import{d as h,u as T,r as x,e as l,a as C,b as D,I as L,J as N,g as c,o as t,h as u,w as n,j as e,K as S,s as o,L as _,i as p,M as P,N as B,O as I,Q as J,n as O,G as V}from"./index.ace9693c.js";import{u as j}from"./useRouteParam.1483cbc1.js";import{u as q}from"./usePageTitle.12638eb5.js";const Q=h({__name:"FlowRun",setup(A){const w=T(),i=x("Logs"),f=j("id"),m=l(()=>{const a=["Logs","Task Runs","Subflow Runs","Parameters"];return O.xl||a.push("Details"),a}),d=C(),v=D(d.flowRuns.getFlowRun,[f],{interval:5e3}),s=l(()=>v.response);L(f,(a,r)=>{a!==r&&(i.value="Logs")});const R=l(()=>{var a;return(a=s.value)!=null&&a.parameters?JSON.stringify(s.value.parameters,void 0,2):"{}"});function y(){w.push(V.flowRuns())}const b=l(()=>{var a;return(a=s.value)==null?void 0:a.stateType});N(b);const k=l(()=>s.value?`Flow Run: ${s.value.name}`:"Flow Run");return q(k),(a,r)=>{const g=c("p-tabs"),F=c("p-layout-well");return t(),u(F,{class:"flow-run"},{header:n(()=>[e(s)?(t(),u(e(S),{key:0,"flow-run":e(s),onDelete:y},null,8,["flow-run"])):o("",!0)]),well:n(()=>[e(s)?(t(),u(e(_),{key:0,"flow-run":e(s),alternate:""},null,8,["flow-run"])):o("",!0)]),default:n(()=>[p(g,{selected:i.value,"onUpdate:selected":r[0]||(r[0]=$=>i.value=$),tabs:e(m)},{details:n(()=>[e(s)?(t(),u(e(_),{key:0,"flow-run":e(s)},null,8,["flow-run"])):o("",!0)]),logs:n(()=>[e(s)?(t(),u(e(P),{key:0,"flow-run":e(s)},null,8,["flow-run"])):o("",!0)]),"task-runs":n(()=>[e(s)?(t(),u(e(B),{key:0,"flow-run-id":e(s).id},null,8,["flow-run-id"])):o("",!0)]),"subflow-runs":n(()=>[e(s)?(t(),u(e(I),{key:0,"flow-run-id":e(s).id},null,8,["flow-run-id"])):o("",!0)]),parameters:n(()=>[p(e(J),{value:e(R)},null,8,["value"])]),_:1},8,["selected","tabs"])]),_:1})}}});export{Q as default};
