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