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