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