farming-code 2.2.8 → 2.2.11

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.
Files changed (102) hide show
  1. package/README.md +36 -23
  2. package/README.zh_cn.md +36 -23
  3. package/THIRD_PARTY_NOTICES.md +11 -2
  4. package/backend/acp-checkpoint-store.js +198 -0
  5. package/backend/acp-runtime.js +306 -83
  6. package/backend/acp-session-state.js +202 -6
  7. package/backend/acp-transcript.js +112 -0
  8. package/backend/agent-activity.js +6 -157
  9. package/backend/agent-manager.js +1482 -730
  10. package/backend/agent-provider-session.js +17 -242
  11. package/backend/agent-runtime-binding.js +219 -0
  12. package/backend/agent-session-history.js +66 -1
  13. package/backend/auth.js +79 -6
  14. package/backend/codex-models.js +81 -84
  15. package/backend/codex-session-archive.js +45 -0
  16. package/backend/codex-terminal-profile.js +500 -0
  17. package/backend/codex-transcript-sanitizer.js +12 -0
  18. package/backend/codex-transcript.js +230 -8
  19. package/backend/config-manager.js +30 -0
  20. package/backend/control-api.js +192 -17
  21. package/backend/farming-net-pass.js +285 -0
  22. package/backend/farming-net-registry.js +112 -0
  23. package/backend/farming-net-server.js +298 -0
  24. package/backend/farming-session-store.js +5 -13
  25. package/backend/git-worktree-info.js +181 -0
  26. package/backend/local-session-engine.js +411 -186
  27. package/backend/main-page-session.js +5 -2
  28. package/backend/native-pty-controller-generation.js +106 -0
  29. package/backend/native-pty-host-client.js +275 -7
  30. package/backend/native-pty-host-identity.js +86 -0
  31. package/backend/native-pty-host.js +813 -114
  32. package/backend/native-session-engine.js +100 -28
  33. package/backend/packaged-node-pty.js +22 -2
  34. package/backend/provider-adapters.js +253 -0
  35. package/backend/provider-session-service.js +241 -0
  36. package/backend/runtime-observation.js +81 -0
  37. package/backend/server.js +294 -86
  38. package/backend/session-engine-bridge.js +21 -2
  39. package/backend/session-engine-router.js +1 -1
  40. package/backend/session-engine.js +1 -1
  41. package/backend/session-stream-protocol.js +185 -0
  42. package/backend/storage-layout.js +55 -0
  43. package/backend/terminal-attach-checkpoint.js +74 -0
  44. package/backend/terminal-exit-quiescence.js +39 -0
  45. package/backend/terminal-reducer-flow-control.js +97 -0
  46. package/backend/terminal-screen-state.js +11 -2
  47. package/backend/terminal-screen-worker-pool.js +59 -6
  48. package/backend/terminal-screen-worker-thread.js +97 -57
  49. package/backend/terminal-screen-worker.js +133 -51
  50. package/backend/terminal-state-serialization.js +127 -0
  51. package/backend/terminal-status.js +23 -4
  52. package/backend/usage-monitor.js +81 -4
  53. package/backend/workspace-directory.js +152 -0
  54. package/backend/workspace-file-router.js +182 -76
  55. package/backend/workspace-file-service.js +319 -4
  56. package/backend/workspace-root-registry.js +164 -0
  57. package/dist/assets/App-CHYpgECZ.js +208 -0
  58. package/dist/assets/{FileEditorMarkdownPreview-elKWc8Im.js → FileEditorMarkdownPreview--Cri80nQ.js} +92 -92
  59. package/dist/assets/FileEditorPane-DGJlEKdf.js +2 -0
  60. package/dist/assets/IconGlyphs-Cc14sepw.js +1 -0
  61. package/dist/assets/ProjectFilesSection-Cz1wG4NT.js +12 -0
  62. package/dist/assets/{ReviewPage-BaXu1ZdX.js → ReviewPage-LonRc6Fz.js} +1 -1
  63. package/dist/assets/code-dark-B1pAtO_P.css +1 -0
  64. package/dist/assets/file-icons-Bw2qd5iT.js +1 -0
  65. package/dist/assets/{index-BrbljRqn.js → index-miO2r9IZ.js} +3 -3
  66. package/dist/assets/main-DNe0jPw-.css +1 -0
  67. package/dist/assets/workspace-editor-model-BQol4qbA.js +1 -0
  68. package/dist/assets/workspace-editor-monaco-5gFbeDPF.js +1 -0
  69. package/dist/assets/workspace-editor-monaco-xPv8JzHH.js +4 -0
  70. package/dist/assets/workspace-view-state-DvYG_9PH.js +7 -0
  71. package/dist/assets/workspace-working-copy-D8-s_Sgh.js +1 -0
  72. package/dist/index.html +1 -1
  73. package/frontend/farming-net/app.css +625 -0
  74. package/frontend/farming-net/app.js +268 -0
  75. package/frontend/farming-net/index.html +86 -0
  76. package/frontend/reading-anchor.js +198 -0
  77. package/frontend/session-bridge.js +12 -3
  78. package/frontend/session-modal-bridge.js +5 -12
  79. package/frontend/skins/crt/app.js +1976 -793
  80. package/frontend/skins/crt/index.html +313 -23
  81. package/frontend/skins/crt/styles/billing.css +294 -223
  82. package/frontend/skins/crt/styles/monochrome-green.css +7 -2
  83. package/frontend/terminal-replay.js +372 -0
  84. package/package.json +10 -3
  85. package/shared/browser-protocol.d.ts +5 -0
  86. package/shared/browser-protocol.js +130 -0
  87. package/dist/assets/App-8dYAM6ql.js +0 -124
  88. package/dist/assets/FileEditorPane-RWiFD2cq.js +0 -5
  89. package/dist/assets/IconGlyphs-DfL0EBnj.js +0 -1
  90. package/dist/assets/ProjectFilesSection-Q4PDsWmM.js +0 -12
  91. package/dist/assets/code-dark-CDkOQAtK.css +0 -1
  92. package/dist/assets/file-icons-EFUGSSwf.js +0 -1
  93. package/dist/assets/main-D073SnW4.css +0 -1
  94. package/dist/assets/qoder-C9LmmOSf.svg +0 -1
  95. package/dist/assets/qoder-Cf9gl0Y5.svg +0 -1
  96. package/dist/assets/qoder-gHCinseV.svg +0 -1
  97. package/dist/assets/workspace-view-state-CTyDzk2D.js +0 -1
  98. package/dist/assets/zsh-CLpveKlF.svg +0 -1
  99. package/dist/assets/zsh-FxSpMPbz.svg +0 -1
  100. /package/dist/assets/{api-D1lyBYIQ.js → api-D8nyOEbz.js} +0 -0
  101. /package/dist/assets/{core-ZlAPicox.js → core-D0LFJkDt.js} +0 -0
  102. /package/dist/assets/{useWorkspaceMenuKeyboard-CneKAZUJ.js → useWorkspaceMenuKeyboard-Brws6Ar9.js} +0 -0
