import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.1cf78234.js";import{e as _,a as C,b as k}from"./icons.ba4d43de.js";import{a as v}from"./asyncComputed.513601fc.js";import{D as l}from"./dashes.e131628f.js";import{C as x}from"./CrudView.9f0a1020.js";import{a as I}from"./ant-design.b7f18845.js";import"./activeRecord.1ee4e98a.js";import"./pubsub.a66a61fd.js";import"./runnerData.c735532a.js";import"./index.a7df5fa7.js";import"./Title.a8b8fdd6.js";import"./Form.5fb25f40.js";import"./router.4077f51e.js";import"./index.748edabf.js";import"./url.18ee0e18.js";import"./index.427c7dc5.js";import"./index.4f30f3fe.js";import"./index.960f4655.js";import"./index.7a53699a.js";import"./index.67188546.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]="1783acd1-7611-4231-aaef-9c8dc1397a99",o._sentryDebugIdIdentifier="sentry-dbid-1783acd1-7611-4231-aaef-9c8dc1397a99")}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.4071d888.js.map
