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