import{_ as T}from"./Cd5yfd14.js";import{_ as b}from"./DM9QX0ua.js";import{d as x,G as C,v as h,l as L,s as S,c as n,f as v,e as a,h as o,t as e,F as A,p as B,w as H,b as i,q as I,g as V,_ as D}from"./tpFEFzWU.js";import{u as y}from"./Grz13CMP.js";const E={class:"terminal-page"},R={class:"card"},U={class:"section-header"},j={class:"column-badge"},q={key:0,class:"loading"},z={key:1,class:"error-message"},G={key:2,class:"empty"},M={key:3,class:"terminal-content"},O={class:"log-time"},J={class:"log-level"},K={class:"log-message"},P={class:"actions"},Q=x({__name:"terminal",async setup(W){let t,l;const m=C(),c=m.params.id,d=m.params.column,{data:r}=([t,l]=h(()=>y(`/api/issues/${c}`,"$kO2jumUF-U")),t=await t,l(),t),f=L(()=>{if(!r.value)return null;const s={id:r.value.key,title:r.value.title,column:r.value.column_slug};return r.value.priority&&(s.priority=r.value.priority),s}),{data:p,status:$,error:g}=([t,l]=h(()=>y(`/api/issues/${c}/${d}/log`,"$kN3ufMrA3g")),t=await t,l(),t),k=s=>{const _=new Date(s);return isNaN(_.getTime())?s:_.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit",second:"2-digit"})};return S({title:`Terminal ${d} - ${c} - AutoCode`}),(s,_)=>{const w=T,N=b;return i(),n("div",E,[v(w,{issue:o(f),"active-tab":"history"},null,8,["issue"]),a("div",R,[a("div",U,[a("h2",null,e(s.$t("history.viewTerminal")),1),a("span",j,e(o(d)),1)]),o($)==="pending"?(i(),n("div",q,e(s.$t("app.loading")),1)):o(g)?(i(),n("div",z,e(o(g).message),1)):o(p)?.length?(i(),n("div",M,[(i(!0),n(A,null,B(o(p),(u,F)=>(i(),n("div",{key:F,class:I(["log-entry",`log-${u.level}`])},[a("span",O,e(k(u.timestamp)),1),a("span",J,e(u.level),1),a("span",K,e(u.message),1)],2))),128))])):(i(),n("div",G,e(s.$t("terminal.noLogs")),1))]),a("div",P,[v(N,{to:`/issue/${o(c)}/history`,class:"btn-secondary"},{default:H(()=>[V(e(s.$t("nav.back")),1)]),_:1},8,["to"])])])}}}),es=D(Q,[["__scopeId","data-v-8427ea96"]]);export{es as default};
