import{d as A,V as y,W as b,H as g,g as h,c as w,h as a,i as C,u as k,o as v,j as u,k as e,C as P,D as r,z as V,Z as I,P as l,I as z}from"./index-B5elPXvm.js";import{_ as B}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-CHruohWI.js";import{u as D}from"./usePageTitle-c6xxeh_y.js";import{u as E}from"./usePrefectApi-O69LXciO.js";import"./mapper-BEeEYyEZ.js";import"./api-DwFTsYIm.js";const F=A({__name:"AutomationEdit",async setup(N){let o,m;const i=E(),c=y(),_=k(),p=b("automationId"),s=([o,m]=g(()=>i.automations.getAutomation(p.value)),o=await o,m(),o);D(`Edit Automation: ${s.name}`);const f=h(()=>[{text:"Automations",to:c.automations()},{text:s.name}]);async function x(d){try{await i.automations.updateAutomation(p.value,d),l(r.success.automationUpdate),_.push(c.automations())}catch(t){console.error(t);const n=z(t,r.error.automationUpdate);l(n,"error",{timeout:!1})}}return(d,t)=>{const n=C("p-layout-default");return v(),w(n,{class:"workspace-automation-create"},{header:a(()=>[u(e(I),{crumbs:f.value},{actions:a(()=>[u(e(P),{to:e(r).docs.automations},{default:a(()=>t[0]||(t[0]=[V(" Documentation ")])),_:1},8,["to"])]),_:1},8,["crumbs"])]),default:a(()=>[u(B,{automation:e(s),editing:"",onSubmit:x},null,8,["automation"])]),_:1})}}});export{F as default};
//# sourceMappingURL=AutomationEdit-Bq9C2oKh.js.map