@@ -1,3 +1,3 @@
1
- import{r as e}from"./chunk-DECur_0Z.js";import{i as t,t as n}from"./jsx-runtime-BthL93pI.js";import{C as r,d as i,h as a,l as o,m as s,o as c,p as l,s as u}from"./IconGlyphs-DfL0EBnj.js";import{a as d,c as f,d as p,i as m,l as h,n as g,o as _,r as v,s as y,t as b,u as x}from"./core-ZlAPicox.js";import{A as S,C as ee,D as te,E as ne,F as re,M as ie,N as C,O as ae,P as oe,S as se,T as ce,_ as le,a as ue,b as w,c as de,d as fe,f as pe,g as me,h as he,i as ge,j as T,k as _e,l as ve,m as ye,n as be,p as xe,r as Se,s as Ce,t as we,u as Te,v as Ee,w as De,x as Oe,y as ke}from"./api-D1lyBYIQ.js";var E=e(t());function D(e){let t=[`package`,`import`,`option`,`optional`,`required`,`repeated`,`group`,`oneof`],n=[`double`,`float`,`int32`,`int64`,`uint32`,`uint64`,`sint32`,`sint64`,`fixed32`,`fixed64`,`sfixed32`,`sfixed64`,`bool`,`string`,`bytes`],r={match:[/(message|enum|service)\s+/,e.IDENT_RE],scope:{1:`keyword`,2:`title.class`}};return{name:`Protocol Buffers`,aliases:[`proto`],keywords:{keyword:t,type:n,literal:[`true`,`false`]},contains:[e.QUOTE_STRING_MODE,e.NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,r,{className:`function`,beginKeywords:`rpc`,end:/[{;]/,excludeEnd:!0,keywords:`rpc returns`},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}function Ae(e){return e instanceof Error&&e.message.trim()?e.message.trim():typeof e==`string`&&e.trim()?e.trim():`review file diff request failed`}function O(e){return e.diffLoaded===!1&&!ie(e)}function je(e,t,n,r={}){if(t.reviewId!==void 0&&r.reviewId!==t.reviewId)throw Error(`loaded review file belongs to a stale review`);if(n.path!==t.path)throw Error(`loaded review file path does not match requested path`);if(O(n))throw Error(`loaded review file is still a metadata-only row`);if(!e[t.patchset]?.some(e=>e.path===t.path))throw Error(`loaded review file path is no longer in the review catalog`);return{action:{patchset:t.patchset,path:t.path,...t.reviewId?{reviewId:t.reviewId}:{},type:`commit-file-diff-load`},catalog:se(e,t.patchset,{...n,diffLoaded:!0})}}function Me(e,t){return{error:Ae(t),patchset:e.patchset,path:e.path,...e.reviewId?{reviewId:e.reviewId}:{},type:`fail-file-diff-load`}}function k(e){return e===`added`?`A`:e===`copied`?`C`:e===`deleted`?`D`:e===`renamed`?`R`:e===`rewritten`?`W`:e===`unmodified`?`U`:e===`reverted`?`X`:`M`}function A(e){return e.status?e.status:k(e.kind)}function j(e){return _e(e)}function Ne(e){return e.binary?`binary`:ie(e)?`too-expensive`:e.diffLoaded===!1?`not-loaded`:`loaded`}function Pe(e,t,n={}){let r=n.patchset??e.patchRange.patchset,i=C(e,t.path,r),a=oe(e,r),o=i.loaded?i.status===`reviewed`:null;return{action:o===null?null:{ariaLabel:o?`Mark as unreviewed`:`Mark as reviewed`,disabled:!!n.mutationPending,label:o?`MARK UNREVIEWED`:`MARK REVIEWED`,nextReviewed:!o,visibility:`on-row-interaction`},added:t.added,binary:t.binary===!0,changeLabel:A(t),commentPaths:j(t),deleted:t.removed,...T(e,t.path,r)?{diffLoadError:T(e,t.path,r)}:{},diffLoadPending:a.pendingDiffPaths.includes(t.path),diffStatus:Ne(t),diffTooExpensive:t.diffTooExpensive===!0||t.diff.truncated===!0,expanded:a.expandedPaths.includes(t.path),...t.newMode?{newMode:t.newMode}:{},...t.newSha?{newSha:t.newSha}:{},...t.oldMode?{oldMode:t.oldMode}:{},...t.oldSha?{oldSha:t.oldSha}:{},path:t.path,pending:i.pending,...t.previousPath?{previousPath:t.previousPath}:{},reviewed:o,reviewedLabel:o===!0?`Reviewed`:null,reviewStatusLoaded:i.loaded,...Number.isInteger(t.size)?{size:t.size}:{},...Number.isInteger(t.sizeDelta)?{sizeDelta:t.sizeDelta}:{}}}function Fe(e){let t=typeof e==`string`?new URLSearchParams(e):e,n=t.get(`agentId`)?.trim()||``,r=[...new Set(t.getAll(`acpItem`).map(e=>e.trim()).filter(Boolean))];return!n||r.length===0||r.length>256?null:{agentId:n,itemIds:r}}function M(e,t,n){let r=e.get(t);if(r===null||r.trim()===``||!/^\d+$/.test(r.trim()))return;let i=Number(r.trim());return Number.isSafeInteger(i)&&i>=n?i:void 0}function Ie(e){let t=e.get(`ignoreWhitespace`);if(t===`ALL`||t===`IGNORE_ALL`)return`ALL`;if(t===`TRAILING`||t===`IGNORE_TRAILING`)return`TRAILING`;if(t===`LEADING_AND_TRAILING`||t===`IGNORE_LEADING_AND_TRAILING`)return`LEADING_AND_TRAILING`}function Le(e){let t=e.get(`metadataOnly`);return t===`1`||t===`true`?!0:void 0}function N(e){let t=e.get(`scope`);return t===`tracked`||t===`untracked`?t:void 0}function Re(e){let t=M(e,`context`,0),n=Ie(e),r=M(e,`limit`,1),i=Le(e),a=M(e,`modifiedWithinDays`,1),o=N(e),s=e.getAll(`path`).map(e=>e.trim()).filter(Boolean);return{...t===void 0?{}:{context:t},...n?{ignoreWhitespace:n}:{},...r===void 0?{}:{limit:r},...i===!0?{metadataOnly:i}:{},...o?{scope:o}:{},...s.length>0?{paths:s}:{},...o===`untracked`&&a!==void 0?{modifiedWithinDays:a}:{}}}function P(e){let t=typeof e==`string`?new URLSearchParams(e):e,n=t.get(`agentId`)?.trim()||``,r=t.get(`root`)?.trim()||``;if(n&&r)return{error:`only one review workspace target is allowed`,request:null};if(!n&&!r)return{request:null};let i=n?{agentId:n}:{root:r},a=Re(t),o=t.get(`reviewId`)?.trim()||``,s=t.get(`base`),c=t.get(`head`);if(!(s!==null||c!==null))return{request:{...i,...a,source:`working-copy`}};let l=w(s||``),u=w(c||``);return!l||!u?{error:`base and head revisions are invalid`,request:null}:{request:{...i,base:l,head:u,...a,...o?{reviewId:o}:{},source:`git-range`}}}function ze(e){return P(e?.search??``)}var F=n();async function Be(e,t){let n=[],r=[],i=0;return await Promise.all(Array.from({length:Math.min(4,t.length)},async()=>{for(;i<t.length;){let a=t[i++];if(a)try{n.push(await fe(e,a))}catch(e){r.push(e instanceof Error?e:Error(`review file diff request failed`))}}})),{errors:r,files:n}}function I(e){let t=nt(e.path),n=t===`python`,r=Ze(e.path).replace(/\W/g,`_`),i=(e,t)=>({kind:`context`,left:{line:e,text:t},right:{line:e,text:t}}),a=Array.from({length:128},(e,n)=>{let r=n+1,a=t===`python`?`#`:t===`markdown`?`<!--`:`//`,o=t===`markdown`?` -->`:``,s=r>=29?`unchanged review context ${r-28}`:`unchanged review prelude ${r}`;return i(r,`${r===29||r===128?` `:``}${a} ${s}${o}`)});if(e.kind===`added`){let t=n?`${r} = create_review_snapshot()`:`export const ${r} = createReviewSnapshot()`,i=n?`__all__ = ["${r}"]`:`export default ${r}`;return{hunks:[{header:`@@ -0,0 +1,2 @@ ${e.path}`,oldStart:0,oldLines:0,newStart:1,newLines:2,rows:[{kind:`added`,right:{line:1,text:t}},{kind:`added`,right:{line:2,text:i}}]}]}}if(e.kind===`deleted`){let t=n?`def summarize_changes():`:`export function summarizeChanges() {`,r=n?` return "legacy summary"`:` return 'legacy summary'`;return{hunks:[{header:`@@ -1,2 +0,0 @@ ${e.path}`,oldStart:1,oldLines:2,newStart:0,newLines:0,rows:[{kind:`deleted`,left:{line:1,text:t}},{kind:`deleted`,left:{line:2,text:r}}]}]}}let o=n?`def create_change_set(input: ChangeInput) -> list[ReviewEntry]:`:`export function createChangeSet(input: ChangeInput) {`,s=n?` return normalize_changes(input.files)`:` return normalizeChanges(input.files)`,c=n?` return create_review_entries(input.files, input.base)`:` return createReviewEntries(input.files, input.base)`,l=n?`def mark_reviewed(path: str) -> ReviewState:`:`export function markReviewed(path: string) {`,u=n?` return {"path": path, "reviewed_at": time.time()}`:` return { path, reviewedAt: Date.now() }`,d=n?`if not path:`:` if (!path) return null`,f=n?` return None`:` const snapshot = readSnapshot(input.base)`,p=n?`return {**snapshot, "files": input.files}`:` return { ...snapshot, files: input.files }`,m=n?``:`}`,h=n?` return finalize_change_set(input) `:` return finalizeChangeSet(input) `;return{hunks:[{commonContext:a,header:`@@ -129,7 +129,10 @@ ${e.path}`,oldStart:129,oldLines:7,newStart:129,newLines:10,rows:[i(129,o),{kind:`deleted`,left:{line:130,text:s}},{kind:`added`,right:{line:130,text:c}},i(131,m),{kind:`added`,right:{line:133,text:l}},{kind:`added`,right:{line:134,text:u}},i(135,d),i(136,f),{kind:`added`,right:{line:137,text:p}},i(138,m),{kind:`deleted`,left:{line:139,text:h},whitespaceOnly:!0},{kind:`added`,right:{line:139,text:h.trimEnd()},whitespaceOnly:!0}]}]}}function Ve(e){return{...e,diff:I(e)}}var He=Object.fromEntries(Object.entries({"Patchset 20":[{path:`clis/dataflow.py`,kind:`modified`,added:2,removed:85},{path:`clis/diagnose.py`,kind:`modified`,added:8,removed:11},{path:`clis/fetch_instance_log.py`,kind:`deleted`,added:0,removed:573},{path:`clis/fetch_logview.py`,kind:`modified`,added:2,removed:2},{path:`clis/fetch_meta_timeline.py`,kind:`modified`,added:0,removed:2},{path:`clis/fetch_quota_snapshot.py`,kind:`deleted`,added:0,removed:290},{path:`clis/hbo_plan_diagnose.py`,kind:`deleted`,added:0,removed:119},{path:`clis/parse_logview.py`,kind:`modified`,added:6,removed:2},{path:`clis/query_sls.py`,kind:`modified`,added:14,removed:2},{path:`devclis/README.md`,kind:`added`,added:15,removed:0},{path:`docs/cli/studio.md`,kind:`modified`,added:1,removed:2},{path:`tests/review/change-set.spec.ts`,kind:`renamed`,previousPath:`tests/changes/change-summary.spec.ts`,added:28,removed:6}],"Patchset 19":[{path:`clis/dataflow.py`,kind:`modified`,added:1,removed:52},{path:`clis/diagnose.py`,kind:`modified`,added:5,removed:6},{path:`clis/fetch_instance_log.py`,kind:`deleted`,added:0,removed:573},{path:`clis/fetch_logview.py`,kind:`modified`,added:1,removed:2},{path:`clis/fetch_meta_timeline.py`,kind:`modified`,added:0,removed:2},{path:`clis/hbo_plan_diagnose.py`,kind:`deleted`,added:0,removed:119},{path:`clis/parse_logview.py`,kind:`modified`,added:4,removed:2},{path:`clis/query_sls.py`,kind:`modified`,added:7,removed:1},{path:`docs/cli/studio.md`,kind:`modified`,added:1,removed:1}]}).map(([e,t])=>[e,t.map(Ve)])),Ue=`Working copy`,L=`Review`,R={"Patchset 20":[`clis/dataflow.py`,`clis/fetch_instance_log.py`],"Patchset 19":[`clis/fetch_instance_log.py`]},We=De,Ge=`farming.review.diff-preferences`;b.registerLanguage(`typescript`,m),b.registerLanguage(`python`,_),b.registerLanguage(`sql`,d),b.registerLanguage(`markdown`,y),b.registerLanguage(`cpp`,x),b.registerLanguage(`java`,h),b.registerLanguage(`protobuf`,D),b.registerLanguage(`json`,f),b.registerLanguage(`yaml`,g),b.registerLanguage(`bash`,p),b.registerLanguage(`xml`,v);function Ke(){if(typeof window>`u`)return We;try{return te(JSON.parse(window.localStorage.getItem(Ge)||`{}`))}catch{return We}}function qe(e,t=!0){return e?e.source===`git-range`?e.head:Ue:t?`Patchset 20`:L}function Je(e,t=!0){return e?e.source===`git-range`?e.base:`HEAD`:`Base`}function Ye(e,t=!0){return e?{[qe(e,t)]:[]}:t?He:{[L]:[]}}function Xe({catalog:e,comments:t,initialPatchset:n,basePatchset:r,initiallyExpand:i,reviewId:a}){let o=ne({catalog:e,comments:t,patchRange:{basePatchset:r,patchset:n},preferences:Ke(),reviewId:a,reviewedPathsByPatchset:n===`Patchset 20`||n===`Patchset 19`?R:{}});return i?{...o,patchsets:Object.fromEntries(Object.keys(e).map(t=>{let n=e[t]??[],r=n[1]?.path??n[0]?.path;return[t,{...oe(o,t),expandedPaths:r?[r]:[]}]}))}:o}function Ze(e){let t=e.split(`/`);return t[t.length-1]||e}function z(e){let t=Math.abs(e);return t<1024?`${e} B`:t<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function B(e){return e.replace(/[&<>"']/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`})[e]??e)}function Qe(e,t,n){return Array.from(e).slice(t,n).join(``)}function $e({action:e,pending:t,reviewed:n,reviewedLabel:r,onToggle:i}){return(0,F.jsxs)(`div`,{className:`review-review-status ${n?`reviewed`:``} ${t?`pending`:``}`,children:[r?(0,F.jsx)(`span`,{className:`review-reviewed-label`,children:r}):null,e?(0,F.jsx)(`button`,{type:`button`,"aria-checked":n===!0,"aria-label":`Reviewed`,"data-action-visibility":e.visibility,disabled:e.disabled,role:`switch`,title:t?`Saving review status`:e.ariaLabel,onClick:i,children:t?`SAVING…`:e.label}):(0,F.jsx)(`span`,{className:`review-review-loading`,children:`Reviewed status loading`})]})}function et({file:e,maxChangeSize:t}){if(e.binary)return(0,F.jsx)(`span`,{className:`review-change-bar binary`,"aria-label":`Binary file`});let n=e=>e===0?0:Math.max(2,Math.round(e/t*72));return(0,F.jsxs)(`span`,{className:`review-change-bar`,"aria-label":`+${e.added} −${e.removed}`,children:[(0,F.jsx)(`i`,{className:`added`,style:{width:`${n(e.added)}px`}}),(0,F.jsx)(`i`,{className:`deleted`,style:{width:`${n(e.removed)}px`}})]})}function tt({file:e}){if(e.binary){let t=typeof e.sizeDelta==`number`&&Number.isInteger(e.sizeDelta)?e.sizeDelta:null;return(0,F.jsx)(`span`,{className:`review-file-stats binary`,children:t===null?`Binary`:z(t)})}return(0,F.jsxs)(`span`,{className:`review-file-stats`,children:[e.added?(0,F.jsxs)(`span`,{className:`added`,children:[`+`,e.added]}):null,e.removed?(0,F.jsxs)(`span`,{className:`removed`,children:[`−`,e.removed]}):null]})}function nt(e){let t=e.toLowerCase();return t.endsWith(`.osql`)||t.endsWith(`.odpsql`)?`sql`:t.endsWith(`.py`)?`python`:t.endsWith(`.md`)||t.endsWith(`.mdx`)?`markdown`:/\.(c|cc|cpp|cxx|h|hh|hpp|hxx)$/.test(t)?`cpp`:t.endsWith(`.java`)?`java`:t.endsWith(`.proto`)?`protobuf`:t.endsWith(`.json`)?`json`:t.endsWith(`.yaml`)||t.endsWith(`.yml`)?`yaml`:/\.(bash|sh|zsh)$/.test(t)?`bash`:/\.(html|htm|xml)$/.test(t)?`xml`:`typescript`}function rt({intraline:e,language:t,line:n,side:r,text:i,preferences:a}){let o=n&&r?{"data-review-line":n,"data-review-side":r}:{},s=a.showTrailingWhitespace?i.match(/[ \t]+$/)?.[0]:void 0,c=s?i.slice(0,-s.length):i,l=a.intralineDifference?e:void 0,u=l?.length?it(c,l,t,a):V(c,t,a);return a.showTabs&&(u=u.replace(/\t/g,`<span class="review-tab-marker">⇥</span>`)),s&&(u+=`<span class="review-trailing-whitespace">${s.replace(/[ \t]/g,`·`)}</span>`),(0,F.jsx)(`code`,{...o,dangerouslySetInnerHTML:{__html:u}})}function V(e,t,n){return n.syntaxHighlighting&&e?b.highlight(e,{language:t,ignoreIllegals:!0}).value:B(e)}function it(e,t,n,r){let i=``,a=0,o=Array.from(e).length;for(let s of t){let t=Math.max(a,Math.min(s.start,o)),c=Math.max(t,Math.min(s.end,o));i+=V(Qe(e,a,t),n,r),c>t&&(i+=`<span class="review-intraline">${V(Qe(e,t,c),n,r)}</span>`),a=c}return i+=V(Qe(e,a),n,r),i}function H({kind:e,intraline:t,language:n,line:r,side:i,text:a,preferences:o,renderAttachment:s}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`review-diff-row unified ${e}`,children:[(0,F.jsx)(`span`,{children:r??``}),(0,F.jsx)(rt,{intraline:t,language:n,line:r,side:i,text:a,preferences:o})]}),r?s?.(r,[i]):null]})}function at({kind:e,language:t,leftLine:n,leftIntraline:r,leftText:i,rightLine:a,rightIntraline:o,rightText:s,preferences:c,renderAttachment:l}){let u=a??n,d=[...n?[`left`]:[],...a?[`right`]:[]];return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`review-diff-row ${e}`,children:[(0,F.jsx)(`span`,{children:n??``}),(0,F.jsx)(rt,{intraline:r,language:t,line:n,side:`left`,text:i??``,preferences:c}),(0,F.jsx)(`span`,{children:a??``}),(0,F.jsx)(rt,{intraline:o,language:t,line:a,side:`right`,text:s??``,preferences:c})]}),u?l?.(u,d):null]})}function U(e){let t=e.findIndex(e=>e.kind!==`context`);if(t<0)return{body:e,leading:[],trailing:[]};let n=e.length-1;for(;n>t&&e[n]?.kind===`context`;)--n;return{body:e.slice(t,n+1),leading:e.slice(0,t),trailing:e.slice(n+1)}}function W(e,t,n){let r=e.filter(e=>e.kind!==`context`&&e.kind!==`skipped`);return(t===`first`?r:[...r].reverse()).find(e=>e[n]?.line)?.[n]?.line}function ot(e,t){let n=e[t]?.rows??[],r=e[t-1]?.rows??[],i=[`left`,`right`].flatMap(e=>{let t=W(n,`first`,e);if(!t)return[];let i=W(r,`last`,e);return[Math.max(0,t-(i??0)-1)]});return i.length?Math.min(...i):0}function G(e,t){let n=e[t];if(!n)return 0;let r=e[t-1],i=r?r.oldStart+r.oldLines-1:0,a=r?r.newStart+r.newLines-1:0;return Math.max(0,Math.min(n.oldStart-i-1,n.newStart-a-1))}function K(e){let t=e.diff.hunks[e.diff.hunks.length-1],n=e.diff.leftMeta?.lines,r=e.diff.rightMeta?.lines;if(!t||!Number.isInteger(n)||!Number.isInteger(r))return 0;let i=t.oldStart+t.oldLines-1,a=t.newStart+t.newLines-1;return Math.max(0,Math.min((n??0)-i,(r??0)-a))}function st(e,t,n,r){let i=n[r-1],a=n[r];return`${e}:${t}:${i?`${i.oldStart+i.oldLines-1}:${i.newStart+i.newLines-1}`:`0:0`}>${a?`${a.oldStart}:${a.newStart}`:`0:0`}`}function q(e,t){let n=t.diff.hunks[t.diff.hunks.length-1],r=n?`${n.oldStart+n.oldLines-1}:${n.newStart+n.newLines-1}`:`0:0`;return`${e}:${t.path}:${r}>eof:${t.diff.leftMeta?.lines??0}:${t.diff.rightMeta?.lines??0}`}function ct(){return{aboveRows:[],belowRows:[]}}function lt(e,t,n,r,i){let a=n.diff.hunks[r],o=n.diff.hunks[r-1],s=U(a?.rows??[]),c=o?U(o.rows):null,l=[...a?.commonContext??[],...s.leading],u=!!a?.commonContext?.length,d=u?ot(n.diff.hunks,r):G(n.diff.hunks,r),f=st(e,n.path,n.diff.hunks,r),p=t[f]??ct(),m=c?.trailing.slice(0,r>0?Math.min(d,i):0)??[],h=Math.min(Math.max(0,d-m.length),i),g=h>0?l.slice(-h):[],_=Math.max(0,d-(u?m.length+g.length:0)-p.aboveRows.length-p.belowRows.length),v=u?W(o?.rows??[],`last`,`left`)??0:o?o.oldStart+o.oldLines-1:0,y=u?W(o?.rows??[],`last`,`right`)??0:o?o.newStart+o.newLines-1:0,b=v+(u?m.length:0)+p.aboveRows.length+1,x=y+(u?m.length:0)+p.aboveRows.length+1;return{availableRows:[...c?.trailing??[],...a?.commonContext??[],...s.leading].filter(e=>{let t=e.left?.line,n=e.right?.line;return t!==void 0&&n!==void 0&&t>=b&&t<b+_&&n>=x&&n<x+_}),baseAboveRows:m,baseBelowRows:g,expansion:p,header:a?.header??``,hiddenLines:_,key:f,location:r===0?`top`:`middle`,newHiddenStart:x,oldHiddenStart:b}}function ut(e,t,n,r){let i=n.diff.hunks[n.diff.hunks.length-1];if(!i)return null;let a=K(n),o=q(e,n),s=t[o]??ct(),c=U(i.rows).trailing,l=c.slice(0,Math.min(a,r)),u=Math.max(0,a-s.aboveRows.length),d=i.oldStart+i.oldLines-1,f=i.newStart+i.newLines-1,p=d+s.aboveRows.length+1,m=f+s.aboveRows.length+1;return{availableRows:c.filter(e=>{let t=e.left?.line,n=e.right?.line;return t!==void 0&&n!==void 0&&t>=p&&n>=m}),baseAboveRows:l,baseBelowRows:[],expansion:s,header:``,hiddenLines:u,key:o,location:`bottom`,newHiddenStart:m,oldHiddenStart:p}}function J({gap:e,onExpand:t}){let n=e.hiddenLines>10,r=!!e.expansion.pending;return(0,F.jsxs)(`div`,{className:`review-diff-hunk interactive`,role:`group`,"aria-label":`${e.hiddenLines} hidden common lines`,children:[(0,F.jsx)(`span`,{children:e.header}),(0,F.jsxs)(`span`,{className:`review-context-controls`,children:[n&&e.location!==`top`?(0,F.jsx)(`button`,{type:`button`,disabled:r,"aria-label":`Show 10 lines above`,onClick:()=>t(`above`),children:`+10↑`}):null,n&&e.location!==`top`?(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`−`}):null,(0,F.jsxs)(`button`,{type:`button`,disabled:r,"aria-label":`Show all ${e.hiddenLines} common lines`,onClick:()=>t(`all`),children:[`+`,e.hiddenLines,` common `,e.hiddenLines===1?`line`:`lines`]}),n&&e.location!==`bottom`?(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`−`}):null,n&&e.location!==`bottom`?(0,F.jsx)(`button`,{type:`button`,disabled:r,"aria-label":`Show 10 lines below`,onClick:()=>t(`below`),children:`+10↓`}):null]}),e.expansion.error?(0,F.jsx)(`span`,{className:`review-context-error`,role:`alert`,children:e.expansion.error}):null]})}function dt({contextKeyPrefix:e,contextGapExpansions:t,file:n,mode:r,preferences:i,renderAttachment:a,onExpandContext:o,onExpandSkippedContext:s}){let c=nt(n.path),l=n.diff.hunks.reduce((e,t)=>{for(let n of[...t.commonContext??[],...t.rows])n.left?.missingNewlineAtEnd&&(e.left=!0),n.right?.missingNewlineAtEnd&&(e.right=!0);return e},{left:!1,right:!1}),u=(t,r,a)=>{let o=Math.max(t.leftLines??0,t.rightLines??0),c=st(e,n.path,n.diff.hunks,a),l=i.context,u=Math.min(10,o);return(0,F.jsxs)(`button`,{type:`button`,className:`review-skipped-row`,onClick:()=>s(c,a,Math.min(1e4,l+u)),children:[`Show `,u,` more common lines (`,o,` hidden)`]},r)},d=(e,t,n)=>(0,F.jsx)(F.Fragment,{children:(i.ignoreWhitespace===`NONE`?e:e.filter(e=>!e.whitespaceOnly)).map((e,o)=>{let s=`${n}:${t}:${e.left?.line??``}:${e.right?.line??``}:${o}`;if(r===`unified`){if(e.kind===`skipped`)return u(e,s,t);if(e.kind===`context`){let t=e.right??e.left;return(0,F.jsx)(H,{intraline:t?.intraline,kind:`context`,language:c,line:t?.line,side:S(`context`,!!e.right),text:t?.text??``,preferences:i,renderAttachment:a},s)}return e.kind===`changed`?(0,F.jsxs)(E.Fragment,{children:[(0,F.jsx)(H,{intraline:e.left?.intraline,kind:`deleted`,language:c,line:e.left?.line,side:S(`deleted`,!1),text:e.left?.text??``,preferences:i,renderAttachment:a}),(0,F.jsx)(H,{intraline:e.right?.intraline,kind:`added`,language:c,line:e.right?.line,side:S(`added`,!0),text:e.right?.text??``,preferences:i,renderAttachment:a})]},s):e.left?(0,F.jsx)(H,{intraline:e.left.intraline,kind:`deleted`,language:c,line:e.left.line,side:S(`deleted`,!1),text:e.left.text,preferences:i,renderAttachment:a},s):(0,F.jsx)(H,{intraline:e.right?.intraline,kind:`added`,language:c,line:e.right?.line,side:S(`added`,!!e.right),text:e.right?.text??``,preferences:i,renderAttachment:a},s)}return e.kind===`skipped`?u(e,s,t):(0,F.jsx)(at,{kind:e.kind,language:c,leftIntraline:e.left?.intraline,leftLine:e.left?.line,leftText:e.left?.text,rightIntraline:e.right?.intraline,rightLine:e.right?.line,rightText:e.right?.text,preferences:i,renderAttachment:a},s)})}),f=n.diff.hunks.map((r,a)=>lt(e,t,n,a,i.context)),p=ut(e,t,n,i.context),m=[...f,...p?[p]:[]].filter(e=>e.hiddenLines>0&&e.hiddenLines<=3&&!e.expansion.pending&&!e.expansion.error),h=m.map(e=>`${e.key}:${e.hiddenLines}:${e.oldHiddenStart}:${e.newHiddenStart}`).join(`|`),g=(0,E.useRef)(o);g.current=o,(0,E.useEffect)(()=>{for(let e of m)g.current(e,`all`,{lines:e.hiddenLines,newStart:e.newHiddenStart,oldStart:e.oldHiddenStart})},[h]);let _=(e,t)=>{let n=t===`all`?e.hiddenLines:Math.min(10,e.hiddenLines),r=t===`below`?e.hiddenLines-n:0;o(e,t,{lines:n,newStart:e.newHiddenStart+r,oldStart:e.oldHiddenStart+r})},v=(e,t)=>{let n=e.expansion.aboveRows.length>0||e.expansion.belowRows.length>0,r=e.hiddenLines>3||!!e.expansion.error;return(0,F.jsxs)(F.Fragment,{children:[d(e.baseAboveRows,t,`context`),d(e.expansion.aboveRows,t,`context`),r?(0,F.jsx)(J,{gap:e,onExpand:t=>_(e,t)}):null,!r&&e.hiddenLines>0?(0,F.jsxs)(`div`,{className:`review-diff-hunk interactive loading`,role:`status`,children:[(0,F.jsx)(`span`,{children:e.header}),(0,F.jsxs)(`span`,{children:[`Loading `,e.hiddenLines,` common `,e.hiddenLines===1?`line`:`lines`,`…`]})]}):null,!r&&e.hiddenLines===0&&!n&&e.location!==`bottom`?(0,F.jsx)(`div`,{className:`review-diff-hunk ${t>0?`secondary`:``}`,children:(0,F.jsx)(`span`,{children:e.header})}):null,d(e.expansion.belowRows,t,`context`),d(e.baseBelowRows,t,`context`)]})};return(0,F.jsxs)(F.Fragment,{children:[n.diff.hunks.map((e,t)=>(0,F.jsxs)(E.Fragment,{children:[v(f[t],t),d(U(e.rows).body,t,`change`)]},`${e.header}:${t}`)),p?v(p,n.diff.hunks.length):null,l.left||l.right?(0,F.jsx)(`div`,{className:`review-newline-warning`,role:`note`,children:[l.left?`No newline at end of left file.`:``,l.right?`No newline at end of right file.`:``].filter(Boolean).join(` — `)}):null]})}function ft({row:e}){return e.diffLoadError?(0,F.jsxs)(`div`,{className:`review-diff-message error`,role:`alert`,children:[`Could not load diff: `,e.diffLoadError]}):e.diffLoadPending?(0,F.jsx)(`div`,{className:`review-diff-message`,role:`status`,children:`Loading diff…`}):e.diffStatus===`binary`?(0,F.jsx)(`div`,{className:`review-diff-message`,children:`Binary file changed`}):e.diffStatus===`too-expensive`?(0,F.jsx)(`div`,{className:`review-diff-message`,children:`Diff too large to render`}):e.diffStatus===`not-loaded`?(0,F.jsx)(`div`,{className:`review-diff-message`,children:`Diff not loaded yet`}):null}function pt({disabled:e,draft:t,target:n,onCancel:r,onDraftChange:i,onSave:a}){let o=n.side===`right`?`Patchset`:n.side===`left`?`Base`:`file`;return(0,F.jsxs)(`form`,{className:`review-comment-editor`,onSubmit:e=>{e.preventDefault(),a()},children:[(0,F.jsxs)(`header`,{children:[`Comment on `,n.range?n.range.start_line===n.range.end_line?`${o} line ${n.range.start_line}, columns ${n.range.start_character+1}–${n.range.end_character}`:`${o} lines ${n.range.start_line}–${n.range.end_line}`:`${o} line ${n.line}`]}),(0,F.jsx)(`textarea`,{"aria-label":`Review comment`,name:`farming-review-comment`,inputMode:`text`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,enterKeyHint:`done`,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-bwignore":`true`,"data-form-type":`other`,autoFocus:!0,placeholder:`Leave a review comment…`,value:t,onChange:e=>i(e.target.value)}),(0,F.jsxs)(`footer`,{children:[(0,F.jsx)(`button`,{type:`button`,onClick:r,children:`CANCEL`}),(0,F.jsx)(`button`,{type:`submit`,disabled:e||!t.trim(),children:e?`SAVING…`:`SAVE COMMENT`})]})]})}function mt({comment:e,disabled:t,onDelete:n,onStatusChange:r}){let a=e.side===`right`?`Patchset`:e.side===`left`?`Base`:`File`,o=e.status||`open`,s=e.range?e.range.start_line===e.range.end_line?`${a} line ${e.range.start_line}, columns ${e.range.start_character+1}–${e.range.end_character}`:`${a} lines ${e.range.start_line}–${e.range.end_line}`:`${a} line ${e.line}`;return(0,F.jsxs)(`article`,{className:`review-comment-thread ${o}`,children:[(0,F.jsxs)(`header`,{children:[(0,F.jsx)(`span`,{children:o===`outdated`?`Outdated · ${s}`:s}),(0,F.jsxs)(`span`,{className:`review-comment-actions`,children:[(0,F.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>r(o===`resolved`?`open`:`resolved`),children:o===`resolved`?`REOPEN`:`RESOLVE`}),(0,F.jsx)(`button`,{type:`button`,"aria-label":`Delete comment on line ${e.line}`,disabled:t,onClick:n,children:(0,F.jsx)(i,{})})]})]}),(0,F.jsx)(`p`,{children:e.body})]})}function ht(e,t){let n=(e instanceof Element?e:e?.parentElement)?.closest(`code[data-review-line][data-review-side]`)??null;return n&&t.contains(n)?n:null}function gt(e,t,n){let r=document.createRange();r.selectNodeContents(e);try{r.setEnd(t,n)}catch{return 0}return r.toString().length}function _t(e){let t=window.getSelection();if(!t||t.isCollapsed||!t.anchorNode||!t.focusNode)return null;let n=ht(t.anchorNode,e),r=ht(t.focusNode,e);if(!n||!r)return null;let i=n.dataset.reviewSide;if(i!==r.dataset.reviewSide||i!==`left`&&i!==`right`&&i!==`unified`)return null;let a=Number(n.dataset.reviewLine),o=Number(r.dataset.reviewLine);if(!Number.isInteger(a)||!Number.isInteger(o))return null;let s={character:gt(n,t.anchorNode,t.anchorOffset),line:a},c={character:gt(r,t.focusNode,t.focusOffset),line:o},l=s.line<c.line||s.line===c.line&&s.character<=c.character,u=l?s:c,d=l?c:s;return u.line===d.line&&u.character===d.character?null:{line:d.line,range:{end_character:d.character,end_line:d.line,start_character:u.character,start_line:u.line},side:i}}function Y(){let e=typeof window<`u`&&new URLSearchParams(window.location.search).get(`fixture`)===`1`,[t]=(0,E.useState)(()=>{let e=typeof window>`u`?``:window.location.search;return{requested:new URLSearchParams(e).has(`acpItem`),route:Fe(e)}}),n=t.route,[i]=(0,E.useState)(()=>ze(typeof window>`u`?null:window.location)),d=!e&&!t.requested&&i.request&&(i.request.source===`working-copy`||i.request.head===`now`)?i.request:null,[f,p]=(0,E.useState)(()=>d||t.requested?null:i.request),[m,h]=(0,E.useState)(null),[g,_]=(0,E.useState)(`final`),[v,y]=(0,E.useState)(!!(d||n)),b=t.requested?!n:!!i.error,x=!e,S=f?.source===`working-copy`,ne=f?.source===`git-range`,[ie,C]=(0,E.useState)(()=>b?{[L]:[]}:Ye(f,e)),[w,T]=(0,E.useState)(t.requested?n?``:`ACP review target is invalid`:i.error??``),[_e,De]=(0,E.useState)(null),[D,Ae]=(0,E.useState)(()=>{let t=b?{[L]:[]}:Ye(f,e);return Xe({basePatchset:b?`Base`:Je(f,e),catalog:t,comments:[],initialPatchset:b?L:qe(f,e),initiallyExpand:!x,reviewId:x?void 0:we})}),O=(0,E.useRef)(D),k=(0,E.useRef)(ie);k.current=ie;let[A,j]=(0,E.useState)(We),[Ne,M]=(0,E.useState)(!1),[Ie,Le]=(0,E.useState)(!1),[N,Re]=(0,E.useState)(``),[P,I]=(0,E.useState)(``),[Ve,He]=(0,E.useState)(``),[Ue,R]=(0,E.useState)([]),[Ze,z]=(0,E.useState)({}),[B,Qe]=(0,E.useState)(null),[nt,rt]=(0,E.useState)(``),[V,it]=(0,E.useState)(!1),[H,at]=(0,E.useState)(()=>new URLSearchParams(window.location.search).get(`comparison`)||``),[U,W]=(0,E.useState)(!1),ot=(0,E.useRef)(null),G=x?D.reviewId??``:we,K=D.patchRange.patchset,st=D.patchRange.basePatchset,q=oe(D,K),lt=new Set(q.expandedPaths),ut=D.diffMode,J=!!(m&&f?.source===`git-range`&&f.reviewId===m.reviewId&&f.head===m.head),ht=J?m?.scope:f?.source===`working-copy`?f.scope:void 0,gt=ht===`untracked`?`unified`:ut,Y=D.preferences,vt=f?{...f,context:Y.context,ignoreWhitespace:Y.ignoreWhitespace}:null,yt=(0,E.useRef)(vt);yt.current=vt;let X=J?{..._e??{workingTree:!0},head:void 0,workingTree:!0}:_e,Z=D.commentDraft,bt=D.commentDraft?.body??``,Q=ie[K]??[],xt=Q.reduce((e,t)=>e+t.added,0),St=Q.reduce((e,t)=>e+t.removed,0),Ct=Math.max(1,...Q.map(e=>e.added+e.removed)),$=e=>{let t=re(O.current,e,k.current);if(t.state!==O.current){O.current=t.state,Ae(t.state);for(let e of t.effects){if(e.type===`load-file-diff`){let t=yt.current;if(!t){$(Me(e,`review file diff source is unavailable`));continue}fe(t,e.path).then(t=>{let n=je(k.current,e,t,{reviewId:O.current.reviewId});k.current=n.catalog,C(n.catalog),$(n.action)}).catch(t=>$(Me(e,t)))}if(e.type===`save-reviewed-status`){let t=e.reviewId??G;le({...e,reviewId:t}).then(t=>$({patchset:e.patchset,paths:e.changes.map(e=>e.path),reviewedPaths:t.reviewedPaths,...e.reviewId?{reviewId:e.reviewId}:{},revision:t.revision,type:`commit-reviewed-status`})).catch(async n=>{let r=n instanceof be&&n.state?n.state:await xe(t,e.patchset).catch(()=>null);if(!r){let t=oe(O.current,e.patchset),n=new Set(t.reviewedPaths);for(let t of e.changes)t.reviewed?n.delete(t.path):n.add(t.path);r={reviewedPaths:[...n],revision:e.revision}}$({patchset:e.patchset,reviewedPaths:r.reviewedPaths,...e.reviewId?{reviewId:e.reviewId}:{},revision:r.revision,type:`restore-reviewed-status`}),Re(n instanceof Error?`Could not save Reviewed: ${n.message}`:`Could not save Reviewed status`)})}if(e.type===`save-comment`){let t=e.reviewId??G;me(t,e.comment).then(()=>$({id:e.comment.id,patchset:e.comment.patchset,pendingType:`save`,...e.reviewId?{reviewId:e.reviewId}:{},type:`commit-comment`})).catch(async n=>{$({comments:await Ce(t,e.comment.patchset).catch(()=>O.current.comments.filter(t=>t.id!==e.comment.id)),id:e.comment.id,patchset:e.comment.patchset,pendingType:`save`,...e.reviewId?{reviewId:e.reviewId}:{},type:`restore-comments`}),I(n instanceof Error?`Could not save comment: ${n.message}`:`Could not save comment`)})}if(e.type===`delete-comment`){let t=e.reviewId??G;ue(t,e.comment.patchset,e.comment.id).then(()=>$({id:e.comment.id,patchset:e.comment.patchset,pendingType:`delete`,...e.reviewId?{reviewId:e.reviewId}:{},type:`commit-comment`})).catch(async n=>{$({comments:await Ce(t,e.comment.patchset).catch(()=>[...O.current.comments,e.comment]),id:e.comment.id,patchset:e.comment.patchset,pendingType:`delete`,...e.reviewId?{reviewId:e.reviewId}:{},type:`restore-comments`}),I(n instanceof Error?`Could not delete comment: ${n.message}`:`Could not delete comment`)})}}}};(0,E.useEffect)(()=>(document.body.classList.add(`review-body`),()=>document.body.classList.remove(`review-body`)),[]),(0,E.useEffect)(()=>{if(!U)return;let e=e=>{ot.current?.contains(e.target)||W(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[U]),(0,E.useEffect)(()=>{if(!d&&!n)return;let e=!0;return y(!0),(n?Se(n.agentId,n.itemIds):(()=>{let e=d;return ge(`root`in e&&typeof e.root==`string`?{root:e.root}:{agentId:e.agentId},e.source===`git-range`?e.base:`HEAD`,e.source===`working-copy`?{modifiedWithinDays:e.modifiedWithinDays,paths:e.paths,scope:e.scope}:void 0)})()).then(t=>{if(!e)return;let n=he(t,`final`),r=new URLSearchParams(window.location.search);r.delete(`agentId`),r.delete(`acpItem`),r.set(`root`,t.root),r.set(`base`,n.base),r.set(`head`,n.head),r.set(`reviewId`,t.reviewId),r.set(`comparison`,`last-turn`),window.history.replaceState(null,``,`${window.location.pathname}?${r.toString()}`),h(t),_(`final`),at(`last-turn`),p(n),T(``)}).catch(t=>{e&&T(t instanceof Error?t.message:`review capture failed`)}).finally(()=>{e&&y(!1)}),()=>{e=!1}},[n,d]),(0,E.useEffect)(()=>{if(d||n||f?.source!==`git-range`||!f.reviewId)return;let e=!0;return pe(f.reviewId).then(t=>{if(!e)return;let n=t.revisions.find(e=>e.head===f.head)??t;h(n),at(e=>e||`last-turn`),_(f.base===n.fixesBase&&n.fixesBase!==n.base?`fixes`:`final`)}).catch(()=>{}),()=>{e=!1}},[n,d,f]),(0,E.useEffect)(()=>{if(!f)return;let e=!0,t=Ke();return ve({...f,context:t.context,ignoreWhitespace:t.ignoreWhitespace,metadataOnly:!0}).then(async n=>{let[r,i]=await Promise.all([xe(n.reviewId,n.patchset).catch(()=>null),Ce(n.reviewId,n.patchset).catch(()=>[])]);if(!e)return;let a=ee(Oe(n),n.patchset,i.map(e=>e.path)),o=ke({comments:i,preferences:t,...r?{reviewedPaths:r.reviewedPaths}:{},snapshot:n});r&&(o=re(o,{patchset:n.patchset,reviewedPaths:r.reviewedPaths,reviewId:n.reviewId,revision:r.revision,type:`hydrate-reviewed-status`},a).state),O.current=o,k.current=a,De(n.comparison??null),C(a),Ae(o),T(``)}).catch(t=>{e&&T(t instanceof Error?t.message:`review diff request failed`)}),()=>{e=!1}},[f]),(0,E.useEffect)(()=>{if(!N)return;let e=window.setTimeout(()=>Re(``),4e3);return()=>window.clearTimeout(e)},[N]),(0,E.useEffect)(()=>{if(!P)return;let e=window.setTimeout(()=>I(``),4e3);return()=>window.clearTimeout(e)},[P]),(0,E.useEffect)(()=>{try{window.localStorage.setItem(Ge,JSON.stringify(Y))}catch{}},[D.preferences]),(0,E.useEffect)(()=>{if(x||!G||!k.current[K])return;let e=!0;return xe(G,K).then(t=>{e&&$({patchset:K,reviewedPaths:t.reviewedPaths,reviewId:G,revision:t.revision,type:`hydrate-reviewed-status`})}).catch(()=>{}),Ce(G,K).then(t=>{if(!e)return;let n=ee(k.current,K,t.map(e=>e.path));n!==k.current&&(k.current=n,C(n)),$({comments:t,patchset:K,reviewId:G,type:`hydrate-comments`})}).catch(()=>{}),()=>{e=!1}},[x,K,G]),(0,E.useEffect)(()=>{let e=()=>{let e=``;for(let t of document.querySelectorAll(`.review-file-change.expanded[data-file-path]`)){let n=t.querySelector(`.review-file-change-header`);if(!n)continue;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();i.top<=1&&r.bottom>i.bottom&&(e=t.dataset.filePath??``)}He(t=>t===e?t:e)};return e(),window.addEventListener(`scroll`,e,{passive:!0}),document.body.addEventListener(`scroll`,e,{passive:!0}),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e),document.body.removeEventListener(`scroll`,e),window.removeEventListener(`resize`,e)}},[K,q.expandedPaths.join(`\0`)]);let wt=!!q.pendingReview,Tt=!!q.pendingComment,Et=(e,t)=>{$({path:e,reviewed:t,type:`set-file-reviewed`})},Dt=e=>{$({patchset:e,type:`select-patchset`})},Ot=Q.length>0&&Q.every(e=>lt.has(e.path)),kt=e=>{$({path:e,type:`toggle-file-expanded`})},At=()=>{j(Y),M(!0)},jt=()=>{let e=Y,t=te(A),n=e.context!==t.context||e.ignoreWhitespace!==t.ignoreWhitespace;if($({preferences:t,type:`set-preferences`}),M(!1),n&&z({}),!x||!f||!n)return;let r=K,i=new Map(Q.map(e=>[e.path,e])),a=q.expandedPaths.filter(e=>{let t=i.get(e);return!!(t&&t.kind!==`unmodified`&&!t.binary&&!t.diffTooExpensive)});a.length&&(R(e=>[...new Set([...e,...a])]),Be({...f,context:t.context,ignoreWhitespace:t.ignoreWhitespace},a).then(e=>{if(O.current.patchRange.patchset!==r)return;let t=k.current;for(let n of e.files)t=se(t,r,n);k.current=t,C(t);let n=e.errors[0];n&&T(n.message)}).finally(()=>R(e=>e.filter(e=>!a.includes(e)))))},Mt=()=>{navigator.clipboard&&navigator.clipboard.writeText(`34a15ae`).catch(()=>{}),Le(!0),window.setTimeout(()=>Le(!1),1200)},Nt=(e,t)=>{let n=yt.current;if(!n||Ue.includes(e))return;let r=K;R(t=>[...t,e]),fe({...n,context:t},e).then(e=>{let t=se(k.current,r,e);k.current=t,C(t)}).catch(e=>T(e instanceof Error?e.message:`review context request failed`)).finally(()=>R(t=>t.filter(t=>t!==e)))},Pt=(e,t,n,r)=>{let i=yt.current;if(t.expansion.pending||r.lines<1)return;let a=e=>{z(r=>{let i=r[t.key]??ct();return{...r,[t.key]:n===`below`?{...i,belowRows:[...e,...i.belowRows],error:void 0,pending:void 0}:{...i,aboveRows:[...i.aboveRows,...e],error:void 0,pending:void 0}}})},o=e=>{let n=e instanceof Error?e.message:`review context request failed`;z(e=>{let r=e[t.key]??ct();return{...e,[t.key]:{...r,error:n,pending:void 0}}})};if(z(e=>{let r=e[t.key]??ct();return{...e,[t.key]:{...r,error:void 0,pending:n}}}),!i){let e=t.availableRows.filter(e=>{let t=e.left?.line,n=e.right?.line;return t!==void 0&&n!==void 0&&t>=r.oldStart&&t<r.oldStart+r.lines&&n>=r.newStart&&n<r.newStart+r.lines});e.length===r.lines?a(e):o(Error(`review context is unavailable`));return}Te(i,e.path,r).then(e=>a(e.rows)).catch(o)},Ft=(e,t,n,r)=>{$({line:t,path:e,range:r,side:n,type:`start-comment`})},It=()=>{!Z||!bt.trim()||$({id:typeof crypto?.randomUUID==`function`?crypto.randomUUID():`comment-${Date.now()}-${Math.random().toString(36).slice(2)}`,type:`save-comment`})},Lt=(e,t)=>{G&&Ee(G,e.patchset,e.id,t).then(()=>Ce(G,e.patchset)).then(t=>$({comments:t,patchset:e.patchset,reviewId:G,type:`hydrate-comments`})).catch(e=>I(e instanceof Error?e.message:`review comment status failed`))},Rt=(e,t)=>{let n=he(e,t),r=new URLSearchParams(window.location.search);r.delete(`agentId`),r.set(`root`,e.root),r.set(`base`,n.base),r.set(`head`,n.head),r.set(`reviewId`,e.reviewId),r.set(`comparison`,`last-turn`),window.history.replaceState(null,``,`${window.location.pathname}?${r.toString()}`),h(e),_(t),at(`last-turn`),W(!1),p(n)},zt=f&&`root`in f&&f.root?{root:f.root}:f&&`agentId`in f&&f.agentId?{agentId:f.agentId}:m?{root:m.root}:null,Bt=()=>{let e=!U;W(e),!(!e||B||V||!zt)&&(it(!0),rt(``),de(zt).then(Qe).catch(e=>rt(e instanceof Error?e.message:`Comparison sources could not be loaded`)).finally(()=>it(!1)))},Vt=e=>{if(!B)return;let t={base:e.base,head:e.head,metadataOnly:!0,root:B.root,source:`git-range`},n=new URLSearchParams(window.location.search);n.delete(`agentId`),n.delete(`reviewId`),n.delete(`path`),n.delete(`scope`),n.delete(`modifiedWithinDays`),n.set(`root`,B.root),n.set(`base`,e.base),n.set(`head`,e.head),n.set(`comparison`,e.id),window.history.replaceState(null,``,`${window.location.pathname}?${n.toString()}`),at(e.id),W(!1),_(`final`),p(t)},Ht=()=>{!m||v||(y(!0),ye(m.reviewId).then(e=>{Rt(e,e.number>1?`fixes`:`final`),T(``)}).catch(e=>T(e instanceof Error?e.message:`review refresh failed`)).finally(()=>y(!1)))},Ut=e=>{!m||e===g||Rt(m,e)},Wt=ht,Gt=Wt===`tracked`?`Changes`:Wt===`untracked`?`Untracked`:`Files`,Kt=B?[B.unstaged,B.staged,...B.commits,...B.branches].find(e=>e.id===H):null,qt=J?`Last Turn`:Kt?.id.startsWith(`commit:`)?`Commit · ${Kt.label}`:Kt?.id.startsWith(`branch:`)?`Branch · ${Kt.label}`:Kt?.label??(S?`Working copy`:ne?`Changes`:Gt),Jt=H===`staged`?`Staged changes`:X?.workingTree?`Workspace changes`:X?.head?.message.split(`
1
+ import{r as e}from"./chunk-DECur_0Z.js";import{i as t,t as n}from"./jsx-runtime-BthL93pI.js";import{C as r,d as i,h as a,l as o,m as s,o as c,p as l,s as u}from"./IconGlyphs-Cc14sepw.js";import{a as d,c as f,d as p,i as m,l as h,n as g,o as _,r as v,s as y,t as b,u as x}from"./core-D0LFJkDt.js";import{A as S,C as ee,D as te,E as ne,F as re,M as ie,N as C,O as ae,P as oe,S as se,T as ce,_ as le,a as ue,b as w,c as de,d as fe,f as pe,g as me,h as he,i as ge,j as T,k as _e,l as ve,m as ye,n as be,p as xe,r as Se,s as Ce,t as we,u as Te,v as Ee,w as De,x as Oe,y as ke}from"./api-D8nyOEbz.js";var E=e(t());function D(e){let t=[`package`,`import`,`option`,`optional`,`required`,`repeated`,`group`,`oneof`],n=[`double`,`float`,`int32`,`int64`,`uint32`,`uint64`,`sint32`,`sint64`,`fixed32`,`fixed64`,`sfixed32`,`sfixed64`,`bool`,`string`,`bytes`],r={match:[/(message|enum|service)\s+/,e.IDENT_RE],scope:{1:`keyword`,2:`title.class`}};return{name:`Protocol Buffers`,aliases:[`proto`],keywords:{keyword:t,type:n,literal:[`true`,`false`]},contains:[e.QUOTE_STRING_MODE,e.NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,r,{className:`function`,beginKeywords:`rpc`,end:/[{;]/,excludeEnd:!0,keywords:`rpc returns`},{begin:/^\s*[A-Z_]+(?=\s*=[^\n]+;$)/}]}}function Ae(e){return e instanceof Error&&e.message.trim()?e.message.trim():typeof e==`string`&&e.trim()?e.trim():`review file diff request failed`}function O(e){return e.diffLoaded===!1&&!ie(e)}function je(e,t,n,r={}){if(t.reviewId!==void 0&&r.reviewId!==t.reviewId)throw Error(`loaded review file belongs to a stale review`);if(n.path!==t.path)throw Error(`loaded review file path does not match requested path`);if(O(n))throw Error(`loaded review file is still a metadata-only row`);if(!e[t.patchset]?.some(e=>e.path===t.path))throw Error(`loaded review file path is no longer in the review catalog`);return{action:{patchset:t.patchset,path:t.path,...t.reviewId?{reviewId:t.reviewId}:{},type:`commit-file-diff-load`},catalog:se(e,t.patchset,{...n,diffLoaded:!0})}}function Me(e,t){return{error:Ae(t),patchset:e.patchset,path:e.path,...e.reviewId?{reviewId:e.reviewId}:{},type:`fail-file-diff-load`}}function k(e){return e===`added`?`A`:e===`copied`?`C`:e===`deleted`?`D`:e===`renamed`?`R`:e===`rewritten`?`W`:e===`unmodified`?`U`:e===`reverted`?`X`:`M`}function A(e){return e.status?e.status:k(e.kind)}function j(e){return _e(e)}function Ne(e){return e.binary?`binary`:ie(e)?`too-expensive`:e.diffLoaded===!1?`not-loaded`:`loaded`}function Pe(e,t,n={}){let r=n.patchset??e.patchRange.patchset,i=C(e,t.path,r),a=oe(e,r),o=i.loaded?i.status===`reviewed`:null;return{action:o===null?null:{ariaLabel:o?`Mark as unreviewed`:`Mark as reviewed`,disabled:!!n.mutationPending,label:o?`MARK UNREVIEWED`:`MARK REVIEWED`,nextReviewed:!o,visibility:`on-row-interaction`},added:t.added,binary:t.binary===!0,changeLabel:A(t),commentPaths:j(t),deleted:t.removed,...T(e,t.path,r)?{diffLoadError:T(e,t.path,r)}:{},diffLoadPending:a.pendingDiffPaths.includes(t.path),diffStatus:Ne(t),diffTooExpensive:t.diffTooExpensive===!0||t.diff.truncated===!0,expanded:a.expandedPaths.includes(t.path),...t.newMode?{newMode:t.newMode}:{},...t.newSha?{newSha:t.newSha}:{},...t.oldMode?{oldMode:t.oldMode}:{},...t.oldSha?{oldSha:t.oldSha}:{},path:t.path,pending:i.pending,...t.previousPath?{previousPath:t.previousPath}:{},reviewed:o,reviewedLabel:o===!0?`Reviewed`:null,reviewStatusLoaded:i.loaded,...Number.isInteger(t.size)?{size:t.size}:{},...Number.isInteger(t.sizeDelta)?{sizeDelta:t.sizeDelta}:{}}}function Fe(e){let t=typeof e==`string`?new URLSearchParams(e):e,n=t.get(`agentId`)?.trim()||``,r=[...new Set(t.getAll(`acpItem`).map(e=>e.trim()).filter(Boolean))];return!n||r.length===0||r.length>256?null:{agentId:n,itemIds:r}}function M(e,t,n){let r=e.get(t);if(r===null||r.trim()===``||!/^\d+$/.test(r.trim()))return;let i=Number(r.trim());return Number.isSafeInteger(i)&&i>=n?i:void 0}function Ie(e){let t=e.get(`ignoreWhitespace`);if(t===`ALL`||t===`IGNORE_ALL`)return`ALL`;if(t===`TRAILING`||t===`IGNORE_TRAILING`)return`TRAILING`;if(t===`LEADING_AND_TRAILING`||t===`IGNORE_LEADING_AND_TRAILING`)return`LEADING_AND_TRAILING`}function Le(e){let t=e.get(`metadataOnly`);return t===`1`||t===`true`?!0:void 0}function N(e){let t=e.get(`scope`);return t===`tracked`||t===`untracked`?t:void 0}function Re(e){let t=M(e,`context`,0),n=Ie(e),r=M(e,`limit`,1),i=Le(e),a=M(e,`modifiedWithinDays`,1),o=N(e),s=e.getAll(`path`).map(e=>e.trim()).filter(Boolean);return{...t===void 0?{}:{context:t},...n?{ignoreWhitespace:n}:{},...r===void 0?{}:{limit:r},...i===!0?{metadataOnly:i}:{},...o?{scope:o}:{},...s.length>0?{paths:s}:{},...o===`untracked`&&a!==void 0?{modifiedWithinDays:a}:{}}}function P(e){let t=typeof e==`string`?new URLSearchParams(e):e,n=t.get(`agentId`)?.trim()||``,r=t.get(`root`)?.trim()||``;if(n&&r)return{error:`only one review workspace target is allowed`,request:null};if(!n&&!r)return{request:null};let i=n?{agentId:n}:{root:r},a=Re(t),o=t.get(`reviewId`)?.trim()||``,s=t.get(`base`),c=t.get(`head`);if(!(s!==null||c!==null))return{request:{...i,...a,source:`working-copy`}};let l=w(s||``),u=w(c||``);return!l||!u?{error:`base and head revisions are invalid`,request:null}:{request:{...i,base:l,head:u,...a,...o?{reviewId:o}:{},source:`git-range`}}}function ze(e){return P(e?.search??``)}var F=n();async function Be(e,t){let n=[],r=[],i=0;return await Promise.all(Array.from({length:Math.min(4,t.length)},async()=>{for(;i<t.length;){let a=t[i++];if(a)try{n.push(await fe(e,a))}catch(e){r.push(e instanceof Error?e:Error(`review file diff request failed`))}}})),{errors:r,files:n}}function I(e){let t=nt(e.path),n=t===`python`,r=Ze(e.path).replace(/\W/g,`_`),i=(e,t)=>({kind:`context`,left:{line:e,text:t},right:{line:e,text:t}}),a=Array.from({length:128},(e,n)=>{let r=n+1,a=t===`python`?`#`:t===`markdown`?`<!--`:`//`,o=t===`markdown`?` -->`:``,s=r>=29?`unchanged review context ${r-28}`:`unchanged review prelude ${r}`;return i(r,`${r===29||r===128?` `:``}${a} ${s}${o}`)});if(e.kind===`added`){let t=n?`${r} = create_review_snapshot()`:`export const ${r} = createReviewSnapshot()`,i=n?`__all__ = ["${r}"]`:`export default ${r}`;return{hunks:[{header:`@@ -0,0 +1,2 @@ ${e.path}`,oldStart:0,oldLines:0,newStart:1,newLines:2,rows:[{kind:`added`,right:{line:1,text:t}},{kind:`added`,right:{line:2,text:i}}]}]}}if(e.kind===`deleted`){let t=n?`def summarize_changes():`:`export function summarizeChanges() {`,r=n?` return "legacy summary"`:` return 'legacy summary'`;return{hunks:[{header:`@@ -1,2 +0,0 @@ ${e.path}`,oldStart:1,oldLines:2,newStart:0,newLines:0,rows:[{kind:`deleted`,left:{line:1,text:t}},{kind:`deleted`,left:{line:2,text:r}}]}]}}let o=n?`def create_change_set(input: ChangeInput) -> list[ReviewEntry]:`:`export function createChangeSet(input: ChangeInput) {`,s=n?` return normalize_changes(input.files)`:` return normalizeChanges(input.files)`,c=n?` return create_review_entries(input.files, input.base)`:` return createReviewEntries(input.files, input.base)`,l=n?`def mark_reviewed(path: str) -> ReviewState:`:`export function markReviewed(path: string) {`,u=n?` return {"path": path, "reviewed_at": time.time()}`:` return { path, reviewedAt: Date.now() }`,d=n?`if not path:`:` if (!path) return null`,f=n?` return None`:` const snapshot = readSnapshot(input.base)`,p=n?`return {**snapshot, "files": input.files}`:` return { ...snapshot, files: input.files }`,m=n?``:`}`,h=n?` return finalize_change_set(input) `:` return finalizeChangeSet(input) `;return{hunks:[{commonContext:a,header:`@@ -129,7 +129,10 @@ ${e.path}`,oldStart:129,oldLines:7,newStart:129,newLines:10,rows:[i(129,o),{kind:`deleted`,left:{line:130,text:s}},{kind:`added`,right:{line:130,text:c}},i(131,m),{kind:`added`,right:{line:133,text:l}},{kind:`added`,right:{line:134,text:u}},i(135,d),i(136,f),{kind:`added`,right:{line:137,text:p}},i(138,m),{kind:`deleted`,left:{line:139,text:h},whitespaceOnly:!0},{kind:`added`,right:{line:139,text:h.trimEnd()},whitespaceOnly:!0}]}]}}function Ve(e){return{...e,diff:I(e)}}var He=Object.fromEntries(Object.entries({"Patchset 20":[{path:`clis/dataflow.py`,kind:`modified`,added:2,removed:85},{path:`clis/diagnose.py`,kind:`modified`,added:8,removed:11},{path:`clis/fetch_instance_log.py`,kind:`deleted`,added:0,removed:573},{path:`clis/fetch_logview.py`,kind:`modified`,added:2,removed:2},{path:`clis/fetch_meta_timeline.py`,kind:`modified`,added:0,removed:2},{path:`clis/fetch_quota_snapshot.py`,kind:`deleted`,added:0,removed:290},{path:`clis/hbo_plan_diagnose.py`,kind:`deleted`,added:0,removed:119},{path:`clis/parse_logview.py`,kind:`modified`,added:6,removed:2},{path:`clis/query_sls.py`,kind:`modified`,added:14,removed:2},{path:`devclis/README.md`,kind:`added`,added:15,removed:0},{path:`docs/cli/studio.md`,kind:`modified`,added:1,removed:2},{path:`tests/review/change-set.spec.ts`,kind:`renamed`,previousPath:`tests/changes/change-summary.spec.ts`,added:28,removed:6}],"Patchset 19":[{path:`clis/dataflow.py`,kind:`modified`,added:1,removed:52},{path:`clis/diagnose.py`,kind:`modified`,added:5,removed:6},{path:`clis/fetch_instance_log.py`,kind:`deleted`,added:0,removed:573},{path:`clis/fetch_logview.py`,kind:`modified`,added:1,removed:2},{path:`clis/fetch_meta_timeline.py`,kind:`modified`,added:0,removed:2},{path:`clis/hbo_plan_diagnose.py`,kind:`deleted`,added:0,removed:119},{path:`clis/parse_logview.py`,kind:`modified`,added:4,removed:2},{path:`clis/query_sls.py`,kind:`modified`,added:7,removed:1},{path:`docs/cli/studio.md`,kind:`modified`,added:1,removed:1}]}).map(([e,t])=>[e,t.map(Ve)])),Ue=`Working copy`,L=`Review`,R={"Patchset 20":[`clis/dataflow.py`,`clis/fetch_instance_log.py`],"Patchset 19":[`clis/fetch_instance_log.py`]},We=De,Ge=`farming.review.diff-preferences`;b.registerLanguage(`typescript`,m),b.registerLanguage(`python`,_),b.registerLanguage(`sql`,d),b.registerLanguage(`markdown`,y),b.registerLanguage(`cpp`,x),b.registerLanguage(`java`,h),b.registerLanguage(`protobuf`,D),b.registerLanguage(`json`,f),b.registerLanguage(`yaml`,g),b.registerLanguage(`bash`,p),b.registerLanguage(`xml`,v);function Ke(){if(typeof window>`u`)return We;try{return te(JSON.parse(window.localStorage.getItem(Ge)||`{}`))}catch{return We}}function qe(e,t=!0){return e?e.source===`git-range`?e.head:Ue:t?`Patchset 20`:L}function Je(e,t=!0){return e?e.source===`git-range`?e.base:`HEAD`:`Base`}function Ye(e,t=!0){return e?{[qe(e,t)]:[]}:t?He:{[L]:[]}}function Xe({catalog:e,comments:t,initialPatchset:n,basePatchset:r,initiallyExpand:i,reviewId:a}){let o=ne({catalog:e,comments:t,patchRange:{basePatchset:r,patchset:n},preferences:Ke(),reviewId:a,reviewedPathsByPatchset:n===`Patchset 20`||n===`Patchset 19`?R:{}});return i?{...o,patchsets:Object.fromEntries(Object.keys(e).map(t=>{let n=e[t]??[],r=n[1]?.path??n[0]?.path;return[t,{...oe(o,t),expandedPaths:r?[r]:[]}]}))}:o}function Ze(e){let t=e.split(`/`);return t[t.length-1]||e}function z(e){let t=Math.abs(e);return t<1024?`${e} B`:t<1024*1024?`${(e/1024).toFixed(1)} KiB`:`${(e/(1024*1024)).toFixed(1)} MiB`}function B(e){return e.replace(/[&<>"']/g,e=>({"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`})[e]??e)}function Qe(e,t,n){return Array.from(e).slice(t,n).join(``)}function $e({action:e,pending:t,reviewed:n,reviewedLabel:r,onToggle:i}){return(0,F.jsxs)(`div`,{className:`review-review-status ${n?`reviewed`:``} ${t?`pending`:``}`,children:[r?(0,F.jsx)(`span`,{className:`review-reviewed-label`,children:r}):null,e?(0,F.jsx)(`button`,{type:`button`,"aria-checked":n===!0,"aria-label":`Reviewed`,"data-action-visibility":e.visibility,disabled:e.disabled,role:`switch`,title:t?`Saving review status`:e.ariaLabel,onClick:i,children:t?`SAVING…`:e.label}):(0,F.jsx)(`span`,{className:`review-review-loading`,children:`Reviewed status loading`})]})}function et({file:e,maxChangeSize:t}){if(e.binary)return(0,F.jsx)(`span`,{className:`review-change-bar binary`,"aria-label":`Binary file`});let n=e=>e===0?0:Math.max(2,Math.round(e/t*72));return(0,F.jsxs)(`span`,{className:`review-change-bar`,"aria-label":`+${e.added} −${e.removed}`,children:[(0,F.jsx)(`i`,{className:`added`,style:{width:`${n(e.added)}px`}}),(0,F.jsx)(`i`,{className:`deleted`,style:{width:`${n(e.removed)}px`}})]})}function tt({file:e}){if(e.binary){let t=typeof e.sizeDelta==`number`&&Number.isInteger(e.sizeDelta)?e.sizeDelta:null;return(0,F.jsx)(`span`,{className:`review-file-stats binary`,children:t===null?`Binary`:z(t)})}return(0,F.jsxs)(`span`,{className:`review-file-stats`,children:[e.added?(0,F.jsxs)(`span`,{className:`added`,children:[`+`,e.added]}):null,e.removed?(0,F.jsxs)(`span`,{className:`removed`,children:[`−`,e.removed]}):null]})}function nt(e){let t=e.toLowerCase();return t.endsWith(`.osql`)||t.endsWith(`.odpsql`)?`sql`:t.endsWith(`.py`)?`python`:t.endsWith(`.md`)||t.endsWith(`.mdx`)?`markdown`:/\.(c|cc|cpp|cxx|h|hh|hpp|hxx)$/.test(t)?`cpp`:t.endsWith(`.java`)?`java`:t.endsWith(`.proto`)?`protobuf`:t.endsWith(`.json`)?`json`:t.endsWith(`.yaml`)||t.endsWith(`.yml`)?`yaml`:/\.(bash|sh|zsh)$/.test(t)?`bash`:/\.(html|htm|xml)$/.test(t)?`xml`:`typescript`}function rt({intraline:e,language:t,line:n,side:r,text:i,preferences:a}){let o=n&&r?{"data-review-line":n,"data-review-side":r}:{},s=a.showTrailingWhitespace?i.match(/[ \t]+$/)?.[0]:void 0,c=s?i.slice(0,-s.length):i,l=a.intralineDifference?e:void 0,u=l?.length?it(c,l,t,a):V(c,t,a);return a.showTabs&&(u=u.replace(/\t/g,`<span class="review-tab-marker">⇥</span>`)),s&&(u+=`<span class="review-trailing-whitespace">${s.replace(/[ \t]/g,`·`)}</span>`),(0,F.jsx)(`code`,{...o,dangerouslySetInnerHTML:{__html:u}})}function V(e,t,n){return n.syntaxHighlighting&&e?b.highlight(e,{language:t,ignoreIllegals:!0}).value:B(e)}function it(e,t,n,r){let i=``,a=0,o=Array.from(e).length;for(let s of t){let t=Math.max(a,Math.min(s.start,o)),c=Math.max(t,Math.min(s.end,o));i+=V(Qe(e,a,t),n,r),c>t&&(i+=`<span class="review-intraline">${V(Qe(e,t,c),n,r)}</span>`),a=c}return i+=V(Qe(e,a),n,r),i}function H({kind:e,intraline:t,language:n,line:r,side:i,text:a,preferences:o,renderAttachment:s}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`review-diff-row unified ${e}`,children:[(0,F.jsx)(`span`,{children:r??``}),(0,F.jsx)(rt,{intraline:t,language:n,line:r,side:i,text:a,preferences:o})]}),r?s?.(r,[i]):null]})}function at({kind:e,language:t,leftLine:n,leftIntraline:r,leftText:i,rightLine:a,rightIntraline:o,rightText:s,preferences:c,renderAttachment:l}){let u=a??n,d=[...n?[`left`]:[],...a?[`right`]:[]];return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`div`,{className:`review-diff-row ${e}`,children:[(0,F.jsx)(`span`,{children:n??``}),(0,F.jsx)(rt,{intraline:r,language:t,line:n,side:`left`,text:i??``,preferences:c}),(0,F.jsx)(`span`,{children:a??``}),(0,F.jsx)(rt,{intraline:o,language:t,line:a,side:`right`,text:s??``,preferences:c})]}),u?l?.(u,d):null]})}function U(e){let t=e.findIndex(e=>e.kind!==`context`);if(t<0)return{body:e,leading:[],trailing:[]};let n=e.length-1;for(;n>t&&e[n]?.kind===`context`;)--n;return{body:e.slice(t,n+1),leading:e.slice(0,t),trailing:e.slice(n+1)}}function W(e,t,n){let r=e.filter(e=>e.kind!==`context`&&e.kind!==`skipped`);return(t===`first`?r:[...r].reverse()).find(e=>e[n]?.line)?.[n]?.line}function ot(e,t){let n=e[t]?.rows??[],r=e[t-1]?.rows??[],i=[`left`,`right`].flatMap(e=>{let t=W(n,`first`,e);if(!t)return[];let i=W(r,`last`,e);return[Math.max(0,t-(i??0)-1)]});return i.length?Math.min(...i):0}function G(e,t){let n=e[t];if(!n)return 0;let r=e[t-1],i=r?r.oldStart+r.oldLines-1:0,a=r?r.newStart+r.newLines-1:0;return Math.max(0,Math.min(n.oldStart-i-1,n.newStart-a-1))}function K(e){let t=e.diff.hunks[e.diff.hunks.length-1],n=e.diff.leftMeta?.lines,r=e.diff.rightMeta?.lines;if(!t||!Number.isInteger(n)||!Number.isInteger(r))return 0;let i=t.oldStart+t.oldLines-1,a=t.newStart+t.newLines-1;return Math.max(0,Math.min((n??0)-i,(r??0)-a))}function st(e,t,n,r){let i=n[r-1],a=n[r];return`${e}:${t}:${i?`${i.oldStart+i.oldLines-1}:${i.newStart+i.newLines-1}`:`0:0`}>${a?`${a.oldStart}:${a.newStart}`:`0:0`}`}function q(e,t){let n=t.diff.hunks[t.diff.hunks.length-1],r=n?`${n.oldStart+n.oldLines-1}:${n.newStart+n.newLines-1}`:`0:0`;return`${e}:${t.path}:${r}>eof:${t.diff.leftMeta?.lines??0}:${t.diff.rightMeta?.lines??0}`}function ct(){return{aboveRows:[],belowRows:[]}}function lt(e,t,n,r,i){let a=n.diff.hunks[r],o=n.diff.hunks[r-1],s=U(a?.rows??[]),c=o?U(o.rows):null,l=[...a?.commonContext??[],...s.leading],u=!!a?.commonContext?.length,d=u?ot(n.diff.hunks,r):G(n.diff.hunks,r),f=st(e,n.path,n.diff.hunks,r),p=t[f]??ct(),m=c?.trailing.slice(0,r>0?Math.min(d,i):0)??[],h=Math.min(Math.max(0,d-m.length),i),g=h>0?l.slice(-h):[],_=Math.max(0,d-(u?m.length+g.length:0)-p.aboveRows.length-p.belowRows.length),v=u?W(o?.rows??[],`last`,`left`)??0:o?o.oldStart+o.oldLines-1:0,y=u?W(o?.rows??[],`last`,`right`)??0:o?o.newStart+o.newLines-1:0,b=v+(u?m.length:0)+p.aboveRows.length+1,x=y+(u?m.length:0)+p.aboveRows.length+1;return{availableRows:[...c?.trailing??[],...a?.commonContext??[],...s.leading].filter(e=>{let t=e.left?.line,n=e.right?.line;return t!==void 0&&n!==void 0&&t>=b&&t<b+_&&n>=x&&n<x+_}),baseAboveRows:m,baseBelowRows:g,expansion:p,header:a?.header??``,hiddenLines:_,key:f,location:r===0?`top`:`middle`,newHiddenStart:x,oldHiddenStart:b}}function ut(e,t,n,r){let i=n.diff.hunks[n.diff.hunks.length-1];if(!i)return null;let a=K(n),o=q(e,n),s=t[o]??ct(),c=U(i.rows).trailing,l=c.slice(0,Math.min(a,r)),u=Math.max(0,a-s.aboveRows.length),d=i.oldStart+i.oldLines-1,f=i.newStart+i.newLines-1,p=d+s.aboveRows.length+1,m=f+s.aboveRows.length+1;return{availableRows:c.filter(e=>{let t=e.left?.line,n=e.right?.line;return t!==void 0&&n!==void 0&&t>=p&&n>=m}),baseAboveRows:l,baseBelowRows:[],expansion:s,header:``,hiddenLines:u,key:o,location:`bottom`,newHiddenStart:m,oldHiddenStart:p}}function J({gap:e,onExpand:t}){let n=e.hiddenLines>10,r=!!e.expansion.pending;return(0,F.jsxs)(`div`,{className:`review-diff-hunk interactive`,role:`group`,"aria-label":`${e.hiddenLines} hidden common lines`,children:[(0,F.jsx)(`span`,{children:e.header}),(0,F.jsxs)(`span`,{className:`review-context-controls`,children:[n&&e.location!==`top`?(0,F.jsx)(`button`,{type:`button`,disabled:r,"aria-label":`Show 10 lines above`,onClick:()=>t(`above`),children:`+10↑`}):null,n&&e.location!==`top`?(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`−`}):null,(0,F.jsxs)(`button`,{type:`button`,disabled:r,"aria-label":`Show all ${e.hiddenLines} common lines`,onClick:()=>t(`all`),children:[`+`,e.hiddenLines,` common `,e.hiddenLines===1?`line`:`lines`]}),n&&e.location!==`bottom`?(0,F.jsx)(`span`,{"aria-hidden":`true`,children:`−`}):null,n&&e.location!==`bottom`?(0,F.jsx)(`button`,{type:`button`,disabled:r,"aria-label":`Show 10 lines below`,onClick:()=>t(`below`),children:`+10↓`}):null]}),e.expansion.error?(0,F.jsx)(`span`,{className:`review-context-error`,role:`alert`,children:e.expansion.error}):null]})}function dt({contextKeyPrefix:e,contextGapExpansions:t,file:n,mode:r,preferences:i,renderAttachment:a,onExpandContext:o,onExpandSkippedContext:s}){let c=nt(n.path),l=n.diff.hunks.reduce((e,t)=>{for(let n of[...t.commonContext??[],...t.rows])n.left?.missingNewlineAtEnd&&(e.left=!0),n.right?.missingNewlineAtEnd&&(e.right=!0);return e},{left:!1,right:!1}),u=(t,r,a)=>{let o=Math.max(t.leftLines??0,t.rightLines??0),c=st(e,n.path,n.diff.hunks,a),l=i.context,u=Math.min(10,o);return(0,F.jsxs)(`button`,{type:`button`,className:`review-skipped-row`,onClick:()=>s(c,a,Math.min(1e4,l+u)),children:[`Show `,u,` more common lines (`,o,` hidden)`]},r)},d=(e,t,n)=>(0,F.jsx)(F.Fragment,{children:(i.ignoreWhitespace===`NONE`?e:e.filter(e=>!e.whitespaceOnly)).map((e,o)=>{let s=`${n}:${t}:${e.left?.line??``}:${e.right?.line??``}:${o}`;if(r===`unified`){if(e.kind===`skipped`)return u(e,s,t);if(e.kind===`context`){let t=e.right??e.left;return(0,F.jsx)(H,{intraline:t?.intraline,kind:`context`,language:c,line:t?.line,side:S(`context`,!!e.right),text:t?.text??``,preferences:i,renderAttachment:a},s)}return e.kind===`changed`?(0,F.jsxs)(E.Fragment,{children:[(0,F.jsx)(H,{intraline:e.left?.intraline,kind:`deleted`,language:c,line:e.left?.line,side:S(`deleted`,!1),text:e.left?.text??``,preferences:i,renderAttachment:a}),(0,F.jsx)(H,{intraline:e.right?.intraline,kind:`added`,language:c,line:e.right?.line,side:S(`added`,!0),text:e.right?.text??``,preferences:i,renderAttachment:a})]},s):e.left?(0,F.jsx)(H,{intraline:e.left.intraline,kind:`deleted`,language:c,line:e.left.line,side:S(`deleted`,!1),text:e.left.text,preferences:i,renderAttachment:a},s):(0,F.jsx)(H,{intraline:e.right?.intraline,kind:`added`,language:c,line:e.right?.line,side:S(`added`,!!e.right),text:e.right?.text??``,preferences:i,renderAttachment:a},s)}return e.kind===`skipped`?u(e,s,t):(0,F.jsx)(at,{kind:e.kind,language:c,leftIntraline:e.left?.intraline,leftLine:e.left?.line,leftText:e.left?.text,rightIntraline:e.right?.intraline,rightLine:e.right?.line,rightText:e.right?.text,preferences:i,renderAttachment:a},s)})}),f=n.diff.hunks.map((r,a)=>lt(e,t,n,a,i.context)),p=ut(e,t,n,i.context),m=[...f,...p?[p]:[]].filter(e=>e.hiddenLines>0&&e.hiddenLines<=3&&!e.expansion.pending&&!e.expansion.error),h=m.map(e=>`${e.key}:${e.hiddenLines}:${e.oldHiddenStart}:${e.newHiddenStart}`).join(`|`),g=(0,E.useRef)(o);g.current=o,(0,E.useEffect)(()=>{for(let e of m)g.current(e,`all`,{lines:e.hiddenLines,newStart:e.newHiddenStart,oldStart:e.oldHiddenStart})},[h]);let _=(e,t)=>{let n=t===`all`?e.hiddenLines:Math.min(10,e.hiddenLines),r=t===`below`?e.hiddenLines-n:0;o(e,t,{lines:n,newStart:e.newHiddenStart+r,oldStart:e.oldHiddenStart+r})},v=(e,t)=>{let n=e.expansion.aboveRows.length>0||e.expansion.belowRows.length>0,r=e.hiddenLines>3||!!e.expansion.error;return(0,F.jsxs)(F.Fragment,{children:[d(e.baseAboveRows,t,`context`),d(e.expansion.aboveRows,t,`context`),r?(0,F.jsx)(J,{gap:e,onExpand:t=>_(e,t)}):null,!r&&e.hiddenLines>0?(0,F.jsxs)(`div`,{className:`review-diff-hunk interactive loading`,role:`status`,children:[(0,F.jsx)(`span`,{children:e.header}),(0,F.jsxs)(`span`,{children:[`Loading `,e.hiddenLines,` common `,e.hiddenLines===1?`line`:`lines`,`…`]})]}):null,!r&&e.hiddenLines===0&&!n&&e.location!==`bottom`?(0,F.jsx)(`div`,{className:`review-diff-hunk ${t>0?`secondary`:``}`,children:(0,F.jsx)(`span`,{children:e.header})}):null,d(e.expansion.belowRows,t,`context`),d(e.baseBelowRows,t,`context`)]})};return(0,F.jsxs)(F.Fragment,{children:[n.diff.hunks.map((e,t)=>(0,F.jsxs)(E.Fragment,{children:[v(f[t],t),d(U(e.rows).body,t,`change`)]},`${e.header}:${t}`)),p?v(p,n.diff.hunks.length):null,l.left||l.right?(0,F.jsx)(`div`,{className:`review-newline-warning`,role:`note`,children:[l.left?`No newline at end of left file.`:``,l.right?`No newline at end of right file.`:``].filter(Boolean).join(` — `)}):null]})}function ft({row:e}){return e.diffLoadError?(0,F.jsxs)(`div`,{className:`review-diff-message error`,role:`alert`,children:[`Could not load diff: `,e.diffLoadError]}):e.diffLoadPending?(0,F.jsx)(`div`,{className:`review-diff-message`,role:`status`,children:`Loading diff…`}):e.diffStatus===`binary`?(0,F.jsx)(`div`,{className:`review-diff-message`,children:`Binary file changed`}):e.diffStatus===`too-expensive`?(0,F.jsx)(`div`,{className:`review-diff-message`,children:`Diff too large to render`}):e.diffStatus===`not-loaded`?(0,F.jsx)(`div`,{className:`review-diff-message`,children:`Diff not loaded yet`}):null}function pt({disabled:e,draft:t,target:n,onCancel:r,onDraftChange:i,onSave:a}){let o=n.side===`right`?`Patchset`:n.side===`left`?`Base`:`file`;return(0,F.jsxs)(`form`,{className:`review-comment-editor`,onSubmit:e=>{e.preventDefault(),a()},children:[(0,F.jsxs)(`header`,{children:[`Comment on `,n.range?n.range.start_line===n.range.end_line?`${o} line ${n.range.start_line}, columns ${n.range.start_character+1}–${n.range.end_character}`:`${o} lines ${n.range.start_line}–${n.range.end_line}`:`${o} line ${n.line}`]}),(0,F.jsx)(`textarea`,{"aria-label":`Review comment`,name:`farming-review-comment`,inputMode:`text`,autoComplete:`off`,autoCorrect:`off`,autoCapitalize:`none`,spellCheck:!1,enterKeyHint:`done`,"data-lpignore":`true`,"data-1p-ignore":`true`,"data-bwignore":`true`,"data-form-type":`other`,autoFocus:!0,placeholder:`Leave a review comment…`,value:t,onChange:e=>i(e.target.value)}),(0,F.jsxs)(`footer`,{children:[(0,F.jsx)(`button`,{type:`button`,onClick:r,children:`CANCEL`}),(0,F.jsx)(`button`,{type:`submit`,disabled:e||!t.trim(),children:e?`SAVING…`:`SAVE COMMENT`})]})]})}function mt({comment:e,disabled:t,onDelete:n,onStatusChange:r}){let a=e.side===`right`?`Patchset`:e.side===`left`?`Base`:`File`,o=e.status||`open`,s=e.range?e.range.start_line===e.range.end_line?`${a} line ${e.range.start_line}, columns ${e.range.start_character+1}–${e.range.end_character}`:`${a} lines ${e.range.start_line}–${e.range.end_line}`:`${a} line ${e.line}`;return(0,F.jsxs)(`article`,{className:`review-comment-thread ${o}`,children:[(0,F.jsxs)(`header`,{children:[(0,F.jsx)(`span`,{children:o===`outdated`?`Outdated · ${s}`:s}),(0,F.jsxs)(`span`,{className:`review-comment-actions`,children:[(0,F.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>r(o===`resolved`?`open`:`resolved`),children:o===`resolved`?`REOPEN`:`RESOLVE`}),(0,F.jsx)(`button`,{type:`button`,"aria-label":`Delete comment on line ${e.line}`,disabled:t,onClick:n,children:(0,F.jsx)(i,{})})]})]}),(0,F.jsx)(`p`,{children:e.body})]})}function ht(e,t){let n=(e instanceof Element?e:e?.parentElement)?.closest(`code[data-review-line][data-review-side]`)??null;return n&&t.contains(n)?n:null}function gt(e,t,n){let r=document.createRange();r.selectNodeContents(e);try{r.setEnd(t,n)}catch{return 0}return r.toString().length}function _t(e){let t=window.getSelection();if(!t||t.isCollapsed||!t.anchorNode||!t.focusNode)return null;let n=ht(t.anchorNode,e),r=ht(t.focusNode,e);if(!n||!r)return null;let i=n.dataset.reviewSide;if(i!==r.dataset.reviewSide||i!==`left`&&i!==`right`&&i!==`unified`)return null;let a=Number(n.dataset.reviewLine),o=Number(r.dataset.reviewLine);if(!Number.isInteger(a)||!Number.isInteger(o))return null;let s={character:gt(n,t.anchorNode,t.anchorOffset),line:a},c={character:gt(r,t.focusNode,t.focusOffset),line:o},l=s.line<c.line||s.line===c.line&&s.character<=c.character,u=l?s:c,d=l?c:s;return u.line===d.line&&u.character===d.character?null:{line:d.line,range:{end_character:d.character,end_line:d.line,start_character:u.character,start_line:u.line},side:i}}function Y(){let e=typeof window<`u`&&new URLSearchParams(window.location.search).get(`fixture`)===`1`,[t]=(0,E.useState)(()=>{let e=typeof window>`u`?``:window.location.search;return{requested:new URLSearchParams(e).has(`acpItem`),route:Fe(e)}}),n=t.route,[i]=(0,E.useState)(()=>ze(typeof window>`u`?null:window.location)),d=!e&&!t.requested&&i.request&&(i.request.source===`working-copy`||i.request.head===`now`)?i.request:null,[f,p]=(0,E.useState)(()=>d||t.requested?null:i.request),[m,h]=(0,E.useState)(null),[g,_]=(0,E.useState)(`final`),[v,y]=(0,E.useState)(!!(d||n)),b=t.requested?!n:!!i.error,x=!e,S=f?.source===`working-copy`,ne=f?.source===`git-range`,[ie,C]=(0,E.useState)(()=>b?{[L]:[]}:Ye(f,e)),[w,T]=(0,E.useState)(t.requested?n?``:`ACP review target is invalid`:i.error??``),[_e,De]=(0,E.useState)(null),[D,Ae]=(0,E.useState)(()=>{let t=b?{[L]:[]}:Ye(f,e);return Xe({basePatchset:b?`Base`:Je(f,e),catalog:t,comments:[],initialPatchset:b?L:qe(f,e),initiallyExpand:!x,reviewId:x?void 0:we})}),O=(0,E.useRef)(D),k=(0,E.useRef)(ie);k.current=ie;let[A,j]=(0,E.useState)(We),[Ne,M]=(0,E.useState)(!1),[Ie,Le]=(0,E.useState)(!1),[N,Re]=(0,E.useState)(``),[P,I]=(0,E.useState)(``),[Ve,He]=(0,E.useState)(``),[Ue,R]=(0,E.useState)([]),[Ze,z]=(0,E.useState)({}),[B,Qe]=(0,E.useState)(null),[nt,rt]=(0,E.useState)(``),[V,it]=(0,E.useState)(!1),[H,at]=(0,E.useState)(()=>new URLSearchParams(window.location.search).get(`comparison`)||``),[U,W]=(0,E.useState)(!1),ot=(0,E.useRef)(null),G=x?D.reviewId??``:we,K=D.patchRange.patchset,st=D.patchRange.basePatchset,q=oe(D,K),lt=new Set(q.expandedPaths),ut=D.diffMode,J=!!(m&&f?.source===`git-range`&&f.reviewId===m.reviewId&&f.head===m.head),ht=J?m?.scope:f?.source===`working-copy`?f.scope:void 0,gt=ht===`untracked`?`unified`:ut,Y=D.preferences,vt=f?{...f,context:Y.context,ignoreWhitespace:Y.ignoreWhitespace}:null,yt=(0,E.useRef)(vt);yt.current=vt;let X=J?{..._e??{workingTree:!0},head:void 0,workingTree:!0}:_e,Z=D.commentDraft,bt=D.commentDraft?.body??``,Q=ie[K]??[],xt=Q.reduce((e,t)=>e+t.added,0),St=Q.reduce((e,t)=>e+t.removed,0),Ct=Math.max(1,...Q.map(e=>e.added+e.removed)),$=e=>{let t=re(O.current,e,k.current);if(t.state!==O.current){O.current=t.state,Ae(t.state);for(let e of t.effects){if(e.type===`load-file-diff`){let t=yt.current;if(!t){$(Me(e,`review file diff source is unavailable`));continue}fe(t,e.path).then(t=>{let n=je(k.current,e,t,{reviewId:O.current.reviewId});k.current=n.catalog,C(n.catalog),$(n.action)}).catch(t=>$(Me(e,t)))}if(e.type===`save-reviewed-status`){let t=e.reviewId??G;le({...e,reviewId:t}).then(t=>$({patchset:e.patchset,paths:e.changes.map(e=>e.path),reviewedPaths:t.reviewedPaths,...e.reviewId?{reviewId:e.reviewId}:{},revision:t.revision,type:`commit-reviewed-status`})).catch(async n=>{let r=n instanceof be&&n.state?n.state:await xe(t,e.patchset).catch(()=>null);if(!r){let t=oe(O.current,e.patchset),n=new Set(t.reviewedPaths);for(let t of e.changes)t.reviewed?n.delete(t.path):n.add(t.path);r={reviewedPaths:[...n],revision:e.revision}}$({patchset:e.patchset,reviewedPaths:r.reviewedPaths,...e.reviewId?{reviewId:e.reviewId}:{},revision:r.revision,type:`restore-reviewed-status`}),Re(n instanceof Error?`Could not save Reviewed: ${n.message}`:`Could not save Reviewed status`)})}if(e.type===`save-comment`){let t=e.reviewId??G;me(t,e.comment).then(()=>$({id:e.comment.id,patchset:e.comment.patchset,pendingType:`save`,...e.reviewId?{reviewId:e.reviewId}:{},type:`commit-comment`})).catch(async n=>{$({comments:await Ce(t,e.comment.patchset).catch(()=>O.current.comments.filter(t=>t.id!==e.comment.id)),id:e.comment.id,patchset:e.comment.patchset,pendingType:`save`,...e.reviewId?{reviewId:e.reviewId}:{},type:`restore-comments`}),I(n instanceof Error?`Could not save comment: ${n.message}`:`Could not save comment`)})}if(e.type===`delete-comment`){let t=e.reviewId??G;ue(t,e.comment.patchset,e.comment.id).then(()=>$({id:e.comment.id,patchset:e.comment.patchset,pendingType:`delete`,...e.reviewId?{reviewId:e.reviewId}:{},type:`commit-comment`})).catch(async n=>{$({comments:await Ce(t,e.comment.patchset).catch(()=>[...O.current.comments,e.comment]),id:e.comment.id,patchset:e.comment.patchset,pendingType:`delete`,...e.reviewId?{reviewId:e.reviewId}:{},type:`restore-comments`}),I(n instanceof Error?`Could not delete comment: ${n.message}`:`Could not delete comment`)})}}}};(0,E.useEffect)(()=>(document.body.classList.add(`review-body`),()=>document.body.classList.remove(`review-body`)),[]),(0,E.useEffect)(()=>{if(!U)return;let e=e=>{ot.current?.contains(e.target)||W(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[U]),(0,E.useEffect)(()=>{if(!d&&!n)return;let e=!0;return y(!0),(n?Se(n.agentId,n.itemIds):(()=>{let e=d;return ge(`root`in e&&typeof e.root==`string`?{root:e.root}:{agentId:e.agentId},e.source===`git-range`?e.base:`HEAD`,e.source===`working-copy`?{modifiedWithinDays:e.modifiedWithinDays,paths:e.paths,scope:e.scope}:void 0)})()).then(t=>{if(!e)return;let n=he(t,`final`),r=new URLSearchParams(window.location.search);r.delete(`agentId`),r.delete(`acpItem`),r.set(`root`,t.root),r.set(`base`,n.base),r.set(`head`,n.head),r.set(`reviewId`,t.reviewId),r.set(`comparison`,`last-turn`),window.history.replaceState(null,``,`${window.location.pathname}?${r.toString()}`),h(t),_(`final`),at(`last-turn`),p(n),T(``)}).catch(t=>{e&&T(t instanceof Error?t.message:`review capture failed`)}).finally(()=>{e&&y(!1)}),()=>{e=!1}},[n,d]),(0,E.useEffect)(()=>{if(d||n||f?.source!==`git-range`||!f.reviewId)return;let e=!0;return pe(f.reviewId).then(t=>{if(!e)return;let n=t.revisions.find(e=>e.head===f.head)??t;h(n),at(e=>e||`last-turn`),_(f.base===n.fixesBase&&n.fixesBase!==n.base?`fixes`:`final`)}).catch(()=>{}),()=>{e=!1}},[n,d,f]),(0,E.useEffect)(()=>{if(!f)return;let e=!0,t=Ke();return ve({...f,context:t.context,ignoreWhitespace:t.ignoreWhitespace,metadataOnly:!0}).then(async n=>{let[r,i]=await Promise.all([xe(n.reviewId,n.patchset).catch(()=>null),Ce(n.reviewId,n.patchset).catch(()=>[])]);if(!e)return;let a=ee(Oe(n),n.patchset,i.map(e=>e.path)),o=ke({comments:i,preferences:t,...r?{reviewedPaths:r.reviewedPaths}:{},snapshot:n});r&&(o=re(o,{patchset:n.patchset,reviewedPaths:r.reviewedPaths,reviewId:n.reviewId,revision:r.revision,type:`hydrate-reviewed-status`},a).state),O.current=o,k.current=a,De(n.comparison??null),C(a),Ae(o),T(``)}).catch(t=>{e&&T(t instanceof Error?t.message:`review diff request failed`)}),()=>{e=!1}},[f]),(0,E.useEffect)(()=>{if(!N)return;let e=window.setTimeout(()=>Re(``),4e3);return()=>window.clearTimeout(e)},[N]),(0,E.useEffect)(()=>{if(!P)return;let e=window.setTimeout(()=>I(``),4e3);return()=>window.clearTimeout(e)},[P]),(0,E.useEffect)(()=>{try{window.localStorage.setItem(Ge,JSON.stringify(Y))}catch{}},[D.preferences]),(0,E.useEffect)(()=>{if(x||!G||!k.current[K])return;let e=!0;return xe(G,K).then(t=>{e&&$({patchset:K,reviewedPaths:t.reviewedPaths,reviewId:G,revision:t.revision,type:`hydrate-reviewed-status`})}).catch(()=>{}),Ce(G,K).then(t=>{if(!e)return;let n=ee(k.current,K,t.map(e=>e.path));n!==k.current&&(k.current=n,C(n)),$({comments:t,patchset:K,reviewId:G,type:`hydrate-comments`})}).catch(()=>{}),()=>{e=!1}},[x,K,G]),(0,E.useEffect)(()=>{let e=()=>{let e=``;for(let t of document.querySelectorAll(`.review-file-change.expanded[data-file-path]`)){let n=t.querySelector(`.review-file-change-header`);if(!n)continue;let r=t.getBoundingClientRect(),i=n.getBoundingClientRect();i.top<=1&&r.bottom>i.bottom&&(e=t.dataset.filePath??``)}He(t=>t===e?t:e)};return e(),window.addEventListener(`scroll`,e,{passive:!0}),document.body.addEventListener(`scroll`,e,{passive:!0}),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`scroll`,e),document.body.removeEventListener(`scroll`,e),window.removeEventListener(`resize`,e)}},[K,q.expandedPaths.join(`\0`)]);let wt=!!q.pendingReview,Tt=!!q.pendingComment,Et=(e,t)=>{$({path:e,reviewed:t,type:`set-file-reviewed`})},Dt=e=>{$({patchset:e,type:`select-patchset`})},Ot=Q.length>0&&Q.every(e=>lt.has(e.path)),kt=e=>{$({path:e,type:`toggle-file-expanded`})},At=()=>{j(Y),M(!0)},jt=()=>{let e=Y,t=te(A),n=e.context!==t.context||e.ignoreWhitespace!==t.ignoreWhitespace;if($({preferences:t,type:`set-preferences`}),M(!1),n&&z({}),!x||!f||!n)return;let r=K,i=new Map(Q.map(e=>[e.path,e])),a=q.expandedPaths.filter(e=>{let t=i.get(e);return!!(t&&t.kind!==`unmodified`&&!t.binary&&!t.diffTooExpensive)});a.length&&(R(e=>[...new Set([...e,...a])]),Be({...f,context:t.context,ignoreWhitespace:t.ignoreWhitespace},a).then(e=>{if(O.current.patchRange.patchset!==r)return;let t=k.current;for(let n of e.files)t=se(t,r,n);k.current=t,C(t);let n=e.errors[0];n&&T(n.message)}).finally(()=>R(e=>e.filter(e=>!a.includes(e)))))},Mt=()=>{navigator.clipboard&&navigator.clipboard.writeText(`34a15ae`).catch(()=>{}),Le(!0),window.setTimeout(()=>Le(!1),1200)},Nt=(e,t)=>{let n=yt.current;if(!n||Ue.includes(e))return;let r=K;R(t=>[...t,e]),fe({...n,context:t},e).then(e=>{let t=se(k.current,r,e);k.current=t,C(t)}).catch(e=>T(e instanceof Error?e.message:`review context request failed`)).finally(()=>R(t=>t.filter(t=>t!==e)))},Pt=(e,t,n,r)=>{let i=yt.current;if(t.expansion.pending||r.lines<1)return;let a=e=>{z(r=>{let i=r[t.key]??ct();return{...r,[t.key]:n===`below`?{...i,belowRows:[...e,...i.belowRows],error:void 0,pending:void 0}:{...i,aboveRows:[...i.aboveRows,...e],error:void 0,pending:void 0}}})},o=e=>{let n=e instanceof Error?e.message:`review context request failed`;z(e=>{let r=e[t.key]??ct();return{...e,[t.key]:{...r,error:n,pending:void 0}}})};if(z(e=>{let r=e[t.key]??ct();return{...e,[t.key]:{...r,error:void 0,pending:n}}}),!i){let e=t.availableRows.filter(e=>{let t=e.left?.line,n=e.right?.line;return t!==void 0&&n!==void 0&&t>=r.oldStart&&t<r.oldStart+r.lines&&n>=r.newStart&&n<r.newStart+r.lines});e.length===r.lines?a(e):o(Error(`review context is unavailable`));return}Te(i,e.path,r).then(e=>a(e.rows)).catch(o)},Ft=(e,t,n,r)=>{$({line:t,path:e,range:r,side:n,type:`start-comment`})},It=()=>{!Z||!bt.trim()||$({id:typeof crypto?.randomUUID==`function`?crypto.randomUUID():`comment-${Date.now()}-${Math.random().toString(36).slice(2)}`,type:`save-comment`})},Lt=(e,t)=>{G&&Ee(G,e.patchset,e.id,t).then(()=>Ce(G,e.patchset)).then(t=>$({comments:t,patchset:e.patchset,reviewId:G,type:`hydrate-comments`})).catch(e=>I(e instanceof Error?e.message:`review comment status failed`))},Rt=(e,t)=>{let n=he(e,t),r=new URLSearchParams(window.location.search);r.delete(`agentId`),r.set(`root`,e.root),r.set(`base`,n.base),r.set(`head`,n.head),r.set(`reviewId`,e.reviewId),r.set(`comparison`,`last-turn`),window.history.replaceState(null,``,`${window.location.pathname}?${r.toString()}`),h(e),_(t),at(`last-turn`),W(!1),p(n)},zt=f&&`root`in f&&f.root?{root:f.root}:f&&`agentId`in f&&f.agentId?{agentId:f.agentId}:m?{root:m.root}:null,Bt=()=>{let e=!U;W(e),!(!e||B||V||!zt)&&(it(!0),rt(``),de(zt).then(Qe).catch(e=>rt(e instanceof Error?e.message:`Comparison sources could not be loaded`)).finally(()=>it(!1)))},Vt=e=>{if(!B)return;let t={base:e.base,head:e.head,metadataOnly:!0,root:B.root,source:`git-range`},n=new URLSearchParams(window.location.search);n.delete(`agentId`),n.delete(`reviewId`),n.delete(`path`),n.delete(`scope`),n.delete(`modifiedWithinDays`),n.set(`root`,B.root),n.set(`base`,e.base),n.set(`head`,e.head),n.set(`comparison`,e.id),window.history.replaceState(null,``,`${window.location.pathname}?${n.toString()}`),at(e.id),W(!1),_(`final`),p(t)},Ht=()=>{!m||v||(y(!0),ye(m.reviewId).then(e=>{Rt(e,e.number>1?`fixes`:`final`),T(``)}).catch(e=>T(e instanceof Error?e.message:`review refresh failed`)).finally(()=>y(!1)))},Ut=e=>{!m||e===g||Rt(m,e)},Wt=ht,Gt=Wt===`tracked`?`Changes`:Wt===`untracked`?`Untracked`:`Files`,Kt=B?[B.unstaged,B.staged,...B.commits,...B.branches].find(e=>e.id===H):null,qt=J?`Last Turn`:Kt?.id.startsWith(`commit:`)?`Commit · ${Kt.label}`:Kt?.id.startsWith(`branch:`)?`Branch · ${Kt.label}`:Kt?.label??(S?`Working copy`:ne?`Changes`:Gt),Jt=H===`staged`?`Staged changes`:X?.workingTree?`Workspace changes`:X?.head?.message.split(`
2
2
  `)[0]||`Commit details`,Yt=X?.head?`Commit message`:H===`staged`?`Index summary`:`Change summary`,Xt=H===`staged`?`Staged changes are stored in the Git index and do not have a commit author or commit message yet.`:`Uncommitted workspace changes do not have a commit author or commit message yet.`,Zt=v?`Capturing an immutable workspace revision…`:f?S?Wt===`tracked`?`No tracked changes in this workspace.`:Wt===`untracked`?`No untracked files modified in the last ${f.modifiedWithinDays??3} days.`:`No uncommitted files in this workspace.`:`No changed files in this range.`:`Open a real review with: farming review <git-dir> <base> <head|now>`,Qt=b?`Could not load review target`:ne?`Could not load git range`:`Could not load working copy`;return(0,F.jsxs)(`main`,{className:`review-root`,"data-testid":`review-page`,children:[(0,F.jsxs)(`section`,{className:`review-files`,"aria-label":`Changed files`,children:[(0,F.jsxs)(`header`,{className:`review-files-toolbar`,children:[(0,F.jsxs)(`div`,{className:`review-patch-info`,children:[(0,F.jsxs)(`div`,{className:`review-source-control`,ref:ot,children:[(0,F.jsxs)(`button`,{type:`button`,className:`review-source-trigger`,"aria-expanded":U,onClick:Bt,children:[(0,F.jsx)(`strong`,{children:qt}),(0,F.jsx)(u,{})]}),U?(0,F.jsxs)(`div`,{className:`review-source-menu`,role:`menu`,"aria-label":`Compare changes from`,children:[V?(0,F.jsx)(`p`,{children:`Loading comparisons…`}):null,nt?(0,F.jsx)(`p`,{className:`error`,children:nt}):null,B?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":H===`unstaged`,disabled:!B.unstaged.available,onClick:()=>Vt(B.unstaged),children:[(0,F.jsx)(`span`,{children:`Unstaged`}),H===`unstaged`?(0,F.jsx)(c,{}):null]}),(0,F.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":H===`staged`,disabled:!B.staged.available,onClick:()=>Vt(B.staged),children:[(0,F.jsx)(`span`,{children:`Staged`}),H===`staged`?(0,F.jsx)(c,{}):null]}),(0,F.jsxs)(`details`,{className:`review-source-submenu`,children:[(0,F.jsxs)(`summary`,{children:[`Commit `,(0,F.jsx)(o,{})]}),(0,F.jsx)(`div`,{children:B.commits.length?B.commits.map(e=>(0,F.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":H===e.id,onClick:()=>Vt(e),children:[(0,F.jsx)(`span`,{children:e.label}),H===e.id?(0,F.jsx)(c,{}):null]},e.id)):(0,F.jsx)(`p`,{children:`No commits available`})})]}),(0,F.jsxs)(`details`,{className:`review-source-submenu`,children:[(0,F.jsxs)(`summary`,{children:[`Branch `,(0,F.jsx)(o,{})]}),(0,F.jsx)(`div`,{children:B.branches.length?B.branches.map(e=>(0,F.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":H===e.id,onClick:()=>Vt(e),children:[(0,F.jsx)(`span`,{children:e.label}),H===e.id?(0,F.jsx)(c,{}):null]},e.id)):(0,F.jsx)(`p`,{children:`No other branches`})})]}),m?(0,F.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":J,onClick:()=>Rt(m,g),children:[(0,F.jsx)(`span`,{children:`Last Turn`}),J?(0,F.jsx)(c,{}):null]}):null]}):null]}):null]}),(0,F.jsxs)(`span`,{className:`review-total-stats`,children:[(0,F.jsxs)(`b`,{children:[`+`,xt]}),(0,F.jsxs)(`i`,{children:[`−`,St]})]}),x?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`select`,{"aria-label":`Patch set`,value:K,onChange:e=>Dt(e.target.value),children:[(0,F.jsx)(`option`,{value:`Patchset 20`,children:`Patchset 20`}),(0,F.jsx)(`option`,{value:`Patchset 19`,children:`Patchset 19`})]}),(0,F.jsxs)(`button`,{type:`button`,className:`review-commit`,onClick:Mt,title:`Copy commit`,children:[Ie?`Copied`:`34a15ae`,(0,F.jsx)(l,{})]})]}),J?(0,F.jsxs)(`span`,{className:`review-revision-label`,children:[`Revision `,m?.number]}):null]}),(0,F.jsxs)(`div`,{className:`review-files-actions`,children:[J&&m?(0,F.jsxs)(F.Fragment,{children:[m.number>1?(0,F.jsx)(`button`,{type:`button`,className:g===`fixes`?`active`:``,onClick:()=>Ut(`fixes`),children:`FIXES SINCE REVIEW`}):null,(0,F.jsx)(`button`,{type:`button`,disabled:v,onClick:Ht,children:v?`CAPTURING…`:`REFRESH`}),(0,F.jsx)(`span`,{className:`review-toolbar-separator`})]}):null,(0,F.jsx)(`button`,{type:`button`,onClick:()=>$({expanded:!Ot,paths:Q.map(e=>e.path),type:`set-all-files-expanded`}),children:Ot?`COLLAPSE ALL`:`EXPAND ALL`}),(0,F.jsx)(`span`,{className:`review-toolbar-separator`}),ht===`untracked`?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`span`,{children:`Diff view:`}),(0,F.jsx)(`button`,{type:`button`,className:`review-icon-action ${ut===`split`?`active`:``}`,"aria-label":`Side-by-side diff`,title:`Side-by-side diff`,onClick:()=>$({mode:`split`,type:`set-diff-mode`}),children:(0,F.jsx)(s,{})}),(0,F.jsx)(`button`,{type:`button`,className:`review-icon-action ${ut===`unified`?`active`:``}`,"aria-label":`Unified diff`,title:`Unified diff`,onClick:()=>$({mode:`unified`,type:`set-diff-mode`}),children:(0,F.jsx)(a,{})})]}),(0,F.jsx)(`button`,{type:`button`,className:`review-icon-action`,"aria-label":`Diff preferences`,title:`Diff preferences`,onClick:At,children:(0,F.jsx)(r,{})})]}),N||P?(0,F.jsx)(`span`,{className:`review-review-error`,role:`status`,children:N||P}):null]}),x&&X?(0,F.jsxs)(`details`,{className:`review-commit-message`,children:[(0,F.jsxs)(`summary`,{children:[(0,F.jsx)(`span`,{children:Yt}),(0,F.jsx)(`strong`,{children:Jt}),(0,F.jsx)(o,{})]}),(0,F.jsx)(`div`,{children:X.head?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{children:[(0,F.jsx)(`span`,{children:`Author`}),(0,F.jsx)(`strong`,{children:X.head.authorName}),X.head.authorEmail?` <${X.head.authorEmail}>`:``]}),X.head.authoredAt?(0,F.jsxs)(`p`,{children:[(0,F.jsx)(`span`,{children:`Date`}),new Date(X.head.authoredAt).toLocaleString()]}):null,(0,F.jsx)(`pre`,{children:X.head.message})]}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(`p`,{children:[(0,F.jsx)(`span`,{children:`Based on`}),(0,F.jsx)(`strong`,{children:X.base?.message.split(`
3
3
  `)[0]||st})]}),X.base?(0,F.jsxs)(`p`,{children:[(0,F.jsx)(`span`,{children:`Base author`}),X.base.authorName,X.base.authorEmail?` <${X.base.authorEmail}>`:``]}):null,(0,F.jsx)(`pre`,{children:Xt})]})})]}):null,(0,F.jsxs)(`div`,{className:`review-files-list`,children:[w?(0,F.jsxs)(`p`,{className:`review-working-copy-message`,role:`alert`,children:[Qt,`: `,w]}):null,x&&!w&&Q.length===0?(0,F.jsx)(`p`,{className:`review-working-copy-message`,role:`status`,children:Zt}):null,Q.map(e=>{let t=Pe(D,e,{mutationPending:wt}),n=ce(D,t.commentPaths),r=n.filter(e=>e.status===`outdated`),i=t=>ae(e,t);return(0,F.jsxs)(`article`,{className:`review-file-change ${t.expanded?`expanded`:``} ${Ve===e.path?`reviewing`:``}`,"data-testid":`review-file-row`,"data-change-kind":e.kind,"data-file-path":e.path,children:[(0,F.jsxs)(`header`,{className:`review-file-change-header`,children:[(0,F.jsxs)(`button`,{type:`button`,className:`review-file-select`,onClick:()=>kt(e.path),children:[(0,F.jsx)(`span`,{className:`review-file-status`,children:t.changeLabel}),(0,F.jsxs)(`span`,{className:`review-file-paths`,children:[(0,F.jsx)(`span`,{className:`review-file-name`,children:e.path}),e.previousPath?(0,F.jsx)(`span`,{className:`review-file-previous-path`,title:`Previous path: ${e.previousPath}`,children:e.previousPath}):null]}),(0,F.jsx)(et,{file:e,maxChangeSize:Ct}),(0,F.jsx)(tt,{file:e})]}),(0,F.jsx)($e,{action:t.action,pending:t.pending,reviewed:t.reviewed,reviewedLabel:t.reviewedLabel,onToggle:()=>{t.action&&Et(e.path,t.action.nextReviewed)}}),(0,F.jsx)(`button`,{type:`button`,className:`review-file-expand`,"aria-label":t.expanded?`Collapse file diff`:`Expand file diff`,onClick:()=>kt(e.path),children:t.expanded?(0,F.jsx)(u,{}):(0,F.jsx)(o,{})})]}),t.expanded?(0,F.jsxs)(`section`,{className:`review-inline-diff ${gt} ${Y.fitToScreen?`fit-to-screen`:``}`,"aria-label":`Diff for ${e.path}`,children:[r.length?(0,F.jsx)(`div`,{className:`review-outdated-comments`,children:r.map(e=>(0,F.jsx)(mt,{comment:e,disabled:Tt,onDelete:()=>$({id:e.id,type:`delete-comment`}),onStatusChange:t=>Lt(e,t)},e.id))}):null,(0,F.jsxs)(`div`,{className:`review-diff-columns`,children:[(0,F.jsx)(`span`,{children:`File`}),gt===`split`?(0,F.jsx)(`span`,{children:`File`}):null]}),t.diffStatus!==`loaded`||t.diffLoadPending||t.diffLoadError?(0,F.jsx)(ft,{row:t}):(0,F.jsx)(F.Fragment,{children:(0,F.jsx)(`div`,{className:`review-diff-code`,style:{fontSize:`${Y.fontSize}px`,tabSize:Y.tabSize,minWidth:Y.fitToScreen?void 0:`${Math.round(Y.lineLength*Y.fontSize*.62)}px`},onClick:e=>{let t=window.getSelection();if(t&&!t.isCollapsed||!(e.target instanceof Element))return;let n=e.target.closest(`code[data-review-line][data-review-side]`);if(!n)return;let r=Number(n.dataset.reviewLine),a=n.dataset.reviewSide;!Number.isFinite(r)||a!==`left`&&a!==`right`&&a!==`unified`||Ft(i(a),r,a)},onMouseUp:e=>{let t=_t(e.currentTarget);t&&Ft(i(t.side),t.line,t.side,t.range)},children:(0,F.jsx)(dt,{contextKeyPrefix:`${G}:${K}`,contextGapExpansions:Ze,file:e,mode:gt,preferences:Y,renderAttachment:(e,t)=>{let r=Z&&Z.path===i(Z.side)&&Z.line===e&&t.includes(Z.side)?Z:null,a=n.filter(n=>n.status!==`outdated`&&n.line===e&&t.includes(n.side)&&n.path===i(n.side));return!r&&a.length===0?null:(0,F.jsxs)(`div`,{className:`review-line-attachment`,"data-review-comment-line":e,children:[r?(0,F.jsx)(pt,{disabled:Tt,draft:bt,target:r,onCancel:()=>$({type:`cancel-comment`}),onDraftChange:e=>$({body:e,type:`update-comment-draft`}),onSave:It}):null,a.map(e=>(0,F.jsx)(mt,{comment:e,disabled:Tt,onDelete:()=>$({id:e.id,type:`delete-comment`}),onStatusChange:t=>Lt(e,t)},e.id))]})},onExpandContext:(t,n,r)=>Pt(e,t,n,r),onExpandSkippedContext:(t,n,r)=>Nt(e.path,r)})})})]}):null]},e.path)})]})]}),Ne?(0,F.jsx)(`div`,{className:`review-preferences-backdrop`,role:`presentation`,onMouseDown:()=>M(!1),children:(0,F.jsxs)(`section`,{className:`review-preferences`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`review-preferences-title`,onMouseDown:e=>e.stopPropagation(),children:[(0,F.jsx)(`header`,{children:(0,F.jsx)(`h2`,{id:`review-preferences-title`,children:`Diff Preferences`})}),(0,F.jsxs)(`div`,{className:`review-preferences-form`,children:[(0,F.jsxs)(`label`,{children:[`Context`,(0,F.jsxs)(`select`,{"aria-label":`Context`,value:A.context,onChange:e=>j(t=>({...t,context:Number(e.target.value)})),children:[(0,F.jsx)(`option`,{value:3,children:`3 lines`}),(0,F.jsx)(`option`,{value:10,children:`10 lines`}),(0,F.jsx)(`option`,{value:25,children:`25 lines`}),(0,F.jsx)(`option`,{value:100,children:`100 lines`})]})]}),(0,F.jsxs)(`label`,{className:`checkbox-row`,children:[`Fit to screen`,(0,F.jsx)(`input`,{"aria-label":`Fit to screen`,type:`checkbox`,checked:A.fitToScreen,onChange:e=>j(t=>({...t,fitToScreen:e.target.checked}))})]}),(0,F.jsxs)(`label`,{children:[`Diff width`,(0,F.jsx)(`input`,{"aria-label":`Diff width`,type:`number`,autoComplete:`off`,"data-form-type":`other`,min:40,max:240,value:A.lineLength,onChange:e=>j(t=>({...t,lineLength:Number(e.target.value)||t.lineLength}))})]}),(0,F.jsxs)(`label`,{children:[`Tab width`,(0,F.jsx)(`input`,{"aria-label":`Tab width`,type:`number`,autoComplete:`off`,"data-form-type":`other`,min:2,max:16,value:A.tabSize,onChange:e=>j(t=>({...t,tabSize:Number(e.target.value)||t.tabSize}))})]}),(0,F.jsxs)(`label`,{children:[`Font size`,(0,F.jsx)(`input`,{"aria-label":`Font size`,type:`number`,autoComplete:`off`,"data-form-type":`other`,min:10,max:20,value:A.fontSize,onChange:e=>j(t=>({...t,fontSize:Number(e.target.value)||t.fontSize}))})]}),(0,F.jsxs)(`label`,{className:`checkbox-row`,children:[`Intraline differences`,(0,F.jsx)(`input`,{"aria-label":`Intraline differences`,type:`checkbox`,checked:A.intralineDifference,onChange:e=>j(t=>({...t,intralineDifference:e.target.checked}))})]}),(0,F.jsxs)(`label`,{className:`checkbox-row`,children:[`Show tabs`,(0,F.jsx)(`input`,{"aria-label":`Show tabs`,type:`checkbox`,checked:A.showTabs,onChange:e=>j(t=>({...t,showTabs:e.target.checked}))})]}),(0,F.jsxs)(`label`,{className:`checkbox-row`,children:[`Show trailing whitespace`,(0,F.jsx)(`input`,{"aria-label":`Show trailing whitespace`,type:`checkbox`,checked:A.showTrailingWhitespace,onChange:e=>j(t=>({...t,showTrailingWhitespace:e.target.checked}))})]}),(0,F.jsxs)(`label`,{className:`checkbox-row`,children:[`Syntax highlighting`,(0,F.jsx)(`input`,{"aria-label":`Syntax highlighting`,type:`checkbox`,checked:A.syntaxHighlighting,onChange:e=>j(t=>({...t,syntaxHighlighting:e.target.checked}))})]}),(0,F.jsxs)(`label`,{children:[`Ignore Whitespace`,(0,F.jsxs)(`select`,{"aria-label":`Ignore Whitespace`,value:A.ignoreWhitespace,onChange:e=>j(t=>({...t,ignoreWhitespace:e.target.value})),children:[(0,F.jsx)(`option`,{value:`NONE`,children:`None`}),(0,F.jsx)(`option`,{value:`TRAILING`,children:`Trailing`}),(0,F.jsx)(`option`,{value:`LEADING_AND_TRAILING`,children:`Leading + trailing`}),(0,F.jsx)(`option`,{value:`ALL`,children:`All`})]})]})]}),(0,F.jsxs)(`footer`,{children:[(0,F.jsx)(`button`,{type:`button`,onClick:()=>M(!1),children:`CANCEL`}),(0,F.jsx)(`button`,{type:`button`,onClick:jt,children:`SAVE`})]})]})}):null]})}export{Y as ReviewPage,nt as diffLanguageForPath};
@@ -0,0 +1 @@
1
+ body.code-mode[data-appearance=dark]{--code-dark-bg:#0d1117;--code-dark-bg-soft:#11161d;--code-dark-bg-panel:#161b22;--code-dark-bg-elevated:#1c2129;--code-dark-bg-hover:#252b35;--code-dark-bg-active:#2b323d;--code-dark-border:#30363d;--code-dark-border-soft:#242b33;--code-dark-text:#e6edf3;--code-dark-text-soft:#c9d1d9;--code-dark-text-muted:#8b949e;--code-dark-accent:#58a6ff;--code-dark-accent-soft:#58a6ff2e;--code-dark-success:#3fb950;--code-dark-warning:#d29922;--code-dark-danger:#f85149;--code-dark-shadow:#01040975;background:var(--code-dark-bg);color:var(--code-dark-text);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}body.code-mode[data-appearance=dark] #root,body.code-mode[data-appearance=dark] .code-app-shell,body.code-mode[data-appearance=dark] .code-workspace,body.code-mode[data-appearance=dark] .code-main,body.code-mode[data-appearance=dark] .code-terminal-grid{background:var(--code-dark-bg);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] ::selection{color:#fff;background:#58a6ff57}body.code-mode[data-appearance=dark] .code-sidebar{background:var(--code-dark-bg-soft);color:var(--code-dark-text);border-right-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-project-row,body.code-mode[data-appearance=dark] .code-pinned-section,body.code-mode[data-appearance=dark] .code-pinned-title{background:var(--code-dark-bg-soft);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-sidebar-resizer{background:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-sidebar-resizer:hover,body.code-resizing-sidebar[data-appearance=dark] .code-sidebar-resizer{background:var(--code-dark-accent)}body.code-mode[data-appearance=dark] .code-sidebar-toggle,body.code-mode[data-appearance=dark] .code-sidebar-focus-toggle,body.code-mode[data-appearance=dark] .code-sidebar-search-toggle,body.code-mode[data-appearance=dark] .code-sidebar-options,body.code-mode[data-appearance=dark] .code-nav-item,body.code-mode[data-appearance=dark] .code-agent-rail-button,body.code-mode[data-appearance=dark] .code-project-agent-compact,body.code-mode[data-appearance=dark] .code-project-title,body.code-mode[data-appearance=dark] .code-project-title-action,body.code-mode[data-appearance=dark] .code-agent-row,body.code-mode[data-appearance=dark] .code-session-show-more,body.code-mode[data-appearance=dark] .code-open-editor-main,body.code-mode[data-appearance=dark] .code-file-row,body.code-mode[data-appearance=dark] .code-file-editor-action,body.code-mode[data-appearance=dark] .code-file-editor-breadcrumb,body.code-mode[data-appearance=dark] .code-composer-add,body.code-mode[data-appearance=dark] .code-composer-mic,body.code-mode[data-appearance=dark] .code-composer-approval,body.code-mode[data-appearance=dark] .code-composer-context-window,body.code-mode[data-appearance=dark] .code-composer-model-picker,body.code-mode[data-appearance=dark] .code-composer-mode-chip,body.code-mode[data-appearance=dark] .code-nav-icon{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-sidebar-toggle,body.code-mode[data-appearance=dark] .code-sidebar-focus-toggle,body.code-mode[data-appearance=dark] .code-sidebar-search-toggle,body.code-mode[data-appearance=dark] .code-sidebar-history-toggle,body.code-mode[data-appearance=dark] .code-sidebar-options{color:var(--code-dark-text-muted);background:#161b22a8}body.code-mode[data-appearance=dark] .code-nav-item:hover,body.code-mode[data-appearance=dark] .code-nav-item.active,body.code-mode[data-appearance=dark] .code-agent-rail-button:hover,body.code-mode[data-appearance=dark] .code-agent-rail-button:focus-visible,body.code-mode[data-appearance=dark] .code-agent-rail-button.active,body.code-mode[data-appearance=dark] .code-project-agent-compact:hover,body.code-mode[data-appearance=dark] .code-project-agent-compact:focus-visible,body.code-mode[data-appearance=dark] .code-project-agent-compact.active,body.code-mode[data-appearance=dark] .code-agent-row:hover,body.code-mode[data-appearance=dark] .code-agent-row.active,body.code-mode[data-appearance=dark] .code-agent-row.search-selected,body.code-mode[data-appearance=dark] .code-project-row:hover .code-project-title,body.code-mode[data-appearance=dark] .code-project-title:hover,body.code-mode[data-appearance=dark] .code-pinned-title:hover,body.code-mode[data-appearance=dark] .code-pinned-title:focus-visible,body.code-mode[data-appearance=dark] .code-open-editor-main:hover,body.code-mode[data-appearance=dark] .code-open-editor-main:focus-visible,body.code-mode[data-appearance=dark] .code-file-row:hover,body.code-mode[data-appearance=dark] .code-file-row.focused,body.code-mode[data-appearance=dark] .code-file-row.selected,body.code-mode[data-appearance=dark] .code-file-row.active,body.code-mode[data-appearance=dark] .code-sidebar-toggle:hover,body.code-mode[data-appearance=dark] .code-sidebar-toggle:focus-visible,body.code-mode[data-appearance=dark] .code-sidebar-focus-toggle:hover,body.code-mode[data-appearance=dark] .code-sidebar-focus-toggle:focus-visible,body.code-mode[data-appearance=dark] .code-sidebar-focus-toggle.active,body.code-mode[data-appearance=dark] .code-sidebar-search-toggle:hover,body.code-mode[data-appearance=dark] .code-sidebar-search-toggle:focus-visible,body.code-mode[data-appearance=dark] .code-sidebar-search-toggle.active,body.code-mode[data-appearance=dark] .code-sidebar-history-toggle:hover,body.code-mode[data-appearance=dark] .code-sidebar-history-toggle:focus-visible,body.code-mode[data-appearance=dark] .code-sidebar-history-toggle.active,body.code-mode[data-appearance=dark] .code-sidebar-options:hover,body.code-mode[data-appearance=dark] .code-sidebar-options:focus-visible,body.code-mode[data-appearance=dark] .code-file-editor-action:hover:not(:disabled),body.code-mode[data-appearance=dark] .code-file-editor-action.active,body.code-mode[data-appearance=dark] .code-file-editor-breadcrumb:hover,body.code-mode[data-appearance=dark] .code-file-editor-breadcrumb:focus-visible,body.code-mode[data-appearance=dark] .code-composer-add:hover,body.code-mode[data-appearance=dark] .code-composer-mic:hover,body.code-mode[data-appearance=dark] .code-composer-approval:hover,body.code-mode[data-appearance=dark] .code-composer-context-window:hover,body.code-mode[data-appearance=dark] .code-composer-model-picker:hover,body.code-mode[data-appearance=dark] .code-composer-mode-chip:hover{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-agent-row-action{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-agent-row-action:hover,body.code-mode[data-appearance=dark] .code-agent-row-action:focus-visible{color:var(--code-dark-text);background:#ffffff1a}body.code-mode[data-appearance=dark] .code-composer-dictation-hint{border-color:var(--code-dark-border);color:var(--code-dark-text-soft);background:#1c1f22e6;box-shadow:0 10px 24px #00000042}body.code-mode[data-appearance=dark] .code-agent-row-action.pin.active{color:#d7c66f}body.code-mode[data-appearance=dark] .code-agent-row-actions{--code-agent-row-action-surface:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-agent-row:hover .code-agent-row-actions,body.code-mode[data-appearance=dark] .code-agent-row.active .code-agent-row-actions,body.code-mode[data-appearance=dark] .code-agent-row.search-selected .code-agent-row-actions{--code-agent-row-action-surface:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .code-project-title-action{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-project-title-action:hover,body.code-mode[data-appearance=dark] .code-project-title-action:focus-visible{color:var(--code-dark-text);background:#ffffff1a}body.code-mode[data-appearance=dark] .code-file-search-box,body.code-mode[data-appearance=dark] .workspace-input input,body.code-mode[data-appearance=dark] .workspace-input select.workflow-select,body.code-mode[data-appearance=dark] .workspace-input textarea.task-input,body.code-mode[data-appearance=dark] .settings-input,body.code-mode[data-appearance=dark] .settings-select,body.code-mode[data-appearance=dark] .code-file-operation-dialog input{background:var(--code-dark-bg-panel);border-color:var(--code-dark-border);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-search-box input,body.code-mode[data-appearance=dark] .code-composer textarea,body.code-mode[data-appearance=dark] .code-composer-mobile-input{color:var(--code-dark-text);caret-color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-search-box input::placeholder,body.code-mode[data-appearance=dark] .code-composer textarea::placeholder,body.code-mode[data-appearance=dark] .code-composer-mobile-input:empty:before,body.code-mode[data-appearance=dark] .workspace-input input::placeholder,body.code-mode[data-appearance=dark] .workspace-input textarea.task-input::placeholder{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-project-list::-webkit-scrollbar-thumb{background:#8b949e52}body.code-mode[data-appearance=dark] .code-file-tree::-webkit-scrollbar-thumb{background:#8b949e52}body.code-mode[data-appearance=dark] .code-terminal-grid::-webkit-scrollbar-thumb{background:#8b949e52}body.code-mode[data-appearance=dark] .code-file-search-results::-webkit-scrollbar-thumb{background:#8b949e52}body.code-mode[data-appearance=dark] .code-file-editor-tabs::-webkit-scrollbar-thumb{background:#8b949e52}body.code-mode[data-appearance=dark] .code-project-list::-webkit-scrollbar-track{background:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-file-tree::-webkit-scrollbar-track{background:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-terminal-grid::-webkit-scrollbar-track{background:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-file-search-results::-webkit-scrollbar-track{background:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-file-editor-tabs::-webkit-scrollbar-track{background:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-file-search-results{border-color:var(--code-dark-border);background:#161b22fa;box-shadow:0 16px 36px #0000006b}body.code-mode[data-appearance=dark] .code-agent-hover-preview{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22fa;box-shadow:0 16px 36px #0000005c}body.code-mode[data-appearance=dark] .code-agent-hover-preview-header span,body.code-mode[data-appearance=dark] .code-agent-hover-preview-icon{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-agent-hover-preview-line,body.code-mode[data-appearance=dark] .code-file-search-result{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-search-result.active,body.code-mode[data-appearance=dark] .code-file-search-result:hover,body.code-mode[data-appearance=dark] .code-file-search-result:focus-visible{background:#8b949e29}body.code-mode[data-appearance=dark] .code-file-search-ignored-action{color:#79c0ff;background:#58a6ff29}body.code-mode[data-appearance=dark] .code-file-search-ignored-action:hover,body.code-mode[data-appearance=dark] .code-file-search-ignored-action:focus-visible{background:#58a6ff42}body.code-mode[data-appearance=dark] .code-file-search-name{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-search-directory,body.code-mode[data-appearance=dark] .code-file-search-kind,body.code-mode[data-appearance=dark] .code-file-search-line{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-side-view-panel{background:var(--code-dark-bg);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-agent-dot.running{background:var(--code-dark-success)}body.code-mode[data-appearance=dark] .code-agent-dot.turn-active{border-color:#3fb9503d;border-top-color:var(--code-dark-success);background:0 0}@media (prefers-reduced-motion:reduce){body.code-mode[data-appearance=dark] .code-agent-dot.turn-active{background:var(--code-dark-success);border:0}}body.code-mode[data-appearance=dark] .code-agent-dot.pending:not(.turn-active){background:var(--code-dark-warning)}body.code-mode[data-appearance=dark] .code-agent-dot.stopped{background:#6e7681}body.code-mode[data-appearance=dark] .code-agent-dot.dead{background:var(--code-dark-danger)}body.code-mode[data-appearance=dark] .code-agent-unread{background:#58a6ff}body.code-mode[data-appearance=dark] .code-project-agent-compact-unread{border-color:var(--code-dark-bg-soft);background:#58a6ff}body.code-mode[data-appearance=dark] .code-project-worktree{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-project-worktree:hover,body.code-mode[data-appearance=dark] .code-project-worktree:focus-visible{color:var(--code-dark-text);background:#8b949e1f}body.code-mode[data-appearance=dark] .code-worktree-popover{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22fa}body.code-mode[data-appearance=dark] .code-worktree-popover-header{border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-worktree-row-heading strong{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-worktree-row:hover,body.code-mode[data-appearance=dark] .code-worktree-row:focus-visible,body.code-mode[data-appearance=dark] .code-worktree-row.current{background:#58a6ff1f}body.code-mode[data-appearance=dark] .code-agent-name,body.code-mode[data-appearance=dark] .code-file-name,body.code-mode[data-appearance=dark] .code-open-editor-name,body.code-mode[data-appearance=dark] .code-project-title-name,body.code-mode[data-appearance=dark] .code-product-mark-main,body.code-mode[data-appearance=dark] .code-usage-row strong,body.code-mode[data-appearance=dark] .code-terminal-title,body.code-mode[data-appearance=dark] .code-empty-workspace h2,body.code-mode[data-appearance=dark] .code-search-panel-header h2,body.code-mode[data-appearance=dark] .code-search-result-copy strong,body.code-mode[data-appearance=dark] .code-history-panel-header h2,body.code-mode[data-appearance=dark] .code-history-card h3{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-agent-meta,body.code-mode[data-appearance=dark] .code-agent-age,body.code-mode[data-appearance=dark] .code-agent-fork-new-worktree,body.code-mode[data-appearance=dark] .code-open-editor-path,body.code-mode[data-appearance=dark] .code-file-search-preview,body.code-mode[data-appearance=dark] .code-file-status,body.code-mode[data-appearance=dark] .code-product-mark-meta,body.code-mode[data-appearance=dark] .code-product-mark-badge,body.code-mode[data-appearance=dark] .code-usage-panel,body.code-mode[data-appearance=dark] .code-usage-header,body.code-mode[data-appearance=dark] .code-usage-subrow,body.code-mode[data-appearance=dark] .code-composer-model-picker-muted,body.code-mode[data-appearance=dark] .code-slash-menu-header,body.code-mode[data-appearance=dark] .code-approval-menu-header,body.code-mode[data-appearance=dark] .code-model-menu-header,body.code-mode[data-appearance=dark] .code-empty-workspace,body.code-mode[data-appearance=dark] .code-search-panel-header span,body.code-mode[data-appearance=dark] .code-search-result-group h3,body.code-mode[data-appearance=dark] .code-search-result-copy span,body.code-mode[data-appearance=dark] .code-history-card p,body.code-mode[data-appearance=dark] .code-history-actions span,body.code-mode[data-appearance=dark] .code-search-panel .code-empty-workspace h2{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-usage-heatmap-cell{background:#58a6ff14}body.code-mode[data-appearance=dark] .code-usage-heatmap-cell[data-level="1"]{background:#58a6ff3d}body.code-mode[data-appearance=dark] .code-usage-heatmap-cell[data-level="2"]{background:#58a6ff6b}body.code-mode[data-appearance=dark] .code-usage-heatmap-cell[data-level="3"]{background:#58a6ffa3}body.code-mode[data-appearance=dark] .code-usage-heatmap-cell[data-level="4"]{background:#58a6ffb8}body.code-mode[data-appearance=dark] .code-usage-heatmap-cell[data-level="5"]{background:#58a6fff0}body.code-mode[data-appearance=dark] .code-usage-heatmap-cell:hover{outline-color:#79baffb3}body.code-mode[data-appearance=dark] .code-usage-activity-heading,body.code-mode[data-appearance=dark] .code-usage-activity-readout{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-search-result{background:var(--code-dark-bg-panel);border-color:var(--code-dark-border);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-search-panel-input{border-color:var(--code-dark-border);color:var(--code-dark-text-muted);background:#161b22c7}body.code-mode[data-appearance=dark] .code-search-panel-input input{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-search-panel-input input::placeholder{color:#6e7681}body.code-mode[data-appearance=dark] .code-search-panel-input button{color:var(--code-dark-text-muted);background:#8b949e1f}body.code-mode[data-appearance=dark] .code-search-result:hover,body.code-mode[data-appearance=dark] .code-search-result.active{background:var(--code-dark-bg-hover);border-color:#58a6ff6b}body.code-mode[data-appearance=dark] .code-history-card{color:var(--code-dark-text);background:0 0;border-color:#0000}body.code-mode[data-appearance=dark] .code-history-card:hover,body.code-mode[data-appearance=dark] .code-history-card.archived:hover{background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .code-history-card:focus-visible{outline-color:#58a6ff57}body.code-mode[data-appearance=dark] .code-history-actions button{color:var(--code-dark-text-muted);background:0 0;border-color:#0000}body.code-mode[data-appearance=dark] .code-history-actions button:hover{background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .code-agents-section,body.code-mode[data-appearance=dark] .code-open-editors,body.code-mode[data-appearance=dark] .code-files-section,body.code-mode[data-appearance=dark] .code-open-editors-header,body.code-mode[data-appearance=dark] .code-files-header,body.code-mode[data-appearance=dark] .code-file-sticky-shell,body.code-mode[data-appearance=dark] .code-file-sticky-stack,body.code-mode[data-appearance=dark] .code-file-row.code-file-sticky-row{background:var(--code-dark-bg-soft);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-open-editors-header,body.code-mode[data-appearance=dark] .code-files-header,body.code-mode[data-appearance=dark] .code-usage-panel,body.code-mode[data-appearance=dark] .code-usage-provider{border-color:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-files-title,body.code-mode[data-appearance=dark] .code-open-editors-title{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-files-refresh{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-files-refresh:hover,body.code-mode[data-appearance=dark] .code-files-refresh:focus-visible{background:var(--code-dark-bg-hover);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-files-refresh[data-refresh-status=success]{color:var(--code-dark-success);background:#3fb95024}body.code-mode[data-appearance=dark] .code-files-refresh[data-refresh-status=error]{color:var(--code-dark-danger);background:#f851491f}body.code-mode[data-appearance=dark] .code-file-type-icon,body.code-mode[data-appearance=dark] .code-file-chevron,body.code-mode[data-appearance=dark] .code-file-section-chevron,body.code-mode[data-appearance=dark] .code-folder-icon,body.code-mode[data-appearance=dark] .code-file-search-icon{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-row.ignored,body.code-mode[data-appearance=dark] .code-file-row.ignored .code-file-name,body.code-mode[data-appearance=dark] .code-file-row.ignored .code-file-chevron{color:#6e7681}body.code-mode[data-appearance=dark] .code-file-row.editor-dirty .code-file-name{color:var(--code-dark-warning)}body.code-mode[data-appearance=dark] .code-file-row.editor-external-changed .code-file-name{color:var(--code-dark-accent)}body.code-mode[data-appearance=dark] .code-file-row.git-status .code-file-name{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-row.git-deleted .code-file-name,body.code-mode[data-appearance=dark] .code-file-row.git-conflicted .code-file-name,body.code-mode[data-appearance=dark] .code-file-row.git-conflicted .code-file-name{color:#ff7b72}body.code-mode[data-appearance=dark] .code-file-row.selected:not(.active){background:var(--code-dark-accent-soft)}body.code-mode[data-appearance=dark] .code-file-tree-viewport:focus-within .code-file-row.located.selected{color:#ffd8cc;background:#d977573d;box-shadow:inset 3px 0 #e58a6be0}body.code-mode[data-appearance=dark] .code-file-row.active{background:var(--code-dark-bg-active)}body.code-mode[data-appearance=dark] .code-file-row.active:after{background:var(--code-dark-accent)}body.code-mode[data-appearance=dark] .code-file-changed{background:var(--code-dark-warning)}body.code-mode[data-appearance=dark] .code-file-changed.external{background:var(--code-dark-accent)}body.code-mode[data-appearance=dark] .code-file-descendant-status.dirty,body.code-mode[data-appearance=dark] .code-file-descendant-status.modified{background:var(--code-dark-warning)}body.code-mode[data-appearance=dark] .code-file-descendant-status.external{background:var(--code-dark-accent)}body.code-mode[data-appearance=dark] .code-file-descendant-status.added{background:var(--code-dark-success)}body.code-mode[data-appearance=dark] .code-file-descendant-status.renamed{background:#a371f7}body.code-mode[data-appearance=dark] .code-file-descendant-status.deleted,body.code-mode[data-appearance=dark] .code-file-descendant-status.conflicted{background:var(--code-dark-danger)}body.code-mode[data-appearance=dark] .code-file-git-status.modified,body.code-mode[data-appearance=dark] .code-file-change-status.modified{color:var(--code-dark-warning)}body.code-mode[data-appearance=dark] .code-file-git-status.added,body.code-mode[data-appearance=dark] .code-file-change-status.added{color:var(--code-dark-success)}body.code-mode[data-appearance=dark] .code-file-git-status.renamed,body.code-mode[data-appearance=dark] .code-file-change-status.renamed{color:#a371f7}body.code-mode[data-appearance=dark] .code-file-git-status.deleted,body.code-mode[data-appearance=dark] .code-file-git-status.conflicted,body.code-mode[data-appearance=dark] .code-file-change-status.deleted,body.code-mode[data-appearance=dark] .code-file-change-status.conflicted{color:var(--code-dark-danger)}body.code-mode[data-appearance=dark] .code-file-change-row.active{background:var(--code-dark-bg-active)}body.code-mode[data-appearance=dark] .code-file-open-spinner{border-color:#8b949e47;border-top-color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-file-change-main,body.code-mode[data-appearance=dark] .code-file-change-status,body.code-mode[data-appearance=dark] .code-file-change-status.modified,body.code-mode[data-appearance=dark] .code-file-change-group-toggle{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-git-history-section{--code-git-history-node-bg:var(--code-dark-bg);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-git-history-header,body.code-mode[data-appearance=dark] .code-git-history-subject,body.code-mode[data-appearance=dark] .code-git-history-change,body.code-mode[data-appearance=dark] .code-git-history-parent-select select{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-git-history-header{background:var(--code-dark-bg)}body.code-mode[data-appearance=dark] .code-git-history-entry.selected,body.code-mode[data-appearance=dark] .code-git-history-commit:hover,body.code-mode[data-appearance=dark] .code-git-history-commit:focus-visible,body.code-mode[data-appearance=dark] button.code-git-history-change:hover,body.code-mode[data-appearance=dark] button.code-git-history-change:focus-visible,body.code-mode[data-appearance=dark] .code-git-history-refresh:hover,body.code-mode[data-appearance=dark] .code-git-history-refresh:focus-visible{background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .code-git-history-meta,body.code-mode[data-appearance=dark] .code-git-history-change-previous,body.code-mode[data-appearance=dark] .code-git-history-change-summary,body.code-mode[data-appearance=dark] .code-git-history-root-label,body.code-mode[data-appearance=dark] .code-git-history-status,body.code-mode[data-appearance=dark] .code-git-history-reference-more{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-git-history-parent-select select{border-color:var(--code-dark-border);background:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-git-history-scope:hover,body.code-mode[data-appearance=dark] .code-git-history-scope:focus-visible,body.code-mode[data-appearance=dark] .code-git-history-scope[aria-expanded=true]{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-git-history-scope-menu{border-color:var(--code-dark-border);color:var(--code-dark-text-soft);background:#161b22fa}body.code-mode[data-appearance=dark] .code-git-history-scope-menu button:hover,body.code-mode[data-appearance=dark] .code-git-history-scope-menu button:focus-visible{background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .code-git-history-message{border-left-color:var(--code-dark-border-strong);background:var(--code-dark-bg-soft)}body.code-mode[data-appearance=dark] .code-git-history-message-label{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-git-history-message-body{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-git-history-reference,body.code-mode[data-appearance=dark] .code-git-history-branch,body.code-mode[data-appearance=dark] .code-git-history-scope{color:#8faed8}body.code-mode[data-appearance=dark] .code-git-history-reference.tag{color:#d2b47c}body.code-mode[data-appearance=dark] .code-git-history-reference.remote-branch{color:#69c5bd}body.code-mode[data-appearance=dark] .code-git-history-review,body.code-mode[data-appearance=dark] .code-git-history-load-more{color:#8faed8}body.code-mode[data-appearance=dark] .code-git-history-review:hover,body.code-mode[data-appearance=dark] .code-git-history-review:focus-visible{background:var(--code-dark-bg-hover);color:#b7cff0}body.code-mode[data-appearance=dark] .code-git-history-status.error{color:var(--code-dark-danger)}body.code-mode[data-appearance=dark] .code-file-change-review{color:#8faed8}body.code-mode[data-appearance=dark] .code-file-change-review:hover,body.code-mode[data-appearance=dark] .code-file-change-review:focus-visible{color:#b7cff0}body.code-mode[data-appearance=dark] .code-file-change-path,body.code-mode[data-appearance=dark] .code-file-change-group-toggle>span:last-child,body.code-mode[data-appearance=dark] .code-file-changes-count{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-change-main:hover,body.code-mode[data-appearance=dark] .code-file-change-main:focus-visible,body.code-mode[data-appearance=dark] .code-file-change-group-toggle:hover,body.code-mode[data-appearance=dark] .code-file-change-group-toggle:focus-visible{background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .code-product-mark{color:var(--code-dark-text-soft);background:0 0}body.code-mode[data-appearance=dark] .code-product-mark:hover,body.code-mode[data-appearance=dark] .code-product-mark:focus-visible{background:0 0}body.code-mode[data-appearance=dark] .code-product-mark-badge{color:var(--code-dark-text-muted);background:0 0;border-color:#0000}body.code-mode[data-appearance=dark] .code-product-mark:hover .code-product-mark-badge,body.code-mode[data-appearance=dark] .code-product-mark:focus-visible .code-product-mark-badge{color:var(--code-dark-text-soft);background:0 0;border-color:#0000}body.code-mode[data-appearance=dark] .code-share-button{color:var(--code-dark-text-muted);background:#161b22a8}:is(body.code-mode[data-appearance=dark] .code-share-button:hover,body.code-mode[data-appearance=dark] .code-share-button:focus-visible,body.code-mode[data-appearance=dark] .code-share-root:has(.code-share-popover) .code-share-button){background:var(--code-dark-bg-hover);color:var(--code-dark-text);box-shadow:inset 0 0 0 1px var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-share-popover{border-color:var(--code-dark-border);color:var(--code-dark-text);box-shadow:0 18px 54px var(--code-dark-shadow);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;background:#1c2129fa}body.code-mode[data-appearance=dark] .code-share-qr-frame{border-color:var(--code-dark-border);background:linear-gradient(#fffffff2,#fbfaf2f2),#fbfaf2}body.code-mode[data-appearance=dark] .code-share-copy-action{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-share-countdown{color:#9b7a35}body.code-mode[data-appearance=dark] .code-share-copy-token{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22b8}body.code-mode[data-appearance=dark] .code-share-copy-token:hover,body.code-mode[data-appearance=dark] .code-share-copy-token:focus-visible{background:var(--code-dark-bg-hover);border-color:#58a6ff3d}body.code-mode[data-appearance=dark] .code-share-token{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-share-qr-loading,body.code-mode[data-appearance=dark] .code-share-copy-action{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-share-refresh{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22e6}body.code-mode[data-appearance=dark] .code-share-error{color:var(--code-dark-danger)}body.code-mode[data-appearance=dark] .code-mobile-share-backdrop{background:#0104098a}body.code-mode[data-appearance=dark] .code-mobile-share-sheet{border-color:var(--code-dark-border);color:var(--code-dark-text);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;background:#161b22f7;box-shadow:0 20px 56px #0104097a}body.code-mode[data-appearance=dark] .code-mobile-share-header button,body.code-mode[data-appearance=dark] .code-mobile-share-choice-copy p,body.code-mode[data-appearance=dark] .code-mobile-share-link,body.code-mode[data-appearance=dark] .code-mobile-share-status,body.code-mode[data-appearance=dark] .code-mobile-install-hint,body.code-mode[data-appearance=dark] .code-mobile-install-complete,body.code-mode[data-appearance=dark] .code-mobile-install-step small{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-mobile-share-choice+.code-mobile-share-choice{border-color:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-mobile-share-link-row{background:#f0f6fc0e}body.code-mode[data-appearance=dark] .code-mobile-share-link-row button{color:var(--code-dark-text);background:#f0f6fc17}body.code-mode[data-appearance=dark] .code-mobile-install-step{color:var(--code-dark-text);background:#f0f6fc0e}body.code-mode[data-appearance=dark] .code-mobile-install-control{color:var(--code-dark-text);background:#f0f6fc17}body.code-mode[data-appearance=dark] .code-brand-backdrop{background:#01040994}body.code-mode[data-appearance=dark] .code-brand-dialog{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22fa;box-shadow:0 24px 68px #01040985}body.code-mode[data-appearance=dark] .code-brand-close,body.code-mode[data-appearance=dark] .code-brand-heading span,body.code-mode[data-appearance=dark] .code-brand-story{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-brand-close:hover,body.code-mode[data-appearance=dark] .code-brand-close:focus-visible{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-brand-github{color:#8cbcff}body.code-mode[data-appearance=dark].code-mobile-touch .code-options-menu,body.code-mode[data-appearance=dark].code-mobile-touch .code-options-menu button,body.code-mode[data-appearance=dark].code-mobile-touch .code-options-menu button:focus,body.code-mode[data-appearance=dark].code-mobile-touch .code-options-menu button:focus-visible{color:var(--code-dark-text)}body.code-mode[data-appearance=dark].code-mobile-touch .code-options-menu{background:#161b22f0}body.code-mode[data-appearance=dark] .code-terminal-pane,body.code-mode[data-appearance=dark] .code-terminal-container,body.code-mode[data-appearance=dark] .terminal-session-host,body.code-mode[data-appearance=dark] .terminal-session-host .xterm,body.code-mode[data-appearance=dark] .terminal-session-host .xterm-screen,body.code-mode[data-appearance=dark] .terminal-session-host .xterm-viewport{color:var(--code-dark-text);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;background:var(--code-dark-bg)!important}body.code-mode[data-appearance=dark] .code-terminal-pane{border-color:#0000}body.code-mode[data-appearance=dark] .terminal-session-host .xterm .xterm-selection div{background-color:#58a6ff52!important}body.code-mode[data-appearance=dark] .terminal-session-host .xterm .xterm-rows ::selection{background:#58a6ff52}body.code-mode[data-appearance=dark] .terminal-session-host .xterm-viewport{scrollbar-color:#8b949e2e transparent}body.code-mode[data-appearance=dark] .terminal-session-host .xterm-viewport::-webkit-scrollbar{width:6px;background:0 0!important}body.code-mode[data-appearance=dark] .terminal-session-host .xterm-viewport::-webkit-scrollbar-thumb{background-color:#8b949e2e!important;border-color:#0000!important}body.code-mode[data-appearance=dark] .terminal-session-host .xterm-viewport::-webkit-scrollbar-track{background:0 0!important}body.code-mode[data-appearance=dark] .terminal-session-host .xterm-viewport::-webkit-scrollbar-thumb:hover{background-color:#8b949e4d!important}body.code-mode[data-appearance=dark] .code-terminal-jump-bottom{color:#ffffffeb;box-shadow:none;-webkit-backdrop-filter:blur(12px);background:#ffffff0e;border-color:#f0f6fc21}body.code-mode[data-appearance=dark] .code-terminal-jump-bottom:hover{color:#fff;background:#ffffff16;border-color:#f0f6fc33}body.code-mode[data-appearance=dark] .code-terminal-search{border-color:var(--code-dark-border);color:var(--code-dark-text);box-shadow:0 12px 32px var(--code-dark-shadow);background:#161b22f5}body.code-mode[data-appearance=dark] .code-terminal-search input:focus{background:#21262df2;box-shadow:inset 0 0 0 1px #58a6ff80}body.code-mode[data-appearance=dark] .code-terminal-search-status{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-terminal-search-status.empty{color:#ff7b72}body.code-mode[data-appearance=dark] .code-terminal-search-button{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-terminal-search-button:hover,body.code-mode[data-appearance=dark] .code-terminal-search-button:focus-visible{color:var(--code-dark-text);background:#8b949e29}body.code-mode[data-appearance=dark] .code-terminal-search-button.option.active{color:var(--code-dark-accent);background:#58a6ff29}body.code-mode[data-appearance=dark] .code-terminal-status-card{border-color:var(--code-dark-border);color:var(--code-dark-text-soft);box-shadow:0 12px 32px var(--code-dark-shadow);background:#161b22f5}body.code-mode[data-appearance=dark] .code-terminal-status-card button{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#21262df2}body.code-mode[data-appearance=dark] .code-terminal-status-card button:hover,body.code-mode[data-appearance=dark] .code-terminal-status-card button:focus-visible{background:#30363df2}body.code-mode[data-appearance=dark] .code-terminal-mode-toggle{background:#161b2266;border-color:#8b949e14;box-shadow:0 8px 22px #01040933}body.code-mode[data-appearance=dark] .code-terminal-mode-toggle:hover,body.code-mode[data-appearance=dark] .code-terminal-mode-toggle:focus-within{background:#161b22d1;border-color:#8b949e33;box-shadow:0 10px 26px #01040952}body.code-mode[data-appearance=dark] .code-terminal-mode-toggle button{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-terminal-mode-toggle button:hover,body.code-mode[data-appearance=dark] .code-terminal-mode-toggle button:focus-visible{color:var(--code-dark-text);background:#8b949e29}body.code-mode[data-appearance=dark] .code-terminal-mode-toggle button.active{color:var(--code-dark-text);background:#8b949e24}body.code-mode[data-appearance=dark] .code-permission-switching{color:var(--code-dark-text-soft);background:#0d1117b8}body.code-mode[data-appearance=dark] .code-permission-switching-spinner{border-color:#c9d1d93d;border-top-color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-codex-transcript,body.code-mode[data-appearance=dark] .code-acp-transcript{background:var(--code-dark-bg);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-acp-user-text{color:var(--code-dark-text);background:#8b949e29;border:1px solid #8b949e1f}body.code-mode[data-appearance=dark] .code-acp-message.assistant{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-acp-message.assistant.notification,body.code-mode[data-appearance=dark] .code-acp-activity,body.code-mode[data-appearance=dark] .code-acp-working,body.code-mode[data-appearance=dark] .code-acp-load-earlier{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-acp-activity>summary:hover,body.code-mode[data-appearance=dark] .code-acp-activity>summary:focus-visible,body.code-mode[data-appearance=dark] .code-acp-activity-group>summary:hover,body.code-mode[data-appearance=dark] .code-acp-activity-group>summary:focus-visible{background:#8b949e1a}body.code-mode[data-appearance=dark] .code-acp-activity-group{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-acp-activity-count{color:var(--code-dark-text-muted);background:#8b949e1f}body.code-mode[data-appearance=dark] .code-acp-activity-detail{border-color:var(--code-dark-border);color:var(--code-dark-text-soft);background:#161b22cc}body.code-mode[data-appearance=dark] .code-acp-jump-bottom{border-color:var(--code-dark-border);color:var(--code-dark-text-soft);background:#161b22f0}body.code-mode[data-appearance=dark] .code-codex-transcript-scroll{scrollbar-color:#8b949e2e transparent}body.code-mode[data-appearance=dark] .code-codex-transcript-scroll::-webkit-scrollbar-thumb{background:#8b949e2e}body.code-mode[data-appearance=dark] .code-codex-goal-bar{box-shadow:0 10px 30px var(--code-dark-shadow);background:#161b22c2;border-color:#8b949e3d}body.code-mode[data-appearance=dark] .code-codex-goal-input{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-goal-input::placeholder,body.code-mode[data-appearance=dark] .code-codex-goal-icon-button{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-codex-goal-icon-button:hover,body.code-mode[data-appearance=dark] .code-codex-goal-icon-button:focus-visible{color:var(--code-dark-text);background:#8b949e29}body.code-mode[data-appearance=dark] .code-codex-goal-icon-button.danger,body.code-mode[data-appearance=dark] .code-codex-goal-error{color:#ff7b72}body.code-mode[data-appearance=dark] .code-codex-transcript-user{color:var(--code-dark-text);background:#8b949e29;border:1px solid #8b949e1f}body.code-mode[data-appearance=dark] .code-codex-transcript-user-images img,body.code-mode[data-appearance=dark] .code-codex-transcript-process-images img,body.code-mode[data-appearance=dark] .code-codex-transcript-result-images img{border-color:var(--code-dark-border);background:var(--code-dark-bg-panel)}body.code-mode[data-appearance=dark] .code-codex-transcript-user-file{border-color:var(--code-dark-border);background:#8b949e1f}body.code-mode[data-appearance=dark] .code-codex-transcript-resource-link>a,body.code-mode[data-appearance=dark] .code-codex-transcript-resource-link>span:not(.code-codex-transcript-user-file-meta),body.code-mode[data-appearance=dark] .code-codex-transcript-subagent-turn .user{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-transcript-terminal,body.code-mode[data-appearance=dark] .code-codex-transcript-subagent,body.code-mode[data-appearance=dark] .code-codex-transcript-subagent-dialog{border-color:var(--code-dark-border);background:var(--code-dark-bg-panel)}body.code-mode[data-appearance=dark] .code-codex-transcript-terminal>header,body.code-mode[data-appearance=dark] .code-codex-transcript-terminal-meta,body.code-mode[data-appearance=dark] .code-codex-transcript-subagent>header,body.code-mode[data-appearance=dark] .code-codex-transcript-subagent-dialog>header,body.code-mode[data-appearance=dark] .code-codex-transcript-subagent-turn{border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-codex-transcript-terminal-copy:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-terminal-copy:focus-visible,body.code-mode[data-appearance=dark] .code-codex-transcript-subagent-control:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-subagent-control:focus-visible{background:#8b949e29}body.code-mode[data-appearance=dark] .code-codex-transcript-subagent-error{color:#ff7b72;background:#f851491a;border-color:#f8514957}body.code-mode[data-appearance=dark] .code-codex-transcript-user-file-name{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-transcript-user-file-meta{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-codex-transcript-user-file pre,body.code-mode[data-appearance=dark] .code-codex-transcript-user-file-error{border-top-color:var(--code-dark-border);background:var(--code-dark-bg-panel)}body.code-mode[data-appearance=dark] .code-codex-transcript-process{border-bottom-color:var(--code-dark-border);color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-acp-progress-update{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-transcript-process-title,body.code-mode[data-appearance=dark] .code-codex-transcript-process-group{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-codex-transcript-process-group-summary:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-process-group-summary:focus-visible,body.code-mode[data-appearance=dark] .code-codex-transcript-process-title-toggle:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-process-title-toggle:focus-visible{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-codex-transcript-process-dot{background:#8b949eb8}body.code-mode[data-appearance=dark] .code-codex-transcript-process-status{color:var(--code-dark-text-muted);background:#8b949e24}body.code-mode[data-appearance=dark] .code-codex-transcript-copy{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-codex-transcript-copy:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-copy.copied,body.code-mode[data-appearance=dark] .code-codex-transcript-copy:focus-visible{color:var(--code-dark-text);background:#8b949e29}body.code-mode[data-appearance=dark] .code-codex-transcript-copy:after,body.code-mode[data-appearance=dark] .code-codex-transcript-answer-action:after{border-color:var(--code-dark-border-soft);color:var(--code-dark-text);background:#161b22fa;box-shadow:0 8px 24px #01040973}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item pre{border:1px solid var(--code-dark-border-soft);color:var(--code-dark-text-muted);background:#0d1117d1}body.code-mode[data-appearance=dark] .code-codex-transcript-process-detail,body.code-mode[data-appearance=dark] .code-codex-transcript-answer-action{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-codex-transcript-answer-action:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-answer-action.copied,body.code-mode[data-appearance=dark] .code-codex-transcript-answer-action:focus-visible{color:var(--code-dark-text);background:#8b949e29}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview,body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview strong{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview code,body.code-mode[data-appearance=dark] .code-codex-transcript-file-link{color:var(--code-dark-accent);background:#58a6ff24}body.code-mode[data-appearance=dark] .code-codex-transcript-file-link:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-file-link:focus-visible{color:var(--code-dark-accent);background:#58a6ff2e}body.code-mode[data-appearance=dark] .code-codex-transcript-markdown-file-link{color:var(--code-dark-accent)}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview blockquote{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview blockquote:after{background:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview pre{border-color:var(--code-dark-border);background:#0d1117d1}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview hr{border-top-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview th{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview th,body.code-mode[data-appearance=dark] .code-codex-transcript-assistant.code-markdown-preview td{border-bottom-color:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-codex-transcript-plan-list li{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-codex-transcript-plan-marker{border-color:#8b949e80}body.code-mode[data-appearance=dark] .code-codex-transcript-plan-list li.completed .code-codex-transcript-plan-marker{background:#3fb950;border-color:#3fb950}body.code-mode[data-appearance=dark] .code-codex-transcript-plan-list li.running .code-codex-transcript-plan-marker{border-color:var(--code-dark-text-muted);border-top-color:#0000}body.code-mode[data-appearance=dark] .code-codex-transcript-result-summary{border-color:var(--code-dark-border);color:var(--code-dark-text-muted);background:#161b22b8;box-shadow:0 1px #ffffff08}body.code-mode[data-appearance=dark] .code-codex-transcript-result-summary .added{color:#3fb950}body.code-mode[data-appearance=dark] .code-codex-transcript-result-summary .removed{color:#ff7b72}body.code-mode[data-appearance=dark] button.code-codex-transcript-result-summary:hover,body.code-mode[data-appearance=dark] button.code-codex-transcript-result-summary:focus-visible{color:var(--code-dark-text);background:#8b949e2e}body.code-mode[data-appearance=dark] .code-codex-transcript-result-details{border-color:var(--code-dark-border);background:#161b22f5;box-shadow:0 8px 28px #00000047}body.code-mode[data-appearance=dark] .code-codex-transcript-result-file+.code-codex-transcript-result-file,body.code-mode[data-appearance=dark] .code-codex-transcript-result-diff,body.code-mode[data-appearance=dark] .code-codex-transcript-result-loading,body.code-mode[data-appearance=dark] .code-codex-transcript-result-error{border-color:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-codex-transcript-result-file>summary{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-codex-transcript-result-file>summary:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-result-review:hover,body.code-mode[data-appearance=dark] .code-codex-transcript-result-review:focus-visible{background:#8b949e24}body.code-mode[data-appearance=dark] .code-codex-transcript-result-diff{color:var(--code-dark-text-muted);background:#0d1117}body.code-mode[data-appearance=dark] .code-codex-transcript-result-review{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22e6}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.command .code-codex-transcript-process-dot{background:#3fb950}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.patch .code-codex-transcript-process-dot{background:#a371f7}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.mcp .code-codex-transcript-process-dot,body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.tool .code-codex-transcript-process-dot,body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.tool-output .code-codex-transcript-process-dot{background:#58a6ff}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.reasoning .code-codex-transcript-process-dot,body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.plan .code-codex-transcript-process-dot{background:#d29922}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.web-search .code-codex-transcript-process-dot{background:#39c5cf}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.status-running .code-codex-transcript-process-dot,body.code-mode[data-appearance=dark] .code-codex-transcript-process-group.running>.code-codex-transcript-process-group-summary>.code-codex-transcript-process-dot{border-color:var(--code-dark-text-muted);background:0 0;border-top-color:#0000}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.status-failed .code-codex-transcript-process-dot,body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.error .code-codex-transcript-process-dot{background:#ff7b72}body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.status-warning .code-codex-transcript-process-dot,body.code-mode[data-appearance=dark] .code-codex-transcript-process-item.warning .code-codex-transcript-process-dot{background:#d29922}body.code-mode[data-appearance=dark] .code-codex-transcript-state,body.code-mode[data-appearance=dark] .code-codex-transcript-placeholder,body.code-mode[data-appearance=dark] .code-codex-transcript-state.error{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-codex-transcript-jump-bottom{color:#ffffffeb;box-shadow:none;-webkit-backdrop-filter:blur(12px);background:#ffffff0e;border-color:#f0f6fc21}body.code-mode[data-appearance=dark] .code-codex-transcript-jump-bottom:hover{color:#fff;background:#ffffff16;border-color:#f0f6fc33}body.code-mode[data-appearance=dark] .code-file-editor{background:var(--code-dark-bg);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-editor-header,body.code-mode[data-appearance=dark] .code-file-editor-bar,body.code-mode[data-appearance=dark] .code-file-editor-statusbar{background:var(--code-dark-bg-panel);border-color:var(--code-dark-border);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-file-editor-tab-strip{background:var(--code-dark-bg-soft);border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-file-editor-navigation{border-color:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-file-editor-navigation-divider{background:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-file-editor-tab{border-color:var(--code-dark-border-soft);color:var(--code-dark-text-soft);background:0 0}body.code-mode[data-appearance=dark] .code-file-editor-tab.active{background:var(--code-dark-bg);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-editor-tab:hover:not(.active){background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .code-file-editor-close,body.code-mode[data-appearance=dark] .code-open-editor-close{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-editor-close:hover,body.code-mode[data-appearance=dark] .code-open-editor-close:hover{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-editor-fallback-textarea,body.code-mode[data-appearance=dark] .code-file-monaco,body.code-mode[data-appearance=dark] .code-file-editor-split,body.code-mode[data-appearance=dark] .code-file-editor-source-region,body.code-mode[data-appearance=dark] .code-file-diff-view,body.code-mode[data-appearance=dark] .code-file-diff-monaco,body.code-mode[data-appearance=dark] .code-file-preview-panel{background:var(--code-dark-bg);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-editor-split.markdown .code-file-monaco,body.code-mode[data-appearance=dark] .code-file-editor-source-region.markdown-split .code-file-monaco{border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-file-diff-header,body.code-mode[data-appearance=dark] .code-file-diff-state{background:var(--code-dark-bg-panel);border-color:var(--code-dark-border);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-file-diff-title{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-diff-title span,body.code-mode[data-appearance=dark] .code-file-diff-close{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-diff-close:hover,body.code-mode[data-appearance=dark] .code-file-diff-close:focus-visible{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-diff-state.error{color:#ff7b72}body.code-mode[data-appearance=dark] .code-file-preview-panel.metadata{background:linear-gradient(#161b22e0,#0d1117f5)}body.code-mode[data-appearance=dark] .code-markdown-preview,body.code-mode[data-appearance=dark] .code-markdown-preview h1,body.code-mode[data-appearance=dark] .code-markdown-preview h2,body.code-mode[data-appearance=dark] .code-markdown-preview h3,body.code-mode[data-appearance=dark] .code-markdown-preview h4,body.code-mode[data-appearance=dark] .code-markdown-preview h5,body.code-mode[data-appearance=dark] .code-markdown-preview h6{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-markdown-preview h1,body.code-mode[data-appearance=dark] .code-markdown-preview h2{border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-markdown-preview a{color:#79c0ff}body.code-mode[data-appearance=dark] .code-markdown-heading-anchor{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-markdown-preview blockquote{color:var(--code-dark-text-muted);border-color:#30363d}body.code-mode[data-appearance=dark] .code-markdown-preview code{color:var(--code-dark-text);background:#6e768152}body.code-mode[data-appearance=dark] .code-markdown-preview pre,body.code-mode[data-appearance=dark] .code-markdown-preview th{background:#161b22}body.code-mode[data-appearance=dark] .code-markdown-preview pre[data-language]:before{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-markdown-preview .katex{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-comment,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-quote{color:#8b949e}body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-keyword,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-selector-tag,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-subst{color:#ff7b72}body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-literal,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-number,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-tag .hljs-attr,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-template-variable,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-variable{color:#79c0ff}body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-doctag,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-string{color:#a5d6ff}body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-section,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-selector-id,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-title{color:#d2a8ff}body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-attr,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-attribute,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-name,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-selector-class,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-selector-pseudo,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-tag{color:#7ee787}body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-built_in,body.code-mode[data-appearance=dark] .code-markdown-preview .hljs-symbol{color:#ffa657}body.code-mode[data-appearance=dark] .code-markdown-preview .code-markdown-frontmatter,body.code-mode[data-appearance=dark] .code-markdown-preview .code-markdown-frontmatter th,body.code-mode[data-appearance=dark] .code-markdown-preview .code-markdown-frontmatter td{border-color:#30363d}body.code-mode[data-appearance=dark] .code-markdown-preview .code-markdown-frontmatter th{color:var(--code-dark-text-muted);background:#161b22}body.code-mode[data-appearance=dark] .code-markdown-preview .code-markdown-frontmatter.error{color:#ff7b72;background:#161b22e6;border-color:#f851496b}body.code-mode[data-appearance=dark] .code-markdown-mermaid{background:#0d1117;border-color:#30363d}body.code-mode[data-appearance=dark] .code-markdown-mermaid-toolbar{background:#161b22eb;border-color:#30363d;box-shadow:0 8px 24px #01040952}body.code-mode[data-appearance=dark] .code-markdown-mermaid-toolbar button{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-markdown-mermaid-toolbar button:hover:not(:disabled),body.code-mode[data-appearance=dark] .code-markdown-mermaid-toolbar button:focus-visible{color:var(--code-dark-text);background:#6e76813d}body.code-mode[data-appearance=dark] .code-markdown-mermaid-toolbar button[aria-pressed=true]{color:#58a6ff;background:#388bfd33}body.code-mode[data-appearance=dark] .code-markdown-mermaid-loading{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-markdown-mermaid.error{background:#161b22e6;border-color:#f851496b}body.code-mode[data-appearance=dark] .code-markdown-mermaid-error-title{color:#ff7b72}body.code-mode[data-appearance=dark] .code-markdown-mermaid-error-message{color:var(--code-dark-text-muted);background:#0d1117c2;border-color:#f8514947}body.code-mode[data-appearance=dark] .code-markdown-preview th,body.code-mode[data-appearance=dark] .code-markdown-preview td{border-color:#30363d}body.code-mode[data-appearance=dark] .code-markdown-preview tr:nth-child(2n){background:#161b22c2}body.code-mode[data-appearance=dark] .code-markdown-preview hr{background:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-file-inline-blame{color:var(--code-dark-text-soft);background:#58a6ff38}body.code-mode[data-appearance=dark] .code-file-inline-blame:hover,body.code-mode[data-appearance=dark] .code-file-inline-blame:focus-visible{color:var(--code-dark-text);background:#58a6ff52}body.code-mode[data-appearance=dark] .code-file-inline-blame.uncommitted{color:#f0c674;background:#d2992238}body.code-mode[data-appearance=dark] .code-file-blame-toast{border-color:var(--code-dark-border);color:var(--code-dark-text-soft);box-shadow:0 12px 32px var(--code-dark-shadow);background:#1c2129f5}body.code-mode[data-appearance=dark] .code-file-blame-toast.error{color:#ff7b72;border-color:#f851495c}body.code-mode[data-appearance=dark] .code-file-blame-detail{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22f5;box-shadow:inset 0 1px #ffffff0a}body.code-mode[data-appearance=dark] .code-file-blame-detail-title code,body.code-mode[data-appearance=dark] .code-file-blame-detail-subtitle,body.code-mode[data-appearance=dark] .code-file-blame-detail-row span{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-blame-detail-row strong,body.code-mode[data-appearance=dark] .code-file-blame-detail-row a{color:var(--code-dark-accent)}body.code-mode[data-appearance=dark] .code-file-blame-detail-close{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-blame-detail-close:hover,body.code-mode[data-appearance=dark] .code-file-blame-detail-close:focus-visible{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-file-line-changes-panel{border-color:var(--code-dark-border);color:var(--code-dark-text);background:#161b22f5;box-shadow:inset 0 1px #ffffff0a}body.code-mode[data-appearance=dark] .code-file-line-changes-title code,body.code-mode[data-appearance=dark] .code-file-line-changes-subtitle,body.code-mode[data-appearance=dark] .code-file-line-changes-state{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-line-changes-state.error{color:#ff7b72}body.code-mode[data-appearance=dark] .code-file-line-changes-patch{border-color:var(--code-dark-border);background:#0d1117ad}body.code-mode[data-appearance=dark] .code-file-line-changes-line.meta{color:#8b949e;background:#7986cb24}body.code-mode[data-appearance=dark] .code-file-line-changes-line.added{color:#7ee787;background:#2ea0432e}body.code-mode[data-appearance=dark] .code-file-line-changes-line.deleted{color:#ff7b72;background:#f8514929}body.code-mode[data-appearance=dark] .code-file-line-changes-close{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-file-line-changes-close:hover,body.code-mode[data-appearance=dark] .code-file-line-changes-close:focus-visible{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-composer{color:var(--code-dark-text);-webkit-backdrop-filter:blur(20px)saturate(1.12);background:#161b22d1;border-color:#f0f6fc1a;box-shadow:0 12px 30px #01040933,inset 0 0 0 1px #f0f6fc0f}body.code-mode[data-appearance=dark] .code-composer-collapse,body.code-mode[data-appearance=dark] .code-composer-restore{border-color:var(--code-dark-border);color:var(--code-dark-text-muted);background:#161b22db;box-shadow:0 12px 30px #01040947}body.code-mode[data-appearance=dark] .code-composer-collapse:hover,body.code-mode[data-appearance=dark] .code-composer-collapse:focus-visible,body.code-mode[data-appearance=dark] .code-composer-restore:hover,body.code-mode[data-appearance=dark] .code-composer-restore:focus-visible{background:var(--code-dark-bg-hover);color:var(--code-dark-text);border-color:#8b949e57}body.code-mode[data-appearance=dark] .code-composer.menu-open{border-color:#58a6ff6b}body.code-mode[data-appearance=dark] .code-composer-send{background:var(--code-dark-text-soft);color:var(--code-dark-bg)}body.code-mode[data-appearance=dark] .code-composer-send:disabled{color:#f0f6fc61;background:#f0f6fc1f}body.code-mode[data-appearance=dark] .code-composer-send:not(:disabled):hover{background:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-composer-send.interrupt{background:var(--code-dark-danger);color:#fff}body.code-mode[data-appearance=dark] .code-context-window-ring{background:conic-gradient(var(--code-dark-text-soft) calc(var(--context-percent) * 1%), #8b949e57 0)}body.code-mode[data-appearance=dark] .code-context-window-ring:after{background:var(--code-dark-bg-panel)}body.code-mode[data-appearance=dark] .code-composer-context-window[data-level=warning] .code-context-window-ring{background:conic-gradient(#d29922 calc(var(--context-percent) * 1%), #d2992240 0)}body.code-mode[data-appearance=dark] .code-composer-context-window[data-level=critical] .code-context-window-ring{background:conic-gradient(#f85149 calc(var(--context-percent) * 1%), #f8514940 0)}body.code-mode[data-appearance=dark] .code-context-window-popover{background:var(--code-dark-bg-elevated);border-color:var(--code-dark-border);color:var(--code-dark-text);box-shadow:0 16px 36px #0104096b}body.code-mode[data-appearance=dark] .code-context-window-popover span{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-composer-attachment,body.code-mode[data-appearance=dark] .code-composer-mode-chip{background:var(--code-dark-bg-elevated);border-color:var(--code-dark-border);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-composer-attachment-preview{background:var(--code-dark-bg);border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-composer-attachment-name,body.code-mode[data-appearance=dark] .code-composer-attachment-fallback{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-composer-attachment-status{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-composer-attachment.image .code-composer-attachment-status{background:#161b22db}body.code-mode[data-appearance=dark] .code-composer-attachment.image .code-composer-attachment-remove{border-color:var(--code-dark-bg);color:#111;background:#f0f3f6}body.code-mode[data-appearance=dark] .code-composer-attachment.image .code-composer-attachment-remove:hover,body.code-mode[data-appearance=dark] .code-composer-attachment.image .code-composer-attachment-remove:focus-visible{color:#111;background:#fff}body.code-mode[data-appearance=dark] .code-pending-followup{background:var(--code-dark-bg-elevated);border-color:var(--code-dark-border);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-pending-followup-icon,body.code-mode[data-appearance=dark] .code-pending-followup-actions button{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-pending-followup-row p{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-pending-followup-actions button:hover,body.code-mode[data-appearance=dark] .code-pending-followup-actions button:focus-visible{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-app-server-request{border-color:var(--code-dark-border);background:var(--code-dark-bg-elevated);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-app-server-notice{background:#4b3d1ad1;border-color:#806c2f}body.code-mode[data-appearance=dark] .code-app-server-request header strong,body.code-mode[data-appearance=dark] .code-app-server-request-questions label>span,body.code-mode[data-appearance=dark] .code-app-server-request input{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-app-server-request p,body.code-mode[data-appearance=dark] .code-app-server-request small,body.code-mode[data-appearance=dark] .code-app-server-request header span{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-app-server-request-command code,body.code-mode[data-appearance=dark] .code-app-server-request input,body.code-mode[data-appearance=dark] .code-app-server-request-options button,body.code-mode[data-appearance=dark] .code-app-server-request-actions button{border-color:var(--code-dark-border);background:var(--code-dark-bg);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-app-server-request-options button.active,body.code-mode[data-appearance=dark] .code-app-server-request-actions button.approve{color:#fff;background:#6f816b;border-color:#6f816b}body.code-mode[data-appearance=dark] .code-copy-toast,body.code-mode[data-appearance=dark] .app-toast{border-color:var(--code-dark-border);color:var(--code-dark-text);box-shadow:0 12px 32px var(--code-dark-shadow);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;background:#1c2129fa}body.code-mode[data-appearance=dark] .code-copy-toast.error,body.code-mode[data-appearance=dark] .app-toast.error{color:#ff7b72;border-color:#f851495c}body.code-mode[data-appearance=dark] .code-context-menu,body.code-mode[data-appearance=dark] .code-options-menu,body.code-mode[data-appearance=dark] .code-composer-menu,body.code-mode[data-appearance=dark] .code-model-submenu,body.code-mode[data-appearance=dark] .code-speed-submenu,body.code-mode[data-appearance=dark] .code-agent-launch-submenu-panel,body.code-mode[data-appearance=dark] .code-editor-context-menu,body.code-mode[data-appearance=dark] .terminal-context-menu,body.code-mode[data-appearance=dark] .terminal-context-menu-pooled,body.code-mode[data-appearance=dark] .code-file-context-menu{background:var(--code-dark-bg-elevated);border-color:var(--code-dark-border);color:var(--code-dark-text);box-shadow:0 18px 48px var(--code-dark-shadow)}body.code-mode[data-appearance=dark] .code-project-context-menu,body.code-mode[data-appearance=dark] .code-project-launch-menu{-webkit-backdrop-filter:blur(18px)saturate(1.06);background:#161b22eb;border-color:#8b949e2e;box-shadow:0 18px 48px #0104096b,inset 0 1px #f0f6fc0d}body.code-mode[data-appearance=dark] .code-project-context-menu button,body.code-mode[data-appearance=dark] .code-project-launch-menu button{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-context-menu button,body.code-mode[data-appearance=dark] .code-options-menu button,body.code-mode[data-appearance=dark] .code-composer-menu button,body.code-mode[data-appearance=dark] .code-editor-context-menu button,body.code-mode[data-appearance=dark] .terminal-context-menu-item,body.code-mode[data-appearance=dark] .terminal-context-menu-pooled .terminal-context-menu-item,body.code-mode[data-appearance=dark] .code-file-context-menu button,body.code-mode[data-appearance=dark] .code-approval-option,body.code-mode[data-appearance=dark] .code-model-option,body.code-mode[data-appearance=dark] .code-model-nested-trigger,body.code-mode[data-appearance=dark] .code-plus-menu button,body.code-mode[data-appearance=dark] .code-slash-command{color:var(--code-dark-text);background:0 0}body.code-mode[data-appearance=dark] .code-context-menu button:hover,body.code-mode[data-appearance=dark] .code-context-menu button:focus-visible,body.code-mode[data-appearance=dark] .code-options-menu button:hover,body.code-mode[data-appearance=dark] .code-options-menu button:focus-visible,body.code-mode[data-appearance=dark] .code-composer-menu button:hover,body.code-mode[data-appearance=dark] .code-composer-menu button:focus-visible,body.code-mode[data-appearance=dark] .code-editor-context-menu button:hover:not(:disabled),body.code-mode[data-appearance=dark] .code-editor-context-menu button:focus-visible,body.code-mode[data-appearance=dark] .terminal-context-menu-item:hover:not(:disabled),body.code-mode[data-appearance=dark] .terminal-context-menu-item:focus-visible,body.code-mode[data-appearance=dark] .code-file-context-menu button:hover,body.code-mode[data-appearance=dark] .code-file-context-menu button:focus-visible,body.code-mode[data-appearance=dark] .code-approval-option:hover,body.code-mode[data-appearance=dark] .code-approval-option:focus-visible,body.code-mode[data-appearance=dark] .code-model-option:hover,body.code-mode[data-appearance=dark] .code-model-option:focus-visible,body.code-mode[data-appearance=dark] .code-model-nested-trigger:hover,body.code-mode[data-appearance=dark] .code-model-nested-trigger:focus-visible,body.code-mode[data-appearance=dark] .code-model-nested-trigger.selected,body.code-mode[data-appearance=dark] .code-plus-menu button:hover,body.code-mode[data-appearance=dark] .code-plus-menu button:focus-visible,body.code-mode[data-appearance=dark] .code-slash-command:hover,body.code-mode[data-appearance=dark] .code-slash-command:focus-visible,body.code-mode[data-appearance=dark] .code-slash-command.active{background:var(--code-dark-bg-hover);color:var(--code-dark-text);outline:0}body.code-mode[data-appearance=dark] .code-editor-context-menu button:disabled{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-editor-context-separator,body.code-mode[data-appearance=dark] .code-context-menu-separator{background:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .code-context-menu-icon,body.code-mode[data-appearance=dark] .code-agent-launch-submenu-arrow{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-options-menu button.checked,body.code-mode[data-appearance=dark] .code-model-option.selected,body.code-mode[data-appearance=dark] .code-approval-option.selected{background:var(--code-dark-accent-soft)}body.code-mode[data-appearance=dark] .code-options-menu-check,body.code-mode[data-appearance=dark] .code-menu-check,body.code-mode[data-appearance=dark] .code-file-search-highlight,body.code-mode[data-appearance=dark] .code-model-option-copy span,body.code-mode[data-appearance=dark] .code-approval-option-copy span,body.code-mode[data-appearance=dark] .code-slash-command-copy code,body.code-mode[data-appearance=dark] .code-slash-command-copy strong,body.code-mode[data-appearance=dark] .code-speed-option-icon{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-model-matrix-stage{box-shadow:none;background:0 0;border-color:#0000}body.code-mode[data-appearance=dark] .code-model-matrix-shell[data-advanced=open] .code-model-matrix-stage{background:0 0;border-color:#0000}body.code-mode[data-appearance=dark] .code-model-matrix-head,body.code-mode[data-appearance=dark] .code-model-matrix-labels span,body.code-mode[data-appearance=dark] .code-model-matrix-current,body.code-mode[data-appearance=dark] .code-model-matrix-rocker{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-model-matrix-surface{background:radial-gradient(circle at 2px 2px,#ffffff0b 0 .7px,#0000 .9px) 0 0/7px 7px,linear-gradient(145deg,#ffffff09,#0000 42%),#34373a;border-color:#ffffff0a;box-shadow:inset 0 1px 2px #0000006b,inset 0 -1px #ffffff0a}body.code-mode[data-appearance=dark] .code-model-matrix-cells button:before{background:#70757a}body.code-mode[data-appearance=dark] .code-model-matrix-rocker-control{background:radial-gradient(circle at 2px 2px,#ffffff14 0 1px,#0000 1.2px) 0 0/6px 6px,#242628;border-color:#ffffff14;box-shadow:inset 0 0 0 1px #ffffff14}body.code-mode[data-appearance=dark] .code-model-matrix-rocker-button:focus-visible .code-model-matrix-rocker-control{box-shadow:inset 0 0 0 1px #282a2c, 0 0 0 2px #111315, 0 0 0 4px var(--rocker-accent)}body.code-mode[data-appearance=dark] .code-model-matrix-fast:not(.is-active){color:var(--code-dark-text-muted);background:#ffffff0e;border-color:#ffffff17;box-shadow:inset 0 1px #ffffff0d}body.code-mode[data-appearance=dark] .code-model-matrix-fast.is-active{color:#674400;background:linear-gradient(145deg,#ffe783,#ffc126);border-color:#ffc72d7a;box-shadow:inset 0 1px #ffffff8a,0 0 10px #ffbe1940}body.code-mode[data-appearance=dark] .code-model-matrix-fast.is-active small{color:#744d00}body.code-mode[data-appearance=dark] .code-model-matrix-fast.is-disabled{background:#ffffff0a}body.code-mode[data-appearance=dark] .code-model-matrix-advanced-toggle{color:var(--code-dark-text-muted);background:#ffffff0f}body.code-mode[data-appearance=dark] .code-model-matrix-advanced-toggle:hover,body.code-mode[data-appearance=dark] .code-model-matrix-advanced-toggle:focus-visible{color:var(--code-dark-text);background:#ffffff1a}body.code-mode[data-appearance=dark] .code-model-option-copy small,body.code-mode[data-appearance=dark] .code-approval-option-copy small,body.code-mode[data-appearance=dark] .code-plus-menu small,body.code-mode[data-appearance=dark] .code-slash-command-copy small,body.code-mode[data-appearance=dark] .code-slash-command-source,body.code-mode[data-appearance=dark] .code-model-nested-trigger span:last-child{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .dialog-overlay{background:#010409b8}body.code-mode[data-appearance=dark] .code-rename-backdrop,body.code-mode[data-appearance=dark] .code-file-save-confirm-backdrop{background:#010409a3}body.code-mode[data-appearance=dark] .input-dialog,body.code-mode[data-appearance=dark] .settings-dialog,body.code-mode[data-appearance=dark] .code-rename-dialog,body.code-mode[data-appearance=dark] .code-file-save-confirm-dialog,body.code-mode[data-appearance=dark] .workspace-history,body.code-mode[data-appearance=dark] .workspace-path-suggestions,body.code-mode[data-appearance=dark] .agent-list,body.code-mode[data-appearance=dark] .agent-item,body.code-mode[data-appearance=dark] .agent-list-status,body.code-mode[data-appearance=dark] .main-agent-resume-option,body.code-mode[data-appearance=dark] .theme-option,body.code-mode[data-appearance=dark] .settings-field,body.code-mode[data-appearance=dark] .settings-checkbox,body.code-mode[data-appearance=dark] .code-file-operation-dialog{background:var(--code-dark-bg-elevated);border-color:var(--code-dark-border);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .dialog-header,body.code-mode[data-appearance=dark] .input-dialog .dialog-header{background:var(--code-dark-bg-panel);border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .dialog-header-title,body.code-mode[data-appearance=dark] .group-label,body.code-mode[data-appearance=dark] .workspace-field-copy,body.code-mode[data-appearance=dark] .workspace-selected-agent strong,body.code-mode[data-appearance=dark] .section-title,body.code-mode[data-appearance=dark] .settings-field label,body.code-mode[data-appearance=dark] .settings-checkbox span,body.code-mode[data-appearance=dark] .agent-item-name,body.code-mode[data-appearance=dark] .theme-name,body.code-mode[data-appearance=dark] .main-agent-resume-title,body.code-mode[data-appearance=dark] .code-rename-dialog label,body.code-mode[data-appearance=dark] .code-kill-dialog h2,body.code-mode[data-appearance=dark] .code-file-save-confirm-dialog h2{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .agent-item-desc,body.code-mode[data-appearance=dark] .theme-desc,body.code-mode[data-appearance=dark] .settings-hint,body.code-mode[data-appearance=dark] .settings-field .settings-hint,body.code-mode[data-appearance=dark] .settings-checkbox .settings-checkbox-hint,body.code-mode[data-appearance=dark] .main-agent-resume-detail,body.code-mode[data-appearance=dark] .workspace-selected-agent,body.code-mode[data-appearance=dark] .workspace-history-header .hint,body.code-mode[data-appearance=dark] .workspace-history-index,body.code-mode[data-appearance=dark] .workspace-path-suggestion-path,body.code-mode[data-appearance=dark] .code-kill-dialog p,body.code-mode[data-appearance=dark] .code-file-save-confirm-dialog p{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .agent-launch-icon,body.code-mode[data-appearance=dark] .code-project-launch-menu .agent-launch-icon,body.code-mode[data-appearance=dark] .code-agent-launch-submenu-panel .agent-launch-icon{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .agent-launch-icon-monochrome image{filter:grayscale()invert()brightness(1.25)}body.code-mode[data-appearance=dark] .agent-launch-icon-theme-light{display:none}body.code-mode[data-appearance=dark] .agent-launch-icon-theme-dark{display:block}body.code-mode[data-appearance=dark] .workspace-input select.workflow-select:focus,body.code-mode[data-appearance=dark] .workspace-input textarea.task-input:focus,body.code-mode[data-appearance=dark] .workspace-input input:focus,body.code-mode[data-appearance=dark] .settings-input:focus,body.code-mode[data-appearance=dark] .settings-select:focus{border-color:#58a6ff94;box-shadow:0 0 0 3px #58a6ff29}body.code-mode[data-appearance=dark] .code-rename-dialog input{background:var(--code-dark-bg-panel);border-color:var(--code-dark-border);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .code-rename-dialog input:focus{border-color:#58a6ff94;box-shadow:0 0 0 3px #58a6ff29}body.code-mode[data-appearance=dark] .workspace-input select.workflow-select option{background:var(--code-dark-bg-panel);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-home-trigger,body.code-mode[data-appearance=dark] .workspace-home-menu,body.code-mode[data-appearance=dark] .workspace-runtime-options{border-color:var(--code-dark-border);background:var(--code-dark-bg-panel);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-home-trigger:focus-visible{border-color:#58a6ff94;box-shadow:0 0 0 3px #58a6ff29}body.code-mode[data-appearance=dark] .workspace-home-trigger-copy strong,body.code-mode[data-appearance=dark] .workspace-home-option-copy strong{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-home-trigger-copy span,body.code-mode[data-appearance=dark] .workspace-home-option-copy span,body.code-mode[data-appearance=dark] .workspace-home-trigger svg{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .workspace-home-menu{box-shadow:0 12px 28px #0104096b}body.code-mode[data-appearance=dark] .workspace-home-option{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-home-option:hover,body.code-mode[data-appearance=dark] .workspace-home-option:focus-visible,body.code-mode[data-appearance=dark] .workspace-home-option.selected{background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .workspace-home-option.selected .workspace-home-option-check{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-runtime-options button{border-left-color:var(--code-dark-border);color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .workspace-runtime-options button:hover,body.code-mode[data-appearance=dark] .workspace-runtime-options button:focus-visible,body.code-mode[data-appearance=dark] .workspace-runtime-options button.active{background:var(--code-dark-bg-hover);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-runtime-options button span{color:var(--code-dark-warning)}body.code-mode[data-appearance=dark] .workspace-history-header{border-bottom-color:var(--code-dark-border-soft);color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .input-dialog .workspace-actions{background:var(--code-dark-bg-elevated);border-top-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .workspace-history-list::-webkit-scrollbar-thumb{background:#8b949e52}body.code-mode[data-appearance=dark] .workspace-history-list::-webkit-scrollbar-track{background:var(--code-dark-bg-elevated)}body.code-mode[data-appearance=dark] .workspace-history-item,body.code-mode[data-appearance=dark] .workspace-path-suggestion{color:var(--code-dark-text-soft);box-shadow:none;background:0 0;border-color:#0000}body.code-mode[data-appearance=dark] .workspace-history-item{border-top-color:var(--code-dark-border-soft)}body.code-mode[data-appearance=dark] .workspace-history-item:first-child{border-top-color:#0000}body.code-mode[data-appearance=dark] .workspace-history-path,body.code-mode[data-appearance=dark] .workspace-path-suggestion-name{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .agent-item:hover,body.code-mode[data-appearance=dark] .agent-item:focus-visible,body.code-mode[data-appearance=dark] .theme-option:hover,body.code-mode[data-appearance=dark] .theme-option.active,body.code-mode[data-appearance=dark] .workspace-history-item:hover,body.code-mode[data-appearance=dark] .workspace-history-item.active,body.code-mode[data-appearance=dark] .workspace-path-suggestion:hover,body.code-mode[data-appearance=dark] .workspace-path-suggestion.active{background:var(--code-dark-bg-hover);border-color:var(--code-dark-border);color:var(--code-dark-text);box-shadow:none}body.code-mode[data-appearance=dark] .workspace-history-item:hover .workspace-history-path,body.code-mode[data-appearance=dark] .workspace-history-item.active .workspace-history-path,body.code-mode[data-appearance=dark] .workspace-path-suggestion:hover .workspace-path-suggestion-name,body.code-mode[data-appearance=dark] .workspace-path-suggestion.active .workspace-path-suggestion-name{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-history-badge{background:var(--code-dark-accent-soft);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .workspace-directory-prompt{border-color:var(--code-dark-border);background:var(--code-dark-bg-panel);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-directory-prompt.error{background:#f8514914;border-color:#f851496b}body.code-mode[data-appearance=dark] .workspace-directory-prompt-icon{background:var(--code-dark-bg-hover);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .workspace-directory-prompt.error .workspace-directory-prompt-icon{color:var(--code-dark-danger);background:#f8514926}body.code-mode[data-appearance=dark] .workspace-directory-prompt-copy h4{color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-directory-prompt-copy p{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .workspace-directory-prompt-copy code{border-color:var(--code-dark-border);background:var(--code-dark-bg-elevated);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .workspace-directory-prompt-actions button{border-color:var(--code-dark-accent);background:var(--code-dark-accent);color:#fff}body.code-mode[data-appearance=dark] .workspace-directory-prompt-actions button:hover:not(:disabled){background:#79b8ff;border-color:#79b8ff}body.code-mode[data-appearance=dark] .workspace-directory-prompt-actions button.secondary{border-color:var(--code-dark-border);background:var(--code-dark-bg-elevated);color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .workspace-directory-prompt-actions button.secondary:hover:not(:disabled){background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .workspace-input input:disabled{border-color:var(--code-dark-border);background:var(--code-dark-bg-panel);color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .workspace-directory-prompt-actions button:focus-visible{box-shadow:0 0 0 3px #58a6ff38}body.code-mode[data-appearance=dark] .workspace-actions button,body.code-mode[data-appearance=dark] .close-btn,body.code-mode[data-appearance=dark] .kill-btn,body.code-mode[data-appearance=dark] .code-rename-actions button,body.code-mode[data-appearance=dark] .code-file-save-confirm-actions button,body.code-mode[data-appearance=dark] .code-file-operation-dialog .code-rename-actions button{background:var(--code-dark-bg-panel);border-color:var(--code-dark-border);color:var(--code-dark-text)}body.code-mode[data-appearance=dark] .workspace-actions button:hover,body.code-mode[data-appearance=dark] .close-btn:hover,body.code-mode[data-appearance=dark] .code-rename-actions button:hover:not(:disabled),body.code-mode[data-appearance=dark] .code-file-save-confirm-actions button:hover:not(:disabled),body.code-mode[data-appearance=dark] .code-file-operation-dialog .code-rename-actions button:hover{background:var(--code-dark-bg-hover)}body.code-mode[data-appearance=dark] .kill-btn,body.code-mode[data-appearance=dark] .code-rename-actions button.primary,body.code-mode[data-appearance=dark] .code-file-save-confirm-actions button.primary,body.code-mode[data-appearance=dark] .code-file-operation-dialog .code-rename-actions button.primary{background:var(--code-dark-accent);border-color:var(--code-dark-accent);color:#fff}body.code-mode[data-appearance=dark] .kill-btn,body.code-mode[data-appearance=dark] .code-rename-actions button.danger{background:var(--code-dark-danger);border-color:var(--code-dark-danger);color:#fff}body.code-mode[data-appearance=dark] .code-mobile-topbar{background:var(--code-dark-bg-soft);border-color:var(--code-dark-border);color:var(--code-dark-text)}body.code-mode[data-appearance=dark].code-mobile-markdown-reading .code-mobile-topbar{background:0 0;border-color:#0000}body.code-mode[data-appearance=dark].code-mobile-touch{background:var(--code-dark-bg)}body.code-mode[data-appearance=dark].code-mobile-touch #root,body.code-mode[data-appearance=dark].code-mobile-touch .app-container,body.code-mode[data-appearance=dark].code-mobile-touch .code-app-shell,body.code-mode[data-appearance=dark].code-mobile-touch .code-workspace,body.code-mode[data-appearance=dark].code-mobile-touch .code-main,body.code-mode[data-appearance=dark].code-mobile-touch .code-terminal-grid,body.code-mode[data-appearance=dark].code-mobile-touch .code-agent-work-pane,body.code-mode[data-appearance=dark].code-mobile-touch .code-terminal-pane,body.code-mode[data-appearance=dark].code-mobile-touch .code-terminal-container,body.code-mode[data-appearance=dark].code-mobile-touch .terminal-session-host,body.code-mode[data-appearance=dark].code-mobile-touch .terminal-session-host .xterm,body.code-mode[data-appearance=dark].code-mobile-touch .terminal-session-host .xterm-screen,body.code-mode[data-appearance=dark].code-mobile-touch .terminal-session-host .xterm-viewport,body.code-mode[data-appearance=dark].code-mobile-touch .code-codex-transcript-scroll{color:var(--code-dark-text);background:var(--code-dark-bg)!important}body.code-mode[data-appearance=dark].code-mobile-touch .code-mobile-topbar-title,body.code-mode[data-appearance=dark].code-mobile-touch .code-mobile-topbar-title strong{color:var(--code-dark-text)}body.code-mode[data-appearance=dark].code-mobile-touch .code-mobile-topbar-title span{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark].code-mobile-touch .code-composer{color:var(--code-dark-text);background:#161b22c7!important;border-color:#f0f6fc14!important;box-shadow:0 16px 42px #01040938,inset 0 0 0 1px #f0f6fc0b!important}body.code-mode[data-appearance=dark].code-mobile-touch .code-composer:focus-within,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer.menu-open{background:#161b22db!important;border-color:#f0f6fc1a!important;box-shadow:0 14px 38px #0104093d,inset 0 0 0 1px #f0f6fc0e!important}body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-mobile-input,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer textarea{color:#f0f6fceb;caret-color:#f0f6fcf5}body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-mobile-input:empty:before,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer textarea::placeholder{color:#f0f6fc75}body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-add,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-mic,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-approval,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-context-window,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-model-picker,body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-mode-chip{color:#f0f6fcbd}body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-send{color:#0d1117;background:#f0f6fceb}body.code-mode[data-appearance=dark].code-mobile-touch .code-composer-send:disabled{color:#f0f6fc61;background:#f0f6fc1f}body.code-mode[data-appearance=dark].code-mobile-markdown-reading .code-mobile-topbar-button,body.code-mode[data-appearance=dark].code-mobile-touch .code-mobile-topbar-button,body.code-mode[data-appearance=dark].code-mobile-touch .code-file-editor.markdown-reading .code-file-editor-action.source-preview{color:#f0f6fcd6;-webkit-backdrop-filter:blur(18px)saturate(1.12);background:#161b22bd;box-shadow:0 10px 24px #01040947}body.code-mode[data-appearance=dark].code-mobile-touch .code-file-editor.markdown-reading .code-file-editor-action.source-preview,body.code-mode[data-appearance=dark].code-mobile-touch .code-file-editor.markdown-reading .code-file-editor-action.source-preview.active{color:#f0f6fcd1;box-shadow:none;background:0 0}body.code-mode[data-appearance=dark].code-mobile-touch .code-file-editor.markdown-reading .code-file-editor-action.source-preview:hover:not(:disabled),body.code-mode[data-appearance=dark].code-mobile-touch .code-file-editor.markdown-reading .code-file-editor-action.source-preview:focus-visible{background:#f0f6fc17}body.code-mode[data-appearance=dark] .code-mobile-sidebar-backdrop{background:#010409a3}body.code-mode[data-appearance=dark] .connection-status{background:var(--code-dark-bg-elevated);border-color:var(--code-dark-border);color:var(--code-dark-warning);box-shadow:0 12px 34px var(--code-dark-shadow)}body.code-mode[data-appearance=dark] .connection-status.lost,body.code-mode[data-appearance=dark] .connection-status.stale{color:#ff7b72;border-color:#f8514975}body.code-mode[data-appearance=dark] .code-settings-panel{color:#d8dee9;background:#171a1f;border-left-color:#30363d}body.code-mode[data-appearance=dark] .code-settings-panel-header,body.code-mode[data-appearance=dark] .code-agent-home-provider-header{border-color:#30363d}body.code-mode[data-appearance=dark] .code-settings-panel-header h2,body.code-mode[data-appearance=dark] .code-settings-section h3,body.code-mode[data-appearance=dark] .code-agent-home-id,body.code-mode[data-appearance=dark] .code-agent-home-provider-header strong{color:#f0f3f6}body.code-mode[data-appearance=dark] .code-settings-panel-header p,body.code-mode[data-appearance=dark] .code-settings-section-heading p,body.code-mode[data-appearance=dark] .code-settings-status,body.code-mode[data-appearance=dark] .code-agent-home-path,body.code-mode[data-appearance=dark] .code-agent-home-form p,body.code-mode[data-appearance=dark] .code-agent-home-empty{color:#8b949e}body.code-mode[data-appearance=dark] .code-settings-row-copy strong,body.code-mode[data-appearance=dark] .code-settings-update-url>span{color:var(--code-dark-text-soft)}body.code-mode[data-appearance=dark] .code-settings-row-copy small,body.code-mode[data-appearance=dark] .code-settings-search-timeout-row output,body.code-mode[data-appearance=dark] .code-settings-update-status dt,body.code-mode[data-appearance=dark] .code-settings-update-summary,body.code-mode[data-appearance=dark] .code-agent-home-provider-title span,body.code-mode[data-appearance=dark] .code-settings-inline-choice>svg,body.code-mode[data-appearance=dark] .code-settings-segmented button{color:var(--code-dark-text-muted)}body.code-mode[data-appearance=dark] .code-settings-section+.code-settings-section,body.code-mode[data-appearance=dark] .code-settings-language-choice,body.code-mode[data-appearance=dark] .code-settings-card>.code-settings-choice-row+.code-settings-choice-row{border-color:var(--code-dark-border)}body.code-mode[data-appearance=dark] .code-settings-choice-row,body.code-mode[data-appearance=dark] .code-agent-home-provider,body.code-mode[data-appearance=dark] .code-agent-home-form{background:#1d2229;border-color:#30363d}body.code-mode[data-appearance=dark] .code-settings-segmented,body.code-mode[data-appearance=dark] .code-agent-home-provider-header button,body.code-mode[data-appearance=dark] .code-agent-home-actions button,body.code-mode[data-appearance=dark] .code-agent-home-form-actions button,body.code-mode[data-appearance=dark] .code-agent-home-form input,body.code-mode[data-appearance=dark] .code-settings-panel-close{border-color:#30363d}body.code-mode[data-appearance=dark] .code-agent-home-form input,body.code-mode[data-appearance=dark] .code-settings-search-timeout-card input[type=range]{color:#d8dee9;background:#11151a}body.code-mode[data-appearance=dark] .code-settings-segmented button.active,body.code-mode[data-appearance=dark] .code-settings-segmented button:hover,body.code-mode[data-appearance=dark] .code-settings-segmented button:focus-visible,body.code-mode[data-appearance=dark] .code-agent-home-provider-header button:hover,body.code-mode[data-appearance=dark] .code-agent-home-provider-header button:focus-visible,body.code-mode[data-appearance=dark] .code-agent-home-actions button:hover,body.code-mode[data-appearance=dark] .code-agent-home-actions button:focus-visible,body.code-mode[data-appearance=dark] .code-agent-home-form-actions button:hover,body.code-mode[data-appearance=dark] .code-agent-home-form-actions button:focus-visible,body.code-mode[data-appearance=dark] .code-settings-panel-close:hover,body.code-mode[data-appearance=dark] .code-settings-panel-close:focus-visible{color:#f0f3f6;background:#30363d}body.code-mode[data-appearance=dark] .code-agent-home-form-actions .primary{color:#171a1f;background:#f0f3f6}body.code-mode[data-appearance=dark] .code-settings-panel-overlay{background:#0104096b}body.code-mode[data-appearance=dark] .code-settings-panel-header{background:#171a1f}body.code-mode[data-appearance=dark] .code-settings-segmented{background:#11151a}body.code-mode[data-appearance=dark] .code-settings-segmented button.active{color:#f0f3f6;box-shadow:none;background:#30363d}body.code-mode[data-appearance=dark] .code-settings-error{color:#ff7b72;background:#f8514914;border-color:#f8514952}