import{d as y,i as m,h as o,o as u,m as V,O as b,n as d,u as a,ag as q,ah as z,ai as D,_ as L,U as M,M as O,aj as $,ak as G,al as J,I as Y,am as H,an as K,ao as Q,ap as W,aq as X,k as _,c as r,l as n,ar as Z,a as f,as as ee,at as ae,au as le,av as se,aw as te,ax as ne,ay as oe,A as ue,af as h,az as re}from"./index-gULJbqdd.js";import{u as fe}from"./usePageTitle-HrbxxOEb.js";const pe={class:"flow-run-graphs__graphs"},ce={class:"flow-run-graphs__panel p-background"},de=y({__name:"FlowRunGraphs",props:{flowRun:{}},setup(k){const c=m(),p=m(!1),e=m(null),i=o(()=>({root:{"flow-run-graphs--fullscreen":p.value,"flow-run-graphs--show-panel":!!e.value}}));return(v,t)=>(u(),V("div",{class:D(["flow-run-graphs",i.value.root])},[b("div",pe,[d(a(q),{fullscreen:p.value,"onUpdate:fullscreen":t[0]||(t[0]=s=>p.value=s),viewport:c.value,"onUpdate:viewport":t[1]||(t[1]=s=>c.value=s),selected:e.value,"onUpdate:selected":t[2]||(t[2]=s=>e.value=s),"flow-run":v.flowRun,class:"flow-run-graphs__flow-run"},null,8,["fullscreen","viewport","selected","flow-run"])]),b("div",ce,[d(a(z),{node:e.value,"onUpdate:node":t[3]||(t[3]=s=>e.value=s),floating:p.value},null,8,["node","floating"])])],2))}}),ve=y({__name:"FlowRun",setup(k){const c=L(),p=M("flowRunId");O();const{flowRun:e,subscription:i}=$(p,{interval:5e3}),v=o(()=>{var l;return(l=e.value)==null?void 0:l.deploymentId}),{deployment:t}=G(v),s=o(()=>{var l;return(l=e.value)!=null&&l.stateType?J(e.value.stateType):!0}),F=o(()=>[{label:"Logs"},{label:"Task Runs",hidden:s.value},{label:"Subflow Runs",hidden:s.value},{label:"Results",hidden:s.value},{label:"Artifacts",hidden:s.value},{label:"Details"},{label:"Parameters"}]),w=Y("tab","Logs"),{tabs:I}=H(F,w),T=o(()=>{var l;return((l=e.value)==null?void 0:l.parameters)??{}}),x=o(()=>{var l;return((l=t.value)==null?void 0:l.parameterOpenApiSchema)??{}}),g=o(()=>K(T.value,x.value)),U=o(()=>[p.value]),{filter:S}=Q({flowRuns:{parentFlowRunId:U}});function B(){c.push(h.flowRuns())}const C=o(()=>{var l;return(l=e.value)==null?void 0:l.stateType});W(C);const A=o(()=>e.value?`Flow Run: ${e.value.name}`:"Flow Run");return fe(A),X(()=>{i.error&&re(i.error).isInRange("clientError")&&c.replace(h[404]())}),(l,R)=>{const N=_("p-code-highlight"),P=_("p-tabs"),j=_("p-layout-default");return u(),r(j,{class:"flow-run"},{header:n(()=>[a(e)?(u(),r(a(Z),{key:0,"flow-run-id":a(e).id,onDelete:B},null,8,["flow-run-id"])):f("",!0)]),default:n(()=>[a(e)&&!s.value?(u(),r(de,{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0),d(P,{selected:a(w),"onUpdate:selected":R[0]||(R[0]=E=>ue(w)?w.value=E:null),tabs:a(I)},{details:n(()=>[a(e)?(u(),r(a(ee),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),logs:n(()=>[a(e)?(u(),r(a(ae),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),results:n(()=>[a(e)?(u(),r(a(le),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),artifacts:n(()=>[a(e)?(u(),r(a(se),{key:0,"flow-run":a(e)},null,8,["flow-run"])):f("",!0)]),"task-runs":n(()=>[a(e)?(u(),r(a(te),{key:0,"flow-run-id":a(e).id},null,8,["flow-run-id"])):f("",!0)]),"subflow-runs":n(()=>[d(a(ne),{filter:a(S)},null,8,["filter"])]),parameters:n(()=>[a(e)?(u(),r(a(oe),{key:0,"text-to-copy":g.value},{default:n(()=>[d(N,{lang:"json",text:g.value,class:"flow-run__parameters"},null,8,["text"])]),_:1},8,["text-to-copy"])):f("",!0)]),_:1},8,["selected","tabs"])]),_:1})}}});export{ve as default};
