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