import{d as m,ex as y,F as b,b as D,u as w,bu as g}from"./registerWidgets.2d3a9fa1.js";import{e as _,f as k,g as C}from"./icons.ef35efa7.js";import{a as x}from"./asyncComputed.da67dddd.js";import{D as l}from"./dashes.405c95fd.js";import{R as v}from"./RuntimeList.82829d0e.js";import"./activeRecord.85525a95.js";import"./pubsub.f5cc447b.js";import"./index.1a3a4850.js";import"./DropdownMenu.1c4bd517.js";import"./CircularLoading.7f8cdc69.js";import"./lottie.8f8e4fb5.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]="8855742e-4f49-4f0f-be79-cf364f887d47",o._sentryDebugIdIdentifier="sentry-dbid-8855742e-4f49-4f0f-be79-cf364f887d47")}catch{}})();const Q=m({__name:"Dashes",setup(o){const s=y(),{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())},f=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(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:f.value,onCreate:p},null,8,["loading","table"]))}});export{Q as default};
//# sourceMappingURL=Dashes.08fa2dd3.js.map
