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