import{_ as L}from"./Cd5yfd14.js";import{_ as D}from"./DM9QX0ua.js";import{d as E,G as R,v as $,l as k,s as S,c as e,f as T,e as i,h as r,t as a,F as m,p as v,b as t,j as c,q as G,i as b,w,g as A,_ as P}from"./tpFEFzWU.js";import{u as H}from"./Grz13CMP.js";const j={class:"issue-history-page"},q={class:"card"},z={class:"section-header"},J={class:"count"},K={key:0,class:"loading"},M={key:1,class:"error-message"},O={key:2,class:"empty"},Q={key:3,class:"history-list"},U={class:"history-main"},W={key:0,class:"history-from"},X={key:1,class:"history-arrow"},Y={class:"history-to"},Z={key:1,class:"history-changes"},ss={class:"change-field"},ts={class:"change-from"},os={class:"change-to"},es={key:0,class:"history-actions"},as={key:1,class:"session-badge"},is={class:"history-date"},rs=E({__name:"index",async setup(ns){let n,u;const d=R().params.id,{data:l}=([n,u]=$(()=>H(`/api/issues/${d}`,"$Rocr4faAHy")),n=await n,u(),n),I=k(()=>{if(!l.value)return null;const o={id:l.value.key,title:l.value.title,column:l.value.column_slug};return l.value.priority&&(o.priority=l.value.priority),o}),{data:_,status:C,error:p}=([n,u]=$(()=>H(`/api/issues/${d}/history`,"$bELPvGg345")),n=await n,u(),n),F=k(()=>_.value?[..._.value].reverse():[]),N=o=>new Date(o).toLocaleDateString("fr-FR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}),f=o=>o||"";return S({title:`History - ${d} - AutoCode`}),(o,h)=>{const V=L,g=D;return t(),e("div",j,[T(V,{issue:r(I),"active-tab":"history"},null,8,["issue"]),i("div",q,[i("div",z,[i("h2",null,a(o.$t("issue.history")),1),i("span",J,"("+a(r(_)?.length||0)+")",1)]),r(C)==="pending"?(t(),e("div",K,a(o.$t("app.loading")),1)):r(p)?(t(),e("div",M,a(r(p).message),1)):r(_)?.length?(t(),e("ul",Q,[(t(!0),e(m,null,v(r(F),(s,x)=>(t(),e("li",{key:x,class:"history-item"},[i("div",U,[i("span",{class:G(["history-action",`history-action-${s.action}`])},a(o.$t(`history.action.${s.action}`)),3),s.action!=="edited"?(t(),e(m,{key:0},[s.from?(t(),e("span",W,a(s.from),1)):c("",!0),s.from?(t(),e("span",X,"→")):c("",!0),i("span",Y,a(s.to),1)],64)):s.changes?.length?(t(),e("div",Z,[(t(!0),e(m,null,v(s.changes,(y,B)=>(t(),e("div",{key:B,class:"history-change-item"},[i("span",ss,a(o.$t(`history.field.${y.field}`)),1),i("span",ts,a(f(y.from)||"∅"),1),h[0]||(h[0]=i("span",{class:"history-arrow"},"→",-1)),i("span",os,a(f(y.to)||"∅"),1)]))),128))])):c("",!0)]),s.artifactsAvailable?.prompt||s.artifactsAvailable?.terminal?(t(),e("div",es,[s.artifactsAvailable?.prompt?(t(),b(g,{key:0,to:`/issue/${r(d)}/history/${s.sessionId}/prompt`,class:"btn-action"},{default:w(()=>[A(a(o.$t("history.viewPrompt")),1)]),_:1},8,["to"])):c("",!0),s.artifactsAvailable?.terminal?(t(),b(g,{key:1,to:`/issue/${r(d)}/history/${s.sessionId}/terminal`,class:"btn-action"},{default:w(()=>[A(a(o.$t("history.viewTerminal")),1)]),_:1},8,["to"])):c("",!0)])):c("",!0),s.sessionId?(t(),e("span",as,a(s.sessionId),1)):c("",!0),i("time",is,a(N(s.at)),1)]))),128))])):(t(),e("div",O,a(o.$t("issue.noHistory")),1))])])}}}),hs=P(rs,[["__scopeId","data-v-e79c602e"]]);export{hs as default};
