import{d as h,ez as y,J as b,b as D,c as w,u as g}from"./outputWidgets.800838e3.js";import{e as _,a as C,b as k}from"./icons.93f59c4e.js";import{a as v}from"./asyncComputed.982dc1f5.js";import{D as c}from"./dashes.b53773aa.js";import{C as x}from"./CrudView.b259bd34.js";import{a as I}from"./ant-design.74cbd470.js";import"./activeRecord.9d8d542d.js";import"./pubsub.3b460539.js";import"./index.cc2e9ddf.js";import"./index.e0615505.js";import"./Title.28613ffd.js";import"./Form.b8148ab8.js";import"./router.ba9fc25a.js";import"./url.e7bb6b8a.js";import"./index.9edddcd4.js";import"./index.70fbd67e.js";import"./index.c4440e89.js";import"./index.960544fb.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="69f2d071-fef5-4e10-9502-4039e93f3ffd",o._sentryDebugIdIdentifier="sentry-dbid-69f2d071-fef5-4e10-9502-4039e93f3ffd")}catch{}})();const q=h({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:d}=v(()=>c.list()),l=({key:e})=>s.push({name:"dashEditor",params:{dashPath:e}}),p=async({key:e})=>{var a,t;await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.duplicate()),d()},u=async()=>{const e=await c.create();l({key:e.path})},m=async({key:e})=>{var a,t;await I("Are you sure you want to delete this dash?")&&(await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.delete()),d())},f=b(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:l},{icon:C,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:g(r),title:"Python Dashes",description:"Create a dashboard page with charts and inputs interacting with your python code.","create-button-text":"Create Dash","empty-title":"No dashes here yet","video-url":"https://www.youtube.com/embed/oYMptrk7QNE",table:f.value,"entity-name":"Dash",onCreate:u},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Dashes.6fe65c80.js.map
