import{d as b,ez as f,J as y,b as D,c as w,u as g}from"./outputWidgets.9b7c29ed.js";import{e as _,a as C,b as k}from"./icons.7c250a15.js";import{a as v}from"./asyncComputed.6a414bed.js";import{D as l}from"./dashes.920727b6.js";import{C as x}from"./CrudView.73bf57c7.js";import{a as I}from"./ant-design.9b0f163e.js";import"./activeRecord.264ba54c.js";import"./pubsub.f1df5000.js";import"./index.31be9da9.js";import"./index.ddedd1b8.js";import"./Title.55bc3e25.js";import"./Form.77e50956.js";import"./router.a8553211.js";import"./url.c61c9940.js";import"./index.5695780b.js";import"./index.d8ed1958.js";import"./index.817f3ac7.js";import"./index.316bc1ac.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]="d8a217b9-5bb5-4746-a513-b03cbbe0a6ca",o._sentryDebugIdIdentifier="sentry-dbid-d8a217b9-5bb5-4746-a513-b03cbbe0a6ca")}catch{}})();const q=b({__name:"Dashes",setup(o){const s=f(),{loading:r,result:n,refetch:c}=v(()=>l.list()),d=({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()),c()},u=async()=>{const e=await l.create();d({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()),c())},h=y(()=>{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:d},{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:h.value,"entity-name":"Dash",onCreate:u},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Dashes.68c95d8f.js.map
