import{d as x,u as N,c as t,a as F,am as T,V as P,e as S,N as V,r,o as a,f as n,w as o,g as e,as as A,h as l,k as c,at as B,au as m,av as D,Z as U,$ as E,B as z,t as I,C as O,ad as Z}from"./index.c3b9a55d.js";import{u as j}from"./useRouteParam.b592fab0.js";import{u as G}from"./useSubscriptionWithDependencies.3dc092ce.js";import{u as H}from"./useToast.c7b792f2.js";const J=E(" No runs from the last 7 days "),ue=x({__name:"WorkQueue",setup(K){const d=N(),f=H(),k=t(()=>{const s=["Upcoming Runs","Runs"];return O.xl||s.unshift("Details"),s}),w=j("id"),h=t(()=>`prefect agent start ${u.value?` --work-queue "${u.value.name}"`:""}`),v={interval:3e5},i=F(T.getWorkQueue,[w.value],v),u=t(()=>i.response),p=t(()=>u.value?[u.value.name]:[]),y=P({states:[],workQueues:p}),b=t(()=>p.value.length?[y.value]:null),Q=G(z.getFlowRuns,b),_=t(()=>{var s;return(s=Q.response)!=null?s:[]}),g=()=>{d.push(I.workQueues())},q=t(()=>u.value?`Work Queue: ${u.value.name}`:"Work Queue");return S(q),V(()=>{var s;return(s=u.value)==null?void 0:s.deprecated},s=>{s&&f(Z.info.deprecatedWorkQueue,"default",{dismissible:!1,timeout:!1})}),(s,L)=>{const R=r("PEmptyResults"),W=r("p-tabs"),$=r("p-layout-well"),C=r("p-layout-default");return a(),n(C,{class:"work-queue"},{header:o(()=>[e(u)?(a(),n(e(A),{key:0,"work-queue":e(u),onUpdate:e(i).refresh,onDelete:g},null,8,["work-queue","onUpdate"])):l("",!0)]),default:o(()=>[c($,{class:"work-queue__body"},{header:o(()=>[c(e(B),{command:e(h),title:"Work queue is ready to go!",subtitle:"Work queues define the work to be done and agents poll a specific work queue for new work."},null,8,["command"])]),well:o(()=>[e(u)?(a(),n(e(m),{key:0,alternate:"","work-queue":e(u)},null,8,["work-queue"])):l("",!0)]),default:o(()=>[c(W,{tabs:e(k)},{details:o(()=>[e(u)?(a(),n(e(m),{key:0,"work-queue":e(u)},null,8,["work-queue"])):l("",!0)]),"upcoming-runs":o(()=>[e(u)?(a(),n(e(D),{key:0,"work-queue":e(u)},null,8,["work-queue"])):l("",!0)]),runs:o(()=>[e(_).length?(a(),n(e(U),{key:0,"flow-runs":e(_),disabled:"",selected:[]},null,8,["flow-runs"])):(a(),n(R,{key:1},{message:o(()=>[J]),_:1}))]),_:1},8,["tabs"])]),_:1})]),_:1})}}});export{ue as default};
