import{d as f,ez as y,J as b,b as D,c as w,u as _}from"./outputWidgets.1f391ab3.js";import{e as g,a as k,b as C}from"./icons.35fd2af6.js";import{a as v}from"./asyncComputed.56fb497e.js";import{D as d}from"./dashes.2f4042ed.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.fc3376a4.js";import{a as I}from"./ant-design.080bc381.js";import"./activeRecord.b9964a93.js";import"./pubsub.ab26e051.js";import"./index.a24e4cfd.js";import"./index.6e066317.js";import"./Title.e19c9b7e.js";import"./Form.d88e907e.js";import"./index.06f9a351.js";import"./index.72e9f57c.js";import"./index.d09067f1.js";import"./index.f0baefdd.js";import"./index.beaf06d8.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]="be742ba7-4978-46f2-920e-a6a597166ac0",o._sentryDebugIdIdentifier="sentry-dbid-be742ba7-4978-46f2-920e-a6a597166ac0")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:c}=v(()=>d.list()),l=({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()},m=async()=>{const e=await d.create();l({key:e.path})},u=async({key:e})=>{var a,t;await I("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:"Actions",align:"right"}],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:l},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:_(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{q as default};
//# sourceMappingURL=Dashes.6cb7398a.js.map
