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