import{d as f,ex as y,H as b,b as D,c as _,u as w}from"./registerWidgets.d207d3d8.js";import{e as g,a as k,b as C}from"./icons.4cf3c6e7.js";import{a as x}from"./asyncComputed.9245c077.js";import{D as l}from"./dashes.e3e34823.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.892f2f1d.js";import"./activeRecord.3ac0bec0.js";import"./pubsub.a025efb1.js";import"./index.4ee96554.js";import"./Modal.c3922cf6.js";import"./Title.db9c20f2.js";import"./transButton.c5e342ac.js";import"./index.ed3f099d.js";import"./Text.df3bd99f.js";import"./index.a3599972.js";import"./index.ce572c42.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]="2c27675f-fa0d-4f65-8c41-0450960bbaec",o._sentryDebugIdIdentifier="sentry-dbid-2c27675f-fa0d-4f65-8c41-0450960bbaec")}catch{}})();const j=f({__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}}),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()),c()},u=async()=>{const e=await l.create();d({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()),c())},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:d},{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.54d0daf4.js.map
