import{d as F,r as h,c as u,o as s,k as V,L as y,m as w,g as l,_ as Z,$ as R,a0 as $,B as j,E as q,v as A,R as G,a1 as O,a2 as U,q as Y,a3 as z,a4 as K,a5 as Q,a6 as W,a as b,e as n,w as t,a7 as H,i as o,a8 as M,a9 as X,aa as ee,ab as ae,ac as le,ad as se,ae as ne,x as te,Z as x,af as ue}from"./index-a91efef8.js";import{u as oe}from"./usePageTitle-6b86fe3b.js";const re={class:"flow-run-graphs__panel-content"},ce=F({__name:"FlowRunGraphs",props:{flowRun:{}},setup(T){const p=h(!1),f=h(null),i=h(!1),c=u(()=>({root:{"flow-run-graphs--fullscreen":p.value},graph:{"flow-run-graphs__graphs--panel-open":i.value},panel:{"flow-run-graphs__panel-container--panel-open":i.value}}));function e(d){f.value=d,i.value=!!d}function m(){i.value=!1}return(d,r)=>(s(),V("div",{class:R(["flow-run-graphs",c.value.root])},[y("div",{class:R(["flow-run-graphs__graphs",c.value.graph])},[w(l(Z),{class:"flow-run-graphs__timeline","flow-run":d.flowRun,height:"340px","selected-node":f.value,onSelection:e,"onUpdate:fullscreen":r[0]||(r[0]=g=>p.value=g)},null,8,["flow-run","selected-node"])],2),y("div",{class:R(["flow-run-graphs__panel-container",c.value.panel])},[y("div",re,[w(l($),{"selected-node":f.value,floating:p.value,onDismiss:m},null,8,["selected-node","floating"])])],2)],2))}});const ie=F({__name:"FlowRun",setup(T){const p=j(),f=q("flowRunId"),i=A(),c=G(i.flowRuns.getFlowRun,[f],{interval:5e3}),e=u(()=>c.response),m=u(()=>{var a;return(a=e.value)==null?void 0:a.deploymentId}),{deployment:d}=O(m),r=u(()=>{var a;return(a=e.value)!=null&&a.stateType?U(e.value.stateType):!0}),g=u(()=>[{label:"Logs"},{label:"Task Runs",hidden:r.value},{label:"Subflow Runs",hidden:r.value},{label:"Results",hidden:r.value},{label:"Artifacts",hidden:r.value},{label:"Details"},{label:"Parameters"}]),{tab:v,tabs:I}=Y(g,"Logs");z(f,(a,_)=>{a!==_&&(v.value="Logs")});const B=u(()=>{var a;return((a=e.value)==null?void 0:a.parameters)??{}}),C=u(()=>{var a;return((a=d.value)==null?void 0:a.parameterOpenApiSchema)??{}}),k=u(()=>K(B.value,C.value));function E(){p.push(x.flowRuns())}const N=u(()=>{var a;return(a=e.value)==null?void 0:a.stateType});Q(N);const P=u(()=>e.value?`Flow Run: ${e.value.name}`:"Flow Run");return oe(P),W(()=>{c.error&&ue(c.error).isInRange("clientError")&&p.replace(x[404]())}),(a,_)=>{const S=b("p-code-highlight"),D=b("p-tabs"),L=b("p-layout-default");return s(),n(L,{class:"flow-run"},{header:t(()=>[e.value?(s(),n(l(H),{key:0,"flow-run-id":e.value.id,onDelete:E},null,8,["flow-run-id"])):o("",!0)]),default:t(()=>[e.value&&!r.value?(s(),n(ce,{key:0,"flow-run":e.value},null,8,["flow-run"])):o("",!0),w(D,{selected:l(v),"onUpdate:selected":_[0]||(_[0]=J=>te(v)?v.value=J:null),tabs:l(I)},{details:t(()=>[e.value?(s(),n(l(M),{key:0,"flow-run":e.value},null,8,["flow-run"])):o("",!0)]),logs:t(()=>[e.value?(s(),n(l(X),{key:0,"flow-run":e.value},null,8,["flow-run"])):o("",!0)]),results:t(()=>[e.value?(s(),n(l(ee),{key:0,"flow-run":e.value},null,8,["flow-run"])):o("",!0)]),artifacts:t(()=>[e.value?(s(),n(l(ae),{key:0,"flow-run":e.value},null,8,["flow-run"])):o("",!0)]),"task-runs":t(()=>[e.value?(s(),n(l(le),{key:0,"flow-run-id":e.value.id},null,8,["flow-run-id"])):o("",!0)]),"subflow-runs":t(()=>[e.value?(s(),n(l(se),{key:0,"flow-run-id":e.value.id},null,8,["flow-run-id"])):o("",!0)]),parameters:t(()=>[e.value?(s(),n(l(ne),{key:0,"text-to-copy":k.value},{default:t(()=>[w(S,{lang:"json",text:k.value,class:"flow-run__parameters"},null,8,["text"])]),_:1},8,["text-to-copy"])):o("",!0)]),_:1},8,["selected","tabs"])]),_:1})}}});export{ie as default};
