import{d as O,b as V,M as j,e as n,n as z,g as F,al as J,az as _,ao as L,c as r,i as t,a as c,j as i,a1 as M,o as p,m as u,u as e,aA as q,aB as m,N as E,q as R,aC as P,x as U,h as $,aD as G,aE as H,ax as K,z as Q,ae as W}from"./index-bD6G21oH.js";import{u as X}from"./usePageTitle-27XdpEbQ.js";const ta=O({__name:"TaskRun",setup(Y){const g=M(),k=V("taskRunId"),d=j(),T=n(()=>[{label:"Details",hidden:z.xl},{label:"Logs"},{label:"Artifacts"},{label:"Task Inputs"}]),l=F("tab","Logs"),{tabs:b}=J(T,l),h=n(()=>k.value?[k.value]:null),w=_(d.taskRuns.getTaskRun,h,{interval:3e4}),a=n(()=>w.response),o=n(()=>{var s;return(s=a.value)==null?void 0:s.flowRunId}),y=n(()=>o.value?[o.value]:null),I=_(d.flowRuns.getFlowRun,y),v=n(()=>{var s;return(s=a.value)!=null&&s.taskInputs?JSON.stringify(a.value.taskInputs,void 0,2):"{}"});function x(){I.refresh(),g.push(W.flowRun(o.value))}const D=n(()=>{var s;return(s=a.value)==null?void 0:s.stateType});L(D);const B=n(()=>a.value?`Task Run: ${a.value.name}`:"Task Run");return X(B),(s,f)=>{const C=i("p-code-highlight"),N=i("p-tabs"),S=i("p-layout-well");return a.value?(p(),r(S,{key:0,class:"task-run"},{header:t(()=>[u(e(q),{"task-run-id":a.value.id,onDelete:x},null,8,["task-run-id"])]),well:t(()=>[u(e(m),{alternate:"","task-run":a.value},null,8,["task-run"])]),default:t(()=>[u(N,{selected:e(l),"onUpdate:selected":f[0]||(f[0]=A=>Q(l)?l.value=A:null),tabs:e(b)},E({details:t(()=>[u(e(m),{"task-run":a.value},null,8,["task-run"])]),logs:t(()=>[u(e(G),{"task-run":a.value},null,8,["task-run"])]),artifacts:t(()=>[a.value?(p(),r(e(H),{key:0,"task-run":a.value},null,8,["task-run"])):c("",!0)]),"task-inputs":t(()=>[a.value?(p(),r(e(K),{key:0,"text-to-copy":v.value},{default:t(()=>[u(C,{lang:"json",text:v.value,class:"task-run__inputs"},null,8,["text"])]),_:1},8,["text-to-copy"])):c("",!0)]),_:2},[a.value?{name:"task-inputs-heading",fn:t(()=>[R(" Task inputs "),u(e(P),{title:"Task Inputs"},{default:t(()=>[R(U(e($).info.taskInput),1)]),_:1})]),key:"0"}:void 0]),1032,["selected","tabs"])]),_:1})):c("",!0)}}});export{ta as default};
