import{d as b,h as A,k as r,o as s,c,j as o,l as t,q as m,m as e,B as C,v,n as j,p as O,y as d,a as h,Z as T,C as U,z as $,F as k,A as q,t as z,i as y,D as E,E as F,G as I,K,H as S,I as Z}from"./index-DgpKcZLs.js";import{u as w}from"./usePageTitle-CgS480GG.js";import{u as G}from"./usePrefectApi-IV1ENcLN.js";const H={class:"automation-card__header"},L={class:"automation-card__header-actions"},W={key:0,class:"automation-card__description"},J={class:"automation-card__label"},M=b({__name:"AutomationCard",props:{automation:{}},emits:["update"],setup(B,{emit:p}){const l=p,_=A();return(a,n)=>{const f=r("p-link"),u=r("p-content"),g=r("p-card");return s(),c(g,{class:"automation-card"},{default:o(()=>[t(u,null,{default:o(()=>[t(u,{secondary:""},{default:o(()=>[m("div",H,[t(f,{class:"automation-card__name",to:e(_).automation(a.automation.id)},{default:o(()=>[C(v(a.automation.name),1)]),_:1},8,["to"]),m("div",L,[t(e(j),{automation:a.automation,onUpdate:n[0]||(n[0]=i=>l("update"))},null,8,["automation"]),t(e(O),{automation:a.automation,onDelete:n[1]||(n[1]=i=>l("update"))},null,8,["automation"])])]),a.automation.description?(s(),d("p",W,v(a.automation.description),1)):h("",!0)]),_:1}),t(u,{secondary:""},{default:o(()=>[n[2]||(n[2]=m("span",{class:"automation-card__label"},"Trigger",-1)),t(e(T),{trigger:a.automation.trigger},null,8,["trigger"])]),_:1}),t(u,{secondary:""},{default:o(()=>[m("span",J,v(e(U)("Action",a.automation.actions.length)),1),(s(!0),d(k,null,$(a.automation.actions,i=>(s(),c(g,{key:i.id},{default:o(()=>[t(e(q),{action:i},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})}}}),Y=b({__name:"Automations",setup(B){const p=A();w("Automations");const l=[{text:"Automations"}],_=G(),a=z(_.automations.getAutomations),n=y(()=>a.response??[]),f=y(()=>a.executed),u=y(()=>n.value.length===0);return(g,i)=>{const D=r("p-button"),N=r("p-virtual-scroller"),P=r("p-layout-default");return s(),c(P,{class:"automations"},{header:o(()=>[t(e(K),{crumbs:l},E({"after-crumbs":o(()=>[t(D,{size:"sm",icon:"PlusIcon",to:e(p).automationCreate()},null,8,["to"])]),_:2},[u.value?void 0:{name:"actions",fn:o(()=>[t(e(F),{to:e(I).docs.automations},{default:o(()=>i[0]||(i[0]=[C(" Documentation ")])),_:1},8,["to"])]),key:"0"}]),1024)]),default:o(()=>[f.value?(s(),d(k,{key:0},[u.value?(s(),c(e(S),{key:0})):(s(),d(k,{key:1},[t(e(Z),{count:n.value.length,label:"automation"},null,8,["count"]),t(N,{items:n.value,class:"automations-list"},{default:o(({item:V})=>[t(M,{automation:V,onUpdate:e(a).refresh},null,8,["automation","onUpdate"])]),_:1},8,["items"])],64))],64)):h("",!0)]),_:1})}}});export{Y as default};
//# sourceMappingURL=Automations-BGTCNyL4.js.map
