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