codex-mobile-re 0.1.88 → 0.1.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AutomationsPanel-Dp8RsslP.js → AutomationsPanel-CIkRctDa.js} +1 -1
- package/dist/assets/{DirectoryHub-BOxKTf5g.js → DirectoryHub-C5Qmidrq.js} +1 -1
- package/dist/assets/{ReviewPane-BI8SWSDv.js → ReviewPane-Bdgmw-KX.js} +1 -1
- package/dist/assets/ThreadConversation-B7LoyUC8.js +39 -0
- package/dist/assets/ThreadConversation-DABmfqIb.css +1 -0
- package/dist/assets/{ThreadTerminalPanel-CgxRx_qQ.js → ThreadTerminalPanel-BPKHKJzQ.js} +1 -1
- package/dist/assets/{index-8nj0j9KO.css → index-BMqNqaVq.css} +1 -1
- package/dist/assets/{index-BrpaGwQT.js → index-CL3S5U3K.js} +33 -33
- package/dist/index.html +2 -2
- package/dist-cli/index.js +82 -26
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/ThreadConversation-DYiDMOhU.js +0 -39
- package/dist/assets/ThreadConversation-DoR0Kazk.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as Xe,A as Ke,q as y,l as G,M as je,N as Ye,m as qe,o,a as r,b as a,t as s,u as c,e as w,g as ae,I as Je,U as Qe,n as be,F as C,r as P,p as U,f as T,i as Ze,w as se,h as et,j as tt,k as b,V as at,W as st,X as nt,_ as it}from"./index-BrpaGwQT.js";const lt={class:"review-pane-header"},ot={class:"review-pane-heading"},rt={class:"review-pane-eyebrow"},ut={class:"review-pane-title"},dt={class:"review-pane-header-actions"},ct=["aria-label"],vt={class:"review-pane-toolbar"},pt={class:"review-pane-toolbar-controls"},ht={key:0,class:"review-pane-control-cluster"},ft={class:"review-pane-control-label"},wt={class:"review-pane-segmented"},mt=["data-active"],_t=["data-active","disabled"],yt={key:1,class:"review-pane-control-cluster"},bt={class:"review-pane-control-label"},kt={key:2,class:"review-pane-control-cluster"},gt={class:"review-pane-control-label"},Ct={class:"review-pane-segmented"},Bt=["data-active"],Ft=["data-active"],St={class:"review-pane-toolbar-actions"},It=["disabled"],Lt={key:1,class:"review-pane-meta"},xt={class:"review-pane-summary-pill review-pane-summary-pill-add"},$t={class:"review-pane-summary-pill review-pane-summary-pill-remove"},At={key:0},Et={key:1},Pt={key:2},Nt={class:"review-pane-content"},Rt={key:0,class:"review-pane-empty"},Tt={class:"review-pane-empty-title"},Mt={key:1,class:"review-pane-empty"},Dt={class:"review-pane-empty-title"},Wt={class:"review-pane-empty-text"},Vt=["disabled"],zt={key:2,class:"review-pane-empty"},Gt={class:"review-pane-empty-title"},Ut={class:"review-pane-empty-text"},Ht={key:0,class:"review-pane-bulk-actions"},Ot=["disabled","onClick"],Xt={key:1,class:"review-pane-empty"},Kt={class:"review-pane-empty-title"},jt={class:"review-pane-empty-text"},Yt={key:0,class:"review-pane-file-list"},qt=["data-expanded","onClick"],Jt=["data-expanded"],Qt={class:"review-pane-tree-folder-name"},Zt={class:"review-pane-tree-folder-count"},ea=["data-active","title","onClick"],ta={class:"review-pane-file-meta-row"},aa={class:"review-pane-file-path"},sa={class:"review-pane-file-delta"},na={class:"review-pane-delta-add"},ia={class:"review-pane-delta-remove"},la=["data-operation"],oa={class:"review-pane-diff"},ra={class:"review-pane-file-header"},ua={class:"review-pane-file-header-main"},da={class:"review-pane-file-title"},ca={class:"review-pane-file-subtitle"},va={key:0,class:"review-pane-row-actions"},pa=["disabled","onClick"],ha={key:0,class:"review-pane-raw-diff"},fa={key:1,class:"review-pane-hunks"},wa=["data-active","onClick"],ma={class:"review-pane-hunk-header"},_a={class:"review-pane-hunk-title"},ya={class:"review-pane-hunk-meta"},ba={key:0,class:"review-pane-row-actions"},ka=["disabled","onClick"],ga={class:"review-pane-lines"},Ca=["data-kind"],Ba={class:"review-pane-line-number"},Fa={class:"review-pane-line-number"},Sa={class:"review-pane-line-marker"},Ia={class:"review-pane-line-code"},La={class:"review-pane-sheet-header"},xa={class:"review-pane-sheet-title"},$a={class:"review-pane-sheet-count"},Aa={class:"review-pane-sheet-list"},Ea=["data-expanded","onClick"],Pa=["data-expanded"],Na={class:"review-pane-tree-folder-name"},Ra={class:"review-pane-tree-folder-count"},Ta=["data-active","title","onClick"],Ma={class:"review-pane-file-meta-row"},Da={class:"review-pane-file-path"},Wa={class:"review-pane-file-delta"},Va={class:"review-pane-delta-add"},za={class:"review-pane-delta-remove"},Ga=["data-operation"],ke="codex-web-local.review-pane-file-list-width.v1",Ua=220,Ha=420,ge=288,Oa=Xe({__name:"ReviewPane",props:{threadId:{},cwd:{},isThreadInProgress:{type:Boolean},initialFilePath:{},commitSha:{}},emits:["close"],setup(Ce){const g=Ce,{isMobile:B}=Ke(),{t:l}=tt(),m=y("workspace"),F=y("unstaged"),d=y(null),L=y(""),H=y(!1),x=y(""),I=y(""),O=y(!1),J=y(!1),N=y(!1),X=y(!1),M=y(""),$=y(""),K=y("");let j=null,A=null;const k=b(()=>{var e,t;return((e=d.value)==null?void 0:e.files.find(u=>u.id===x.value))??((t=d.value)==null?void 0:t.files[0])??null}),R=y({}),S=b(()=>{var e;return!!((e=g.commitSha)!=null&&e.trim())}),Be=b(()=>{var e;return(((e=d.value)==null?void 0:e.baseBranchOptions)??[]).map(t=>({value:t,label:t}))}),Fe=b(()=>{var e;return((e=d.value)==null?void 0:e.scope)==="commit"||S.value?l("No file changes in this commit."):m.value==="workspace"?l("Your current workspace is clean."):l("No merge diff found against the base branch.")});function ne(e){return e.trim().replace(/\\/g,"/")}function Se(e){const t=ne(e);return!t||!d.value?null:d.value.files.find(u=>[u.path,u.absolutePath,u.previousPath,u.previousAbsolutePath].some(v=>typeof v=="string"&&ne(v)===t))??null}function ie(){const e=Se(g.initialFilePath??"");return e?(ee(e.id),!0):!1}const Ie=b(()=>{var e,t;return(e=d.value)!=null&&e.isGitRepo?S.value?d.value.commitSha?`${l("Commit")} ${_e(d.value.commitSha)}`:l("Commit"):m.value==="workspace"?F.value==="staged"?l("Staged changes"):l("Workspace changes"):(t=d.value)!=null&&t.baseBranch?`${l("Against")} ${d.value.baseBranch}`:l("Base branch"):l("Repository review")}),le=b(()=>{var e;return!S.value&&m.value==="workspace"&&((e=d.value)==null?void 0:e.isGitRepo)===!0&&d.value.files.length>0}),oe=b(()=>le.value&&!N.value),Le=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage all")}]:[{value:"stage",label:l("Stage all")},{value:"revert",label:l("Revert all")}]),xe=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage file")}]:[{value:"stage",label:l("Stage file")},{value:"revert",label:l("Revert file")}]),$e=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage hunk")}]:[{value:"stage",label:l("Stage hunk")},{value:"revert",label:l("Revert hunk")}]),re=b(()=>$.value||M.value||K.value),Ae=b(()=>!!($.value||M.value)),Y=y(Ne()),Ee=b(()=>{const e={};return B.value||(e["--review-file-list-width"]=`${Y.value}px`),e}),ue=b(()=>{var e;return De(((e=d.value)==null?void 0:e.files)??[],R.value)}),de=b(()=>ue.value.nodes),Pe=b(()=>ue.value.folderIdsByFileId);function Q(e){return Number.isFinite(e)?Math.min(Ha,Math.max(Ua,Math.round(e))):ge}function Ne(){if(typeof window>"u")return ge;const e=window.localStorage.getItem(ke),t=e?Number(e):Number.NaN;return Q(t)}function Re(e){typeof window>"u"||window.localStorage.setItem(ke,String(Q(e)))}function Te(e){if(B.value)return;e.preventDefault(),A==null||A();const t=e.clientX,u=Y.value,v=i=>{Y.value=Q(u+(i.clientX-t))},p=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",n),A=null},n=()=>{p(),Re(Y.value)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",n),A=p}function Me(e){return e==="add"?"+":e==="remove"?"-":e==="hunk"?"@@":" "}function ce(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??e}function ve(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function De(e,t){const u={folders:new Map,files:[]},v={};for(const f of e){const _=f.path.split("/").filter(Boolean),W=_.pop()??f.path;let h=u,E="";const ye=[];for(const[Oe,V]of _.entries()){E=E?`${E}/${V}`:V;let z=h.folders.get(V);z||(z={id:E,name:V,depth:Oe,folders:new Map,files:[]},h.folders.set(V,z)),h=z,ye.push(z.id)}h.files.push({file:f,name:W,depth:_.length}),v[f.id]=ye}const p=[],n=f=>f.files.length+Array.from(f.folders.values()).reduce((_,W)=>_+n(W),0),i=f=>{const _=Array.from(f.folders.values()).sort((h,E)=>ve(h.name,E.name)),W=[...f.files].sort((h,E)=>ve(h.name,E.name));for(const h of _)p.push({kind:"folder",treeKey:`folder:${h.id}`,id:h.id,name:h.name,depth:h.depth,fileCount:n(h)}),t[h.id]!==!1&&i(h);for(const h of W)p.push({kind:"file",treeKey:`file:${h.file.id}`,id:h.file.id,name:h.name,depth:h.depth,file:h.file})};return i(u),{nodes:p,folderIdsByFileId:v}}function D(e){return R.value[e]!==!1}function pe(e){R.value={...R.value,[e]:!D(e)}}function he(e){const t=Pe.value[e]??[];if(t.length===0)return;const u={...R.value};let v=!1;for(const p of t)u[p]===!1&&(u[p]=!0,v=!0);v&&(R.value=u)}function fe(e){const t=B.value?8:10,u=B.value?12:14;return{paddingLeft:`${t+e*u}px`}}function we(){return{paddingLeft:B.value?"8px":"10px"}}function Z(e){return l(e==="add"?"Added":e==="delete"?"Deleted":e==="rename"?"Renamed":"Modified")}function We(e){const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null;return typeof(t==null?void 0:t.threadId)=="string"?t.threadId:""}async function q(){var e,t,u,v;if(g.cwd.trim()){J.value=!0,M.value="";try{const p=m.value==="baseBranch"?L.value.trim():"",n=((e=g.commitSha)==null?void 0:e.trim())??"",i=await at(g.cwd,S.value?"commit":m.value,F.value,p||null,n||null);if(i.baseBranchOptions.length>0){const _=i.baseBranch??i.baseBranchOptions[0]??"";L.value!==_&&(H.value=!0,L.value=_)}else L.value!==""&&(H.value=!0,L.value="");d.value=i;const f=i.files.some(_=>_.id===x.value);!ie()&&!f&&(x.value=((t=i.files[0])==null?void 0:t.id)??"",I.value=((v=(u=i.files[0])==null?void 0:u.hunks[0])==null?void 0:v.id)??"")}catch(p){M.value=p instanceof Error?p.message:"Failed to load review snapshot"}finally{J.value=!1}}}async function me(){await q()}function ee(e){var u,v;he(e),x.value=e;const t=((u=d.value)==null?void 0:u.files.find(p=>p.id===e))??null;I.value=((v=t==null?void 0:t.hunks[0])==null?void 0:v.id)??"",B.value&&(O.value=!1)}function _e(e){return e.trim().slice(0,7)}async function te(e,t,u=""){var v,p,n;if(d.value){N.value=!0,$.value="";try{const i=await nt({cwd:g.cwd,scope:m.value,workspaceView:F.value,action:e,level:t,patch:u});d.value=i,i.files.some(_=>_.id===x.value)||(x.value=((v=i.files[0])==null?void 0:v.id)??"",I.value=((n=(p=i.files[0])==null?void 0:p.hunks[0])==null?void 0:n.id)??"")}catch(i){$.value=i instanceof Error?i.message:"Failed to apply review action"}finally{N.value=!1}}}async function Ve(e){await te(e,"all")}async function ze(e,t){await te(e,"file",t.diff)}async function Ge(e,t){I.value=t.id,await te(e,"hunk",t.patch)}async function Ue(){if(g.cwd.trim()){X.value=!0,$.value="";try{await st(g.cwd),await q()}catch(e){$.value=e instanceof Error?e.message:"Failed to initialize Git"}finally{X.value=!1}}}function He(e){if(We(e)!==g.threadId)return;const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null,u=(t==null?void 0:t.item)!==null&&typeof(t==null?void 0:t.item)=="object"&&!Array.isArray(t.item)?t.item:null,v=typeof(u==null?void 0:u.type)=="string"?u.type:"";if(e.method==="item/started"&&v==="enteredReviewMode"){K.value=typeof(u==null?void 0:u.review)=="string"?u.review:"Review in progress";return}e.method==="item/completed"&&v==="exitedReviewMode"&&(K.value="")}return G(()=>[g.threadId,g.cwd,g.commitSha],()=>{S.value&&(m.value="workspace"),x.value="",I.value="",$.value="",K.value="",me()},{immediate:!0}),G(()=>[g.initialFilePath,g.commitSha],()=>{ie()}),G(()=>[m.value,F.value],()=>{x.value="",I.value="",$.value="",M.value="",q()}),G(L,(e,t)=>{if(H.value){H.value=!1;return}m.value==="baseBranch"&&(!e||e===t||q())}),G(k,e=>{var t;e&&(he(e.id),e.hunks.some(u=>u.id===I.value)||(I.value=((t=e.hunks[0])==null?void 0:t.id)??""))}),je(()=>{j=Ye(He)}),qe(()=>{j&&(j(),j=null),A==null||A()}),(e,t)=>{var u,v,p;return o(),r("section",{class:be(["review-pane",{"is-mobile":c(B)}]),onPointerdown:t[9]||(t[9]=se(()=>{},["stop"])),onClick:t[10]||(t[10]=se(()=>{},["stop"]))},[a("header",lt,[a("div",ot,[a("p",rt,s(c(l)("Review")),1),a("p",ut,s(Ie.value),1)]),a("div",dt,[c(B)&&((u=d.value)!=null&&u.files.length)?(o(),r("button",{key:0,type:"button",class:"review-pane-mobile-files-button",onClick:t[0]||(t[0]=n=>O.value=!0)},s(c(l)("Files")),1)):w("",!0),a("button",{type:"button",class:"review-pane-close","aria-label":c(l)("Close review pane"),onClick:t[1]||(t[1]=n=>e.$emit("close"))},[ae(Je,{class:"icon-svg"})],8,ct)])]),a("div",vt,[a("div",pt,[S.value?w("",!0):(o(),r("div",ht,[a("span",ft,s(c(l)("Compare")),1),a("div",wt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="workspace",onClick:t[2]||(t[2]=n=>m.value="workspace")},s(c(l)("Workspace")),9,mt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="baseBranch",disabled:!((v=d.value)!=null&&v.baseBranch),onClick:t[3]||(t[3]=n=>m.value="baseBranch")},s(c(l)("Base branch")),9,_t)])])),!S.value&&m.value==="baseBranch"&&((p=d.value)!=null&&p.baseBranchOptions.length)?(o(),r("div",yt,[a("span",bt,s(c(l)("Branch")),1),ae(Qe,{modelValue:L.value,"onUpdate:modelValue":t[4]||(t[4]=n=>L.value=n),class:"review-pane-branch-dropdown",options:Be.value,placeholder:c(l)("Branch"),"enable-search":"","search-placeholder":c(l)("Search branches...")},null,8,["modelValue","options","placeholder","search-placeholder"])])):w("",!0),!S.value&&m.value==="workspace"?(o(),r("div",kt,[a("span",gt,s(c(l)("Changes")),1),a("div",Ct,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="unstaged",onClick:t[5]||(t[5]=n=>F.value="unstaged")},s(c(l)("Unstaged")),9,Bt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="staged",onClick:t[6]||(t[6]=n=>F.value="staged")},s(c(l)("Staged")),9,Ft)])])):w("",!0)]),a("div",St,[a("button",{type:"button",class:"review-pane-refresh",disabled:J.value,onClick:me},s(c(l)("Refresh")),9,It)])]),re.value?(o(),r("div",{key:0,class:be(["review-pane-banner",{"is-error":Ae.value}])},s(re.value),3)):w("",!0),d.value?(o(),r("div",Lt,[a("span",null,s(d.value.summary.fileCount)+" "+s(c(l)("files")),1),a("span",xt,"+"+s(d.value.summary.addedLineCount),1),a("span",$t,"-"+s(d.value.summary.removedLineCount),1),d.value.headBranch?(o(),r("span",At,s(d.value.headBranch),1)):w("",!0),S.value&&d.value.commitSha?(o(),r("span",Et,s(_e(d.value.commitSha)),1)):w("",!0),!S.value&&m.value==="baseBranch"&&d.value.baseBranch?(o(),r("span",Pt,"vs "+s(d.value.baseBranch),1)):w("",!0)])):w("",!0),a("div",Nt,[d.value?d.value.isGitRepo?!S.value&&m.value==="baseBranch"&&!d.value.baseBranch?(o(),r("div",zt,[a("p",Gt,s(c(l)("Base branch unavailable")),1),a("p",Ut,s(c(l)("Could not resolve `origin/HEAD`, `main`, or `master` for this repository.")),1)])):(o(),r(C,{key:3},[le.value?(o(),r("div",Ht,[(o(!0),r(C,null,P(Le.value,n=>(o(),r("button",{key:n.value,type:"button",class:"review-pane-bulk-button",disabled:N.value,onClick:i=>Ve(n.value)},s(n.label),9,Ot))),128))])):w("",!0),d.value.files.length?(o(),r("div",{key:2,class:"review-pane-main",style:U(Ee.value)},[c(B)?w("",!0):(o(),r("aside",Yt,[(o(!0),r(C,null,P(de.value,n=>{var i;return o(),r(C,{key:n.treeKey},[n.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder",style:U(fe(n.depth)),"data-expanded":D(n.id),onClick:f=>pe(n.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(n.id)},null,8,Jt),a("span",Qt,s(n.name),1),a("span",Zt,s(n.fileCount),1)],12,qt)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(we()),"data-active":((i=k.value)==null?void 0:i.id)===n.file.id,title:n.file.path,onClick:f=>ee(n.file.id)},[a("span",ta,[a("span",aa,[T(s(n.name)+" ",1),n.file.previousPath?(o(),r(C,{key:0},[T(" ← "+s(ce(n.file.previousPath)),1)],64)):w("",!0)]),a("span",sa,[a("span",na,"+"+s(n.file.addedLineCount),1),t[11]||(t[11]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",ia,"-"+s(n.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":n.file.operation},s(Z(n.file.operation)),9,la)],12,ea))],64)}),128))])),c(B)?w("",!0):(o(),r("div",{key:1,class:"review-pane-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerdown:Te},null,32)),a("section",oa,[k.value?(o(),r(C,{key:0},[a("div",ra,[a("div",ua,[a("p",da,[T(s(k.value.path)+" ",1),k.value.previousPath?(o(),r(C,{key:0},[T(" ← "+s(k.value.previousPath),1)],64)):w("",!0)]),a("p",ca,s(Z(k.value.operation))+" · +"+s(k.value.addedLineCount)+" / -"+s(k.value.removedLineCount),1)]),oe.value?(o(),r("div",va,[(o(!0),r(C,null,P(xe.value,n=>(o(),r("button",{key:`${k.value.id}:${n.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:i=>ze(n.value,k.value)},s(n.label),9,pa))),128))])):w("",!0)]),k.value.hunks.length===0?(o(),r("div",ha,[a("pre",null,s(k.value.diff||"No unified diff available."),1)])):(o(),r("div",fa,[(o(!0),r(C,null,P(k.value.hunks,n=>(o(),r("article",{key:n.id,class:"review-pane-hunk","data-active":I.value===n.id,onClick:i=>I.value=n.id},[a("div",ma,[a("div",null,[a("p",_a,s(n.header),1),a("p",ya,"+"+s(n.addedLineCount)+" / -"+s(n.removedLineCount),1)]),oe.value?(o(),r("div",ba,[(o(!0),r(C,null,P($e.value,i=>(o(),r("button",{key:`${n.id}:${i.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:f=>Ge(i.value,n)},s(i.label),9,ka))),128))])):w("",!0)]),a("div",ga,[(o(!0),r(C,null,P(n.lines,i=>(o(),r("div",{key:i.key,class:"review-pane-line","data-kind":i.kind},[a("span",Ba,s(i.oldLine??""),1),a("span",Fa,s(i.newLine??""),1),a("span",Sa,s(Me(i.kind)),1),a("code",Ia,s(i.text||" "),1)],8,Ca))),128))])],8,wa))),128))]))],64)):w("",!0)])],4)):(o(),r("div",Xt,[a("p",Kt,s(c(l)("No changes in this scope")),1),a("p",jt,s(Fe.value),1)]))],64)):(o(),r("div",Mt,[a("p",Dt,s(c(l)("This folder is not a Git repository")),1),a("p",Wt,s(c(l)("Initialize Git to review local changes and run Codex review.")),1),a("button",{type:"button",class:"review-pane-primary-cta",disabled:X.value,onClick:Ue},s(X.value?c(l)("Initializing…"):c(l)("Initialize Git")),9,Vt)])):(o(),r("div",Rt,[a("p",Tt,s(c(l)("Loading review state")),1)]))]),ae(et,{name:"review-pane-sheet"},{default:Ze(()=>{var n;return[c(B)&&O.value&&((n=d.value)!=null&&n.files.length)?(o(),r("div",{key:0,class:"review-pane-sheet-backdrop",onClick:t[8]||(t[8]=i=>O.value=!1)},[a("div",{class:"review-pane-sheet",onClick:t[7]||(t[7]=se(()=>{},["stop"]))},[t[13]||(t[13]=a("div",{class:"review-pane-sheet-handle","aria-hidden":"true"},null,-1)),a("div",La,[a("p",xa,s(c(l)("Changed files")),1),a("p",$a,s(d.value.files.length),1)]),a("div",Aa,[(o(!0),r(C,null,P(de.value,i=>{var f;return o(),r(C,{key:`sheet:${i.treeKey}`},[i.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder review-pane-tree-folder-sheet",style:U(fe(i.depth)),"data-expanded":D(i.id),onClick:_=>pe(i.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(i.id)},null,8,Pa),a("span",Na,s(i.name),1),a("span",Ra,s(i.fileCount),1)],12,Ea)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(we()),"data-active":((f=k.value)==null?void 0:f.id)===i.file.id,title:i.file.path,onClick:_=>ee(i.file.id)},[a("span",Ma,[a("span",Da,[T(s(i.name)+" ",1),i.file.previousPath?(o(),r(C,{key:0},[T(" ← "+s(ce(i.file.previousPath)),1)],64)):w("",!0)]),a("span",Wa,[a("span",Va,"+"+s(i.file.addedLineCount),1),t[12]||(t[12]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",za,"-"+s(i.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":i.file.operation},s(Z(i.file.operation)),9,Ga)],12,Ta))],64)}),128))])])])):w("",!0)]}),_:1})],34)}}}),Ka=it(Oa,[["__scopeId","data-v-b6468d35"]]);export{Ka as default};
|
|
1
|
+
import{d as Xe,A as Ke,q as y,l as G,M as je,N as Ye,m as qe,o,a as r,b as a,t as s,u as c,e as w,g as ae,I as Je,U as Qe,n as be,F as C,r as P,p as U,f as T,i as Ze,w as se,h as et,j as tt,k as b,V as at,W as st,X as nt,_ as it}from"./index-CL3S5U3K.js";const lt={class:"review-pane-header"},ot={class:"review-pane-heading"},rt={class:"review-pane-eyebrow"},ut={class:"review-pane-title"},dt={class:"review-pane-header-actions"},ct=["aria-label"],vt={class:"review-pane-toolbar"},pt={class:"review-pane-toolbar-controls"},ht={key:0,class:"review-pane-control-cluster"},ft={class:"review-pane-control-label"},wt={class:"review-pane-segmented"},mt=["data-active"],_t=["data-active","disabled"],yt={key:1,class:"review-pane-control-cluster"},bt={class:"review-pane-control-label"},kt={key:2,class:"review-pane-control-cluster"},gt={class:"review-pane-control-label"},Ct={class:"review-pane-segmented"},Bt=["data-active"],Ft=["data-active"],St={class:"review-pane-toolbar-actions"},It=["disabled"],Lt={key:1,class:"review-pane-meta"},xt={class:"review-pane-summary-pill review-pane-summary-pill-add"},$t={class:"review-pane-summary-pill review-pane-summary-pill-remove"},At={key:0},Et={key:1},Pt={key:2},Nt={class:"review-pane-content"},Rt={key:0,class:"review-pane-empty"},Tt={class:"review-pane-empty-title"},Mt={key:1,class:"review-pane-empty"},Dt={class:"review-pane-empty-title"},Wt={class:"review-pane-empty-text"},Vt=["disabled"],zt={key:2,class:"review-pane-empty"},Gt={class:"review-pane-empty-title"},Ut={class:"review-pane-empty-text"},Ht={key:0,class:"review-pane-bulk-actions"},Ot=["disabled","onClick"],Xt={key:1,class:"review-pane-empty"},Kt={class:"review-pane-empty-title"},jt={class:"review-pane-empty-text"},Yt={key:0,class:"review-pane-file-list"},qt=["data-expanded","onClick"],Jt=["data-expanded"],Qt={class:"review-pane-tree-folder-name"},Zt={class:"review-pane-tree-folder-count"},ea=["data-active","title","onClick"],ta={class:"review-pane-file-meta-row"},aa={class:"review-pane-file-path"},sa={class:"review-pane-file-delta"},na={class:"review-pane-delta-add"},ia={class:"review-pane-delta-remove"},la=["data-operation"],oa={class:"review-pane-diff"},ra={class:"review-pane-file-header"},ua={class:"review-pane-file-header-main"},da={class:"review-pane-file-title"},ca={class:"review-pane-file-subtitle"},va={key:0,class:"review-pane-row-actions"},pa=["disabled","onClick"],ha={key:0,class:"review-pane-raw-diff"},fa={key:1,class:"review-pane-hunks"},wa=["data-active","onClick"],ma={class:"review-pane-hunk-header"},_a={class:"review-pane-hunk-title"},ya={class:"review-pane-hunk-meta"},ba={key:0,class:"review-pane-row-actions"},ka=["disabled","onClick"],ga={class:"review-pane-lines"},Ca=["data-kind"],Ba={class:"review-pane-line-number"},Fa={class:"review-pane-line-number"},Sa={class:"review-pane-line-marker"},Ia={class:"review-pane-line-code"},La={class:"review-pane-sheet-header"},xa={class:"review-pane-sheet-title"},$a={class:"review-pane-sheet-count"},Aa={class:"review-pane-sheet-list"},Ea=["data-expanded","onClick"],Pa=["data-expanded"],Na={class:"review-pane-tree-folder-name"},Ra={class:"review-pane-tree-folder-count"},Ta=["data-active","title","onClick"],Ma={class:"review-pane-file-meta-row"},Da={class:"review-pane-file-path"},Wa={class:"review-pane-file-delta"},Va={class:"review-pane-delta-add"},za={class:"review-pane-delta-remove"},Ga=["data-operation"],ke="codex-web-local.review-pane-file-list-width.v1",Ua=220,Ha=420,ge=288,Oa=Xe({__name:"ReviewPane",props:{threadId:{},cwd:{},isThreadInProgress:{type:Boolean},initialFilePath:{},commitSha:{}},emits:["close"],setup(Ce){const g=Ce,{isMobile:B}=Ke(),{t:l}=tt(),m=y("workspace"),F=y("unstaged"),d=y(null),L=y(""),H=y(!1),x=y(""),I=y(""),O=y(!1),J=y(!1),N=y(!1),X=y(!1),M=y(""),$=y(""),K=y("");let j=null,A=null;const k=b(()=>{var e,t;return((e=d.value)==null?void 0:e.files.find(u=>u.id===x.value))??((t=d.value)==null?void 0:t.files[0])??null}),R=y({}),S=b(()=>{var e;return!!((e=g.commitSha)!=null&&e.trim())}),Be=b(()=>{var e;return(((e=d.value)==null?void 0:e.baseBranchOptions)??[]).map(t=>({value:t,label:t}))}),Fe=b(()=>{var e;return((e=d.value)==null?void 0:e.scope)==="commit"||S.value?l("No file changes in this commit."):m.value==="workspace"?l("Your current workspace is clean."):l("No merge diff found against the base branch.")});function ne(e){return e.trim().replace(/\\/g,"/")}function Se(e){const t=ne(e);return!t||!d.value?null:d.value.files.find(u=>[u.path,u.absolutePath,u.previousPath,u.previousAbsolutePath].some(v=>typeof v=="string"&&ne(v)===t))??null}function ie(){const e=Se(g.initialFilePath??"");return e?(ee(e.id),!0):!1}const Ie=b(()=>{var e,t;return(e=d.value)!=null&&e.isGitRepo?S.value?d.value.commitSha?`${l("Commit")} ${_e(d.value.commitSha)}`:l("Commit"):m.value==="workspace"?F.value==="staged"?l("Staged changes"):l("Workspace changes"):(t=d.value)!=null&&t.baseBranch?`${l("Against")} ${d.value.baseBranch}`:l("Base branch"):l("Repository review")}),le=b(()=>{var e;return!S.value&&m.value==="workspace"&&((e=d.value)==null?void 0:e.isGitRepo)===!0&&d.value.files.length>0}),oe=b(()=>le.value&&!N.value),Le=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage all")}]:[{value:"stage",label:l("Stage all")},{value:"revert",label:l("Revert all")}]),xe=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage file")}]:[{value:"stage",label:l("Stage file")},{value:"revert",label:l("Revert file")}]),$e=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage hunk")}]:[{value:"stage",label:l("Stage hunk")},{value:"revert",label:l("Revert hunk")}]),re=b(()=>$.value||M.value||K.value),Ae=b(()=>!!($.value||M.value)),Y=y(Ne()),Ee=b(()=>{const e={};return B.value||(e["--review-file-list-width"]=`${Y.value}px`),e}),ue=b(()=>{var e;return De(((e=d.value)==null?void 0:e.files)??[],R.value)}),de=b(()=>ue.value.nodes),Pe=b(()=>ue.value.folderIdsByFileId);function Q(e){return Number.isFinite(e)?Math.min(Ha,Math.max(Ua,Math.round(e))):ge}function Ne(){if(typeof window>"u")return ge;const e=window.localStorage.getItem(ke),t=e?Number(e):Number.NaN;return Q(t)}function Re(e){typeof window>"u"||window.localStorage.setItem(ke,String(Q(e)))}function Te(e){if(B.value)return;e.preventDefault(),A==null||A();const t=e.clientX,u=Y.value,v=i=>{Y.value=Q(u+(i.clientX-t))},p=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",n),A=null},n=()=>{p(),Re(Y.value)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",n),A=p}function Me(e){return e==="add"?"+":e==="remove"?"-":e==="hunk"?"@@":" "}function ce(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??e}function ve(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function De(e,t){const u={folders:new Map,files:[]},v={};for(const f of e){const _=f.path.split("/").filter(Boolean),W=_.pop()??f.path;let h=u,E="";const ye=[];for(const[Oe,V]of _.entries()){E=E?`${E}/${V}`:V;let z=h.folders.get(V);z||(z={id:E,name:V,depth:Oe,folders:new Map,files:[]},h.folders.set(V,z)),h=z,ye.push(z.id)}h.files.push({file:f,name:W,depth:_.length}),v[f.id]=ye}const p=[],n=f=>f.files.length+Array.from(f.folders.values()).reduce((_,W)=>_+n(W),0),i=f=>{const _=Array.from(f.folders.values()).sort((h,E)=>ve(h.name,E.name)),W=[...f.files].sort((h,E)=>ve(h.name,E.name));for(const h of _)p.push({kind:"folder",treeKey:`folder:${h.id}`,id:h.id,name:h.name,depth:h.depth,fileCount:n(h)}),t[h.id]!==!1&&i(h);for(const h of W)p.push({kind:"file",treeKey:`file:${h.file.id}`,id:h.file.id,name:h.name,depth:h.depth,file:h.file})};return i(u),{nodes:p,folderIdsByFileId:v}}function D(e){return R.value[e]!==!1}function pe(e){R.value={...R.value,[e]:!D(e)}}function he(e){const t=Pe.value[e]??[];if(t.length===0)return;const u={...R.value};let v=!1;for(const p of t)u[p]===!1&&(u[p]=!0,v=!0);v&&(R.value=u)}function fe(e){const t=B.value?8:10,u=B.value?12:14;return{paddingLeft:`${t+e*u}px`}}function we(){return{paddingLeft:B.value?"8px":"10px"}}function Z(e){return l(e==="add"?"Added":e==="delete"?"Deleted":e==="rename"?"Renamed":"Modified")}function We(e){const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null;return typeof(t==null?void 0:t.threadId)=="string"?t.threadId:""}async function q(){var e,t,u,v;if(g.cwd.trim()){J.value=!0,M.value="";try{const p=m.value==="baseBranch"?L.value.trim():"",n=((e=g.commitSha)==null?void 0:e.trim())??"",i=await at(g.cwd,S.value?"commit":m.value,F.value,p||null,n||null);if(i.baseBranchOptions.length>0){const _=i.baseBranch??i.baseBranchOptions[0]??"";L.value!==_&&(H.value=!0,L.value=_)}else L.value!==""&&(H.value=!0,L.value="");d.value=i;const f=i.files.some(_=>_.id===x.value);!ie()&&!f&&(x.value=((t=i.files[0])==null?void 0:t.id)??"",I.value=((v=(u=i.files[0])==null?void 0:u.hunks[0])==null?void 0:v.id)??"")}catch(p){M.value=p instanceof Error?p.message:"Failed to load review snapshot"}finally{J.value=!1}}}async function me(){await q()}function ee(e){var u,v;he(e),x.value=e;const t=((u=d.value)==null?void 0:u.files.find(p=>p.id===e))??null;I.value=((v=t==null?void 0:t.hunks[0])==null?void 0:v.id)??"",B.value&&(O.value=!1)}function _e(e){return e.trim().slice(0,7)}async function te(e,t,u=""){var v,p,n;if(d.value){N.value=!0,$.value="";try{const i=await nt({cwd:g.cwd,scope:m.value,workspaceView:F.value,action:e,level:t,patch:u});d.value=i,i.files.some(_=>_.id===x.value)||(x.value=((v=i.files[0])==null?void 0:v.id)??"",I.value=((n=(p=i.files[0])==null?void 0:p.hunks[0])==null?void 0:n.id)??"")}catch(i){$.value=i instanceof Error?i.message:"Failed to apply review action"}finally{N.value=!1}}}async function Ve(e){await te(e,"all")}async function ze(e,t){await te(e,"file",t.diff)}async function Ge(e,t){I.value=t.id,await te(e,"hunk",t.patch)}async function Ue(){if(g.cwd.trim()){X.value=!0,$.value="";try{await st(g.cwd),await q()}catch(e){$.value=e instanceof Error?e.message:"Failed to initialize Git"}finally{X.value=!1}}}function He(e){if(We(e)!==g.threadId)return;const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null,u=(t==null?void 0:t.item)!==null&&typeof(t==null?void 0:t.item)=="object"&&!Array.isArray(t.item)?t.item:null,v=typeof(u==null?void 0:u.type)=="string"?u.type:"";if(e.method==="item/started"&&v==="enteredReviewMode"){K.value=typeof(u==null?void 0:u.review)=="string"?u.review:"Review in progress";return}e.method==="item/completed"&&v==="exitedReviewMode"&&(K.value="")}return G(()=>[g.threadId,g.cwd,g.commitSha],()=>{S.value&&(m.value="workspace"),x.value="",I.value="",$.value="",K.value="",me()},{immediate:!0}),G(()=>[g.initialFilePath,g.commitSha],()=>{ie()}),G(()=>[m.value,F.value],()=>{x.value="",I.value="",$.value="",M.value="",q()}),G(L,(e,t)=>{if(H.value){H.value=!1;return}m.value==="baseBranch"&&(!e||e===t||q())}),G(k,e=>{var t;e&&(he(e.id),e.hunks.some(u=>u.id===I.value)||(I.value=((t=e.hunks[0])==null?void 0:t.id)??""))}),je(()=>{j=Ye(He)}),qe(()=>{j&&(j(),j=null),A==null||A()}),(e,t)=>{var u,v,p;return o(),r("section",{class:be(["review-pane",{"is-mobile":c(B)}]),onPointerdown:t[9]||(t[9]=se(()=>{},["stop"])),onClick:t[10]||(t[10]=se(()=>{},["stop"]))},[a("header",lt,[a("div",ot,[a("p",rt,s(c(l)("Review")),1),a("p",ut,s(Ie.value),1)]),a("div",dt,[c(B)&&((u=d.value)!=null&&u.files.length)?(o(),r("button",{key:0,type:"button",class:"review-pane-mobile-files-button",onClick:t[0]||(t[0]=n=>O.value=!0)},s(c(l)("Files")),1)):w("",!0),a("button",{type:"button",class:"review-pane-close","aria-label":c(l)("Close review pane"),onClick:t[1]||(t[1]=n=>e.$emit("close"))},[ae(Je,{class:"icon-svg"})],8,ct)])]),a("div",vt,[a("div",pt,[S.value?w("",!0):(o(),r("div",ht,[a("span",ft,s(c(l)("Compare")),1),a("div",wt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="workspace",onClick:t[2]||(t[2]=n=>m.value="workspace")},s(c(l)("Workspace")),9,mt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="baseBranch",disabled:!((v=d.value)!=null&&v.baseBranch),onClick:t[3]||(t[3]=n=>m.value="baseBranch")},s(c(l)("Base branch")),9,_t)])])),!S.value&&m.value==="baseBranch"&&((p=d.value)!=null&&p.baseBranchOptions.length)?(o(),r("div",yt,[a("span",bt,s(c(l)("Branch")),1),ae(Qe,{modelValue:L.value,"onUpdate:modelValue":t[4]||(t[4]=n=>L.value=n),class:"review-pane-branch-dropdown",options:Be.value,placeholder:c(l)("Branch"),"enable-search":"","search-placeholder":c(l)("Search branches...")},null,8,["modelValue","options","placeholder","search-placeholder"])])):w("",!0),!S.value&&m.value==="workspace"?(o(),r("div",kt,[a("span",gt,s(c(l)("Changes")),1),a("div",Ct,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="unstaged",onClick:t[5]||(t[5]=n=>F.value="unstaged")},s(c(l)("Unstaged")),9,Bt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="staged",onClick:t[6]||(t[6]=n=>F.value="staged")},s(c(l)("Staged")),9,Ft)])])):w("",!0)]),a("div",St,[a("button",{type:"button",class:"review-pane-refresh",disabled:J.value,onClick:me},s(c(l)("Refresh")),9,It)])]),re.value?(o(),r("div",{key:0,class:be(["review-pane-banner",{"is-error":Ae.value}])},s(re.value),3)):w("",!0),d.value?(o(),r("div",Lt,[a("span",null,s(d.value.summary.fileCount)+" "+s(c(l)("files")),1),a("span",xt,"+"+s(d.value.summary.addedLineCount),1),a("span",$t,"-"+s(d.value.summary.removedLineCount),1),d.value.headBranch?(o(),r("span",At,s(d.value.headBranch),1)):w("",!0),S.value&&d.value.commitSha?(o(),r("span",Et,s(_e(d.value.commitSha)),1)):w("",!0),!S.value&&m.value==="baseBranch"&&d.value.baseBranch?(o(),r("span",Pt,"vs "+s(d.value.baseBranch),1)):w("",!0)])):w("",!0),a("div",Nt,[d.value?d.value.isGitRepo?!S.value&&m.value==="baseBranch"&&!d.value.baseBranch?(o(),r("div",zt,[a("p",Gt,s(c(l)("Base branch unavailable")),1),a("p",Ut,s(c(l)("Could not resolve `origin/HEAD`, `main`, or `master` for this repository.")),1)])):(o(),r(C,{key:3},[le.value?(o(),r("div",Ht,[(o(!0),r(C,null,P(Le.value,n=>(o(),r("button",{key:n.value,type:"button",class:"review-pane-bulk-button",disabled:N.value,onClick:i=>Ve(n.value)},s(n.label),9,Ot))),128))])):w("",!0),d.value.files.length?(o(),r("div",{key:2,class:"review-pane-main",style:U(Ee.value)},[c(B)?w("",!0):(o(),r("aside",Yt,[(o(!0),r(C,null,P(de.value,n=>{var i;return o(),r(C,{key:n.treeKey},[n.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder",style:U(fe(n.depth)),"data-expanded":D(n.id),onClick:f=>pe(n.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(n.id)},null,8,Jt),a("span",Qt,s(n.name),1),a("span",Zt,s(n.fileCount),1)],12,qt)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(we()),"data-active":((i=k.value)==null?void 0:i.id)===n.file.id,title:n.file.path,onClick:f=>ee(n.file.id)},[a("span",ta,[a("span",aa,[T(s(n.name)+" ",1),n.file.previousPath?(o(),r(C,{key:0},[T(" ← "+s(ce(n.file.previousPath)),1)],64)):w("",!0)]),a("span",sa,[a("span",na,"+"+s(n.file.addedLineCount),1),t[11]||(t[11]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",ia,"-"+s(n.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":n.file.operation},s(Z(n.file.operation)),9,la)],12,ea))],64)}),128))])),c(B)?w("",!0):(o(),r("div",{key:1,class:"review-pane-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerdown:Te},null,32)),a("section",oa,[k.value?(o(),r(C,{key:0},[a("div",ra,[a("div",ua,[a("p",da,[T(s(k.value.path)+" ",1),k.value.previousPath?(o(),r(C,{key:0},[T(" ← "+s(k.value.previousPath),1)],64)):w("",!0)]),a("p",ca,s(Z(k.value.operation))+" · +"+s(k.value.addedLineCount)+" / -"+s(k.value.removedLineCount),1)]),oe.value?(o(),r("div",va,[(o(!0),r(C,null,P(xe.value,n=>(o(),r("button",{key:`${k.value.id}:${n.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:i=>ze(n.value,k.value)},s(n.label),9,pa))),128))])):w("",!0)]),k.value.hunks.length===0?(o(),r("div",ha,[a("pre",null,s(k.value.diff||"No unified diff available."),1)])):(o(),r("div",fa,[(o(!0),r(C,null,P(k.value.hunks,n=>(o(),r("article",{key:n.id,class:"review-pane-hunk","data-active":I.value===n.id,onClick:i=>I.value=n.id},[a("div",ma,[a("div",null,[a("p",_a,s(n.header),1),a("p",ya,"+"+s(n.addedLineCount)+" / -"+s(n.removedLineCount),1)]),oe.value?(o(),r("div",ba,[(o(!0),r(C,null,P($e.value,i=>(o(),r("button",{key:`${n.id}:${i.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:f=>Ge(i.value,n)},s(i.label),9,ka))),128))])):w("",!0)]),a("div",ga,[(o(!0),r(C,null,P(n.lines,i=>(o(),r("div",{key:i.key,class:"review-pane-line","data-kind":i.kind},[a("span",Ba,s(i.oldLine??""),1),a("span",Fa,s(i.newLine??""),1),a("span",Sa,s(Me(i.kind)),1),a("code",Ia,s(i.text||" "),1)],8,Ca))),128))])],8,wa))),128))]))],64)):w("",!0)])],4)):(o(),r("div",Xt,[a("p",Kt,s(c(l)("No changes in this scope")),1),a("p",jt,s(Fe.value),1)]))],64)):(o(),r("div",Mt,[a("p",Dt,s(c(l)("This folder is not a Git repository")),1),a("p",Wt,s(c(l)("Initialize Git to review local changes and run Codex review.")),1),a("button",{type:"button",class:"review-pane-primary-cta",disabled:X.value,onClick:Ue},s(X.value?c(l)("Initializing…"):c(l)("Initialize Git")),9,Vt)])):(o(),r("div",Rt,[a("p",Tt,s(c(l)("Loading review state")),1)]))]),ae(et,{name:"review-pane-sheet"},{default:Ze(()=>{var n;return[c(B)&&O.value&&((n=d.value)!=null&&n.files.length)?(o(),r("div",{key:0,class:"review-pane-sheet-backdrop",onClick:t[8]||(t[8]=i=>O.value=!1)},[a("div",{class:"review-pane-sheet",onClick:t[7]||(t[7]=se(()=>{},["stop"]))},[t[13]||(t[13]=a("div",{class:"review-pane-sheet-handle","aria-hidden":"true"},null,-1)),a("div",La,[a("p",xa,s(c(l)("Changed files")),1),a("p",$a,s(d.value.files.length),1)]),a("div",Aa,[(o(!0),r(C,null,P(de.value,i=>{var f;return o(),r(C,{key:`sheet:${i.treeKey}`},[i.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder review-pane-tree-folder-sheet",style:U(fe(i.depth)),"data-expanded":D(i.id),onClick:_=>pe(i.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(i.id)},null,8,Pa),a("span",Na,s(i.name),1),a("span",Ra,s(i.fileCount),1)],12,Ea)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(we()),"data-active":((f=k.value)==null?void 0:f.id)===i.file.id,title:i.file.path,onClick:_=>ee(i.file.id)},[a("span",Ma,[a("span",Da,[T(s(i.name)+" ",1),i.file.previousPath?(o(),r(C,{key:0},[T(" ← "+s(ce(i.file.previousPath)),1)],64)):w("",!0)]),a("span",Wa,[a("span",Va,"+"+s(i.file.addedLineCount),1),t[12]||(t[12]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",za,"-"+s(i.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":i.file.operation},s(Z(i.file.operation)),9,Ga)],12,Ta))],64)}),128))])])])):w("",!0)]}),_:1})],34)}}}),Ka=it(Oa,[["__scopeId","data-v-b6468d35"]]);export{Ka as default};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{d as G,o as l,c as Y,a as d,w as Se,b as v,t as y,n as N,e as L,T as Ts,_ as U,u as T,F as E,r as H,f as ie,g as j,I as lo,h as Ls,i as zt,j as ee,k as M,l as ce,m as Xt,p as We,q as O,s as Nt,v as co,x as Is,y as uo,z as Ms,A as Ps,B as nt,C as Ss,D as As,E as Es,G as Un,H as Fs,J as Bs,K as Rs,L as Os}from"./index-CL3S5U3K.js";import{s as Rt}from"./sanitizeHtml-LuNwludj.js";function Hs(e){if(!e||/[\r\n]/u.test(e)||e.endsWith("/")||e.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(e))return!1;const n=e.startsWith("/"),o=/^[A-Za-z]:[\\/]/u.test(e),i=e.startsWith("./")||e.startsWith("../")||e.startsWith("~/");return n||o||i||/^[A-Za-z0-9._@() -]+\.[A-Za-z0-9]{1,12}$/u.test(e)?!0:/^[A-Za-z0-9._@() -]+(?:[\\/][A-Za-z0-9._@() -]+)+$/u.test(e)}function at(e){return e.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||e}function Ae(e){return e.replace(/\\/gu,"/")}function fo(e){if(!e.startsWith("file://"))return e;let n=e.replace(/^file:\/\//u,"");try{n=decodeURIComponent(n)}catch{}return/^\/[A-Za-z]:\//u.test(n)&&(n=n.slice(1)),n}function Ds(e){const n=Ae(e),o=n.match(/^\/Users\/([^/]+)/u);if(o)return`/Users/${o[1]}`;const i=n.match(/^\/home\/([^/]+)/u);return i?`/home/${i[1]}`:""}function Me(e){const n=Ae(e);if(!n)return n;let o="",i=n;const a=i.match(/^([A-Za-z]:)(\/.*)?$/u);a?(o=`${a[1]}/`,i=(a[2]??"").replace(/^\/+/u,"")):i.startsWith("/")&&(o="/",i=i.slice(1));const f=i.split("/").filter(Boolean),c=[];for(const g of f)if(g!=="."){if(g===".."){c.length>0&&c.pop();continue}c.push(g)}const u=c.join("/");return o?`${o}${u}`.replace(/\/+$/u,"")||o:u||n}function ho(e,n){const o=Ae(fo(e.trim()));if(!o)return"";if(o.startsWith("/")||/^[A-Za-z]:\//u.test(o))return Me(o);if(o.startsWith("~/")){const f=Ds(n);if(f)return Me(`${f}/${o.slice(2)}`)}const a=Ae(n.trim());return Me(a?`${a.replace(/\/+$/u,"")}/${o}`:o)}function it(e){let n=e,o="",i="";const a={"(":")","[":"]","{":"}","<":">",'"':'"',"'":"'","`":"`","“":"”","‘":"’"};for(;n.length>0;){const f=n[0],c=Object.prototype.hasOwnProperty.call(a,f)?a[f]:"";if(!c||!n.endsWith(c))break;o+=f,i+=c,n=n.slice(1,-1)}return{core:n,leading:o,trailing:i}}function ze(e){if(!e)return null;let n=e.trim();n=it(n).core.trim();let i=null;const a=n.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(a)n=a[1],i=Number(a[2]);else{const f=n.match(/^(.*):(\d+)(?::\d+)?$/u);f&&(n=f[1],i=Number(f[2]))}return n=fo(n),Hs(n)?{path:n,line:i}:null}function Vn(e,n,o){let i=0,a=n-1;for(;a>=o&&e[a]==="*";)i+=1,a-=1;return i}function js(e,n){let o=0,i=n;for(;i<e.length&&e[i]==="*";)o+=1,i+=1;return o}function mo(e,n,o,i,a){const f=Vn(e,n,i);return f<2?null:js(e,o)>=f?{segmentStart:n-f,segmentEnd:o+f,tokenEndTrim:0}:Vn(a,a.length,0)>=f?{segmentStart:n-f,segmentEnd:o,tokenEndTrim:f}:null}function qt(e){const n=e.trim();if(!n.startsWith("[")||!n.endsWith(")"))return null;const o=n.indexOf("]");if(o<=1||n[o+1]!=="(")return null;const i=n.slice(1,o).trim(),a=n.slice(o+2,-1).trim();if(i.includes(`
|
|
2
|
+
`)||a.includes(`
|
|
3
|
+
`))return null;const f=it(i).core.trim()||i,c=it(a).core.trim();return c?{label:f,target:c}:null}function rt(e){const n=e.trim().match(/^codex:\/\/threads\/([A-Za-z0-9-]+)$/u);if(!n)return null;if(typeof window>"u")return`/#/thread/${n[1]}`;const o=window.location.pathname.replace(/\/?$/u,"/");return`${window.location.origin}${o}#/thread/${n[1]}`}function Kn(e){const n=Math.min(6,Math.max(1,Math.trunc(e)));return`h${String(n)}`}function Gn(e){switch(Math.min(6,Math.max(1,Math.trunc(e)))){case 1:return"message-heading-h1";case 2:return"message-heading-h2";case 3:return"message-heading-h3";case 4:return"message-heading-h4";case 5:return"message-heading-h5";default:return"message-heading-h6"}}function Ws(e){const n=e.trim();if(!n)return"";if(n.startsWith("data:")||n.startsWith("blob:")||n.startsWith("http://")||n.startsWith("https://")||n.startsWith("/codex-local-image?"))return n;if(n.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(n)}`;const o=n.startsWith("/"),i=/^[A-Za-z]:[\\/]/u.test(n);return o||i?`/codex-local-image?path=${encodeURIComponent(n)}`:n}function Pe(e,n={}){const o=[],i=/codex:\/\/threads\/[A-Za-z0-9-]+|https?:\/\/[^\s<>"'`,。;:!?、()[\]{}「」『』《》]+|file:\/\/[^\n<>"'`,。;:!?、[\]{}「」『』《》]+|["'](?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^\n"']+["']|`(?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^`\n]+`/gu;let a=0;for(const f of e.matchAll(i)){if(typeof f.index!="number")continue;const c=f.index,u=c+f[0].length;let g=f[0],p="";for(;/[.,;:!?,。;:!?、]$/u.test(g);)p=g.slice(-1)+p,g=g.slice(0,-1);const b=mo(e,c,u,a,g),I=(b==null?void 0:b.segmentStart)??c,A=(b==null?void 0:b.segmentEnd)??u;I>a&&o.push({kind:"text",value:e.slice(a,I)}),b!=null&&b.tokenEndTrim&&(g=g.slice(0,-b.tokenEndTrim));const x=it(g);g=x.core;const P=x.leading,w=x.trailing+p;P&&o.push({kind:"text",value:P});const F=rt(g);if(F)o.push({kind:"url",value:F,href:F}),w&&o.push({kind:"text",value:w});else if(g.startsWith("**")&&g.endsWith("**")&&g.length>4)o.push({kind:"bold",value:g.slice(2,-2)}),w&&o.push({kind:"text",value:w});else if(/^https?:\/\//u.test(g))o.push({kind:"url",value:g,href:g}),w&&o.push({kind:"text",value:w});else{const B=ze(g);B?(o.push({kind:"file",value:g,path:B.path,displayPath:g,downloadName:at(B.path)}),w&&o.push({kind:"text",value:w})):o.push({kind:"text",value:f[0]})}a=A}return a<e.length&&o.push({kind:"text",value:e.slice(a)}),n.applyMarkdownMarkers===!1?o:go(o)}function Ot(e,n){const o=[];let i=!1,a="";const f=c=>{c&&o.push({kind:"text",value:c})};for(const c of e){if(c.kind!=="text"){i&&(f(`${n.marker}${a}`),i=!1,a=""),o.push(c);continue}let u=c.value;for(;u.length>0;){const g=u.indexOf(n.marker);if(g<0){i?a+=u:f(u);break}const p=u.slice(0,g);if(i?a+=p:f(p),u=u.slice(g+n.marker.length),i){const b=a;b.length>0&&(!n.isValidContent||n.isValidContent(b))?o.push({kind:n.kind,value:b}):f(`${n.marker}${b}${n.marker}`),a="",i=!1}else i=!0}}return i&&f(`${n.marker}${a}`),o}function go(e){const n=i=>i.trim().length>0&&!/^\s/u.test(i)&&!/\s$/u.test(i);let o=Ot(e,{marker:"**",kind:"bold",isValidContent:n});return o=Ot(o,{marker:"~~",kind:"strikethrough",isValidContent:n}),o=Ot(o,{marker:"*",kind:"italic",isValidContent:n}),o}function zs(e,n={}){const o=[];let i=0,a=0;const f=(c,u)=>{let g=c.indexOf("[",u);for(;g>=0;){const p=c.indexOf("]",g+1);if(p<0)return null;if(c[p+1]!=="("){g=c.indexOf("[",g+1);continue}let b=1,I=p+2,A=!1;for(;I<c.length;){const x=c[I];if(x===`
|
|
4
|
+
`){A=!0;break}if(x==="("&&(b+=1),x===")"&&(b-=1,b===0)){const P=c.slice(g,I+1);if(qt(P))return{start:g,end:I+1,token:P};break}I+=1}if(A){g=c.indexOf("[",g+1);continue}g=c.indexOf("[",g+1)}return null};for(;a<e.length;){const c=f(e,a);if(!c)break;const{start:u,end:g,token:p}=c,b=mo(e,u,g,i,p),I=(b==null?void 0:b.segmentStart)??u,A=(b==null?void 0:b.segmentEnd)??g;I>i&&o.push(...Pe(e.slice(i,I),n));const x=qt(p);if(!x){o.push(...Pe(e.slice(I,A),n)),i=A,a=A;continue}const P=x.label,w=x.target,F=rt(w);if(F)o.push({kind:"url",value:P||F,href:F});else if(/^https?:\/\//u.test(w))o.push({kind:"url",value:P||w,href:w});else{const B=ze(w);B?o.push({kind:"file",value:w,path:B.path,displayPath:P||w,downloadName:at(B.path)}):o.push({kind:"text",value:p})}i=A,a=A}return i<e.length&&o.push(...Pe(e.slice(i),n)),o}function Ns(e){const n=e.includes("`"),o=zs(e,{applyMarkdownMarkers:!n});if(!n)return o;if(!o.some(a=>a.kind==="text"&&a.value.includes("`")))return go(o);const i=a=>{if(!a.includes("`"))return Pe(a);const f=[];let c=0,u=0;for(;c<a.length;){if(a[c]!=="`"){c+=1;continue}let g=1;for(;c+g<a.length&&a[c+g]==="`";)g+=1;const p="`".repeat(g);let b=c+g,I=-1;for(;b<a.length;){const x=a.indexOf(p,b);if(x<0)break;const P=x>0&&a[x-1]==="`",w=x+g<a.length&&a[x+g]==="`",F=a.slice(c+g,x).includes(`
|
|
5
|
+
`);if(!P&&!w&&!F){I=x;break}b=x+1}if(I<0){c+=g;continue}c>u&&f.push(...Pe(a.slice(u,c)));const A=a.slice(c+g,I);if(A.length>0){const x=qt(A);if(x){const P=rt(x.target);if(P)f.push({kind:"url",value:x.label||P,href:P});else if(/^https?:\/\//u.test(x.target))f.push({kind:"url",value:x.label||x.target,href:x.target});else{const w=ze(x.target);w?f.push({kind:"file",value:x.target,path:w.path,displayPath:x.label||x.target,downloadName:at(w.path)}):f.push({kind:"code",value:A})}}else{const P=rt(A);if(P)f.push({kind:"url",value:P,href:P});else if(/^https?:\/\/[^\s]+$/u.test(A))f.push({kind:"url",value:A,href:A});else{const w=ze(A);if(w){const F=w.line?`${w.path}:${String(w.line)}`:w.path;f.push({kind:"file",value:A,path:w.path,displayPath:F,downloadName:at(w.path)})}else f.push({kind:"code",value:A})}}}else f.push({kind:"text",value:`${p}${p}`});c=I+g,u=c}return u<a.length&&f.push(...Pe(a.slice(u))),f};return o.flatMap(a=>a.kind==="text"?i(a.value):[a])}function po(e){return e.replace(/\r\n/gu,`
|
|
6
|
+
`)}function ue(e){var o;return(((o=e.match(/^\s*/u))==null?void 0:o[0])??"").replace(/\t/gu," ").length}function vo(e,n){if(n<=0)return e.trimStart();let o=0,i=0;for(;o<e.length&&i<n;){const a=e[o];i+=a===" "?4:1,o+=1}return e.slice(o)}function de(e){return e.trim().length===0}function Ut(e){const n=e.match(/^\s{0,3}(#{1,6})\s+(.+)$/u);return n?{level:n[1].length,value:n[2].trim()}:null}function ot(e){const n=e.match(/^\s{0,3}>\s?(.*)$/u);return n?n[1]??"":null}function Ne(e){var o;const n=e.match(/^\s*[-*+]\s+(.+)$/u);return((o=n==null?void 0:n[1])==null?void 0:o.trim())??null}function qs(e){var o;const n=e.match(/^(\s*)[-*+]\s+(.+)$/u);return n?{indent:ue(n[1]??""),text:((o=n[2])==null?void 0:o.trim())??""}:null}function qe(e){var o;const n=e.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{checked:(n[1]??" ").toLowerCase()==="x",text:((o=n[2])==null?void 0:o.trim())??""}:null}function Zn(e){var o;const n=e.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{indent:ue(n[1]??""),item:{checked:(n[2]??" ").toLowerCase()==="x",text:((o=n[3])==null?void 0:o.trim())??""}}:null}function ko(e){var o;const n=e.match(/^(\s*)(\d+)[.)]\s+(.+)$/u);return n?{indent:ue(n[1]??""),start:Number.parseInt(n[2]??"1",10)||1,text:((o=n[3])==null?void 0:o.trim())??""}:null}function Vt(e){var n;return((n=ko(e))==null?void 0:n.text)??null}function Jn(e){return ko(e)}function Kt(e){const n=e.trim();if(!n.includes("|"))return null;let o=n;o.startsWith("|")&&(o=o.slice(1)),o.endsWith("|")&&(o=o.slice(0,-1));const i=[];let a="",f=0;for(let c=0;c<o.length;c+=1){const u=o[c];if(u==="\\"&&o[c+1]==="|"){a+="|",c+=1;continue}if(u==="`"){let g=1;for(;o[c+g]==="`";)g+=1;a+=o.slice(c,c+g),f===0?f=g:f===g&&(f=0),c+=g-1;continue}if(u==="|"&&f===0){i.push(a.trim()),a="";continue}a+=u}return i.push(a.trim()),i.some(c=>c.length>0)?i:null}function Us(e){const n=Kt(e);if(!n||n.length===0)return null;const o=n.map(i=>{const a=i.replace(/\s+/gu,"");if(!/^:?-{3,}:?$/u.test(a))return null;const f=a.startsWith(":"),c=a.endsWith(":");return f&&c?"center":c?"right":f?"left":null});return o.every((i,a)=>i!==null||/^-+$/u.test(n[a].replace(/\s+/gu,"")))?o:null}function Yn(e,n){return e.length===n?e:e.length>n?e.slice(0,n):[...e,...Array.from({length:n-e.length},()=>"")]}function Qn(e,n){var b;if(n+1>=e.length)return null;const o=e[n],i=e[n+1],a=Kt(o),f=Us(i);if(!a||!f||a.length!==f.length)return null;const c=o.trim();if(!c.startsWith("|")&&(((b=c.match(/\|/gu))==null?void 0:b.length)??0)<2)return null;const u=a.length,g=[];let p=n+2;for(;p<e.length&&!de(e[p]);){const I=Kt(e[p]);if(!I)break;g.push(Yn(I,u)),p+=1}return{kind:"table",headers:Yn(a,u),rows:g,alignments:f}}function Vs(e){return de(e)||lt(e)!==null||Gt(e)||Ut(e)!==null||ot(e)!==null||qe(e)!==null||Ne(e)!==null||Vt(e)!==null}function Ks(e,n,o=-1){const i=[];let a=n;for(;a<e.length&&!(Vs(e[a])||o>=0&&ue(e[a])<=o);)i.push(o>=0?vo(e[a],o+1):e[a]),a+=1;const f=i.join(`
|
|
7
|
+
`).trim();return f?{value:f,nextIndex:a}:null}function yo(e,n){for(let o=n;o<e.length;o+=1)if(!de(e[o]))return o;return-1}function Gs(e,n,o,i=null,a=!1){const f=[];let c=n;for(;c<e.length;){const u=e[c];if(de(u)){const I=yo(e,c+1);if(I===-1){f.push(""),c=e.length;break}const A=i==null?void 0:i(e[I]);if(A&&A.indent===o||ue(e[I])<=o)break;f.push(""),c+=1;continue}const g=i==null?void 0:i(u);if(g&&g.indent===o)break;const p=ue(u),b=a&&(qe(u)!==null||Ne(u)!==null);if(p<=o&&!b)break;f.push(p>o?vo(u,o+1):u.trimStart()),c+=1}for(;f.length>0&&de(f[0]);)f.shift();for(;f.length>0&&de(f[f.length-1]);)f.pop();return f.length===0?null:{blocks:st(f.join(`
|
|
8
|
+
`)),nextIndex:c}}function Xn(e,n,o,i=!1){const a=[];let f=n;const c=o(e[n]);if(!c)return null;const u=c.indent;for(;f<e.length;){const g=o(e[f]);if(g===null||g.indent!==u)break;const p=[g.text],b=[];for(f+=1;f<e.length;){if(de(e[f])){const w=yo(e,f+1);if(w===-1){f=e.length;break}const F=o(e[w]);if(F&&F.indent===u){f=w;break}if(ue(e[w])<=u){f=w;break}f+=1;continue}const I=o(e[f]);if(I&&I.indent===u)break;const A=ue(e[f])>u,x=i&&(qe(e[f])!==null||Ne(e[f])!==null);if(A||x){const w=Gs(e,f,u,o,i);if(w){b.push(...w.blocks),f=w.nextIndex;continue}}if(ue(e[f])<=u)break;const P=Ks(e,f,u);if(!P)break;p.push(P.value),f=P.nextIndex}a.push(b.length>0?{paragraphs:p,children:b}:{paragraphs:p})}return a.length>0?{items:a,nextIndex:f}:null}function Gt(e){return/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/u.test(e.trim())}function lt(e){const n=e.match(/^\s{0,3}(```+|~~~+)\s*([^\s`~][^`]*)?\s*$/u);return n?{marker:n[1],language:(n[2]??"").trim()}:null}function st(e){var f;const o=po(e).split(`
|
|
9
|
+
`),i=[];let a=0;for(;a<o.length;){if(de(o[a])){a+=1;continue}const c=lt(o[a]);if(c){a+=1;const w=[];for(;a<o.length;){if(o[a].trim()===c.marker){a+=1;break}w.push(o[a]),a+=1}i.push({kind:"codeBlock",language:c.language,value:w.join(`
|
|
10
|
+
`)});continue}if(Gt(o[a])){i.push({kind:"thematicBreak"}),a+=1;continue}const u=Ut(o[a]);if(u){i.push({kind:"heading",level:u.level,value:u.value}),a+=1;continue}if(ot(o[a])!==null){const w=[];for(;a<o.length;){const F=ot(o[a]);if(F===null)break;w.push(F),a+=1}i.push({kind:"blockquote",value:w.join(`
|
|
11
|
+
`).trim()});continue}const p=Qn(o,a);if(p){i.push(p),a+=2+p.rows.length;continue}if(qe(o[a])!==null){const w=[],F=((f=Zn(o[a]))==null?void 0:f.indent)??0;for(;a<o.length;){const B=Zn(o[a]);if(B===null||B.indent!==F)break;w.push(B.item),a+=1}if(w.length>0){i.push({kind:"taskList",items:w});continue}}const I=Ne(o[a]);if(I!==null){const w=Xn(o,a,qs);if(w){i.push({kind:"unorderedList",items:w.items}),a=w.nextIndex;continue}if(I.length>0){i.push({kind:"unorderedList",items:[{paragraphs:[I]}]}),a+=1;continue}}const A=Vt(o[a]);if(A!==null){const w=Jn(o[a]),F=Xn(o,a,Jn,!0);if(F){i.push({kind:"orderedList",items:F.items,start:(w==null?void 0:w.start)??1}),a=F.nextIndex;continue}if(A.length>0){i.push({kind:"orderedList",items:[{paragraphs:[A]}],start:(w==null?void 0:w.start)??1}),a+=1;continue}}const x=[];for(;a<o.length&&!(de(o[a])||lt(o[a])||Gt(o[a])||Ut(o[a])||Qn(o,a)||ot(o[a])!==null||qe(o[a])!==null||Ne(o[a])!==null||Vt(o[a])!==null);)x.push(o[a]),a+=1;const P=x.join(`
|
|
12
|
+
`).trim();P&&i.push({kind:"paragraph",value:P})}return i}function Zs(e){if(!e.includes(")return st(e);const n=[],o=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let i=0;for(const a of e.matchAll(o)){const[f,c,u]=a;if(typeof a.index!="number")continue;const g=a.index,p=g+f.length,b=Ws(u.trim());b&&(g>i&&n.push(...st(e.slice(i,g))),n.push({kind:"image",url:b,alt:c.trim(),markdown:f}),i=p)}return i<e.length&&n.push(...st(e.slice(i))),n}function eo(e){const o=po(e).split(`
|
|
13
|
+
`),i=[];let a=0,f=0;const c=u=>{if(u<=f)return;const g=o.slice(f,u).join(`
|
|
14
|
+
`);i.push(...Zs(g))};for(;a<o.length;){const u=lt(o[a]);if(!u){a+=1;continue}c(a),a+=1;const g=[];for(;a<o.length;){if(o[a].trim()===u.marker){a+=1;break}g.push(o[a]),a+=1}i.push({kind:"codeBlock",language:u.language,value:g.join(`
|
|
15
|
+
`)}),f=a}return c(o.length),i.length>0?i:[{kind:"paragraph",value:e}]}const bo={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",yml:"yaml",md:"markdown","c++":"cpp","c#":"csharp",ps1:"powershell"};function K(e){return`${e.path}\0${e.movedToPath??""}`}function Js(e,n){return e?!n||e===n?e:`${e}
|
|
16
|
+
${n}`.trim():n}function Ys(e,n){const o=e.operation==="add"||n.operation==="add"?"add":e.operation==="delete"||n.operation==="delete"?"delete":"update";return{path:n.path||e.path,operation:o,movedToPath:n.movedToPath??e.movedToPath??null,diff:Js(e.diff,n.diff),addedLineCount:e.addedLineCount+n.addedLineCount,removedLineCount:e.removedLineCount+n.removedLineCount}}function Qs(e,n){const o=e.operation==="add"?0:e.operation==="update"?1:2,i=n.operation==="add"?0:n.operation==="update"?1:2;if(o!==i)return o-i;const a=`${e.path}\0${e.movedToPath??""}`,f=`${n.path}\0${n.movedToPath??""}`;return a.localeCompare(f)}function Ht(e){const n=new Map;for(const o of e){const i=`${o.path}\0${o.movedToPath??""}`,a=n.get(i);n.set(i,a?Ys(a,o):{...o})}return Array.from(n.values()).sort(Qs)}function en(e,n){return e.operation==="update"&&e.movedToPath?e.addedLineCount>0||e.removedLineCount>0?n("Moved + edited"):n("Moved"):e.operation==="add"?n("Added"):e.operation==="delete"?n("Deleted"):n("Edited")}function Xs(e){return e.operation==="update"&&e.movedToPath?"→":e.operation==="add"?"+":e.operation==="delete"?"−":"M"}function Zt(e){return e.operation==="update"&&e.movedToPath?"move":e.operation}function $e(e){const n=[];return e.addedLineCount>0&&n.push(`+${e.addedLineCount}`),e.removedLineCount>0&&n.push(`-${e.removedLineCount}`),n.join(" ")}function wo(e,n,o=""){const i=[];return e>0&&i.push({tone:"add",label:`+${e}`}),n>0&&i.push({tone:"remove",label:`-${n}`}),i.length>0?i:o?[{tone:"neutral",label:o}]:[]}function ea(e){return wo(e.addedLineCount,e.removedLineCount)}function $o(e,n){return e===1?`1 ${n("file changed")}`:`${e} ${n("files changed")}`}function ta(e,n){if(!e||e.changes.length===0)return"";let o=0,i=0,a=0,f=0;for(const u of e.changes){if(u.operation==="add"){o+=1;continue}if(u.operation==="delete"){i+=1;continue}if(u.movedToPath){f+=1;continue}a+=1}const c=[];return a>0&&c.push(`${a} ${n("edited")}`),o>0&&c.push(`${o} ${n("added")}`),i>0&&c.push(`${i} ${n("deleted")}`),f>0&&c.push(`${f} ${n("moved")}`),c.join(", ")}function na(e,n){if(!e||e.changes.length===0)return n("Modified files");const o=$o(e.changes.length,n),i=ta(e,n);return i?`${o} · ${i}`:o}function oa(e){if(!e||e.changes.length===0)return[];const n=e.changes.reduce((a,f)=>a+f.addedLineCount,0),o=e.changes.reduce((a,f)=>a+f.removedLineCount,0),i=e.changes.some(a=>a.movedToPath)?"Moved":"Ready";return wo(n,o,i)}function Ee(e,n){const o=ho(e,n),i=Me(Ae(n.trim())),a=Me(Ae(o));return i&&a.startsWith(`${i}/`)?a.slice(i.length+1):e}function sa(e,n,o){if(!e||e.changes.length===0)return"";const i=e.changes.map(a=>{const f=Ee(a.path,n),c=a.movedToPath?` -> ${Ee(a.movedToPath,n)}`:"",u=$e(a);return`- ${en(a,o)}: ${f}${c}${u?` (${u})`:""}`});return`${o("Modified files")}:
|
|
17
|
+
${i.join(`
|
|
18
|
+
`)}`.trim()}function aa(e){var i;const o=((i=(e.movedToPath||e.path).split(".").pop())==null?void 0:i.toLowerCase())??"";return bo[o]??o??""}function ia(e){return e.operation==="update"&&/^diff --git |^@@ |^--- |^\+\+\+ |^[ +-]|^\*\*\* (Move to:|End of File)/mu.test(e.diff)}function ra(e){const n=e.diff.replace(/\r\n/g,`
|
|
19
|
+
`),o=n.length>0?n.split(`
|
|
20
|
+
`):[];return o.length>0&&o[o.length-1]===""&&o.pop(),o.map((i,a)=>({key:`${K(e)}:synthetic:${a}`,kind:e.operation==="delete"?"remove":"add",oldLine:e.operation==="delete"?a+1:null,newLine:e.operation==="delete"?null:a+1,text:i}))}function la(e){const n=e.diff.replace(/\r\n/g,`
|
|
21
|
+
`),o=n.length>0?n.split(`
|
|
22
|
+
`):[];o.length>0&&o[o.length-1]===""&&o.pop();const i=[];let a=0,f=0;for(const[c,u]of o.entries()){const g=u.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/u);if(g){a=Number(g[1]),f=Number(g[2]),i.push({key:`${K(e)}:hunk:${c}`,kind:"hunk",oldLine:null,newLine:null,text:u});continue}if(u.startsWith("+")&&!u.startsWith("+++")){i.push({key:`${K(e)}:add:${c}`,kind:"add",oldLine:null,newLine:f,text:u.slice(1)}),f+=1;continue}if(u.startsWith("-")&&!u.startsWith("---")){i.push({key:`${K(e)}:remove:${c}`,kind:"remove",oldLine:a,newLine:null,text:u.slice(1)}),a+=1;continue}if(u.startsWith(" ")){i.push({key:`${K(e)}:context:${c}`,kind:"context",oldLine:a,newLine:f,text:u.slice(1)}),a+=1,f+=1;continue}i.push({key:`${K(e)}:meta:${c}`,kind:"meta",oldLine:null,newLine:null,text:u})}return i}function ca(e){return!e||!e.diff.trim()?[]:ia(e)?la(e):ra(e)}function ua(e){return!!(e!=null&&e.diff.trim())}function da(e){return e.kind==="add"?"+":e.kind==="remove"?"-":e.kind==="hunk"?"@@":""}const fa=["aria-label"],ha={class:"confirm-dialog-title"},ma={class:"confirm-dialog-message"},ga={class:"confirm-dialog-actions"},pa=G({__name:"ConfirmDialog",props:{visible:{type:Boolean},title:{},message:{},confirmLabel:{default:""},cancelLabel:{default:""},danger:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(e){return(n,o)=>(l(),Y(Ts,{to:"body"},[e.visible?(l(),d("div",{key:0,class:"confirm-dialog-overlay",onClick:o[2]||(o[2]=Se(i=>n.$emit("cancel"),["self"]))},[v("div",{class:"confirm-dialog-panel",role:"alertdialog","aria-modal":"true","aria-label":e.title},[v("h3",ha,y(e.title),1),v("p",ma,y(e.message),1),v("div",ga,[v("button",{class:"confirm-dialog-btn confirm-dialog-btn-cancel",type:"button",onClick:o[0]||(o[0]=i=>n.$emit("cancel"))},y(e.cancelLabel||"Cancel"),1),v("button",{class:N(["confirm-dialog-btn confirm-dialog-btn-confirm",{"is-danger":e.danger}]),type:"button",onClick:o[1]||(o[1]=i=>n.$emit("confirm"))},y(e.confirmLabel||"Confirm"),3)])],8,fa)])):L("",!0)]))}}),va=U(pa,[["__scopeId","data-v-30493aaa"]]),ka={key:0,class:"diff-viewer-sidebar"},ya={class:"diff-viewer-sidebar-header"},ba={class:"diff-viewer-sidebar-title"},wa={class:"diff-viewer-sidebar-count"},$a={class:"diff-viewer-sidebar-list"},xa=["data-active","onClick"],_a=["data-operation"],Ca={class:"diff-viewer-file-label"},Ta={key:0,class:"diff-viewer-file-delta"},La={class:"diff-viewer-main"},Ia={class:"diff-viewer-toolbar"},Ma={class:"diff-viewer-title-wrap"},Pa={class:"diff-viewer-title"},Sa={class:"diff-viewer-subtitle"},Aa={key:0},Ea={class:"diff-viewer-toolbar-actions"},Fa=["aria-label"],Ba={key:0,class:"diff-viewer-empty"},Ra={class:"diff-viewer-empty-title"},Oa={class:"diff-viewer-empty-text"},Ha={key:1,class:"diff-viewer-panel"},Da={class:"diff-viewer-meta"},ja={class:"diff-viewer-language"},Wa={class:"diff-viewer-lines"},za=["data-kind"],Na={class:"diff-viewer-line-number"},qa={class:"diff-viewer-line-number"},Ua={class:"diff-viewer-line-marker"},Va=["innerHTML"],Ka={class:"diff-viewer-mobile-sheet-header"},Ga={class:"diff-viewer-sidebar-title"},Za={class:"diff-viewer-sidebar-count"},Ja={class:"diff-viewer-mobile-sheet-list"},Ya=["data-active","onClick"],Qa=["data-operation"],Xa={class:"diff-viewer-file-label"},ei={key:0,class:"diff-viewer-file-delta"},ti=G({__name:"DiffViewer",props:{change:{},changes:{},lines:{},isMobile:{type:Boolean},isFileListOpen:{type:Boolean},cwd:{}},emits:["close","select-change","toggle-file-list","close-file-list"],setup(e){const n=e,{t:o}=ee();function i(u){return u.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}const a=M(()=>u=>en(u,o)),f=M(()=>u=>$o(u,o)),c=M(()=>u=>Ee(u,n.cwd));return(u,g)=>e.change?(l(),d("div",{key:0,class:"diff-viewer-backdrop",onClick:g[5]||(g[5]=p=>u.$emit("close"))},[v("div",{class:"diff-viewer-shell",onClick:g[4]||(g[4]=Se(()=>{},["stop"]))},[e.isMobile?L("",!0):(l(),d("aside",ka,[v("div",ya,[v("p",ba,y(T(o)("Changed files")),1),v("p",wa,y(f.value(e.changes.length)),1)]),v("div",$a,[(l(!0),d(E,null,H(e.changes,p=>(l(),d("button",{key:`diff-viewer:${T(K)(p)}`,type:"button",class:"diff-viewer-file-button","data-active":T(K)(p)===T(K)(e.change),onClick:b=>u.$emit("select-change",p)},[v("span",{class:"file-change-badge","data-operation":T(Zt)(p)},y(a.value(p)),9,_a),v("span",Ca,[ie(y(c.value(p.path))+" ",1),p.movedToPath?(l(),d(E,{key:0},[ie(" → "+y(c.value(p.movedToPath)),1)],64)):L("",!0)]),T($e)(p)?(l(),d("span",Ta,y(T($e)(p)),1)):L("",!0)],8,xa))),128))])])),v("section",La,[v("div",Ia,[v("div",Ma,[v("p",Pa,[ie(y(c.value(e.change.path))+" ",1),e.change.movedToPath?(l(),d(E,{key:0},[ie(" → "+y(c.value(e.change.movedToPath)),1)],64)):L("",!0)]),v("p",Sa,[ie(y(a.value(e.change))+" ",1),T($e)(e.change)?(l(),d("span",Aa," · "+y(T($e)(e.change)),1)):L("",!0)])]),v("div",Ea,[e.isMobile?(l(),d("button",{key:0,type:"button",class:"diff-viewer-mobile-files-button",onClick:g[0]||(g[0]=p=>u.$emit("toggle-file-list"))},y(f.value(e.changes.length)),1)):L("",!0),v("button",{class:"image-modal-close diff-viewer-close",type:"button","aria-label":T(o)("Close diff viewer"),onClick:g[1]||(g[1]=p=>u.$emit("close"))},[j(lo,{class:"icon-svg"})],8,Fa)])]),T(ua)(e.change)?(l(),d("div",Ha,[v("div",Da,[v("span",ja,y(T(aa)(e.change)||"diff"),1)]),v("div",Wa,[(l(!0),d(E,null,H(e.lines,p=>(l(),d("div",{key:p.key,class:"diff-viewer-line","data-kind":p.kind},[v("span",Na,y(p.oldLine??""),1),v("span",qa,y(p.newLine??""),1),v("span",Ua,y(T(da)(p)),1),v("code",{class:"diff-viewer-line-code",innerHTML:i(p.text)||" "},null,8,Va)],8,za))),128))])])):(l(),d("div",Ba,[v("p",Ra,y(T(o)("No diff available")),1),v("p",Oa,y(T(o)("This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.")),1)]))]),j(Ls,{name:"diff-viewer-sheet"},{default:zt(()=>[e.isMobile&&e.isFileListOpen?(l(),d("div",{key:0,class:"diff-viewer-mobile-sheet-backdrop",onClick:g[3]||(g[3]=p=>u.$emit("close-file-list"))},[v("div",{class:"diff-viewer-mobile-sheet",onClick:g[2]||(g[2]=Se(()=>{},["stop"]))},[g[6]||(g[6]=v("div",{class:"diff-viewer-mobile-sheet-handle","aria-hidden":"true"},null,-1)),v("div",Ka,[v("p",Ga,y(T(o)("Changed files")),1),v("p",Za,y(f.value(e.changes.length)),1)]),v("div",Ja,[(l(!0),d(E,null,H(e.changes,p=>(l(),d("button",{key:`diff-viewer-sheet:${T(K)(p)}`,type:"button",class:"diff-viewer-file-button","data-active":T(K)(p)===T(K)(e.change),onClick:b=>u.$emit("select-change",p)},[v("span",{class:"file-change-badge","data-operation":T(Zt)(p)},y(a.value(p)),9,Qa),v("span",Xa,[ie(y(c.value(p.path))+" ",1),p.movedToPath?(l(),d(E,{key:0},[ie(" → "+y(c.value(p.movedToPath)),1)],64)):L("",!0)]),T($e)(p)?(l(),d("span",ei,y(T($e)(p)),1)):L("",!0)],8,Ya))),128))])])])):L("",!0)]),_:1})])])):L("",!0)}}),ni=U(ti,[["__scopeId","data-v-6b07ab3a"]]),oi={},si={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ai(e,n){return l(),d("svg",si,[...n[0]||(n[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Jt=U(oi,[["render",ai]]),ii={class:"file-change-summary-label"},ri={class:"file-change-summary-status"},li=["data-tone"],ci={class:"file-change-panel-inner"},ui={class:"file-change-list"},di=["data-operation","title"],fi=["title","onClick"],hi={key:0,class:"file-change-arrow"},mi=["title","onClick"],gi={key:2,class:"file-change-delta"},pi=["data-tone"],vi=["title","aria-label","onClick"],ki={key:0,class:"file-change-actions"},yi={key:0,class:"file-change-action-error"},bi=["disabled","title","aria-label"],wi=G({__name:"FileChangeSummaryBlock",props:{summary:{},expanded:{type:Boolean},inline:{type:Boolean},cwd:{},actionable:{type:Boolean},actionStatus:{},actionErrorText:{},nextAction:{},actionLabel:{}},emits:["toggle","open-diff","request-action","request-file-action"],setup(e){const n=e,{t:o}=ee(),i=M(()=>u=>en(u,o)),a=M(()=>u=>na(u,o)),f=M(()=>u=>Ee(u,n.cwd)),c=M(()=>u=>`${o("Undo")} ${Ee(u.path,n.cwd)}`);return(u,g)=>e.summary?(l(),d("section",{key:0,class:N(["file-change-summary-block",{"file-change-summary-block-inline":e.inline}])},[v("button",{type:"button",class:N(["cmd-row cmd-row-group cmd-compact file-change-summary-row",{"cmd-expanded":e.expanded}]),onClick:g[0]||(g[0]=p=>u.$emit("toggle"))},[v("span",{class:N(["cmd-chevron",{"cmd-chevron-open":e.expanded}])},"▶",2),v("span",ii,y(a.value(e.summary)),1),v("span",ri,[(l(!0),d(E,null,H(T(oa)(e.summary),p=>(l(),d("span",{key:`summary-status:${e.summary.turnId}:${p.tone}:${p.label}`,class:"file-change-signed-count","data-tone":p.tone},y(p.label),9,li))),128))])],2),v("div",{class:N(["cmd-group-wrap",{"cmd-group-visible":e.expanded}])},[v("div",ci,[v("ul",ui,[(l(!0),d(E,null,H(e.summary.changes,p=>(l(),d("li",{key:`file-change:${e.summary.turnId}:${p.path}:${p.movedToPath||""}`,class:"file-change-item"},[v("span",{class:"file-change-badge","data-operation":T(Zt)(p),title:i.value(p)},y(T(Xs)(p)),9,di),v("button",{type:"button",class:"file-change-path-button",title:p.path,onClick:b=>u.$emit("open-diff",p)},y(f.value(p.path)),9,fi),p.movedToPath?(l(),d("span",hi,"→")):L("",!0),p.movedToPath?(l(),d("button",{key:1,type:"button",class:"file-change-path-button",title:p.movedToPath,onClick:b=>u.$emit("open-diff",p)},y(f.value(p.movedToPath)),9,mi)):L("",!0),p.addedLineCount>0||p.removedLineCount>0?(l(),d("span",gi,[(l(!0),d(E,null,H(T(ea)(p),b=>(l(),d("span",{key:`change-delta:${e.summary.turnId}:${p.path}:${b.tone}:${b.label}`,class:"file-change-signed-count","data-tone":b.tone},y(b.label),9,pi))),128))])):L("",!0),e.actionable?(l(),d("button",{key:3,type:"button",class:"file-change-file-undo-button",title:c.value(p),"aria-label":c.value(p),onClick:b=>u.$emit("request-file-action",p)},[j(Jt,{class:"icon-svg file-change-action-icon"})],8,vi)):L("",!0)]))),128))]),e.actionable?(l(),d("div",ki,[e.actionErrorText?(l(),d("p",yi,y(e.actionErrorText),1)):L("",!0),v("button",{type:"button",class:"file-change-action-button",disabled:e.actionStatus==="undoing"||e.actionStatus==="redoing",title:e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn","aria-label":e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn",onClick:g[1]||(g[1]=p=>u.$emit("request-action",e.nextAction))},[j(Jt,{class:N(["icon-svg file-change-action-icon",{"file-change-action-icon-redo":e.nextAction==="redo"}])},null,8,["class"]),ie(" "+y(e.actionLabel),1)],8,bi)])):L("",!0)])],2)],2)):L("",!0)}}),Dt=U(wi,[["__scopeId","data-v-7eef6e2c"]]),$i=G({__name:"FileLinkContextMenu",props:{visible:{type:Boolean},x:{},y:{},browseUrl:{},editUrl:{}},emits:["close"],setup(e,{emit:n}){const o=e,i=n,a=O(null),f=M(()=>({left:`${String(o.x)}px`,top:`${String(o.y)}px`}));function c(){i("close")}function u(){const x=o.browseUrl;c(),!(!x||x==="#")&&window.open(x,"_blank","noopener,noreferrer")}function g(){const x=o.editUrl;c(),!(!x||x==="#")&&window.open(x,"_blank","noopener,noreferrer")}async function p(){const x=o.browseUrl;if(c(),!(!x||x==="#"))try{await Nt(x)}catch{}}function b(x){if(!o.visible)return;const P=a.value;if(!P){c();return}const w=x.target;w instanceof Node&&P.contains(w)||c()}function I(){c()}function A(x){x.key==="Escape"&&c()}return ce(()=>o.visible,x=>{x?(window.addEventListener("pointerdown",b,!0),window.addEventListener("blur",I),window.addEventListener("keydown",A,!0)):(window.removeEventListener("pointerdown",b,!0),window.removeEventListener("blur",I),window.removeEventListener("keydown",A,!0))}),Xt(()=>{window.removeEventListener("pointerdown",b,!0),window.removeEventListener("blur",I),window.removeEventListener("keydown",A,!0)}),(x,P)=>e.visible?(l(),d("div",{key:0,ref_key:"menuRef",ref:a,class:"file-link-context-menu",style:We(f.value),onClick:P[0]||(P[0]=Se(()=>{},["stop"]))},[v("button",{type:"button",class:"file-link-context-menu-item",onClick:u}," Open link "),v("button",{type:"button",class:"file-link-context-menu-item",onClick:p}," Copy link "),e.editUrl?(l(),d("button",{key:0,type:"button",class:"file-link-context-menu-item",onClick:g}," Edit file ")):L("",!0)],4)):L("",!0)}}),xi=U($i,[["__scopeId","data-v-f6643b04"]]),_i=12e3,Ci=240;function Ti(e,{streaming:n,truncateStreaming:o=!0,maxChars:i=_i,maxLines:a=Ci}){if(!o)return e;let f=e,c=!1;if(i>0&&f.length>i&&(f=f.slice(-i),c=!0),a>0){const u=f.split(/\r?\n/);u.length>a&&(f=u.slice(-a).join(`
|
|
23
|
+
`),c=!0)}return c?`...
|
|
24
|
+
${f}`:f}const Li={class:"conversation-item conversation-item-overlay"},Ii={class:"message-row"},Mi={class:"message-stack"},Pi={class:"live-overlay-inline","aria-live":"polite"},Si={class:"live-overlay-title-row"},Ai={key:0,class:"live-overlay-spinner","aria-hidden":"true"},Ei=["aria-expanded"],Fi={class:"live-overlay-label"},Bi={class:"live-overlay-toggle","aria-hidden":"true"},Ri={key:2,class:"live-overlay-label"},Oi={key:0,class:"live-overlay-reasoning"},Hi={key:1,class:"live-overlay-error"},Di=["href"],ji=G({__name:"LiveOverlayItem",props:{overlay:{},feedbackMailto:{}},setup(e){const n=e,{buildFeedbackMailto:o,recordVisibleFailure:i}=co(),{t:a}=ee(),f=O(!0);function c(){f.value=!f.value}const u=M(()=>{var p;return Ti(((p=n.overlay)==null?void 0:p.reasoningText)??"",{streaming:!0})});function g(p,b){i(b);const I=p.currentTarget;I instanceof HTMLAnchorElement&&(I.href=o())}return(p,b)=>{var I,A,x,P,w,F;return l(),d("li",Li,[v("div",Ii,[v("div",Mi,[v("article",Pi,[v("div",Si,[(I=e.overlay)!=null&&I.errorText?L("",!0):(l(),d("span",Ai)),(A=e.overlay)!=null&&A.reasoningText?(l(),d("button",{key:1,type:"button",class:"live-overlay-heading","aria-expanded":f.value,onClick:c},[v("span",Fi,y((x=e.overlay)==null?void 0:x.activityLabel),1),v("span",Bi,y(f.value?"▾":"▸"),1)],8,Ei)):(l(),d("p",Ri,y((P=e.overlay)==null?void 0:P.activityLabel),1))]),(w=e.overlay)!=null&&w.reasoningText&&f.value?(l(),d("p",Oi,y(u.value),1)):L("",!0),(F=e.overlay)!=null&&F.errorText?(l(),d("div",Hi,[v("span",null,y(e.overlay.errorText),1),v("a",{class:"live-overlay-feedback",href:e.feedbackMailto,onClick:b[0]||(b[0]=B=>g(B,e.overlay.errorText))},y(T(a)("Send feedback")),9,Di)])):L("",!0)])])])])}}}),Wi=U(ji,[["__scopeId","data-v-b69a0020"]]),zi={},Ni={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function qi(e,n){return l(),d("svg",Ni,[...n[0]||(n[0]=[v("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Ui=U(zi,[["render",qi]]),Vi=["data-role"],Ki=["aria-label","title"],Gi={key:0,class:"message-rollback-label"},Zi=["aria-label","title"],Ji={class:"message-fork-label"},Yi=["data-copied","aria-label","title"],Qi={key:0,class:"message-copy-label"},Xi=G({__name:"MessageToolbar",props:{role:{},showEdit:{type:Boolean,default:!1},showFork:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},copied:{type:Boolean,default:!1}},emits:["edit","fork","copy"],setup(e){const{t:n}=ee();return(o,i)=>e.showEdit||e.showFork||e.showCopy?(l(),d("div",{key:0,class:"message-toolbar","data-role":e.role},[e.showEdit?(l(),d("button",{key:0,type:"button",class:"message-rollback-button","aria-label":T(n)("Rollback this message"),title:T(n)("Rollback this message"),onClick:i[0]||(i[0]=a=>o.$emit("edit"))},[j(Jt,{class:"icon-svg message-rollback-icon"}),e.role!=="user"?(l(),d("span",Gi,y(T(n)("Rollback")),1)):L("",!0)],8,Ki)):L("",!0),e.showFork?(l(),d("button",{key:1,type:"button",class:"message-fork-button","aria-label":T(n)("Fork thread from this response"),title:T(n)("Fork thread from this response"),onClick:i[1]||(i[1]=a=>o.$emit("fork"))},[j(Is,{class:"icon-svg message-fork-icon"}),v("span",Ji,y(T(n)("Fork")),1)],8,Zi)):L("",!0),e.showCopy?(l(),d("button",{key:2,type:"button",class:"message-copy-button","data-copied":e.copied,"aria-label":e.copied?T(n)("Response copied"):T(n)("Copy response"),title:e.copied?T(n)("Response copied"):T(n)("Copy response"),onClick:i[2]||(i[2]=a=>o.$emit("copy"))},[j(Ui,{class:"icon-svg message-copy-icon"}),e.role!=="user"?(l(),d("span",Qi,y(e.copied?"Copied":"Copy"),1)):L("",!0)],8,Yi)):L("",!0)],8,Vi)):L("",!0)}}),er=U(Xi,[["__scopeId","data-v-59a7a725"]]),tr="codex-web-local.process-fold.v1",to="codex:web-local:process-fold";function jt(){return typeof localStorage>"u"?"auto":localStorage.getItem(tr)==="expanded"?"expanded":"auto"}function nr(e){const n=o=>e(o.detail);return window.addEventListener(to,n),()=>window.removeEventListener(to,n)}const or=["aria-expanded"],sr={class:"process-fold-label"},ar={class:"process-fold-toggle","aria-hidden":"true"},ir={key:0,class:"process-fold-body"},rr=G({__name:"ProcessFold",props:{label:{},running:{type:Boolean},hasOutsideContent:{type:Boolean}},setup(e){const n=e,o=O(jt()==="expanded"||!n.hasOutsideContent),i=O(!1);let a=!1;const f=nr(()=>{i.value=!1,jt()==="expanded"?o.value=!0:!n.running&&n.hasOutsideContent&&(o.value=!1)});ce(()=>n.running,u=>{const g=a;a=u,u?(g||(i.value=!1),i.value||(o.value=!0)):g&&!i.value&&n.hasOutsideContent&&jt()!=="expanded"&&(o.value=!1)},{immediate:!0}),Xt(()=>f());function c(){i.value=!0,o.value=!o.value}return(u,g)=>(l(),d("div",{class:N(["process-fold",{"process-fold--open":o.value,"process-fold--running":e.running}])},[v("button",{type:"button",class:"process-fold-header","aria-expanded":o.value,onClick:c},[v("span",sr,y(e.label),1),v("span",ar,y(o.value?"▾":"▸"),1)],8,or),o.value?(l(),d("div",ir,[uo(u.$slots,"default",{},void 0)])):L("",!0)],2))}}),lr=U(rr,[["__scopeId","data-v-de9b3329"]]),cr=["aria-label"],ur=["data-turn","aria-label","onClick"],dr={class:"question-jump-preview-text"},fr=2,Wt="#3b82f6",hr=G({__name:"QuestionJumpBar",props:{anchors:{},activeTurn:{}},emits:["jump"],setup(e,{emit:n}){const o=e,i=n,{t:a}=ee(),f=O(null),c=O(-1),u=O("0px"),g=M(()=>{const w=c.value;return w<0?null:o.anchors[w]??null});function p(w){var J;const F=o.activeTurn===((J=o.anchors[w])==null?void 0:J.turn),B={};if(c.value<0)return B.width=F?"18px":"12px",B.background=F?Wt:void 0,B;const V=Math.abs(w-c.value);return B.width=V===0?"32px":V===1?"20px":V===2?"14px":F?"18px":"12px",B.background=V===0?Wt:V===1?"rgba(59,130,246,0.6)":V===2?"rgba(59,130,246,0.35)":F?Wt:void 0,B.transitionDelay=`${V*20}ms`,B}function b(w){const F=f.value;if(!F)return-1;const B=Array.from(F.querySelectorAll(".question-jump-item"));let V=-1,J=Number.POSITIVE_INFINITY;for(let R=0;R<B.length;R+=1){const ve=B[R].getBoundingClientRect(),xe=ve.top+ve.height/2,Z=Math.abs(w-xe);Z<J&&(J=Z,V=R)}return V}function I(w){var xe;const F=b(w.clientY);if(F<0)return;c.value=F;const B=f.value;if(!B)return;const J=(xe=Array.from(B.querySelectorAll(".question-jump-item"))[F])==null?void 0:xe.getBoundingClientRect(),R=B.getBoundingClientRect();if(!J)return;const ve=J.top+J.height/2;u.value=`${ve-R.top}px`}function A(){c.value=-1}function x(w){const F=b(w.clientY),B=F>=0?o.anchors[F]:null;B&&i("jump",B.turn)}function P(w){i("jump",w.turn)}return(w,F)=>e.anchors.length>=fr?(l(),d("nav",{key:0,class:"question-jump-bar","aria-label":T(a)("Question navigation")},[v("div",{ref_key:"trackRef",ref:f,class:"question-jump-track",onMousemove:I,onMouseleave:A,onMousedown:x},[(l(!0),d(E,null,H(e.anchors,(B,V)=>(l(),d("button",{key:B.turn,type:"button",class:"question-jump-item","data-turn":B.turn,"aria-label":T(a)("Jump to question {n}",{n:B.turn+1}),onMousedown:F[0]||(F[0]=Se(()=>{},["prevent"])),onClick:J=>P(B)},[v("span",{class:"question-jump-dot",style:We(p(V))},null,4)],40,ur))),128))],544),g.value?(l(),d("div",{key:0,class:"question-jump-preview",role:"tooltip",style:We({top:u.value})},[v("span",dr,y(g.value.text),1)],4)):L("",!0)],8,cr)):L("",!0)}}),mr=U(hr,[["__scopeId","data-v-96d087d4"]]),gr=["data-state"],pr=["aria-expanded"],vr={class:"reasoning-block-title"},kr={class:"reasoning-block-toggle","aria-hidden":"true"},yr={key:0,class:"reasoning-block-body"},br={key:0,class:"reasoning-block-summary"},wr=["innerHTML"],$r=G({__name:"ReasoningBlock",props:{message:{},expanded:{type:Boolean},contentHtml:{}},emits:["toggle"],setup(e){const n=e,{t:o}=ee(),i=M(()=>{var f;return(((f=n.message.reasoning)==null?void 0:f.summary)??[]).map(c=>c.trim()).filter(Boolean).join(`
|
|
25
|
+
`).trim()});return(a,f)=>(l(),d("div",{class:"reasoning-block","data-state":e.expanded?"expanded":"collapsed"},[v("button",{type:"button",class:"reasoning-block-header","aria-expanded":e.expanded,onClick:f[0]||(f[0]=c=>a.$emit("toggle"))},[v("span",vr,y(T(o)("Thinking process")),1),v("span",kr,y(e.expanded?"▾":"▸"),1)],8,pr),e.expanded?(l(),d("div",yr,[i.value?(l(),d("p",br,y(i.value),1)):L("",!0),v("div",{class:"reasoning-block-content message-card",innerHTML:e.contentHtml},null,8,wr)])):L("",!0)],8,gr))}}),no=U($r,[["__scopeId","data-v-5fa90230"]]),xr=new Set(["read_file","ls","grep","glob","web_fetch","read_skill","code_index","connect_tool_source"]),_r=new Set(["write_file","edit_file","multi_edit","move_file","delete_range","delete_symbol","notebook_edit"]),Cr=new Set(["task","run_skill","explore","research","review","security_review"]);function Tr(e){var o;const n=((o=e.toolCall)==null?void 0:o.tool)??"";return xr.has(n)?"readonly":_r.has(n)?"modify":Cr.has(n)?"delegate":null}const Lr=2;function Ir(e){var f;const n=[];let o=[],i=null;const a=()=>{if(i!==null&&o.length>=Lr)n.push({type:"batch",kind:i,messages:o});else for(const c of o)n.push({type:"tool",message:c});o=[],i=null};for(const c of e){if(c.messageType!=="toolCall"||((f=c.toolCall)==null?void 0:f.status)==="inProgress"){a(),n.push({type:"tool",message:c});continue}const u=Tr(c);if(u===null){a(),n.push({type:"tool",message:c});continue}i!==null&&i!==u&&a(),i=u,o.push(c)}return a(),n}function Mr(e,n,o){const{t:i}=o;if(e==="readonly"){const a=n.filter(g=>{var p,b;return((p=g.toolCall)==null?void 0:p.tool)==="read_file"||((b=g.toolCall)==null?void 0:b.tool)==="ls"}).length,f=n.filter(g=>{var b;const p=((b=g.toolCall)==null?void 0:b.tool)??"";return p==="grep"||p==="glob"||p==="web_fetch"||p==="code_index"}).length,c=n.length-a-f,u=[];return a>0&&u.push(i("Read {n} files",{n:a})),f>0&&u.push(i("Search {n} files",{n:f})),c>0&&u.push(i("{n} read calls",{n:c})),u.join(" · ")}return e==="modify"?i("Modified {n} files",{n:n.length}):e==="delegate"?i("Delegated {n} tasks",{n:n.length}):i("Explored {n} items",{n:n.length})}const Pr={class:"message-row","data-role":"system"},Sr={class:"message-stack","data-role":"system"},Ar=["title"],Er={key:0,class:"tool-call-server"},Fr={class:"tool-call-name"},Br={class:"tool-call-status"},Rr={key:0,class:"work-block-spinner","aria-hidden":"true"},Or={key:1,class:"tool-call-status-icon","aria-hidden":"true"},Hr={key:2,class:"tool-call-status-icon","aria-hidden":"true"},Dr=G({__name:"ToolCallRow",props:{message:{}},setup(e){const n=e,{t:o}=ee(),i=M(()=>{const c=n.message.toolCall;if(!c)return"";switch(c.status){case"inProgress":return o("Running");case"failed":return o("Failed");default:return o("Done")}}),a=M(()=>{var c;switch((c=n.message.toolCall)==null?void 0:c.status){case"inProgress":return"tool-call-running";case"failed":return"tool-call-error";default:return"tool-call-ok"}}),f=M(()=>{const c=n.message.toolCall;if(!c)return"";const u=[];return c.server&&u.push(c.server),u.push(c.tool),c.error&&u.push(c.error),typeof c.durationMs=="number"&&c.durationMs>=0&&u.push(`${c.durationMs}ms`),u.join(" · ")});return(c,u)=>{var g,p,b,I;return l(),d("div",Pr,[v("div",Sr,[v("div",{class:N(["tool-call-block",a.value]),title:f.value},[u[0]||(u[0]=v("span",{class:"tool-call-icon","aria-hidden":"true"},"🛠",-1)),(g=e.message.toolCall)!=null&&g.server?(l(),d("span",Er,y(e.message.toolCall.server),1)):L("",!0),v("code",Fr,y(((p=e.message.toolCall)==null?void 0:p.tool)||e.message.text||"(tool)"),1),v("span",Br,[((b=e.message.toolCall)==null?void 0:b.status)==="inProgress"?(l(),d("span",Rr)):((I=e.message.toolCall)==null?void 0:I.status)==="completed"?(l(),d("span",Or,"✓")):(l(),d("span",Hr,"✗")),ie(" "+y(i.value),1)])],10,Ar)])])}}}),Yt=U(Dr,[["__scopeId","data-v-e25278a7"]]),jr=["aria-expanded","title"],Wr={class:"tool-batch-toggle","aria-hidden":"true"},zr={class:"tool-batch-label"},Nr={class:"tool-batch-count"},qr={key:0,class:"tool-batch-body"},Ur=G({__name:"ToolBatchBlock",props:{kind:{},messages:{}},setup(e){const n=e,{t:o}=ee(),i=O(!1),a=M(()=>Mr(n.kind,n.messages,{t:o})),f=M(()=>n.messages.map(c=>{var u;return((u=c.toolCall)==null?void 0:u.tool)??""}).join(" · "));return(c,u)=>(l(),d("div",{class:N(["tool-batch-block",{"tool-batch-block--open":i.value}])},[v("button",{type:"button",class:"tool-batch-head","aria-expanded":i.value,title:f.value,onClick:u[0]||(u[0]=g=>i.value=!i.value)},[v("span",Wr,y(i.value?"▾":"▸"),1),u[1]||(u[1]=v("span",{class:"tool-batch-icon","aria-hidden":"true"},"🛠",-1)),v("span",zr,y(a.value),1),v("span",Nr,y(e.messages.length),1)],8,jr),i.value?(l(),d("div",qr,[(l(!0),d(E,null,H(e.messages,g=>(l(),Y(Yt,{key:g.id,message:g},null,8,["message"]))),128))])):L("",!0)],2))}}),Vr=U(Ur,[["__scopeId","data-v-df1cadae"]]),Kr=["aria-expanded"],Gr={class:"warm-turn__preview"},Zr={key:0,class:"warm-turn__meta"},Jr={class:"warm-turn__content"},Yr={key:1,class:"warm-turn__assistant"},Qr=G({__name:"WarmTurnCard",props:{userText:{},assistantPreview:{},toolCount:{},expanded:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const o=n,{t:i}=ee();function a(){o("toggle")}return(f,c)=>(l(),d("div",{class:N(["warm-turn",{"warm-turn--expanded":e.expanded}])},[v("button",{type:"button",class:"warm-turn__head","aria-expanded":e.expanded,onClick:a},[j(Ms,{class:N(["warm-turn__chevron",{"warm-turn__chevron--open":e.expanded}])},null,8,["class"]),v("span",Gr,y(e.userText),1),e.toolCount>0?(l(),d("span",Zr,y(T(i)("{n} tools",{n:e.toolCount})),1)):L("",!0)],8,Kr),v("div",Jr,[e.expanded?uo(f.$slots,"default",{},void 0,!0,0):e.assistantPreview?(l(),d("div",Yr,y(e.assistantPreview),1)):L("",!0)])],2))}}),Xr=U(Qr,[["__scopeId","data-v-7e3ebbc7"]]),el=["aria-expanded"],tl=["title"],nl={class:"work-block-command"},ol={class:"work-block-status"},sl={key:0,class:"work-block-spinner","aria-hidden":"true"},al={key:1,class:"work-block-status-icon","aria-hidden":"true"},il={key:2,class:"work-block-status-icon","aria-hidden":"true"},rl={class:"work-block-output-inner"},ll=["textContent"],cl={key:0,class:"work-block-permission-hint",role:"note"},ul=G({__name:"WorkBlockItem",props:{command:{},stepIndex:{},expanded:{type:Boolean},compact:{type:Boolean},outputCondensed:{type:Boolean}},emits:["toggle"],setup(e){const n=e,{t:o}=ee(),i=M(()=>{var g,p;const u=(g=n.command.commandExecution)==null?void 0:g.status;return u==="inProgress"?"cmd-status-running":u==="completed"&&((p=n.command.commandExecution)==null?void 0:p.exitCode)===0?"cmd-status-ok":"cmd-status-error"}),a=M(()=>{const u=n.command.commandExecution;if(!u)return"";switch(u.status){case"inProgress":return o("Running");case"completed":return u.exitCode===0?o("Done"):`${o("Exit")} ${u.exitCode??"?"}`;case"failed":return o("Failed");case"declined":return o("Declined");case"interrupted":return o("Stopped");default:return""}}),f=[/access to the path .* is denied/iu,/access is denied/iu,/permission denied/iu,/not permitted/iu,/EACCES|EPERM/iu,/denied access|deny access/iu,/拒绝访问/iu,/没有权限/iu,/权限不足/iu,/要求提权|需要提权|require_escalated/iu],c=M(()=>{const u=n.command.commandExecution;if(!u||!(u.status==="failed"||u.status==="declined"||typeof u.exitCode=="number"&&u.exitCode!==0))return"";const p=u.aggregatedOutput??"";return!p||!f.some(b=>b.test(p))?"":o("Command blocked by a permission or sandbox restriction; no approval prompt was shown. Check the approval policy or trusted directories if you expected one.")});return(u,g)=>{var p,b,I,A,x,P;return l(),d("div",{class:N(["work-block",[i.value,{"work-block-expanded":e.expanded,"work-block-compact":e.compact}]])},[v("button",{type:"button",class:"work-block-header","aria-expanded":e.expanded,onClick:g[0]||(g[0]=w=>u.$emit("toggle"))},[v("span",{class:"work-step-dot",title:`${T(o)("Step")} ${String(e.stepIndex+1)}`},y(e.stepIndex+1),9,tl),v("code",nl,y(((p=e.command.commandExecution)==null?void 0:p.command)||"(command)"),1),v("span",ol,[((b=e.command.commandExecution)==null?void 0:b.status)==="inProgress"?(l(),d("span",sl)):((I=e.command.commandExecution)==null?void 0:I.status)==="completed"&&((A=e.command.commandExecution)==null?void 0:A.exitCode)===0?(l(),d("span",al,"✓")):((x=e.command.commandExecution)==null?void 0:x.status)==="failed"?(l(),d("span",il,"✗")):L("",!0),ie(" "+y(a.value),1)])],8,el),v("div",{class:N(["work-block-output-wrap",{"work-block-output-visible":e.expanded}])},[v("div",rl,[v("pre",{class:N(["work-block-output",{"cmd-output-condensed":e.outputCondensed}]),textContent:y(((P=e.command.commandExecution)==null?void 0:P.aggregatedOutput)||"(no output)")},null,10,ll)])],2),c.value?(l(),d("p",cl,y(c.value),1)):L("",!0)],2)}}}),oo=U(ul,[["__scopeId","data-v-84a7e8b2"]]),dl=2;function so(e){const n=e.messageType;return n==="commandExecution"||n==="toolCall"}function fl(e){var o,i;return(((o=e.commandExecution)==null?void 0:o.status)??"")==="inProgress"||(((i=e.toolCall)==null?void 0:i.status)??"")==="inProgress"?!0:(e.messageType??"").endsWith(".live")}function hl(e){const n=[];let o=[],i="";const a=()=>{o.length>0&&(n.push(o),o=[])};for(const u of e){const g=u.turnId??"",p=so(u)&&g!=="";(!p||g!==i)&&(o.length>0&&a(),i=p?g:""),p&&o.push(u)}a();const f=new Map;for(const u of e)u.messageType==="worked"&&u.turnId&&typeof u.durationMs=="number"&&f.set(u.turnId,u.durationMs);const c=[];for(const u of n){if(u.length<dl)continue;const g=u[0].turnId??"";let p=0,b=0,I=0,A=!1;for(const P of u)P.messageType==="toolCall"?p+=1:P.messageType==="reasoning"?b+=1:P.messageType==="commandExecution"&&(I+=1),fl(P)&&(A=!0);const x=e.some(P=>P.turnId===g&&!so(P));c.push({turnId:g,messages:u,running:A,toolCount:p,thoughtCount:b,commandCount:I,durationMs:f.get(g)??0,hasOutsideContent:x})}return c}function ml(e,n){const{t:o,formatDuration:i}=n,a=[];return e.running?a.push(o("Working…")):e.durationMs>0?a.push(i(e.durationMs)):a.push(o("Processed")),e.toolCount>0&&a.push(o("{n} tools",{n:e.toolCount})),e.thoughtCount>0&&a.push(o("{n} thoughts",{n:e.thoughtCount})),e.commandCount>0&&a.push(o("{n} commands",{n:e.commandCount})),a.join(" · ")}function xo(e){return e.replace(/\s+/g," ").trim()}function gl(e){const n=xo(e);return n.length<=80?n:n.slice(0,80)}function _o(e){const n=xo(e);return n.length<=80?n:n.slice(0,77)+"..."}function Qt(e){return{sessionKey:e,expandedWarmTurns:new Set,coldPage:0}}function ct(e,n){return e.sessionKey===n?e:Qt(n)}function pl(e,n){const o=ct(e,n);return{...o,coldPage:o.coldPage+1}}function vl(e,n,o){const i=ct(e,n),a=Math.max(0,Math.floor(o));return i.coldPage>=a?i:{...i,coldPage:a}}function ao(e,n,o,i){const a=ct(e,n),f=new Set(a.expandedWarmTurns);return i?f.add(o):f.delete(o),{...a,expandedWarmTurns:f}}function kl(e){return e.role==="user"}function yl(e){var n;return((n=e.messageType)==null?void 0:n.endsWith(".live"))===!0}function bl(e){var f;const n=[];let o=-1,i=0;const a=(c,u)=>{n.push({userItem:c,assistantPreview:"",toolCount:0,startIdx:u,endIdx:e.length})};for(let c=0;c<e.length;c+=1){const u=e[c];if(kl(u)){if(o>=0)n[n.length-1].endIdx=c;else{n.push({userItem:u,assistantPreview:"",toolCount:0,startIdx:i,endIdx:e.length}),o=c,i=c;continue}o=c,a(u,c)}else if(o>=0&&n.length>0){const g=n[n.length-1],p=((f=u.text)==null?void 0:f.trim())||"";u.role==="assistant"&&!yl(u)&&p&&(g.assistantPreview=_o(p)),u.messageType==="toolCall"&&(g.toolCount+=1)}}return n}function wl({turnCount:e,hotTurns:n,pageSize:o,coldPage:i}){const a=Math.max(0,e),f=Math.max(0,n),c=Math.max(0,a-Math.min(a,f));if(c===0)return{warmStartTurn:0,warmEndTurn:0,coldTurnCount:0};const u=Math.max(0,o),g=Math.max(0,Math.floor(i)),p=Math.min(c,u*(g+1));return{warmStartTurn:c-p,warmEndTurn:c,coldTurnCount:c-p}}function $l({turn:e,turnCount:n,hotTurns:o,pageSize:i}){const a=Math.max(0,n),f=Math.max(0,o),c=Math.max(0,a-Math.min(a,f));if(c===0||e>=c)return 0;const u=Math.max(1,i),g=Math.max(0,Math.floor(e)),p=c-g;return Math.max(0,Math.ceil(p/u)-1)}function xl(e,n,o){if(n.length===0)return e.slice(0);if(o>=n.length)return[];const i=n[o].startIdx;return e.slice(i)}const _l={key:0,class:"conversation-loading"},Cl={key:1,class:"conversation-empty"},Tl={key:0,class:"conversation-load-more"},Ll=["disabled"],Il={key:1,class:"conversation-load-more conversation-warm-collapse"},Ml=["disabled"],Pl=["id"],Sl={class:"message-row","data-role":"system"},Al={class:"message-stack","data-role":"system"},El={class:"conversation-item conversation-item-fold","data-role":"system","data-message-type":"processFold"},Fl={class:"message-row","data-role":"system"},Bl={class:"message-stack","data-role":"system"},Rl={key:0,class:"work-block-list"},Ol={key:0,class:"conversation-item conversation-item-file-change","data-role":"system","data-message-type":"fileChange"},Hl={class:"message-row","data-role":"system"},Dl={class:"message-stack","data-role":"system"},jl=["id","data-role","data-message-type"],Wl={key:0,class:"message-row thread-compaction-row","data-role":"system"},zl={class:"thread-compaction-inline thread-compaction-inline--pending",role:"status"},Nl={key:1,class:"message-row thread-compaction-row","data-role":"system"},ql={class:"thread-compaction-inline thread-compaction-inline--done",role:"status"},Ul={key:2,class:"message-row","data-role":"system"},Vl={class:"message-stack","data-role":"system"},Kl={class:"work-block-list"},Gl=["data-role","data-message-type"],Zl=["data-role"],Jl=["data-role"],Yl=["data-role","data-message-type"],Ql=["data-role"],Xl=["data-role"],ec=["data-role"],tc=["onClick"],nc=["src","alt"],oc={key:1,class:"message-file-attachments"},sc=["href","title"],ac={key:2,class:"message-skill-attachments"},ic=["href","title"],rc={class:"message-skill-chip-prefix"},lc={class:"message-skill-chip-name"},cc=["data-role"],uc={key:0,class:"automation-message-label"},dc={key:0},fc={key:1,class:"work-summary-wrap","aria-live":"polite"},hc={class:"work-summary-text"},mc={key:0,class:"message-text"},gc={key:0},pc={key:1,class:"message-bold-text"},vc={key:2,class:"message-italic-text"},kc={key:3,class:"message-strikethrough-text"},yc=["href","title"],bc=["href","title"],wc={key:6,class:"message-inline-code"},$c={key:0},xc={key:1,class:"message-bold-text"},_c={key:2,class:"message-italic-text"},Cc={key:3,class:"message-strikethrough-text"},Tc=["href","title"],Lc=["href","title"],Ic={key:6,class:"message-inline-code"},Mc={key:2,class:"message-blockquote"},Pc={key:0},Sc={key:1,class:"message-bold-text"},Ac={key:2,class:"message-italic-text"},Ec={key:3,class:"message-strikethrough-text"},Fc=["href","title"],Bc=["href","title"],Rc={key:6,class:"message-inline-code"},Oc={key:3,class:"message-list message-list-unordered"},Hc=["innerHTML"],Dc={key:4,class:"message-list message-task-list"},jc=["data-checked"],Wc={class:"message-list-item-text"},zc={key:0},Nc={key:1,class:"message-bold-text"},qc={key:2,class:"message-italic-text"},Uc={key:3,class:"message-strikethrough-text"},Vc=["href","title"],Kc=["href","title"],Gc={key:6,class:"message-inline-code"},Zc=["start"],Jc=["innerHTML"],Yc={key:6,class:"message-table-wrap"},Qc={class:"message-table"},Xc={key:0},eu={key:1,class:"message-bold-text"},tu={key:2,class:"message-italic-text"},nu={key:3,class:"message-strikethrough-text"},ou=["href","title"],su=["href","title"],au={key:6,class:"message-inline-code"},iu={key:0},ru={key:0},lu={key:1,class:"message-bold-text"},cu={key:2,class:"message-italic-text"},uu={key:3,class:"message-strikethrough-text"},du=["href","title"],fu=["href","title"],hu={key:6,class:"message-inline-code"},mu={key:7,class:"message-code-block"},gu={key:0,class:"message-code-language"},pu={class:"message-code-pre"},vu=["innerHTML"],ku={key:8,class:"message-divider"},yu={key:9,class:"message-text"},bu=["onClick"],wu=["src","alt","onError"],$u=["href","onClick"],xu={key:0,class:"conversation-item conversation-item-file-change","data-role":"system","data-message-type":"fileChange"},_u={class:"message-row","data-role":"system"},Cu={class:"message-stack","data-role":"system"},Tu=["title","aria-label"],Lu=["aria-label"],Iu=["src","alt"],Mu=16,Pu=300,Su=1200,Au=300,Eu=250,io=30,ro=20,Fu=200,Bu=G({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},liveTurnId:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},hasMorePersistedAbove:{type:Boolean},isLoadingPersistedAbove:{type:Boolean},loadEarlierMessages:{type:Function}},emits:["forkThread","rollback","respondServerRequest","fileChangesChanged"],setup(e,{expose:n,emit:o}){function i(t){return sa(t,_.cwd,R)}function a(t){return Ee(t,_.cwd)}const f=O(new Set),c=O(new Set),u=O(new Set),g=O(null),p=O(""),b=O(!1),I=O(!1),A=O(0),x=O(0),P=O(""),w=O(""),{isMobile:F}=Ps(),{buildFeedbackMailto:B,feedbackMailtoBase:V,recordVisibleFailure:J}=co(),{t:R}=ee(),ve=V();function xe(t,s){J(s);const h=t.currentTarget;h instanceof HTMLAnchorElement&&(h.href=B())}function Z(t){return t.messageType==="commandExecution"&&!!t.commandExecution}function Co(t){return t.messageType==="compaction.pending"}function To(t){return t.messageType==="compaction.done"}function ut(t){return t.messageType==="plan"||t.messageType==="plan.live"}function dt(t){return t.messageType==="reasoning"&&!!t.reasoning}const ft=O(new Set);function tn(t){return ft.value.has(t.id)}function nn(t){const s=new Set(ft.value);s.has(t.id)?s.delete(t.id):s.add(t.id),ft.value=s}function on(t){return t.messageType==="toolCall"&&!!t.toolCall}function Lo(t){return t.messageType==="turnError"}function Ue(t){return t.messageType==="fileChange"&&t.fileChangeStatus==="completed"&&Array.isArray(t.fileChanges)&&t.fileChanges.length>0}function ht(t){return t.role==="assistant"&&!Z(t)&&t.messageType!=="worked"&&!(t.messageType??"").endsWith(".live")}const mt=M(()=>{var t;for(let s=_.messages.length-1;s>=0;s-=1){const h=_.messages[s];if(h.messageType==="commandExecution"&&((t=h.commandExecution)==null?void 0:t.status)==="inProgress")return h.id}return""}),sn=M(()=>_.messages.some(t=>t.role==="assistant"&&t.messageType==="agentMessage.live"&&t.text.trim().length>0)),an=M(()=>!!_.liveOverlay||mt.value.length>0||sn.value),rn=M(()=>{const t={};for(let s=0;s<_.messages.length;){const h=_.messages[s];if(!Z(h)){s+=1;continue}const r=[];for(;s<_.messages.length&&Z(_.messages[s]);)r.push(_.messages[s]),s+=1;if(r.length<=1)continue;const m=r[r.length-1];t[m.id]=r.slice(0,-1)}return t}),gt=M(()=>{const t=new Set;for(const s of Object.values(rn.value))for(const h of s)t.add(h.id);return t});function ln(t){return!sn.value&&t.id===mt.value}function cn(t){return Z(t)?f.value.has(t.id)||!c.value.has(t.id)&&ln(t):!1}function un(t){return Z(t)&&an.value}function dn(t){var s;return Z(t)&&(an.value||((s=t.commandExecution)==null?void 0:s.status)==="inProgress")}function fn(t){if(!Z(t))return;const s=new Set(f.value),h=new Set(c.value),r=ln(t);s.has(t.id)?(s.delete(t.id),r&&h.add(t.id)):r&&!h.has(t.id)?h.add(t.id):(s.add(t.id),h.delete(t.id)),f.value=s,c.value=h}function Io(t){return rn.value[t.id]??[]}function hn(t){return Z(t)?[...Io(t),t]:[]}function pt(t){const s=new Set(u.value);s.has(t.id)?s.delete(t.id):s.add(t.id),u.value=s}function vt(t){return u.value.has(t.id)}function kt(t,s){t&&(g.value=t,p.value=K(s),b.value=!1)}function Mo(){g.value=null,p.value="",b.value=!1}function Po(){b.value=!b.value}function So(){b.value=!1}function Ao(t){p.value=K(t),F.value&&(b.value=!1)}function yt(t,s){if(t.size===0)return t;const h=new Set;for(const r of t)s.has(r)&&h.add(r);return h.size===t.size?t:h}const _=e,bt=o,fe=O(null),mn=O(null),Fe=O(""),ke=O(""),q=O({}),te=O({}),ne=O({}),re=O(null),Eo=M(()=>{const t=re.value;return t?t.kind==="edit-message"?R("Rollback this turn?"):t.action==="undo"?R("Undo file changes?"):R("Redo file changes?"):""}),Fo=M(()=>{const t=re.value;return t?t.kind==="edit-message"?R("This rolls the thread back to this turn so you can edit the message. Later replies will be removed."):t.filePathLabel?t.action==="undo"?R("Undo the changes to {file}? This modifies the working tree and Codex cannot revert it automatically.",{file:t.filePathLabel}):R("Redo the changes to {file}? This reapplies the edits to the working tree.",{file:t.filePathLabel}):t.action==="undo"?R("Undo the file changes from this turn? This modifies the working tree and Codex cannot revert it automatically."):R("Redo the file changes from this turn? This reapplies the edits to the working tree."):""}),he=O(!0);let ye=0,oe=0,Ve=0,Q=null,Be=null;const gn=new WeakSet,Ke=O(null),_e=O(0),pn=O(0);let Ge=null;const Re=new Map,Oe=new Map,Ce=new Map,Te=new Map;function Ze(t,s,h,r){for(t.has(s)&&t.delete(s),t.set(s,h);t.size>r;){const m=t.keys().next().value;if(m===void 0)break;t.delete(m)}return h}const me=O(Qt(_.activeThreadId)),vn=M(()=>ct(me.value,_.activeThreadId)),ge=O(!1),kn=M(()=>_.messages.filter(t=>!ut(t))),He=M(()=>bl(kn.value)),wt=M(()=>wl({turnCount:He.value.length,hotTurns:io,pageSize:ro,coldPage:vn.value.coldPage})),yn=M(()=>wt.value.warmStartTurn),Je=M(()=>wt.value.warmEndTurn),bn=M(()=>wt.value.coldTurnCount),wn=M(()=>bn.value>0),$n=M(()=>vn.value.expandedWarmTurns),xn=M(()=>{const t=kn.value,s=He.value,h=[],r=$n.value;for(let m=yn.value;m<Je.value;m+=1){const $=s[m];if(!$)continue;const k=_o($.userItem.text),C=$.assistantPreview,S=$.toolCount;if(r.has(m)){h.push({kind:"warm-card",key:`warm-head-${m}`,turn:m,userText:k,assistantPreview:C,toolCount:S,expanded:!0});for(let W=$.startIdx;W<$.endIdx;W+=1){const D=t[W];D&&h.push({kind:"message",key:D.id,message:D})}}else h.push({kind:"warm-card",key:`warm-${m}`,turn:m,userText:k,assistantPreview:C,toolCount:S,expanded:!1})}for(const m of xl(t,s,Je.value))h.push({kind:"message",key:m.id,message:m});return h});function _n(){me.value=pl(me.value,_.activeThreadId)}function Bo(t){me.value=ao(me.value,_.activeThreadId,t,!$n.value.has(t))}const Cn=M(()=>He.value.map((t,s)=>({turn:s,text:gl(t.userItem.text)}))),Ro=M(()=>Math.max(0,Cn.value.length-1)),Oo=M(()=>{const t=new Map;return He.value.forEach((s,h)=>{t.set(s.userItem.id,h)}),t});function $t(t){return`question-anchor-${t}`}function Ho(t){const s=Oo.value.get(t.id);if(s!==void 0&&!(s<Je.value))return $t(s)}function Do(t){if(t<Je.value){let s=me.value;if(t<yn.value){const h=$l({turn:t,turnCount:He.value.length,hotTurns:io,pageSize:ro});s=vl(s,_.activeThreadId,h)}s=ao(s,_.activeThreadId,t,!0),me.value=s}he.value=!1,nt().then(()=>{const s=fe.value,h=document.getElementById($t(t));if(!s||!h)return;const r=h.getBoundingClientRect(),m=s.getBoundingClientRect(),$=s.scrollTop+r.top-m.top-12;s.scrollTo({top:Math.max(0,$),behavior:"smooth"})})}const xt=M(()=>{const t=[];for(const s of xn.value)s.kind==="message"&&t.push(s.message);return hl(t)}),De=M(()=>{var s;const t=new Map;for(const h of xt.value){const r=((s=h.messages[0])==null?void 0:s.id)??"";r&&t.set(r,h)}return t}),jo=M(()=>{const t=new Set;for(const s of xt.value)for(const h of s.messages)t.add(h.id);return t}),Wo=M(()=>{const t=new Set;for(const s of xt.value)t.add(s.turnId);return t});function zo(t){return De.value.has(t.id)}function Tn(t){return jo.value.has(t.id)}function Ln(t){var s;return((s=De.value.get(t.id))==null?void 0:s.messages)??[]}function _t(t){const s=Ln(t);return s[s.length-1]??t}function se(t){return X(_t(t))}function No(t){return Ir(Ln(t))}function qo(t){var s;return t.type==="batch"?`tool-batch-${t.kind}-${((s=t.messages[0])==null?void 0:s.id)??""}`:t.message.id}function Uo(t){const s=De.value.get(t.id);return s?ml(s,{t:R,formatDuration:Rs}):""}function Vo(t){var s;return((s=De.value.get(t.id))==null?void 0:s.running)??!1}function Ko(t){var s;return((s=De.value.get(t.id))==null?void 0:s.hasOutsideContent)??!0}function Go(t){return t.messageType==="worked"}const Zo=M(()=>_.hasMorePersistedAbove===!0),Jo=M(()=>!he.value&&(_.messages.length>0||_.pendingRequests.length>0||!!_.liveOverlay));function Yo(){return Ke.value?Promise.resolve():(Ge||(Ge=Es(()=>import("./common-BeuopZEI.js"),[]).then(t=>{Ke.value=t.default,Te.clear(),Ce.clear(),_e.value+=1}).finally(()=>{Ge=null})),Ge)}function Qo(t){switch(t){case"completed":return"[x]";case"inProgress":return"[~]";default:return"[ ]"}}function Xo(t){var r;const s=Bs(t);if(!s)return"";const h=[];return(r=s.explanation)!=null&&r.trim()&&h.push(s.explanation.trim()),s.steps.length>0&&h.push(s.steps.map(m=>`- ${Qo(m.status)} ${m.step}`.trim()).join(`
|
|
26
|
+
`)),h.join(`
|
|
27
|
+
|
|
28
|
+
`).trim()}function Ct(t){const s=[],h=t.text.trim()||Xo(t),r=ut(t)&&h?`Plan
|
|
29
|
+
${h}`:h;r&&s.push(r);const m=(t.fileAttachments??[]).map(k=>k.path.trim()).filter(k=>k.length>0);m.length>0&&s.push(`Files:
|
|
30
|
+
${m.join(`
|
|
31
|
+
`)}`);const $=(t.images??[]).map(k=>k.trim()).filter(k=>k.length>0);return $.length>0&&s.push(`Images:
|
|
32
|
+
${$.join(`
|
|
33
|
+
`)}`),s.join(`
|
|
34
|
+
|
|
35
|
+
`).trim()}const In=M(()=>{var h;const t=new Map;for(const r of _.messages){if(!ht(r))continue;const m=Ct(r);if(!m)continue;const $=typeof r.turnIndex=="number"?`turn:${r.turnIndex}`:`message:${r.id}`,k=t.get($);if(k){k.anchorMessageId=r.id,k.parts.push(m);continue}t.set($,{anchorMessageId:r.id,parts:[m]})}const s={};for(const r of t.values()){const m=r.parts.join(`
|
|
36
|
+
|
|
37
|
+
`).trim();m&&(s[r.anchorMessageId]=m)}for(const[r,m]of Object.entries(je.value)){if(m.source!=="metadata")continue;const $=i(m);if(!$)continue;const k=(h=s[r])==null?void 0:h.trim();s[r]=k?`${k}
|
|
38
|
+
|
|
39
|
+
${$}`:$}return s}),Mn=M(()=>{const t=new Map;for(const h of _.messages){if(!ht(h)||typeof h.turnIndex!="number")continue;const r=`turn:${h.turnIndex}`,m=t.get(r);if(m){m.anchorMessageId=h.id,m.turnIndex=h.turnIndex;continue}t.set(r,{anchorMessageId:h.id,turnIndex:h.turnIndex})}const s={};for(const h of t.values())s[h.anchorMessageId]=h.turnIndex;return s});function es(t){return typeof In.value[t.id]=="string"}function ts(t){return t.role==="user"&&Ct(t).length>0}async function ns(t){const s=_.messages.find(m=>m.id===t);if(!s)return;const h=Ct(s);if(!h)return;let r=!1;try{await Nt(h),r=!0}catch{r=!1}r||(r=Un(h)),r&&(ke.value=t,Q&&clearTimeout(Q),Q=setTimeout(()=>{ke.value===t&&(ke.value=""),Q=null},1800))}function os(t){return typeof Mn.value[t.id]=="number"}const je=M(()=>{var $,k;const t=new Map,s=new Map,h=new Map,r=C=>!Ue(C)&&!dt(C)&&!ut(C)&&!gt.value.has(C.id)&&!Tn(C);for(const C of _.messages){const S=typeof C.turnIndex=="number"?`turn:${C.turnIndex}`:`message:${C.id}`;if(r(C)&&t.set(S,C.id),ht(C)&&typeof C.turnIndex=="number"&&Array.isArray(C.fileChanges)&&C.fileChanges.length>0&&s.set(C.id,{changes:Ht(C.fileChanges),sourceMessageIds:[],source:"assistant",turnId:C.turnId??""}),!Ue(C))continue;const W=h.get(S);W?W.push(C):h.set(S,[C])}const m={};for(const[C,S]of h.entries()){const W=t.get(C);if(!W)continue;const D=(($=s.get(W))==null?void 0:$.turnId)??"";m[W]={changes:Ht(S.flatMap(pe=>pe.fileChanges??[])),sourceMessageIds:S.map(pe=>pe.id),source:"metadata",turnId:((k=S.find(pe=>typeof pe.turnId=="string"&&pe.turnId.length>0))==null?void 0:k.turnId)??D}}for(const[C,S]of s.entries())m[C]||(m[C]=S);return m}),Tt=M(()=>{var r;const t=new Map,s=new Set;for(const m of Object.values(je.value))for(const $ of m.sourceMessageIds)s.add($);for(const m of _.messages){if(!Ue(m))continue;const $=typeof m.turnIndex=="number"?`turn:${m.turnIndex}`:`message:${m.id}`,k=t.get($);k?k.push(m):t.set($,[m])}const h={};for(const[m,$]of t.entries()){if($.some(C=>s.has(C.id)))continue;const k=$[$.length-1];k&&(h[k.id]={changes:Ht($.flatMap(C=>C.fileChanges??[])),sourceMessageIds:$.map(C=>C.id),source:"metadata",turnId:k.turnId??((r=$.find(C=>typeof C.turnId=="string"&&C.turnId.length>0))==null?void 0:r.turnId)??""})}return h}),Pn=M(()=>{const t=new Set;for(const s of Object.values(je.value))for(const h of s.sourceMessageIds)t.add(h);for(const[s,h]of Object.entries(Tt.value))for(const r of h.sourceMessageIds)r!==s&&t.add(r);return t});function X(t){return je.value[t.id]??null}function ae(t){return Tt.value[t.id]??null}function Lt(t){if(!t)return!1;const s=_.liveTurnId??"";return s?(t.turnId??"")!==s:!0}function Le(t){return t!=null&&t.turnId&&_.activeThreadId?`thread:${_.activeThreadId}:turn:${t.turnId}`:""}function It(t){return Le(t).length>0}function Ie(t){const s=Le(t);return s?q.value[s]??"idle":"idle"}function Mt(t){const s=Le(t);return s?te.value[s]??"":""}function Ye(t){const s=Ie(t);return s==="undone"||s==="redoing"?"redo":"undo"}function Pt(t){const s=Ie(t);return s==="undoing"?R("Undoing"):s==="redoing"?R("Redoing"):Ye(t)==="redo"?R("Redo"):R("Undo")}async function ss(t,s,h){const r=Le(t);if(!t||!r||!_.activeThreadId||!_.cwd)return;const m=Ie(t),$=s==="undo"?"undoing":"redoing";q.value={...q.value,[r]:$},te.value={...te.value,[r]:""};let k;try{const C=ne.value[r]??[];k=await Fs(_.activeThreadId,t.turnId,_.cwd,s,C.length>0?C:void 0,"single_turn",h)}catch(C){q.value={...q.value,[r]:m},te.value={...te.value,[r]:C instanceof Error?C.message:R("Failed to update file changes.")};return}if(k.errors.length>0){s==="undo"?(ne.value={...ne.value,[r]:k.revertedPatchIds??[]},q.value={...q.value,[r]:"undone"}):((k.appliedPatchIds??[]).length>0&&(ne.value={...ne.value,[r]:k.appliedPatchIds??[]}),q.value={...q.value,[r]:"undone"}),te.value={...te.value,[r]:k.errors.join("; ")};return}if((k.changed??0)<=0){q.value={...q.value,[r]:m},te.value={...te.value,[r]:k.message||R(s==="undo"?"No file changes to undo.":"No file changes to redo.")};return}s==="undo"?(ne.value={...ne.value,[r]:k.revertedPatchIds??[]},q.value={...q.value,[r]:"undone"}):(ne.value={...ne.value,[r]:k.appliedPatchIds??[]},q.value={...q.value,[r]:"redone"}),bt("fileChangesChanged",_.activeThreadId)}const Sn=M(()=>{var t;return((t=g.value)==null?void 0:t.changes)??[]}),An=M(()=>{const t=Sn.value;return t.length===0?null:t.find(s=>K(s)===p.value)??t[0]}),as=M(()=>ca(An.value));async function is(t){const s=In.value[t]??"";if(!s)return;let h=!1;try{await Nt(s),h=!0}catch{h=!1}h||(h=Un(s)),h&&(ke.value=t,Q&&clearTimeout(Q),Q=setTimeout(()=>{ke.value===t&&(ke.value=""),Q=null},1800))}function rs(t){const s=Mn.value[t];typeof s=="number"&&_.activeThreadId&&bt("forkThread",{threadId:_.activeThreadId,turnIndex:s})}const St=M(()=>{const t={};for(const s of _.messages){if(s.role!=="user"||typeof s.turnIndex!="number")continue;const h=typeof s.turnId=="string"&&s.turnId.length>0?s.turnId:"";!h||s.text.trim().length===0||(t[s.id]=h)}return t});function ls(t){return typeof St.value[t.id]=="string"}function cs(t){St.value[t]&&(re.value={kind:"edit-message",messageId:t})}function At(t,s){Le(t)&&(re.value={kind:"file-change",summary:t,action:s})}function Et(t,s){!t||!Le(t)||!s.path||(re.value={kind:"file-change",summary:t,action:"undo",filePaths:[s.path],filePathLabel:a(s.path)})}function us(){const t=re.value;if(re.value=null,!!t){if(t.kind==="edit-message"){const s=St.value[t.messageId];s&&bt("rollback",{turnId:s});return}ss(t.summary,t.action,t.filePaths)}}function be(t){const s=Oe.get(t);return s?(Oe.delete(t),Oe.set(t,s),s):Ze(Oe,t,Ns(t),Su)}function le(t){const s=t.trim();if(!s)return"#";const h=k=>k.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(k),r=ze(s),m=(r==null?void 0:r.path)??s,$=ho(m,_.cwd);if(h($)){const k=$.startsWith("/")?$:`/${$}`;return`/codex-local-browse${encodeURI(k)}`}return"#"}function ds(t){const s=t.trim();if(!s)return"";try{const h=new URL(s,window.location.href);return h.pathname.startsWith("/codex-local-browse")?`${`/codex-local-edit${h.pathname.slice(19)}`}${h.search}${h.hash}`:""}catch{return""}}function fs(t){const s=t.target;if(!(s instanceof Element))return;const h=s.closest("a.message-file-link");if(!(h instanceof HTMLAnchorElement))return;const r=(h.getAttribute("href")??"").trim();!r||r==="#"||(t.preventDefault(),t.stopPropagation(),P.value=r,w.value=ds(r),A.value=t.clientX,x.value=t.clientY,I.value=!0)}function hs(){I.value&&(I.value=!1)}function ms(t){const s=Re.get(t.id);if(s&&s.text===t.text&&s.cwd===_.cwd)return Re.delete(t.id),Re.set(t.id,s),s.blocks;const h=eo(t.text);return Ze(Re,t.id,{text:t.text,cwd:_.cwd,blocks:h},Pu).blocks}function z(t){return t.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}function En(t){var h;const s=((h=t.trim().split(/\s+/u)[0])==null?void 0:h.toLowerCase())??"";return s?bo[s]??s:""}function gs(t,s){const h=En(t);if(!h)return z(s);const r=Ke.value;if(!r)return z(s);try{if(r.getLanguage(h))return r.highlight(s,{language:h,ignoreIllegals:!0}).value}catch{}return z(s)}function Fn(t,s){return Rt(ps(t,s))}function ps(t,s){const h=`${_e.value}\0${En(t)}\0${t}\0${s}`,r=Te.get(h);return r!==void 0?(Te.delete(h),Te.set(h,r),r):Ze(Te,h,gs(t,s),Eu)}function we(t){return be(t).map(s=>s.kind==="text"?z(s.value):s.kind==="bold"?`<strong class="message-bold-text">${z(s.value)}</strong>`:s.kind==="italic"?`<em class="message-italic-text">${z(s.value)}</em>`:s.kind==="strikethrough"?`<s class="message-strikethrough-text">${z(s.value)}</s>`:s.kind==="file"?`<a class="message-file-link" href="${z(le(s.path))}" target="_blank" rel="noopener noreferrer" title="${z(s.path)}">${z(s.displayPath)}</a>`:s.kind==="url"?`<a class="message-file-link" href="${z(s.href)}" target="_blank" rel="noopener noreferrer" title="${z(s.href)}">${z(s.value)}</a>`:`<code class="message-inline-code">${z(s.value)}</code>`).join("")}function vs(t){return t.paragraphs.map(s=>`<div class="message-list-item-text message-list-item-paragraph">${we(s)}</div>`).join("")}function Qe(t){var r;const s=vs(t),h=((r=t.children)==null?void 0:r.map(m=>Rn(m)).join(""))??"";return Rt(s+h)}function Bn(t){return t?` style="text-align:${t}"`:""}function Rn(t){if(t.kind==="paragraph")return`<p class="message-text">${we(t.value)}</p>`;if(t.kind==="heading"){const s=Math.min(6,Math.max(1,Math.trunc(t.level))),h=Kn(s),r=`message-heading ${Gn(s)}`;return`<${h} class="${r}">${we(t.value)}</${h}>`}if(t.kind==="blockquote")return`<blockquote class="message-blockquote">${we(t.value)}</blockquote>`;if(t.kind==="unorderedList")return`<ul class="message-list message-list-unordered">${t.items.map(h=>`<li class="message-list-item"><div class="message-list-item-content">${Qe(h)}</div></li>`).join("")}</ul>`;if(t.kind==="taskList")return`<ul class="message-list message-task-list">${t.items.map(h=>`<li class="message-task-item"><span class="message-task-checkbox" data-checked="${h.checked?"true":"false"}">${h.checked?"☑":"☐"}</span><div class="message-list-item-text">${we(h.text)}</div></li>`).join("")}</ul>`;if(t.kind==="orderedList"){const s=t.items.map(h=>`<li class="message-list-item"><div class="message-list-item-content">${Qe(h)}</div></li>`).join("");return`<ol class="message-list message-list-ordered" start="${t.start}">${s}</ol>`}if(t.kind==="table"){const s=t.headers.map((m,$)=>`<th class="message-table-head-cell"${Bn(t.alignments[$]??null)}>${we(m)}</th>`).join(""),h=t.rows.map(m=>'<tr class="message-table-body-row">'+m.map(($,k)=>`<td class="message-table-cell"${Bn(t.alignments[k]??null)}>${we($)}</td>`).join("")+"</tr>").join(""),r=h?`<tbody>${h}</tbody>`:"";return`<div class="message-table-wrap"><table class="message-table"><thead><tr>${s}</tr></thead>${r}</table></div>`}return t.kind==="codeBlock"?`<div class="message-code-block">${t.language?`<div class="message-code-language">${z(t.language)}</div>`:""}<pre class="message-code-pre"><code class="hljs">${Fn(t.language,t.value)}</code></pre></div>`:t.kind==="thematicBreak"?'<hr class="message-divider">':`<img class="message-image-preview message-markdown-image" src="${z(t.url)}" alt="${z(t.alt||"Embedded message image")}" loading="lazy">`}function On(t){const s=`${_.cwd}\0${_e.value}\0${t}`,h=Ce.get(s);if(h&&h.text===t&&h.cwd===_.cwd&&h.highlightVersion===_e.value)return Ce.delete(s),Ce.set(s,h),h.html;const r=eo(t).map($=>Rn($)).join(""),m=Rt(r);return Ze(Ce,s,{text:t,cwd:_.cwd,highlightVersion:_e.value,html:m},Au).html}function ks(){const t=fe.value,s=mn.value;!t||!s||(t.scrollTop=t.scrollHeight,s.scrollIntoView({block:"end"}))}function ys(t){return t.scrollHeight-(t.scrollTop+t.clientHeight)<=Mu}function bs(){if(fe.value&&he.value){Xe();return}}function Xe(){fe.value&&ks()}function Ft(){return he.value}function Hn(){if(!Ft()){Ve=0,oe=0;return}if(Xe(),Ve-=1,Ve<=0){oe=0;return}oe=requestAnimationFrame(Hn)}function et(t=6){Ft()&&(oe&&(cancelAnimationFrame(oe),oe=0),Ve=Math.max(t,1),oe=requestAnimationFrame(Hn))}function Dn(){et(3)}function jn(){he.value=!0,Xe(),et(4)}async function Wn(){var m;const t=fe.value;if(!t||!_.hasMorePersistedAbove||ge.value||_.isLoadingPersistedAbove===!0)return;ge.value=!0;const s=_.activeThreadId,h=t.scrollHeight,r=t.scrollTop;try{await((m=_.loadEarlierMessages)==null?void 0:m.call(_,s)),await nt(),_.activeThreadId===s&&(t.scrollTop=r+(t.scrollHeight-h))}finally{ge.value=!1}}n({jumpToLatest:jn});function ws(){if(!Ft())return;const t=fe.value;if(!t)return;const s=t.querySelectorAll("img.message-image-preview");for(const h of s)h.complete||gn.has(h)||(gn.add(h),h.addEventListener("load",Dn,{once:!0}),h.addEventListener("error",Dn,{once:!0}))}async function tt(){return Be||(Be=nt().then(()=>new Promise(t=>{ye&&cancelAnimationFrame(ye),ye=requestAnimationFrame(()=>{ye=0,Be=null,bs(),ws(),et(),t()})})),Be)}function $s(){Re.clear(),Oe.clear(),Ce.clear(),Te.clear()}ce(()=>_.messages,async t=>{if(_.isLoading)return;const s=new Set(t.filter(h=>h.messageType==="commandExecution"&&h.commandExecution).map(h=>h.id));f.value=yt(f.value,s),c.value=yt(c.value,s),u.value=yt(u.value,new Set([...Object.keys(je.value),...Object.keys(Tt.value)])),await tt()}),ce(()=>_.messages.some(t=>t.text.includes("```")),t=>{!t||Ke.value||Yo()},{immediate:!0}),ce(mt,(t,s)=>{if(!s||s===t||!c.value.has(s))return;const h=new Set(c.value);h.delete(s),c.value=h}),ce(()=>_.pendingRequests,async()=>{_.isLoading||await tt()},{deep:!0}),ce(()=>_.liveOverlay,async t=>{t&&he.value&&(await nt(),Xe(),et(8))},{deep:!0}),ce(()=>_.isLoading,async t=>{t||await tt()}),ce(()=>_.activeThreadId,async()=>{he.value=!0,Fe.value="",ge.value=!1,q.value={},te.value={},ne.value={},me.value=Qt(_.activeThreadId),await tt()},{flush:"post"});function xs(){const t=fe.value;!t||_.isLoading||(he.value=ys(t),t.scrollTop<Fu&&!ge.value&&(wn.value?_n():_.hasMorePersistedAbove===!0&&Wn()))}const Bt=O(new Set);function zn(t,s){return`${t}:${s}`}function _s(t,s){return Bt.value.has(zn(t,s))}function Cs(t,s){const h=new Set(Bt.value);h.add(zn(t,s)),Bt.value=h,pn.value+=1}function Nn(t){Fe.value=t}function qn(){Fe.value=""}return Xt(()=>{$s(),ye&&(cancelAnimationFrame(ye),ye=0),oe&&(cancelAnimationFrame(oe),oe=0),Q&&(clearTimeout(Q),Q=null)}),(t,s)=>(l(),d(E,null,[v("section",{class:"conversation-root",onContextmenuCapture:fs},[e.isLoading?(l(),d("p",_l,y(T(R)("Loading messages...")),1)):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(l(),d("p",Cl,y(T(R)("No messages in this thread yet.")),1)):(l(),d("ul",{key:2,ref_key:"conversationListRef",ref:fe,class:"conversation-list",onScroll:xs},[Zo.value?(l(),d("li",Tl,[v("button",{type:"button",class:"load-more-button",disabled:ge.value||e.isLoadingPersistedAbove,onClick:Wn},y(ge.value||e.isLoadingPersistedAbove?T(R)("Loading…"):T(R)("Load earlier messages")),9,Ll)])):L("",!0),wn.value?(l(),d("li",Il,[v("button",{type:"button",class:"load-more-button",disabled:ge.value,onClick:_n},y(T(R)("Load earlier ({n} turns)",{n:bn.value})),9,Ml)])):L("",!0),(l(!0),d(E,null,H(xn.value,h=>(l(),d(E,{key:h.key},[h.kind==="warm-card"?(l(),d("li",{key:0,id:$t(h.turn),class:"conversation-item conversation-item-warm-card","data-role":"system","data-message-type":"warmTurn"},[v("div",Sl,[v("div",Al,[j(Xr,{"user-text":h.userText,"assistant-preview":h.assistantPreview,"tool-count":h.toolCount,expanded:h.expanded,onToggle:r=>Bo(h.turn)},null,8,["user-text","assistant-preview","tool-count","expanded","onToggle"])])])],8,Pl)):(l(!0),d(E,{key:1},H([h.message],r=>(l(),d(E,{key:r.id},[zo(r)?(l(),d(E,{key:0},[v("li",El,[v("div",Fl,[v("div",Bl,[j(lr,{label:Uo(r),running:Vo(r),"has-outside-content":Ko(r)},{default:zt(()=>[(l(!0),d(E,null,H(No(r),m=>(l(),d(E,{key:qo(m)},[m.type==="batch"?(l(),Y(Vr,{key:0,kind:m.kind,messages:m.messages},null,8,["kind","messages"])):(l(!0),d(E,{key:1},H([m.message],$=>(l(),d(E,{key:$.id},[!gt.value.has($.id)&&!Pn.value.has($.id)?(l(),d(E,{key:0},[Z($)?(l(),d("div",Rl,[(l(!0),d(E,null,H(hn($),(k,C)=>(l(),Y(oo,{key:`work-cmd-${k.id}`,command:k,"step-index":C,expanded:cn(k),compact:un(k),"output-condensed":dn(k),onToggle:S=>fn(k)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])):on($)?(l(),Y(Yt,{key:1,message:$},null,8,["message"])):dt($)?(l(),Y(no,{key:2,message:$,expanded:tn($),"content-html":On($.text),onToggle:k=>nn($)},null,8,["message","expanded","content-html","onToggle"])):L("",!0)],64)):L("",!0)],64))),128))],64))),128))]),_:2},1032,["label","running","has-outside-content"])])])]),Lt(se(r))?(l(),d("li",Ol,[v("div",Hl,[v("div",Dl,[j(Dt,{summary:se(r),expanded:vt(_t(r)),cwd:_.cwd,actionable:It(se(r)),"action-status":Ie(se(r)),"action-error-text":Mt(se(r)),"next-action":Ye(se(r)),"action-label":Pt(se(r)),onToggle:m=>pt(_t(r)),onOpenDiff:m=>kt(se(r),m),onRequestAction:m=>At(se(r),m),onRequestFileAction:m=>Et(se(r),m)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])])])])):L("",!0)],64)):!Tn(r)&&!gt.value.has(r.id)&&!Pn.value.has(r.id)&&!(Go(r)&&Wo.value.has(r.turnId??""))?(l(),d(E,{key:1},[v("li",{id:Ho(r),class:"conversation-item","data-role":r.role,"data-message-type":r.messageType||""},[Co(r)?(l(),d("div",Wl,[v("div",zl,[s[3]||(s[3]=v("span",{class:"thread-compaction-spinner","aria-hidden":"true"},null,-1)),v("span",null,y(T(R)("Compacting thread context…")),1)])])):To(r)?(l(),d("div",Nl,[v("div",ql,y(T(R)("Context compacted")),1)])):Z(r)?(l(),d("div",Ul,[v("div",Vl,[v("div",Kl,[(l(!0),d(E,null,H(hn(r),(m,$)=>(l(),Y(oo,{key:`work-cmd-${m.id}`,command:m,"step-index":$,expanded:cn(m),compact:un(m),"output-condensed":dn(m),onToggle:k=>fn(m)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])])])):on(r)?(l(),Y(Yt,{key:3,message:r},null,8,["message"])):Ue(r)?(l(),d("div",{key:4,class:"message-row","data-role":r.role,"data-message-type":r.messageType||""},[v("div",{class:"message-stack","data-role":r.role},[v("article",{class:"message-body","data-role":r.role},[Lt(ae(r))?(l(),Y(Dt,{key:0,summary:ae(r),expanded:vt(r),cwd:_.cwd,actionable:It(ae(r)),"action-status":Ie(ae(r)),"action-error-text":Mt(ae(r)),"next-action":Ye(ae(r)),"action-label":Pt(ae(r)),onToggle:m=>pt(r),onOpenDiff:m=>kt(ae(r),m),onRequestAction:m=>At(ae(r),m),onRequestFileAction:m=>Et(ae(r),m)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):L("",!0)],8,Jl)],8,Zl)],8,Gl)):(l(),d("div",{key:5,class:"message-row","data-role":r.role,"data-message-type":r.messageType||""},[v("div",{class:"message-stack","data-role":r.role},[v("article",{class:"message-body","data-role":r.role},[r.images&&r.images.length>0?(l(),d("ul",{key:0,class:N(["message-image-list",{"message-generated-image-list":r.messageType==="imageView"}]),"data-role":r.role},[(l(!0),d(E,null,H(r.images,m=>(l(),d("li",{key:m,class:"message-image-item"},[v("button",{class:"message-image-button",type:"button",onClick:$=>Nn(m)},[v("img",{class:N(["message-image-preview",{"message-generated-image-preview":r.messageType==="imageView"}]),src:m,alt:r.messageType==="imageView"?"Generated image":"Message image preview",loading:"lazy"},null,10,nc)],8,tc)]))),128))],10,ec)):L("",!0),r.fileAttachments&&r.fileAttachments.length>0?(l(),d("div",oc,[(l(!0),d(E,null,H(r.fileAttachments,m=>(l(),d("span",{key:`${r.id}:${m.path}`,class:"message-file-chip"},[s[4]||(s[4]=v("span",{class:"message-file-chip-icon"},"📄",-1)),v("a",{class:"message-file-link message-file-chip-name",href:le(m.path),target:"_blank",rel:"noopener noreferrer",title:m.path},y(m.label),9,sc)]))),128))])):L("",!0),r.skills&&r.skills.length>0?(l(),d("div",ac,[(l(!0),d(E,null,H(r.skills,m=>(l(),d("a",{key:`${r.id}:${m.path}`,class:"message-skill-chip",href:le(m.path),title:m.path},[v("span",rc,y(T(R)("Skill")),1),v("span",lc,y(m.name),1)],8,ic))),128))])):L("",!0),r.text.length>0?(l(),d("article",{key:3,class:"message-card","data-role":r.role},[r.isAutomationRun?(l(),d("div",uc,[s[5]||(s[5]=v("span",null,"Sent via automation",-1)),r.automationDisplayName?(l(),d("code",dc,y(r.automationDisplayName),1)):L("",!0)])):L("",!0),r.messageType==="worked"?(l(),d("div",fc,[v("p",hc,y(r.text),1)])):dt(r)?(l(),Y(no,{key:2,message:r,expanded:tn(r),"content-html":On(r.text),onToggle:m=>nn(r)},null,8,["message","expanded","content-html","onToggle"])):Ss([r.id,r.text,_.cwd,_e.value,pn.value],()=>(l(),d("div",{key:3,class:"message-text-flow"},[(l(!0),d(E,null,H(ms(r),(m,$)=>(l(),d(E,{key:`block-${$}`},[m.kind==="paragraph"?(l(),d("p",mc,[(l(!0),d(E,null,H(be(m.value),(k,C)=>(l(),d(E,{key:`seg-${$}-${C}`},[k.kind==="text"?(l(),d("span",gc,y(k.value),1)):k.kind==="bold"?(l(),d("strong",pc,y(k.value),1)):k.kind==="italic"?(l(),d("em",vc,y(k.value),1)):k.kind==="strikethrough"?(l(),d("s",kc,y(k.value),1)):k.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(k.path),target:"_blank",rel:"noopener noreferrer",title:k.path},y(k.displayPath),9,yc)):k.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:k.href,target:"_blank",rel:"noopener noreferrer",title:k.href},y(k.value),9,bc)):(l(),d("code",wc,y(k.value),1))],64))),128))])):m.kind==="heading"?(l(),Y(Os(T(Kn)(m.level)),{key:1,class:N(["message-heading",T(Gn)(m.level)])},{default:zt(()=>[(l(!0),d(E,null,H(be(m.value),(k,C)=>(l(),d(E,{key:`heading-seg-${$}-${C}`},[k.kind==="text"?(l(),d("span",$c,y(k.value),1)):k.kind==="bold"?(l(),d("strong",xc,y(k.value),1)):k.kind==="italic"?(l(),d("em",_c,y(k.value),1)):k.kind==="strikethrough"?(l(),d("s",Cc,y(k.value),1)):k.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(k.path),target:"_blank",rel:"noopener noreferrer",title:k.path},y(k.displayPath),9,Tc)):k.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:k.href,target:"_blank",rel:"noopener noreferrer",title:k.href},y(k.value),9,Lc)):(l(),d("code",Ic,y(k.value),1))],64))),128))]),_:2},1032,["class"])):m.kind==="blockquote"?(l(),d("blockquote",Mc,[(l(!0),d(E,null,H(be(m.value),(k,C)=>(l(),d(E,{key:`quote-seg-${$}-${C}`},[k.kind==="text"?(l(),d("span",Pc,y(k.value),1)):k.kind==="bold"?(l(),d("strong",Sc,y(k.value),1)):k.kind==="italic"?(l(),d("em",Ac,y(k.value),1)):k.kind==="strikethrough"?(l(),d("s",Ec,y(k.value),1)):k.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(k.path),target:"_blank",rel:"noopener noreferrer",title:k.path},y(k.displayPath),9,Fc)):k.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:k.href,target:"_blank",rel:"noopener noreferrer",title:k.href},y(k.value),9,Bc)):(l(),d("code",Rc,y(k.value),1))],64))),128))])):m.kind==="unorderedList"?(l(),d("ul",Oc,[(l(!0),d(E,null,H(m.items,(k,C)=>(l(),d("li",{key:`ul-${$}-${C}`,class:"message-list-item"},[v("div",{class:"message-list-item-content",innerHTML:Qe(k)},null,8,Hc)]))),128))])):m.kind==="taskList"?(l(),d("ul",Dc,[(l(!0),d(E,null,H(m.items,(k,C)=>(l(),d("li",{key:`task-${$}-${C}`,class:"message-task-item"},[v("span",{class:"message-task-checkbox","data-checked":k.checked},y(k.checked?"☑":"☐"),9,jc),v("div",Wc,[(l(!0),d(E,null,H(be(k.text),(S,W)=>(l(),d(E,{key:`task-seg-${$}-${C}-${W}`},[S.kind==="text"?(l(),d("span",zc,y(S.value),1)):S.kind==="bold"?(l(),d("strong",Nc,y(S.value),1)):S.kind==="italic"?(l(),d("em",qc,y(S.value),1)):S.kind==="strikethrough"?(l(),d("s",Uc,y(S.value),1)):S.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(S.path),target:"_blank",rel:"noopener noreferrer",title:S.path},y(S.displayPath),9,Vc)):S.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:S.href,target:"_blank",rel:"noopener noreferrer",title:S.href},y(S.value),9,Kc)):(l(),d("code",Gc,y(S.value),1))],64))),128))])]))),128))])):m.kind==="orderedList"?(l(),d("ol",{key:5,class:"message-list message-list-ordered",start:m.start},[(l(!0),d(E,null,H(m.items,(k,C)=>(l(),d("li",{key:`ol-${$}-${C}`,class:"message-list-item"},[v("div",{class:"message-list-item-content",innerHTML:Qe(k)},null,8,Jc)]))),128))],8,Zc)):m.kind==="table"?(l(),d("div",Yc,[v("table",Qc,[v("thead",null,[v("tr",null,[(l(!0),d(E,null,H(m.headers,(k,C)=>(l(),d("th",{key:`th-${$}-${C}`,class:"message-table-head-cell",style:We({textAlign:m.alignments[C]??"left"})},[(l(!0),d(E,null,H(be(k),(S,W)=>(l(),d(E,{key:`th-seg-${$}-${C}-${W}`},[S.kind==="text"?(l(),d("span",Xc,y(S.value),1)):S.kind==="bold"?(l(),d("strong",eu,y(S.value),1)):S.kind==="italic"?(l(),d("em",tu,y(S.value),1)):S.kind==="strikethrough"?(l(),d("s",nu,y(S.value),1)):S.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(S.path),target:"_blank",rel:"noopener noreferrer",title:S.path},y(S.displayPath),9,ou)):S.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:S.href,target:"_blank",rel:"noopener noreferrer",title:S.href},y(S.value),9,su)):(l(),d("code",au,y(S.value),1))],64))),128))],4))),128))])]),m.rows.length>0?(l(),d("tbody",iu,[(l(!0),d(E,null,H(m.rows,(k,C)=>(l(),d("tr",{key:`tr-${$}-${C}`,class:"message-table-body-row"},[(l(!0),d(E,null,H(k,(S,W)=>(l(),d("td",{key:`td-${$}-${C}-${W}`,class:"message-table-cell",style:We({textAlign:m.alignments[W]??"left"})},[(l(!0),d(E,null,H(be(S),(D,pe)=>(l(),d(E,{key:`td-seg-${$}-${C}-${W}-${pe}`},[D.kind==="text"?(l(),d("span",ru,y(D.value),1)):D.kind==="bold"?(l(),d("strong",lu,y(D.value),1)):D.kind==="italic"?(l(),d("em",cu,y(D.value),1)):D.kind==="strikethrough"?(l(),d("s",uu,y(D.value),1)):D.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:le(D.path),target:"_blank",rel:"noopener noreferrer",title:D.path},y(D.displayPath),9,du)):D.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:D.href,target:"_blank",rel:"noopener noreferrer",title:D.href},y(D.value),9,fu)):(l(),d("code",hu,y(D.value),1))],64))),128))],4))),128))]))),128))])):L("",!0)])])):m.kind==="codeBlock"?(l(),d("div",mu,[m.language?(l(),d("div",gu,y(m.language),1)):L("",!0),v("pre",pu,[v("code",{class:"hljs",innerHTML:Fn(m.language,m.value)},null,8,vu)])])):m.kind==="thematicBreak"?(l(),d("hr",ku)):_s(r.id,$)?(l(),d("p",yu,y(m.markdown),1)):(l(),d("button",{key:10,class:"message-image-button",type:"button",onClick:k=>Nn(m.url)},[v("img",{class:"message-image-preview message-markdown-image",src:m.url,alt:m.alt||"Embedded message image",loading:"lazy",onError:k=>Cs(r.id,$)},null,40,wu)],8,bu))],64))),128))])),s,0),Lo(r)?(l(),d("a",{key:4,class:"turn-error-feedback",href:T(ve),onClick:m=>xe(m,r.text)},y(T(R)("Send feedback")),9,$u)):L("",!0)],8,cc)):L("",!0),j(er,{role:r.role,"show-edit":ls(r),"show-fork":os(r),"show-copy":es(r)||ts(r),copied:ke.value===r.id,onEdit:m=>cs(r.id),onFork:m=>rs(r.id),onCopy:m=>r.role==="user"?ns(r.id):is(r.id)},null,8,["role","show-edit","show-fork","show-copy","copied","onEdit","onFork","onCopy"])],8,Xl)],8,Ql)],8,Yl))],8,jl),Lt(X(r))?(l(),d("li",xu,[v("div",_u,[v("div",Cu,[j(Dt,{summary:X(r),expanded:vt(r),cwd:_.cwd,actionable:It(X(r)),"action-status":Ie(X(r)),"action-error-text":Mt(X(r)),"next-action":Ye(X(r)),"action-label":Pt(X(r)),onToggle:m=>pt(r),onOpenDiff:m=>kt(X(r),m),onRequestAction:m=>At(X(r),m),onRequestFileAction:m=>Et(X(r),m)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])])])])):L("",!0)],64)):L("",!0)],64))),128))],64))),128)),e.liveOverlay?(l(),Y(Wi,{key:2,overlay:e.liveOverlay,"feedback-mailto":T(ve)},null,8,["overlay","feedback-mailto"])):L("",!0),v("li",{ref_key:"bottomAnchorRef",ref:mn,class:"conversation-bottom-anchor"},null,512)],544)),j(mr,{anchors:Cn.value,"active-turn":Ro.value,onJump:Do},null,8,["anchors","active-turn"]),Jo.value?(l(),d("button",{key:3,type:"button",class:"jump-to-latest-button",title:T(R)("Jump to latest"),"aria-label":T(R)("Jump to latest output"),onClick:jn},[j(As,{class:"icon-svg jump-to-latest-icon"})],8,Tu)):L("",!0),Fe.value.length>0?(l(),d("div",{key:4,class:"image-modal-backdrop",onClick:qn},[v("div",{class:"image-modal-content",onClick:s[1]||(s[1]=Se(()=>{},["stop"]))},[v("button",{class:"image-modal-close",type:"button","aria-label":T(R)("Close image preview"),onClick:qn},[j(lo,{class:"icon-svg"})],8,Lu),v("img",{class:"image-modal-image",src:Fe.value,alt:T(R)("Expanded message image")},null,8,Iu)])])):L("",!0),j(xi,{visible:I.value,x:A.value,y:x.value,"browse-url":P.value,"edit-url":w.value,onClose:hs},null,8,["visible","x","y","browse-url","edit-url"]),j(ni,{change:An.value,changes:Sn.value,lines:as.value,"is-mobile":T(F),"is-file-list-open":b.value,cwd:_.cwd,onClose:Mo,onSelectChange:Ao,onToggleFileList:Po,onCloseFileList:So},null,8,["change","changes","lines","is-mobile","is-file-list-open","cwd"])],32),j(va,{visible:re.value!==null,title:Eo.value,message:Fo.value,"confirm-label":"Confirm",danger:"",onConfirm:us,onCancel:s[2]||(s[2]=h=>re.value=null)},null,8,["visible","title","message"])],64))}}),Hu=U(Bu,[["__scopeId","data-v-87ebbea0"]]);export{Hu as default};
|