import{d as B,V as C,W as D,f as U,g as n,c as _,h as e,a as N,i as s,u as T,o as l,j as a,k as o,U as w,m as F,Z as I,n as d,p as P,t as W,q as Z,v as j,x as q,F as E,y as L}from"./index-B5elPXvm.js";import{u as R}from"./usePageTitle-c6xxeh_y.js";import{u as S}from"./usePrefectApi-O69LXciO.js";import"./api-DwFTsYIm.js";import"./mapper-BEeEYyEZ.js";const $={class:"automation-card__label"},O=B({__name:"Automation",setup(z){const c=C(),f=T(),v=S(),g=D("automationId"),i=U(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 h=s("p-key-value"),r=s("p-content"),x=s("p-card"),V=s("p-layout-default");return t.value?(l(),_(V,{key:0,class:"automation"},{header:e(()=>[a(o(I),{crumbs:b.value},{actions:e(()=>[a(o(w),{automation:t.value,onUpdate:o(i).refresh},null,8,["automation","onUpdate"]),a(o(F),{automation:t.value,onDelete:A},null,8,["automation"])]),_:1},8,["crumbs"])]),default:e(()=>[a(r,null,{default:e(()=>[a(h,{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(P),{trigger:t.value.trigger},null,8,["trigger"])]),_:1}),a(r,{secondary:""},{default:e(()=>[d("span",$,W(o(Z)("Action",t.value.actions.length)),1),(l(!0),j(E,null,q(t.value.actions,p=>(l(),_(x,{key:p.id},{default:e(()=>[a(o(L),{action:p},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})):N("",!0)}}});export{O as default};
//# sourceMappingURL=Automation-CZ8PKIFg.js.map
