import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.a8447bcb.js";import{e as _,a as C,b as k}from"./icons.6de7af10.js";import{a as v}from"./asyncComputed.6c2627ea.js";import{D as p}from"./dashes.d6e52b47.js";import{C as x}from"./CrudView.996cd8b2.js";import{a as I}from"./ant-design.1bcd10c9.js";import"./activeRecord.52c1b6f8.js";import"./pubsub.3b516de1.js";import"./runnerData.64650392.js";import"./Text.722e2789.js";import"./Title.4127a4b4.js";import"./transButton.26020e2e.js";import"./router.8be149da.js";import"./Form.a869b3cf.js";import"./index.41d49230.js";import"./url.0a1547fb.js";import"./index.ee9a096e.js";import"./index.c058ebd2.js";import"./index.823e1eed.js";import"./index.71f713cd.js";import"./index.5fa32c06.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[i]="68daf0cf-db0f-4307-acf8-911d1b775025",o._sentryDebugIdIdentifier="sentry-dbid-68daf0cf-db0f-4307-acf8-911d1b775025")}catch{}})();const K=f({__name:"Dashes",setup(o){const i=y(),{loading:r,result:s,refetch:d}=v(()=>p.list()),c=({key:t})=>i.push({name:"dashEditor",params:{dashPath:t}}),l=async({key:t})=>{var a,e;await((e=(a=s.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.duplicate()),d()},m=async()=>{const t=await p.create();c({key:t.path})},u=async({key:t})=>{var a,e;await I("Are you sure you want to delete this dash?")&&(await((e=(a=s.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.delete()),d())},h=b(()=>{var t,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=s.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:c},{icon:C,label:"Duplicate",onClick:l},{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{K as default};
//# sourceMappingURL=Dashes.544c3145.js.map
