import{d as C,B as D,W as F,b as N,e as n,c as _,f as e,a as T,g as s,u as V,o as l,j as a,k as o,F as I,m as K,K as P,l as d,p as U,t as W,n as j,q,v as w,x as E,y as L}from"./index-BrFqolpA.js";import{u as R}from"./usePageTitle-CsnULHHx.js";import{u as S}from"./usePrefectApi-Q0V-aAwL.js";const $={class:"automation-card__label"},M=C({__name:"Automation",setup(z){const c=D(),f=V(),v=S(),g=F("automationId"),i=N(v.automations.getAutomation,[g]),t=n(()=>i.response),y=n(()=>{var u;return((u=t.value)==null?void 0:u.name)??""}),b=n(()=>[{text:"Automations",to:c.automations()},{text:y.value}]),k=n(()=>t.value?`Automation: ${t.value.name}`:"Automation");R(k);function A(){f.push(c.automations())}return(u,m)=>{const x=s("p-key-value"),r=s("p-content"),B=s("p-card"),h=s("p-layout-default");return t.value?(l(),_(h,{key:0,class:"automation"},{header:e(()=>[a(o(P),{crumbs:b.value},{actions:e(()=>[a(o(I),{automation:t.value,onUpdate:o(i).refresh},null,8,["automation","onUpdate"]),a(o(K),{automation:t.value,onDelete:A},null,8,["automation"])]),_:1},8,["crumbs"])]),default:e(()=>[a(r,null,{default:e(()=>[a(x,{label:"Description",value:t.value.description},null,8,["value"]),a(r,{secondary:""},{default:e(()=>[m[0]||(m[0]=d("span",{class:"automation-card__label"},"Trigger",-1)),a(o(U),{trigger:t.value.trigger},null,8,["trigger"])]),_:1}),a(r,{secondary:""},{default:e(()=>[d("span",$,W(o(j)("Action",t.value.actions.length)),1),(l(!0),q(E,null,w(t.value.actions,p=>(l(),_(B,{key:p.id},{default:e(()=>[a(o(L),{action:p},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})):T("",!0)}}});export{M as default};
//# sourceMappingURL=Automation-Djqk4BAB.js.map
