import{d as f,ex as y,H as b,b as D,c as _,u as w}from"./registerWidgets.ca57da3e.js";import{e as g,a as k,b as C}from"./icons.1efe7950.js";import{a as x}from"./asyncComputed.ae0b6a3c.js";import{D as l}from"./dashes.8ed8444a.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.7b5510ae.js";import"./activeRecord.f8743cd4.js";import"./pubsub.277d05a3.js";import"./index.56c756a6.js";import"./Modal.db45c3f3.js";import"./Title.e5d7f1b0.js";import"./transButton.a2961478.js";import"./index.b0c465bd.js";import"./Text.1f2709b6.js";import"./index.e15362b2.js";import"./index.9943ced7.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]="68eadd9d-0fd8-40fc-94ae-ae3d389264eb",o._sentryDebugIdIdentifier="sentry-dbid-68eadd9d-0fd8-40fc-94ae-ae3d389264eb")}catch{}})();const j=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:d}=x(()=>l.list()),c=({key:e})=>s.push({name:"dashEditor",params:{dashPath:e}}),p=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()),d()},u=async()=>{const e=await l.create();c({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()),d())},h=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,link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:g,label:"Edit Dash",onClick:c},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),_(v,{loading:w(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:u},null,8,["loading","table"]))}});export{j as default};
//# sourceMappingURL=Dashes.925cb362.js.map
