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