import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.942e04a7.js";import{e as _,a as C,b as k}from"./icons.c37bd5be.js";import{a as v}from"./asyncComputed.581a6d32.js";import{D as l}from"./dashes.6b0715ff.js";import{C as x}from"./CrudView.ef33eac6.js";import{a as I}from"./ant-design.683e844e.js";import"./activeRecord.c49c8827.js";import"./pubsub.c4874b0f.js";import"./runnerData.e597f90f.js";import"./index.a0056785.js";import"./Title.02f374d5.js";import"./Form.fa989528.js";import"./router.88ac172f.js";import"./index.6d3b437a.js";import"./url.c27b4b3f.js";import"./index.afbbab9c.js";import"./index.a1c695e0.js";import"./index.f7b7cb5d.js";import"./index.182b7916.js";import"./index.90e879e1.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]="9cab2931-aba4-43c8-82cd-7027c600f122",o._sentryDebugIdIdentifier="sentry-dbid-9cab2931-aba4-43c8-82cd-7027c600f122")}catch{}})();const J=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:i,refetch:c}=v(()=>l.list()),d=({key:t})=>s.push({name:"dashEditor",params:{dashPath:t}}),p=async({key:t})=>{var a,e;await((e=(a=i.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.duplicate()),c()},m=async()=>{const t=await l.create();d({key:t.path})},u=async({key:t})=>{var a,e;await I("Are you sure you want to delete this dash?")&&(await((e=(a=i.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.delete()),c())},h=b(()=>{var t,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=i.value)==null?void 0:t.map(e=>({key:e.path,cells:[{text:e.title,link:`/_editor/dash/${encodeURIComponent(e.path)}`},{text:e.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:d},{icon:C,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(t,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:m},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Dashes.188149c3.js.map
