import{d as y,B as A,W as b,J as g,e as h,c as w,g as a,h as C,u as k,o as v,j as u,k as e,I as B,C as r,y as I,K as E,L as l,Y as K}from"./index-Bp1Bhxow.js";import{_ as N}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-B37AUkYO.js";import{u as P}from"./usePageTitle-CccNdtFw.js";import{u as T}from"./usePrefectApi-CTi5F9jI.js";const j=y({__name:"AutomationEdit",async setup(U){let o,m;const i=T(),c=A(),_=k(),p=b("automationId"),s=([o,m]=g(()=>i.automations.getAutomation(p.value)),o=await o,m(),o);P(`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=K(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(E),{crumbs:f.value},{actions:a(()=>[u(e(B),{to:e(r).docs.automations},{default:a(()=>t[0]||(t[0]=[I(" Documentation ")])),_:1},8,["to"])]),_:1},8,["crumbs"])]),default:a(()=>[u(N,{automation:e(s),editing:"",onSubmit:x},null,8,["automation"])]),_:1})}}});export{j as default};
//# sourceMappingURL=AutomationEdit-DrbUsRWN.js.map
