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