import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.8a1294ac.js";import{e as _,a as C,b as k}from"./icons.25b21aee.js";import{a as v}from"./asyncComputed.3699cd44.js";import{D as l}from"./dashes.20f3fde0.js";import{C as x}from"./CrudView.707fb9d1.js";import{a as I}from"./ant-design.8f569ff8.js";import"./activeRecord.4f50a80e.js";import"./pubsub.5ff7800d.js";import"./runnerData.9cd8b9cf.js";import"./index.21148e20.js";import"./Title.c5e29cf7.js";import"./Form.1860c0ed.js";import"./router.e765b2a2.js";import"./index.04ab96ef.js";import"./url.9a5c0e6d.js";import"./index.d5d7d1dc.js";import"./index.4fc6eb1b.js";import"./index.91683b65.js";import"./index.bf7f5369.js";import"./index.0f4f2049.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]="ce8ae5f9-9e60-4be4-92e6-2ac8d291d96b",o._sentryDebugIdIdentifier="sentry-dbid-ce8ae5f9-9e60-4be4-92e6-2ac8d291d96b")}catch{}})();const J=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:i,refetch:d}=v(()=>l.list()),c=({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()),d()},m=async()=>{const e=await l.create();c({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()),d())},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:c},{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.f55f6135.js.map
