import{d as f,ex as b,H as y,b as D,c as _,u as w}from"./registerWidgets.faec4901.js";import{e as g,a as k,b as C}from"./icons.4b27c20b.js";import{a as x}from"./asyncComputed.04758d6d.js";import{D as l}from"./dashes.ee327d44.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.3dfdcdc3.js";import"./activeRecord.64153c3d.js";import"./pubsub.c32c984e.js";import"./index.dabe2e32.js";import"./Modal.c4a3eb37.js";import"./Title.38629c7e.js";import"./transButton.389d0ba4.js";import"./index.bd454869.js";import"./Text.8913855c.js";import"./index.353431e1.js";import"./index.da74220a.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]="e9a1ff43-103a-46ba-b318-dfe6c4d0c1bc",o._sentryDebugIdIdentifier="sentry-dbid-e9a1ff43-103a-46ba-b318-dfe6c4d0c1bc")}catch{}})();const j=f({__name:"Dashes",setup(o){const s=b(),{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=y(()=>{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.607b04b8.js.map
