import{d as S,aE as h,R as k,c as l,B as C,G as E,_ as F,o as u,g as D,O as H,h as o,u as e,aF as M,P as N,s as y,V as P,S as $,a as q,M as G,T as L,E as O,aG as U,aH as J,b as R,e as f,w as n,aI as K,f as w,aJ as Y,aK as j,aL as z,ab as A}from"./index-562c8470.js";import{s as Q,a as W}from"./index-d6eb1d44.js";import{u as X}from"./usePageTitle-ad3dbf10.js";const Z={class:"flow-stats"},ee={class:"flow-stats__cards"},se=S({__name:"FlowStats",props:{flowId:{}},setup(_){const d=_,{flowId:r}=h(d),t=k("span",$,W*24),c=l(()=>({flowId:r.value,timeSpanInSeconds:t.value}));C(E,{interval:Q(30)});const a=l(()=>F.map("FlowStatsFilter",c.value,"FlowRunsFilter")),p=l(()=>F.map("FlowStatsFilter",c.value,"TaskRunsFilter"));return(m,i)=>(u(),D("div",Z,[H("div",ee,[o(e(M),{filter:a.value},null,8,["filter"]),o(e(N),{filter:p.value},null,8,["filter"])]),o(e(P),{selected:e(t),"onUpdate:selected":i[0]||(i[0]=s=>y(t)?t.value=s:null),small:""},null,8,["selected"])]))}});const ne=S({__name:"Flow",setup(_){const d=q(),r=G("flowId"),t=l(()=>[r.value]),c=L(),a=k("tab","Runs"),p=["Runs","Deployments","Details"],m={interval:3e5},i=O(d.flows.getFlow,[r.value],m),s=l(()=>i.response),{filter:I}=U({flows:{id:t}}),{filter:b}=J({flows:{id:t}});function x(){c.push(A.flows())}const B=l(()=>s.value?`Flow: ${s.value.name}`:"Flow");return X(B),(te,v)=>{const T=R("p-tabs"),V=R("p-layout-default");return u(),f(V,{class:"flow"},{header:n(()=>[s.value?(u(),f(e(K),{key:0,flow:s.value,onDelete:x},null,8,["flow"])):w("",!0)]),default:n(()=>[s.value?(u(),f(se,{key:0,"flow-id":s.value.id},null,8,["flow-id"])):w("",!0),o(T,{selected:e(a),"onUpdate:selected":v[0]||(v[0]=g=>y(a)?a.value=g:null),tabs:p},{details:n(()=>[s.value?(u(),f(e(Y),{key:0,flow:s.value},null,8,["flow"])):w("",!0)]),deployments:n(()=>[o(e(j),{filter:e(b)},null,8,["filter"])]),runs:n(()=>[o(e(z),{"flow-run-filter":e(I)},null,8,["flow-run-filter"])]),_:1},8,["selected"])]),_:1})}}});export{ne as default};
