import{d as f,J as y,L as b,b as D,u as w,A as g}from"./registerWidgets.163fba07.js";import{e as _,f as k,g as C}from"./icons.89f10f59.js";import{a as v}from"./asyncComputed.5f7867b2.js";import{D as l}from"./dashes.3e49528a.js";import{R as x}from"./RuntimeList.d11aea7e.js";import"./activeRecord.b56127d8.js";import"./pubsub.2d612358.js";import"./index.0f874dbb.js";import"./DropdownMenu.8ad1467e.js";import"./CircularLoading.926802eb.js";import"./lottie.981a9cff.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]="fd2617ae-5393-4997-a2c1-86000629506d",o._sentryDebugIdIdentifier="sentry-dbid-fd2617ae-5393-4997-a2c1-86000629506d")}catch{}})();const Q=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:c}=v(()=>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=b(()=>{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(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:m.value,onCreate:p},null,8,["loading","table"]))}});export{Q as default};
//# sourceMappingURL=Dashes.1c438dbd.js.map
