import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.d5738148.js";import{e as _,a as C,b as k}from"./icons.fc57d5d6.js";import{a as v}from"./asyncComputed.5b25749a.js";import{D as l}from"./dashes.2209d5c8.js";import{C as x}from"./CrudView.1762d1c1.js";import{a as I}from"./ant-design.5238fdc0.js";import"./activeRecord.bb15dfc5.js";import"./pubsub.601f5d35.js";import"./runnerData.25a438f3.js";import"./index.a6d8d08b.js";import"./Title.69748959.js";import"./Form.45dee1c8.js";import"./router.6dfa30a6.js";import"./index.f7210413.js";import"./url.d1f492ee.js";import"./index.faad752e.js";import"./index.f9a2f10c.js";import"./index.2791d1cb.js";import"./index.3bddf189.js";import"./index.ffe76733.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]="c164a8fd-eb01-45a8-99f0-205829ec8a60",o._sentryDebugIdIdentifier="sentry-dbid-c164a8fd-eb01-45a8-99f0-205829ec8a60")}catch{}})();const J=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:i,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=i.value)==null?void 0:a.find(n=>n.path===e))==null?void 0:t.duplicate()),c()},m=async()=>{const e=await l.create();d({key:e.path})},u=async({key:e})=>{var a,t;await I("Are you sure you want to delete this dash?")&&(await((t=(a=i.value)==null?void 0:a.find(n=>n.path===e))==null?void 0:t.delete()),c())},h=b(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=i.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:u,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:m},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Dashes.58423c28.js.map
