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