import{d as A,B as x,H as h,J as w,c as B,g as s,h as T,u as b,o as k,j as r,k as n,I as P,C as i,y as I,K,L as m,Y as L}from"./index-Bp1Bhxow.js";import{_ as N}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-B37AUkYO.js";import{u as V}from"./usePageTitle-CccNdtFw.js";import{u as Y}from"./usePrefectApi-CTi5F9jI.js";const J=A({__name:"AutomationCreate",async setup(j){let e,u;V("Create Automation");const l=Y(),c=x(),_=b(),f=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:p,getTrigger:g}=h(),d=([e,u]=w(()=>C()),e=await e,u(),e);async function C(){const o={},[t,a]=await Promise.all([g(),p()]);return t&&(o.trigger=t),a&&(o.actions=a),o}async function y(o){try{await l.automations.createAutomation(o),m(i.success.automationCreate),_.push(c.automations())}catch(t){console.error(t);const a=L(t,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(o,t)=>{const a=T("p-layout-default");return k(),B(a,{class:"automation-create"},{header:s(()=>[r(n(K),{crumbs:f},{actions:s(()=>[r(n(P),{to:n(i).docs.automations},{default:s(()=>t[0]||(t[0]=[I(" Documentation ")])),_:1},8,["to"])]),_:1})]),default:s(()=>[r(N,{automation:n(d),onSubmit:y},null,8,["automation"])]),_:1})}}});export{J as default};
//# sourceMappingURL=AutomationCreate-Yb3tHLTr.js.map
