import{d as x,V as y,I as w,J as P,c as b,i as s,j as h,u as T,o as V,k as r,l as n,O as k,G as i,C as B,K,P as m,Z as N}from"./index-BBlvj0M_.js";import{_ as O}from"./AutomationWizard.vue_vue_type_script_setup_true_lang-CeS8t0eN.js";import{u as Z}from"./usePageTitle-lBdMRcrQ.js";import{u as j}from"./usePrefectApi-Boduij1X.js";import"./mapper-DWfgs_2K.js";import"./api-D3LJrWSC.js";const $=x({__name:"AutomationCreate",async setup(v){let e,u;Z("Create Automation");const l=j(),c=y(),p=T(),_=[{text:"Automations",to:c.automations()},{text:"Create"}],{getActions:f,getTrigger:d}=w(),g=([e,u]=P(()=>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 l.automations.createAutomation(o),m(i.success.automationCreate),p.push(c.automations())}catch(t){console.error(t);const a=N(t,i.error.automationCreate);m(a,"error",{timeout:!1})}}return(o,t)=>{const a=h("p-layout-default");return V(),b(a,{class:"automation-create"},{header:s(()=>[r(n(K),{crumbs:_},{actions:s(()=>[r(n(k),{to:n(i).docs.automations},{default:s(()=>t[0]||(t[0]=[B(" Documentation ")])),_:1},8,["to"])]),_:1})]),default:s(()=>[r(O,{automation:n(g),onSubmit:A},null,8,["automation"])]),_:1})}}});export{$ as default};
//# sourceMappingURL=AutomationCreate-Bi5J5Jqa.js.map
