import{d as f,ex as b,F as y,b as D,u as w,bu as g}from"./registerWidgets.92d2f644.js";import{e as _,f as k,g as C}from"./icons.f7e2c66d.js";import{a as x}from"./asyncComputed.969e5e52.js";import{D as l}from"./dashes.d1b5d69d.js";import{R as v}from"./RuntimeList.72cb38fa.js";import"./activeRecord.1a640186.js";import"./pubsub.cabffe13.js";import"./index.75f517f3.js";import"./DropdownMenu.737d17d7.js";import"./CircularLoading.e3659467.js";import"./lottie.8475a642.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]="bf53500a-fc00-442c-9c77-70bdd714fc7c",o._sentryDebugIdIdentifier="sentry-dbid-bf53500a-fc00-442c-9c77-70bdd714fc7c")}catch{}})();const Q=f({__name:"Dashes",setup(o){const s=b(),{loading:r,result:n,refetch:c}=x(()=>l.list()),d=({key:e})=>s.push({name:"dashEditor",params:{dashPath: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()},p=async()=>{const e=await l.create();d({key:e.path})},h=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())},m=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:h,dangerous:!0},{icon:k,label:"Edit Dash",onClick:d},{icon:C,label:"Duplicate",onClick:u}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(v,{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:m.value,onCreate:p},null,8,["loading","table"]))}});export{Q as default};
//# sourceMappingURL=Dashes.eaa3ec0d.js.map
