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