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