import{d as b,B as A,h as r,o as s,c,g as o,j as t,m,k as e,y as h,t as v,D as V,l as P,p as d,a as C,M as T,z as U,x as $,F as k,R as z,b as E,e as y,A as F,I as K,C as M,K as R,E as S,G as j}from"./index-Bp1Bhxow.js";import{u as w}from"./usePageTitle-CccNdtFw.js";import{u as G}from"./usePrefectApi-CTi5F9jI.js";const q={class:"automation-card__header"},H={class:"automation-card__header-actions"},J={key:0,class:"automation-card__description"},O={class:"automation-card__label"},Q=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",q,[t(f,{class:"automation-card__name",to:e(_).automation(a.automation.id)},{default:o(()=>[h(v(a.automation.name),1)]),_:1},8,["to"]),m("div",H,[t(e(V),{automation:a.automation,onUpdate:n[0]||(n[0]=i=>l("update"))},null,8,["automation"]),t(e(P),{automation:a.automation,onDelete:n[1]||(n[1]=i=>l("update"))},null,8,["automation"])])]),a.automation.description?(s(),d("p",J,v(a.automation.description),1)):C("",!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",O,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(z),{action:i},null,8,["action"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})}}}),Z=b({__name:"Automations",setup(B){const p=A();w("Automations");const l=[{text:"Automations"}],_=G(),a=E(_.automations.getAutomations),n=y(()=>a.response??[]),f=y(()=>a.executed),u=y(()=>n.value.length===0);return(g,i)=>{const D=r("p-button"),I=r("p-virtual-scroller"),L=r("p-layout-default");return s(),c(L,{class:"automations"},{header:o(()=>[t(e(R),{crumbs:l},F({"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(K),{to:e(M).docs.automations},{default:o(()=>i[0]||(i[0]=[h(" 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(j),{count:n.value.length,label:"automation"},null,8,["count"]),t(I,{items:n.value,class:"automations-list"},{default:o(({item:N})=>[t(Q,{automation:N,onUpdate:e(a).refresh},null,8,["automation","onUpdate"])]),_:1},8,["items"])],64))],64)):C("",!0)]),_:1})}}});export{Z as default};
//# sourceMappingURL=Automations-B4alRGHi.js.map
