import{d as b,K as y,b as D,t as w,z as d,H as g}from"./registerWidgets.eddc32f4.js";import{f as _,g as k,h as C}from"./icons.54ab2234.js";import{a as I}from"./asyncComputed.562c187e.js";import{D as p}from"./dashes.82e3b02c.js";import{R as x}from"./RuntimeList.368e500b.js";import"./activeRecord.ed4e0294.js";import"./runnerData.cdcfd570.js";import"./DropdownMenu.07e05b99.js";import"./CircularLoading.c96bd1c9.js";import"./lottie.6d443700.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]="b6ea47bf-ee77-4a36-8e6e-be1bf5955725",o._sentryDebugIdIdentifier="sentry-dbid-b6ea47bf-ee77-4a36-8e6e-be1bf5955725")}catch{}})();const z=b({__name:"Dashes",setup(o){const s=g(),{loading:r,result:n,refetch:c}=I(()=>p.list()),l=({key:e})=>s.push({path:`/_editor/dash/${encodeURIComponent(e)}`}),u=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()},h=async()=>{const e=await p.create();l({key:e.path})},m=async({key:e})=>{var a,t;confirm("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())},f=y(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Dash Actions"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,classes:["title","centered"],link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",classes:["centered"],actions:[{icon:_,label:"Delete",onClick:m,dangerous:!0},{icon:k,label:"Edit Dash",onClick:l},{icon:C,label:"Duplicate",onClick:u}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:d(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:d(f),onCreate:h},null,8,["loading","table"]))}});export{z as default};
//# sourceMappingURL=Dashes.a3a5c6fa.js.map
