@xbzbing/dsh-git-panel 1.6.2 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -1,6 +1,6 @@
1
1
  window.__ModuleLoader__.load({ id: "@xbzbing/dsh-git-panel", factory: (require) => {
2
2
  var module = { exports: {} }; var exports = module.exports;
3
- "use strict";var Sn=require("react");var ti=`
3
+ "use strict";var Cr=require("react");var Zi=`
4
4
  .gp-panel{display:flex;flex-direction:column;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-size:13px;position:relative;
5
5
  /* One selection language across the three list panes (Overview commits,
6
6
  * Changes rows, Files tree): primary-tinted fill + a 3px inset left bar. */
@@ -8,7 +8,7 @@ var module = { exports: {} }; var exports = module.exports;
8
8
  --gp-select-bar:inset 3px 0 0 var(--dsw-alias-state-business-primary)}
9
9
  .gp-panel[data-font-delta="1"]{zoom:1.08;font-size:14px}
10
10
  .gp-panel[data-font-delta="-1"]{zoom:.92;font-size:12px}
11
- .gp-tabbar{display:flex;align-items:center;gap:4px;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;flex-wrap:nowrap;min-width:0;container-type:inline-size}
11
+ .gp-tabbar{display:flex;align-items:center;gap:4px;padding:6px 10px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none;flex-wrap:nowrap;min-width:0}
12
12
  /* The shell floats the input composer over the view's bottom (composer-overlay
13
13
  * mode). Reserve that height as bottom padding so the panel's own bottom rows
14
14
  * (commit box / commit comment) stay above it instead of being covered. */
@@ -30,34 +30,56 @@ var module = { exports: {} }; var exports = module.exports;
30
30
  /* star link: hollow by default, fills to a gold star on hover */
31
31
  .gp-verbar__gh--starred:hover{color:var(--dsw-alias-state-warn-primary,#e3b341)}
32
32
  .gp-verbar__gh--starred:hover svg{fill:currentColor}
33
- .gp-tab{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:13px;cursor:pointer;flex:none;transition:background .12s ease,color .12s ease}
34
- .gp-tab:hover{background:var(--dsw-alias-interactive-bg-hover)}
35
- /* Active tab: primary-tinted fill + primary text + medium weight + a soft ring.
36
- * Clear enough to spot at a glance, restrained enough not to shout. */
37
- .gp-tab--active{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);color:var(--dsw-alias-state-business-primary);font-weight:600;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dsw-alias-state-business-primary) 32%,transparent)}
38
- .gp-tab__icon{display:inline-flex;width:15px;height:15px;flex:none}
33
+ /* The sub-tab switcher is the platform SegmentedTabs primitive (official track,
34
+ * pill and sliding indicator). We only place the tab list in our flex bar and
35
+ * supply the icon/label spans inside each tab's label. */
36
+ .gp-tabbar__tabs{flex:0 1 auto;min-width:0}
37
+ .gp-tab__icon{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;flex:none}
39
38
  .gp-tab__label{white-space:nowrap}
40
39
  /* Trailing cluster (font stepper + version bar). display:contents makes it
41
40
  * transparent to the tab-bar flex in the wide layout \u2014 font sits after the
42
41
  * tabs, version bar floats right via its own margin-left:auto \u2014 identical to a
43
- * flat layout. The compact layout re-materializes it as a wrapped second row. */
42
+ * flat layout. The compact layout re-materializes it as a single trailing item. */
44
43
  .gp-tabbar__trailing{display:contents}
45
- /* Responsive tab bar (the bar is an inline-size container): a very narrow panel
46
- * drops the tab labels to icon-only so they never wrap into a garbled multi-line
47
- * state. Hiding the trailing controls is handled by the compact layout (which
48
- * moves them to a second row) rather than removing them. */
49
- @container (max-width:300px){.gp-tab__label{display:none}.gp-tab{gap:0;padding:0 10px}}
50
44
  .gp-font{margin-left:4px;display:inline-flex;align-items:center;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;overflow:hidden}
51
45
  .gp-font button{border:0;border-left:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;line-height:22px;width:24px;height:24px;padding:0;cursor:pointer}
52
46
  .gp-font button:first-child{border-left:0}
53
47
  .gp-font button:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
48
+ /* The current step is stored as aria-pressed, so the selected cell needs no
49
+ * parallel class: it keeps the filled background even while hovered. */
50
+ .gp-font button[aria-pressed="true"]{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-primary);font-weight:600}
54
51
  .gp-font button:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
55
52
  .gp-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;height:100%;color:var(--dsw-alias-label-tertiary);font-size:12px;padding:24px;text-align:center}
56
53
  .gp-files-wrap{display:flex;flex-direction:column;width:100%;height:100%;min-height:0}
57
54
  .gp-files-wrap>.gp-files{flex:1;min-height:0;height:auto}
58
55
  .gp-notice{flex:none;padding:8px 14px;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border-bottom:1px solid var(--dsw-alias-border-l2)}
59
56
  .gp-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:6px 8px;border-bottom:1px solid var(--dsw-alias-border-l2);flex:none}
60
- .gp-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;cursor:pointer}
57
+ .gp-changes__toolbar{flex-wrap:nowrap;gap:4px;overflow-x:auto}
58
+ .gp-changes__toolbar .gp-icon-btn{flex:none}
59
+ /* Compact history toolbar: one control height across the branch pill, the
60
+ * search input, the select triggers and the icon buttons (the touch media query
61
+ * used to leave only .gp-btn at 36px, so the branch pill towered over its row).
62
+ * The author / since / refresh group starts collapsed behind a chevron. */
63
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-btn,
64
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-search,
65
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-select-trigger{height:30px}
66
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-select-trigger{min-height:30px}
67
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-icon-btn{width:30px;height:30px}
68
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-btn{flex:none;max-width:55%;min-width:0;gap:5px}
69
+ .gp-btn__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
70
+ /* Square 30px chevron button: the scoped selector keeps the 30px box and zero
71
+ * padding ahead of the later, equally specific gp-btn base rule. */
72
+ .gp-toolbar .gp-toolbar__more-toggle{flex:none;width:30px;box-sizing:border-box;padding:0;justify-content:center}
73
+ .gp-toolbar__chev{display:inline-flex;transition:transform .12s ease}
74
+ .gp-toolbar__chev--up{transform:rotate(180deg)}
75
+ .gp-toolbar__more{flex:1 1 100%;display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0}
76
+ .gp-panel[data-layout="compact"] .gp-history .gp-toolbar .gp-toolbar__more .gp-filter{flex:1 1 0;min-width:0;max-width:calc(50% - 23px)}
77
+ .gp-changes__toolbar .gp-icon-btn:disabled{opacity:.4;cursor:default}
78
+ .gp-changes__toolbar .gp-icon-btn:hover:disabled{background:transparent}
79
+ .gp-changes__toolbar .gp-icon-btn:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
80
+ .gp-changes__toolbar .gp-icon-btn>span{display:inline-flex}
81
+ .gp-changes__refresh--busy svg{animation:gp-spin 1s linear infinite}
82
+ .gp-btn{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}
61
83
  .gp-btn:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
62
84
  .gp-btn:disabled{opacity:.5;cursor:default}
63
85
  .gp-btn--primary{border-color:transparent;background:var(--dsw-alias-state-business-primary);color:#fff}
@@ -83,16 +105,28 @@ var module = { exports: {} }; var exports = module.exports;
83
105
  /* branch list */
84
106
  .gp-branch-group{padding:2px 0}
85
107
  .gp-branch-group__head{display:flex;align-items:center;gap:6px;padding:4px 10px;font-size:11px;color:var(--dsw-alias-label-tertiary);cursor:pointer;user-select:none}
86
- .gp-branch-row{display:flex;align-items:center;gap:6px;padding:4px 10px 4px 22px;cursor:pointer;border-radius:6px;font-size:12px;color:var(--dsw-alias-label-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
108
+ /* Left corners stay square so the row highlight (and its inset accent bar)
109
+ * sits flush against the panel edge; only the right end is rounded. */
110
+ .gp-branch-row{display:flex;align-items:center;gap:6px;padding:4px 10px 4px 22px;cursor:pointer;border-radius:0 6px 6px 0;font-size:12px;color:var(--dsw-alias-label-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
87
111
  .gp-branch-row:hover{background:var(--dsw-alias-interactive-bg-hover)}
88
112
  .gp-branch-row--active,.gp-branch-row--active:hover{color:var(--dsw-alias-state-business-primary);background:var(--gp-select-bg);box-shadow:var(--gp-select-bar)}
89
- .gp-branch-row--current{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-business-primary))}
90
- .gp-branch-row__track{margin-left:auto;font-size:10px;color:var(--dsw-alias-label-tertiary)}
113
+ .gp-branch-row--current .gp-tree-name{font-weight:600}
114
+ .gp-branch-row__ic--current,.gp-branch-row__ic--primary{color:var(--dsw-alias-state-warn-primary,var(--dsw-alias-state-business-primary))}
115
+ .gp-branch-row__track{display:inline-flex;align-items:center;gap:7px;flex:none;margin-left:auto;font-size:11px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--dsw-alias-state-business-primary)}
116
+ .gp-branch-row__sync{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}
117
+ .gp-branch-row__sync-icon{flex:none}
91
118
  .gp-branch-row__switch{display:none;flex:none;margin:-2px 0 -2px auto;padding:0 7px;height:18px;border:1px solid var(--dsw-alias-border-l2);border-radius:5px;background:var(--dsw-alias-bg-layer-1);font:inherit;font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary);cursor:pointer}
92
119
  .gp-branch-row__track+.gp-branch-row__switch{margin-left:0}
93
120
  .gp-branch-row:hover .gp-branch-row__switch{display:inline-block}
94
121
  .gp-branch-row__switch:hover{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary)}
95
122
  .gp-branch-row__switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}
123
+ /* Refs sharing a '/'-prefix fold into a collapsible directory row: the chevron
124
+ * keeps its own column and the folder glyph shares the 14px icon box, so a dir
125
+ * label lines up with the leaf labels of the same level. */
126
+ .gp-branch-row__chev{display:inline-flex;flex:none;width:11px;align-items:center;justify-content:center}
127
+ .gp-branch-row__ic{display:inline-flex;flex:none;width:14px;align-items:center;justify-content:center}
128
+ .gp-branch-row--dir{color:var(--dsw-alias-label-secondary)}
129
+ .gp-branch-row--dir .gp-tree-name{font-weight:600}
96
130
 
97
131
  /* left-column footer status bar: repo icon (left) + branch sync (right) */
98
132
  .gp-statusbar{flex:none;display:flex;align-items:center;gap:8px;min-height:30px;padding:4px 8px;border-top:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);font-size:11px}
@@ -128,9 +162,20 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
128
162
  .gp-ref-chip--head{background:var(--dsw-alias-state-business-primary);color:#fff;border-color:transparent;font-weight:700;font-size:11px}
129
163
  .gp-graph-cell{position:relative}
130
164
  .gp-graph-svg{display:block}
165
+ .gp-graph-edge,.gp-graph-boundary{vector-effect:non-scaling-stroke}
166
+ .gp-graph-boundary{opacity:.8}
131
167
  .gp-search{flex:1;min-width:60px;height:28px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:0 10px;box-sizing:border-box}
132
168
  .gp-search:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
133
- .gp-select{height:28px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:0 6px}
169
+ /* Filter dropdowns are the platform Menu: the wrapper is the Menu's own anchor
170
+ * span (inline-flex, so it still lays out as a toolbar item), and the trigger
171
+ * uses the same module background as the shell's settings selectors. */
172
+ .gp-filter{display:inline-flex;align-items:center;min-width:0;max-width:100%}
173
+ .gp-select-trigger{display:inline-flex;align-items:center;gap:4px;min-height:28px;max-width:180px;padding:0 8px;border:none;border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;font-weight:500;line-height:20px;white-space:nowrap;cursor:pointer}
174
+ .gp-select-trigger:not(:disabled):hover,.gp-select-trigger[aria-expanded="true"]{background:var(--dsw-alias-interactive-bg-hover)}
175
+ .gp-select-trigger:disabled{cursor:default;color:var(--dsw-alias-label-quaternary)}
176
+ .gp-select-trigger:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
177
+ .gp-select-trigger__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
178
+ .gp-select-trigger__chevron{flex:none;color:var(--dsw-alias-label-caption)}
134
179
 
135
180
  /* commit detail (right pane): the changed-file tree and the commit message
136
181
  * split the column in half, each scrolling on its own. Equal halves keep the
@@ -150,12 +195,13 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
150
195
  .gp-tree-row--active{background:var(--dsw-alias-bg-layer-2)}
151
196
  .gp-tree-row--muted{color:var(--dsw-alias-label-tertiary);cursor:default}
152
197
  .gp-tree-row--muted:hover{background:transparent}
153
- .gp-tree-chev{flex:none;width:11px;display:inline-flex;align-items:center;justify-content:center;color:var(--dsw-alias-label-tertiary)}
154
- .gp-tree-ic{flex:none;display:inline-flex;align-items:center;color:var(--dsw-alias-label-tertiary)}
198
+ .gp-tree-ic{flex:none;display:inline-flex;align-items:center;color:var(--dsw-alias-label-secondary)}
155
199
  .gp-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
156
200
  .gp-tree-row--dir .gp-tree-name{font-weight:600}
157
201
  .gp-files__entry{width:100%;border:0;background:transparent;color:inherit;text-align:left;font:inherit}
158
- .gp-files__entry--dir .gp-tree-name{font-weight:600}
202
+ /* Official file lists render directory names at the same weight as files; the
203
+ * open/closed folder glyph carries the expansion state. */
204
+ .gp-files__tree .gp-files__entry--dir .gp-tree-name{font-weight:500}
159
205
  .gp-files__entry:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
160
206
  .gp-files__entry.gp-tree-row--active,.gp-files__entry.gp-tree-row--active:hover{background:var(--gp-select-bg);box-shadow:var(--gp-select-bar)}
161
207
  .gp-files__entry.gp-tree-row--active .gp-tree-name{font-weight:600}
@@ -183,6 +229,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
183
229
  .gp-files__path{flex:1 1 120px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-secondary);font:inherit}
184
230
  .gp-files__copy-path{flex:none;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:4px 8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;font-size:12px}
185
231
  .gp-files__copy-path:hover{background:var(--dsw-alias-interactive-bg-hover)}
232
+ /* The path/content copy actions read as one joined button group: the shared
233
+ * border collapses (1px overlap) and only the outer corners stay rounded. */
234
+ .gp-files__copy-group{flex:none;display:flex;align-items:center}
235
+ .gp-files__copy-group .gp-files__copy-path{border-radius:0;margin-left:-1px}
236
+ .gp-files__copy-group .gp-files__copy-path:first-child{border-radius:6px 0 0 6px;margin-left:0}
237
+ .gp-files__copy-group .gp-files__copy-path:last-child{border-radius:0 6px 6px 0}
238
+ .gp-files__copy-group .gp-files__copy-path:only-child{border-radius:6px}
239
+ .gp-files__copy-group .gp-files__copy-path:hover,.gp-files__copy-group .gp-files__copy-path:focus-visible{position:relative;z-index:1}
186
240
  .gp-files__copy-path:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
187
241
  .gp-files__copy-path--error{color:var(--dsw-alias-state-error-primary)}
188
242
  /* Icon-only properties entry at the toolbar's far right. The path's flex-grow
@@ -192,14 +246,32 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
192
246
  .gp-files__props:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
193
247
  .gp-files__props:disabled{opacity:0.5;cursor:default}
194
248
  .gp-files__props:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
195
- .gp-files__mode{display:flex;gap:4px}
196
- .gp-files__mode-btn{border:0;border-radius:6px;padding:4px 10px;background:transparent;color:var(--dsw-alias-label-secondary);cursor:pointer;font:inherit;font-size:12px}
197
- .gp-files__mode-btn--active{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-weight:600}
198
- .gp-files__mode-btn:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
249
+ .gp-files__props[aria-pressed="true"]{background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 12%,transparent);color:var(--dsw-alias-state-business-primary);border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary) 35%,transparent)}
250
+ .gp-files__mode-seg{flex:none}
251
+ /* Compact preview toolbar: the relative path and the two copy buttons are gone
252
+ * (they forced three wrapped rows on a phone). Back + the official source/render
253
+ * control + fullscreen + properties share one row; longer locales wrap instead
254
+ * of squeezing the mode labels. */
255
+ .gp-files__bar--compact{padding:6px 8px}
256
+ .gp-files__bar--compact .gp-files__mode-seg{flex:1 1 auto;min-width:max-content}
257
+ .gp-files__bar--compact .gp-files__bar-end{flex:none;margin-left:auto;display:flex;align-items:center;gap:6px}
258
+ /* Trailing icon buttons match the 30px back button / mode control instead of
259
+ * their 24px inline size (4px padding + 14px glyph). */
260
+ .gp-panel[data-layout="compact"] .gp-files__bar-end .gp-files__props{height:30px;box-sizing:border-box;padding:0 6px}
261
+ .gp-files__bar--compact .gp-files__mode-seg button{padding:0 10px;font-size:12px}
199
262
  .gp-files__markdown{overflow:auto;overscroll-behavior:contain;padding:16px 24px;color:var(--dsw-alias-label-primary)}
263
+ /* Mermaid figures: the SVG centers and never overflows the pane width; a
264
+ * parse/load failure falls back to the source as a plain code block. */
265
+ .gp-mermaid{overflow-x:auto;padding:4px 0}
266
+ .gp-mermaid svg{display:block;max-width:100%;height:auto;margin:0 auto}
267
+ .gp-mermaid--loading{min-height:64px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-skeleton);color:var(--dsw-alias-label-tertiary)}
268
+ .gp-mermaid__loading-text{font-size:12px;line-height:20px}
269
+ .gp-mermaid__fallback{overflow:auto;background:var(--dsw-alias-markdown-code-block);border-radius:6px;padding:10px 12px;font-family:var(--dsw-font-mono,monospace);font-size:12px;margin:8px 0}
200
270
  .gp-files__html{flex:1;min-height:0;width:100%;border:0;background:#fff}
201
271
  .gp-files__code{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;font-family:var(--dsw-font-mono,monospace);font-size:12px;position:relative}
202
- .gp-files__header{position:sticky;top:0;z-index:2}
272
+ /* Both sticky axes: the header must also stay put under horizontal scroll
273
+ * (reachable only in nowrap mode), or the find bar slides out of view. */
274
+ .gp-files__header{position:sticky;top:0;left:0;z-index:2}
203
275
  .gp-files__note{padding:5px 12px;font-size:11px;color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);border-bottom:1px solid var(--dsw-alias-border-l2)}
204
276
  .gp-find{display:flex;align-items:center;gap:4px;padding:5px 8px;background:var(--dsw-alias-bg-layer-2);border-bottom:1px solid var(--dsw-alias-border-l2)}
205
277
  .gp-find__input{flex:1;min-width:60px;height:26px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;padding:0 8px;box-sizing:border-box}
@@ -224,6 +296,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
224
296
  /* Fixed row height needs non-wrapping cells; a long line scrolls horizontally
225
297
  * on the container instead of growing the row past ROW_HEIGHT. */
226
298
  .gp-files__row .gp-diff-cell{white-space:pre;overflow:hidden;text-overflow:clip}
299
+ /* No-wrap: rows size to the longest line (min-width keeps short files full-bleed)
300
+ * so the container's overflow:auto exposes a real horizontal scrollbar. */
301
+ .gp-files__code--nowrap .gp-files__single--virt{width:max-content;min-width:100%}
302
+ .gp-files__code--nowrap .gp-files__row{right:auto;width:max-content;min-width:100%}
303
+ .gp-files__code--nowrap .gp-files__row .gp-diff-cell{overflow:visible}
304
+ /* Wrap: flow layout (not the fixed-height virtual grid) so a line can grow the
305
+ * row; the gutter stays one column beside the wrapping cell. */
306
+ .gp-files__code--wrap .gp-files__single--virt{position:static;width:auto;height:auto!important}
307
+ .gp-files__code--wrap .gp-files__row{position:static;height:auto;min-height:20px}
308
+ .gp-files__code--wrap .gp-files__row .gp-diff-cell{white-space:pre-wrap;overflow-wrap:anywhere;overflow:visible}
227
309
  .gp-files__image{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;display:flex;align-items:flex-start;justify-content:flex-start;padding:16px;background-color:var(--dsw-alias-bg-layer-1);background-image:linear-gradient(45deg,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 25%,transparent 25%,transparent 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 50%,color-mix(in srgb,var(--dsw-alias-label-primary) 5%,transparent) 75%,transparent 75%);background-size:16px 16px}
228
310
  .gp-files__image img{max-width:100%;max-height:100%;object-fit:contain}
229
311
  .gp-changes__list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 0}
@@ -235,6 +317,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
235
317
  .gp-changes__vrow>.gp-file-row,.gp-changes__vrow>.gp-group-head{height:100%;box-sizing:border-box}
236
318
  .gp-check{width:14px;height:14px;flex:none;cursor:pointer}
237
319
  .gp-group-head{display:flex;align-items:center;gap:6px;padding:5px 10px;font-size:11px;color:var(--dsw-alias-label-tertiary);cursor:pointer;user-select:none}
320
+ /* A group kept only for its count has nothing to collapse: no chevron, no hand. */
321
+ .gp-group-head--static{cursor:default}
322
+ .gp-group-head__chev-spacer{display:inline-block;width:12px;flex:none}
238
323
  .gp-file-row{display:flex;align-items:center;gap:8px;padding:4px 10px 4px 20px;cursor:pointer;font-size:12px;border-radius:4px}
239
324
  .gp-file-row:hover{background:var(--dsw-alias-interactive-bg-hover)}
240
325
  /* Selected change row: identical accent to the Git overview commit list
@@ -255,6 +340,12 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
255
340
  .gp-stats__del{color:var(--dsw-alias-state-error-primary)}
256
341
  /* "simplified" marker on a huge change set: muted + help cursor + dotted hint. */
257
342
  .gp-stats__partial{color:var(--dsw-alias-label-tertiary);cursor:help;text-decoration:underline dotted;text-underline-offset:2px}
343
+ /* Compact stats bar: the counts on one clipped, never-wrapping line. The
344
+ * timestamps are not rendered at all at this width (ChangeStats) \u2014 the bar must
345
+ * not cost a second row above the change list on a phone. */
346
+ .gp-stats--compact{padding:6px 8px 6px 12px;gap:4px 8px;align-items:center}
347
+ .gp-stats--compact .gp-stats__main{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:14px;overflow:hidden;white-space:nowrap}
348
+ .gp-stats--compact .gp-stats__main>.gp-stats__item{flex:none}
258
349
 
259
350
  /* commit box */
260
351
  .gp-commitbox{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:8px 10px;display:flex;flex-direction:column;gap:8px}
@@ -265,9 +356,27 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
265
356
  .gp-commitbox__spin{position:absolute;top:8px;right:8px;width:13px;height:13px;box-sizing:border-box;border-radius:50%;border:2px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-state-business-primary);animation:gp-spin .7s linear infinite;pointer-events:none}
266
357
  .gp-commitbox__msg[readonly]{color:var(--dsw-alias-label-tertiary);background:var(--dsw-alias-bg-layer-2);cursor:progress}
267
358
  .gp-commitbox__msg:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
268
- .gp-commitbox__row{display:flex;align-items:center;gap:10px}
269
- .gp-commitbox__amend{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--dsw-alias-label-secondary);cursor:pointer}
270
- .gp-commitbox__actions{margin-left:auto;display:flex;gap:6px}
359
+ .gp-commitbox__row{display:flex;align-items:center;flex-wrap:wrap;gap:10px}
360
+ .gp-commitbox__amend{display:inline-flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap;color:var(--dsw-alias-label-secondary);cursor:pointer}
361
+ /* Compact commit bar: stands in for the whole editor until tapped, so the
362
+ * change list keeps the panel's scarce height on a phone. */
363
+ .gp-commitbar{flex:none;border-top:1px solid var(--dsw-alias-border-l2);padding:4px 8px;display:flex;align-items:center;gap:6px}
364
+ .gp-commitbar__open{flex:1 1 auto;min-width:0;display:flex;align-items:center;height:30px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;text-align:left;cursor:text}
365
+ .gp-commitbar__open:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
366
+ .gp-commitbar__ph,.gp-commitbar__draft{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
367
+ .gp-commitbar__ph{color:var(--dsw-alias-label-tertiary)}
368
+ .gp-panel[data-layout="compact"] .gp-commitbar .gp-btn{height:30px}
369
+ /* Compact commit row: AI suggest / Commit / fold all share the 30px height, so
370
+ * the fold button lines up with its neighbours and the row loses vertical padding. */
371
+ .gp-panel[data-layout="compact"] .gp-commitbox .gp-btn{height:30px}
372
+ /* Compact fold control: a real button (tinted fill, border, press feedback) so
373
+ * collapsing the editor reads as an action next to AI suggest / Commit. */
374
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold{width:30px;height:30px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);transition:background .12s ease,color .12s ease,transform .08s ease}
375
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
376
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold:active:not(:disabled){transform:scale(.94)}
377
+ .gp-panel[data-layout="compact"] .gp-commitbox__fold:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
378
+ .gp-commitbox__fold:disabled{opacity:.5;cursor:default}
379
+ .gp-commitbox__actions{margin-left:auto;display:flex;flex-wrap:nowrap;gap:6px}
271
380
 
272
381
  /* diff view */
273
382
  .gp-diff{flex:1;min-height:0;display:flex;flex-direction:column}
@@ -278,15 +387,18 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
278
387
  .gp-diff__toolbar--compact{flex-wrap:wrap;row-gap:6px}
279
388
  .gp-diff__toolbar-row{display:flex;align-items:center;gap:8px;min-width:0}
280
389
  .gp-diff__toolbar-row:first-child{flex:1 1 100%}
281
- .gp-diff__toolbar-row--controls{flex:1 1 100%}
390
+ .gp-diff__toolbar-row--controls{flex:1 1 100%;flex-wrap:wrap}
282
391
  .gp-diff__toolbar-row--controls .gp-diff__expand{flex:none}
283
- .gp-diff__toolbar-row--controls .gp-seg{flex:1}
284
- .gp-diff__toolbar-row--controls .gp-seg__btn{flex:1;min-width:0}
392
+ /* Seg labels never break: the track keeps at least its content width and may
393
+ * wrap below the expand toggle on an ultra-narrow panel instead of squeezing
394
+ * "\u53D8\u66F4\u524D / \u53D8\u66F4\u540E" into two lines. Buttons stay equal-width while they fit. */
395
+ .gp-diff__toolbar-row--controls .gp-seg{flex:1 1 auto;min-width:max-content}
396
+ .gp-diff__toolbar-row--controls .gp-seg .gp-seg__btn{flex:1 1 0;min-width:max-content}
285
397
  .gp-diff__path{font-size:12px;color:var(--dsw-alias-label-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
286
398
  .gp-diff__expand{border:1px solid var(--dsw-alias-border-l2);border-radius:7px}
287
399
  .gp-diff__expand:disabled{opacity:.45;cursor:not-allowed}
288
400
  .gp-seg{display:inline-flex;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;overflow:hidden;background:var(--dsw-alias-bg-layer-1)}
289
- .gp-seg__btn{border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;padding:5px 10px;cursor:pointer;transition:background .12s ease,color .12s ease}
401
+ .gp-seg__btn{border:0;background:transparent;color:var(--dsw-alias-label-secondary);font:inherit;font-size:11px;white-space:nowrap;padding:5px 10px;cursor:pointer;transition:background .12s ease,color .12s ease}
290
402
  .gp-seg__btn:hover{background:var(--dsw-alias-interactive-bg-hover)}
291
403
  .gp-seg__btn--active{background:var(--dsw-alias-state-business-primary);color:#fff}
292
404
  .gp-seg__btn--active:hover{background:var(--dsw-alias-state-business-primary)}
@@ -341,6 +453,11 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
341
453
  .gp-svgdiff__body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
342
454
  .gp-feedback{padding:6px 10px;font-size:12px;color:var(--dsw-alias-state-error-primary);background:color-mix(in srgb,var(--dsw-alias-state-error-primary) 10%,transparent);display:flex;align-items:center;gap:8px}
343
455
  .gp-notice{padding:6px 10px;font-size:12px;color:var(--dsw-alias-label-secondary);background:color-mix(in srgb,var(--dsw-alias-label-secondary) 10%,transparent);display:flex;align-items:center;gap:8px}
456
+ /* Dismissible banner: the text takes the free width, the close button pins right. */
457
+ .gp-notice__text{flex:1 1 auto;min-width:0}
458
+ .gp-notice__close{flex:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;margin:-2px -4px -2px 0;padding:0;border:0;border-radius:5px;background:transparent;color:var(--dsw-alias-label-tertiary);cursor:pointer}
459
+ .gp-notice__close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
460
+ .gp-notice__close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
344
461
 
345
462
  /* commit file-diff modal (overview \u2192 click a file): a centered dialog over a
346
463
  * dimmed backdrop, closed by Esc / backdrop click / the close button. */
@@ -360,8 +477,9 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
360
477
  * changes-pane toolbar. The seg stretches evenly and the bordered close
361
478
  * button pins to the row's far right. */
362
479
  .gp-modal__bar-row{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 100%}
363
- .gp-modal__bar-row--controls .gp-seg{flex:1}
364
- .gp-modal__bar-row--controls .gp-seg__btn{flex:1;min-width:0}
480
+ .gp-modal__bar-row--controls{flex-wrap:wrap}
481
+ .gp-modal__bar-row--controls .gp-seg{flex:1 1 auto;min-width:max-content}
482
+ .gp-modal__bar-row--controls .gp-seg .gp-seg__btn{flex:1 1 0;min-width:max-content}
365
483
  .gp-modal__bar-row--controls .gp-modal__close{margin-left:auto;border:1px solid var(--dsw-alias-border-l2);border-radius:7px}
366
484
  .gp-modal__scroll{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden;font-family:var(--dsw-font-mono,monospace);font-size:12px;background:var(--dsw-alias-bg-layer-2)}
367
485
 
@@ -458,6 +576,10 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
458
576
  .gp-detail__tags{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
459
577
  .gp-detail__tagname{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:180px}
460
578
  .gp-detail__actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
579
+ /* Compact commit-detail ops: the touch rule lifts every .gp-btn to 36px, which
580
+ * makes revert / reset / create-tag tall for such low-frequency actions. Keep
581
+ * them at the compact control height (30px) instead. */
582
+ .gp-panel[data-layout="compact"] .gp-detail__actions .gp-btn{height:30px}
461
583
  .gp-ref-chip--del{display:inline-flex;align-items:center;gap:4px;max-width:100%}
462
584
  .gp-ref-chip__x{display:inline-flex;align-items:center;padding:0;margin-left:2px;border:none;background:none;color:inherit;cursor:pointer;opacity:.7}
463
585
  .gp-ref-chip__x:hover{opacity:1;color:var(--dsw-alias-state-error-primary)}
@@ -503,32 +625,38 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
503
625
  .gp-pill--compact .gp-pill__dot{display:block}
504
626
  .gp-pill--compact .gp-pill__repo,.gp-pill--compact .gp-pill__git{display:none}
505
627
 
506
- /* plugin detail config form (plugins.bundle.config slot body) */
507
- .gp-cfg{display:flex;flex-direction:column;gap:10px;padding:14px 16px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-1)}
508
- .gp-cfg__title{margin:0;font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}
628
+ /* plugin detail config form (plugins.bundle.config slot body) \u2014 font sizes
629
+ * follow the shell settings page: 15px section titles, 14px labels, 13px hints. */
630
+ .gp-cfg{display:flex;flex-direction:column;gap:12px;padding:16px 20px;border:1px solid var(--dsw-alias-border-l2);border-radius:12px;background:var(--dsw-alias-bg-layer-1)}
631
+ .gp-cfg__title{margin:0;font-size:15px;font-weight:600;color:var(--dsw-alias-label-primary)}
509
632
  .gp-cfg__row{display:inline-flex;align-items:center;gap:10px;cursor:pointer;user-select:none}
510
633
  /* \u5F00\u5173\u6E05\u96F6 border/padding\uFF1A::after \u6309 padding box \u5B9A\u4F4D\uFF0CUA \u9ED8\u8BA4 1px \u8FB9\u6846\u4F1A\u628A\u5B9A\u4F4D\u6846\u4E0A\u4E0B\u5404\u7F29 1px\uFF0C\u6ED1\u5757\u4E0A\u7F18\u5C31\u591A\u51FA 1px \u7A7A\u9699\u3002 */
511
- .gp-cfg__switch{appearance:none;-webkit-appearance:none;flex:none;width:32px;height:18px;margin:0;padding:0;border:0;border-radius:999px;background:var(--dsw-alias-border-l2);position:relative;transition:background .15s ease;cursor:pointer}
512
- .gp-cfg__switch::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:999px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s ease}
634
+ .gp-cfg__switch{appearance:none;-webkit-appearance:none;flex:none;width:36px;height:20px;margin:0;padding:0;border:0;border-radius:999px;background:var(--dsw-alias-border-l2);position:relative;transition:background .15s ease;cursor:pointer}
635
+ .gp-cfg__switch::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:999px;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s ease}
513
636
  .gp-cfg__switch:checked{background:var(--dsw-alias-state-business-primary)}
514
- .gp-cfg__switch:checked::after{transform:translateX(14px)}
637
+ .gp-cfg__switch:checked::after{transform:translateX(16px)}
515
638
  .gp-cfg__switch:disabled{opacity:.5;cursor:default}
516
639
  .gp-cfg__switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
517
- .gp-cfg__text{font-size:13px;color:var(--dsw-alias-label-primary)}
640
+ .gp-cfg__text{font-size:14px;color:var(--dsw-alias-label-primary)}
518
641
  .gp-cfg__seg{align-self:flex-start}
519
- .gp-cfg__seglabel{margin:0;font-size:13px;color:var(--dsw-alias-label-primary)}
520
- .gp-cfg__hint{margin:0;font-size:12px;line-height:1.6;color:var(--dsw-alias-label-tertiary)}
521
- .gp-cfg__err{margin:0;font-size:12px;color:var(--dsw-alias-state-error-primary)}
522
- .gp-cfg__card{display:flex;flex-direction:column;gap:10px;padding:12px 14px;border:1px solid var(--dsw-alias-border-l2);border-radius:10px;background:var(--dsw-alias-bg-layer-2)}
523
- .gp-cfg__card-title{margin:0;font-size:13px;font-weight:600;color:var(--dsw-alias-label-primary)}
642
+ .gp-cfg__seglabel{margin:0;font-size:14px;color:var(--dsw-alias-label-primary)}
643
+ .gp-cfg__hint{margin:0;font-size:13px;line-height:1.6;color:var(--dsw-alias-label-tertiary)}
644
+ .gp-cfg__err{margin:0;font-size:13px;color:var(--dsw-alias-state-error-primary)}
524
645
  .gp-cfg__numrow{display:flex;align-items:center;gap:8px}
525
- .gp-cfg__numlabel{flex:1;min-width:0;font-size:13px;color:var(--dsw-alias-label-primary)}
526
- .gp-cfg__numinput{flex:none;width:76px;height:26px;padding:0 8px;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;text-align:right}
646
+ .gp-cfg__numlabel{flex:1;min-width:0;font-size:14px;color:var(--dsw-alias-label-primary)}
647
+ .gp-cfg__numinput{flex:none;width:80px;height:30px;padding:0 8px;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:13px;text-align:right}
527
648
  .gp-cfg__numinput:focus{outline:none;border-color:var(--dsw-alias-state-business-primary)}
528
649
  .gp-cfg__numinput:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-1px}
529
650
  .gp-cfg__numinput:disabled{opacity:.5;cursor:default}
530
- .gp-cfg__numunit{flex:none;width:44px;font-size:11px;color:var(--dsw-alias-label-tertiary)}
531
- .gp-cfg__rangehint{margin:-4px 0 0;font-size:11px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
651
+ .gp-cfg__numunit{flex:none;width:44px;font-size:12px;color:var(--dsw-alias-label-tertiary)}
652
+ .gp-cfg__rangehint{margin:-4px 0 0;font-size:12px;line-height:1.5;color:var(--dsw-alias-label-tertiary)}
653
+ /* Cascading model selects use the platform Menu; the row is label + trigger. */
654
+ .gp-cfg__menur{display:flex;align-items:center;gap:8px}
655
+ .gp-cfg__menulabel{flex:1;min-width:0;font-size:14px;color:var(--dsw-alias-label-primary)}
656
+ .gp-cfg__select-trigger{max-width:240px;min-height:30px;font-size:13px}
657
+ .gp-cfg__menu{display:inline-flex;align-items:center;min-width:0}
658
+ .gp-cfg__retry{margin-left:6px;padding:0 8px;height:24px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;font-size:12px;cursor:pointer}
659
+ .gp-cfg__retry:hover{background:var(--dsw-alias-interactive-bg-hover)}
532
660
 
533
661
  /* status dot appended to the shell's Git view-tab button \u2014 shown only when the
534
662
  * input-bar marker is hidden; colour mirrors the pill branch (synced/dirty). */
@@ -537,11 +665,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
537
665
  .gp-tab-dot--dirty{background:var(--dsw-alias-state-warn-primary,#e0982e)}
538
666
 
539
667
  /* pill wrapper + rounded hover tooltip panel (openviking-manager style):
540
- * soft radius, layered shadow, subtle border, portaled above the pill. */
541
- .gp-tip{position:fixed;z-index:60;max-width:520px;padding:8px 12px;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:12px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));box-shadow:0 6px 24px rgba(0,0,0,.18),0 1px 3px rgba(0,0,0,.12);font-size:12px;line-height:1.5;pointer-events:none}
668
+ * soft radius, layered shadow, subtle border, portaled above the pill.
669
+ * width:max-content is load-bearing: a fixed box with only left set would
670
+ * shrink to the room on its right (a phone row icon left a 36px column). */
671
+ .gp-tip{position:fixed;z-index:60;width:max-content;box-sizing:border-box;max-width:520px;padding:8px 12px;border:1px solid var(--dsw-alias-border-l1,var(--dsw-alias-border-l2));border-radius:12px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-bg-layer-2));box-shadow:0 6px 24px rgba(0,0,0,.18),0 1px 3px rgba(0,0,0,.12);font-size:12px;line-height:1.5;pointer-events:none}
542
672
  .gp-tip__path{color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-mono,ui-monospace,monospace);word-break:break-all}
543
673
  .gp-tip__note{margin-top:4px;color:var(--dsw-alias-label-tertiary)}
544
674
  .gp-tip--sb{color:var(--dsw-alias-label-secondary);line-height:1.45}
675
+ /* Compact panels put the control's centre in the left offset and shift by half
676
+ * the bubble's own width, so it reads as centred on the row icon it explains. */
677
+ .gp-tip--center{transform:translateX(-50%)}
545
678
 
546
679
  /* ===================================================================
547
680
  * Compact (mobile / narrow-split) layout
@@ -554,13 +687,16 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
554
687
  * own classes / viewport media queries instead.
555
688
  * =================================================================== */
556
689
 
557
- /* Tab bar: wrap the trailing cluster onto a second full-width row so the
558
- * font stepper + version bar stay reachable instead of being hidden. */
559
- .gp-panel[data-layout="compact"] .gp-tabbar{flex-wrap:wrap;row-gap:4px}
560
- .gp-panel[data-layout="compact"] .gp-tabbar__trailing{display:flex;flex-basis:100%;align-items:center;gap:8px;margin-top:2px}
561
- .gp-panel[data-layout="compact"] .gp-tabbar .gp-font,
562
- .gp-panel[data-layout="compact"] .gp-tabbar .gp-verbar{display:inline-flex}
563
- .gp-panel[data-layout="compact"] .gp-tab{height:36px}
690
+ /* Tab bar: one row. The switcher drops its labels to icon-only and takes the
691
+ * remaining width (the three icon cells stay equal and touch-sized), while the
692
+ * font stepper rides the same row at the trailing edge. The version bar is not
693
+ * mounted at all in compact (Panel.tsx), so the bar keeps a single row.
694
+ * The label stays in the DOM \u2014 clipped, not display:none \u2014 so the tab keeps its
695
+ * accessible name for screen readers. */
696
+ .gp-panel[data-layout="compact"] .gp-tabbar__tabs{flex:1 1 auto}
697
+ .gp-panel[data-layout="compact"] .gp-tabbar__tabs--single{flex:0 0 auto}
698
+ .gp-panel[data-layout="compact"] .gp-tabbar__trailing{display:flex;flex:none;align-items:center;margin-left:auto}
699
+ .gp-panel[data-layout="compact"] .gp-tab__label{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
564
700
 
565
701
  /* Shared drill-in back bar (overview detail / files preview). The Changes
566
702
  * diff and Files bar reuse just the .gp-subhead__back button inline. */
@@ -568,7 +704,14 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
568
704
  .gp-subhead__back{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 10px;border:1px solid var(--dsw-alias-border-l2);border-radius:8px;background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;font-size:12px;cursor:pointer;flex:none;white-space:nowrap}
569
705
  .gp-subhead__back:hover{background:var(--dsw-alias-interactive-bg-hover)}
570
706
  .gp-subhead__back:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:-2px}
571
- .gp-subhead__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--dsw-alias-label-tertiary)}
707
+ /* Compact drill-in back buttons (\u8FD4\u56DE\u5217\u8868 / \u8FD4\u56DE\u6587\u4EF6\u6811 / \u8FD4\u56DE\u53D8\u66F4\u5217\u8868) match the
708
+ * 30px control height of the history toolbar's branch-filter pill. */
709
+ .gp-panel[data-layout="compact"] .gp-subhead__back{height:30px}
710
+ /* The compact commit-detail header carries the change summary on the back
711
+ * button's row: the summary drops its own hairline/padding and takes the
712
+ * trailing edge, clipped (never wrapped) when the counts run long. */
713
+ .gp-panel[data-layout="compact"] .gp-detail__summary--inline{margin:0 0 0 auto;padding:0;border-bottom:0;min-width:0;overflow:hidden}
714
+ .gp-panel[data-layout="compact"] .gp-detail__summary--inline>span{white-space:nowrap}
572
715
 
573
716
  /* Overview: single column, each pane fills width + height. */
574
717
  .gp-overview--compact{flex-direction:column}
@@ -667,12 +810,19 @@ a.gp-statusbar__repo:hover{background:var(--dsw-alias-interactive-bg-hover);colo
667
810
  @media (prefers-reduced-motion:reduce){
668
811
  .gp-sheet,.gp-sheet-backdrop,.gp-modal,.gp-modal-backdrop,.gp-zl-mask{animation:none}
669
812
  }
670
- `,Cn=!1;function or(){if(Cn||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){Cn=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=ti,document.head.appendChild(t),Cn=!0}var sr={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","tab.overview":"Git \u603B\u89C8","tab.changes":"\u53D8\u66F4\u8BB0\u5F55","tab.files":"\u6587\u4EF6\u6D4F\u89C8","pill.unavailable":"Git \u4E0D\u53EF\u7528","pill.detached":"\u6E38\u79BB HEAD","pill.synced":"\u672C\u5730\u5DF2\u540C\u6B65","pill.dirty":"\u6709\u5F85\u63D0\u4EA4\u7684\u53D8\u66F4","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.retry":"\u91CD\u8BD5","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","ops.aiHint":"\u63D0\u793A\uFF1A\u7ED9 AI \u591A\u4E00\u70B9\u4FE1\u4EFB\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u8BA9 AI \u76F4\u63A5\u6267\u884C Git \u64CD\u4F5C\u3002","version.check":"\u68C0\u67E5\u65B0\u7248\u672C","version.checking":"\u68C0\u67E5\u4E2D\u2026","version.upToDate":"\u5DF2\u662F\u6700\u65B0\uFF08{current}\uFF09","version.updateAvailable":"\u6709\u65B0\u7248\u672C {latest}\uFF08\u5F53\u524D {current}\uFF09","version.viewRelease":"\u67E5\u770B\u53D1\u5E03","version.error":"\u68C0\u67E5\u5931\u8D25","version.noRepo":"\u672A\u914D\u7F6E\u4ED3\u5E93\u5730\u5740","version.openRepo":"\u8BBF\u95EE GitHub \u67E5\u770B @xbzbing/dsh-git-panel \u9879\u76EE\uFF0C\u8BF7\u4E3A\u9879\u76EE\u70B9\u4EAE\u4E00\u9897\u5C0F\u661F\u661F\u5427 \u2B50","overview.head":"\u5168\u90E8\u5206\u652F","overview.local":"\u672C\u5730","overview.remote":"\u8FDC\u7A0B","overview.tags":"\u6807\u7B7E","overview.search":"\u641C\u7D22\u63D0\u4EA4\uFF08\u6D88\u606F / \u54C8\u5E0C\uFF09","overview.searchShort":"\u641C\u7D22\u63D0\u4EA4","overview.allUsers":"\u5168\u90E8\u4F5C\u8005","overview.allTime":"\u5168\u90E8\u65F6\u95F4","overview.today":"\u4ECA\u5929","overview.last7d":"\u8FD1 7 \u5929","overview.last30d":"\u8FD1 30 \u5929","overview.selectCommit":"\u9009\u62E9\u4E00\u4E2A\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5","overview.noMessage":"\uFF08\u65E0\u63D0\u4EA4\u6B63\u6587\uFF09","overview.noResults":"\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4","overview.loadFailed":"\u52A0\u8F7D\u5931\u8D25","overview.detailFailed":"\u8BE6\u60C5\u52A0\u8F7D\u5931\u8D25","overview.diffFailed":"\u5DEE\u5F02\u52A0\u8F7D\u5931\u8D25","overview.openFileDiff":"\u67E5\u770B\u8BE5\u6587\u4EF6\u5728\u6B64\u63D0\u4EA4\u4E2D\u7684\u53D8\u66F4","overview.changeSummary":"{files} \u4E2A\u6587\u4EF6","overview.expandDir":"\u5C55\u5F00\u76EE\u5F55","overview.collapseDir":"\u6298\u53E0\u76EE\u5F55","overview.fetch":"\u62C9\u53D6\u8FDC\u7A0B","overview.branchesError":"\u5206\u652F\u52A0\u8F7D\u5931\u8D25","overview.filterBranch":"\u6309\u5206\u652F\u7B5B\u9009","overview.backToList":"\u8FD4\u56DE\u5217\u8868","overview.createTag":"\u521B\u5EFA\u6807\u7B7E","overview.revert":"\u8FD8\u539F\u6B64\u63D0\u4EA4","overview.reset":"\u91CD\u7F6E\u5230\u6B64","switch.action":"\u5207\u6362","switch.rowTitle":"\u5207\u6362\u5230 {name}","switch.rowTitleTrack":"\u4ECE {ref} \u65B0\u5EFA\u8DDF\u8E2A\u5206\u652F {name} \u5E76\u5207\u6362","switch.detached":"\u6E38\u79BB HEAD","switch.confirmTitle":"\u5207\u6362\u5206\u652F","switch.body":"\u4ECE {from} \u5207\u6362\u5230 {to}\u3002","switch.trackingNote":"\u672C\u5730\u8FD8\u6CA1\u6709 {name}\uFF0C\u5C06\u5148\u4ECE {ref} \u521B\u5EFA\u5B83\u5E76\u8BBE\u7F6E\u8DDF\u8E2A\uFF08upstream\uFF09\u3002","switch.dirtyWarn":"\u5F53\u524D\u6709 {count} \u4E2A\u6587\u4EF6\u5B58\u5728\u672A\u63D0\u4EA4\u53D8\u66F4\u3002","switch.modeDirect":"\u76F4\u63A5\u5207\u6362","switch.modeDirectHint":"\u672A\u63D0\u4EA4\u53D8\u66F4\u4F1A\u968F\u5DE5\u4F5C\u533A\u5E26\u8FC7\u53BB\uFF1B\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\uFF0CGit \u4F1A\u62D2\u7EDD\u5207\u6362\uFF0C\u5DE5\u4F5C\u533A\u4FDD\u6301\u4E0D\u53D8\u3002","switch.modeStash":"\u5148\u8D2E\u85CF {count} \u4E2A\u6587\u4EF6\u7684\u53D8\u66F4\uFF0C\u518D\u5207\u6362","switch.modeStashHint":"\u53D8\u66F4\u79FB\u5165\u8D2E\u85CF\u6808\u9876\uFF08\u542B\u672A\u8DDF\u8E2A\u6587\u4EF6\uFF09\uFF0C\u5207\u6362\u540E\u53EF\u4ECE\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\u3002\u6CE8\u610F\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u6062\u590D\uFF1B\u6062\u590D\u65F6\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\u9700\u624B\u52A8\u89E3\u51B3\u3002","switch.confirm":"\u5207\u6362","switch.confirmStash":"\u8D2E\u85CF\u5E76\u5207\u6362","switch.switching":"\u6B63\u5728\u5207\u6362\u2026","switch.stashMessage":"\u5207\u6362\u5230 {branch} \u524D\u81EA\u52A8\u8D2E\u85CF","tag.createTitle":"\u5728\u6B64\u63D0\u4EA4\u521B\u5EFA\u6807\u7B7E","tag.namePlaceholder":"\u6807\u7B7E\u540D","tag.annotated":"\u9644\u6CE8\u6807\u7B7E\uFF08\u5E26\u8BF4\u660E\uFF09","tag.messagePlaceholder":"\u6807\u7B7E\u8BF4\u660E","tag.create":"\u521B\u5EFA\u6807\u7B7E","tag.deleteTitle":"\u5220\u9664\u6807\u7B7E","tag.deleteConfirm":"\u786E\u5B9A\u5220\u9664\u6807\u7B7E\u300C{name}\u300D\uFF1F","tag.deleteOne":"\u5220\u9664\u6807\u7B7E\u300C{name}\u300D","ops.dirtyWarn":"\u68C0\u6D4B\u5230\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8FD9\u4E9B\u6539\u52A8\u53EF\u80FD\u662F dsh AI \u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\u3002","revert.title":"\u8FD8\u539F\u63D0\u4EA4","revert.body":"\u5C06\u5728\u5F53\u524D HEAD \u8FFD\u52A0\u4E00\u4E2A\u53CD\u5411\u63D0\u4EA4\uFF0C\u8FD8\u539F {ref} \u7684\u6539\u52A8\u3002\u4E0D\u4F1A\u4E22\u5F03\u4F60\u7684\u5DE5\u4F5C\u533A\u6539\u52A8\u3002","revert.confirm":"\u8FD8\u539F","reset.title":"\u91CD\u7F6E\u5206\u652F","reset.body":"\u5C06\u628A\u5F53\u524D\u5206\u652F\u7684 HEAD \u4ECE {from} \u79FB\u52A8\u5230 {to}\u3002","reset.modeSoft":"\u8F6F\u91CD\u7F6E\uFF08--soft\uFF09","reset.softHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u6682\u5B58\u533A\u3002","reset.modeMixed":"\u6DF7\u5408\u91CD\u7F6E\uFF08--mixed\uFF0C\u9ED8\u8BA4\uFF09","reset.mixedHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u5DE5\u4F5C\u533A\u3002","reset.modeHard":"\u786C\u91CD\u7F6E\uFF08--hard\uFF09","reset.hardHint":"\u79FB\u52A8 HEAD \u5230\u6B64\u63D0\u4EA4\u5E76\u4E22\u5F03\u6240\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF08\u672A\u63D0\u4EA4\u6539\u52A8\u65E0\u6CD5\u6062\u590D\uFF09\u3002","reset.hardOrphan":"\u5F53\u524D\u5206\u652F\u4E0A\u665A\u4E8E\u76EE\u6807\u7684\u63D0\u4EA4\u4F1A\u79BB\u5F00\u5206\u652F\uFF08\u4ECD\u53EF\u7528 git reflog \u627E\u56DE\uFF09\u3002","reset.hardWarn":"\u4EE5\u4E0B\u672A\u63D0\u4EA4\u6539\u52A8\u5C06\u88AB\u6C38\u4E45\u4E22\u5F03\uFF1A","reset.lostMore":"\u2026\u8FD8\u6709\u66F4\u591A\u672A\u63D0\u4EA4\u6539\u52A8\u672A\u663E\u793A\uFF08\u5217\u8868\u5DF2\u622A\u65AD\uFF09","reset.hardAck":"\u6211\u5DF2\u4E86\u89E3\uFF0C\u786E\u8BA4\u4E22\u5F03\u8FD9\u4E9B\u672A\u63D0\u4EA4\u6539\u52A8","reset.hardAckClean":"\u6211\u5DF2\u4E86\u89E3\u6B64\u64CD\u4F5C\u7684\u540E\u679C\uFF0C\u786E\u8BA4\u91CD\u7F6E","reset.confirm":"\u91CD\u7F6E","changes.groupStaged":"\u5DF2\u6682\u5B58\u7684\u66F4\u6539","changes.groupUnstaged":"\u66F4\u6539","changes.groupUntracked":"\u672A\u7248\u672C\u63A7\u5236\u7684\u6587\u4EF6","changes.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u53D8\u66F4","changes.noChanges":"\u6CA1\u6709\u672A\u63D0\u4EA4\u7684\u53D8\u66F4","changes.stageAll":"\u5168\u90E8\u6682\u5B58","changes.unstageAll":"\u5168\u90E8\u53D6\u6D88\u6682\u5B58","changes.stage":"\u6682\u5B58","changes.unstage":"\u53D6\u6D88\u6682\u5B58","changes.discard":"\u653E\u5F03\u66F4\u6539","changes.discardConfirm":"\u518D\u6B21\u70B9\u51FB\u4EE5\u786E\u8BA4\u653E\u5F03","changes.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","stash.title":"\u8D2E\u85CF\u5F53\u524D\u66F4\u6539","stash.messagePlaceholder":"\u8D2E\u85CF\u8BF4\u660E\uFF08\u53EF\u9009\uFF09","stash.save":"\u8D2E\u85CF","stash.section":"\u8D2E\u85CF","stash.onBranch":"\u4F4D\u4E8E {branch}","stash.apply":"\u5E94\u7528","stash.pop":"\u5F39\u51FA","stash.drop":"\u4E22\u5F03","stash.dropTitle":"\u4E22\u5F03\u8D2E\u85CF","stash.dropConfirm":"\u786E\u5B9A\u4E22\u5F03\u6B64\u8D2E\u85CF\u6761\u76EE\uFF1F\u4E22\u5F03\u540E\u65E0\u6CD5\u6062\u590D\uFF1A{name}","files.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.loadFailed":"\u52A0\u8F7D\u5931\u8D25","files.backToTree":"\u8FD4\u56DE\u6587\u4EF6\u6811","files.truncated":"\u6761\u76EE\u8FC7\u591A\uFF0C\u5DF2\u622A\u65AD","files.tooLarge":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8","files.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u9884\u89C8","files.highlightOff":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5173\u95ED\u8BED\u6CD5\u9AD8\u4EAE\u4EE5\u4FDD\u6301\u6D41\u7545","files.lineTruncated":" \u2026\uFF08\u6B64\u884C\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09","files.findPlaceholder":"\u5728\u6B64\u6587\u4EF6\u4E2D\u67E5\u627E","files.findNoMatch":"\u65E0\u5339\u914D","files.findPrev":"\u4E0A\u4E00\u4E2A","files.findNext":"\u4E0B\u4E00\u4E2A","files.findClose":"\u5173\u95ED\u67E5\u627E","files.findCase":"\u533A\u5206\u5927\u5C0F\u5199","files.previewMode":"\u9884\u89C8\u65B9\u5F0F","files.source":"\u6E90\u7801","files.render":"\u6E32\u67D3","files.copyPath":"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","files.pathCopied":"\u8DEF\u5F84\u5DF2\u590D\u5236","files.pathCopyFailed":"\u590D\u5236\u5931\u8D25","files.copyContent":"\u590D\u5236\u6587\u4EF6\u5185\u5BB9","files.contentCopied":"\u5185\u5BB9\u5DF2\u590D\u5236","files.contentCopyFailed":"\u590D\u5236\u5931\u8D25","files.ignored":"\u5DF2\u88AB Git \u5FFD\u7565","files.copy":"\u590D\u5236\u4EE3\u7801","files.copied":"\u5DF2\u590D\u5236","files.footnotes":"\u6CE8\u91CA","files.zoomBar":"\u56FE\u7247\u7F29\u653E","files.zoomIn":"\u653E\u5927","files.zoomOut":"\u7F29\u5C0F","files.zoomActual":"\u5B9E\u9645\u5927\u5C0F\uFF08100%\uFF09","files.zoomFit":"\u9002\u5E94\u7A97\u53E3","files.zoomFullscreen":"\u5168\u5C4F\u67E5\u770B","files.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","files.propsTitle":"\u6587\u4EF6\u5C5E\u6027","files.propsGroupStats":"\u5927\u5C0F\u4E0E\u7EDF\u8BA1","files.propsGroupTime":"\u65F6\u95F4","files.propsName":"\u540D\u79F0","files.propsType":"\u7C7B\u578B","files.propsTypeImage":"{fmt} \u56FE\u7247","files.propsTypeText":"\u6587\u672C\u6587\u4EF6","files.propsTypeBinary":"\u4E8C\u8FDB\u5236\u6587\u4EF6","files.propsTypeUnread":"\u8FC7\u5927\u672A\u8BFB\u53D6","files.propsTypeFmt":"{label}\uFF08.{ext}\uFF09","files.propsRelPath":"\u76F8\u5BF9\u8DEF\u5F84","files.propsAbsPath":"\u7EDD\u5BF9\u8DEF\u5F84","files.propsCopyHint":"\u70B9\u51FB\u590D\u5236","files.propsSize":"\u5927\u5C0F","files.propsSizeBytes":"\uFF08{bytes} \u5B57\u8282\uFF09","files.propsLines":"\u884C\u6570","files.propsImageSize":"\u56FE\u7247\u5C3A\u5BF8","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"\u4FEE\u6539\u65F6\u95F4","files.propsUntracked":"\u672A\u8DDF\u8E2A","files.propsTrackedYes":"\u5DF2\u8DDF\u8E2A","files.propsStaged":"\u5DF2\u6682\u5B58","files.stAdded":"\u5DF2\u6DFB\u52A0","files.stModified":"\u5DF2\u4FEE\u6539","files.stDeleted":"\u5DF2\u5220\u9664","files.stRenamed":"\u5DF2\u91CD\u547D\u540D","files.stConflicted":"\u6709\u51B2\u7A81","files.stTypechange":"\u7C7B\u578B\u53D8\u66F4","stats.files":"{n} \u4E2A\u6587\u4EF6","stats.lastChange":"\u6700\u8FD1\u53D8\u66F4 {time}","stats.lastCommit":"\u4E0A\u6B21\u63D0\u4EA4 {time}","stats.staged":"\u5DF2\u6682\u5B58 {n}","stats.modified":"\u5DF2\u4FEE\u6539 {n}","stats.untracked":"\u672A\u8DDF\u8E2A {n}","stats.partial":"\u7EDF\u8BA1\u5DF2\u7B80\u5316","stats.partialHint":"\u53D8\u66F4\u6570\u91CF\u8F83\u591A\uFF0C\u5DF2\u8DF3\u8FC7\u672A\u8DDF\u8E2A\u6587\u4EF6\u884C\u6570\u4E0E\u6700\u8FD1\u53D8\u66F4\u65F6\u95F4\u7684\u7CBE\u786E\u7EDF\u8BA1\u4EE5\u4FDD\u6301\u9762\u677F\u6D41\u7545\u3002","commit.placeholder":"\u63D0\u4EA4\u4FE1\u606F","commit.commit":"\u63D0\u4EA4","commit.amend":"\u4FEE\u6B63\u4E0A\u6B21\u63D0\u4EA4\uFF08amend\uFF09","commit.suggest":"AI \u751F\u6210","commit.suggesting":"\u751F\u6210\u4E2D\u2026","commit.suggestOverwrite":"\u518D\u6B21\u70B9\u51FB\u300CAI \u751F\u6210\u300D\u4EE5\u8986\u76D6\u5F53\u524D\u63D0\u4EA4\u4FE1\u606F","commit.suggestTruncated":"diff \u8FC7\u957F\u5DF2\u622A\u65AD\uFF0C\u751F\u6210\u7684\u5EFA\u8BAE\u53EF\u80FD\u4E0D\u5B8C\u6574","diff.unified":"\u7EDF\u4E00","diff.split":"\u5BF9\u7167","diff.before":"\u53D8\u66F4\u524D","diff.after":"\u53D8\u66F4\u540E","diff.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.tooLarge":"\u56FE\u7247\u8FC7\u5927\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.imageMissing":"\u4E0D\u5B58\u5728","diff.svgRender":"\u6E32\u67D3","diff.svgSource":"\u6E90\u7801","diff.empty":"\u65E0\u5DEE\u5F02","diff.expandAll":"\u5C55\u5F00\u5168\u90E8","diff.collapse":"\u6298\u53E0\u672A\u53D8\u66F4","diff.expandGap":"\u5C55\u5F00\u5168\u90E8 {n} \u884C","diff.expandUp":"\u5411\u4E0A\u5C55\u5F00 {n} \u884C","diff.expandDown":"\u5411\u4E0B\u5C55\u5F00 {n} \u884C","diff.expandCapped":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5C55\u5F00 {n} \u884C\u4E0A\u4E0B\u6587\uFF0C\u5176\u4F59\u4FDD\u6301\u6298\u53E0\uFF0C\u53EF\u9010\u6BB5\u5C55\u5F00","diff.truncated":"git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF1A\u6B64\u5DEE\u5F02\u53EA\u4FDD\u7559\u4E86\u5C3E\u6BB5\uFF0C\u5F00\u5934\u7684\u6539\u52A8\u4E0E\u589E\u5220\u7EDF\u8BA1\u53EF\u80FD\u7F3A\u5931","time.justNow":"\u521A\u521A","time.minutesAgo":"{n} \u5206\u949F\u524D","time.hoursAgo":"{n} \u5C0F\u65F6\u524D","time.daysAgo":"{n} \u5929\u524D","error.generic":"\u64CD\u4F5C\u5931\u8D25","error.notARepo":"\u5F53\u524D\u76EE\u5F55\u4E0D\u662F Git \u4ED3\u5E93","error.noCwd":"\u5F53\u524D\u4F1A\u8BDD\u65E0\u5DE5\u4F5C\u76EE\u5F55","error.localChangesBlock":"\u672C\u5730\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u64CD\u4F5C\u88AB\u963B\u6B62","error.emptyMessage":"\u63D0\u4EA4\u4FE1\u606F\u4E0D\u80FD\u4E3A\u7A7A","error.emptyDiff":"\u6CA1\u6709\u53EF\u751F\u6210\u7684\u53D8\u66F4","error.llmUnavailable":"AI \u670D\u52A1\u4E0D\u53EF\u7528","error.llmFailed":"AI \u751F\u6210\u5931\u8D25","error.suggestDisabled":"AI \u751F\u6210\u5DF2\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u5173\u95ED","error.conflict":"\u8D2E\u85CF\u5E94\u7528\u4EA7\u751F\u51B2\u7A81\uFF0C\u8D2E\u85CF\u6761\u76EE\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u624B\u52A8\u89E3\u51B3\u51B2\u7A81\u540E\u518D\u8BD5","error.revertConflict":"\u8FD8\u539F\u4F1A\u4E0E\u5F53\u524D\u5185\u5BB9\u51B2\u7A81\uFF0C\u5DF2\u81EA\u52A8\u53D6\u6D88\u8FD8\u539F\uFF08\u672A\u6539\u52A8\u4F60\u7684\u5DE5\u4F5C\u533A\uFF09","error.revertStuck":"\u8FD8\u539F\u4EA7\u751F\u51B2\u7A81\u4E14\u81EA\u52A8\u53D6\u6D88\u5931\u8D25\uFF0C\u4ED3\u5E93\u4ECD\u5904\u4E8E\u8FD8\u539F\u4E2D\uFF0C\u8BF7\u624B\u52A8\u6267\u884C git revert --abort \u6216\u89E3\u51B3\u51B2\u7A81","error.revertMerge":"\u8FD9\u662F\u4E00\u4E2A\u5408\u5E76\u63D0\u4EA4\uFF0C\u9762\u677F\u6682\u4E0D\u652F\u6301\u8FD8\u539F\uFF08\u9700\u6307\u5B9A\u4E3B\u7EBF\u7236\u63D0\u4EA4\uFF09\uFF0C\u8BF7\u5728\u547D\u4EE4\u884C\u7528 git revert -m \u5904\u7406","error.indexBusy":"Git \u6B63\u5FD9\uFF08\u53E6\u4E00\u8FDB\u7A0B\u5360\u7528\u7D22\u5F15\uFF09\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","error.notFound":"\u76EE\u6807\u4E0D\u5B58\u5728\uFF08\u5206\u652F / \u6807\u7B7E / \u8D2E\u85CF\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u91CD\u547D\u540D\uFF09","error.branchInUse":"\u8BE5\u5206\u652F\u5DF2\u5728\u53E6\u4E00\u4E2A\u5DE5\u4F5C\u6811\u4E2D\u68C0\u51FA\uFF0C\u65E0\u6CD5\u5728\u6B64\u5207\u6362","error.stashSwitchFailed":"\u672A\u63D0\u4EA4\u53D8\u66F4\u5DF2\u8D2E\u85CF\uFF08\u53EF\u5728\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\uFF09\uFF0C\u4F46\u5207\u6362\u5931\u8D25\uFF1A{reason}","error.invalidName":"\u540D\u79F0\u4E0D\u5408\u6CD5","error.notFastForward":"\u672C\u5730\u4E0E\u8FDC\u7A0B\u5206\u652F\u5DF2\u5206\u53C9\uFF0C\u65E0\u6CD5\u5FEB\u8FDB\u62C9\u53D6\uFF0C\u8BF7\u624B\u52A8\u5408\u5E76\u6216\u53D8\u57FA","error.pushRejected":"\u63A8\u9001\u88AB\u62D2\u7EDD\uFF1A\u8FDC\u7A0B\u5DF2\u6709\u65B0\u63D0\u4EA4\uFF0C\u8BF7\u5148\u300C\u68C0\u67E5\u540C\u6B65\u300D\u5E76\u62C9\u53D6\u540E\u518D\u63A8\u9001","error.authFailed":"\u8BA4\u8BC1\u5931\u8D25\uFF1A\u6CA1\u6709\u53EF\u7528\u7684 git \u51ED\u636E\uFF08HTTPS \u9700\u51ED\u636E\u52A9\u624B\u3001SSH \u9700\u5BC6\u94A5\uFF09\u3002\u8BF7\u5148\u5728\u547D\u4EE4\u884C\u5B8C\u6210\u4E00\u6B21\u63A8\u9001\u4EE5\u7F13\u5B58\u51ED\u636E","status.openRepo":"\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.openRepoOn":"\u5728 {host} \u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.synced":"\u5DF2\u4E0E\u8FDC\u7A0B\u540C\u6B65","status.ahead":"\u9886\u5148 {n}","status.behind":"\u843D\u540E {n}","status.diverged":"\u5DF2\u5206\u53C9\uFF08\u9886\u5148 {ahead} / \u843D\u540E {behind}\uFF09","status.noUpstream":"\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u5206\u652F","status.detached":"\u6E38\u79BB HEAD\uFF0C\u65E0\u5206\u652F\u540C\u6B65\u72B6\u6001","status.check":"\u68C0\u67E5\u540C\u6B65\u72B6\u6001","status.checkTitle":"\u68C0\u67E5\u4E0E\u8FDC\u7A0B\u7684\u540C\u6B65\u72B6\u6001\uFF1A\u6267\u884C git fetch \u62C9\u53D6\u6700\u65B0\u5F15\u7528\u5E76\u5237\u65B0\u9886\u5148/\u843D\u540E\u8BA1\u6570\uFF0C\u4E0D\u6539\u52A8\u5DE5\u4F5C\u533A","status.pull":"\u62C9\u53D6","status.pulling":"\u540C\u6B65\u4E2D\u2026","status.pullTitle":"\u5FEB\u8FDB\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmTitle":"\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmBody":"\u5C06\u4EE5\u5FEB\u8FDB\u65B9\u5F0F\u628A\u5F53\u524D\u5206\u652F {branch} \u66F4\u65B0\u5230\u8FDC\u7A0B\u6700\u65B0\u63D0\u4EA4\uFF08\u843D\u540E {behind} \u4E2A\u63D0\u4EA4\uFF09\u3002\u4EC5\u5728\u672A\u5206\u53C9\u65F6\u53EF\u884C\uFF0C\u4E0D\u4F1A\u4EA7\u751F\u5408\u5E76\u63D0\u4EA4\uFF0C\u4E5F\u4E0D\u4F1A\u6539\u52A8\u4F60\u7684\u672A\u63D0\u4EA4\u5185\u5BB9\u3002","status.pullConfirm":"\u62C9\u53D6","status.pullScope":"\u5C06\u5F15\u5165 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pullScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u8FDC\u7A0B\u5DEE\u5F02\u2026","status.push":"\u63A8\u9001","status.pushTitle":"\u63A8\u9001\u672C\u5730\u63D0\u4EA4\u5230\u8FDC\u7A0B","status.pushConfirmTitle":"\u63A8\u9001\u5230\u8FDC\u7A0B","status.pushConfirmBody":"\u5C06\u628A\u5F53\u524D\u5206\u652F {branch} \u9886\u5148\u8FDC\u7A0B\u7684 {ahead} \u4E2A\u63D0\u4EA4\u63A8\u9001\u5230\u4E0A\u6E38\u3002\u4EC5\u505A\u5FEB\u8FDB\u63A8\u9001\uFF0C\u4E0D\u4F1A\u5F3A\u5236\u8986\u76D6\u8FDC\u7A0B\u5386\u53F2\u3002","status.pushConfirm":"\u63A8\u9001","status.pushing":"\u63A8\u9001\u4E2D\u2026","status.pushScope":"\u5C06\u63A8\u9001 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pushScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u5F85\u63A8\u9001\u5DEE\u5F02\u2026","status.publish":"\u53D1\u5E03","status.publishTitle":"\u53D1\u5E03\u5206\u652F\u5E76\u8BBE\u7F6E\u4E0A\u6E38","status.publishConfirmTitle":"\u53D1\u5E03\u5206\u652F\u5230\u8FDC\u7A0B","status.publishConfirmBody":"\u5F53\u524D\u5206\u652F {branch} \u5C1A\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u3002\u5C06\u6267\u884C git push -u {remote} \u5728\u8FDC\u7A0B\u521B\u5EFA\u540C\u540D\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\u8DDF\u8E2A\u3002","status.publishConfirm":"\u53D1\u5E03","status.publishing":"\u53D1\u5E03\u4E2D\u2026","cfg.title":"\u8F93\u5165\u6846\u5206\u652F\u6807\u8BB0","cfg.toggle":"\u663E\u793A\u8F93\u5165\u6846\u6807\u8BB0","cfg.hint":"\u5F00\u542F\u65F6\u5728\u8F93\u5165\u6846\u663E\u793A zsh \u98CE\u683C\u7684 <\u4ED3\u5E93\u540D> (\u5206\u652F) \u6807\u8BB0\uFF1B\u5173\u95ED\u540E\u6539\u4E3A\u5728 Git \u6807\u7B7E\u65C1\u663E\u793A\u72B6\u6001\u5706\u70B9\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffTitle":"\u5DEE\u5F02\u5BF9\u6BD4\u9ED8\u8BA4\u89C6\u56FE","cfg.diffHint":"\u9009\u62E9\u53D8\u66F4\u5BF9\u6BD4\u9ED8\u8BA4\u6253\u5F00\u7684\u5E03\u5C40\uFF1A\u7EDF\u4E00\u89C6\u56FE\u4E3A\u5355\u680F\u884C\u5185\u5BF9\u6BD4\uFF0C\u5E76\u6392\u89C6\u56FE\u4E3A\u5DE6\u53F3\u5206\u680F\u5BF9\u6BD4\u3002\u4ECD\u53EF\u5728\u6BCF\u4E2A\u5DEE\u5F02\u89C6\u56FE\u4E2D\u4E34\u65F6\u5207\u6362\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffUnified":"\u7EDF\u4E00\u89C6\u56FE\uFF08\u5355\u680F\u884C\u5185\uFF09","cfg.diffSplit":"\u5E76\u6392\u89C6\u56FE\uFF08\u5DE6\u53F3\u5206\u680F\uFF09","cfg.graphTitle":"\u63D0\u4EA4\u5386\u53F2\u56FE\u7EBF\u6761\u6837\u5F0F","cfg.graphHint":"\u9009\u62E9\u63D0\u4EA4\u5386\u53F2\u56FE\u7684\u8FDE\u7EBF\u753B\u6CD5\uFF1A\u5E73\u884C\u7EBF\u4E3A VSCode / \u56FE\u5F62\u754C\u9762\u98CE\u683C\uFF0C\u5206\u652F\u5404\u5360\u4E00\u5217\u3001\u5171\u4EAB\u7956\u5148\u4EE5\u5E76\u884C\u7EBF\u8868\u793A\uFF1B\u7D27\u51D1\u4E3A git log \u547D\u4EE4\u884C\u98CE\u683C\uFF0C\u5171\u4EAB\u7956\u5148\u5408\u5E76\u4E3A\u4E00\u5217\u3001\u7EBF\u66F4\u5C11\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.graphParallel":"\u5E73\u884C\u7EBF\uFF08VSCode \u98CE\u683C\uFF09","cfg.graphCompact":"\u7D27\u51D1\uFF08git log \u98CE\u683C\uFF09","cfg.suggestTitle":"AI \u751F\u6210\u63D0\u4EA4\u4FE1\u606F","cfg.suggestToggle":"\u63D0\u4EA4\u6846\u663E\u793A AI \u751F\u6210\u6309\u94AE","cfg.suggestLangLabel":"\u751F\u6210\u8BED\u8A00","cfg.suggestLangAuto":"\u81EA\u52A8","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"\u81EA\u52A8 = \u8DDF\u968F\u4F60\u5728\u6B64\u4ED3\u5E93\u7684\u63D0\u4EA4\u8BED\u8A00\uFF08\u5C31\u8FD1\u52A0\u6743\uFF0C\u5F53\u524D git \u4F5C\u8005\u4F18\u5148\uFF0C\u5FFD\u7565 release / merge \u7B49\u673A\u68B0\u63D0\u4EA4\uFF09\uFF1B\u4E2D\u6587 / English \u76F4\u63A5\u6307\u5B9A\u3002","cfg.suggestMaxBytesLabel":"\u8F93\u5165\u9884\u7B97","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"\u53D1\u9001\u7ED9\u6A21\u578B\u7684 diff \u4E0A\u9650\uFF0C\u8D85\u51FA\u4F1A\u622A\u65AD\uFF1B\u8303\u56F4 16\u2013512\u3002","cfg.suggestOutputLabel":"\u8F93\u51FA\u4E0A\u9650","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"\u6A21\u578B\u751F\u6210\u9884\u7B97\uFF1B\u601D\u8003\u6A21\u578B\u7684\u63A8\u7406\u8BA1\u5165\u8BE5\u9884\u7B97\uFF1B\u8303\u56F4 256\u201316384\u3002","cfg.suggestTimeoutLabel":"\u751F\u6210\u8D85\u65F6","cfg.suggestTimeoutUnit":"\u79D2","cfg.suggestTimeoutHint":"\u8D85\u65F6\u5373\u751F\u6210\u5931\u8D25\uFF1B\u8303\u56F4 5\u2013120\u3002","cfg.suggestHint":"\u5F00\u542F\u540E\u63D0\u4EA4\u6846\u65C1\u4F1A\u51FA\u73B0\u300CAI \u751F\u6210\u300D\u6309\u94AE\uFF1A\u6839\u636E\u5F53\u524D\u53D8\u66F4\u4E0E\u4ED3\u5E93\u65E2\u6709\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u751F\u6210\u7684\u8BF7\u6C42\u4F1A\u4F7F\u7528\u4F60\u5728 DSH \u4E2D\u914D\u7F6E\u7684\u6A21\u578B\uFF0Cdiff \u5185\u5BB9\u4F1A\u53D1\u9001\u7ED9\u6A21\u578B\u4F9B\u5E94\u5546\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.notLoaded":"\u914D\u7F6E\u672A\u52A0\u8F7D\uFF1A\u8BE5\u914D\u7F6E\u7531\u8FD0\u884C\u4E2D\u7684\u5BBF\u4E3B\u63D0\u4F9B\uFF0C\u82E5\u957F\u65F6\u95F4\u7A7A\u767D\u8BF7\u91CD\u542F DSH \u540E\u91CD\u8BD5\u3002","cfg.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"},lr={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","tab.overview":"Overview","tab.changes":"Changes","tab.files":"Files","pill.unavailable":"Git unavailable","pill.detached":"detached HEAD","pill.synced":"Everything committed","pill.dirty":"Uncommitted changes","common.loading":"Loading\u2026","common.retry":"Retry","common.close":"Close","common.cancel":"Cancel","ops.aiHint":"Tip: Trust AI more, try direct Git\u2011operation execution by AI.","version.check":"Check for updates","version.checking":"Checking\u2026","version.upToDate":"Up to date ({current})","version.updateAvailable":"New version {latest} available (current {current})","version.viewRelease":"View release","version.error":"Check failed","version.noRepo":"Repository not configured","version.openRepo":"Visit @xbzbing/dsh-git-panel on GitHub \u2014 please give the project a little star \u2B50","overview.head":"All branches","overview.local":"Local","overview.remote":"Remote","overview.tags":"Tags","overview.search":"Search commits (message / hash)","overview.searchShort":"Search","overview.allUsers":"All authors","overview.allTime":"All time","overview.today":"Today","overview.last7d":"Last 7 days","overview.last30d":"Last 30 days","overview.selectCommit":"Select a commit to see details","overview.noMessage":"(no commit body)","overview.noResults":"No matching commits","overview.loadFailed":"Load failed","overview.detailFailed":"Failed to load details","overview.diffFailed":"Failed to load diff","overview.openFileDiff":"View this file\u2019s changes in this commit","overview.changeSummary":"{files} files","overview.expandDir":"Expand folder","overview.collapseDir":"Collapse folder","overview.fetch":"Fetch","overview.branchesError":"Failed to load branches","overview.filterBranch":"Filter by branch","overview.backToList":"Back to list","overview.createTag":"Create tag","switch.action":"Switch","switch.rowTitle":"Switch to {name}","switch.rowTitleTrack":"Create {name} tracking {ref} and switch to it","switch.detached":"detached HEAD","switch.confirmTitle":"Switch branch","switch.body":"Switch from {from} to {to}.","switch.trackingNote":"There is no local {name} yet: it will be created from {ref} and set to track it.","switch.dirtyWarn":"{count} file(s) have uncommitted changes.","switch.modeDirect":"Switch directly","switch.modeDirectHint":"Uncommitted changes come along; if they collide with the target branch, git refuses the switch and the work tree stays untouched.","switch.modeStash":"Stash the {count} file(s) first, then switch","switch.modeStashHint":"The changes (including untracked files) move to the top of the stash; restore them from Changes \u2192 Stash afterwards. Note: they are not restored automatically, and restoring may need manual conflict resolution.","switch.confirm":"Switch","switch.confirmStash":"Stash and switch","switch.switching":"Switching\u2026","switch.stashMessage":"Auto-stash before switching to {branch}","overview.revert":"Revert this commit","overview.reset":"Reset to here","tag.createTitle":"Create a tag at this commit","tag.namePlaceholder":"Tag name","tag.annotated":"Annotated tag (with message)","tag.messagePlaceholder":"Tag message","tag.create":"Create tag","tag.deleteTitle":"Delete tag","tag.deleteConfirm":'Delete tag "{name}"?',"tag.deleteOne":'Delete tag "{name}"',"ops.dirtyWarn":"There are uncommitted changes \u2014 they may be work the dsh AI is doing.","revert.title":"Revert commit","revert.body":"Appends a reverse commit at the current HEAD that undoes the changes in {ref}. Your working-tree changes are kept.","revert.confirm":"Revert","reset.title":"Reset branch","reset.body":"Moves the current branch HEAD from {from} to {to}.","reset.modeSoft":"Soft (--soft)","reset.softHint":"Moves HEAD; changes stay staged.","reset.modeMixed":"Mixed (--mixed, default)","reset.mixedHint":"Moves HEAD; changes stay in the working tree.","reset.modeHard":"Hard (--hard)","reset.hardHint":"Moves HEAD to this commit and discards all uncommitted changes (uncommitted changes cannot be recovered).","reset.hardOrphan":"Commits after the target leave the branch (still recoverable via git reflog).","reset.hardWarn":"The following uncommitted changes will be permanently discarded:","reset.lostMore":"\u2026 more uncommitted changes not shown (list capped)","reset.hardAck":"I understand these uncommitted changes will be lost","reset.hardAckClean":"I understand the consequences and confirm the reset","reset.confirm":"Reset","changes.groupStaged":"Staged changes","changes.groupUnstaged":"Changes","changes.groupUntracked":"Unversioned files","changes.selectFile":"Select a file to see its diff","changes.noChanges":"No uncommitted changes","changes.stageAll":"Stage all","changes.unstageAll":"Unstage all","changes.stage":"Stage","changes.unstage":"Unstage","changes.discard":"Discard changes","changes.discardConfirm":"Click again to confirm discard","changes.backToList":"Back to list","changes.stash":"Stash changes","stash.title":"Stash current changes","stash.messagePlaceholder":"Stash message (optional)","stash.save":"Stash","stash.section":"Stashes","stash.onBranch":"on {branch}","stash.apply":"Apply","stash.pop":"Pop","stash.drop":"Drop","stash.dropTitle":"Drop stash","stash.dropConfirm":"Drop this stash? This cannot be undone: {name}","files.selectFile":"Select a file to preview","files.loadFailed":"Load failed","files.backToTree":"Back to files","files.truncated":"Too many entries \u2014 truncated","files.tooLarge":"File too large to preview","files.binary":"Binary file \u2014 no preview","files.highlightOff":"Large file \u2014 syntax highlighting disabled for performance","files.lineTruncated":" \u2026 (line too long, truncated)","files.findPlaceholder":"Find in file","files.findNoMatch":"No results","files.findPrev":"Previous match","files.findNext":"Next match","files.findClose":"Close find","files.findCase":"Match case","files.previewMode":"Preview mode","files.source":"Source","files.render":"Rendered","files.copyPath":"Copy relative path","files.pathCopied":"Path copied","files.pathCopyFailed":"Copy failed","files.copyContent":"Copy file content","files.contentCopied":"Content copied","files.contentCopyFailed":"Copy failed","files.ignored":"Ignored by Git","files.copy":"Copy code","files.copied":"Copied","files.footnotes":"Footnotes","files.zoomBar":"Image zoom","files.zoomIn":"Zoom in","files.zoomOut":"Zoom out","files.zoomActual":"Actual size (100%)","files.zoomFit":"Fit to window","files.zoomFullscreen":"View fullscreen","files.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","files.propsTitle":"File properties","files.propsGroupStats":"Size & stats","files.propsGroupTime":"Timestamps","files.propsName":"Name","files.propsType":"Type","files.propsTypeImage":"{fmt} image","files.propsTypeText":"Text file","files.propsTypeBinary":"Binary file","files.propsTypeUnread":"Too large to read","files.propsTypeFmt":"{label} (.{ext})","files.propsRelPath":"Relative path","files.propsAbsPath":"Absolute path","files.propsCopyHint":"Click to copy","files.propsSize":"Size","files.propsSizeBytes":"({bytes} bytes)","files.propsLines":"Lines","files.propsImageSize":"Dimensions","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"Modified","files.propsUntracked":"Untracked","files.propsTrackedYes":"Tracked","files.propsStaged":"Staged","files.stAdded":"Added","files.stModified":"Modified","files.stDeleted":"Deleted","files.stRenamed":"Renamed","files.stConflicted":"Conflicted","files.stTypechange":"Type changed","stats.files":"{n} files","stats.lastChange":"changed {time}","stats.lastCommit":"last commit {time}","stats.staged":"{n} staged","stats.modified":"{n} modified","stats.untracked":"{n} untracked","stats.partial":"simplified","stats.partialHint":"Large change set \u2014 untracked line counts and last-change time are omitted to keep the panel responsive.","commit.placeholder":"Commit message","commit.commit":"Commit","commit.amend":"Amend previous commit","commit.suggest":"AI suggest","commit.suggesting":"Generating\u2026","commit.suggestOverwrite":'Click "AI suggest" again to replace the current message',"commit.suggestTruncated":"The diff was truncated; the suggestion may be incomplete","diff.unified":"Unified","diff.split":"Split","diff.before":"Before","diff.after":"After","diff.binary":"Binary file \u2014 no diff to show","diff.tooLarge":"Image too large to compare","diff.imageMissing":"Does not exist","diff.svgRender":"Rendered","diff.svgSource":"Source","diff.empty":"No differences","diff.expandAll":"Expand all","diff.collapse":"Collapse unchanged","diff.expandGap":"Expand all {n} lines","diff.expandUp":"Expand up {n} lines","diff.expandDown":"Expand down {n} lines","diff.expandCapped":"Large file: expanded {n} lines of context; the rest stays collapsed and can be expanded in place","diff.truncated":"git output exceeded the output cap: only the tail of this diff survived, so the opening changes and the +/- counts may be missing","time.justNow":"just now","time.minutesAgo":"{n}m ago","time.hoursAgo":"{n}h ago","time.daysAgo":"{n}d ago","error.generic":"Operation failed","error.notARepo":"Not a Git repository","error.noCwd":"This session has no working directory","error.localChangesBlock":"Local changes block this operation","error.emptyMessage":"Commit message cannot be empty","error.emptyDiff":"No changes to summarize","error.llmUnavailable":"AI service unavailable","error.llmFailed":"AI generation failed","error.suggestDisabled":"AI suggest is turned off in the plugin config","error.conflict":"Applying the stash produced conflicts; the stash entry is kept \u2014 resolve them and retry","error.revertConflict":"The revert would conflict with the current content; it was cancelled automatically (your working tree is unchanged)","error.revertStuck":"The revert conflicted and could not be auto-cancelled; the repository is mid-revert \u2014 run `git revert --abort` or resolve it manually","error.revertMerge":"This is a merge commit; the panel cannot revert it (a mainline parent is required) \u2014 use `git revert -m` on the command line","error.indexBusy":"Git is busy (another process holds the index lock); try again shortly","error.notFound":"Target not found (the branch / tag / stash may have been removed or renamed)","error.branchInUse":"That branch is checked out in another worktree, so it cannot be switched to here","error.stashSwitchFailed":"The uncommitted changes were stashed (restore them from Changes \u2192 Stash), but the switch failed: {reason}","error.invalidName":"Invalid name","error.notFastForward":"Local and remote have diverged \u2014 a fast-forward pull is not possible; merge or rebase manually","error.pushRejected":"Push rejected: the remote has new commits \u2014 run \u201CCheck sync\u201D and pull first, then push","error.authFailed":"Authentication failed: no usable git credentials (HTTPS needs a credential helper, SSH needs a key). Push once from the command line first to cache them","status.openRepo":"Open the repository home in the browser","status.openRepoOn":"Open the repository home on {host}","status.synced":"Up to date with remote","status.ahead":"{n} ahead","status.behind":"{n} behind","status.diverged":"Diverged ({ahead} ahead / {behind} behind)","status.noUpstream":"No upstream branch","status.detached":"Detached HEAD \u2014 no branch sync state","status.check":"Check sync status","status.checkTitle":"Check sync with the remote: runs git fetch to update refs and refresh the ahead/behind counts; your working tree is untouched","status.pull":"Pull","status.pulling":"Syncing\u2026","status.pullTitle":"Fast-forward pull of remote updates","status.pullConfirmTitle":"Pull remote updates","status.pullConfirmBody":"Fast-forwards the current branch {branch} to the latest remote commit ({behind} behind). Only possible when not diverged; it creates no merge commit and leaves your uncommitted work untouched.","status.pullConfirm":"Pull","status.pullScope":"Brings in {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pullScopeLoading":"Measuring incoming changes\u2026","status.push":"Push","status.pushTitle":"Push local commits to the remote","status.pushConfirmTitle":"Push to remote","status.pushConfirmBody":"Pushes the {ahead} commits that {branch} is ahead of the remote to its upstream. Fast-forward only \u2014 it never force-overwrites remote history.","status.pushConfirm":"Push","status.pushing":"Pushing\u2026","status.pushScope":"Pushes {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pushScopeLoading":"Measuring outgoing changes\u2026","status.publish":"Publish","status.publishTitle":"Publish the branch and set its upstream","status.publishConfirmTitle":"Publish branch to remote","status.publishConfirmBody":"The current branch {branch} has no upstream yet. This runs git push -u {remote} to create a same-named branch on the remote and set it as the upstream.","status.publishConfirm":"Publish","status.publishing":"Publishing\u2026","cfg.title":"Input-bar branch marker","cfg.toggle":"Show input-bar marker","cfg.hint":"When on, the input bar shows the zsh-style <repo> (branch) marker; when off, a status dot appears beside the Git tab instead. Saved changes apply immediately.","cfg.diffTitle":"Default diff view","cfg.diffHint":"Choose the layout diffs open with: unified is a single inline column, split is side-by-side. You can still switch per diff. Saved changes apply immediately.","cfg.diffUnified":"Unified (single inline column)","cfg.diffSplit":"Split (side-by-side)","cfg.graphTitle":"Commit graph line style","cfg.graphHint":"Choose how the commit graph draws its lines: parallel is the VSCode / GUI style \u2014 each branch keeps its own column and a shared ancestor shows as parallel lines; compact is the git log style \u2014 a shared ancestor merges into one column with fewer lines. Saved changes apply immediately.","cfg.graphParallel":"Parallel (VSCode style)","cfg.graphCompact":"Compact (git log style)","cfg.suggestTitle":"AI commit message","cfg.suggestToggle":"Show AI suggest button in the commit box","cfg.suggestLangLabel":"Language","cfg.suggestLangAuto":"Auto","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"Auto follows the language you write commits in for this repository (recency-weighted, with the current git author preferred, ignoring mechanical commits such as releases and merges); \u4E2D\u6587 / English pin it.","cfg.suggestMaxBytesLabel":"Input budget","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"Diff bytes sent to the model; beyond it the diff is truncated. Range 16\u2013512.","cfg.suggestOutputLabel":"Output limit","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"Model generation budget; reasoning tokens count against it on thinking models. Range 256\u201316384.","cfg.suggestTimeoutLabel":"Generation timeout","cfg.suggestTimeoutUnit":"s","cfg.suggestTimeoutHint":"Generation fails after the timeout. Range 5\u2013120.","cfg.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the repository\u2019s existing commit style, filled in for you to edit before committing. Generation uses the model configured in DSH; the diff is sent to that model provider. Saved changes apply immediately.',"cfg.notLoaded":"Config not loaded: it is served by the running host. Restart DSH if this stays blank.","cfg.saveFailed":"Save failed, please retry"};var Vt=require("react");var ni=new Set(["cwd-unavailable"]),Tn=3e4,ri=6e4,Kt=class{constructor(t,n){this.remote=t;this.sessionId=n}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=Tn;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}ensure(){this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){return this.inflight!==void 0?(this.pendingRefresh=!0,this.inflight):this.disposed?Promise.resolve():(this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(t=>{if(!this.disposed){if(t.ok)this.pollMs=t.value.refreshIntervalMs||Tn,this.setView({state:"ready",snapshot:t.value});else if(t.error.code!=="cancelled")if(ni.has(t.error.code))this.pollMs=ri,this.setView({state:"no-cwd"});else if(t.error.code==="not-a-git-repo"){let n=t.error;this.setView({state:"error",error:{code:"not-a-git-repo",...n.cwd?{cwd:n.cwd}:{},...n.showInputPill!==void 0?{showInputPill:n.showInputPill}:{}}})}else if(t.error.code==="git-unavailable"){let n=t.error;this.setView({state:"error",error:{code:"git-unavailable",...n.detail?{detail:n.detail}:{},...n.cwd?{cwd:n.cwd}:{},...n.isGitRepo!==void 0?{isGitRepo:n.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:t.error.code,..."detail"in t.error?{detail:t.error.detail}:{}}})}}).catch(t=>{this.disposed||this.setView({state:"error",error:{code:"git-unavailable",detail:t instanceof Error?t.message:String(t)}})}).finally(()=>{this.inflight=void 0,this.pendingRefresh&&!this.disposed?(this.pendingRefresh=!1,this.refresh()):this.schedulePoll()}),this.inflight)}resync(){this.disposed||this.refresh()}accept(t){this.disposed||(this.pollMs=t.refreshIntervalMs||Tn,this.setView({state:"ready",snapshot:t}),this.schedulePoll())}schedulePoll(){this.disposed||(this.timer!==void 0&&clearTimeout(this.timer),!(this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.refresh()},this.pollMs)))}setView(t){this.view=t;for(let n of this.listeners)n()}dispose(){this.disposed=!0,this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0,this.listeners.clear()}};var ai="/api",ii="gitPanel";function oi(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,a,i)=>n.call(t,ai,r,a,i)}catch{}}function si(e){let t=e;if(t===null||typeof t!="object")return{ok:!1,error:{code:"git-unavailable",message:"malformed rpc result"}};if(t.ok!==!0){let n=t.error;return{ok:!1,error:{code:typeof n?.code=="string"?n.code:"git-unavailable",message:typeof n?.message=="string"?n.message:void 0}}}return t.value===void 0?{ok:!1,error:{code:"git-unavailable",message:"missing value"}}:t.value}function ye(e,t){return!e.ok||e.value.kind!==t?null:e.value}function et(e){return e!==void 0&&e!==""}var dr=new WeakMap;function Pt(e){let t=dr.get(e);if(t!==void 0)return t;let n=async(a,i,o)=>{let s=oi(e);if(s===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await s(`${ii}/${a}`,{args:{request:i}},o);return si(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},r={snapshot:(a,i)=>n("snapshot",a,i),run:(a,i)=>n("run",a,i),query:(a,i)=>n("query",a,i),suggest:(a,i)=>n("suggest",a,i),version:(a,i)=>n("version",a,i)};return dr.set(e,r),r}var pt=new Map,cr,Nn;function pr(e){Nn=e,cr=Pt(e)}function Dt(e){let t=pt.get(e);if(t===void 0){let n=cr??(Nn?Pt(Nn):void 0);t=new Kt(n??pi(),e),pt.set(e,t)}return t}var li=6e4,Ut=new Map;function di(e){let t=Ut.get(e);t!==void 0&&(clearTimeout(t),Ut.delete(e)),vt.set(e,(vt.get(e)??0)+1)}function ci(e){let t=(vt.get(e)??1)-1;if(t>0){vt.set(e,t);return}vt.delete(e);let n=setTimeout(()=>{Ut.delete(e),!((vt.get(e)??0)>0)&&(pt.get(e)?.dispose(),pt.delete(e))},li);Ut.set(e,n)}var vt=new Map;function zt(){for(let e of pt.values())e.resync()}function ur(){for(let e of pt.values())e.dispose();pt.clear()}function pi(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e}}function Wt(e){let[,t]=(0,Vt.useState)(0),n=e?Dt(e):void 0;return(0,Vt.useEffect)(()=>{if(n===void 0||e===void 0)return;di(e);let r=n.subscribe(()=>t(a=>a+1));return n.ensure(),()=>{r(),ci(e)}},[n,e]),n?n.getSnapshot():{state:"cold"}}var I=require("react");var gr="[data-conversation-tabs]",Ht='[data-conversation-tabs] button[role="tab"]',En=new Map,At=new Map;function fr(e,t){let n=At.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}En.set(e,t)}function mr(e){let t=En.get(e);return t===void 0?null:(En.delete(e),t)}function hr(e,t){let n=At.get(e);return n===void 0&&(n=new Set,At.set(e,n)),n.add(t),()=>{let r=At.get(e);r!==void 0&&(r.delete(t),r.size===0&&At.delete(e))}}var ui=6e4,Mn=new Map;function yr(e,t){Mn.set(e,{tab:t,leftAt:Date.now()})}function br(e){let t=Mn.get(e);return t===void 0?null:Date.now()-t.leftAt>ui?(Mn.delete(e),null):t.tab}function vr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function wr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function xr(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var c=require("react"),hn=require("react-dom");var H=require("react");function ve(e,t=15){return(0,H.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},e)}function qt({size:e}){return ve([(0,H.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,H.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,H.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function kr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M4 2v8"}),(0,H.createElement)("path",{key:"b",d:"M2 4h4"}),(0,H.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,H.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,H.createElement)("path",{key:"e",d:"M12 6v4"}),(0,H.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function Gn({size:e}){return ve([(0,H.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,H.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,H.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,H.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,H.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function wt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M2 7V3h4l8 8-4 4z"}),(0,H.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e)}function tt({size:e,open:t}){return ve([(0,H.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function nt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function xt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,H.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function _r({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function jt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,H.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function Sr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M8 2.6l1.4 4 4 1.4-4 1.4-1.4 4-1.4-4-4-1.4 4-1.4z"}),(0,H.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function Cr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,H.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function Rn({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,H.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,H.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function Tr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,H.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,H.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function Nr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,H.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function Qt({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M13 3v10"}),(0,H.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function Er({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,H.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,H.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function Mr({size:e=15}){return(0,H.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,H.createElement)("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"}))}function Gr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,H.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,H.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Ln({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,H.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,H.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Rr({size:e}){return ve([(0,H.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,H.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,H.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,H.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function Lr({size:e}){return ve([(0,H.createElement)("circle",{key:"a",cx:8,cy:8,r:6}),(0,H.createElement)("path",{key:"b",d:"M8 7.2v3.6"}),(0,H.createElement)("circle",{key:"c",cx:8,cy:5.2,r:.5,fill:"currentColor",stroke:"none"})],e)}function Pr({size:e=15,filled:t}){return(0,H.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},(0,H.createElement)("path",{d:"M8 1.8l1.76 3.57 3.94.57-2.85 2.78.67 3.92L8 10.78l-3.52 1.85.67-3.92L2.3 5.94l3.94-.57z"}))}function Dr(e){let t=0;for(let n of e){t=Math.max(t,n.lane+1);for(let r of n.edges)t=Math.max(t,r.fromLane+1,r.toLane+1)}return t}function zr(e,t){let n=[],r=[],a=[],i=[],o=0,s=()=>{if(i.length===0)return o++;let d=Math.min(...i);return i.splice(i.indexOf(d),1),d},l=d=>{d!==null&&!i.includes(d)&&i.push(d)};for(let d of e){let p=C=>{let R=r.findIndex(Q=>Q===C);return R===-1&&(R=r.findIndex(Q=>Q===null),R===-1&&(R=r.length,r.push(null),a.push(null)),r[R]=C,a[R]=s()),R},u=r.some(C=>C===d.hash),g=p(d.hash),S=a[g],b=[...r],_=[...a],k=d.parents,M=k.length>=2;for(let C=0;C<r.length;C++)C!==g&&r[C]===d.hash&&(l(a[C]),r[C]=null,a[C]=null);let D=-1,J=[];if(k.length===0)l(a[g]),r[g]=null,a[g]=null;else{let C=k[0],R=t==="compact"?r.findIndex((Q,U)=>Q===C&&U!==g):-1;if(R===-1)r[g]=C,D=g;else{let Q=Math.min(g,R),U=Math.max(g,R);r[Q]=C,l(a[U]),r[U]=null,a[U]=null,D=Q}for(let Q=1;Q<k.length;Q++)J.push(p(k[Q]))}let F=[];for(let C=0;C<b.length;C++){let R=b[C];if(R!==null)if(R===d.hash){if(C===g&&!u)continue;F.push({fromLane:C,toLane:g,color:_[C],kind:"into"})}else{let Q=r[C]===R?C:r.findIndex(U=>U===R);Q!==-1&&F.push({fromLane:C,toLane:Q,color:_[C],kind:"pass"})}}D!==-1&&F.push({fromLane:g,toLane:D,color:a[D],kind:"out"});for(let C of J)F.push({fromLane:g,toLane:C,color:a[C],kind:"out"});for(n.push({commit:d,lane:g,color:S,edges:F,merge:M});r.length>0&&r[r.length-1]===null;)r=r.slice(0,-1),a=a.slice(0,-1)}return n}function Ar(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(o=>o!==""),a=t,i="";for(let o=0;o<r.length;o++){let s=r[o];i=i===""?s:`${i}/${s}`;let l=o===r.length-1,d=a.children.find(p=>p.name===s&&p.dir===!l);d===void 0&&(d={name:s,path:i,dir:!l,children:[],...l?{meta:n.meta}:{}},a.children.push(d)),a=d}}return Hr(t),Fr(t.children)}function Hr(e){e.children.sort((t,n)=>t.dir!==n.dir?t.dir?-1:1:t.name.localeCompare(n.name));for(let t of e.children)Hr(t)}function Fr(e){return e.map(t=>{if(!t.dir)return t;let n=t;for(;n.children.length===1&&n.children[0].dir;){let r=n.children[0];n={name:`${n.name}/${r.name}`,path:r.path,dir:!0,children:r.children}}return{...n,children:Fr(n.children)}})}function rt(e,t,n){if(e===null)return"";let r=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(r))return"";let a=Math.max(0,t-r),i=Math.floor(a/6e4);if(i<1)return n("time.justNow");if(i<60)return n("time.minutesAgo",{n:i});let o=Math.floor(i/60);if(o<24)return n("time.hoursAgo",{n:o});let s=Math.floor(o/24);return n("time.daysAgo",{n:s})}function Ft(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Bt(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Yt={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function kt(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}function Br(e,t){return e.some(n=>n.status==="untracked"&&(n.isDirectory?t.startsWith(`${n.path}/`):n.path===t))}var x=require("react");var Re={maxBytes:{min:16384,max:524288,default:131072},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},Zt=["auto","zh","en"],Pn="auto",gi={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff"};function It(e){let t=e.lastIndexOf(".");return t<0?null:gi[e.slice(t+1).toLowerCase()]??null}function Ir(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function Or(e){return It(e)!==null}function $r(e){return/\.svg$/i.test(e)}function fi(e){let t=e.split(`
671
- `),n=[],r=!1;for(let a of t){if(a.startsWith("@@")){r=!0;continue}if(r){if(a.startsWith("diff ")||a.startsWith("index ")){r=!1;continue}a!==""&&n.push(a)}}return n}function Xr(e){let t=0,n=0;for(let r of fi(e))r.startsWith("+")?t++:r.startsWith("-")&&n++;return{add:t,del:n}}var mi=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function Jr(e,t){let n=[],r=e.split(`
672
- `),a=Number.isFinite(t)&&t>0?t:0,i=0,o=0,s=!0,l=!1,d=0;for(;d<r.length&&!r[d].startsWith("@@");d++);for(;d<r.length;d++){let u=r[d];if(u.startsWith("@@")){let b=mi.exec(u);if(b){let _=Number(b[1]),k=Number(b[3]),M=_-k;if(s)k>1&&n.push(ut({rightStart:1,count:k-1,delta:M,atStart:!0}));else{let D=k-o;D>0&&n.push(ut({rightStart:o,count:D,delta:M,atStart:!1}))}i=_,o=k,s=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:u});continue}if(u.startsWith("\\"))continue;let g=u[0],S=u.slice(1);g==="+"?(n.push({kind:"add",leftNo:null,rightNo:o,leftText:null,rightText:S}),o++,l=!0):g==="-"?(n.push({kind:"del",leftNo:i,rightNo:null,leftText:S,rightText:null}),i++,l=!0):g===" "&&(n.push({kind:"context",leftNo:i,rightNo:o,leftText:S,rightText:S}),i++,o++,l=!0)}let p=a-o+1;return l&&!s&&o>0&&p>0&&n.push(ut({rightStart:o,count:p,delta:i-o,atStart:!1})),hi(n)}function Kr(e,t){let n=e[e.length-1],r=n!==void 0&&n.kind==="gap",a=r?n.gap:void 0,i=r?e[e.length-2]:n,o=i===void 0?null:i.rightNo,s=o!==null&&o>0?o:0,l=Number.isFinite(t)?t-s:0,d=l>0?l:0;if(a===void 0){if(d===0||s===0)return e;let p=i===void 0?null:i.leftNo;return p===null?null:[...e,ut({rightStart:s+1,count:d,delta:p-s,atStart:!1})]}return a.rightStart===s+1&&a.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),ut({rightStart:s+1,count:d,delta:a.delta,atStart:!1})]}function ut(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function hi(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let a=[],i=n;for(;i<e.length&&e[i].kind==="del";)a.push(e[i]),i++;let o=[];for(;i<e.length&&e[i].kind==="add";)o.push(e[i]),i++;let s=Math.max(a.length,o.length);for(let l=0;l<s;l++){let d=a[l],p=o[l];if(d&&p){let u=yi(d.leftText??"",p.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:p.rightNo,leftText:d.leftText,rightText:p.rightText,...u!==null?{leftWord:u.left,rightWord:u.right}:{}})}else d?t.push({kind:"del",leftNo:d.leftNo,rightNo:null,leftText:d.leftText,rightText:null}):p&&t.push({kind:"add",leftNo:null,rightNo:p.rightNo,leftText:null,rightText:p.rightText})}n=i}else t.push(r),n++}return t}function yi(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let a=0;for(;a<n-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return r===0&&a===0?null:{left:[r,e.length-a],right:[r,t.length-a]}}function bi(e,t,n){return n.map((r,a)=>{let i=t+a;return{kind:"context",leftNo:i+e,rightNo:i,leftText:r,rightText:r}})}var gt=20;function Ur(e){let t=[];for(let n of e)n.kind==="mod"?(t.push({kind:"del",leftNo:n.leftNo,rightNo:null,leftText:n.leftText,rightText:null,...n.leftWord!==void 0?{leftWord:n.leftWord}:{}}),t.push({kind:"add",leftNo:null,rightNo:n.rightNo,leftText:null,rightText:n.rightText,...n.rightWord!==void 0?{rightWord:n.rightWord}:{}})):t.push(n);return t}function Vr(e,t,n,r,a,i){let o=e.findIndex(u=>u.kind==="gap"&&u.gap?.rightStart===t);if(o<0)return e.slice();let s=e[o].gap,l=bi(s.delta,r,a),d=[],p=s.count;if(n==="all"||a.length>=p)d.push(...l);else if(n==="down")d.push(...l),i||d.push(ut({rightStart:s.rightStart+a.length,count:p-a.length,delta:s.delta,atStart:!1}));else{if(a.length===0)return[...e.slice(0,o),...e.slice(o+1)];let u=p-a.length;d.push(ut({rightStart:s.rightStart,count:u,delta:s.delta,atStart:s.atStart})),d.push(...l)}return[...e.slice(0,o),...d,...e.slice(o+1)]}var pn=require("@deepseek-ai/dsh-client-ui-primitives");function Wr(e,t){let n=[[],[],[]],r=0;for(let a of e){let i=r+a.text.length,o=[r,Math.max(r,Math.min(i,t[0])),Math.max(r,Math.min(i,t[1])),i];for(let s=0;s<3;s++){let l=a.text.slice(o[s]-r,o[s+1]-r);l!==""&&n[s].push({text:l,style:a.style})}r=i}return n}function qr(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.size>=8e3&&t.clear(),t.set(n,r),r}}function St(e){let t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t}function jr(e,t){let n=0,r=e.length-1;for(;n<r;){let a=n+r+1>>1;e[a]<=t?n=a:r=a-1}return n}function Ct(e,t,n,r){let a=e.length-1;if(a<=0)return{first:0,last:0};let i=jr(e,t-r),o=Math.min(a,jr(e,t+n+r)+1);return{first:i,last:o}}function en(e,t,n,r){return t<0?e:t>=e.first&&t<e.last?{first:Math.min(e.first,Math.max(0,t-r)),last:Math.max(e.last,Math.min(n,t+r))}:{first:Math.max(0,t-r),last:Math.min(n,t+r)}}var ft=require("react");function Tt(){let[e,t]=(0,ft.useState)({top:0,height:0}),n=(0,ft.useRef)(null),r=(0,ft.useRef)(null);return{setEl:(0,ft.useCallback)(i=>{if(r.current!==null&&(r.current(),r.current=null),n.current=i,i===null)return;let o=()=>t(l=>{let d=i.scrollTop,p=i.clientHeight;return l.top===d&&l.height===p?l:{top:d,height:p}});o(),i.addEventListener("scroll",o,{passive:!0});let s=typeof ResizeObserver<"u"?new ResizeObserver(o):null;s?.observe(i),r.current=()=>{i.removeEventListener("scroll",o),s?.disconnect()}},[]),viewport:e,elRef:n}}var Ne=require("react"),tn=5e3,nn=120;function rn(e,t){let[n,r]=(0,Ne.useState)(e);return(0,Ne.useEffect)(()=>{let a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}function an(e,t){if(t==="")return[];let n=[],r=0;for(;;){let a=e.indexOf(t,r);if(a<0)break;n.push([a,a+t.length]),r=a+t.length}return n}function Dn(e,t,n,r,a){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let i=[],o=0,s=0;for(let l of e){let d=o+l.text.length,p=Math.max(n,o),u=Math.min(r,d);if(u>p&&i.push((0,Ne.createElement)("span",{key:`${a}-${s++}`,style:l.style},l.text.slice(p-o,u-o))),o=d,o>=r)break}return i}function on(e,t,n,r,a,i){let o=[],s=0,l=[...t].sort((d,p)=>d[0]-p[0]);for(let[d,p]of l){if(d<s)continue;d>s&&o.push(...Dn(n,e,s,d,`${r}b${s}`));let u=a!==null&&a[0]===d&&a[1]===p;o.push((0,Ne.createElement)("mark",{key:`mk${r}-${d}`,className:`gp-find-hit${u?" gp-find-hit--active":""}`,...u?{ref:i}:{}},Dn(n,e,d,p,`mk${r}-${d}`))),s=p}return s<e.length&&o.push(...Dn(n,e,s,e.length,`${r}e`)),o}function sn(e){return(0,Ne.createElement)("div",{key:"find",className:"gp-find"},[(0,Ne.createElement)("input",{key:"in",ref:e.inputRef,className:"gp-find__input",type:"text",placeholder:e.t("files.findPlaceholder"),value:e.query,spellCheck:!1,"aria-label":e.t("files.findPlaceholder"),onChange:t=>e.onChange(t.target.value),onKeyDown:t=>{t.key==="Escape"?(t.preventDefault(),t.stopPropagation(),e.onClose()):t.key==="Enter"&&(t.preventDefault(),e.onStep(t.shiftKey?-1:1))}}),(0,Ne.createElement)("button",{key:"case",type:"button",className:`gp-find__btn gp-find__case${e.caseSensitive?" gp-find__case--active":""}`,title:e.t("files.findCase"),"aria-label":e.t("files.findCase"),"aria-pressed":e.caseSensitive,onClick:()=>e.onToggleCase()},"Aa"),(0,Ne.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,Ne.createElement)("button",{key:"prev",type:"button",className:"gp-find__btn",title:e.t("files.findPrev"),"aria-label":e.t("files.findPrev"),disabled:e.matches===0,onClick:()=>e.onStep(-1)},"\u2039"),(0,Ne.createElement)("button",{key:"next",type:"button",className:"gp-find__btn",title:e.t("files.findNext"),"aria-label":e.t("files.findNext"),disabled:e.matches===0,onClick:()=>e.onStep(1)},"\u203A"),(0,Ne.createElement)("button",{key:"x",type:"button",className:"gp-find__btn",title:e.t("files.findClose"),"aria-label":e.t("files.findClose"),onClick:()=>e.onClose()},"\u2715")])}var at=require("react");var X=require("react"),ra=require("react-dom");function Yr(e){let t=e.deltaMode===1?8:e.deltaMode===2?24:1;return Math.sign(e.deltaY)*Math.min(24,Math.abs(e.deltaY*t))}function Zr(e){let t=Math.sign(e)*Math.min(24,Math.abs(e));return t<=0?1-2*t/100:1/(1+2*t/100)}var vi=.1,wi=8,zn=1.25;function ea(e){return Number.isFinite(e)?Math.min(wi,Math.max(vi,e)):1}function An(e,t,n){return(e+t)*n-t}var Qr=3;function ta(e,t){return e*e+t*t>=Qr*Qr}function na(e,t,n,r){return{left:e-n,top:t-r}}var xi=300;function Ot({src:e,alt:t,t:n,viewportClass:r,fullscreen:a=!0,onEmptyAreaMouseDown:i}){let o=(0,X.useRef)(null),s=(0,X.useRef)(null),l=(0,X.useRef)(null),[d,p]=(0,X.useState)(null),[u,g]=(0,X.useState)("fit"),[S,b]=(0,X.useState)(null),[_,k]=(0,X.useState)(!1),[M,D]=(0,X.useState)(!1),J=(0,X.useRef)("fit"),F=(0,X.useRef)(null),C=(0,X.useRef)(null),R=(0,X.useRef)(null),Q=(0,X.useRef)(0),U=(0,X.useCallback)(()=>{let w=l.current;return w===null||w.naturalWidth===0||w.clientWidth===0?null:w.clientWidth/w.naturalWidth},[]),K=(0,X.useCallback)((w,T,j)=>{let Y=s.current,m=l.current;if(Y===null||m===null||m.naturalWidth===0||m.clientWidth===0)return;let G=m.clientWidth/m.naturalWidth,B=ea(w);if(B===G)return;let P=Y.getBoundingClientRect();F.current={x:T-P.left,y:j-P.top,ratio:B/G},g(B)},[]),ae=(0,X.useCallback)(w=>{let T=s.current,j=U();if(T===null||j===null)return;let Y=T.getBoundingClientRect();K(j*w,Y.left+Y.width/2,Y.top+Y.height/2)},[U,K]),z=(0,X.useCallback)(()=>{let w=s.current;if(w===null)return;let T=w.getBoundingClientRect();K(1,T.left+T.width/2,T.top+T.height/2)},[K]),W=(0,X.useCallback)(()=>{g("fit")},[]),O=(0,X.useCallback)(()=>{let w=l.current;w===null||w.naturalWidth===0||w.clientWidth===0||b(Math.round(w.clientWidth/w.naturalWidth*100))},[]);(0,X.useLayoutEffect)(()=>{J.current=u,u==="fit"&&O();let w=F.current;F.current=null;let T=s.current;w===null||T===null||(T.scrollLeft=An(T.scrollLeft,w.x,w.ratio),T.scrollTop=An(T.scrollTop,w.y,w.ratio))},[u,O]),(0,X.useEffect)(()=>{J.current="fit",F.current=null,C.current=null,g("fit"),p(null),b(null)},[e]),(0,X.useEffect)(()=>{let w=o.current;if(w===null)return;let T=G=>{if(!G.ctrlKey)return;G.cancelable&&G.preventDefault();let B=l.current;if(B===null||!B.complete||B.naturalWidth===0)return;let P=U();P!==null&&K(P*Zr(Yr(G)),G.clientX,G.clientY)},j=G=>{let B=G,P=U();P!==null&&(B.cancelable&&B.preventDefault(),C.current={base:P,x:B.clientX,y:B.clientY})},Y=G=>{let B=G,P=C.current;P!==null&&(B.cancelable&&B.preventDefault(),K(P.base*B.scale,P.x,P.y))},m=()=>{C.current=null};return w.addEventListener("wheel",T,{passive:!1}),w.addEventListener("gesturestart",j,{passive:!1}),w.addEventListener("gesturechange",Y,{passive:!1}),w.addEventListener("gestureend",m),()=>{w.removeEventListener("wheel",T),w.removeEventListener("gesturestart",j),w.removeEventListener("gesturechange",Y),w.removeEventListener("gestureend",m)}},[U,K]);let se=(0,X.useCallback)(w=>{if(w.button!==0||w.pointerType!=="mouse")return;let T=s.current;if(T===null)return;let{offsetX:j,offsetY:Y}=w.nativeEvent;w.target===T&&(j>=T.clientWidth||Y>=T.clientHeight)||(R.current={id:w.pointerId,x:w.clientX,y:w.clientY,left:T.scrollLeft,top:T.scrollTop,pan:T.scrollWidth>T.clientWidth||T.scrollHeight>T.clientHeight,moved:!1})},[]);(0,X.useEffect)(()=>{let w=Y=>{let m=R.current;m===null||Y!==m.id||(m.moved&&(Q.current=performance.now()),R.current=null,D(!1))},T=Y=>{let m=R.current;if(m===null||Y.pointerId!==m.id)return;if(Y.buttons===0){w(Y.pointerId);return}let G=Y.clientX-m.x,B=Y.clientY-m.y;if(!m.moved){if(!ta(G,B))return;m.moved=!0,D(!0)}let P=s.current;if(P===null||!m.pan)return;let ue=na(m.left,m.top,G,B);P.scrollLeft=ue.left,P.scrollTop=ue.top},j=Y=>{w(Y.pointerId)};return window.addEventListener("pointermove",T),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j),()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j)}},[]),(0,X.useEffect)(()=>{let w=s.current;if(w===null||typeof ResizeObserver>"u")return;let T=new ResizeObserver(()=>{J.current==="fit"&&O()});return T.observe(w),()=>T.disconnect()},[O]);let q=(0,X.useCallback)(()=>{let w=l.current;w!==null&&(p({w:w.naturalWidth,h:w.naturalHeight}),J.current==="fit"&&O())},[O]),de=(0,X.useCallback)(()=>{performance.now()-Q.current<xi||(u==="fit"?z():W())},[u,z,W]),le=(0,X.useCallback)(()=>{k(!1)},[]),he=u==="fit"?S!==null?`${S}%`:"\u2014":`${Math.round(u*100)}%`,be=u!=="fit"&&d!==null?{width:`${d.w*u}px`,maxWidth:"none",maxHeight:"none"}:void 0,ee=d!==null?(0,X.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,X.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>ae(1/zn)},"\u2212"),(0,X.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${he}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:z},he),(0,X.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>ae(zn)},"+"),(0,X.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":u==="fit",onClick:W},n("files.zoomFit")),a?(0,X.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>k(!0)},"\u2921"):null]):null;return(0,X.createElement)("div",{className:"gp-zoom",ref:o,"data-zoomed":u==="fit"?void 0:"true","data-dragging":M?"true":void 0},[(0,X.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${r}`,ref:s,onPointerDown:se,onMouseDown:i===void 0?void 0:w=>{w.target===w.currentTarget&&i()}},(0,X.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:be,draggable:!1,onLoad:q,onDoubleClick:de})),ee,_?(0,X.createElement)(ki,{key:"lb",src:e,alt:t,t:n,onClose:le}):null])}function ki({src:e,alt:t,t:n,onClose:r}){let a=(0,X.useRef)(null),i=(0,X.useRef)(null),o=(0,X.useRef)(null);return(0,X.useEffect)(()=>{o.current=document.activeElement instanceof HTMLElement?document.activeElement:null,i.current?.focus();let s=()=>{let d=a.current;return d===null?[]:[...d.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(p=>!p.hasAttribute("disabled")&&p.getClientRects().length>0)},l=d=>{if(d.key==="Escape"){d.stopPropagation(),r();return}if(d.key!=="Tab")return;let p=s();if(p.length===0)return;let u=document.activeElement instanceof HTMLElement?document.activeElement:null,g=u===null?-1:p.indexOf(u);d.preventDefault();let S=d.shiftKey?-1:1,b=g===-1?S===-1?p.length-1:0:(g+S+p.length)%p.length;p[b]?.focus()};return window.addEventListener("keydown",l,!0),()=>{window.removeEventListener("keydown",l,!0),o.current?.focus()}},[r]),(0,ra.createPortal)((0,X.createElement)("div",{className:"gp-zl-backdrop",ref:a,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,X.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,X.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:r}),(0,X.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,X.createElement)(Ot,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:r})),(0,X.createElement)("button",{key:"close",ref:i,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:r},(0,X.createElement)(nt,{size:16}))])]),document.body)}function ln(e,t,n){let r=n(`diff.${e}`);return(0,at.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,at.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,at.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,at.createElement)(Ot,{key:"img",src:t,alt:r,t:n,viewportClass:"gp-imgcmp__img"})])}function aa({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,at.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ln("before",e,r)):n==="after"?(0,at.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ln("after",t,r)):(0,at.createElement)("div",{className:"gp-imgcmp"},[ln("before",e,r),ln("after",t,r)])}var Hn=20,_i=27,Si=29,ia=12,Ci=600,un=(0,x.memo)(function({text:t,mode:n,path:r,remote:a,sessionId:i,base:o,commit:s,expanded:l,truncated:d,newLines:p,t:u}){let g=(0,x.useMemo)(()=>Jr(t,p),[t,p]),S=Ir(t),b=(0,pn.useCodeHighlighter)(r===void 0?void 0:(0,pn.languageForPath)(r)),_=(0,x.useMemo)(()=>qr(b),[b]),[k,M]=(0,x.useState)(g),D=(0,x.useRef)(t);(0,x.useEffect)(()=>{if(D.current!==t){D.current=t,M(g);return}M(te=>Kr(te,p)??g)},[t,p,g]);let J=Mi(k,M,a,i,r,o,s),F=r!==void 0&&$r(r),[C,R]=(0,x.useState)("render");(0,x.useEffect)(()=>{R("render")},[r]);let U=(S||F)&&r!==void 0&&Or(r)&&a!==void 0&&i!==void 0&&o!==void 0&&(!F||C==="render"),K=Ri(U?a:void 0,U?i:void 0,U?r:void 0,U?o:void 0,U?s:void 0),[ae,z]=(0,x.useState)(!1),[W,O]=(0,x.useState)(""),[se,q]=(0,x.useState)(!1),[de,le]=(0,x.useState)(0),he=(0,x.useRef)(null),be=(0,x.useRef)(null),ee=(0,x.useRef)(null);(0,x.useEffect)(()=>{z(!1),O(""),le(0)},[t,r]);let w=(0,x.useMemo)(()=>n==="unified"?Ur(k):null,[n,k]),T=(0,x.useMemo)(()=>n==="before"?Li(k):n==="after"?Pi(k):null,[n,k]),j=(0,x.useMemo)(()=>Ni(k,w,T),[k,w,T]),Y=(0,x.useMemo)(()=>j.map(te=>({key:te.key,text:te.text.toLowerCase()})),[j]),m=rn(W,nn),G=se?m:m.toLowerCase(),B=se?j:Y,P=(0,x.useMemo)(()=>Ei(B,G),[B,G]);(0,x.useEffect)(()=>{le(0)},[G]);let ue=P.length===0?0:Math.min(de,P.length-1),Se=P.length>0?P[ue]:null,_e=Se?.cellKey??null,lt=Se?.start??-1,Fe=(0,x.useMemo)(()=>{let te=new Map;for(let $ of P){let h=te.get($.cellKey)??[];h.push([$.start,$.end]),te.set($.cellKey,h)}return te},[P]);(0,x.useEffect)(()=>{if(_e===null)return;let te=requestAnimationFrame(()=>ee.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(te)},[ue,P,_e,lt]);let De=(0,x.useCallback)(te=>{le($=>P.length===0?0:($+te+P.length)%P.length)},[P.length]);(0,x.useEffect)(()=>{let te=$=>{if(!(($.ctrlKey||$.metaKey)&&($.key==="f"||$.key==="F")))return;let h=he.current;h===null||h.offsetParent===null||($.preventDefault(),z(!0),requestAnimationFrame(()=>be.current?.select()))};return document.addEventListener("keydown",te),()=>document.removeEventListener("keydown",te)},[]);let{setEl:N,viewport:Ee,elRef:ze}=Tt(),xe=(0,x.useRef)(null),[$e,Ve]=(0,x.useState)(0),[Be,Ae]=(0,x.useState)(0),Me=(0,x.useRef)({mode:n,rows:k,heights:[]});(Me.current.mode!==n||Me.current.rows!==k)&&(Me.current={mode:n,rows:k,heights:[]});let Te=Me.current.heights,Xe=w!==null?w.length:T!==null?T.length:k.length,qe=(0,x.useCallback)(te=>{let $=w!==null?w[te]??null:T===null?k[te]??null:null;return $===null?Hn:$.kind==="hunk"?_i:$.kind==="gap"?Si:Hn},[w,T,k]),Ge=(0,x.useMemo)(()=>{let te=new Array(Xe);for(let $=0;$<Xe;$++){let h=Te[$];te[$]=h!==void 0&&h>0?h:qe($)}return te},[Xe,Te,qe,Be]),ke=(0,x.useMemo)(()=>St(Ge),[Ge]),ht=Ee.height>0?Ee.height:Ci,{first:ne,last:Ie}=Ct(ke,Math.max(0,Ee.top-$e),ht,ia*Hn),Lt=_e===null?-1:Ti(_e),{first:je,last:Qe}=en({first:ne,last:Ie},Lt,Xe,ia);if((0,x.useLayoutEffect)(()=>{let te=xe.current,$=ze.current;if(te===null||$===null)return;let h=te.getBoundingClientRect().top-$.getBoundingClientRect().top+$.scrollTop;Math.abs(h-$e)>.5&&Ve(h);let L=new Map;for(let re of te.querySelectorAll("[data-r]")){let pe=Number(re.dataset.r),we=re.getBoundingClientRect().height;if(!Number.isFinite(we)||we<=0)continue;let We=L.get(pe);(We===void 0||we>We)&&L.set(pe,we)}let E=!1;for(let[re,pe]of L){let we=Te[re];(we===void 0||Math.abs(we-pe)>.5)&&(Te[re]=pe,E=!0)}E&&Ae(re=>re+1)}),U){let te=(()=>{if(K.kind==="idle"||K.kind==="loading")return(0,x.createElement)("div",{className:"gp-empty"},u("common.loading"));if(K.kind==="ready"){let $=K.res;if($.tooLarge===!0)return(0,x.createElement)("div",{className:"gp-empty"},u("diff.tooLarge"));if($.mime!==null&&($.old!==void 0||$.new!==void 0))return(0,x.createElement)(aa,{oldUrl:$.old,newUrl:$.new,mode:n,t:u})}return(0,x.createElement)("div",{className:"gp-empty"},u("diff.binary"))})();return F?oa(C,R,te,u):te}if(S&&!F)return(0,x.createElement)("div",{className:"gp-empty"},u("diff.binary"));let Ye=ae&&G!==""?{perCell:Fe,activeKey:_e,activeRange:Se!==null?[Se.start,Se.end]:null,activeRef:ee}:null,yt=(te,$)=>$>.5?(0,x.createElement)("div",{key:te,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${$}px`}}):null,Ce=yt("lead",ke[je]),Je=yt("tail",ke[Xe]-ke[Qe]),bt=(()=>{if(t.trim()==="")return(0,x.createElement)("div",{className:"gp-empty"},u("diff.empty"));if(T!==null){let $=[Ce];for(let h=je;h<Qe;h++){let L=T[h];$.push((0,x.createElement)("div",{key:`n${h}`,className:"gp-diff-no"},L.no??"")),$.push(cn("gp-diff-cell",`c${h}`,L.text,_,Ye,h))}return $.push(Je),(0,x.createElement)("div",{className:"gp-diff__single",ref:xe},$)}if(w!==null){let $=[Ce];for(let h=je;h<Qe;h++)$.push(...zi(w[h],h,_,J,Ye,u));return $.push(Je),(0,x.createElement)("div",{className:"gp-diff__unified",ref:xe},$)}let te=[Ce];for(let $=je;$<Qe;$++)te.push(...Di(k[$],$,_,J,Ye,u));return te.push(Je),(0,x.createElement)("div",{className:"gp-diff__side",ref:xe},te)})(),dt=ae?(0,x.createElement)(sn,{inputRef:be,query:W,matches:P.length,active:ue,caseSensitive:se,onChange:O,onToggleCase:()=>q(te=>!te),onStep:De,onClose:()=>z(!1),t:u}):null,Ze=l===!0&&k.some(te=>te.kind==="gap"),ct=(0,x.createElement)("div",{className:"gp-diff__wrap",ref:he},[dt,d===!0?(0,x.createElement)("div",{key:"truncated",className:"gp-notice"},u("diff.truncated")):null,Ze?(0,x.createElement)("div",{key:"capped",className:"gp-notice"},u("diff.expandCapped",{n:2e3})):null,(0,x.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:N},bt)]);return F?oa(C,R,ct,u):ct});function Ti(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function Ni(e,t,n){let r=[];return n!==null?(n.forEach((a,i)=>r.push({key:`c${i}`,text:a.text})),r):t!==null?(t.forEach((a,i)=>{if(a.kind==="hunk"||a.kind==="gap")return;let o=a.rightText??a.leftText??"";o!==""&&r.push({key:`c${i}`,text:o})}),r):(e.forEach((a,i)=>{a.kind==="hunk"||a.kind==="gap"||(a.leftText!==null&&a.leftText!==""&&r.push({key:`l${i}`,text:a.leftText}),a.rightText!==null&&a.rightText!==""&&r.push({key:`r${i}`,text:a.rightText}))}),r)}function Ei(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[a,i]of an(r.text,t))if(n.push({cellKey:r.key,start:a,end:i}),n.length>=tn)return n;return n}function oa(e,t,n,r){let a=(i,o)=>(0,x.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${e===i?" gp-seg__btn--active":""}`,"aria-pressed":e===i,onClick:()=>t(i)},o);return(0,x.createElement)("div",{className:"gp-svgdiff"},[(0,x.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,x.createElement)("div",{className:"gp-seg"},[a("render",r("diff.svgRender")),a("source",r("diff.svgSource"))])),(0,x.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function Mi(e,t,n,r,a,i,o){let[s,l]=(0,x.useState)(null),d=(0,x.useRef)(0);(0,x.useEffect)(()=>{d.current+=1,l(null)},[e]);let p=(0,x.useCallback)((u,g)=>{if(n===void 0||r===void 0||a===void 0||i===void 0)return;let S=`${u.rightStart}:${g}`;l(S);let b=++d.current,{start:_,end:k}=Gi(u,g),M=i==="commit"&&o!==void 0?{kind:"file-lines",path:a,base:"commit",commit:o,start:_,end:k}:i==="staged"?{kind:"file-lines",path:a,base:"staged",start:_,end:k}:{kind:"file-lines",path:a,base:"worktree",start:_,end:k};n.query({sessionId:r,query:M}).then(D=>{if(b!==d.current)return;let J=ye(D,"file-lines");l(null),J!==null&&t(F=>Vr(F,u.rightStart,g,J.start,J.lines,J.eof))}).catch(()=>{b===d.current&&l(null)})},[n,r,a,i,o,t]);return{busy:s,run:p}}function Gi(e,t){let n=e.count;return t==="all"||n<=gt?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+gt-1}:{start:e.rightStart+n-gt,end:e.rightStart+n-1}}function Ri(e,t,n,r,a){let[i,o]=(0,x.useState)({kind:"idle"});return(0,x.useEffect)(()=>{if(e===void 0||t===void 0||n===void 0||r===void 0)return;let s=!0;o({kind:"loading"});let l=r==="commit"&&a!==void 0?{kind:"image-diff",path:n,base:"commit",commit:a}:r==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"};return e.query({sessionId:t,query:l}).then(d=>{if(!s)return;let p=ye(d,"image-diff");o(p!==null?{kind:"ready",res:p}:{kind:"failed"})}).catch(()=>{s&&o({kind:"failed"})}),()=>{s=!1}},[e,t,n,r,a]),i}function dn(e,t=""){return e.map((n,r)=>(0,x.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function sa(e,t,n,r){if(n===null)return null;let a=n.perCell.get(t);if(a===void 0||a.length===0)return null;let i=n.activeKey===t?n.activeRange:null;return on(e,a,r,t,i,n.activeRef)}function cn(e,t,n,r,a=null,i=-1){let o={key:t,className:e,"data-r":i>=0?i:void 0};if(n==="")return(0,x.createElement)("div",o,"\xA0");let s=r(n)?.[0],l=sa(n,t,a,s);return l!==null?(0,x.createElement)("div",o,l):(0,x.createElement)("div",o,s===void 0?n:dn(s))}function Fn(e,t,n,r,a,i,o=null,s=-1){let l={key:t,className:e,"data-r":s>=0?s:void 0},d=i(n)?.[0]??[{text:n,style:{}}],p=sa(n,t,o,d);if(p!==null)return(0,x.createElement)("div",l,p);let[u,g,S]=Wr(d,r);return(0,x.createElement)("div",l,[...dn(u,"p"),(0,x.createElement)("span",{key:"w",className:a},g.length===0?"\xA0":dn(g)),...dn(S,"s")])}function Li(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function Pi(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function Di(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,x.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[la(e.gap,t,r,i)];let o=e.kind==="del"||e.kind==="mod"?"gp-diff-row--del":"",s=e.kind==="add"||e.kind==="mod"?"gp-diff-row--add":"",l=e.leftText===null?(0,x.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${o}`}):e.kind==="mod"&&e.leftWord!==void 0?Fn(`gp-diff-cell ${o}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,a,t):cn(`gp-diff-cell ${o}`,`l${t}`,e.leftText,n,a,t),d=e.rightText===null?(0,x.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.rightWord!==void 0?Fn(`gp-diff-cell ${s}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,a,t):cn(`gp-diff-cell ${s}`,`r${t}`,e.rightText,n,a,t);return[(0,x.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,x.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function zi(e,t,n,r,a,i){if(e.kind==="hunk")return[(0,x.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[la(e.gap,t,r,i)];let o=e.kind==="del",s=e.kind==="add",l=s?"gp-diff-row--add":o?"gp-diff-row--del":"",d=s?"+":o?"\u2212":"\xA0",p=e.rightText??e.leftText??"",u=s?e.rightWord:o?e.leftWord:void 0,g=s?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",S=`gp-diff-cell gp-diff-uni__code ${l}`,b=u!==void 0?Fn(S,`c${t}`,p,u,g,n,a,t):cn(S,`c${t}`,p,n,a,t);return[(0,x.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,x.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,x.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),b]}function la(e,t,n,r){let a=n.busy===`${e.rightStart}:all`,i=n.busy===`${e.rightStart}:up`,o=n.busy===`${e.rightStart}:down`,s=(p,u,g)=>(0,x.createElement)("button",{key:p,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:S=>{S.stopPropagation(),n.run(e,p)}},g?r("common.loading"):u),l=[],d=e.count;return d<=gt?l.push(s("all",r("diff.expandGap",{n:d}),a)):(e.atStart||l.push(s("up",r("diff.expandUp",{n:gt}),i)),l.push(s("all",r("diff.expandGap",{n:d}),a)),l.push(s("down",r("diff.expandDown",{n:gt}),o))),(0,x.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function gn(e){return Xr(e)}var Z=require("react");var Ai=100;function da(e,t,n){let[r,a]=(0,Z.useState)(null),[i,o]=(0,Z.useState)(!1),[s,l]=(0,Z.useState)([]),d=(0,Z.useCallback)(()=>{o(!1),(async()=>{let[p,u]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]),g=ye(p,"branches");if(g===null){o(!0);return}let S=ye(u,"tags");a({current:g.current,defaultBranch:g.defaultBranch,local:g.local,remote:g.remote,tags:S?.tags??[]}),e.query({sessionId:t,query:{kind:"authors"}}).then(b=>{l(ye(b,"authors")?.authors??[])})})()},[e,t]);return(0,Z.useEffect)(()=>{d()},[n]),{tree:r,treeError:i,authors:s,reload:d}}function ca(e,t,n,r,a){let[i,o]=(0,Z.useState)([]),[s,l]=(0,Z.useState)(0),[d,p]=(0,Z.useState)(!1),[u,g]=(0,Z.useState)(!1),S=(0,Z.useRef)(0),b=(0,Z.useRef)(!1),_=(0,Z.useRef)(null),k=(0,Z.useCallback)(async(F,C)=>{if(b.current)return;b.current=!0;let R=S.current;p(!0),g(!1);let Q=await e.query({sessionId:t,query:{kind:"history",limit:Ai,skip:F,...C.ref?{ref:C.ref}:{},...C.search?{search:C.search}:{},...C.author?{author:C.author}:{},...C.since?{since:C.since}:{}}});if(b.current=!1,R!==S.current)return;p(!1);let U=ye(Q,"history");if(U===null){g(!0);return}let K=U.commits;o(ae=>F===0?K:[...ae,...K]),l(U.total)},[e,t]),M=(0,Z.useRef)(n);(0,Z.useEffect)(()=>{S.current+=1,b.current=!1,M.current!==n&&(M.current=n,a(),_.current&&(_.current.scrollTop=0)),k(0,n)},[n,r]);let D=s<0?!0:i.length<s,J=(0,Z.useCallback)(()=>{b.current||!D||k(i.length,n)},[k,i.length,n,D]);return{commits:i,total:s,loading:d,listError:u,hasMore:D,listRef:_,loadMore:J}}function pa(e,t,n){let[r,a]=(0,Z.useState)(null),[i,o]=(0,Z.useState)(null),[s,l]=(0,Z.useState)(!1),[d,p]=(0,Z.useState)(null),[u,g]=(0,Z.useState)(null),[S,b]=(0,Z.useState)(!1),[_,k]=(0,Z.useState)(n),[M,D]=(0,Z.useState)(!1),J=(0,Z.useRef)(0),F=(0,Z.useRef)(null),C=(0,Z.useRef)(new Map),R=(0,Z.useCallback)((ee,w)=>{let T=C.current;for(T.set(ee,w);T.size>50;){let j=T.keys().next().value;if(j===void 0)break;T.delete(j)}},[]),Q=(0,Z.useCallback)(()=>{a(null),o(null),F.current=null},[]),U=(0,Z.useCallback)(ee=>{F.current===ee.hash&&a(ee)},[]),K=(0,Z.useCallback)(async ee=>{F.current=ee.hash,a(ee),l(!1),J.current+=1,p(null),g(null),b(!1);let w=C.current.get(ee.hash);if(w!==void 0){o(w);return}o(null);let T=await e.query({sessionId:t,query:{kind:"show",ref:ee.hash}});if(F.current!==ee.hash)return;let j=ye(T,"show");if(j!==null){let Y={commit:j.commit,body:j.body,stats:j.stats,insertions:j.insertions,deletions:j.deletions};R(ee.hash,Y),o(Y)}else l(!0)},[e,t,R]),ae=(0,Z.useCallback)(async(ee,w,T,j=!1)=>{let Y=++J.current;p({path:ee,hash:w,shortHash:T}),g(null),b(!1),D(j);let m=await e.query({sessionId:t,query:{kind:"diff",path:ee,base:"commit",commit:w,...j?{context:2e3}:{}}});if(Y!==J.current)return;let G=ye(m,"diff");G!==null?g({text:G.text,newLines:G.newLines,truncated:G.truncated}):b(!0)},[e,t]),z=(0,Z.useCallback)(()=>{J.current+=1,p(null),g(null),b(!1),D(!1)},[]);(0,Z.useEffect)(()=>{if(d===null)return;let ee=w=>{w.key==="Escape"&&z()};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[d,z]);let[W,O]=(0,Z.useState)(null),[se,q]=(0,Z.useState)(null),de=(0,Z.useRef)(void 0),le=(0,Z.useRef)(null),he=(0,Z.useCallback)((ee,w,T)=>{de.current!==void 0&&clearTimeout(de.current),de.current=setTimeout(()=>{le.current=ee.hash,O({commit:ee,x:w,y:T});let j=C.current.get(ee.hash);if(j!==void 0){q(j.body);return}q(null),e.query({sessionId:t,query:{kind:"show",ref:ee.hash}}).then(Y=>{if(le.current!==ee.hash)return;let m=ye(Y,"show");m!==null?(R(ee.hash,{commit:m.commit,body:m.body,stats:m.stats,insertions:m.insertions,deletions:m.deletions}),q(m.body)):q("")})},260)},[e,t,R]),be=(0,Z.useCallback)(()=>{de.current!==void 0&&clearTimeout(de.current),le.current=null,O(null),q(null)},[]);return(0,Z.useEffect)(()=>()=>{de.current!==void 0&&clearTimeout(de.current)},[]),{selected:r,detail:i,detailError:s,select:K,resyncSelected:U,clearSelection:Q,fileDiff:d,fileDiffData:u,fileDiffError:S,fileDiffMode:_,setFileDiffMode:k,fileDiffExpanded:M,openFileDiff:ae,closeFileDiff:z,hover:W,hoverBody:se,onHoverEnter:he,onHoverLeave:be}}var Oe=require("react"),Hi=(e,t,n)=>Math.max(t,Math.min(n,e));function Fi(e,t){try{let n=typeof localStorage<"u"?localStorage.getItem(e):null,r=n===null?NaN:Number(n);return Number.isFinite(r)?r:t}catch{return t}}function Bi(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function mt(e){let{storageKey:t,initial:n,min:r,reserve:a,edge:i}=e,[o,s]=(0,Oe.useState)(()=>Fi(t,n)),l=(0,Oe.useRef)(null),d=(0,Oe.useRef)(null),p=(0,Oe.useCallback)(g=>{let b=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:g.clientX,w:o,max:Math.max(r,b-a)},g.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[o,r,a]);(0,Oe.useEffect)(()=>{if(typeof window>"u")return;let g=b=>{let _=d.current;if(_===null)return;let k=b.clientX-_.x;s(Hi(_.w+(i==="end"?k:-k),r,_.max))},S=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),s(b=>(Bi(t,b),b)))};return window.addEventListener("pointermove",g),window.addEventListener("pointerup",S),()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",S)}},[i,r,t]);let u=(0,Oe.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:p});return{width:o,divider:u}}var ua=require("react");function it(e,t,n,r,a=!1){return e.map(i=>(0,ua.createElement)("button",{key:i,type:"button",className:`gp-seg__btn${t===i?" gp-seg__btn--active":""}`,...a?{disabled:!0}:{},onClick:()=>n(i)},r(i)))}var me=require("react"),ga=require("react-dom");function $t(e,t,n){switch(e){case"empty-message":return n("error.emptyMessage");case"not-a-git-repo":return n("error.notARepo");case"cwd-unavailable":return n("error.noCwd");case"local-changes-block":return n("error.localChangesBlock");case"not-ff":return n("error.notFastForward");case"push-rejected":return n("error.pushRejected");case"auth-failed":return n("error.authFailed");case"conflict":return n("error.conflict");case"revert-conflict":return n("error.revertConflict");case"revert-stuck":return n("error.revertStuck");case"revert-merge":return n("error.revertMerge");case"index-busy":return n("error.indexBusy");case"not-found":return n("error.notFound");case"branch-in-use":return n("error.branchInUse");case"stash-switch-failed":return n("error.stashSwitchFailed",{reason:t??""});case"invalid-name":case"invalid-index":return n("error.invalidName");default:return t??n("error.generic")}}function Nt(e){return(0,me.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function Et(e){return(0,me.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,me.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,me.createElement)("button",{key:"ok",type:"button",className:`gp-btn ${e.danger?"gp-btn--danger":"gp-btn--primary"}`,disabled:e.confirmDisabled,onClick:e.onConfirm},e.confirmLabel)])}function ot(e){return typeof document>"u"?null:(0,me.createElement)(Ii,e)}function Ii({onClose:e,title:t,icon:n,hash:r,body:a,footer:i,overlay:o,portalKey:s,t:l}){let d=o!=null;(0,me.useEffect)(()=>{let u=g=>{g.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,d]);let p=(0,me.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{!d&&u.target===u.currentTarget&&e()}},(0,me.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,me.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,me.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,me.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,me.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,me.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,me.createElement)(nt,{size:15}))]),(0,me.createElement)("div",{key:"body",className:"gp-modal__form"},a),i,o??null]));return(0,ga.createPortal)(p,document.body,s)}function Oi(e){return(0,me.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,me.createElement)("div",{key:"sp",className:"gp-spinner"}),(0,me.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function Ke(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return ot({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,me.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,Nt(e.t),e.error!==null?(0,me.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:Et({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:Oi(e.busyLabel)}:{}})}var ie=require("react");function fa(e,t){return typeof document>"u"?null:(0,ie.createElement)($i,{target:e,...t})}function $i({target:e,onClose:t,onCreate:n,error:r,t:a}){let[i,o]=(0,ie.useState)(""),[s,l]=(0,ie.useState)(!1),[d,p]=(0,ie.useState)(""),u=()=>{i.trim()!==""&&n(i.trim(),s?d:"")};return ot({onClose:t,title:a("tag.createTitle"),icon:(0,ie.createElement)(wt,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:a,body:[(0,ie.createElement)("input",{key:"name",className:"gp-input",placeholder:a("tag.namePlaceholder"),value:i,autoFocus:!0,onChange:g=>o(g.target.value),onKeyDown:g=>{g.key==="Enter"&&u()}}),(0,ie.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,ie.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:s,onChange:()=>l(g=>!g)}),a("tag.annotated")]),s?(0,ie.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:a("tag.messagePlaceholder"),value:d,onChange:g=>p(g.target.value)}):null,Nt(a),r!==null?(0,ie.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:Et({onClose:t,onConfirm:u,confirmLabel:a("tag.create"),confirmDisabled:i.trim()==="",danger:!1,t:a})})}function ma(e,t){return typeof document>"u"?null:(0,ie.createElement)(Xi,{target:e,...t})}function Xi({target:e,from:t,dirty:n,lostFiles:r,lostTotal:a,lostTruncated:i,busy:o,error:s,onReset:l,onClose:d,t:p}){let[u,g]=(0,ie.useState)("mixed"),[S,b]=(0,ie.useState)(!1);(0,ie.useEffect)(()=>{u!=="hard"&&b(!1)},[u]);let _=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],k=o||u==="hard"&&!S;return ot({onClose:d,title:p("reset.title"),icon:(0,ie.createElement)(Qt,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:p,body:[(0,ie.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},p("reset.body",{from:t,to:e.shortHash})),(0,ie.createElement)("div",{key:"modes",className:"gp-reset__modes"},_.map(M=>(0,ie.createElement)("label",{key:M.value,className:`gp-reset__mode${u===M.value?" gp-reset__mode--on":""}${M.value==="hard"?" gp-reset__mode--danger":""}`},[(0,ie.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:u===M.value,onChange:()=>g(M.value)}),(0,ie.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,ie.createElement)("span",{key:"l",className:"gp-reset__modelabel"},p(M.label)),(0,ie.createElement)("span",{key:"h",className:"gp-reset__modehint"},p(M.hint))])]))),u==="hard"?(0,ie.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},p("reset.hardOrphan")):null,u==="hard"&&a>0?(0,ie.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,ie.createElement)("div",{key:"w",className:"gp-reset__warn"},p("reset.hardWarn")),(0,ie.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(M=>(0,ie.createElement)("li",{key:M,title:M},M)),i?(0,ie.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},p("reset.lostMore")):null])]):null,u==="hard"?(0,ie.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,ie.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:S,onChange:()=>b(M=>!M)}),p(a>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,ie.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},p("ops.dirtyWarn")):null,Nt(p),s!==null?(0,ie.createElement)("div",{key:"err",className:"gp-feedback"},s):null],footer:Et({onClose:d,onConfirm:()=>void l(u),confirmLabel:p("reset.confirm"),confirmDisabled:k,danger:u==="hard",t:p})})}var Le=require("react");function ha(e,t){return typeof document>"u"?null:(0,Le.createElement)(Ji,{target:e,...t})}function Ji({target:e,from:t,dirty:n,busy:r,error:a,onConfirm:i,onClose:o,t:s}){let[l,d]=(0,Le.useState)(!1),p=(u,g,S,b)=>(0,Le.createElement)("label",{key:g,className:`gp-bpick__mode${l===u?" gp-bpick__mode--on":""}`},[(0,Le.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===u,onChange:()=>d(u)}),(0,Le.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,Le.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},S),(0,Le.createElement)("span",{key:"h",className:"gp-bpick__modehint"},b)])]);return Ke({title:s("switch.confirmTitle"),body:s("switch.body",{from:t??s("switch.detached"),to:e.name}),extra:(0,Le.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,Le.createElement)("div",{key:"trk",className:"gp-bpick__note"},s("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,Le.createElement)("div",{key:"dw",className:"gp-bpick__warn"},s("switch.dirtyWarn",{count:n})),n===0?null:(0,Le.createElement)("div",{key:"md",className:"gp-bpick__modes"},[p(!1,"direct",s("switch.modeDirect"),s("switch.modeDirectHint")),p(!0,"stash",s("switch.modeStash",{count:n}),s("switch.modeStashHint"))])]),confirmLabel:s(l?"switch.confirmStash":"switch.confirm"),danger:!1,error:a,confirmBusy:r,busyLabel:s("switch.switching"),onConfirm:()=>i(l),onClose:o,t:s})}function Ki(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function ya(e){let t=new Set(e.local.map(a=>a.name)),n=e.local.map(a=>({key:`local:${a.name}`,group:"local",label:a.name,name:a.name,reused:!1,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})),r=[];for(let a of e.remote){let i=Ki(a.name);if(i===null)continue;let o=t.has(i.branch);r.push({key:`remote:${a.name}`,group:"remote",label:a.name,name:i.branch,createFrom:o?void 0:a.name,reused:o,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})}return[...n,...r]}function ba(e,t){return e.name!==t}var ge=require("react");var Ue=require("react"),va=require("react-dom"),Ui=140,Vi=260;function fn(e){let t=e?.placement??"above",n=e?.delayMs??Ui,r=e?.maxWidth??Vi,[a,i]=(0,Ue.useState)(null),o=(0,Ue.useRef)(void 0),s=(0,Ue.useCallback)(()=>{o.current!==void 0&&(clearTimeout(o.current),o.current=void 0),i(null)},[]),l=(0,Ue.useCallback)((g,S)=>{o.current!==void 0&&clearTimeout(o.current),o.current=setTimeout(()=>{let b=g.getBoundingClientRect(),_=Math.max(8,Math.min(b.left,window.innerWidth-r-8));i(t==="below"?{text:S,left:_,top:b.bottom+6}:{text:S,left:_,bottom:Math.max(8,window.innerHeight-b.top+6)})},n)},[t,n,r]),d=(0,Ue.useCallback)(g=>({onMouseEnter:S=>l(S.currentTarget,g),onMouseLeave:s,onFocus:S=>l(S.currentTarget,g),onBlur:s}),[l,s]),p={left:a?.left??0,maxWidth:r};a?.top!==void 0&&(p.top=a.top),a?.bottom!==void 0&&(p.bottom=a.bottom);let u=a!==null&&typeof document<"u"?(0,va.createPortal)((0,Ue.createElement)("div",{className:"gp-tip gp-tip--sb",style:p},a.text),document.body):null;return{tipProps:d,tipNode:u,hideTip:s}}function wa(e,t,n){if(e==="loading"||e===null)return(0,ge.createElement)("div",{className:"gp-pullscope gp-pullscope--loading"},t(n.loading));let r=t(n.line,{commits:e.commits,files:e.files,ins:e.insertions,del:e.deletions}),a=r.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(a===null)return(0,ge.createElement)("div",{className:"gp-pullscope"},r);let i=r.indexOf(a[0]);return(0,ge.createElement)("div",{className:"gp-pullscope"},[r.slice(0,i),(0,ge.createElement)("span",{key:"add",className:"gp-pullscope__add"},a[1])," / ",(0,ge.createElement)("span",{key:"del",className:"gp-pullscope__del"},a[2]),r.slice(i+a[0].length)])}function xa(e,t){return wa(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function ka(e,t){return wa(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function Wi(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function Bn(e,t){return(0,ge.createElement)(qi,{snapshot:e,cb:t})}function qi({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:a,hideTip:i}=fn({placement:"above"}),o=e.remote??null,s=e.hasUpstream===!0,l=(()=>{if(o===null||o.hostKind!=="github")return null;let M=(0,ge.createElement)(Mr,{size:14});if(o.webUrl===null)return(0,ge.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":o.url,...r(o.url)},(0,ge.createElement)("span",{className:"gp-statusbar__ic"},M));let D=o.host!==null?n("status.openRepoOn",{host:o.host}):n("status.openRepo"),J=`${Wi(o.webUrl)} \xB7 ${D}`;return(0,ge.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:o.webUrl,target:"_blank",rel:"noreferrer","aria-label":J,...r(J)},(0,ge.createElement)("span",{className:"gp-statusbar__ic"},M))})(),{ahead:d,behind:p,branch:u}=e,g=s&&p>0&&d===0,S=s&&d>0&&p===0,b=!s&&u!==null&&o!==null,_=(()=>{let M,D="";return u===null?M=n("status.detached"):s?d===0&&p===0?(M=n("status.synced"),D=" gp-statusbar__state--ok"):d>0&&p>0?(M=n("status.diverged",{ahead:d,behind:p}),D=" gp-statusbar__state--warn"):p>0?(M=n("status.behind",{n:p}),D=" gp-statusbar__state--warn"):M=n("status.ahead",{n:d}):M=n("status.noUpstream"),(0,ge.createElement)("span",{key:"s",className:`gp-statusbar__state${D}`},M)})(),k=[o!==null?(0,ge.createElement)("button",{key:"check",type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),...r(n("status.checkTitle")),onClick:()=>{i(),t.onCheck()}},(0,ge.createElement)(Rr,{size:13})):null,g?(0,ge.createElement)("button",{key:"pull",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),...r(n("status.pullTitle")),onClick:()=>{i(),t.onPull()}},[(0,ge.createElement)(Gr,{key:"i",size:12}),n("status.pull")]):null,S?(0,ge.createElement)("button",{key:"push",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),...r(n("status.pushTitle")),onClick:()=>{i(),t.onPush()}},[(0,ge.createElement)(Ln,{key:"i",size:12}),n("status.push")]):null,b?(0,ge.createElement)("button",{key:"publish",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),...r(n("status.publishTitle")),onClick:()=>{i(),t.onPublish()}},[(0,ge.createElement)(Ln,{key:"i",size:12}),n("status.publish")]):null];return(0,ge.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,ge.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[_,...k]),a])}var In=new Set,Mt=14,_a=30;function ji(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].kind!==t[n].kind||e[n].name!==t[n].name||e[n].head!==t[n].head)return!1;return!0}var Qi=46,Yi=260;function Zi(e,t){let[n,r]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=()=>r(e.clientWidth>0&&e.clientWidth<t);a();let i=new ResizeObserver(a);return i.observe(e),()=>i.disconnect()},[e,t]),n}function Sa({remote:e,sessionId:t,refreshKey:n,defaultDiffView:r,snapshot:a,onAction:i,onResync:o,compact:s,t:l}){let[d,p]=(0,c.useState)({ref:null,search:"",author:"",since:""}),[u,g]=(0,c.useState)(""),[S,b]=(0,c.useState)(null),_=Zi(S,Yi),[k,M]=(0,c.useState)(new Set(["tags","remote"])),[D,J]=(0,c.useState)(0),F=n+D,C=()=>J(y=>y+1),[R,Q]=(0,c.useState)(null),[U,K]=(0,c.useState)(null),[ae,z]=(0,c.useState)(null),[W,O]=(0,c.useState)(null),[se,q]=(0,c.useState)(null),[de,le]=(0,c.useState)(!1),[he,be]=(0,c.useState)(!1),[ee,w]=(0,c.useState)(!1),[T,j]=(0,c.useState)(!1),[Y,m]=(0,c.useState)(!1),[G,B]=(0,c.useState)(!1),[P,ue]=(0,c.useState)(!1),[Se,_e]=(0,c.useState)(!1),[lt,Fe]=(0,c.useState)(null),[De,N]=(0,c.useState)(null),[Ee,ze]=(0,c.useState)("list"),[xe,$e]=(0,c.useState)(null),[Ve,Be]=(0,c.useState)(!1),[Ae,Me]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!Ae)return;let y=V=>{V.key==="Escape"&&Me(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[Ae]),(0,c.useEffect)(()=>{!s&&Ae&&Me(!1)},[s,Ae]),(0,c.useEffect)(()=>{if(!T){Fe(null);return}let y=!0;return Fe("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then(V=>{if(!y)return;let ce=ye(V,"pull-preview");Fe(ce!==null&&ce.hasUpstream?{commits:ce.commits,files:ce.files,insertions:ce.insertions,deletions:ce.deletions}:null)}),()=>{y=!1}},[T,e,t]),(0,c.useEffect)(()=>{if(!G){N(null);return}let y=!0;return N("loading"),e.query({sessionId:t,query:{kind:"push-preview"}}).then(V=>{if(!y)return;let ce=ye(V,"push-preview");N(ce!==null&&ce.hasUpstream?{commits:ce.commits,files:ce.files,insertions:ce.insertions,deletions:ce.deletions}:null)}),()=>{y=!1}},[G,e,t]);let{tree:Te,treeError:Xe,authors:qe,reload:Ge}=da(e,t,F),ke=(0,c.useMemo)(()=>{let y=new Map;if(Te===null)return y;for(let V of ya(Te))ba(V,Te.current)&&y.set(V.key,V);return y},[Te]),ht=y=>{q(null),$e(y)},ne=pa(e,t,r),{commits:Ie,loading:Lt,listError:je,hasMore:Qe,listRef:Ye,loadMore:yt}=ca(e,t,d,F,ne.clearSelection);(0,c.useEffect)(()=>{let y=setTimeout(()=>p(V=>V.search===u?V:{...V,search:u}),300);return()=>clearTimeout(y)},[u]);let Ce=d.search!=="",Je=(0,c.useMemo)(()=>Ce?Ie.map(y=>({commit:y,lane:0,color:0,edges:[],merge:!1})):zr(Ie,a.graphStyle),[Ie,Ce,a.graphStyle]),bt=(0,c.useMemo)(()=>Ce?0:Dr(Je),[Je,Ce]),dt=Ce?12:Math.max(Mt,bt*Mt),Ze=s?Qi:_a,ct=s?`${dt}px minmax(0,1fr)`:`${dt}px minmax(120px,1fr) 72px 120px 96px`,te=()=>{let y=Ye.current;y===null||!Qe||y.scrollTop+y.clientHeight>=y.scrollHeight-240&&yt()},$=y=>{ne.select(y),s&&ze("detail")},h=(0,c.useMemo)(()=>Date.now(),[Ie]),L=(0,c.useMemo)(()=>ne.detail===null?[]:Ar(ne.detail.stats.map(y=>({path:y.path,meta:y.status}))),[ne.detail]),E=ne.selected,re=E?.hash??null,[pe,we]=(0,c.useState)({hash:null,dirs:In}),We=pe.hash===re?pe.dirs:In,Ka=(0,c.useCallback)(y=>{we(V=>{let ce=V.hash===re?V.dirs:In,Jt=new Set(ce);return Jt.has(y)?Jt.delete(y):Jt.add(y),{hash:re,dirs:Jt}})},[re]);(0,c.useEffect)(()=>{if(E===null)return;let y=Ie.find(V=>V.hash===E.hash);y!==void 0&&y!==E&&!ji(y.refs,E.refs)&&ne.resyncSelected(y)},[Ie,E]);let Qn=mt({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),Yn=mt({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),Zn=y=>p(V=>({...V,ref:y})),Ua=async(y,V)=>{if(!(R===null||de)){q(null),le(!0);try{let ce=await e.run({sessionId:t,action:{kind:"tag-create",name:y,commit:R.hash,...V.trim()!==""?{message:V}:{}}});ce.ok?(Q(null),C()):q($t(ce.error.code,ce.error.message,l))}finally{le(!1)}}},Va=async y=>{if(!de){q(null),le(!0);try{let V=await e.run({sessionId:t,action:{kind:"tag-delete",name:y}});V.ok?(K(null),C()):q($t(V.error.code,V.error.message,l))}finally{le(!1)}}},Wa=async()=>{if(!(ae===null||de)){q(null),le(!0);try{let y=await i({kind:"revert",commit:ae.hash});y.ok?z(null):q(y.error??l("error.generic"))}finally{le(!1)}}},qa=async y=>{if(!(W===null||de)){q(null),le(!0);try{let V=await i({kind:"reset",commit:W.hash,mode:y});V.ok?O(null):q(V.error??l("error.generic"))}finally{le(!1)}}},ja=async y=>{if(!(xe===null||Ve)){q(null),Be(!0);try{let V=await i({kind:"branch-checkout",name:xe.name,...xe.createFrom===void 0?{}:{createFrom:xe.createFrom},...y?{stashMessage:l("switch.stashMessage",{branch:xe.name})}:{}});V.ok?($e(null),Ge()):q(V.error??l("error.generic"))}finally{Be(!1)}}},Qa=async()=>{if(!he){q(null),be(!0);try{let y=await i({kind:"fetch"});y.ok?Ge():q(y.error??l("error.generic"))}finally{be(!1)}}},Ya=async()=>{if(!ee){q(null),w(!0);try{let y=await i({kind:"pull-ff"});y.ok?(j(!1),Ge()):q(y.error??l("error.generic"))}finally{w(!1)}}},Za=async()=>{if(!Y){q(null),m(!0);try{let y=await i({kind:"push"});y.ok?(B(!1),Ge()):q(y.error??l("error.generic"))}finally{m(!1)}}},ei=async()=>{if(!(P||a.remote===null)){q(null),ue(!0);try{let y=await i({kind:"publish",remote:a.remote.name});y.ok?(_e(!1),Ge()):q(y.error??l("error.generic"))}finally{ue(!1)}}},er={syncBusy:he,pullBusy:ee,pushBusy:Y,publishBusy:P,onCheck:()=>void Qa(),onPull:()=>{q(null),j(!0)},onPush:()=>{q(null),B(!0)},onPublish:()=>{q(null),_e(!0)},t:l},tr=io(ne.fileDiff,{data:ne.fileDiffData,error:ne.fileDiffError,mode:ne.fileDiffMode,onMode:ne.setFileDiffMode,expanded:ne.fileDiffExpanded,onExpand:y=>{ne.fileDiff!==null&&ne.openFileDiff(ne.fileDiff.path,ne.fileDiff.hash,ne.fileDiff.shortHash,y)},onClose:ne.closeFileDiff,remote:e,sessionId:t,compact:s,t:l}),nr=(0,c.useMemo)(()=>[...new Set(a.changes.filter(y=>y.status!=="untracked").map(y=>y.path))],[a.changes]),rr=[R!==null?fa(R,{onClose:()=>Q(null),onCreate:Ua,error:se,compact:s,t:l}):null,U!==null?Ke({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:U}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:se,confirmBusy:de,onConfirm:()=>void Va(U),onClose:()=>K(null),t:l}):null,ae!==null?Ke({title:l("revert.title"),body:l("revert.body",{ref:`${ae.shortHash} ${ae.subject}`})+(a.dirty?`
673
-
674
- ${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:se,confirmBusy:de,onConfirm:()=>void Wa(),onClose:()=>z(null),t:l}):null,W!==null?ma(W,{from:a.head??W.shortHash,dirty:a.dirty,lostFiles:nr,lostTotal:nr.length,lostTruncated:a.truncated,busy:de,error:se,onReset:qa,onClose:()=>O(null),t:l}):null,T?Ke({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:a.branch??"HEAD",behind:a.behind}),extra:xa(lt,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:se,confirmBusy:ee,busyLabel:l("status.pulling"),onConfirm:()=>void Ya(),onClose:()=>j(!1),t:l}):null,G?Ke({title:l("status.pushConfirmTitle"),body:l("status.pushConfirmBody",{branch:a.branch??"HEAD",ahead:a.ahead}),extra:ka(De,l),confirmLabel:l("status.pushConfirm"),danger:!1,error:se,confirmBusy:Y,busyLabel:l("status.pushing"),onConfirm:()=>void Za(),onClose:()=>B(!1),t:l}):null,Se?Ke({title:l("status.publishConfirmTitle"),body:l("status.publishConfirmBody",{branch:a.branch??"HEAD",remote:a.remote?.name??"origin"}),confirmLabel:l("status.publishConfirm"),danger:!1,error:se,confirmBusy:P,busyLabel:l("status.publishing"),onConfirm:()=>void ei(),onClose:()=>_e(!1),t:l}):null,xe!==null?ha(xe,{from:a.branch,dirty:a.dirty?Math.max(1,a.stats.fileCount):0,busy:Ve,error:se,onConfirm:y=>void ja(y),onClose:()=>$e(null),t:l}):null],ar=(0,c.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,c.createElement)("div",{key:"tb",className:"gp-toolbar",ref:b},[s?(0,c.createElement)("button",{key:"filter",type:"button",className:`gp-btn${d.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>Me(!0)},[(0,c.createElement)(_r,{key:"ic",size:13}),d.ref??l("overview.filterBranch")]):null,(0,c.createElement)("input",{key:"search",className:"gp-search",placeholder:l(_||s?"overview.searchShort":"overview.search"),value:u,onChange:y=>g(y.target.value)}),(0,c.createElement)("select",{key:"author",className:"gp-select",value:d.author,onChange:y=>p(V=>({...V,author:y.target.value}))},[(0,c.createElement)("option",{key:"",value:""},l("overview.allUsers")),...qe.map(y=>(0,c.createElement)("option",{key:y,value:y},y))]),(0,c.createElement)("select",{key:"since",className:"gp-select",value:d.since,onChange:y=>p(V=>({...V,since:y.target.value}))},[(0,c.createElement)("option",{key:"",value:""},l("overview.allTime")),(0,c.createElement)("option",{key:"today",value:"1 day ago"},l("overview.today")),(0,c.createElement)("option",{key:"7d",value:"7 days ago"},l("overview.last7d")),(0,c.createElement)("option",{key:"30d",value:"30 days ago"},l("overview.last30d"))]),(0,c.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),onClick:()=>{e.run({sessionId:t,action:{kind:"fetch"}}).then(()=>Ge())}},(0,c.createElement)(jt,{size:14}))]),(0,c.createElement)("div",{key:"list",className:"gp-history__list",ref:Ye,onScroll:te},Ie.length===0?(0,c.createElement)("div",{className:"gp-empty"},l(Lt?"common.loading":je?"overview.loadFailed":"overview.noResults")):Je.map(y=>no(y,{selected:E?.hash===y.commit.hash,gridTpl:ct,graphW:dt,laneCount:bt,searching:Ce,now:h,compact:s,rowH:Ze,onSelect:()=>$(y.commit),onHoverEnter:ne.onHoverEnter,onHoverLeave:ne.onHoverLeave,t:l})))]),ir=E===null?[(0,c.createElement)("div",{key:"empty",className:"gp-empty"},[(0,c.createElement)(qt,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,c.createElement)("div",{key:"files",className:"gp-detail__files"},ne.detail===null?(0,c.createElement)("div",{className:"gp-empty"},ne.detailError?l("overview.detailFailed"):l("common.loading")):[ne.detail.stats.length>0?(0,c.createElement)("div",{key:"sum",className:"gp-detail__summary"},[(0,c.createElement)("span",{key:"f"},l("overview.changeSummary",{files:ne.detail.stats.length})),(0,c.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,c.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ne.detail.insertions}`),(0,c.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ne.detail.deletions}`)]):null,ao(L,{activePath:ne.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:y=>{E!==null&&ne.openFileDiff(y,E.hash,E.shortHash)},collapsed:We,onToggleDir:Ka,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,c.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,c.createElement)("div",{key:"subj",className:"gp-detail__subject"},E.subject),(0,c.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},E.shortHash),(0,c.createElement)("span",{key:"a"},E.author),(0,c.createElement)("span",{key:"t"},Bt(E.dateIso))]),(0,c.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let y=E.refs.filter(V=>V.kind==="tag");return[y.length>0?(0,c.createElement)("div",{key:"tags",className:"gp-detail__tags"},y.map(V=>(0,c.createElement)("span",{key:`tag-${V.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:V.name},[(0,c.createElement)(wt,{key:"i",size:11}),(0,c.createElement)("span",{key:"n",className:"gp-detail__tagname"},V.name),(0,c.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:V.name}),onClick:()=>{q(null),K(V.name)}},(0,c.createElement)(nt,{size:11}))]))):null,(0,c.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,c.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{q(null),z({hash:E.hash,shortHash:E.shortHash,subject:E.subject})}},[(0,c.createElement)(Nr,{key:"i",size:12}),l("overview.revert")]),(0,c.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{q(null),o(),O({hash:E.hash,shortHash:E.shortHash,subject:E.subject})}},[(0,c.createElement)(Qt,{key:"i",size:12}),l("overview.reset")]),(0,c.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{q(null),Q({hash:E.hash,shortHash:E.shortHash})}},[(0,c.createElement)(wt,{key:"i",size:12}),l("overview.createTag")])])]})()),ne.detail!==null&&ne.detail.body!==""?(0,c.createElement)("pre",{key:"body",className:"gp-detail__body"},ne.detail.body):(0,c.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return s?(0,c.createElement)("div",{className:"gp-overview gp-overview--compact"},[tr,...rr,Ee==="detail"?(0,c.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,c.createElement)("div",{key:"back",className:"gp-subhead"},[(0,c.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>ze("list")},[(0,c.createElement)(xt,{key:"i",size:14}),l("overview.backToList")]),E!==null?(0,c.createElement)("span",{key:"h",className:"gp-subhead__title gp-commit-hash"},E.shortHash):null]),...ir]):ar,Bn(a,er),Ae?to(Te,Xe,d.ref,k,{onFilter:y=>{Zn(y),Me(!1)},switchOptions:ke,onSwitch:y=>{Me(!1),ht(y)},onToggle:y=>M(V=>{let ce=new Set(V);return ce.has(y)?ce.delete(y):ce.add(y),ce}),onRetry:Ge,onClose:()=>Me(!1),t:l}):null]):(0,c.createElement)("div",{className:"gp-overview"},[tr,...rr,(0,c.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${Qn.width}px`}},[(0,c.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},Ca(Te,Xe,d.ref,k,{onFilter:y=>Zn(y),switchOptions:ke,onSwitch:ht,onToggle:y=>M(V=>{let ce=new Set(V);return ce.has(y)?ce.delete(y):ce.add(y),ce}),onRetry:Ge,t:l})),Bn(a,er)]),Qn.divider,ar,Yn.divider,(0,c.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${Yn.width}px`}},ir),eo(ne.hover,ne.hoverBody,l)])}function eo(e,t,n){if(e===null||typeof document>"u")return null;let r=460,a=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-r-12),i=e.y+14,o=(0,c.createElement)("div",{className:"gp-hovercard",style:{left:a,top:i,maxWidth:r}},[(0,c.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,c.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,c.createElement)("span",{key:"a"},e.commit.author),(0,c.createElement)("span",{key:"t"},Bt(e.commit.dateIso))]),t===null?(0,c.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,c.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,c.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,hn.createPortal)(o,document.body,"commit-hovercard")}function Ca(e,t,n,r,a){if(t)return(0,c.createElement)("div",{className:"gp-empty"},[(0,c.createElement)("span",{key:"m"},a.t("overview.branchesError")),(0,c.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:a.onRetry},a.t("common.retry"))]);if(e===null)return(0,c.createElement)("div",{className:"gp-empty"},a.t("common.loading"));let i=(o,s,l,d,p="")=>(0,c.createElement)("div",{key:o,className:"gp-branch-group"},[(0,c.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>a.onToggle(o)},[(0,c.createElement)(tt,{key:"c",size:11,open:!r.has(o)}),`${a.t(s)} (${l.length})`]),r.has(o)?null:l.map(u=>{let g=p+u.name,S=e.current===u.name,b=`gp-branch-row${n===g?" gp-branch-row--active":""}${S?" gp-branch-row--current":""}`,_=a.switchOptions.get(`${o}:${u.name}`);return(0,c.createElement)("div",{key:u.name,className:b,title:u.name,onClick:()=>a.onFilter(n===g?null:g)},[(0,c.createElement)("span",{key:"i",style:{display:"inline-flex",width:14}},d),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},u.name),u.ahead||u.behind?(0,c.createElement)("span",{key:"t",className:"gp-branch-row__track"},`${u.ahead?`\u2191${u.ahead}`:""}${u.behind?`\u2193${u.behind}`:""}`):null,_===void 0?null:(0,c.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:a.t(_.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:_.name,ref:_.label}),onClick:k=>{k.stopPropagation(),a.onSwitch(_)}},a.t("switch.action"))])})]);return(0,c.createElement)("div",{},[(0,c.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>a.onFilter(null)},a.t("overview.head")),i("local","overview.local",e.local,(0,c.createElement)(Gn,{size:13})),i("remote","overview.remote",e.remote,(0,c.createElement)(Gn,{size:13})),i("tags","overview.tags",e.tags,(0,c.createElement)(wt,{size:13}))])}function to(e,t,n,r,a){if(typeof document>"u")return null;let i=(0,c.createElement)("div",{className:"gp-sheet-backdrop",onClick:o=>{o.target===o.currentTarget&&a.onClose()}},(0,c.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,c.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,c.createElement)("span",{key:"title",className:"gp-sheet__title"},a.t("overview.filterBranch")),(0,c.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:a.t("common.close"),onClick:a.onClose},(0,c.createElement)(nt,{size:15}))]),(0,c.createElement)("div",{key:"body",className:"gp-sheet__body"},Ca(e,t,n,r,a))]));return(0,hn.createPortal)(i,document.body,"branch-filter-sheet")}function no(e,t){let n=e.commit,r=n.refs.map(i=>(0,c.createElement)("span",{key:i.name,className:`gp-ref-chip${i.head?" gp-ref-chip--head":""}${i.kind==="remote"?" gp-ref-chip--remote":""}${i.kind==="tag"?" gp-ref-chip--tag":""}`},i.name)),a=(0,c.createElement)("div",{key:"g",className:"gp-graph-cell"},t.searching?null:ro(e,t.laneCount,t.rowH));return t.compact?(0,c.createElement)("div",{key:n.hash,className:`gp-commit-row gp-commit-row--compact${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl,height:`${t.rowH}px`},onClick:t.onSelect},[a,(0,c.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,c.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,c.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,c.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,c.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,c.createElement)("span",{key:"d",className:"gp-commit-date"},rt(n.dateIso,t.now,t.t))])])]):(0,c.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:i=>t.onHoverEnter(n,i.clientX,i.clientY),onMouseLeave:t.onHoverLeave},[a,(0,c.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,c.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,c.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,c.createElement)("div",{key:"d",className:"gp-commit-date",title:Ft(n.dateIso)},rt(n.dateIso,t.now,t.t))])}var mn=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function ro(e,t,n=_a){let r=Math.max(Mt,t*Mt),a=s=>s*Mt+Mt/2,i=n/2,o=[];for(let s of e.edges){let l=mn[s.color%mn.length],d=s.kind==="out"?i:0,p=s.kind==="into"?i:n,u=(d+p)/2;o.push((0,c.createElement)("path",{key:`e${s.kind}-${s.fromLane}-${s.toLane}-${s.color}`,d:`M ${a(s.fromLane)} ${d} C ${a(s.fromLane)} ${u}, ${a(s.toLane)} ${u}, ${a(s.toLane)} ${p}`,stroke:l,strokeWidth:1.6,fill:"none"}))}return o.push((0,c.createElement)("circle",{key:"node",cx:a(e.lane),cy:i,r:e.merge?4:3.2,fill:mn[e.color%mn.length],stroke:"var(--dsw-alias-bg-layer-1)",strokeWidth:1})),(0,c.createElement)("svg",{className:"gp-graph-svg",width:r,height:n},o)}function ao(e,t){let n=[],r=(a,i)=>{for(let o of a)if(o.dir){let s=t.collapsed.has(o.path);n.push((0,c.createElement)("div",{key:o.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+i*14},title:s?t.expandLabel:t.collapseLabel,role:"button",tabIndex:0,"aria-expanded":!s,onClick:()=>t.onToggleDir(o.path),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onToggleDir(o.path))}},[(0,c.createElement)(tt,{key:"c",size:11,open:!s}),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)])),s||r(o.children,i+1)}else{let s=String(o.meta??"modified"),l=t.activePath===o.path;n.push((0,c.createElement)("div",{key:o.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+i*14},title:t.openTitle,onClick:()=>t.onOpen(o.path)},[(0,c.createElement)("span",{key:"st",className:`gp-status-badge ${kt(s)}`},(Yt[s]??s[0]??"M").toUpperCase()),(0,c.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)]))}};return r(e,0),(0,c.createElement)("div",{},n)}function io(e,t){if(e===null||typeof document>"u")return null;let{data:n,error:r,mode:a,onMode:i,expanded:o,onExpand:s,onClose:l,remote:d,sessionId:p,compact:u,t:g}=t,S=u?["unified","before","after"]:["unified","split","before","after"],b=u&&a==="split"?"unified":a,_=n!==null&&n.text!==""?(()=>{let R=gn(n.text);return(0,c.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,c.createElement)("span",{key:"a",className:"gp-stats__add"},`+${R.add}`),(0,c.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${R.del}`)])})():null,k=(0,c.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${o?" gp-seg__btn--active":""}`,disabled:b!=="split"&&b!=="unified",title:g(o?"diff.collapse":"diff.expandAll"),onClick:()=>s(!o)},g(o?"diff.collapse":"diff.expandAll")),M=(0,c.createElement)("div",{key:"seg",className:"gp-seg"},it(S,b,i,R=>g(`diff.${R}`))),D=(0,c.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:g("common.close"),onClick:l},(0,c.createElement)(nt,{size:15})),J=[(0,c.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,c.createElement)(Cr,{size:15})),(0,c.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},oo(e.path)),(0,c.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),_,k],F=u?[(0,c.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},J),(0,c.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[M,D])]:[...J,M,D],C=(0,c.createElement)("div",{className:"gp-modal-backdrop",onClick:R=>{R.target===R.currentTarget&&l()}},(0,c.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,c.createElement)("div",{key:"bar",className:"gp-modal__bar"},F),(0,c.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},n===null?(0,c.createElement)("div",{className:"gp-empty"},g(r?"overview.diffFailed":"common.loading")):(0,c.createElement)(un,{key:"diff",text:n.text,mode:b,path:e.path,remote:d,sessionId:p,base:"commit",commit:e.hash,expanded:o,truncated:n.truncated===!0,newLines:n.newLines,t:g}))]));return(0,hn.createPortal)(C,document.body,"file-diff-modal")}function oo(e){let t=e.lastIndexOf("/");return t<0?[(0,c.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,c.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,c.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var f=require("react");var Pe=require("react");function Ta({stats:e,t}){let n=Date.now(),r=[(0,Pe.createElement)("span",{key:"files",className:"gp-stats__item"},t("stats.files",{n:e.fileCount})),(0,Pe.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,Pe.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,Pe.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&r.push((0,Pe.createElement)("span",{key:"st",className:"gp-stats__item"},t("stats.staged",{n:e.staged}))),e.modified>0&&r.push((0,Pe.createElement)("span",{key:"mo",className:"gp-stats__item"},t("stats.modified",{n:e.modified}))),e.untracked>0&&r.push((0,Pe.createElement)("span",{key:"un",className:"gp-stats__item"},t("stats.untracked",{n:e.untracked}))),e.partial&&r.push((0,Pe.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial",title:t("stats.partialHint")},t("stats.partial")));let a=[];return e.lastChangeAt!==null&&a.push((0,Pe.createElement)("span",{key:"lc",className:"gp-stats__item",title:Ft(e.lastChangeAt)},t("stats.lastChange",{time:rt(e.lastChangeAt,n,t)}))),e.headCommittedAt!==null&&a.push((0,Pe.createElement)("span",{key:"hc",className:"gp-stats__item",title:Ft(e.headCommittedAt)},t("stats.lastCommit",{time:rt(e.headCommittedAt,n,t)}))),a.length>0&&r.push((0,Pe.createElement)("span",{key:"times",className:"gp-stats__times"},a)),(0,Pe.createElement)("div",{className:"gp-stats"},r)}var On=28,Na=26,so=8,lo=600;function Ea({remote:e,sessionId:t,snapshot:n,onAction:r,compact:a,t:i}){let[o,s]=(0,f.useState)(new Set),[l,d]=(0,f.useState)(""),[p,u]=(0,f.useState)(!1),[g,S]=(0,f.useState)(!1),[b,_]=(0,f.useState)(null),[k,M]=(0,f.useState)(new Set),[D,J]=(0,f.useState)(null),[F,C]=(0,f.useState)(null),[R,Q]=(0,f.useState)(null),[U,K]=(0,f.useState)(()=>n.defaultDiffView),[ae,z]=(0,f.useState)(!1),[W,O]=(0,f.useState)(!1),[se,q]=(0,f.useState)(!1),[de,le]=(0,f.useState)(!1),[he,be]=(0,f.useState)(null),[ee,w]=(0,f.useState)("list"),[T,j]=(0,f.useState)([]),[Y,m]=(0,f.useState)(!0),[G,B]=(0,f.useState)(!1),[P,ue]=(0,f.useState)(null),Se=(0,f.useRef)(null),_e=(0,f.useRef)(0),{setEl:lt,viewport:Fe}=Tt(),De=(0,f.useCallback)(async()=>{let h=await e.query({sessionId:t,query:{kind:"stash-list"}}),L=ye(h,"stash-list");j(L?.entries??[])},[e,t]);(0,f.useEffect)(()=>{De()},[De,n.checkedAt]);let N=(0,f.useMemo)(()=>n.changes.filter(h=>h.staged).sort($n),[n]),Ee=(0,f.useMemo)(()=>n.changes.filter(h=>!h.staged&&h.status!=="untracked").sort($n),[n]),ze=(0,f.useMemo)(()=>n.changes.filter(h=>h.status==="untracked").sort($n),[n]),$e=[{key:"staged",labelKey:"changes.groupStaged",items:N},{key:"unstaged",labelKey:"changes.groupUnstaged",items:Ee},{key:"untracked",labelKey:"changes.groupUntracked",items:ze}].filter(h=>h.items.length>0),{items:Ve,tops:Be,totalH:Ae}=(0,f.useMemo)(()=>{let h=[];for(let E of $e)if(h.push({kind:"head",g:{key:E.key,labelKey:E.labelKey,count:E.items.length}}),!k.has(E.key))for(let re of E.items)h.push({kind:"row",c:re});let L=St(h.map(E=>E.kind==="head"?Na:On));return{items:h,tops:L,totalH:L[h.length]}},[N,Ee,ze,k]),Me=Fe.height>0?Fe.height:lo,{first:Te,last:Xe}=Ct(Be,Fe.top,Me,so*On);(0,f.useEffect)(()=>{s(h=>{if(h.size===0)return h;let L=new Set(n.changes.map(pe=>pe.path+(pe.staged?":s":":w"))),E=new Set,re=!1;for(let pe of h)L.has(pe)?E.add(pe):re=!0;return re?E:h})},[n]),(0,f.useEffect)(()=>{if(!p||W||l.trim()!=="")return;let h=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(L=>{let E=ye(L,"last-commit-message");h&&E!==null&&(d(E.message),O(!0))}),()=>{h=!1}},[p,W,l,e,t]);let qe=(0,f.useCallback)(async(h,L,E=!1,re=!1)=>{let pe=++_e.current;C({path:h,base:L}),re||Q(null),z(E);let we=await e.query({sessionId:t,query:{kind:"diff",path:h,base:L,...E?{context:2e3}:{}}});if(pe!==_e.current)return;let We=ye(we,"diff");Q(We!==null?{text:We.text,newLines:We.newLines,truncated:We.truncated}:{text:"",newLines:0})},[e,t]);(0,f.useEffect)(()=>{if(F===null)return;if(!n.changes.some(L=>L.path===F.path)){C(null),Q(null),w("list");return}qe(F.path,F.base,ae,!0)},[n]),(0,f.useEffect)(()=>{J(null)},[n]),(0,f.useEffect)(()=>{le(!1)},[n]);let Ge=h=>{s(L=>{let E=new Set(L);return E.has(h)?E.delete(h):E.add(h),E})},ke=async h=>{if(g)return!1;S(!0),_(null),be(null);try{let L=await r(h);return L.ok?!0:(_(L.error??i("error.generic")),!1)}catch(L){return _(L instanceof Error?L.message:i("error.generic")),!1}finally{S(!1)}},ht=async()=>{let h=l.trim();if(h===""&&!p){_(i("error.emptyMessage"));return}let L=o.size>0?[...new Set([...o].map(re=>re.replace(/:[sw]$/,"")))]:void 0;await ke({kind:"commit",message:h,...L?{paths:L}:{},...p?{amend:!0}:{}})&&(d(""),s(new Set),u(!1),O(!1))},ne=async h=>{await ke({kind:"stash-push",...h.trim()!==""?{message:h}:{}})&&(B(!1),De())},Ie=(h,L)=>{ke({kind:"stash-apply",index:h,sha:L}).then(E=>{E&&De()})},Lt=(h,L)=>{ke({kind:"stash-pop",index:h,sha:L}).then(E=>{E&&De()})},je=async(h,L)=>{await ke({kind:"stash-drop",index:h,sha:L})&&(ue(null),De())},Qe=(h,L)=>{switch(h){case"empty-diff":return i("error.emptyDiff");case"llm-unavailable":return i("error.llmUnavailable");case"suggest-disabled":return i("error.suggestDisabled");case"llm-error":case"llm-output":return L===void 0?i("error.llmFailed"):`${i("error.llmFailed")}: ${L}`;default:return L??i("error.generic")}},Ye=async()=>{if(se)return;if(p&&!de&&l.trim()!==""){le(!0),_(null),be(i("commit.suggestOverwrite"));return}le(!1);let h=o.size>0?[...new Set([...o].map(L=>L.replace(/:[sw]$/,"")))]:void 0;q(!0),_(null),be(null);try{let L=await e.suggest({sessionId:t,...h&&h.length>0?{paths:h}:{}});L.ok?(d(L.value.message),L.value.truncated===!0&&be(i("commit.suggestTruncated")),Se.current?.focus()):_(Qe(L.error.code,L.error.message))}catch(L){_(L instanceof Error?L.message:i("error.generic"))}finally{q(!1)}},yt=h=>{M(L=>{let E=new Set(L);return E.has(h)?E.delete(h):E.add(h),E})},Ce=R!==null&&R.text!==""?gn(R.text):null,Je=mt({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),bt=(h,L)=>{qe(h,L),a&&w("diff")},dt=a?["unified","before","after"]:["unified","split","before","after"],Ze=a&&U==="split"?"unified":U,ct=[(0,f.createElement)(Ta,{key:"stats",stats:n.stats,t:i}),(0,f.createElement)("div",{key:"toolbar",className:"gp-toolbar"},[(0,f.createElement)("button",{key:"sa",type:"button",className:"gp-btn",disabled:g||n.changes.length===0,onClick:()=>void ke({kind:"stage-all"})},i("changes.stageAll")),(0,f.createElement)("button",{key:"ua",type:"button",className:"gp-btn",disabled:g||n.staged===0,onClick:()=>void ke({kind:"unstage-all"})},i("changes.unstageAll")),(0,f.createElement)("button",{key:"stash",type:"button",className:"gp-btn",disabled:g||n.staged===0&&n.modified===0,title:i("changes.stash"),onClick:()=>{_(null),B(!0)}},[(0,f.createElement)(Rn,{key:"ic",size:13}),i("changes.stash")])]),b!==null?(0,f.createElement)("div",{key:"err",className:"gp-feedback"},b):null,he!==null?(0,f.createElement)("div",{key:"notice",className:"gp-notice"},he):null,(0,f.createElement)("div",{key:"list",className:"gp-changes__list",ref:lt},n.changes.length===0?(0,f.createElement)("div",{className:"gp-empty"},i("changes.noChanges")):(0,f.createElement)("div",{className:"gp-changes__vlist",style:{height:Ae}},Ve.slice(Te,Xe).map((h,L)=>{let E=Te+L;if(h.kind==="head"){let we=h.g;return(0,f.createElement)("div",{key:`h:${we.key}`,className:"gp-changes__vrow",style:{top:Be[E],height:Na}},(0,f.createElement)("div",{className:"gp-group-head",onClick:()=>yt(we.key)},[(0,f.createElement)(tt,{key:"chev",size:12,open:!k.has(we.key)}),`${i(we.labelKey)} (${we.count})`]))}let re=h.c,pe=re.path+(re.staged?":s":":w");return(0,f.createElement)("div",{key:pe,className:"gp-changes__vrow",style:{top:Be[E],height:On}},uo(re,{selected:o.has(pe),active:F?.path===re.path&&F.base===(re.staged?"staged":"worktree"),busy:g,armed:D===pe,onToggle:()=>Ge(pe),onOpen:()=>bt(re.path,re.staged?"staged":"worktree"),onStage:()=>void ke(re.staged?{kind:"unstage",paths:[re.path]}:{kind:"stage",paths:[re.path]}),onDiscard:()=>{D===pe?(ke({kind:"discard",paths:[re.path]}),J(null)):J(pe)},t:i}))}))),T.length>0?(0,f.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,f.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>m(h=>!h)},[(0,f.createElement)(tt,{key:"chev",size:12,open:!Y}),`${i("stash.section")} (${T.length})`]),Y?null:(0,f.createElement)("div",{key:"items"},T.map(h=>po(h,{busy:g,onApply:()=>Ie(h.index,h.sha),onPop:()=>Lt(h.index,h.sha),onDrop:()=>{_(null),ue(h)},t:i})))]):null,(0,f.createElement)("div",{key:"box",className:"gp-commitbox"},[(0,f.createElement)("div",{key:"msg",className:`gp-commitbox__msg-wrap${se?" gp-commitbox__msg-wrap--busy":""}`},[(0,f.createElement)("textarea",{key:"ta",className:"gp-commitbox__msg",placeholder:i("commit.placeholder"),value:l,ref:Se,readOnly:se,"aria-busy":se,onChange:h=>d(h.target.value)}),se?(0,f.createElement)("span",{key:"spin",className:"gp-commitbox__spin","aria-hidden":"true"}):null]),(0,f.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,f.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,f.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:p,disabled:se,onChange:()=>{u(h=>!h),O(!1)}}),i("commit.amend")]),(0,f.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[n.suggestEnabled!==!1?(0,f.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:g||se||n.changes.length===0,onClick:()=>void Ye(),title:i("commit.suggest")},[(0,f.createElement)(Sr,{key:"ic",size:13}),i(se?"commit.suggesting":"commit.suggest")]):null,(0,f.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:g||se||l.trim()==="",onClick:()=>void ht()},i("commit.commit"))])])])],te=F===null?(0,f.createElement)("div",{className:"gp-empty"},i("changes.selectFile")):(0,f.createElement)("div",{className:"gp-diff"},[(0,f.createElement)("div",{key:"tb",className:`gp-diff__toolbar${a?" gp-diff__toolbar--compact":""}`},(()=>{let h=a?(0,f.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>w("list")},[(0,f.createElement)(xt,{key:"i",size:14}),i("changes.backToList")]):null,L=(0,f.createElement)("span",{key:"path",className:"gp-diff__path"},F.path),E=Ce?(0,f.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,f.createElement)("span",{key:"a",className:"gp-stats__add"},`+${Ce.add}`)," ",(0,f.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${Ce.del}`)]):null,re=(0,f.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${ae?" gp-seg__btn--active":""}`,style:Ce||a?{}:{marginLeft:"auto"},disabled:Ze!=="split"&&Ze!=="unified",title:i(ae?"diff.collapse":"diff.expandAll"),onClick:()=>void qe(F.path,F.base,!ae)},i(ae?"diff.collapse":"diff.expandAll")),pe=(0,f.createElement)("div",{key:"seg",className:"gp-seg"},it(dt,Ze,K,we=>i(`diff.${we}`)));return a?[(0,f.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[h,L,E]),(0,f.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[re,pe])]:[h,L,E,re,pe]})()),R===null?(0,f.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,f.createElement)("div",{className:"gp-empty"},i("common.loading"))):(0,f.createElement)(un,{key:"diff",text:R.text,mode:Ze,path:F.path,remote:e,sessionId:t,base:F.base,expanded:ae,truncated:R.truncated===!0,newLines:R.newLines,t:i})]),$=[G?(0,f.createElement)(co,{key:"push",onClose:()=>B(!1),onStash:ne,error:b,t:i}):null,P!==null?Ke({title:i("stash.dropTitle"),body:i("stash.dropConfirm",{name:P.message}),confirmLabel:i("stash.drop"),danger:!0,error:b,onConfirm:()=>void je(P.index,P.sha),onClose:()=>ue(null),t:i}):null];return a?(0,f.createElement)("div",{className:"gp-changes gp-changes--compact"},[...$,ee==="diff"?(0,f.createElement)("div",{key:"right",className:"gp-changes__right"},te):(0,f.createElement)("div",{key:"left",className:"gp-changes__left"},ct)]):(0,f.createElement)("div",{className:"gp-changes"},[...$,(0,f.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${Je.width}px`}},ct),Je.divider,(0,f.createElement)("div",{key:"right",className:"gp-changes__right"},te)])}function co({onClose:e,onStash:t,error:n,t:r}){let[a,i]=(0,f.useState)("");return ot({onClose:e,title:r("stash.title"),icon:(0,f.createElement)(Rn,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,f.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:a,autoFocus:!0,onChange:o=>i(o.target.value),onKeyDown:o=>{o.key==="Enter"&&t(a)}}),Nt(r),n!==null?(0,f.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:Et({onClose:e,onConfirm:()=>void t(a),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function po(e,t){return(0,f.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,f.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,f.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,f.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,f.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,f.createElement)("span",{key:"t"},e.relTime):null])]),(0,f.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,f.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,f.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,f.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,f.createElement)(Tr,{size:14}))])])}function $n(e,t){return e.path.localeCompare(t.path)}function uo(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,f.createElement)("div",{key:e.path+(e.staged?":s":":w"),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,f.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,onClick:a=>a.stopPropagation(),onChange:t.onToggle}),(0,f.createElement)("span",{key:"st",className:`gp-status-badge ${kt(e.status)}`},Yt[e.status]??"?"),(0,f.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,f.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,f.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,f.createElement)("button",{key:"stg",type:"button",className:"gp-icon-btn",title:e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,onClick:a=>{a.stopPropagation(),t.onStage()}},e.staged?"\u2212":"+"),(0,f.createElement)("button",{key:"dis",type:"button",className:"gp-icon-btn",title:t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,onClick:a=>{a.stopPropagation(),t.onDiscard()}},"\u21BA")])])}var v=require("react");var He=require("@deepseek-ai/dsh-client-ui-primitives");var oe=require("react");function Xn(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],n=e/1024,r=0;for(;(n>=1024||Number(n.toFixed(1))>=1024)&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}var go={bash:"Bash",c:"C",cpp:"C++",csharp:"C#",css:"CSS",dockerfile:"Dockerfile",go:"Go",html:"HTML",java:"Java",javascript:"JavaScript",json:"JSON",jsx:"JSX",kotlin:"Kotlin",markdown:"Markdown",php:"PHP",python:"Python",ruby:"Ruby",rust:"Rust",scss:"SCSS",shellscript:"Shell",sql:"SQL",swift:"Swift",toml:"TOML",tsx:"TSX",typescript:"TypeScript",vue:"Vue",xml:"XML",yaml:"YAML"};function Ma(e){return go[e]??fo(e)}function fo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Gt=require("@deepseek-ai/dsh-client-ui-primitives");function mo(e,t){let n=ho(e.path);if(e.kind==="binary")return t("files.propsTypeBinary");let r=It(e.path);if((e.kind==="image"||e.kind==="tooLarge")&&r!==null){let s=r.slice(6).toUpperCase();return t("files.propsTypeFmt",{label:t("files.propsTypeImage",{fmt:s}),ext:n})}let a=(0,Gt.languageForPath)(e.path),o=a!==void 0&&a!==""?Ma(a):e.kind==="tooLarge"?t("files.propsTypeUnread"):t("files.propsTypeText");return n===""?o:t("files.propsTypeFmt",{label:o,ext:n})}function ho(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1):""}function st(e,t,n){return{label:e,value:typeof t=="string"?(0,oe.createElement)("span",{},t):t,key:n}}function Jn(e,t,n){return(0,oe.createElement)("div",{key:n,className:"gp-props__group"},[e!==null?(0,oe.createElement)("div",{key:"t",className:"gp-props__group-title"},e):null,...t.map(r=>(0,oe.createElement)("div",{key:r.key,className:"gp-props__row"},[(0,oe.createElement)("span",{key:"l",className:"gp-props__label"},r.label),(0,oe.createElement)("span",{key:"v",className:"gp-props__value"},r.value)]))])}function Ga(e,t,n){return(0,oe.createElement)("button",{type:"button",className:"gp-props__copy",title:t,"aria-label":t,onClick:n},(0,oe.createElement)("code",{className:"gp-props__mono"},e))}function yo(e,t,n){let r=[],a=e.filter(i=>i.path===t&&!i.isDirectory);a.some(i=>i.staged)&&r.push((0,oe.createElement)("span",{key:"staged",className:"gp-props__badge gp-status--added"},n("files.propsStaged")));for(let i of a)i.staged||i.status==="untracked"||r.push((0,oe.createElement)("span",{key:i.status,className:`gp-props__badge ${kt(i.status)}`},bo(i.status,n)));return r}function bo(e,t){switch(e){case"added":return t("files.stAdded");case"modified":return t("files.stModified");case"deleted":return t("files.stDeleted");case"renamed":return t("files.stRenamed");case"untracked":return t("files.propsUntracked");case"conflicted":return t("files.stConflicted");case"typechange":return t("files.stTypechange")}}function Ra({input:e,snapshot:t,onClose:n,t:r}){let[a,i]=(0,oe.useState)(null);(0,oe.useEffect)(()=>{if(e.kind!=="image"||e.dataUrl===void 0)return;let D=!0,J=new Image;return J.onload=()=>{D&&i({w:J.naturalWidth,h:J.naturalHeight})},J.src=e.dataUrl,()=>{D=!1}},[e.kind,e.dataUrl]);let[o,s]=(0,oe.useState)(null),l=(0,oe.useRef)(void 0);(0,oe.useEffect)(()=>{s(null)},[e.path]),(0,oe.useEffect)(()=>()=>{l.current!==void 0&&clearTimeout(l.current)},[]);let d=D=>{(0,Gt.writeClipboard)(D).then(J=>{s(J?"copied":"error"),l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>s(null),1600)})},p=e.path.lastIndexOf("/"),u=p<0?e.path:e.path.slice(p+1),g=[st(r("files.propsName"),(0,oe.createElement)("span",{className:"gp-props__strong"},u),"name"),st(r("files.propsType"),mo(e,r),"type"),st(r("files.propsRelPath"),Ga(e.path,r("files.propsCopyHint"),()=>d(e.path)),"rel")];if(t!==null){let D=`${t.root}/${e.path}`;g.push(st(r("files.propsAbsPath"),Ga(D,r("files.propsCopyHint"),()=>d(D)),"abs"))}let S=[];if(e.size!==void 0){let D=e.size>=1024?(0,oe.createElement)("span",{},[(0,oe.createElement)("span",{key:"h",className:"gp-props__strong"},Xn(e.size)),(0,oe.createElement)("span",{key:"b",className:"gp-props__sub"},r("files.propsSizeBytes",{bytes:e.size.toLocaleString("en-US")}))]):(0,oe.createElement)("span",{className:"gp-props__strong"},Xn(e.size));S.push(st(r("files.propsSize"),D,"size"))}e.kind==="text"&&e.lines!==void 0&&S.push(st(r("files.propsLines"),(0,oe.createElement)("span",{className:"gp-props__strong"},String(e.lines)),"lines")),a!==null&&S.push(st(r("files.propsImageSize"),(0,oe.createElement)("span",{className:"gp-props__strong"},r("files.propsImageSizeFmt",a)),"dims"));let b=[];e.mtimeMs!==void 0&&b.push(st(r("files.propsMtime"),(0,oe.createElement)("span",{title:rt(e.mtimeMs,Date.now(),r)},Bt(e.mtimeMs)),"mtime"));let _=[Jn(null,g,"g-basic"),S.length>0?Jn(r("files.propsGroupStats"),S,"g-stats"):null,b.length>0?Jn(r("files.propsGroupTime"),b,"g-time"):null],k=[];t!==null&&(k.push(e.ignored?(0,oe.createElement)("span",{key:"ig",className:"gp-props__badge gp-props__badge--muted"},r("files.ignored")):Br(t.changes,e.path)?(0,oe.createElement)("span",{key:"un",className:"gp-props__badge gp-props__badge--muted"},r("files.propsUntracked")):(0,oe.createElement)("span",{key:"tr",className:"gp-props__badge gp-props__badge--ok"},r("files.propsTrackedYes"))),k.push(...yo(t.changes,e.path,r)));let M=(0,oe.createElement)("div",{key:"status",className:"gp-modal__footer gp-props__statusbar","aria-live":"polite"},[k.length>0?(0,oe.createElement)("span",{key:"chips",className:"gp-props__footer-chips"},k):null,o!==null?(0,oe.createElement)("span",{key:"fb",className:`gp-props__copied${o==="error"?" gp-props__copied--err":""}`},r(o==="copied"?"files.pathCopied":"files.pathCopyFailed")):null]);return ot({onClose:n,title:r("files.propsTitle"),icon:(0,oe.createElement)(Gt.FileTypeIcon,{path:e.path,size:15}),body:_,footer:M,portalKey:"file-props",t:r})}function Da(e){return/\.(?:md|markdown)$/i.test(e)}function Kn(e){return/\.(?:html?|xhtml)$/i.test(e)}function vo(e){return Da(e)||Kn(e)}var wo=256*1024,xo=5e3,La=5e3,yn=20,Pa=12,ko=600,_o=6e4,bn=new Map;function So(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;bn.set(e,{state:{...t,file:n},leftAt:Date.now()})}function Co(e){let t=bn.get(e);return t===void 0?null:Date.now()-t.leftAt>_o?(bn.delete(e),null):t.state}function Un({remote:e,sessionId:t,compact:n,worktreeGen:r,snapshot:a,t:i}){let o=(0,v.useRef)(void 0);o.current===void 0&&(o.current=Co(t));let s=o.current,[l,d]=(0,v.useState)(()=>s?.dirs??new Map),[p,u]=(0,v.useState)(()=>s?.open??new Set([""])),[g,S]=(0,v.useState)(()=>s?.selected??null),[b,_]=(0,v.useState)(()=>s?.file??{kind:"idle"}),[k,M]=(0,v.useState)(()=>s?.renderMarkdown??!0),[D,J]=(0,v.useState)("idle"),[F,C]=(0,v.useState)("idle"),[R,Q]=(0,v.useState)(!1),[U,K]=(0,v.useState)(()=>s?.pane??"tree"),ae=(0,v.useMemo)(()=>({code:{copyLabel:i("files.copy"),copiedLabel:i("files.copied")},footnotes:i("files.footnotes")}),[i]),z=(0,v.useRef)(0),W=mt({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),O=(0,v.useCallback)(m=>{d(G=>{let B=G.get(m);if(B!==void 0&&B.status!=="error")return G;let P=new Map(G);return P.set(m,{status:"loading"}),P}),e.query({sessionId:t,query:{kind:"dir-list",path:m}}).then(G=>{let B=ye(G,"dir-list");d(P=>{let ue=new Map(P);return ue.set(m,B===null?{status:"error"}:{status:"ready",entries:B.entries,truncated:B.truncated}),ue})}).catch(()=>{d(G=>{let B=new Map(G);return B.set(m,{status:"error"}),B})})},[e,t]);(0,v.useEffect)(()=>{O("")},[O]);let se=(0,v.useRef)(r);(0,v.useEffect)(()=>{se.current!==r&&(se.current=r,bn.delete(t),d(new Map),u(new Set([""])),S(null),_({kind:"idle"}),K("tree"),O(""))},[r,t,O]);let q=(0,v.useCallback)(m=>{u(G=>{let B=new Set(G);return B.has(m)?(B.delete(m),B):(B.add(m),l.get(m)===void 0&&O(m),B)})},[l,O]),de=(0,v.useCallback)(m=>{S(m),n&&K("preview"),M(!Kn(m)),J("idle"),C("idle"),Q(!1);let G=++z.current;_({kind:"loading",path:m}),e.query({sessionId:t,query:{kind:"file-content",path:m}}).then(B=>{if(G!==z.current)return;let P=ye(B,"file-content");if(P===null){_({kind:"error",path:m});return}let ue={...P.size!==void 0?{size:P.size}:{},...P.mtimeMs!==void 0?{mtimeMs:P.mtimeMs}:{}};if(P.tooLarge===!0){_({kind:"tooLarge",path:m,...ue});return}if(P.variant==="image"&&P.dataUrl!==void 0){_({kind:"image",path:m,dataUrl:P.dataUrl,...ue});return}if(P.variant==="text"){_({kind:"text",path:m,content:P.content??"",lines:P.lines??0,...ue});return}_({kind:"binary",path:m,...ue})}).catch(()=>{G===z.current&&_({kind:"error",path:m})})},[e,t,n]),le=(0,v.useRef)({dirs:l,open:p,selected:g,file:b,renderMarkdown:k,pane:U});le.current={dirs:l,open:p,selected:g,file:b,renderMarkdown:k,pane:U},(0,v.useEffect)(()=>()=>{So(t,le.current)},[t]);let he=(0,v.useRef)(!1);(0,v.useEffect)(()=>{he.current||(he.current=!0,s!==null&&s.selected!==null&&b.kind==="idle"&&de(s.selected))},[s,b.kind,de]);let be=(0,v.useMemo)(()=>za("",0,{dirs:l,open:p,selected:g,toggleDir:q,selectFile:de,t:i}),[l,p,g,q,de,i]),ee=async()=>{if(g===null)return;let m=z.current,G=await(0,He.writeClipboard)(g);m===z.current&&J(G?"copied":"error")},w=async()=>{if(b.kind!=="text")return;let m=z.current,G=await(0,He.writeClipboard)(b.content);m===z.current&&C(G?"copied":"error")},T=(()=>{if(g===null||b.kind!=="text"&&b.kind!=="image"&&b.kind!=="binary"&&b.kind!=="tooLarge")return null;let m=g.lastIndexOf("/"),G=m<0?"":g.slice(0,m),B=m<0?g:g.slice(m+1),P=l.get(G),ue=P?.status==="ready"?P.entries.find(Se=>!Se.dir&&Se.name===B):void 0;return{path:g,kind:b.kind,...b.size!==void 0?{size:b.size}:{},...b.mtimeMs!==void 0?{mtimeMs:b.mtimeMs}:{},...b.kind==="text"?{lines:b.lines}:{},...b.kind==="image"?{dataUrl:b.dataUrl}:{},ignored:ue?.ignored===!0}})(),j=(0,v.createElement)("div",{key:"left",className:"gp-files__tree",style:n?void 0:{flex:`0 0 ${W.width}px`}},be),Y=(0,v.createElement)("div",{key:"right",className:"gp-files__preview"},[g!==null?(0,v.createElement)("div",{key:"bar",className:"gp-files__bar"},[n?(0,v.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>K("tree")},[(0,v.createElement)(xt,{key:"i",size:14}),i("files.backToTree")]):null,(0,v.createElement)("code",{key:"path",className:"gp-files__path",title:g},g),b.kind==="text"&&vo(b.path)?(0,v.createElement)("div",{key:"mode",className:"gp-files__mode",role:"group","aria-label":i("files.previewMode")},[(0,v.createElement)("button",{key:"source",type:"button",className:`gp-files__mode-btn${k?"":" gp-files__mode-btn--active"}`,"aria-pressed":!k,onClick:()=>M(!1)},i("files.source")),(0,v.createElement)("button",{key:"render",type:"button",className:`gp-files__mode-btn${k?" gp-files__mode-btn--active":""}`,"aria-pressed":k,onClick:()=>M(!0)},i("files.render"))]):null,(0,v.createElement)("button",{key:"copy",type:"button",className:`gp-files__copy-path${D==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{ee()}},i(D==="copied"?"files.pathCopied":D==="error"?"files.pathCopyFailed":"files.copyPath")),b.kind==="text"?(0,v.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${F==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{w()}},i(F==="copied"?"files.contentCopied":F==="error"?"files.contentCopyFailed":"files.copyContent")):null,(0,v.createElement)("button",{key:"props",type:"button",className:"gp-files__props",title:i("files.propsTitle"),"aria-label":i("files.propsTitle"),disabled:T===null,onClick:()=>Q(!0)},(0,v.createElement)(Lr,{size:14}))]):null,(0,v.createElement)("div",{key:"content",className:"gp-files__preview-content"},To(b,k,ae,i)),T!==null&&R?(0,v.createElement)(Ra,{key:"props-modal",input:T,snapshot:a,onClose:()=>Q(!1),t:i}):null]);return n?(0,v.createElement)("div",{className:"gp-files gp-files--compact"},U==="preview"?Y:j):(0,v.createElement)("div",{className:"gp-files"},[j,W.divider,Y])}function To(e,t,n,r){return e.kind==="text"&&t&&Da(e.path)?(0,v.createElement)("div",{className:"gp-files__markdown"},(0,v.createElement)(He.MarkdownText,{text:e.content,labels:n,variant:"body"})):e.kind==="text"&&t&&Kn(e.path)?(0,v.createElement)("iframe",{className:"gp-files__html",title:e.path,srcDoc:e.content,sandbox:"allow-scripts",referrerPolicy:"no-referrer"}):No(e,r)}function za(e,t,n){let r=n.dirs.get(e);if(r===void 0||r.status==="loading")return t===0?[(0,v.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,v.createElement)("div",{key:`l${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("common.loading"))];if(r.status==="error")return[(0,v.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("files.loadFailed"))];let a=[];for(let i of r.entries){let o=e===""?i.name:`${e}/${i.name}`;if(i.dir){let s=n.open.has(o);a.push((0,v.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-expanded":s,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.toggleDir(o)},[(0,v.createElement)("span",{key:"c",className:"gp-tree-chev"},(0,v.createElement)(tt,{size:11,open:s})),(0,v.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,v.createElement)(He.FileTypeIcon,{kind:"folder",size:18})),(0,v.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)])),s&&a.push(...za(o,t+1,n))}else{let s=n.selected===o;a.push((0,v.createElement)("button",{key:o,type:"button",className:`gp-tree-row gp-files__entry${s?" gp-tree-row--active":""}${i.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:10+t*14},"aria-current":s?"true":void 0,"aria-label":i.ignored?`${i.name} (${n.t("files.ignored")})`:i.name,onClick:()=>n.selectFile(o)},[(0,v.createElement)("span",{key:"c",className:"gp-tree-chev"}),(0,v.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,v.createElement)(He.FileTypeIcon,{path:o,size:18})),(0,v.createElement)("span",{key:"n",className:"gp-tree-name"},i.name)]))}}return r.truncated&&a.push((0,v.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:10+t*14}},n.t("files.truncated"))),a}function No(e,t){switch(e.kind){case"idle":return(0,v.createElement)("div",{className:"gp-empty"},t("files.selectFile"));case"loading":return(0,v.createElement)("div",{className:"gp-empty"},t("common.loading"));case"error":return(0,v.createElement)("div",{className:"gp-empty"},t("files.loadFailed"));case"tooLarge":return(0,v.createElement)("div",{className:"gp-empty"},t("files.tooLarge"));case"binary":return(0,v.createElement)("div",{className:"gp-empty"},t("files.binary"));case"image":return(0,v.createElement)(Ot,{src:e.dataUrl,alt:e.path,t,viewportClass:"gp-files__image"});case"text":return(0,v.createElement)(Mo,{content:e.content,path:e.path,t})}}function Eo(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[a,i]of an(e[r],t))if(n.push({line:r,start:a,end:i}),n.length>=tn)return n;return n}function Mo({content:e,path:t,t:n}){let r=(0,v.useMemo)(()=>{let m=e.split(`
675
- `);return m.length>0&&m[m.length-1]===""&&m.pop(),m},[e]),a=e.length>wo||r.length>xo,i=a?void 0:(0,He.languageForPath)(t),o=(0,He.useCodeHighlighter)(i),s=(0,v.useMemo)(()=>a?void 0:o(r.join(`
676
- `)),[a,o,r]),[l,d]=(0,v.useState)(!1),[p,u]=(0,v.useState)(""),[g,S]=(0,v.useState)(!1),[b,_]=(0,v.useState)(0),{setEl:k,viewport:M,elRef:D}=Tt(),J=(0,v.useRef)(null),F=(0,v.useRef)(null);(0,v.useEffect)(()=>{d(!1),u(""),_(0)},[t]);let C=rn(p,nn),R=(0,v.useMemo)(()=>r.map(m=>m.toLowerCase()),[r]),Q=g?C:C.toLowerCase(),U=g?r:R,K=(0,v.useMemo)(()=>Eo(U,Q),[U,Q]);(0,v.useEffect)(()=>{_(0)},[Q]);let ae=K.length===0?0:Math.min(b,K.length-1),z=(0,v.useMemo)(()=>{let m=new Map;for(let G of K){let B=m.get(G.line)??[];B.push([G.start,G.end]),m.set(G.line,B)}return m},[K]);(0,v.useEffect)(()=>{let m=G=>{if(!((G.ctrlKey||G.metaKey)&&(G.key==="f"||G.key==="F")))return;let B=D.current;B===null||B.offsetParent===null||(G.preventDefault(),d(!0),requestAnimationFrame(()=>J.current?.select()))};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[]);let W=r.length,O=(0,v.useMemo)(()=>St(new Array(W).fill(yn)),[W]),se=M.height>0?M.height:ko,{first:q,last:de}=Ct(O,M.top,se,Pa*yn),le=K.length>0?K[ae].line:-1,{first:he,last:be}=en({first:q,last:de},le,W,Pa);(0,v.useEffect)(()=>{if(le<0)return;let m=requestAnimationFrame(()=>F.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(m)},[ae,K,le]);let ee=(0,v.useCallback)(m=>{_(G=>K.length===0?0:(G+m+K.length)%K.length)},[K.length]),w=K.length>0?K[ae]:null,T=l?(0,v.createElement)(sn,{inputRef:J,query:p,matches:K.length,active:ae,caseSensitive:g,onChange:u,onToggleCase:()=>S(m=>!m),onStep:ee,onClose:()=>d(!1),t:n}):null,j=a||l?(0,v.createElement)("div",{key:"hd",className:"gp-files__header"},[a?(0,v.createElement)("div",{key:"note",className:"gp-files__note"},n("files.highlightOff")):null,T]):null,Y=[];for(let m=he;m<be;m++)Y.push((0,v.createElement)("div",{key:m,className:"gp-files__row",style:{top:m*yn}},[(0,v.createElement)("div",{key:"n",className:"gp-diff-no"},m+1),Go(r[m],m,s?.[m],z.get(m),w,F,n)]));return(0,v.createElement)("div",{className:"gp-files__code gp-diff__scroll",ref:k},[j,(0,v.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",style:{height:W*yn}},Y)])}function Go(e,t,n,r,a,i,o){if(e==="")return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>La)return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,La),(0,v.createElement)("span",{key:"trunc",className:"gp-files__trunc"},o("files.lineTruncated"))]);if(r===void 0||r.length===0)return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,v.createElement)("span",{key:d,style:l.style},l.text)):e);let s=a!==null&&a.line===t?[a.start,a.end]:null;return(0,v.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},on(e,r,n,`c${t}`,s,i))}var vn=require("react"),Ro=620;function Aa(e){let[t,n]=(0,vn.useState)(!1);return(0,vn.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(e.clientWidth>0&&e.clientWidth<=Ro);r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}var Ha="gp.panel.fontDelta";function Lo(){if(typeof localStorage>"u")return 0;let e=Number(localStorage.getItem(Ha));return e===-1||e===1?e:0}function Fa({ctx:e,sessionId:t,t:n}){let[r,a]=(0,I.useState)(Lo),[i,o]=(0,I.useState)(null),[s,l]=(0,I.useState)(null),d=Aa(s),p=Wt(t),u=Pt(e),g=p.state==="error"&&p.error.code==="git-unavailable",S=p.state==="error"&&(p.error.code==="not-a-git-repo"||p.error.code==="git-unavailable"),b=g&&p.state==="error"&&p.error.isGitRepo===!0,_=S?"files":i!==null&&i.sessionId===t?i.tab:null,k=(0,I.useRef)({tabs:new Set});k.current.sessionId!==t&&(k.current={sessionId:t,tabs:new Set}),_!==null&&k.current.tabs.add(_);let M=k.current.tabs.has("files");(0,I.useEffect)(()=>{if(!et(t))return;if(S){o(null);return}if(i?.sessionId===t)return;let z=mr(t);if(z!==null){o({sessionId:t,tab:z});return}let W=br(t);if(W!==null){o({sessionId:t,tab:W});return}p.state==="ready"&&o({sessionId:t,tab:p.snapshot.dirty?"changes":"overview"})},[t,p,S,i?.sessionId]),(0,I.useEffect)(()=>{if(et(t))return hr(t,z=>o({sessionId:t,tab:z}))},[t]);let D=(0,I.useRef)({tab:null});D.current={sessionId:t,tab:_},(0,I.useEffect)(()=>()=>{let{sessionId:z,tab:W}=D.current;z!==void 0&&W!==null&&yr(z,W)},[]);let J=p.state==="ready"?p.snapshot.checkedAt:0,[F,C]=(0,I.useState)(0),R=async z=>{if(!et(t))return{ok:!1,error:n("error.noCwd")};let W=await u.run({sessionId:t,action:z});return W.ok?(Dt(t).accept(W.snapshot),z.kind==="branch-checkout"&&C(O=>O+1),{ok:!0}):(z.kind==="branch-checkout"&&z.stashMessage!==void 0&&C(O=>O+1),Dt(t).resync(),{ok:!1,error:$t(W.error.code,W.error.message,n)})},Q=z=>{a(z),typeof localStorage<"u"&&localStorage.setItem(Ha,String(z))},U=[{key:"overview",label:n("tab.overview"),icon:(0,I.createElement)(qt,{size:14})},{key:"changes",label:n("tab.changes"),icon:(0,I.createElement)(kr,{size:14})},{key:"files",label:n("tab.files"),icon:(0,I.createElement)(Er,{size:14})}],K=S?U.filter(z=>z.key==="files"):U,ae=(()=>{if(!et(t))return(0,I.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(p.state==="no-cwd")return(0,I.createElement)("div",{className:"gp-empty"},n("error.noCwd"));if(S){let W=M?(0,I.createElement)(Un,{key:t,remote:u,sessionId:t,compact:d,worktreeGen:F,snapshot:null,t:n}):null;return b?(0,I.createElement)("div",{className:"gp-files-wrap"},[(0,I.createElement)("div",{key:"notice",className:"gp-notice"},n("files.gitNotInstalled")),W]):(0,I.createElement)("div",{style:{display:"contents"}},W)}if(p.state==="error")return(0,I.createElement)("div",{className:"gp-empty"},n("pill.unavailable"));if(p.state==="cold"||p.state==="loading"||_===null)return(0,I.createElement)("div",{className:"gp-empty"},n("common.loading"));let z=p.snapshot;return(0,I.createElement)("div",{style:{display:"contents"}},[k.current.tabs.has("overview")?(0,I.createElement)("div",{key:"overview",style:_==="overview"?{display:"contents"}:{display:"none"}},(0,I.createElement)(Sa,{key:t,remote:u,sessionId:t,refreshKey:J,defaultDiffView:z.defaultDiffView,snapshot:z,onAction:R,onResync:()=>Dt(t).resync(),compact:d,t:n})):null,k.current.tabs.has("changes")?(0,I.createElement)("div",{key:"changes",style:_==="changes"?{display:"contents"}:{display:"none"}},(0,I.createElement)(Ea,{key:t,remote:u,sessionId:t,snapshot:z,onAction:R,compact:d,t:n})):null,M?(0,I.createElement)("div",{key:"files",style:_==="files"?{display:"contents"}:{display:"none"}},(0,I.createElement)(Un,{key:t,remote:u,sessionId:t,compact:d,worktreeGen:F,snapshot:z,t:n})):null])})();return(0,I.createElement)("div",{className:"gp-panel",ref:l,"data-conversation-composer-overlay":"","data-font-delta":r,"data-layout":d?"compact":"wide"},[(0,I.createElement)("div",{key:"tabs",className:"gp-tabbar",role:"tablist"},[...K.map(z=>(0,I.createElement)("button",{key:z.key,type:"button",role:"tab","aria-selected":_===z.key,className:`gp-tab${_===z.key?" gp-tab--active":""}`,onClick:()=>{et(t)&&o({sessionId:t,tab:z.key})}},[(0,I.createElement)("span",{key:"i",className:"gp-tab__icon"},z.icon),(0,I.createElement)("span",{key:"l",className:"gp-tab__label"},z.label)])),(0,I.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[(0,I.createElement)("div",{key:"font",className:"gp-font"},[(0,I.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease",onClick:()=>Q(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,I.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset",onClick:()=>Q(0),"aria-label":n("panel.fontReset")},"A"),(0,I.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase",onClick:()=>Q(1),"aria-label":n("panel.fontIncrease")},"A+")]),(0,I.createElement)(Po,{key:"ver",remote:u,t:n})])]),(0,I.createElement)("div",{key:"body",className:"gp-body"},ae)])}function Po({remote:e,t}){let[n,r]=(0,I.useState)({kind:"idle"}),{tipProps:a,tipNode:i}=fn({placement:"below",maxWidth:300});(0,I.useEffect)(()=>{let d=!0;return e.version({}).then(p=>{d&&"current"in p&&r(u=>({...u,info:p}))}),()=>{d=!1}},[e]);let o=async()=>{r(p=>({kind:"checking",info:p.info}));let d=await e.version({check:!0});r({kind:"idle",info:"current"in d?d:void 0})},s=n.info,l=n.kind==="checking"?(0,I.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):s===void 0||!s.checkedRemote?null:s.error!==void 0?(0,I.createElement)("span",{className:"gp-verbar__status gp-verbar__status--err",title:s.error},s.error==="repository is not configured"?t("version.noRepo"):t("version.error")):s.updateAvailable&&s.latest!==void 0?(0,I.createElement)("span",{},[(0,I.createElement)("span",{key:"s",className:"gp-verbar__status gp-verbar__status--new"},t("version.updateAvailable",{latest:s.latest,current:s.current})),s.releaseUrl!==void 0?(0,I.createElement)("a",{key:"l",className:"gp-verbar__link",href:s.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,I.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:s.current}));return(0,I.createElement)("div",{className:"gp-verbar"},[s!==void 0?(0,I.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${s.current}`):null,l,(0,I.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void o()},[(0,I.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,I.createElement)(jt,{size:12})),t("version.check")]),s?.repositoryUrl!==void 0?(0,I.createElement)("a",{key:"gh",className:"gp-icon-btn gp-verbar__gh gp-verbar__gh--starred",href:s.repositoryUrl,target:"_blank",rel:"noreferrer","aria-label":t("version.openRepo"),...a(t("version.openRepo"))},(0,I.createElement)(Pr,{size:15})):null,i])}var fe=require("react"),$a=require("react-dom");var Ba="data-gp-tab-dot",Rt,Vn=null,Ia="",xn=null,wn;function Do(e){if(typeof document>"u")return null;let t=document.querySelectorAll(Ht);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function Wn(){let e=Do(Ia);if(e===null)return;let t=e.querySelector(`[${Ba}]`);if(xn===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${xn}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(Ba,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function zo(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(gr);if(e!==Vn){if(Rt?.disconnect(),Vn=e,e===null){Rt=void 0;return}Rt=new MutationObserver(()=>Wn()),Rt.observe(e,{childList:!0,subtree:!0})}}function Ao(){Rt?.disconnect(),Rt=void 0,Vn=null}function Oa(e,t,n){if(!(typeof document>"u")){if(n===null){qn(e);return}wn=e,Ia=t,xn=n,zo(),Wn()}}function qn(e){wn!==void 0&&wn!==e||(wn=void 0,xn=null,Wn(),Ao())}function Ho(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function Fo(){let[e,t]=(0,fe.useState)(!1),[n,r]=(0,fe.useState)(null),a=(0,fe.useRef)(null);return(0,fe.useLayoutEffect)(()=>{if(!e||a.current===null){r(null);return}let s=a.current.getBoundingClientRect();r({left:s.left,bottom:window.innerHeight-s.top+8})},[e]),{bind:{ref:s=>{a.current=s},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:s=>!e||n===null||typeof document>"u"?null:(0,$a.createPortal)((0,fe.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},s.map((l,d)=>(0,fe.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function Bo(e){let[t,n]=(0,fe.useState)(!1);return(0,fe.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=e.closest("[data-conversation-region]")??document.body,i=()=>n(a.clientWidth>0&&a.clientWidth<Io);i();let o=new ResizeObserver(i);return o.observe(a),()=>o.disconnect()},[e]),t}var Io=620;function Xa({sessionId:e,t}){let n=Wt(e),r=Fo(),[a,i]=(0,fe.useState)(null),o=Bo(a),s=(0,fe.useRef)(Symbol("gp-tab-dot")),l=n.state==="ready"&&n.snapshot.showInputPill===!1?n.snapshot.dirty?"dirty":"synced":null,d=t("panel.tab");if((0,fe.useEffect)(()=>{Oa(s.current,d,l);let k=s.current;return()=>{qn(k)}},[d,l]),n.state==="cold"||n.state==="loading"||n.state==="no-cwd")return null;if(n.state==="error")return n.error.code==="not-a-git-repo"||n.error.code==="git-unavailable"||n.error.showInputPill===!1?null:(0,fe.createElement)("span",{className:"gp-pill gp-pill--degraded",title:n.error.detail??t("pill.unavailable")},t("pill.unavailable"));let p=n.snapshot;if(p.showInputPill===!1)return null;let u=Ho(p.root),g=p.branch??`(${t("pill.detached")})`,S=p.dirty,b=S?"gp-pill--dirty":"gp-pill--synced",_=()=>{if(wr(d)){xr(d);return}et(e)&&fr(e,S?"changes":"overview"),vr(d)};return(0,fe.createElement)("span",{className:"gp-pill-wrap",ref:i},[(0,fe.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${b}${o?" gp-pill--compact":""}`,onClick:_,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,fe.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,fe.createElement)("span",{key:"repo",className:"gp-pill__repo"},u),(0,fe.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,fe.createElement)("span",{key:"b",className:"gp-pill__branch"},g),")"])]),r.render([p.root,t(S?"pill.dirty":"pill.synced")])])}var A=require("react");function Oo(e){for(let t of e){let n=t.schema?.dict;if(n!==void 0&&"showInputPill"in n||JSON.stringify(t.schema).includes("showInputPill"))return t.ns}}var kn={min:Re.maxBytes.min/1024,max:Re.maxBytes.max/1024},_n={min:Re.timeoutMs.min/1e3,max:Re.timeoutMs.max/1e3};function jn(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function $o(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Ja({ctx:e,t}){let[,n]=(0,A.useState)(0),[r,a]=(0,A.useState)(!1),[i,o]=(0,A.useState)(!1),[s,l]=(0,A.useState)(null),[d,p]=(0,A.useState)(null),[u,g]=(0,A.useState)(null),[S,b]=(0,A.useState)(null),[_,k]=(0,A.useState)(null),[M,D]=(0,A.useState)(null),[J,F]=(0,A.useState)(null),[C,R]=(0,A.useState)(null),Q=()=>{n(N=>N+1)},U=e.get("configForms"),K=(0,A.useMemo)(()=>U?.describe(),[U]);(0,A.useEffect)(()=>{if(K!==void 0)return K.ensure(),K.subscribe(Q)},[K]);let ae=K?.getSnapshot().view,z=(0,A.useMemo)(()=>ae===void 0?void 0:Oo(ae.namespaces),[ae]),W=(0,A.useMemo)(()=>U!==void 0&&z!==void 0?U.get(z):void 0,[U,z]);(0,A.useEffect)(()=>{if(W!==void 0)return W.subscribe(Q)},[W]);let O=W?.getSnapshot(),se=W!==void 0&&O!==void 0&&O.status==="ready",q=K?.getSnapshot().status,de=s??(typeof O?.value?.showInputPill=="boolean"?O.value.showInputPill:!0),le=d??(O?.value?.defaultDiffView==="split"?"split":"unified"),he=u??(O?.value?.graphStyle==="compact"?"compact":"parallel"),be=S??(typeof O?.value?.suggestEnabled=="boolean"?O.value.suggestEnabled:!0),ee=O?.value?.suggestLanguage,w=_??(typeof ee=="string"&&Zt.includes(ee)?ee:Pn),T=jn(typeof O?.value?.suggestMaxBytes=="number"?O.value.suggestMaxBytes/1024:Re.maxBytes.default/1024,kn),j=jn(typeof O?.value?.suggestMaxOutputTokens=="number"?O.value.suggestMaxOutputTokens:Re.maxOutputTokens.default,Re.maxOutputTokens),Y=jn(typeof O?.value?.suggestTimeoutMs=="number"?O.value.suggestTimeoutMs/1e3:Re.timeoutMs.default/1e3,_n),m=async(N,Ee,ze)=>{if(W!==void 0){o(!1),a(!0);try{let xe=await W.set(N,Ee);ze(),xe?(zt(),setTimeout(()=>zt(),1e3)):o(!0)}catch{ze(),o(!0)}finally{a(!1)}}},G=N=>(l(N),m("showInputPill",N,()=>l(null))),B=N=>N===le?Promise.resolve():(p(N),m("defaultDiffView",N,()=>p(null))),P=N=>N===he?Promise.resolve():(g(N),m("graphStyle",N,()=>g(null))),ue=N=>(b(N),m("suggestEnabled",N,()=>b(null))),Se=N=>N===w?Promise.resolve():(k(N),m("suggestLanguage",N,()=>k(null))),_e=(N,Ee,ze,xe,$e,Ve)=>{let Be=N===null?null:$o(N);if(Be===null)return Ve(),Promise.resolve();let Ae=Math.min(Ee.max,Math.max(Ee.min,Math.floor(Be)));return $e(String(Ae)),m(xe,Ae*ze,Ve)},lt=N=>_e(N,kn,1024,"suggestMaxBytes",D,()=>D(null)),Fe=N=>_e(N,Re.maxOutputTokens,1,"suggestMaxOutputTokens",F,()=>F(null)),De=N=>_e(N,_n,1e3,"suggestTimeoutMs",R,()=>R(null));return U===void 0?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):se?(0,A.createElement)("div",{className:"gp-cfg"},[(0,A.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,A.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,A.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:de,disabled:r||O?.writable===!1,onChange:N=>{G(N.currentTarget.checked)}}),(0,A.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,A.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,A.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,A.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},it(["unified","split"],le,N=>{B(N)},N=>t(N==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||O?.writable===!1)),(0,A.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,A.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,A.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},it(["parallel","compact"],he,N=>{P(N)},N=>t(N==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||O?.writable===!1)),(0,A.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,A.createElement)("div",{key:"suggestcard",className:"gp-cfg__card"},[(0,A.createElement)("h3",{key:"sgtitle",className:"gp-cfg__card-title"},t("cfg.suggestTitle")),(0,A.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,A.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:be,disabled:r||O?.writable===!1,onChange:N=>{ue(N.currentTarget.checked)}}),(0,A.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,A.createElement)("p",{key:"sglangtitle",className:"gp-cfg__seglabel"},t("cfg.suggestLangLabel")),(0,A.createElement)("div",{key:"sglang",className:"gp-seg gp-cfg__seg",role:"group","aria-label":t("cfg.suggestLangLabel")},it([...Zt],w,N=>{Se(N)},N=>t(N==="auto"?"cfg.suggestLangAuto":N==="zh"?"cfg.suggestLangZh":"cfg.suggestLangEn"),r||O?.writable===!1)),(0,A.createElement)("p",{key:"sglanghint",className:"gp-cfg__rangehint"},t("cfg.suggestLangHint")),(0,A.createElement)("div",{key:"numax",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-maxkib"},t("cfg.suggestMaxBytesLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-maxkib",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:kn.min,max:kn.max,"aria-describedby":"gp-cfg-maxkib-hint",value:M??String(T),disabled:r||O?.writable===!1,onChange:N=>{D(N.currentTarget.value)},onBlur:()=>{lt(M)},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestMaxBytesUnit"))]),(0,A.createElement)("p",{key:"numaxhint",id:"gp-cfg-maxkib-hint",className:"gp-cfg__rangehint"},t("cfg.suggestMaxBytesHint")),(0,A.createElement)("div",{key:"nuout",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-outtok"},t("cfg.suggestOutputLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-outtok",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:Re.maxOutputTokens.min,max:Re.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:J??String(j),disabled:r||O?.writable===!1,onChange:N=>{F(N.currentTarget.value)},onBlur:()=>{Fe(J)},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestOutputUnit"))]),(0,A.createElement)("p",{key:"nuouthint",id:"gp-cfg-outtok-hint",className:"gp-cfg__rangehint"},t("cfg.suggestOutputHint")),(0,A.createElement)("div",{key:"nuto",className:"gp-cfg__numrow"},[(0,A.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-timeout"},t("cfg.suggestTimeoutLabel")),(0,A.createElement)("input",{key:"input",id:"gp-cfg-timeout",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:_n.min,max:_n.max,"aria-describedby":"gp-cfg-timeout-hint",value:C??String(Y),disabled:r||O?.writable===!1,onChange:N=>{R(N.currentTarget.value)},onBlur:()=>{De(C)},onKeyDown:N=>{N.key==="Enter"&&N.currentTarget.blur()}}),(0,A.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestTimeoutUnit"))]),(0,A.createElement)("p",{key:"nutohint",id:"gp-cfg-timeout-hint",className:"gp-cfg__rangehint"},t("cfg.suggestTimeoutHint")),(0,A.createElement)("p",{key:"sghint",className:"gp-cfg__hint"},t("cfg.suggestHint"))]),i?(0,A.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):q==="idle"||q==="loading"?(0,A.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,A.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var Xt="gitPanel",Xo=["dsh-git-panel","@xbzbing/dsh-git-panel"],Jo=["slots","locale","connection"],Ko="dsh-git-panel";function Uo(e){or(),pr(e),e.effect(()=>e.locale.register(Xt,{zh:sr,en:lr})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(Xt),n=[],r=a=>{typeof a=="function"&&n.push(a)};r(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:Xt,label:()=>t("panel.tab")},a=>(0,Sn.createElement)(Fa,{ctx:e,sessionId:a.sessionId,t})))),r(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:Xt},a=>(0,Sn.createElement)(Xa,{sessionId:a.sessionId,t}))));for(let a of Xo)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:a,locale:Xt},i=>i.view==="summary"?t("cfg.title"):(0,Sn.createElement)(Ja,{ctx:e,t}))));e.effect(()=>{let a=e.on("connection/reset",()=>zt());return()=>{typeof a=="function"&&a();for(let i of n.splice(0))try{i()}catch{}ur()}},"dsh-git-panel: lifecycle")}module.exports={name:Ko,inject:Jo,apply:Uo};
813
+ `,Er=!1;function ya(){if(Er||typeof document>"u")return;let e="dsh-git-panel/client.css";if(document.querySelector(`style[data-plugin-css="${e}"]`)!==null){Er=!0;return}let t=document.createElement("style");t.dataset.plugin="@xbzbing/dsh-git-panel",t.dataset.pluginCss=e,t.textContent=Zi,document.head.appendChild(t),Er=!0}var ba={"panel.tab":"Git","panel.fontDecrease":"\u7F29\u5C0F\u5B57\u4F53","panel.fontReset":"\u91CD\u7F6E\u5B57\u4F53\u5927\u5C0F","panel.fontIncrease":"\u653E\u5927\u5B57\u4F53","panel.fontSize":"\u9762\u677F\u5B57\u53F7","panel.tabs":"\u9762\u677F\u6807\u7B7E\u9875","tab.overview":"Git \u603B\u89C8","tab.changes":"\u53D8\u66F4\u8BB0\u5F55","tab.files":"\u6587\u4EF6\u6D4F\u89C8","pill.unavailable":"Git \u4E0D\u53EF\u7528","pill.detached":"\u6E38\u79BB HEAD","pill.synced":"\u672C\u5730\u5DF2\u540C\u6B65","pill.dirty":"\u6709\u5F85\u63D0\u4EA4\u7684\u53D8\u66F4","common.loading":"\u52A0\u8F7D\u4E2D\u2026","common.retry":"\u91CD\u8BD5","common.close":"\u5173\u95ED","common.cancel":"\u53D6\u6D88","ops.aiHint":"\u63D0\u793A\uFF1A\u7ED9 AI \u591A\u4E00\u70B9\u4FE1\u4EFB\uFF0C\u4F60\u53EF\u4EE5\u5C1D\u8BD5\u8BA9 AI \u76F4\u63A5\u6267\u884C Git \u64CD\u4F5C\u3002","version.check":"\u68C0\u67E5\u65B0\u7248\u672C","version.checking":"\u68C0\u67E5\u4E2D\u2026","version.upToDate":"\u5DF2\u662F\u6700\u65B0\uFF08{current}\uFF09","version.updateAvailable":"\u6709\u65B0\u7248\u672C {latest}\uFF08\u5F53\u524D {current}\uFF09","version.viewRelease":"\u67E5\u770B\u53D1\u5E03","version.error":"\u68C0\u67E5\u5931\u8D25","version.noRepo":"\u672A\u914D\u7F6E\u4ED3\u5E93\u5730\u5740","version.openRepo":"\u8BBF\u95EE GitHub \u67E5\u770B @xbzbing/dsh-git-panel \u9879\u76EE\uFF0C\u8BF7\u4E3A\u9879\u76EE\u70B9\u4EAE\u4E00\u9897\u5C0F\u661F\u661F\u5427 \u2B50","overview.head":"\u5168\u90E8\u5206\u652F","overview.local":"\u672C\u5730","overview.currentBranch":"\u5F53\u524D\u5206\u652F","overview.primaryBranch":"\u4E3B\u5206\u652F","overview.branchAhead":"\u6BD4\u4E0A\u6E38\u9886\u5148 {n} \u4E2A\u63D0\u4EA4","overview.branchBehind":"\u6BD4\u4E0A\u6E38\u843D\u540E {n} \u4E2A\u63D0\u4EA4","overview.remote":"\u8FDC\u7A0B","overview.tags":"\u6807\u7B7E","overview.search":"\u641C\u7D22\u63D0\u4EA4\uFF08\u6D88\u606F / \u54C8\u5E0C\uFF09","overview.searchShort":"\u641C\u7D22\u63D0\u4EA4","overview.allUsers":"\u5168\u90E8\u4F5C\u8005","overview.allTime":"\u5168\u90E8\u65F6\u95F4","overview.today":"\u4ECA\u5929","overview.last7d":"\u8FD1 7 \u5929","overview.last30d":"\u8FD1 30 \u5929","overview.selectCommit":"\u9009\u62E9\u4E00\u4E2A\u63D0\u4EA4\u67E5\u770B\u8BE6\u60C5","overview.noMessage":"\uFF08\u65E0\u63D0\u4EA4\u6B63\u6587\uFF09","overview.noResults":"\u6CA1\u6709\u5339\u914D\u7684\u63D0\u4EA4","overview.loadFailed":"\u52A0\u8F7D\u5931\u8D25","overview.detailFailed":"\u8BE6\u60C5\u52A0\u8F7D\u5931\u8D25","overview.diffFailed":"\u5DEE\u5F02\u52A0\u8F7D\u5931\u8D25","overview.openFileDiff":"\u67E5\u770B\u8BE5\u6587\u4EF6\u5728\u6B64\u63D0\u4EA4\u4E2D\u7684\u53D8\u66F4","overview.changeSummary":"{files} \u4E2A\u6587\u4EF6","overview.expandDir":"\u5C55\u5F00\u76EE\u5F55","overview.collapseDir":"\u6298\u53E0\u76EE\u5F55","overview.fetch":"\u62C9\u53D6\u8FDC\u7A0B","overview.branchesError":"\u5206\u652F\u52A0\u8F7D\u5931\u8D25","overview.filterBranch":"\u6309\u5206\u652F\u7B5B\u9009","overview.moreFilters":"\u66F4\u591A\u7B5B\u9009","overview.backToList":"\u8FD4\u56DE\u5217\u8868","overview.createTag":"\u521B\u5EFA\u6807\u7B7E","overview.revert":"\u8FD8\u539F\u6B64\u63D0\u4EA4","overview.reset":"\u91CD\u7F6E\u5230\u6B64","switch.action":"\u5207\u6362","switch.rowTitle":"\u5207\u6362\u5230 {name}","switch.rowTitleTrack":"\u4ECE {ref} \u65B0\u5EFA\u8DDF\u8E2A\u5206\u652F {name} \u5E76\u5207\u6362","switch.detached":"\u6E38\u79BB HEAD","switch.confirmTitle":"\u5207\u6362\u5206\u652F","switch.body":"\u4ECE {from} \u5207\u6362\u5230 {to}\u3002","switch.trackingNote":"\u672C\u5730\u8FD8\u6CA1\u6709 {name}\uFF0C\u5C06\u5148\u4ECE {ref} \u521B\u5EFA\u5B83\u5E76\u8BBE\u7F6E\u8DDF\u8E2A\uFF08upstream\uFF09\u3002","switch.dirtyWarn":"\u5F53\u524D\u6709 {count} \u4E2A\u6587\u4EF6\u5B58\u5728\u672A\u63D0\u4EA4\u53D8\u66F4\u3002","switch.modeDirect":"\u76F4\u63A5\u5207\u6362","switch.modeDirectHint":"\u672A\u63D0\u4EA4\u53D8\u66F4\u4F1A\u968F\u5DE5\u4F5C\u533A\u5E26\u8FC7\u53BB\uFF1B\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\uFF0CGit \u4F1A\u62D2\u7EDD\u5207\u6362\uFF0C\u5DE5\u4F5C\u533A\u4FDD\u6301\u4E0D\u53D8\u3002","switch.modeStash":"\u5148\u8D2E\u85CF {count} \u4E2A\u6587\u4EF6\u7684\u53D8\u66F4\uFF0C\u518D\u5207\u6362","switch.modeStashHint":"\u53D8\u66F4\u79FB\u5165\u8D2E\u85CF\u6808\u9876\uFF08\u542B\u672A\u8DDF\u8E2A\u6587\u4EF6\uFF09\uFF0C\u5207\u6362\u540E\u53EF\u4ECE\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\u3002\u6CE8\u610F\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u6062\u590D\uFF1B\u6062\u590D\u65F6\u82E5\u4E0E\u76EE\u6807\u5206\u652F\u51B2\u7A81\u9700\u624B\u52A8\u89E3\u51B3\u3002","switch.confirm":"\u5207\u6362","switch.confirmStash":"\u8D2E\u85CF\u5E76\u5207\u6362","switch.switching":"\u6B63\u5728\u5207\u6362\u2026","switch.stashMessage":"\u5207\u6362\u5230 {branch} \u524D\u81EA\u52A8\u8D2E\u85CF","tag.createTitle":"\u5728\u6B64\u63D0\u4EA4\u521B\u5EFA\u6807\u7B7E","tag.namePlaceholder":"\u6807\u7B7E\u540D","tag.annotated":"\u9644\u6CE8\u6807\u7B7E\uFF08\u5E26\u8BF4\u660E\uFF09","tag.messagePlaceholder":"\u6807\u7B7E\u8BF4\u660E","tag.create":"\u521B\u5EFA\u6807\u7B7E","tag.deleteTitle":"\u5220\u9664\u6807\u7B7E","tag.deleteConfirm":"\u786E\u5B9A\u5220\u9664\u6807\u7B7E\u300C{name}\u300D\uFF1F","tag.deleteOne":"\u5220\u9664\u6807\u7B7E\u300C{name}\u300D","ops.dirtyWarn":"\u68C0\u6D4B\u5230\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u8FD9\u4E9B\u6539\u52A8\u53EF\u80FD\u662F dsh AI \u6B63\u5728\u8FDB\u884C\u7684\u5DE5\u4F5C\u3002","revert.title":"\u8FD8\u539F\u63D0\u4EA4","revert.body":"\u5C06\u5728\u5F53\u524D HEAD \u8FFD\u52A0\u4E00\u4E2A\u53CD\u5411\u63D0\u4EA4\uFF0C\u8FD8\u539F {ref} \u7684\u6539\u52A8\u3002\u4E0D\u4F1A\u4E22\u5F03\u4F60\u7684\u5DE5\u4F5C\u533A\u6539\u52A8\u3002","revert.confirm":"\u8FD8\u539F","reset.title":"\u91CD\u7F6E\u5206\u652F","reset.body":"\u5C06\u628A\u5F53\u524D\u5206\u652F\u7684 HEAD \u4ECE {from} \u79FB\u52A8\u5230 {to}\u3002","reset.modeSoft":"\u8F6F\u91CD\u7F6E\uFF08--soft\uFF09","reset.softHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u6682\u5B58\u533A\u3002","reset.modeMixed":"\u6DF7\u5408\u91CD\u7F6E\uFF08--mixed\uFF0C\u9ED8\u8BA4\uFF09","reset.mixedHint":"\u79FB\u52A8 HEAD\uFF0C\u6539\u52A8\u4FDD\u7559\u5728\u5DE5\u4F5C\u533A\u3002","reset.modeHard":"\u786C\u91CD\u7F6E\uFF08--hard\uFF09","reset.hardHint":"\u79FB\u52A8 HEAD \u5230\u6B64\u63D0\u4EA4\u5E76\u4E22\u5F03\u6240\u6709\u672A\u63D0\u4EA4\u6539\u52A8\uFF08\u672A\u63D0\u4EA4\u6539\u52A8\u65E0\u6CD5\u6062\u590D\uFF09\u3002","reset.hardOrphan":"\u5F53\u524D\u5206\u652F\u4E0A\u665A\u4E8E\u76EE\u6807\u7684\u63D0\u4EA4\u4F1A\u79BB\u5F00\u5206\u652F\uFF08\u4ECD\u53EF\u7528 git reflog \u627E\u56DE\uFF09\u3002","reset.hardWarn":"\u4EE5\u4E0B\u672A\u63D0\u4EA4\u6539\u52A8\u5C06\u88AB\u6C38\u4E45\u4E22\u5F03\uFF1A","reset.lostMore":"\u2026\u8FD8\u6709\u66F4\u591A\u672A\u63D0\u4EA4\u6539\u52A8\u672A\u663E\u793A\uFF08\u5217\u8868\u5DF2\u622A\u65AD\uFF09","reset.hardAck":"\u6211\u5DF2\u4E86\u89E3\uFF0C\u786E\u8BA4\u4E22\u5F03\u8FD9\u4E9B\u672A\u63D0\u4EA4\u6539\u52A8","reset.hardAckClean":"\u6211\u5DF2\u4E86\u89E3\u6B64\u64CD\u4F5C\u7684\u540E\u679C\uFF0C\u786E\u8BA4\u91CD\u7F6E","reset.confirm":"\u91CD\u7F6E","changes.groupStaged":"\u5DF2\u6682\u5B58\u7684\u66F4\u6539","changes.groupUnstaged":"\u66F4\u6539","changes.groupUntracked":"\u672A\u7248\u672C\u63A7\u5236\u7684\u6587\u4EF6","changes.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u53D8\u66F4","changes.noChanges":"\u6CA1\u6709\u672A\u63D0\u4EA4\u7684\u53D8\u66F4","changes.actions":"\u4ED3\u5E93\u53D8\u66F4\u64CD\u4F5C","changes.refresh":"\u5237\u65B0\u5F53\u524D\u4ED3\u5E93\u72B6\u6001","changes.stageAll":"\u5168\u90E8\u6682\u5B58","changes.unstageAll":"\u5168\u90E8\u53D6\u6D88\u6682\u5B58","changes.stage":"\u6682\u5B58","changes.unstage":"\u53D6\u6D88\u6682\u5B58","changes.discard":"\u653E\u5F03\u66F4\u6539","changes.discardConfirm":"\u518D\u6B21\u70B9\u51FB\u4EE5\u786E\u8BA4\u653E\u5F03","changes.stageTip":"\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u4E0B\u4E00\u6B21\u63D0\u4EA4\u4F1A\u5305\u542B\u5B83\u7684\u6539\u52A8","changes.unstageTip":"\u53D6\u6D88\u6682\u5B58\u6B64\u6587\u4EF6\uFF0C\u6539\u52A8\u4ECD\u7559\u5728\u5DE5\u4F5C\u533A","changes.discardTip":"\u653E\u5F03\u6B64\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u6539\u52A8\uFF08\u4E0D\u53EF\u6062\u590D\uFF09\uFF1B\u518D\u70B9\u4E00\u6B21\u786E\u8BA4","changes.discardTipArmed":"\u518D\u70B9\u4E00\u6B21\u5373\u653E\u5F03\u6B64\u6587\u4EF6\u7684\u6539\u52A8\uFF0C\u4E0D\u53EF\u6062\u590D","changes.discardPicked":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedTitle":"\u653E\u5F03\u9009\u4E2D\u7684\u66F4\u6539","changes.discardPickedBody":"\u5C06\u653E\u5F03 {count} \u4E2A\u6587\u4EF6\u5728\u5DE5\u4F5C\u533A\u7684\u672A\u63D0\u4EA4\u66F4\u6539\uFF0C\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002","changes.discardPickedStaged":"\u53E6\u6709 {count} \u4E2A\u9009\u4E2D\u9879\u5728\u6682\u5B58\u533A\uFF0C\u4E0D\u5728\u6B64\u6B21\u653E\u5F03\u8303\u56F4\uFF08\u5982\u9700\u64A4\u9500\u6682\u5B58\u8BF7\u7528\u300C\u53D6\u6D88\u6682\u5B58\u300D\uFF09\u3002","changes.discardPickedUntracked":"\u5176\u4E2D {count} \u4E2A\u662F\u672A\u8DDF\u8E2A\u7684\u6587\u4EF6\u6216\u76EE\u5F55\uFF0C\u5C06\u4ECE\u78C1\u76D8\u5220\u9664\uFF08\u4E0D\u5728 Git \u5386\u53F2\u4E2D\uFF0C\u65E0\u6CD5\u6062\u590D\uFF09\u3002","changes.discarding":"\u6B63\u5728\u653E\u5F03\u2026","changes.backToList":"\u8FD4\u56DE\u5217\u8868","changes.stash":"\u8D2E\u85CF\u66F4\u6539","changes.untrackedCollapsed":"\u672A\u8DDF\u8E2A\u9879\u4EE5\u76EE\u5F55\u5F62\u5F0F\u663E\u793A\uFF0C\u672A\u9010\u4E2A\u5C55\u5F00","changes.truncatedCap":"\u53D8\u66F4\u8FC7\u591A\uFF0C\u5217\u8868\u4EC5\u663E\u793A\u524D {n} \u9879\uFF1B\u8BA1\u6570\u4ECD\u4E3A\u5168\u90E8\u53D8\u66F4\u7684\u7EDF\u8BA1","changes.truncatedLossy":"Git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF0C\u5217\u8868\u53EF\u80FD\u7F3A\u5C11\u5F00\u5934\u90E8\u5206","changes.truncatedUnknown":"\u5217\u8868\u4E0D\u5B8C\u6574\uFF0C\u53EF\u80FD\u7F3A\u5C11\u90E8\u5206\u53D8\u66F4","stash.title":"\u8D2E\u85CF\u5F53\u524D\u66F4\u6539","stash.messagePlaceholder":"\u8D2E\u85CF\u8BF4\u660E\uFF08\u53EF\u9009\uFF09","stash.save":"\u8D2E\u85CF","stash.section":"\u8D2E\u85CF","stash.onBranch":"\u4F4D\u4E8E {branch}","stash.apply":"\u5E94\u7528","stash.pop":"\u5F39\u51FA","stash.drop":"\u4E22\u5F03","stash.dropTitle":"\u4E22\u5F03\u8D2E\u85CF","stash.dropConfirm":"\u786E\u5B9A\u4E22\u5F03\u6B64\u8D2E\u85CF\u6761\u76EE\uFF1F\u4E22\u5F03\u540E\u65E0\u6CD5\u6062\u590D\uFF1A{name}","files.selectFile":"\u9009\u62E9\u4E00\u4E2A\u6587\u4EF6\u67E5\u770B\u5185\u5BB9","files.loadFailed":"\u52A0\u8F7D\u5931\u8D25","files.notFound":"\u6587\u4EF6\u4E0D\u5B58\u5728\uFF08\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u79FB\u52A8\uFF09","files.backToTree":"\u8FD4\u56DE\u6587\u4EF6\u6811","files.truncated":"\u6761\u76EE\u8FC7\u591A\uFF0C\u5DF2\u622A\u65AD","files.tooLarge":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u65E0\u6CD5\u9884\u89C8","files.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u9884\u89C8","files.highlightOff":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5173\u95ED\u8BED\u6CD5\u9AD8\u4EAE\u4EE5\u4FDD\u6301\u6D41\u7545","files.lineTruncated":" \u2026\uFF08\u6B64\u884C\u8FC7\u957F\uFF0C\u5DF2\u622A\u65AD\uFF09","files.findPlaceholder":"\u5728\u6B64\u6587\u4EF6\u4E2D\u67E5\u627E","files.findNoMatch":"\u65E0\u5339\u914D","files.findPrev":"\u4E0A\u4E00\u4E2A","files.findNext":"\u4E0B\u4E00\u4E2A","files.findClose":"\u5173\u95ED\u67E5\u627E","files.findCase":"\u533A\u5206\u5927\u5C0F\u5199","files.previewMode":"\u9884\u89C8\u65B9\u5F0F","files.source":"\u6E90\u7801","files.render":"\u6E32\u67D3","files.wrap":"\u81EA\u52A8\u6362\u884C","files.wrapDisabled":"\u6587\u4EF6\u8FC7\u5927\uFF0C\u81EA\u52A8\u6362\u884C\u4E0D\u53EF\u7528","files.mermaidLoading":"\u6B63\u5728\u52A0\u8F7D\u56FE\u8868\u5F15\u64CE\u2026","files.copyPath":"\u590D\u5236\u76F8\u5BF9\u8DEF\u5F84","files.pathCopied":"\u8DEF\u5F84\u5DF2\u590D\u5236","files.pathCopyFailed":"\u590D\u5236\u5931\u8D25","files.copyContent":"\u590D\u5236\u6587\u4EF6\u5185\u5BB9","files.contentCopied":"\u5185\u5BB9\u5DF2\u590D\u5236","files.contentCopyFailed":"\u590D\u5236\u5931\u8D25","files.ignored":"\u5DF2\u88AB Git \u5FFD\u7565","files.copy":"\u590D\u5236\u4EE3\u7801","files.copied":"\u5DF2\u590D\u5236","files.footnotes":"\u6CE8\u91CA","files.zoomBar":"\u56FE\u7247\u7F29\u653E","files.zoomIn":"\u653E\u5927","files.zoomOut":"\u7F29\u5C0F","files.zoomActual":"\u5B9E\u9645\u5927\u5C0F\uFF08100%\uFF09","files.zoomFit":"\u9002\u5E94\u7A97\u53E3","files.zoomFullscreen":"\u5168\u5C4F\u67E5\u770B","files.fullscreen":"\u5168\u5C4F\u67E5\u770B\u6587\u4EF6","files.gitNotInstalled":"\u7CFB\u7EDF\u672A\u5B89\u88C5 Git\uFF0CGit \u9762\u677F\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5B89\u88C5 Git \u5DE5\u5177\u540E\u91CD\u8BD5\u3002","files.propsTitle":"\u6587\u4EF6\u5C5E\u6027","files.propsGroupStats":"\u5927\u5C0F\u4E0E\u7EDF\u8BA1","files.propsGroupTime":"\u65F6\u95F4","files.propsName":"\u540D\u79F0","files.propsType":"\u7C7B\u578B","files.propsTypeImage":"{fmt} \u56FE\u7247","files.propsTypeText":"\u6587\u672C\u6587\u4EF6","files.propsTypeBinary":"\u4E8C\u8FDB\u5236\u6587\u4EF6","files.propsTypeUnread":"\u8FC7\u5927\u672A\u8BFB\u53D6","files.propsTypeFmt":"{label}\uFF08.{ext}\uFF09","files.propsRelPath":"\u76F8\u5BF9\u8DEF\u5F84","files.propsAbsPath":"\u7EDD\u5BF9\u8DEF\u5F84","files.propsCopyHint":"\u70B9\u51FB\u590D\u5236","files.propsSize":"\u5927\u5C0F","files.propsSizeBytes":"\uFF08{bytes} \u5B57\u8282\uFF09","files.propsLines":"\u884C\u6570","files.propsImageSize":"\u56FE\u7247\u5C3A\u5BF8","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"\u4FEE\u6539\u65F6\u95F4","files.propsUntracked":"\u672A\u8DDF\u8E2A","files.propsTrackedYes":"\u5DF2\u8DDF\u8E2A","files.propsStaged":"\u5DF2\u6682\u5B58","files.stAdded":"\u5DF2\u6DFB\u52A0","files.stModified":"\u5DF2\u4FEE\u6539","files.stDeleted":"\u5DF2\u5220\u9664","files.stRenamed":"\u5DF2\u91CD\u547D\u540D","files.stConflicted":"\u6709\u51B2\u7A81","files.stTypechange":"\u7C7B\u578B\u53D8\u66F4","stats.files":"{n} \u4E2A\u6587\u4EF6","stats.lastChange":"\u6700\u8FD1\u53D8\u66F4 {time}","stats.lastCommit":"\u4E0A\u6B21\u63D0\u4EA4 {time}","stats.staged":"\u5DF2\u6682\u5B58 {n}","stats.modified":"\u5DF2\u4FEE\u6539 {n}","stats.untracked":"\u672A\u8DDF\u8E2A {n}","stats.partial":"\u7EDF\u8BA1\u5DF2\u7B80\u5316","stats.partialHint":"\u53D8\u66F4\u6570\u91CF\u8F83\u591A\uFF0C\u5DF2\u8DF3\u8FC7\u672A\u8DDF\u8E2A\u6587\u4EF6\u884C\u6570\u4E0E\u6700\u8FD1\u53D8\u66F4\u65F6\u95F4\u7684\u7CBE\u786E\u7EDF\u8BA1\u4EE5\u4FDD\u6301\u9762\u677F\u6D41\u7545\u3002","commit.placeholder":"\u63D0\u4EA4\u4FE1\u606F","commit.commit":"\u63D0\u4EA4","commit.amend":"Amend \u63D0\u4EA4","commit.edit":"\u7F16\u8F91\u63D0\u4EA4\u4FE1\u606F","commit.collapse":"\u6536\u8D77\u63D0\u4EA4\u6846","commit.suggest":"AI \u751F\u6210","commit.suggesting":"\u751F\u6210\u4E2D\u2026","commit.suggestOverwrite":"\u518D\u6B21\u70B9\u51FB\u300CAI \u751F\u6210\u300D\u4EE5\u8986\u76D6\u5F53\u524D\u63D0\u4EA4\u4FE1\u606F","commit.suggestTruncated":"diff \u8FC7\u957F\u5DF2\u622A\u65AD\uFF0C\u751F\u6210\u7684\u5EFA\u8BAE\u53EF\u80FD\u4E0D\u5B8C\u6574","diff.unified":"\u7EDF\u4E00","diff.split":"\u5BF9\u7167","diff.before":"\u53D8\u66F4\u524D","diff.after":"\u53D8\u66F4\u540E","diff.binary":"\u4E8C\u8FDB\u5236\u6587\u4EF6\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.tooLarge":"\u56FE\u7247\u8FC7\u5927\uFF0C\u65E0\u6CD5\u663E\u793A\u5BF9\u7167","diff.imageMissing":"\u4E0D\u5B58\u5728","diff.svgRender":"\u6E32\u67D3","diff.svgSource":"\u6E90\u7801","diff.empty":"\u65E0\u5DEE\u5F02","diff.expandAll":"\u5C55\u5F00\u5168\u90E8","diff.collapse":"\u6298\u53E0\u672A\u53D8\u66F4","diff.expandGap":"\u5C55\u5F00\u5168\u90E8 {n} \u884C","diff.expandUp":"\u5411\u4E0A\u5C55\u5F00 {n} \u884C","diff.expandDown":"\u5411\u4E0B\u5C55\u5F00 {n} \u884C","diff.expandCapped":"\u6587\u4EF6\u8F83\u5927\uFF0C\u5DF2\u5C55\u5F00 {n} \u884C\u4E0A\u4E0B\u6587\uFF0C\u5176\u4F59\u4FDD\u6301\u6298\u53E0\uFF0C\u53EF\u9010\u6BB5\u5C55\u5F00","diff.truncated":"git \u8F93\u51FA\u8D85\u51FA\u4E0A\u9650\uFF1A\u6B64\u5DEE\u5F02\u53EA\u4FDD\u7559\u4E86\u5C3E\u6BB5\uFF0C\u5F00\u5934\u7684\u6539\u52A8\u4E0E\u589E\u5220\u7EDF\u8BA1\u53EF\u80FD\u7F3A\u5931","time.justNow":"\u521A\u521A","time.minutesAgo":"{n} \u5206\u949F\u524D","time.hoursAgo":"{n} \u5C0F\u65F6\u524D","time.daysAgo":"{n} \u5929\u524D","error.generic":"\u64CD\u4F5C\u5931\u8D25","error.notARepo":"\u5F53\u524D\u76EE\u5F55\u4E0D\u662F Git \u4ED3\u5E93","error.noCwd":"\u5F53\u524D\u4F1A\u8BDD\u65E0\u5DE5\u4F5C\u76EE\u5F55","error.localChangesBlock":"\u672C\u5730\u6709\u672A\u63D0\u4EA4\u53D8\u66F4\uFF0C\u64CD\u4F5C\u88AB\u963B\u6B62","error.emptyMessage":"\u63D0\u4EA4\u4FE1\u606F\u4E0D\u80FD\u4E3A\u7A7A","error.emptyDiff":"\u6CA1\u6709\u53EF\u751F\u6210\u7684\u53D8\u66F4","error.llmUnavailable":"AI \u670D\u52A1\u4E0D\u53EF\u7528","error.llmFailed":"AI \u751F\u6210\u5931\u8D25","error.suggestDisabled":"AI \u751F\u6210\u5DF2\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u5173\u95ED","error.conflict":"\u8D2E\u85CF\u5E94\u7528\u4EA7\u751F\u51B2\u7A81\uFF0C\u8D2E\u85CF\u6761\u76EE\u5DF2\u4FDD\u7559\uFF0C\u8BF7\u624B\u52A8\u89E3\u51B3\u51B2\u7A81\u540E\u518D\u8BD5","error.revertConflict":"\u8FD8\u539F\u4F1A\u4E0E\u5F53\u524D\u5185\u5BB9\u51B2\u7A81\uFF0C\u5DF2\u81EA\u52A8\u53D6\u6D88\u8FD8\u539F\uFF08\u672A\u6539\u52A8\u4F60\u7684\u5DE5\u4F5C\u533A\uFF09","error.revertStuck":"\u8FD8\u539F\u4EA7\u751F\u51B2\u7A81\u4E14\u81EA\u52A8\u53D6\u6D88\u5931\u8D25\uFF0C\u4ED3\u5E93\u4ECD\u5904\u4E8E\u8FD8\u539F\u4E2D\uFF0C\u8BF7\u624B\u52A8\u6267\u884C git revert --abort \u6216\u89E3\u51B3\u51B2\u7A81","error.revertMerge":"\u8FD9\u662F\u4E00\u4E2A\u5408\u5E76\u63D0\u4EA4\uFF0C\u9762\u677F\u6682\u4E0D\u652F\u6301\u8FD8\u539F\uFF08\u9700\u6307\u5B9A\u4E3B\u7EBF\u7236\u63D0\u4EA4\uFF09\uFF0C\u8BF7\u5728\u547D\u4EE4\u884C\u7528 git revert -m \u5904\u7406","error.indexBusy":"Git \u6B63\u5FD9\uFF08\u53E6\u4E00\u8FDB\u7A0B\u5360\u7528\u7D22\u5F15\uFF09\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5","error.notFound":"\u76EE\u6807\u4E0D\u5B58\u5728\uFF08\u5206\u652F / \u6807\u7B7E / \u8D2E\u85CF\u53EF\u80FD\u5DF2\u88AB\u5220\u9664\u6216\u91CD\u547D\u540D\uFF09","error.branchInUse":"\u8BE5\u5206\u652F\u5DF2\u5728\u53E6\u4E00\u4E2A\u5DE5\u4F5C\u6811\u4E2D\u68C0\u51FA\uFF0C\u65E0\u6CD5\u5728\u6B64\u5207\u6362","error.nestedRepo":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u653E\u5F03\u4F1A\u8FDE\u5E26\u5220\u9664\u6574\u4E2A\u5185\u90E8\u4ED3\u5E93\uFF1B\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.nestedRepoPartial":"\u8BE5\u6761\u76EE\u672C\u8EAB\u662F\u4E00\u4E2A Git \u4ED3\u5E93\uFF08\u5D4C\u5957\u4ED3\u5E93\u6216\u5B50\u6A21\u5757\uFF09\uFF0C\u62D2\u7EDD\u8FDE\u5E26\u5220\u9664\uFF1B\u4F46\u540C\u6279\u4E2D\u4F4D\u4E8E\u5B83\u4E4B\u524D\u7684\u6761\u76EE\u5DF2\u7ECF\u88AB\u5220\u9664\u4E86\uFF0C\u8BF7\u5237\u65B0\u540E\u786E\u8BA4\u5269\u4F59\u53D8\u66F4\uFF0C\u6B64\u64CD\u4F5C\u8BF7\u5728\u7EC8\u7AEF\u4E2D\u5B8C\u6210","error.stashSwitchFailed":"\u672A\u63D0\u4EA4\u53D8\u66F4\u5DF2\u8D2E\u85CF\uFF08\u53EF\u5728\u300C\u53D8\u66F4\u8BB0\u5F55 \u2192 \u8D2E\u85CF\u300D\u6062\u590D\uFF09\uFF0C\u4F46\u5207\u6362\u5931\u8D25\uFF1A{reason}","error.invalidName":"\u540D\u79F0\u4E0D\u5408\u6CD5","error.notFastForward":"\u672C\u5730\u4E0E\u8FDC\u7A0B\u5206\u652F\u5DF2\u5206\u53C9\uFF0C\u65E0\u6CD5\u5FEB\u8FDB\u62C9\u53D6\uFF0C\u8BF7\u624B\u52A8\u5408\u5E76\u6216\u53D8\u57FA","error.pushRejected":"\u63A8\u9001\u88AB\u62D2\u7EDD\uFF1A\u8FDC\u7A0B\u5DF2\u6709\u65B0\u63D0\u4EA4\uFF0C\u8BF7\u5148\u300C\u68C0\u67E5\u540C\u6B65\u300D\u5E76\u62C9\u53D6\u540E\u518D\u63A8\u9001","error.authFailed":"\u8BA4\u8BC1\u5931\u8D25\uFF1A\u6CA1\u6709\u53EF\u7528\u7684 git \u51ED\u636E\uFF08HTTPS \u9700\u51ED\u636E\u52A9\u624B\u3001SSH \u9700\u5BC6\u94A5\uFF09\u3002\u8BF7\u5148\u5728\u547D\u4EE4\u884C\u5B8C\u6210\u4E00\u6B21\u63A8\u9001\u4EE5\u7F13\u5B58\u51ED\u636E","status.openRepo":"\u5728\u6D4F\u89C8\u5668\u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.openRepoOn":"\u5728 {host} \u6253\u5F00\u4ED3\u5E93\u4E3B\u9875","status.synced":"\u5DF2\u4E0E\u8FDC\u7A0B\u540C\u6B65","status.ahead":"\u9886\u5148 {n}","status.behind":"\u843D\u540E {n}","status.diverged":"\u5DF2\u5206\u53C9\uFF08\u9886\u5148 {ahead} / \u843D\u540E {behind}\uFF09","status.noUpstream":"\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u5206\u652F","status.detached":"\u6E38\u79BB HEAD\uFF0C\u65E0\u5206\u652F\u540C\u6B65\u72B6\u6001","status.check":"\u68C0\u67E5\u540C\u6B65\u72B6\u6001","status.checkTitle":"\u68C0\u67E5\u4E0E\u8FDC\u7A0B\u7684\u540C\u6B65\u72B6\u6001\uFF1A\u6267\u884C git fetch \u62C9\u53D6\u6700\u65B0\u5F15\u7528\u5E76\u5237\u65B0\u9886\u5148/\u843D\u540E\u8BA1\u6570\uFF0C\u4E0D\u6539\u52A8\u5DE5\u4F5C\u533A","status.pull":"\u62C9\u53D6","status.pulling":"\u540C\u6B65\u4E2D\u2026","status.pullTitle":"\u5FEB\u8FDB\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmTitle":"\u62C9\u53D6\u8FDC\u7A0B\u66F4\u65B0","status.pullConfirmBody":"\u5C06\u4EE5\u5FEB\u8FDB\u65B9\u5F0F\u628A\u5F53\u524D\u5206\u652F {branch} \u66F4\u65B0\u5230\u8FDC\u7A0B\u6700\u65B0\u63D0\u4EA4\uFF08\u843D\u540E {behind} \u4E2A\u63D0\u4EA4\uFF09\u3002\u4EC5\u5728\u672A\u5206\u53C9\u65F6\u53EF\u884C\uFF0C\u4E0D\u4F1A\u4EA7\u751F\u5408\u5E76\u63D0\u4EA4\uFF0C\u4E5F\u4E0D\u4F1A\u6539\u52A8\u4F60\u7684\u672A\u63D0\u4EA4\u5185\u5BB9\u3002","status.pullConfirm":"\u62C9\u53D6","status.pullScope":"\u5C06\u5F15\u5165 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pullScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u8FDC\u7A0B\u5DEE\u5F02\u2026","status.push":"\u63A8\u9001","status.pushTitle":"\u63A8\u9001\u672C\u5730\u63D0\u4EA4\u5230\u8FDC\u7A0B","status.pushConfirmTitle":"\u63A8\u9001\u5230\u8FDC\u7A0B","status.pushConfirmBody":"\u5C06\u628A\u5F53\u524D\u5206\u652F {branch} \u9886\u5148\u8FDC\u7A0B\u7684 {ahead} \u4E2A\u63D0\u4EA4\u63A8\u9001\u5230\u4E0A\u6E38\u3002\u4EC5\u505A\u5FEB\u8FDB\u63A8\u9001\uFF0C\u4E0D\u4F1A\u5F3A\u5236\u8986\u76D6\u8FDC\u7A0B\u5386\u53F2\u3002","status.pushConfirm":"\u63A8\u9001","status.pushing":"\u63A8\u9001\u4E2D\u2026","status.pushScope":"\u5C06\u63A8\u9001 {commits} \u4E2A\u63D0\u4EA4 \xB7 {files} \u4E2A\u6587\u4EF6 \xB7 +{ins} / \u2212{del} \u884C","status.pushScopeLoading":"\u6B63\u5728\u7EDF\u8BA1\u5F85\u63A8\u9001\u5DEE\u5F02\u2026","status.publish":"\u53D1\u5E03","status.publishTitle":"\u53D1\u5E03\u5206\u652F\u5E76\u8BBE\u7F6E\u4E0A\u6E38","status.publishConfirmTitle":"\u53D1\u5E03\u5206\u652F\u5230\u8FDC\u7A0B","status.publishConfirmBody":"\u5F53\u524D\u5206\u652F {branch} \u5C1A\u672A\u8DDF\u8E2A\u8FDC\u7A0B\u3002\u5C06\u6267\u884C git push -u {remote} \u5728\u8FDC\u7A0B\u521B\u5EFA\u540C\u540D\u5206\u652F\u5E76\u8BBE\u4E3A\u4E0A\u6E38\u8DDF\u8E2A\u3002","status.publishConfirm":"\u53D1\u5E03","status.publishing":"\u53D1\u5E03\u4E2D\u2026","cfg.title":"\u8F93\u5165\u6846\u5206\u652F\u6807\u8BB0","cfg.toggle":"\u663E\u793A\u8F93\u5165\u6846\u6807\u8BB0","cfg.hint":"\u5F00\u542F\u65F6\u5728\u8F93\u5165\u6846\u663E\u793A zsh \u98CE\u683C\u7684 <\u4ED3\u5E93\u540D> (\u5206\u652F) \u6807\u8BB0\uFF1B\u5173\u95ED\u540E\u6539\u4E3A\u5728 Git \u6807\u7B7E\u65C1\u663E\u793A\u72B6\u6001\u5706\u70B9\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffTitle":"\u5DEE\u5F02\u5BF9\u6BD4\u9ED8\u8BA4\u89C6\u56FE","cfg.diffHint":"\u9009\u62E9\u53D8\u66F4\u5BF9\u6BD4\u9ED8\u8BA4\u6253\u5F00\u7684\u5E03\u5C40\uFF1A\u7EDF\u4E00\u89C6\u56FE\u4E3A\u5355\u680F\u884C\u5185\u5BF9\u6BD4\uFF0C\u5E76\u6392\u89C6\u56FE\u4E3A\u5DE6\u53F3\u5206\u680F\u5BF9\u6BD4\u3002\u4ECD\u53EF\u5728\u6BCF\u4E2A\u5DEE\u5F02\u89C6\u56FE\u4E2D\u4E34\u65F6\u5207\u6362\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.diffUnified":"\u7EDF\u4E00\u89C6\u56FE\uFF08\u5355\u680F\u884C\u5185\uFF09","cfg.diffSplit":"\u5E76\u6392\u89C6\u56FE\uFF08\u5DE6\u53F3\u5206\u680F\uFF09","cfg.graphTitle":"\u63D0\u4EA4\u5386\u53F2\u56FE\u7EBF\u6761\u6837\u5F0F","cfg.graphHint":"\u9009\u62E9\u63D0\u4EA4\u5386\u53F2\u56FE\u7684\u8FDE\u7EBF\u753B\u6CD5\uFF1A\u5E73\u884C\u7EBF\u4E3A VSCode / \u56FE\u5F62\u754C\u9762\u98CE\u683C\uFF0C\u5206\u652F\u5404\u5360\u4E00\u5217\u3001\u5171\u4EAB\u7956\u5148\u4EE5\u5E76\u884C\u7EBF\u8868\u793A\uFF1B\u7D27\u51D1\u4E3A git log \u547D\u4EE4\u884C\u98CE\u683C\uFF0C\u5171\u4EAB\u7956\u5148\u5408\u5E76\u4E3A\u4E00\u5217\u3001\u7EBF\u66F4\u5C11\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.graphParallel":"\u5E73\u884C\u7EBF\uFF08VSCode \u98CE\u683C\uFF09","cfg.graphCompact":"\u7D27\u51D1\uFF08git log \u98CE\u683C\uFF09","cfg.suggestTitle":"AI \u751F\u6210\u63D0\u4EA4\u4FE1\u606F","cfg.suggestToggle":"\u63D0\u4EA4\u6846\u663E\u793A AI \u751F\u6210\u6309\u94AE","cfg.suggestLangLabel":"\u751F\u6210\u8BED\u8A00","cfg.suggestLangAuto":"\u81EA\u52A8","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"\u81EA\u52A8 = \u8DDF\u968F\u4F60\u5728\u6B64\u4ED3\u5E93\u7684\u63D0\u4EA4\u8BED\u8A00\uFF08\u5C31\u8FD1\u52A0\u6743\uFF0C\u5F53\u524D git \u4F5C\u8005\u4F18\u5148\uFF0C\u5FFD\u7565 release / merge \u7B49\u673A\u68B0\u63D0\u4EA4\uFF09\uFF1B\u4E2D\u6587 / English \u76F4\u63A5\u6307\u5B9A\u3002","cfg.suggestMaxBytesLabel":"\u8F93\u5165\u9884\u7B97","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"\u53D1\u9001\u7ED9\u6A21\u578B\u7684 diff \u4E0A\u9650\uFF0C\u8D85\u51FA\u4F1A\u622A\u65AD\uFF1B\u8303\u56F4 16\u2013512\u3002","cfg.suggestOutputLabel":"\u8F93\u51FA\u4E0A\u9650","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"\u6A21\u578B\u751F\u6210\u9884\u7B97\uFF1B\u601D\u8003\u6A21\u578B\u7684\u63A8\u7406\u8BA1\u5165\u8BE5\u9884\u7B97\uFF1B\u8303\u56F4 256\u201316384\u3002","cfg.suggestTimeoutLabel":"\u751F\u6210\u8D85\u65F6","cfg.suggestTimeoutUnit":"\u79D2","cfg.suggestTimeoutHint":"\u8D85\u65F6\u5373\u751F\u6210\u5931\u8D25\uFF1B\u8303\u56F4 5\u2013120\u3002","cfg.suggestModelLabel":"\u6A21\u578B","cfg.suggestModelSession":"\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4","cfg.suggestModelLoading":"\u52A0\u8F7D\u6A21\u578B\u5217\u8868\u2026","cfg.suggestModelEmpty":"\u672A\u68C0\u6D4B\u5230\u53EF\u7528\u6A21\u578B\uFF0C\u8BF7\u5148\u5728 DSH \u8BBE\u7F6E\u4E2D\u914D\u7F6E","cfg.suggestModelFailed":"\u6A21\u578B\u5217\u8868\u52A0\u8F7D\u5931\u8D25","cfg.suggestModelRetry":"\u91CD\u8BD5","cfg.suggestProviderLabel":"\u63D0\u4F9B\u65B9","cfg.suggestModelPick":"\u9009\u62E9\u6A21\u578B","cfg.suggestEffortLabel":"\u63A8\u7406\u5F3A\u5EA6","cfg.suggestEffortUnset":"\u4E0D\u8BBE\u7F6E\uFF08\u7528\u6A21\u578B\u9ED8\u8BA4\uFF09","cfg.suggestHint":"\u5F00\u542F\u540E\u63D0\u4EA4\u6846\u65C1\u4F1A\u51FA\u73B0\u300CAI \u751F\u6210\u300D\u6309\u94AE\uFF1A\u6839\u636E\u5F53\u524D\u53D8\u66F4\u4E0E\u4ED3\u5E93\u65E2\u6709\u63D0\u4EA4\u98CE\u683C\u751F\u6210\u63D0\u4EA4\u4FE1\u606F\uFF0C\u586B\u5165\u540E\u53EF\u7F16\u8F91\u518D\u63D0\u4EA4\u3002\u9009\u56FA\u5B9A\u6A21\u578B\u540E\uFF0C\u751F\u6210\u4F1A\u628A diff \u53D1\u7ED9\u8BE5\u6A21\u578B\u7684\u4F9B\u5E94\u5546\uFF1B\u9009\u300C\u8DDF\u968F\u4F1A\u8BDD\u9ED8\u8BA4\u300D\u5219\u7528\u5F53\u524D\u4F1A\u8BDD\u7684 Agent \u6A21\u578B\u3002\u4FDD\u5B58\u540E\u7ACB\u5373\u751F\u6548\u3002","cfg.notLoaded":"\u914D\u7F6E\u672A\u52A0\u8F7D\uFF1A\u8BE5\u914D\u7F6E\u7531\u8FD0\u884C\u4E2D\u7684\u5BBF\u4E3B\u63D0\u4F9B\uFF0C\u82E5\u957F\u65F6\u95F4\u7A7A\u767D\u8BF7\u91CD\u542F DSH \u540E\u91CD\u8BD5\u3002","cfg.saveFailed":"\u4FDD\u5B58\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"},va={"panel.tab":"Git","panel.fontDecrease":"Decrease font size","panel.fontReset":"Reset font size","panel.fontIncrease":"Increase font size","panel.fontSize":"Panel font size","panel.tabs":"Panel tabs","tab.overview":"Overview","tab.changes":"Changes","tab.files":"Files","pill.unavailable":"Git unavailable","pill.detached":"detached HEAD","pill.synced":"Everything committed","pill.dirty":"Uncommitted changes","common.loading":"Loading\u2026","common.retry":"Retry","common.close":"Close","common.cancel":"Cancel","ops.aiHint":"Tip: Trust AI more, try direct Git\u2011operation execution by AI.","version.check":"Check for updates","version.checking":"Checking\u2026","version.upToDate":"Up to date ({current})","version.updateAvailable":"New version {latest} available (current {current})","version.viewRelease":"View release","version.error":"Check failed","version.noRepo":"Repository not configured","version.openRepo":"Visit @xbzbing/dsh-git-panel on GitHub \u2014 please give the project a little star \u2B50","overview.head":"All branches","overview.local":"Local","overview.currentBranch":"Current branch","overview.primaryBranch":"Primary branch","overview.branchAhead":"{n} commits ahead of upstream","overview.branchBehind":"{n} commits behind upstream","overview.remote":"Remote","overview.tags":"Tags","overview.search":"Search commits (message / hash)","overview.searchShort":"Search","overview.allUsers":"All authors","overview.allTime":"All time","overview.today":"Today","overview.last7d":"Last 7 days","overview.last30d":"Last 30 days","overview.selectCommit":"Select a commit to see details","overview.noMessage":"(no commit body)","overview.noResults":"No matching commits","overview.loadFailed":"Load failed","overview.detailFailed":"Failed to load details","overview.diffFailed":"Failed to load diff","overview.openFileDiff":"View this file\u2019s changes in this commit","overview.changeSummary":"{files} files","overview.expandDir":"Expand folder","overview.collapseDir":"Collapse folder","overview.fetch":"Fetch","overview.branchesError":"Failed to load branches","overview.filterBranch":"Filter by branch","overview.moreFilters":"More filters","overview.backToList":"Back to list","overview.createTag":"Create tag","switch.action":"Switch","switch.rowTitle":"Switch to {name}","switch.rowTitleTrack":"Create {name} tracking {ref} and switch to it","switch.detached":"detached HEAD","switch.confirmTitle":"Switch branch","switch.body":"Switch from {from} to {to}.","switch.trackingNote":"There is no local {name} yet: it will be created from {ref} and set to track it.","switch.dirtyWarn":"{count} file(s) have uncommitted changes.","switch.modeDirect":"Switch directly","switch.modeDirectHint":"Uncommitted changes come along; if they collide with the target branch, git refuses the switch and the work tree stays untouched.","switch.modeStash":"Stash the {count} file(s) first, then switch","switch.modeStashHint":"The changes (including untracked files) move to the top of the stash; restore them from Changes \u2192 Stash afterwards. Note: they are not restored automatically, and restoring may need manual conflict resolution.","switch.confirm":"Switch","switch.confirmStash":"Stash and switch","switch.switching":"Switching\u2026","switch.stashMessage":"Auto-stash before switching to {branch}","overview.revert":"Revert this commit","overview.reset":"Reset to here","tag.createTitle":"Create a tag at this commit","tag.namePlaceholder":"Tag name","tag.annotated":"Annotated tag (with message)","tag.messagePlaceholder":"Tag message","tag.create":"Create tag","tag.deleteTitle":"Delete tag","tag.deleteConfirm":'Delete tag "{name}"?',"tag.deleteOne":'Delete tag "{name}"',"ops.dirtyWarn":"There are uncommitted changes \u2014 they may be work the dsh AI is doing.","revert.title":"Revert commit","revert.body":"Appends a reverse commit at the current HEAD that undoes the changes in {ref}. Your working-tree changes are kept.","revert.confirm":"Revert","reset.title":"Reset branch","reset.body":"Moves the current branch HEAD from {from} to {to}.","reset.modeSoft":"Soft (--soft)","reset.softHint":"Moves HEAD; changes stay staged.","reset.modeMixed":"Mixed (--mixed, default)","reset.mixedHint":"Moves HEAD; changes stay in the working tree.","reset.modeHard":"Hard (--hard)","reset.hardHint":"Moves HEAD to this commit and discards all uncommitted changes (uncommitted changes cannot be recovered).","reset.hardOrphan":"Commits after the target leave the branch (still recoverable via git reflog).","reset.hardWarn":"The following uncommitted changes will be permanently discarded:","reset.lostMore":"\u2026 more uncommitted changes not shown (list capped)","reset.hardAck":"I understand these uncommitted changes will be lost","reset.hardAckClean":"I understand the consequences and confirm the reset","reset.confirm":"Reset","changes.groupStaged":"Staged changes","changes.groupUnstaged":"Changes","changes.groupUntracked":"Unversioned files","changes.selectFile":"Select a file to see its diff","changes.noChanges":"No uncommitted changes","changes.actions":"Repository change actions","changes.refresh":"Refresh repository status","changes.stageAll":"Stage all","changes.unstageAll":"Unstage all","changes.stage":"Stage","changes.unstage":"Unstage","changes.discard":"Discard changes","changes.discardConfirm":"Click again to confirm discard","changes.stageTip":"Stage this file so the next commit includes its changes","changes.unstageTip":"Unstage this file; its changes stay in the working tree","changes.discardTip":"Discard this file's working-tree changes (cannot be undone); click again to confirm","changes.discardTipArmed":"Click again to discard this file's changes \u2014 cannot be undone","changes.discardPicked":"Discard selected","changes.discardPickedTitle":"Discard selected changes","changes.discardPickedBody":"Discards uncommitted working-tree changes in {count} file(s). This cannot be undone.","changes.discardPickedStaged":"{count} of the selected rows are on the staged side and are not affected; use Unstage to undo the index.","changes.discardPickedUntracked":"{count} of them are untracked files or directories that will be deleted from disk (never in Git history \u2014 unrecoverable).","changes.discarding":"Discarding\u2026","changes.backToList":"Back to list","changes.stash":"Stash changes","changes.untrackedCollapsed":"Untracked entries are shown as directories, not expanded","changes.truncatedCap":"Too many changes \u2014 showing the first {n}; counts still cover all changes","changes.truncatedLossy":"Git output exceeded the limit; the list may be missing its opening entries","changes.truncatedUnknown":"The list is incomplete; some changes may be missing","stash.title":"Stash current changes","stash.messagePlaceholder":"Stash message (optional)","stash.save":"Stash","stash.section":"Stashes","stash.onBranch":"on {branch}","stash.apply":"Apply","stash.pop":"Pop","stash.drop":"Drop","stash.dropTitle":"Drop stash","stash.dropConfirm":"Drop this stash? This cannot be undone: {name}","files.selectFile":"Select a file to preview","files.loadFailed":"Load failed","files.notFound":"File not found (deleted or moved)","files.backToTree":"Back to files","files.truncated":"Too many entries \u2014 truncated","files.tooLarge":"File too large to preview","files.binary":"Binary file \u2014 no preview","files.highlightOff":"Large file \u2014 syntax highlighting disabled for performance","files.lineTruncated":" \u2026 (line too long, truncated)","files.findPlaceholder":"Find in file","files.findNoMatch":"No results","files.findPrev":"Previous match","files.findNext":"Next match","files.findClose":"Close find","files.findCase":"Match case","files.previewMode":"Preview mode","files.source":"Source","files.render":"Rendered","files.wrap":"Word wrap","files.wrapDisabled":"Word wrap unavailable for large files","files.mermaidLoading":"Loading diagram engine\u2026","files.copyPath":"Copy relative path","files.pathCopied":"Path copied","files.pathCopyFailed":"Copy failed","files.copyContent":"Copy file content","files.contentCopied":"Content copied","files.contentCopyFailed":"Copy failed","files.ignored":"Ignored by Git","files.copy":"Copy code","files.copied":"Copied","files.footnotes":"Footnotes","files.zoomBar":"Image zoom","files.zoomIn":"Zoom in","files.zoomOut":"Zoom out","files.zoomActual":"Actual size (100%)","files.zoomFit":"Fit to window","files.zoomFullscreen":"View fullscreen","files.fullscreen":"View file full screen","files.gitNotInstalled":"Git is not installed; the Git panel is unavailable. Please install Git and try again.","files.propsTitle":"File properties","files.propsGroupStats":"Size & stats","files.propsGroupTime":"Timestamps","files.propsName":"Name","files.propsType":"Type","files.propsTypeImage":"{fmt} image","files.propsTypeText":"Text file","files.propsTypeBinary":"Binary file","files.propsTypeUnread":"Too large to read","files.propsTypeFmt":"{label} (.{ext})","files.propsRelPath":"Relative path","files.propsAbsPath":"Absolute path","files.propsCopyHint":"Click to copy","files.propsSize":"Size","files.propsSizeBytes":"({bytes} bytes)","files.propsLines":"Lines","files.propsImageSize":"Dimensions","files.propsImageSizeFmt":"{w} \xD7 {h}","files.propsMtime":"Modified","files.propsUntracked":"Untracked","files.propsTrackedYes":"Tracked","files.propsStaged":"Staged","files.stAdded":"Added","files.stModified":"Modified","files.stDeleted":"Deleted","files.stRenamed":"Renamed","files.stConflicted":"Conflicted","files.stTypechange":"Type changed","stats.files":"{n} files","stats.lastChange":"changed {time}","stats.lastCommit":"last commit {time}","stats.staged":"{n} staged","stats.modified":"{n} modified","stats.untracked":"{n} untracked","stats.partial":"simplified","stats.partialHint":"Large change set \u2014 untracked line counts and last-change time are omitted to keep the panel responsive.","commit.placeholder":"Commit message","commit.commit":"Commit","commit.amend":"Amend previous commit","commit.edit":"Edit commit message","commit.collapse":"Collapse commit editor","commit.suggest":"AI suggest","commit.suggesting":"Generating\u2026","commit.suggestOverwrite":'Click "AI suggest" again to replace the current message',"commit.suggestTruncated":"The diff was truncated; the suggestion may be incomplete","diff.unified":"Unified","diff.split":"Split","diff.before":"Before","diff.after":"After","diff.binary":"Binary file \u2014 no diff to show","diff.tooLarge":"Image too large to compare","diff.imageMissing":"Does not exist","diff.svgRender":"Rendered","diff.svgSource":"Source","diff.empty":"No differences","diff.expandAll":"Expand all","diff.collapse":"Collapse unchanged","diff.expandGap":"Expand all {n} lines","diff.expandUp":"Expand up {n} lines","diff.expandDown":"Expand down {n} lines","diff.expandCapped":"Large file: expanded {n} lines of context; the rest stays collapsed and can be expanded in place","diff.truncated":"git output exceeded the output cap: only the tail of this diff survived, so the opening changes and the +/- counts may be missing","time.justNow":"just now","time.minutesAgo":"{n}m ago","time.hoursAgo":"{n}h ago","time.daysAgo":"{n}d ago","error.generic":"Operation failed","error.notARepo":"Not a Git repository","error.noCwd":"This session has no working directory","error.localChangesBlock":"Local changes block this operation","error.emptyMessage":"Commit message cannot be empty","error.emptyDiff":"No changes to summarize","error.llmUnavailable":"AI service unavailable","error.llmFailed":"AI generation failed","error.suggestDisabled":"AI suggest is turned off in the plugin config","error.conflict":"Applying the stash produced conflicts; the stash entry is kept \u2014 resolve them and retry","error.revertConflict":"The revert would conflict with the current content; it was cancelled automatically (your working tree is unchanged)","error.revertStuck":"The revert conflicted and could not be auto-cancelled; the repository is mid-revert \u2014 run `git revert --abort` or resolve it manually","error.revertMerge":"This is a merge commit; the panel cannot revert it (a mainline parent is required) \u2014 use `git revert -m` on the command line","error.indexBusy":"Git is busy (another process holds the index lock); try again shortly","error.notFound":"Target not found (the branch / tag / stash may have been removed or renamed)","error.branchInUse":"That branch is checked out in another worktree, so it cannot be switched to here","error.nestedRepo":"That entry is a Git repository itself (a nested repo or a submodule): discarding it would delete the whole inner repository. Do it from a terminal instead","error.nestedRepoPartial":"That entry is a Git repository itself (a nested repo or a submodule), so it was not deleted \u2014 but earlier entries in this batch already were. Refresh to see what is left, and handle this one from a terminal","error.stashSwitchFailed":"The uncommitted changes were stashed (restore them from Changes \u2192 Stash), but the switch failed: {reason}","error.invalidName":"Invalid name","error.notFastForward":"Local and remote have diverged \u2014 a fast-forward pull is not possible; merge or rebase manually","error.pushRejected":"Push rejected: the remote has new commits \u2014 run \u201CCheck sync\u201D and pull first, then push","error.authFailed":"Authentication failed: no usable git credentials (HTTPS needs a credential helper, SSH needs a key). Push once from the command line first to cache them","status.openRepo":"Open the repository home in the browser","status.openRepoOn":"Open the repository home on {host}","status.synced":"Up to date with remote","status.ahead":"{n} ahead","status.behind":"{n} behind","status.diverged":"Diverged ({ahead} ahead / {behind} behind)","status.noUpstream":"No upstream branch","status.detached":"Detached HEAD \u2014 no branch sync state","status.check":"Check sync status","status.checkTitle":"Check sync with the remote: runs git fetch to update refs and refresh the ahead/behind counts; your working tree is untouched","status.pull":"Pull","status.pulling":"Syncing\u2026","status.pullTitle":"Fast-forward pull of remote updates","status.pullConfirmTitle":"Pull remote updates","status.pullConfirmBody":"Fast-forwards the current branch {branch} to the latest remote commit ({behind} behind). Only possible when not diverged; it creates no merge commit and leaves your uncommitted work untouched.","status.pullConfirm":"Pull","status.pullScope":"Brings in {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pullScopeLoading":"Measuring incoming changes\u2026","status.push":"Push","status.pushTitle":"Push local commits to the remote","status.pushConfirmTitle":"Push to remote","status.pushConfirmBody":"Pushes the {ahead} commits that {branch} is ahead of the remote to its upstream. Fast-forward only \u2014 it never force-overwrites remote history.","status.pushConfirm":"Push","status.pushing":"Pushing\u2026","status.pushScope":"Pushes {commits} commits \xB7 {files} files \xB7 +{ins} / \u2212{del} lines","status.pushScopeLoading":"Measuring outgoing changes\u2026","status.publish":"Publish","status.publishTitle":"Publish the branch and set its upstream","status.publishConfirmTitle":"Publish branch to remote","status.publishConfirmBody":"The current branch {branch} has no upstream yet. This runs git push -u {remote} to create a same-named branch on the remote and set it as the upstream.","status.publishConfirm":"Publish","status.publishing":"Publishing\u2026","cfg.title":"Input-bar branch marker","cfg.toggle":"Show input-bar marker","cfg.hint":"When on, the input bar shows the zsh-style <repo> (branch) marker; when off, a status dot appears beside the Git tab instead. Saved changes apply immediately.","cfg.diffTitle":"Default diff view","cfg.diffHint":"Choose the layout diffs open with: unified is a single inline column, split is side-by-side. You can still switch per diff. Saved changes apply immediately.","cfg.diffUnified":"Unified (single inline column)","cfg.diffSplit":"Split (side-by-side)","cfg.graphTitle":"Commit graph line style","cfg.graphHint":"Choose how the commit graph draws its lines: parallel is the VSCode / GUI style \u2014 each branch keeps its own column and a shared ancestor shows as parallel lines; compact is the git log style \u2014 a shared ancestor merges into one column with fewer lines. Saved changes apply immediately.","cfg.graphParallel":"Parallel (VSCode style)","cfg.graphCompact":"Compact (git log style)","cfg.suggestTitle":"AI commit message","cfg.suggestToggle":"Show AI suggest button in the commit box","cfg.suggestLangLabel":"Language","cfg.suggestLangAuto":"Auto","cfg.suggestLangZh":"\u4E2D\u6587","cfg.suggestLangEn":"English","cfg.suggestLangHint":"Auto follows the language you write commits in for this repository (recency-weighted, with the current git author preferred, ignoring mechanical commits such as releases and merges); \u4E2D\u6587 / English pin it.","cfg.suggestMaxBytesLabel":"Input budget","cfg.suggestMaxBytesUnit":"KiB","cfg.suggestMaxBytesHint":"Diff bytes sent to the model; beyond it the diff is truncated. Range 16\u2013512.","cfg.suggestOutputLabel":"Output limit","cfg.suggestOutputUnit":"tokens","cfg.suggestOutputHint":"Model generation budget; reasoning tokens count against it on thinking models. Range 256\u201316384.","cfg.suggestTimeoutLabel":"Generation timeout","cfg.suggestTimeoutUnit":"s","cfg.suggestTimeoutHint":"Generation fails after the timeout. Range 5\u2013120.","cfg.suggestModelLabel":"Model","cfg.suggestModelSession":"Follow session default","cfg.suggestModelLoading":"Loading model list\u2026","cfg.suggestModelEmpty":"No models detected \u2014 configure one in DSH Settings first","cfg.suggestModelFailed":"Failed to load the model list","cfg.suggestModelRetry":"Retry","cfg.suggestProviderLabel":"Provider","cfg.suggestModelPick":"Select a model","cfg.suggestEffortLabel":"Reasoning effort","cfg.suggestEffortUnset":"Not set (model default)","cfg.suggestHint":'When on, an "AI suggest" button appears beside the commit button: it writes a commit message from the current changes and the repository\u2019s existing commit style, filled in for you to edit before committing. A fixed model sends the diff to that model\u2019s provider; "Follow session default" uses the current session\u2019s Agent model. Saved changes apply immediately.',"cfg.notLoaded":"Config not loaded: it is served by the running host. Restart DSH if this stays blank.","cfg.saveFailed":"Save failed, please retry"};var Sn=require("react");function es(e=()=>typeof document>"u"?void 0:document){let t=new Set,n,r=!0,a=()=>e()?.hidden!==!0,o=()=>{let s=a();if(s!==r){r=s;for(let i of[...t])i()}};return{isVisible:a,subscribe(s){return t.size===0&&(n=e(),r=a(),n?.addEventListener("visibilitychange",o)),t.add(s),()=>{t.delete(s),t.size===0&&(n?.removeEventListener("visibilitychange",o),n=void 0)}}}}var Qe=es();var ts=new Set(["cwd-unavailable"]),wa=3e4,ns=6e4,An=class{constructor(t,n,r=Qe){this.remote=t;this.sessionId=n;this.visibility=r;this.unsubscribeVisibility=r.subscribe(()=>{this.disposed||(this.visibilityGeneration+=1,this.publish(this.view,this.unreadySignal()),r.isVisible()?this.refresh():this.clearPoll())})}view={state:"cold"};listeners=new Set;timer;inflight;pendingRefresh=!1;disposed=!1;pollMs=wa;unsubscribeVisibility;visibilityGeneration=0;requestGeneration=0;querySignal={tick:0,sampledAt:0,ready:!1,root:null};queryListeners=new Set;subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}getSnapshot(){return this.view}subscribeQueries(t){return this.queryListeners.add(t),()=>{this.queryListeners.delete(t)}}getQuerySignal(){return this.querySignal}ensure(){this.inflight!==void 0||this.view.state!=="cold"&&this.view.state!=="no-cwd"||this.refresh()}refresh(){if(this.disposed)return Promise.resolve();if(!this.visibility.isVisible())return this.pendingRefresh=!0,this.clearPoll(),Promise.resolve();if(this.inflight!==void 0)return this.pendingRefresh=!0,this.inflight.then(()=>this.inflight);this.pendingRefresh=!1,this.clearPoll();let t=this.visibilityGeneration,n=this.requestGeneration;return this.view.state==="cold"&&this.setView({state:"loading"}),this.inflight=this.remote.snapshot({sessionId:this.sessionId}).then(r=>{if(!(this.disposed||n!==this.requestGeneration)){if(r.ok)this.publishSnapshot(r.value,t,!1);else if(r.error.code!=="cancelled")if(ts.has(r.error.code))this.pollMs=ns,this.setView({state:"no-cwd"});else if(r.error.code==="not-a-git-repo"){let a=r.error;this.setView({state:"error",error:{code:"not-a-git-repo",...a.cwd?{cwd:a.cwd}:{},...a.showInputPill!==void 0?{showInputPill:a.showInputPill}:{}}})}else if(r.error.code==="git-unavailable"){let a=r.error;this.setView({state:"error",error:{code:"git-unavailable",...a.detail?{detail:a.detail}:{},...a.cwd?{cwd:a.cwd}:{},...a.isGitRepo!==void 0?{isGitRepo:a.isGitRepo}:{}}})}else this.setView({state:"error",error:{code:r.error.code,..."detail"in r.error?{detail:r.error.detail}:{}}})}}).catch(r=>{this.disposed||n!==this.requestGeneration||this.setView({state:"error",error:{code:"git-unavailable",detail:r instanceof Error?r.message:String(r)}})}).finally(()=>{this.inflight=void 0,!(this.disposed||!this.visibility.isVisible())&&(this.pendingRefresh?this.refresh():this.schedulePoll())}),this.inflight}resync(){this.disposed||(this.requestGeneration+=1,this.refresh())}accept(t){this.disposed||(this.requestGeneration+=1,this.pendingRefresh=!1,this.publishSnapshot(t,this.visibilityGeneration,!0),this.schedulePoll())}publishSnapshot(t,n,r){this.pollMs=t.refreshIntervalMs||wa;let a=this.view.state==="ready"?this.view.snapshot:null,o=!r&&a!==null&&t.root===a.root&&t.stateFingerprint!==void 0&&t.stateFingerprint===a.stateFingerprint,s={tick:this.querySignal.tick+1,sampledAt:t.checkedAt,ready:this.visibility.isVisible()&&n===this.visibilityGeneration,root:t.root};this.publish(o?this.view:{state:"ready",snapshot:t},s)}unreadySignal(){return this.querySignal.ready?{...this.querySignal,ready:!1}:this.querySignal}clearPoll(){this.timer!==void 0&&clearTimeout(this.timer),this.timer=void 0}schedulePoll(){this.clearPoll(),!(this.disposed||!this.visibility.isVisible()||this.inflight!==void 0||this.pollMs<=0)&&(this.timer=setTimeout(()=>{this.timer=void 0,this.refresh()},this.pollMs))}setView(t){this.publish(t,this.unreadySignal())}publish(t,n){let r=t!==this.view,a=n!==this.querySignal;if(this.view=t,this.querySignal=n,r)for(let o of this.listeners)o();if(a)for(let o of this.queryListeners)o()}dispose(){this.disposed=!0,this.clearPoll(),this.unsubscribeVisibility(),this.pendingRefresh=!1,this.listeners.clear(),this.queryListeners.clear()}};var zn=require("react"),Mr={tick:0,sampledAt:0,ready:!1,root:null};function rs(e,t){let[n,r]=(0,zn.useState)(()=>e?.getQuerySignal()??Mr);return(0,zn.useEffect)(()=>{if(e===void 0){r(Mr);return}let a=()=>r(e.getQuerySignal());if(!t){a();return}let o=e.subscribeQueries(a);return a(),o},[e,t]),t?e?.getQuerySignal()??Mr:n}function xa(e,t,n){let r=rs(e,t);return{signal:r,queryVisible:t&&r.ready&&r.root===n,queryKey:[r.root,r.tick]}}var as="/api",os="gitPanel";function is(e){try{let t=e.get("connection")?.rpc,n=t?.call;if(t!==void 0&&typeof n=="function")return(r,a,o)=>n.call(t,as,r,a,o)}catch{}}function ss(e){let t=e;if(t===null||typeof t!="object")return{ok:!1,error:{code:"git-unavailable",message:"malformed rpc result"}};if(t.ok!==!0){let n=t.error;return{ok:!1,error:{code:typeof n?.code=="string"?n.code:"git-unavailable",message:typeof n?.message=="string"?n.message:void 0}}}return t.value===void 0?{ok:!1,error:{code:"git-unavailable",message:"missing value"}}:t.value}function ve(e,t){return!e.ok||e.value.kind!==t?null:e.value}function Ct(e){return e!==void 0&&e!==""}var ka=new WeakMap;function Vt(e){let t=ka.get(e);if(t!==void 0)return t;let n=async(a,o,s)=>{let i=is(e);if(i===void 0)return{ok:!1,error:{code:"git-unavailable",message:"no connection"}};try{let l=await i(`${os}/${a}`,{args:{request:o}},s);return ss(l)}catch(l){return{ok:!1,error:{code:"git-unavailable",message:l instanceof Error?l.message:String(l)}}}},r={snapshot:(a,o)=>n("snapshot",a,o),run:(a,o)=>n("run",a,o),query:(a,o)=>n("query",a,o),suggest:(a,o)=>n("suggest",a,o),version:(a,o)=>n("version",a,o)};return ka.set(e,r),r}var Rt=new Map,_a,Gr;function Sa(e){Gr=e,_a=Vt(e)}function jt(e){let t=Rt.get(e);if(t===void 0){let n=_a??(Gr?Vt(Gr):void 0);t=new An(n??ds(),e),Rt.set(e,t)}return t}var ls=6e4,an=new Map;function Ca(e){let t=an.get(e);t!==void 0&&(clearTimeout(t),an.delete(e)),qt.set(e,(qt.get(e)??0)+1)}function Ta(e,t){if(Rt.get(e)!==t)return;let n=(qt.get(e)??1)-1;if(n>0){qt.set(e,n);return}qt.delete(e);let r=setTimeout(()=>{Rt.get(e)===t&&(an.delete(e),!((qt.get(e)??0)>0)&&(t.dispose(),Rt.delete(e)))},ls);an.set(e,r)}var qt=new Map;function Ut(){for(let e of Rt.values())e.resync()}function Na(){for(let e of Rt.values())e.dispose();Rt.clear();for(let e of an.values())clearTimeout(e);an.clear(),qt.clear()}function ds(){let e=async()=>({ok:!1,error:{code:"git-unavailable"}});return{snapshot:e,run:e,query:e,suggest:e,version:e}}function Fn(e,t,n){let r=e?t?jt(e):Rt.get(e):void 0,a=xa(r,t,n);return(0,Sn.useEffect)(()=>{if(!(!t||r===void 0||e===void 0))return Ca(e),r.ensure(),()=>Ta(e,r)},[r,e,t]),a}function Hn(e){let[,t]=(0,Sn.useState)(0),n=e?jt(e):void 0,r=n?n.getSnapshot():{state:"cold"};return(0,Sn.useEffect)(()=>{if(n===void 0||e===void 0)return;Ca(e);let a=n.subscribe(()=>t(o=>o+1));return n.getSnapshot()!==r&&t(o=>o+1),n.ensure(),()=>{a(),Ta(e,n)}},[n,e]),r}var q=require("react"),Ai=require("@deepseek-ai/dsh-client-ui-primitives");var Ea="[data-conversation-tabs]",Tn='[data-conversation-tabs] button[role="tab"]',Pr=new Map,Cn=new Map;function Ma(e,t){let n=Cn.get(e);if(n!==void 0&&n.size>0){for(let r of n)r(t);return}Pr.set(e,t)}function Ga(e){let t=Pr.get(e);return t===void 0?null:(Pr.delete(e),t)}function Pa(e,t){let n=Cn.get(e);return n===void 0&&(n=new Set,Cn.set(e,n)),n.add(t),()=>{let r=Cn.get(e);r!==void 0&&(r.delete(t),r.size===0&&Cn.delete(e))}}var cs=6e4,Rr=new Map;function Ra(e,t){Rr.set(e,{tab:t,leftAt:Date.now()})}function La(e){let t=Rr.get(e);return t===void 0?null:Date.now()-t.leftAt>cs?(Rr.delete(e),null):t.tab}function Da(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}function Aa(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()===e)return n.getAttribute("aria-selected")==="true";return!1}function za(e){if(typeof document>"u")return!1;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()!==e)return n.getAttribute("aria-selected")!=="true"&&n.click(),!0;return!1}var p=require("react"),ur=require("react-dom"),Xr=require("@deepseek-ai/dsh-client-ui-primitives");var Bn=require("react"),Fa=require("@deepseek-ai/dsh-client-ui-primitives");function Nn(e,t,n,r={}){let a=r.extraClass===void 0?"gp-select-trigger":`gp-select-trigger ${r.extraClass}`;return(0,Bn.createElement)("button",{type:"button",className:a,"aria-haspopup":"menu","aria-expanded":e,title:t,disabled:r.disabled,onClick:n},[(0,Bn.createElement)("span",{key:"l",className:"gp-select-trigger__label"},t),(0,Bn.createElement)(Fa.IconChevronDownOutlineRegular,{key:"c",className:"gp-select-trigger__chevron",size:14})])}var A=require("react"),ps="M2 7V3h4l8 8-4 4z",Ha="M8 1.8l1.76 3.57 3.94.57-2.85 2.78.67 3.92L8 10.78l-3.52 1.85.67-3.92L2.3 5.94l3.94-.57z";function xe(e,t=15,n=!1){return(0,A.createElement)("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round",...n?{"aria-hidden":!0}:{}},e)}function In({size:e}){return xe([(0,A.createElement)("circle",{key:"c",cx:8,cy:8,r:2.4}),(0,A.createElement)("line",{key:"l1",x1:8,y1:1.5,x2:8,y2:5.6}),(0,A.createElement)("line",{key:"l2",x1:8,y1:10.4,x2:8,y2:14.5})],e)}function Ba({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M4 2v8"}),(0,A.createElement)("path",{key:"b",d:"M2 4h4"}),(0,A.createElement)("circle",{key:"c",cx:4,cy:12,r:1.6}),(0,A.createElement)("circle",{key:"d",cx:12,cy:4,r:1.6}),(0,A.createElement)("path",{key:"e",d:"M12 6v4"}),(0,A.createElement)("path",{key:"f",d:"M10 12h4"})],e)}function Lr({size:e}){return xe([(0,A.createElement)("circle",{key:"a",cx:4,cy:3,r:1.6}),(0,A.createElement)("circle",{key:"b",cx:4,cy:13,r:1.6}),(0,A.createElement)("circle",{key:"c",cx:12,cy:5,r:1.6}),(0,A.createElement)("path",{key:"d",d:"M4 4.6v6.8"}),(0,A.createElement)("path",{key:"e",d:"M12 6.6c0 3-4 2.4-8 4"})],e)}function Ia(e,t=!1){return xe([(0,A.createElement)("path",{key:"a",d:ps}),(0,A.createElement)("circle",{key:"b",cx:4.5,cy:5.5,r:.8,fill:"currentColor"})],e,t)}function on({size:e}){return Ia(e)}function Lt({size:e,open:t}){return xe([(0,A.createElement)("path",{key:"a",d:t?"M3 6l5 5 5-5":"M6 3l5 5-5 5"})],e)}function gt({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M4 4l8 8M12 4l-8 8"})],e)}function Oa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 6V2h4"}),(0,A.createElement)("path",{key:"b",d:"M10 2h4v4"}),(0,A.createElement)("path",{key:"c",d:"M14 10v4h-4"}),(0,A.createElement)("path",{key:"d",d:"M6 14H2v-4"})],e)}function $a({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 3.5h12"}),(0,A.createElement)("path",{key:"b",d:"M2 7.5h12"}),(0,A.createElement)("path",{key:"c",d:"M2 11.5h7"}),(0,A.createElement)("path",{key:"d",d:"M2 11.5c0 2 1.5 3 3.5 3H10"})],e)}function sn({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M10 3L5 8l5 5"}),(0,A.createElement)("path",{key:"b",d:"M5 8h8"})],e)}function Xa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 3h12l-4.5 5.5V13L6.5 11V8.5z"})],e)}function Ja({size:e}){return xe([(0,A.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,A.createElement)("path",{key:"plus",d:"M11 8v6M8 11h6"})],e,!0)}function Ka({size:e}){return xe([(0,A.createElement)("path",{key:"stack",d:"M2 3h8M2 6h6M2 9h4"}),(0,A.createElement)("path",{key:"minus",d:"M8 11h6"})],e,!0)}function ln({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M13 8a5 5 0 1 1-1.5-3.5"}),(0,A.createElement)("path",{key:"b",d:"M13 2v3h-3"})],e)}function Va({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M8 2.6l1.4 4 4 1.4-4 1.4-1.4 4-1.4-4-4-1.4 4-1.4z"}),(0,A.createElement)("path",{key:"b",d:"M13 11.6v2.8M11.6 13h2.8"})],e)}function qa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M4 2h5l3 3v9H4z"}),(0,A.createElement)("path",{key:"b",d:"M9 2v3h3"})],e)}function ja({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 12.5V3.5h4l1.5 2H14v7z"})],e)}function On({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M2 5.5h12V13H2z"}),(0,A.createElement)("path",{key:"b",d:"M1.5 3h13v2.5h-13z"}),(0,A.createElement)("path",{key:"c",d:"M6.5 8.5h3"})],e)}function $n({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M3 4.5h10"}),(0,A.createElement)("path",{key:"b",d:"M5.5 4.5V3h5v1.5"}),(0,A.createElement)("path",{key:"c",d:"M4.5 4.5l.7 9h5.6l.7-9"})],e)}function Ua({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M3 7a5 5 0 1 1 1.3 3.4"}),(0,A.createElement)("path",{key:"b",d:"M3 3.5V7h3.5"})],e)}function Xn({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M13 3v10"}),(0,A.createElement)("path",{key:"b",d:"M10.5 8L3 3.5v9z",fill:"currentColor"})],e)}function Wa({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M5 2.5h4l2.5 2.5v7.5h-6.5z"}),(0,A.createElement)("path",{key:"b",d:"M9 2.5V5h2.5"}),(0,A.createElement)("path",{key:"c",d:"M11 12.5v1.5h-6.5V6"})],e)}function Qa({size:e=15}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor"},(0,A.createElement)("path",{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"}))}function Ya({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M8 2.5v7"}),(0,A.createElement)("path",{key:"b",d:"M4.5 7L8 10.5 11.5 7"}),(0,A.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function En({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M8 10.5v-7"}),(0,A.createElement)("path",{key:"b",d:"M4.5 6L8 2.5 11.5 6"}),(0,A.createElement)("path",{key:"c",d:"M3 13h10"})],e)}function Za({size:e}){return xe([(0,A.createElement)("path",{key:"a",d:"M12.5 7a4.5 4.5 0 0 0-8-2.3"}),(0,A.createElement)("path",{key:"b",d:"M3.5 9a4.5 4.5 0 0 0 8 2.3"}),(0,A.createElement)("path",{key:"c",d:"M4.3 2.2v2.5h2.5"}),(0,A.createElement)("path",{key:"d",d:"M11.7 13.8v-2.5H9.2"})],e)}function eo({size:e}){return xe([(0,A.createElement)("circle",{key:"a",cx:8,cy:8,r:6}),(0,A.createElement)("path",{key:"b",d:"M8 7.2v3.6"}),(0,A.createElement)("circle",{key:"c",cx:8,cy:5.2,r:.5,fill:"currentColor",stroke:"none"})],e)}function to({size:e=15,filled:t}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:t?"currentColor":"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round"},(0,A.createElement)("path",{d:Ha}))}function no({size:e}){return Ia(e,!0)}function ro({size:e=15}){return(0,A.createElement)("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"currentColor",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},(0,A.createElement)("path",{d:Ha}))}function ao({size:e,direction:t}){let n=e??15,r=t==="ahead"?"M4.5 11.5L11.5 4.5":"M11.5 4.5L4.5 11.5",a=t==="ahead"?"M6.5 4.5h5v5":"M9.5 11.5h-5v-5";return(0,A.createElement)("svg",{className:"gp-branch-row__sync-icon","data-direction":t,width:n,height:n,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:1.4,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0},[(0,A.createElement)("path",{key:"a",d:r}),(0,A.createElement)("path",{key:"b",d:a})])}function oo(e){let t=0;for(let n of e){t=Math.max(t,n.lane+1);for(let r of n.edges)t=Math.max(t,r.fromLane+1,r.toLane+1)}return t}function Jn(e,t,n){let r=[],a=[],o=[],s=[],i=[],l=0,d=()=>{if(i.length===0)return l++;let w=Math.min(...i);return i.splice(i.indexOf(w),1),w},c=w=>{w!==null&&!i.includes(w)&&i.push(w)},u=(w,k)=>{let y=a.findIndex(x=>x===null);return y===-1&&(y=a.length,a.push(null),o.push(null),s.push(!1)),a[y]=w,o[y]=d(),s[y]=k,y},f=w=>a.findIndex(k=>k===w),v=(w,k)=>{let y=a.findIndex((x,C)=>x===w&&s[C]===k);return y===-1?u(w,k):y},g=(w,k,y,x,C)=>C?{fromLane:w,toLane:k,color:y,kind:x,indirect:!0}:{fromLane:w,toLane:k,color:y,kind:x};for(let w=0;w<e.length;w++){let k=e[w],y=n===void 0?void 0:n[w],x=y===void 0?k.parents.length:y.length,C=L=>y===void 0?k.parents[L]:y[L].hash,T=L=>y!==void 0&&y[L].indirect,F=f(k.hash),M=F!==-1,E=F===-1?u(k.hash,!1):F,J=o[E],te=[...a],Z=[...o],I=[...s],K=k.parents.length>=2;for(let L=0;L<a.length;L++)L!==E&&a[L]===k.hash&&(c(o[L]),a[L]=null,o[L]=null);let U=-1,se=[];if(x===0)c(o[E]),a[E]=null,o[E]=null;else{let L=C(0),ne=T(0),ae=t==="compact"?a.findIndex((oe,H)=>oe===L&&H!==E&&s[H]===ne):-1;if(ae===-1)a[E]=L,s[E]=ne,U=E;else{let oe=Math.min(E,ae),H=Math.max(E,ae);a[oe]=L,s[oe]=ne,c(o[H]),a[H]=null,o[H]=null,U=oe}for(let oe=1;oe<x;oe++)se.push(v(C(oe),T(oe)))}let de=[];for(let L=0;L<te.length;L++){let ne=te[L];if(ne!==null)if(ne===k.hash){if(L===E&&!M)continue;de.push(g(L,E,Z[L],"into",I[L]))}else{let ae=a[L]===ne?L:a.findIndex((oe,H)=>oe===ne&&s[H]===I[L]);ae!==-1&&de.push(g(L,ae,Z[L],"pass",I[L]))}}U!==-1&&de.push(g(E,U,o[U],"out",s[U]));for(let L of se)de.push(g(E,L,o[L],"out",s[L]));for(r.push({commit:k,lane:E,color:J,edges:de,merge:K});a.length>0&&a[a.length-1]===null;)a=a.slice(0,-1),o=o.slice(0,-1),s=s.slice(0,-1)}return r}var io=4096,us=1e6,gs=1e5;function so(e,t,n){let r=new Map;for(let g of t)r.set(g.hash,g.parents);let a=new Map;e.forEach((g,w)=>a.set(g.hash,w));let o=Math.min(io,a.size),s=new Map,i=0,l=g=>{let w=s.get(g);if(w!==void 0)return w;let k=[{hash:g,expanded:!1}],y=new Set,x=[];for(;k.length>0;){let C=k[k.length-1];if(!C.expanded){C.expanded=!0,y.add(C.hash);let T=r.get(C.hash);for(let F=T.length-1;F>=0;F--){let M=T[F];a.has(M)||!r.has(M)||y.has(M)||s.has(M)||k.push({hash:M,expanded:!1})}continue}x.push(C.hash),k.pop()}for(let C of x){if(s.has(C))continue;let T=r.get(C),F,M=T.length>0;for(let I of T){if(a.has(I)){M=!1;break}let K=s.get(I);if(K===void 0){M=!1;break}if(F===void 0)F=K;else if(F!==K){M=!1;break}}if(M&&F!==void 0){s.set(C,F);continue}let E=[],J=new Set,te=!1,Z=I=>{if(!J.has(I)){if(E.length>=o||i>=us){te=!0;return}J.add(I),E.push(I),i++}};for(let I of T){if(a.has(I)){Z(I);continue}let K=s.get(I);if(K===void 0){te=!0;continue}for(let U of K.ancestors)Z(U);K.unknown&&(te=!0)}s.set(C,{ancestors:E,unknown:te})}return s.get(g)},d=io,c=gs,u=[],f=[];for(let g=0;g<e.length;g++){let k=e[g].parents,y=[],x=new Map,C=!1,T=M=>{let E=a.get(M);return E!==void 0&&E>g},F=(M,E)=>{let J=x.get(M);if(J===void 0){let te=a.get(M)-g+1;if(d===0||c<te){C=!0;return}d--,c-=te,x.set(M,y.length),y.push({hash:M,indirect:E})}else!E&&y[J].indirect&&(y[J]={hash:M,indirect:!1})};for(let M of k){if(a.has(M)){T(M)?F(M,!1):C=!0;continue}if(!r.has(M)){C=!0;continue}let E=l(M);(E.ancestors.length===0||E.unknown)&&(C=!0);for(let J of E.ancestors)T(J)?F(J,!0):C=!0}u.push(y),f.push(C)}let v=Jn(e,n,u);return f.some(g=>g)?v.map((g,w)=>f[w]===!0?{...g,boundary:!0}:g):v}var rt=require("react"),Wt=14,Kn=["#4e9bff","#3fb950","#e0982e","#d05ce3","#e5534b","#2dc6c6","#d29922","#8b949e"];function lo({row:e,laneCount:t,rowH:n,current:r}){let a=(0,rt.useId)(),o=Math.max(Wt,t*Wt),s=c=>c*Wt+Wt/2,i=n/2,l=Kn[e.color%Kn.length],d=e.edges.map(c=>{let u=c.kind==="out"?i:0,f=c.kind==="into"?i:n,v=(u+f)/2;return(0,rt.createElement)("path",{key:`${c.kind}-${c.fromLane}-${c.toLane}-${c.color}`,className:"gp-graph-edge",d:`M ${s(c.fromLane)} ${u} C ${s(c.fromLane)} ${v}, ${s(c.toLane)} ${v}, ${s(c.toLane)} ${f}`,stroke:Kn[c.color%Kn.length],strokeWidth:1.6,fill:"none",...c.indirect?{strokeDasharray:"7 5","data-indirect":"true"}:{}})});if(e.boundary){let c=s(e.lane)+(e.edges.some(u=>u.kind==="out")?5:0);d.push((0,rt.createElement)("path",{key:"boundary",className:"gp-graph-boundary",d:`M ${s(e.lane)} ${i} L ${c} ${i+7} V ${Math.min(n-3,i+13)}`,stroke:l,strokeWidth:1.6,strokeDasharray:"3 3",fill:"none"}))}return(0,rt.createElement)("svg",{className:"gp-graph-svg",width:o,height:n,"aria-hidden":!0},[r?(0,rt.createElement)("defs",{key:"defs"},(0,rt.createElement)("mask",{id:a,maskUnits:"userSpaceOnUse",x:0,y:0,width:o,height:n},[(0,rt.createElement)("rect",{key:"area",x:0,y:0,width:o,height:n,fill:"white"}),(0,rt.createElement)("circle",{key:"hole",cx:s(e.lane),cy:i,r:6.2,fill:"black"})])):null,(0,rt.createElement)("g",{key:"edges",...r?{mask:`url(#${a})`}:{}},d),(0,rt.createElement)("circle",{key:"node",className:`gp-graph-node${r?" gp-graph-node--current":""}`,cx:s(e.lane),cy:i,r:r?5.2:e.merge?4:3.2,fill:r?"none":l,stroke:r?l:"var(--dsw-alias-bg-layer-1)",strokeWidth:r?2:1}),r?(0,rt.createElement)("circle",{key:"head-dot",className:"gp-graph-node__dot",cx:s(e.lane),cy:i,r:2.2,fill:l}):null])}function fs(e){return/^[0-9a-fA-F]{7,40}$/.test(e.trim())}function Dr(e){let t=e.search?.trim()??"";return!fs(t)&&(t!==""||(e.author??"")!==""||(e.since??"")!=="")}var Vn=10*1024*1024,at={maxBytes:{min:16*1024,max:512*1024,default:200*1024},maxOutputTokens:{min:256,max:16384,default:4096},timeoutMs:{min:5e3,max:12e4,default:15e3}},qn=["auto","zh","en"],Ar="auto",ms={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",avif:"image/avif",bmp:"image/bmp",svg:"image/svg+xml",ico:"image/x-icon",tif:"image/tiff",tiff:"image/tiff"};function Mn(e){let t=e.lastIndexOf(".");return t<0?null:ms[e.slice(t+1).toLowerCase()]??null}function jn(e){let t=[],n=new Set;for(let o of e){let s=o.name.split("/").filter(l=>l!=="");if(s.length===0)continue;t.push({segments:s,branch:o});let i="";for(let l=0;l<s.length-1;l++)i=i===""?s[l]:`${i}/${s[l]}`,n.add(i)}let r=new Map,a=[];for(let{segments:o,branch:s}of t){let i=o.join("/"),l=n.has(i),d=a,c="";for(let u=0;u<o.length;u++){let f=o[u];c=c===""?f:`${c}/${f}`;let v=u===o.length-1;if(v&&!l){d.push({kind:"leaf",label:f,path:i,branch:s});break}let g=r.get(c);g===void 0&&(g={kind:"dir",label:f,path:c,self:null,children:[]},r.set(c,g),d.push(g)),v?g.self=s:d=g.children}}return co(a)}function co(e){return e.map(t=>{if(t.kind==="leaf")return t;let n=t;for(;;){let r=n.children.length===1?n.children[0]:void 0;if(n.self!==null||r===void 0||r.kind!=="dir")break;n={kind:"dir",label:`${n.label}/${r.label}`,path:r.path,self:r.self,children:r.children}}return{kind:"dir",label:n.label,path:n.path,self:n.self,children:co(n.children)}})}function po(e,t){let n=r=>e.some(a=>a.name===r);return t!==null&&n(t)?t:n("main")?"main":n("master")?"master":null}function uo(e,t){if(t===null)return e;let n=e.findIndex(r=>r.name===t);return n<=0?e:[e[n],...e.slice(0,n),...e.slice(n+1)]}function go(e,t,n){if(t===null)return null;let r=n===null?["main","master"]:[n,"main","master"];for(let a of r){let o=`${t}/${a}`;if(e.some(s=>s.name===o))return o}return null}function fo(e,t,n){let r=[],a=s=>{if(s===null||r.some(l=>l.name===s))return;let i=e.find(l=>l.name===s);i!==void 0&&r.push(i)};a(t),a(n);let o=new Set(r.map(s=>s.name));return{pinned:r,nodes:jn(e.filter(s=>!o.has(s.name)))}}function mo(e){let t={name:"",path:"",dir:!0,children:[]};for(let n of e){let r=n.path.split("/").filter(s=>s!==""),a=t,o="";for(let s=0;s<r.length;s++){let i=r[s];o=o===""?i:`${o}/${i}`;let l=s===r.length-1,d=a.children.find(c=>c.name===i&&c.dir===!l);d===void 0&&(d={name:i,path:o,dir:!l,children:[],...l?{meta:n.meta}:{}},a.children.push(d)),a=d}}return ho(t),yo(t.children)}function ho(e){e.children.sort((t,n)=>t.dir!==n.dir?t.dir?-1:1:t.name.localeCompare(n.name));for(let t of e.children)ho(t)}function yo(e){return e.map(t=>{if(!t.dir)return t;let n=t;for(;n.children.length===1&&n.children[0].dir;){let r=n.children[0];n={name:`${n.name}/${r.name}`,path:r.path,dir:!0,children:r.children}}return{...n,children:yo(n.children)}})}function Ft(e,t,n){if(e===null)return"";let r=typeof e=="number"?e:Date.parse(e);if(!Number.isFinite(r))return"";let a=Math.max(0,t-r),o=Math.floor(a/6e4);if(o<1)return n("time.justNow");if(o<60)return n("time.minutesAgo",{n:o});let s=Math.floor(o/60);if(s<24)return n("time.hoursAgo",{n:s});let i=Math.floor(s/24);return n("time.daysAgo",{n:i})}function Gn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Pn(e){if(e===null)return"";let t=new Date(typeof e=="number"?e:Date.parse(e));if(Number.isNaN(t.getTime()))return"";let n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Un={added:"A",modified:"M",deleted:"D",renamed:"R",untracked:"U",conflicted:"!",typechange:"T"};function cn(e){return e==="added"||e==="untracked"?"gp-status--added":e==="deleted"?"gp-status--deleted":e==="renamed"?"gp-status--renamed":"gp-status--modified"}function bo(e,t){return e.some(n=>n.status==="untracked"&&(n.isDirectory?t.startsWith(`${n.path}/`):n.path===t))}var R=require("react");function vo(e){return/^Binary files .* differ$/m.test(e)||/^GIT binary patch$/m.test(e)}function wo(e){return Mn(e)!==null}function xo(e){return/\.svg$/i.test(e)}function hs(e){let t=e.split(`
814
+ `),n=[],r=!1;for(let a of t){if(a.startsWith("@@")){r=!0;continue}if(r){if(a.startsWith("diff ")||a.startsWith("index ")){r=!1;continue}a!==""&&n.push(a)}}return n}function ko(e){let t=0,n=0;for(let r of hs(e))r.startsWith("+")?t++:r.startsWith("-")&&n++;return{add:t,del:n}}var ys=/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;function _o(e,t){let n=[],r=e.split(`
815
+ `),a=Number.isFinite(t)&&t>0?t:0,o=0,s=0,i=!0,l=!1,d=0;for(;d<r.length&&!r[d].startsWith("@@");d++);for(;d<r.length;d++){let u=r[d];if(u.startsWith("@@")){let g=ys.exec(u);if(g){let w=Number(g[1]),k=Number(g[3]),y=w-k;if(i)k>1&&n.push(Qt({rightStart:1,count:k-1,delta:y,atStart:!0}));else{let x=k-s;x>0&&n.push(Qt({rightStart:s,count:x,delta:y,atStart:!1}))}o=w,s=k,i=!1}n.push({kind:"hunk",leftNo:null,rightNo:null,leftText:null,rightText:null,text:u});continue}if(u.startsWith("\\"))continue;let f=u[0],v=u.slice(1);f==="+"?(n.push({kind:"add",leftNo:null,rightNo:s,leftText:null,rightText:v}),s++,l=!0):f==="-"?(n.push({kind:"del",leftNo:o,rightNo:null,leftText:v,rightText:null}),o++,l=!0):f===" "&&(n.push({kind:"context",leftNo:o,rightNo:s,leftText:v,rightText:v}),o++,s++,l=!0)}let c=a-s+1;return l&&!i&&s>0&&c>0&&n.push(Qt({rightStart:s,count:c,delta:o-s,atStart:!1})),bs(n)}function So(e,t){let n=e[e.length-1],r=n!==void 0&&n.kind==="gap",a=r?n.gap:void 0,o=r?e[e.length-2]:n,s=o===void 0?null:o.rightNo,i=s!==null&&s>0?s:0,l=Number.isFinite(t)?t-i:0,d=l>0?l:0;if(a===void 0){if(d===0||i===0)return e;let c=o===void 0?null:o.leftNo;return c===null?null:[...e,Qt({rightStart:i+1,count:d,delta:c-i,atStart:!1})]}return a.rightStart===i+1&&a.count===d?e:d===0?e.slice(0,-1):[...e.slice(0,-1),Qt({rightStart:i+1,count:d,delta:a.delta,atStart:!1})]}function Qt(e){return{kind:"gap",leftNo:null,rightNo:null,leftText:null,rightText:null,gap:e}}function bs(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind==="del"){let a=[],o=n;for(;o<e.length&&e[o].kind==="del";)a.push(e[o]),o++;let s=[];for(;o<e.length&&e[o].kind==="add";)s.push(e[o]),o++;let i=Math.max(a.length,s.length);for(let l=0;l<i;l++){let d=a[l],c=s[l];if(d&&c){let u=vs(d.leftText??"",c.rightText??"");t.push({kind:"mod",leftNo:d.leftNo,rightNo:c.rightNo,leftText:d.leftText,rightText:c.rightText,...u!==null?{leftWord:u.left,rightWord:u.right}:{}})}else d?t.push({kind:"del",leftNo:d.leftNo,rightNo:null,leftText:d.leftText,rightText:null}):c&&t.push({kind:"add",leftNo:null,rightNo:c.rightNo,leftText:null,rightText:c.rightText})}n=o}else t.push(r),n++}return t}function vs(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r++;let a=0;for(;a<n-r&&e[e.length-1-a]===t[t.length-1-a];)a++;return r===0&&a===0?null:{left:[r,e.length-a],right:[r,t.length-a]}}function ws(e,t,n){return n.map((r,a)=>{let o=t+a;return{kind:"context",leftNo:o+e,rightNo:o,leftText:r,rightText:r}})}var Yt=20;function Co(e){let t=[];for(let n of e)n.kind==="mod"?(t.push({kind:"del",leftNo:n.leftNo,rightNo:null,leftText:n.leftText,rightText:null,...n.leftWord!==void 0?{leftWord:n.leftWord}:{}}),t.push({kind:"add",leftNo:null,rightNo:n.rightNo,leftText:null,rightText:n.rightText,...n.rightWord!==void 0?{rightWord:n.rightWord}:{}})):t.push(n);return t}function To(e,t,n,r,a,o){let s=e.findIndex(u=>u.kind==="gap"&&u.gap?.rightStart===t);if(s<0)return e.slice();let i=e[s].gap,l=ws(i.delta,r,a),d=[],c=i.count;if(n==="all"||a.length>=c)d.push(...l);else if(n==="down")d.push(...l),o||d.push(Qt({rightStart:i.rightStart+a.length,count:c-a.length,delta:i.delta,atStart:!1}));else{if(a.length===0)return[...e.slice(0,s),...e.slice(s+1)];let u=c-a.length;d.push(Qt({rightStart:i.rightStart,count:u,delta:i.delta,atStart:i.atStart})),d.push(...l)}return[...e.slice(0,s),...d,...e.slice(s+1)]}var lr=require("@deepseek-ai/dsh-client-ui-primitives");function No(e,t){let n=[[],[],[]],r=0;for(let a of e){let o=r+a.text.length,s=[r,Math.max(r,Math.min(o,t[0])),Math.max(r,Math.min(o,t[1])),o];for(let i=0;i<3;i++){let l=a.text.slice(s[i]-r,s[i+1]-r);l!==""&&n[i].push({text:l,style:a.style})}r=o}return n}function Eo(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=e(n);return t.size>=8e3&&t.clear(),t.set(n,r),r}}function pn(e){let t=new Array(e.length+1);t[0]=0;for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t}function Mo(e,t){let n=0,r=e.length-1;for(;n<r;){let a=n+r+1>>1;e[a]<=t?n=a:r=a-1}return n}function un(e,t,n,r){let a=e.length-1;if(a<=0)return{first:0,last:0};let o=Mo(e,t-r),s=Math.min(a,Mo(e,t+n+r)+1);return{first:o,last:s}}function Wn(e,t,n,r){return t<0?e:t>=e.first&&t<e.last?{first:Math.min(e.first,Math.max(0,t-r)),last:Math.max(e.last,Math.min(n,t+r))}:{first:Math.max(0,t-r),last:Math.min(n,t+r)}}var Zt=require("react");function gn(){let[e,t]=(0,Zt.useState)({top:0,height:0}),n=(0,Zt.useRef)(null),r=(0,Zt.useRef)(null);return{setEl:(0,Zt.useCallback)(o=>{if(r.current!==null&&(r.current(),r.current=null),n.current=o,o===null)return;let s=()=>t(l=>{let d=o.scrollTop,c=o.clientHeight;return l.top===d&&l.height===c?l:{top:d,height:c}});s(),o.addEventListener("scroll",s,{passive:!0});let i=typeof ResizeObserver<"u"?new ResizeObserver(s):null;i?.observe(o),r.current=()=>{o.removeEventListener("scroll",s),i?.disconnect()}},[]),viewport:e,elRef:n}}var Ye=require("react"),Qn=5e3,Yn=120;function Zn(e,t){let[n,r]=(0,Ye.useState)(e);return(0,Ye.useEffect)(()=>{let a=setTimeout(()=>r(e),t);return()=>clearTimeout(a)},[e,t]),n}function er(e,t){if(t==="")return[];let n=[],r=0;for(;;){let a=e.indexOf(t,r);if(a<0)break;n.push([a,a+t.length]),r=a+t.length}return n}function zr(e,t,n,r,a){if(n>=r)return[];if(e===void 0)return[t.slice(n,r)];let o=[],s=0,i=0;for(let l of e){let d=s+l.text.length,c=Math.max(n,s),u=Math.min(r,d);if(u>c&&o.push((0,Ye.createElement)("span",{key:`${a}-${i++}`,style:l.style},l.text.slice(c-s,u-s))),s=d,s>=r)break}return o}function tr(e,t,n,r,a,o){let s=[],i=0,l=[...t].sort((d,c)=>d[0]-c[0]);for(let[d,c]of l){if(d<i)continue;d>i&&s.push(...zr(n,e,i,d,`${r}b${i}`));let u=a!==null&&a[0]===d&&a[1]===c;s.push((0,Ye.createElement)("mark",{key:`mk${r}-${d}`,className:`gp-find-hit${u?" gp-find-hit--active":""}`,...u?{ref:o}:{}},zr(n,e,d,c,`mk${r}-${d}`))),i=c}return i<e.length&&s.push(...zr(n,e,i,e.length,`${r}e`)),s}function nr(e){return(0,Ye.createElement)("div",{key:"find",className:"gp-find"},[(0,Ye.createElement)("input",{key:"in",ref:e.inputRef,className:"gp-find__input",type:"text",placeholder:e.t("files.findPlaceholder"),value:e.query,spellCheck:!1,"aria-label":e.t("files.findPlaceholder"),onChange:t=>e.onChange(t.target.value),onKeyDown:t=>{t.key==="Escape"?(t.preventDefault(),t.stopPropagation(),e.onClose()):t.key==="Enter"&&(t.preventDefault(),e.onStep(t.shiftKey?-1:1))}}),(0,Ye.createElement)("button",{key:"case",type:"button",className:`gp-find__btn gp-find__case${e.caseSensitive?" gp-find__case--active":""}`,title:e.t("files.findCase"),"aria-label":e.t("files.findCase"),"aria-pressed":e.caseSensitive,onClick:()=>e.onToggleCase()},"Aa"),(0,Ye.createElement)("span",{key:"cnt",className:"gp-find__count"},e.query===""?"":e.matches===0?e.t("files.findNoMatch"):`${e.active+1}/${e.matches}`),(0,Ye.createElement)("button",{key:"prev",type:"button",className:"gp-find__btn",title:e.t("files.findPrev"),"aria-label":e.t("files.findPrev"),disabled:e.matches===0,onClick:()=>e.onStep(-1)},"\u2039"),(0,Ye.createElement)("button",{key:"next",type:"button",className:"gp-find__btn",title:e.t("files.findNext"),"aria-label":e.t("files.findNext"),disabled:e.matches===0,onClick:()=>e.onStep(1)},"\u203A"),(0,Ye.createElement)("button",{key:"x",type:"button",className:"gp-find__btn",title:e.t("files.findClose"),"aria-label":e.t("files.findClose"),onClick:()=>e.onClose()},"\u2715")])}var Ht=require("react");var Q=require("react");var fn=require("react"),xs='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function rr(e,t,n){let r=(0,fn.useRef)(t);(0,fn.useLayoutEffect)(()=>{r.current=t}),(0,fn.useEffect)(()=>{let a=document.activeElement instanceof HTMLElement?document.activeElement:null;n?.current?.focus();let o=()=>{let i=e.current;return i===null?[]:[...i.querySelectorAll(xs)].filter(l=>!l.hasAttribute("disabled")&&l.getClientRects().length>0)},s=i=>{if(i.key==="Escape"){i.stopPropagation(),r.current();return}if(i.key!=="Tab")return;let l=o();if(l.length===0)return;let d=document.activeElement instanceof HTMLElement?document.activeElement:null,c=d===null?-1:l.indexOf(d);i.preventDefault();let u=i.shiftKey?-1:1,f=c===-1?u===-1?l.length-1:0:(c+u+l.length)%l.length;l[f]?.focus()};return window.addEventListener("keydown",s,!0),()=>{window.removeEventListener("keydown",s,!0),a?.focus()}},[e,n])}var zo=require("react-dom");function Po(e){let t=e.deltaMode===1?8:e.deltaMode===2?24:1;return Math.sign(e.deltaY)*Math.min(24,Math.abs(e.deltaY*t))}function Ro(e){let t=Math.sign(e)*Math.min(24,Math.abs(e));return t<=0?1-2*t/100:1/(1+2*t/100)}var ks=.1,_s=8,Fr=1.25;function Lo(e){return Number.isFinite(e)?Math.min(_s,Math.max(ks,e)):1}function Hr(e,t,n){return(e+t)*n-t}var Go=3;function Do(e,t){return e*e+t*t>=Go*Go}function Ao(e,t,n,r){return{left:e-n,top:t-r}}var Ss=300;function Rn({src:e,alt:t,t:n,viewportClass:r,fullscreen:a=!0,onEmptyAreaMouseDown:o}){let s=(0,Q.useRef)(null),i=(0,Q.useRef)(null),l=(0,Q.useRef)(null),[d,c]=(0,Q.useState)(null),[u,f]=(0,Q.useState)("fit"),[v,g]=(0,Q.useState)(null),[w,k]=(0,Q.useState)(!1),[y,x]=(0,Q.useState)(!1),C=(0,Q.useRef)("fit"),T=(0,Q.useRef)(null),F=(0,Q.useRef)(null),M=(0,Q.useRef)(null),E=(0,Q.useRef)(0),J=(0,Q.useCallback)(()=>{let N=l.current;return N===null||N.naturalWidth===0||N.clientWidth===0?null:N.clientWidth/N.naturalWidth},[]),te=(0,Q.useCallback)((N,G,$)=>{let B=i.current,z=l.current;if(B===null||z===null||z.naturalWidth===0||z.clientWidth===0)return;let Y=z.clientWidth/z.naturalWidth,S=Lo(N);if(S===Y)return;let W=B.getBoundingClientRect();T.current={x:G-W.left,y:$-W.top,ratio:S/Y},f(S)},[]),Z=(0,Q.useCallback)(N=>{let G=i.current,$=J();if(G===null||$===null)return;let B=G.getBoundingClientRect();te($*N,B.left+B.width/2,B.top+B.height/2)},[J,te]),I=(0,Q.useCallback)(()=>{let N=i.current;if(N===null)return;let G=N.getBoundingClientRect();te(1,G.left+G.width/2,G.top+G.height/2)},[te]),K=(0,Q.useCallback)(()=>{f("fit")},[]),U=(0,Q.useCallback)(()=>{let N=l.current;N===null||N.naturalWidth===0||N.clientWidth===0||g(Math.round(N.clientWidth/N.naturalWidth*100))},[]);(0,Q.useLayoutEffect)(()=>{C.current=u,u==="fit"&&U();let N=T.current;T.current=null;let G=i.current;N===null||G===null||(G.scrollLeft=Hr(G.scrollLeft,N.x,N.ratio),G.scrollTop=Hr(G.scrollTop,N.y,N.ratio))},[u,U]),(0,Q.useEffect)(()=>{C.current="fit",T.current=null,F.current=null,f("fit"),c(null),g(null)},[e]),(0,Q.useEffect)(()=>{let N=s.current;if(N===null)return;let G=Y=>{if(!Y.ctrlKey)return;Y.cancelable&&Y.preventDefault();let S=l.current;if(S===null||!S.complete||S.naturalWidth===0)return;let W=J();W!==null&&te(W*Ro(Po(Y)),Y.clientX,Y.clientY)},$=Y=>{let S=Y,W=J();W!==null&&(S.cancelable&&S.preventDefault(),F.current={base:W,x:S.clientX,y:S.clientY})},B=Y=>{let S=Y,W=F.current;W!==null&&(S.cancelable&&S.preventDefault(),te(W.base*S.scale,W.x,W.y))},z=()=>{F.current=null};return N.addEventListener("wheel",G,{passive:!1}),N.addEventListener("gesturestart",$,{passive:!1}),N.addEventListener("gesturechange",B,{passive:!1}),N.addEventListener("gestureend",z),()=>{N.removeEventListener("wheel",G),N.removeEventListener("gesturestart",$),N.removeEventListener("gesturechange",B),N.removeEventListener("gestureend",z)}},[J,te]);let se=(0,Q.useCallback)(N=>{if(N.button!==0||N.pointerType!=="mouse")return;let G=i.current;if(G===null)return;let{offsetX:$,offsetY:B}=N.nativeEvent;N.target===G&&($>=G.clientWidth||B>=G.clientHeight)||(M.current={id:N.pointerId,x:N.clientX,y:N.clientY,left:G.scrollLeft,top:G.scrollTop,pan:G.scrollWidth>G.clientWidth||G.scrollHeight>G.clientHeight,moved:!1})},[]);(0,Q.useEffect)(()=>{let N=B=>{let z=M.current;z===null||B!==z.id||(z.moved&&(E.current=performance.now()),M.current=null,x(!1))},G=B=>{let z=M.current;if(z===null||B.pointerId!==z.id)return;if(B.buttons===0){N(B.pointerId);return}let Y=B.clientX-z.x,S=B.clientY-z.y;if(!z.moved){if(!Do(Y,S))return;z.moved=!0,x(!0)}let W=i.current;if(W===null||!z.pan)return;let be=Ao(z.left,z.top,Y,S);W.scrollLeft=be.left,W.scrollTop=be.top},$=B=>{N(B.pointerId)};return window.addEventListener("pointermove",G),window.addEventListener("pointerup",$),window.addEventListener("pointercancel",$),()=>{window.removeEventListener("pointermove",G),window.removeEventListener("pointerup",$),window.removeEventListener("pointercancel",$)}},[]),(0,Q.useEffect)(()=>{let N=i.current;if(N===null||typeof ResizeObserver>"u")return;let G=new ResizeObserver(()=>{C.current==="fit"&&U()});return G.observe(N),()=>G.disconnect()},[U]);let de=(0,Q.useCallback)(()=>{let N=l.current;N!==null&&(c({w:N.naturalWidth,h:N.naturalHeight}),C.current==="fit"&&U())},[U]),L=(0,Q.useCallback)(()=>{performance.now()-E.current<Ss||(u==="fit"?I():K())},[u,I,K]),ne=(0,Q.useCallback)(()=>{k(!1)},[]),ae=u==="fit"?v!==null?`${v}%`:"\u2014":`${Math.round(u*100)}%`,oe=u!=="fit"&&d!==null?{width:`${d.w*u}px`,maxWidth:"none",maxHeight:"none"}:void 0,H=d!==null?(0,Q.createElement)("div",{key:"bar",className:"gp-zoom__bar",role:"group","aria-label":n("files.zoomBar")},[(0,Q.createElement)("button",{key:"out",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomOut"),title:n("files.zoomOut"),onClick:()=>Z(1/Fr)},"\u2212"),(0,Q.createElement)("button",{key:"pct",type:"button",className:"gp-zoom__btn gp-zoom__pct","aria-label":`${ae}\uFF0C${n("files.zoomActual")}`,title:n("files.zoomActual"),onClick:I},ae),(0,Q.createElement)("button",{key:"in",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomIn"),title:n("files.zoomIn"),onClick:()=>Z(Fr)},"+"),(0,Q.createElement)("button",{key:"fit",type:"button",className:"gp-zoom__btn gp-zoom__btn--text","aria-pressed":u==="fit",onClick:K},n("files.zoomFit")),a?(0,Q.createElement)("button",{key:"fs",type:"button",className:"gp-zoom__btn","aria-label":n("files.zoomFullscreen"),title:n("files.zoomFullscreen"),onClick:()=>k(!0)},"\u2921"):null]):null;return(0,Q.createElement)("div",{className:"gp-zoom",ref:s,"data-zoomed":u==="fit"?void 0:"true","data-dragging":y?"true":void 0},[(0,Q.createElement)("div",{key:"vp",className:`gp-zoom__scroll ${r}`,ref:i,onPointerDown:se,onMouseDown:o===void 0?void 0:N=>{N.target===N.currentTarget&&o()}},(0,Q.createElement)("img",{key:"img",ref:l,className:"gp-zoom__img",src:e,alt:t,style:oe,draggable:!1,onLoad:de,onDoubleClick:L})),H,w?(0,Q.createElement)(Cs,{key:"lb",src:e,alt:t,t:n,onClose:ne}):null])}function Cs({src:e,alt:t,t:n,onClose:r}){let a=(0,Q.useRef)(null),o=(0,Q.useRef)(null);return rr(a,r,o),(0,zo.createPortal)((0,Q.createElement)("div",{className:"gp-zl-backdrop",ref:a,role:"dialog","aria-modal":"true","aria-label":n("files.zoomFullscreen")},[(0,Q.createElement)("div",{key:"stage",className:"gp-zl-stage"},[(0,Q.createElement)("div",{key:"mask",className:"gp-zl-mask","aria-hidden":"true",onMouseDown:r}),(0,Q.createElement)("div",{key:"frame",className:"gp-zl-frame"},(0,Q.createElement)(Rn,{src:e,alt:t,t:n,viewportClass:"gp-zl-viewport",fullscreen:!1,onEmptyAreaMouseDown:r})),(0,Q.createElement)("button",{key:"close",ref:o,type:"button",className:"gp-zl-close","aria-label":n("common.close"),onClick:r},(0,Q.createElement)(gt,{size:16}))])]),document.body)}function ar(e,t,n){let r=n(`diff.${e}`);return(0,Ht.createElement)("div",{className:`gp-imgcmp__pane gp-imgcmp__pane--${e}`},[(0,Ht.createElement)("div",{key:"head",className:"gp-imgcmp__head"},r),t===void 0?(0,Ht.createElement)("div",{key:"missing",className:"gp-imgcmp__missing"},n("diff.imageMissing")):(0,Ht.createElement)(Rn,{key:"img",src:t,alt:r,t:n,viewportClass:"gp-imgcmp__img"})])}function Fo({oldUrl:e,newUrl:t,mode:n,t:r}){return n==="before"?(0,Ht.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ar("before",e,r)):n==="after"?(0,Ht.createElement)("div",{className:"gp-imgcmp gp-imgcmp--single"},ar("after",t,r)):(0,Ht.createElement)("div",{className:"gp-imgcmp"},[ar("before",e,r),ar("after",t,r)])}var Ho=require("react");var Tt=require("react");function Bt(e,t,n,r){let a=JSON.stringify(e),o=(0,Tt.useRef)({key:a,visible:t,load:n,onError:r});o.current={key:a,visible:t,load:n,onError:r};let s=(0,Tt.useRef)(!0),i=(0,Tt.useRef)(0),l=(0,Tt.useRef)(null);(0,Tt.useEffect)(()=>(s.current=!0,()=>{s.current=!1,i.current+=1,l.current=null}),[]);let d=(0,Tt.useCallback)(()=>{let c=o.current;if(!s.current||!c.visible||!Qe.isVisible())return Promise.resolve();if(l.current?.key===c.key)return l.current.promise;let u=++i.current,f=()=>s.current&&u===i.current&&o.current.key===c.key,v=()=>f()&&o.current.visible&&Qe.isVisible(),g=c.load(f,v).catch(()=>{f()&&c.onError()}).finally(()=>{l.current?.promise===g&&(l.current=null)});return l.current={key:c.key,promise:g},g},[]);return(0,Tt.useEffect)(()=>{t&&d()},[a,t,d]),d}function Bo(e,t,n,r,a,o){let s=[t,n,r,a],[i,l]=(0,Ho.useState)({queryKey:s,value:{kind:"idle"}}),d=c=>c.length===s.length&&c.every((u,f)=>u===s[f]);return Bt(s,o&&e!==void 0&&t!==void 0&&n!==void 0&&r!==void 0,async c=>{if(e===void 0||t===void 0||n===void 0||r===void 0)return;l(g=>d(g.queryKey)&&g.value.kind==="ready"?g:{queryKey:s,value:{kind:"loading"}});let u=r==="commit"&&a!==void 0?{kind:"image-diff",path:n,base:"commit",commit:a}:r==="staged"?{kind:"image-diff",path:n,base:"staged"}:{kind:"image-diff",path:n,base:"worktree"},f=await e.query({sessionId:t,query:u});if(!c())return;let v=ve(f,"image-diff");l({queryKey:s,value:v!==null?{kind:"ready",res:v}:{kind:"failed"}})},()=>l({queryKey:s,value:{kind:"failed"}})),d(i.queryKey)?i.value:{kind:"idle"}}var Dt=require("react");function At({text:e,closeLabel:t,onClose:n,status:r=!1}){return(0,Dt.createElement)("div",{className:"gp-notice",...r?{role:"status"}:{}},[(0,Dt.createElement)("span",{key:"txt",className:"gp-notice__text"},e),(0,Dt.createElement)("button",{key:"close",type:"button",className:"gp-notice__close",title:t,"aria-label":t,onClick:n},(0,Dt.createElement)(gt,{key:"i",size:12}))])}function or(){let[e,t]=(0,Dt.useState)(()=>new Set);return(0,Dt.useMemo)(()=>({isDismissed:n=>e.has(n),dismiss:n=>t(r=>r.has(n)?r:new Set(r).add(n))}),[e])}var Br=20,Ts=27,Ns=29,Io=12,Es=600,dr=(0,R.memo)(function({visible:t=!0,text:n,mode:r,path:a,remote:o,sessionId:s,base:i,commit:l,expanded:d,truncated:c,newLines:u,t:f}){let v=or(),g=(0,R.useMemo)(()=>_o(n,u),[n,u]),w=vo(n),k=(0,lr.useCodeHighlighter)(a===void 0?void 0:(0,lr.languageForPath)(a)),y=(0,R.useMemo)(()=>Eo(k),[k]),[x,C]=(0,R.useState)(g),T=(0,R.useRef)(n);(0,R.useEffect)(()=>{if(T.current!==n){T.current=n,C(g);return}C(ee=>So(ee,u)??g)},[n,u,g]);let F=Rs(x,C,o,s,a,i,l),M=a!==void 0&&xo(a),[E,J]=(0,R.useState)("render");(0,R.useEffect)(()=>{J("render")},[a]);let Z=(w||M)&&a!==void 0&&wo(a)&&o!==void 0&&s!==void 0&&i!==void 0&&(!M||E==="render"),I=Bo(Z?o:void 0,Z?s:void 0,Z?a:void 0,Z?i:void 0,Z?l:void 0,t),[K,U]=(0,R.useState)(!1),[se,de]=(0,R.useState)(""),[L,ne]=(0,R.useState)(!1),[ae,oe]=(0,R.useState)(0),H=(0,R.useRef)(null),N=(0,R.useRef)(null),G=(0,R.useRef)(null);(0,R.useEffect)(()=>{U(!1),de(""),oe(0)},[n,a]);let $=(0,R.useMemo)(()=>r==="unified"?Co(x):null,[r,x]),B=(0,R.useMemo)(()=>r==="before"?Ds(x):r==="after"?As(x):null,[r,x]),z=(0,R.useMemo)(()=>Gs(x,$,B),[x,$,B]),Y=(0,R.useMemo)(()=>z.map(ee=>({key:ee.key,text:ee.text.toLowerCase()})),[z]),S=Zn(se,Yn),W=L?S:S.toLowerCase(),be=L?z:Y,ke=(0,R.useMemo)(()=>Ps(be,W),[be,W]);(0,R.useEffect)(()=>{oe(0)},[W]);let Le=ke.length===0?0:Math.min(ae,ke.length-1),De=ke.length>0?ke[Le]:null,Te=De?.cellKey??null,Fe=De?.start??-1,Je=(0,R.useMemo)(()=>{let ee=new Map;for(let V of ke){let he=ee.get(V.cellKey)??[];he.push([V.start,V.end]),ee.set(V.cellKey,he)}return ee},[ke]);(0,R.useEffect)(()=>{if(Te===null)return;let ee=requestAnimationFrame(()=>G.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(ee)},[Le,ke,Te,Fe]);let ft=(0,R.useCallback)(ee=>{oe(V=>ke.length===0?0:(V+ee+ke.length)%ke.length)},[ke.length]);(0,R.useEffect)(()=>{let ee=V=>{if(!((V.ctrlKey||V.metaKey)&&(V.key==="f"||V.key==="F")))return;let he=H.current;he===null||he.offsetParent===null||(V.preventDefault(),U(!0),requestAnimationFrame(()=>N.current?.select()))};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[]);let{setEl:xt,viewport:Ze,elRef:Ve}=gn(),Oe=(0,R.useRef)(null),[et,O]=(0,R.useState)(0),[pe,me]=(0,R.useState)(0),le=(0,R.useRef)({mode:r,rows:x,heights:[]});(le.current.mode!==r||le.current.rows!==x)&&(le.current={mode:r,rows:x,heights:[]});let Ne=le.current.heights,He=$!==null?$.length:B!==null?B.length:x.length,Ge=(0,R.useCallback)(ee=>{let V=$!==null?$[ee]??null:B===null?x[ee]??null:null;return V===null?Br:V.kind==="hunk"?Ts:V.kind==="gap"?Ns:Br},[$,B,x]),mt=(0,R.useMemo)(()=>{let ee=new Array(He);for(let V=0;V<He;V++){let he=Ne[V];ee[V]=he!==void 0&&he>0?he:Ge(V)}return ee},[He,Ne,Ge,pe]),Be=(0,R.useMemo)(()=>pn(mt),[mt]),Nt=Ze.height>0?Ze.height:Es,{first:dt,last:ct}=un(Be,Math.max(0,Ze.top-et),Nt,Io*Br),Se=Te===null?-1:Ms(Te),{first:ht,last:qe}=Wn({first:dt,last:ct},Se,He,Io);if((0,R.useLayoutEffect)(()=>{let ee=Oe.current,V=Ve.current;if(ee===null||V===null)return;let he=ee.getBoundingClientRect().top-V.getBoundingClientRect().top+V.scrollTop;Math.abs(he-et)>.5&&O(he);let tt=new Map;for(let We of ee.querySelectorAll("[data-r]")){let ut=Number(We.dataset.r),b=We.getBoundingClientRect().height;if(!Number.isFinite(b)||b<=0)continue;let ye=tt.get(ut);(ye===void 0||b>ye)&&tt.set(ut,b)}let _t=!1;for(let[We,ut]of tt){let b=Ne[We];(b===void 0||Math.abs(b-ut)>.5)&&(Ne[We]=ut,_t=!0)}_t&&me(We=>We+1)}),Z){let ee=(()=>{if(I.kind==="idle"||I.kind==="loading")return(0,R.createElement)("div",{className:"gp-empty"},f("common.loading"));if(I.kind==="ready"){let V=I.res;if(V.tooLarge===!0)return(0,R.createElement)("div",{className:"gp-empty"},f("diff.tooLarge"));if(V.mime!==null&&(V.old!==void 0||V.new!==void 0))return(0,R.createElement)(Fo,{oldUrl:V.old,newUrl:V.new,mode:r,t:f})}return(0,R.createElement)("div",{className:"gp-empty"},f("diff.binary"))})();return M?Oo(E,J,ee,f):ee}if(w&&!M)return(0,R.createElement)("div",{className:"gp-empty"},f("diff.binary"));let pt=K&&W!==""?{perCell:Je,activeKey:Te,activeRange:De!==null?[De.start,De.end]:null,activeRef:G}:null,Et=(ee,V)=>V>.5?(0,R.createElement)("div",{key:ee,className:"gp-diff__spacer",style:{gridColumn:"1 / -1",height:`${V}px`}}):null,kt=Et("lead",Be[ht]),je=Et("tail",Be[He]-Be[qe]),Mt=(()=>{if(n.trim()==="")return(0,R.createElement)("div",{className:"gp-empty"},f("diff.empty"));if(B!==null){let V=[kt];for(let he=ht;he<qe;he++){let tt=B[he];V.push((0,R.createElement)("div",{key:`n${he}`,className:"gp-diff-no"},tt.no??"")),V.push(sr("gp-diff-cell",`c${he}`,tt.text,y,pt,he))}return V.push(je),(0,R.createElement)("div",{className:"gp-diff__single",ref:Oe},V)}if($!==null){let V=[kt];for(let he=ht;he<qe;he++)V.push(...Fs($[he],he,y,F,pt,f));return V.push(je),(0,R.createElement)("div",{className:"gp-diff__unified",ref:Oe},V)}let ee=[kt];for(let V=ht;V<qe;V++)ee.push(...zs(x[V],V,y,F,pt,f));return ee.push(je),(0,R.createElement)("div",{className:"gp-diff__side",ref:Oe},ee)})(),ie=K?(0,R.createElement)(nr,{inputRef:N,query:se,matches:ke.length,active:Le,caseSensitive:L,onChange:de,onToggleCase:()=>ne(ee=>!ee),onStep:ft,onClose:()=>U(!1),t:f}):null,Ue=d===!0&&x.some(ee=>ee.kind==="gap"),Ie=f("diff.truncated"),Gt=f("diff.expandCapped",{n:2e3}),Ae=ee=>`${a??""}\0${ee}`,yt=(0,R.createElement)("div",{className:"gp-diff__wrap",ref:H},[ie,c===!0&&!v.isDismissed(Ae(Ie))?(0,R.createElement)(At,{key:"truncated",text:Ie,closeLabel:f("common.close"),onClose:()=>v.dismiss(Ae(Ie))}):null,Ue&&!v.isDismissed(Ae(Gt))?(0,R.createElement)(At,{key:"capped",text:Gt,closeLabel:f("common.close"),onClose:()=>v.dismiss(Ae(Gt))}):null,(0,R.createElement)("div",{key:"scroll",className:"gp-diff__scroll",ref:xt},Mt)]);return M?Oo(E,J,yt,f):yt});function Ms(e){let t=Number(e.slice(1));return Number.isFinite(t)?t:-1}function Gs(e,t,n){let r=[];return n!==null?(n.forEach((a,o)=>r.push({key:`c${o}`,text:a.text})),r):t!==null?(t.forEach((a,o)=>{if(a.kind==="hunk"||a.kind==="gap")return;let s=a.rightText??a.leftText??"";s!==""&&r.push({key:`c${o}`,text:s})}),r):(e.forEach((a,o)=>{a.kind==="hunk"||a.kind==="gap"||(a.leftText!==null&&a.leftText!==""&&r.push({key:`l${o}`,text:a.leftText}),a.rightText!==null&&a.rightText!==""&&r.push({key:`r${o}`,text:a.rightText}))}),r)}function Ps(e,t){if(t==="")return[];let n=[];for(let r of e)for(let[a,o]of er(r.text,t))if(n.push({cellKey:r.key,start:a,end:o}),n.length>=Qn)return n;return n}function Oo(e,t,n,r){let a=(o,s)=>(0,R.createElement)("button",{key:o,type:"button",className:`gp-seg__btn${e===o?" gp-seg__btn--active":""}`,"aria-pressed":e===o,onClick:()=>t(o)},s);return(0,R.createElement)("div",{className:"gp-svgdiff"},[(0,R.createElement)("div",{key:"bar",className:"gp-svgdiff__bar"},(0,R.createElement)("div",{className:"gp-seg"},[a("render",r("diff.svgRender")),a("source",r("diff.svgSource"))])),(0,R.createElement)("div",{key:"body",className:"gp-svgdiff__body"},n)])}function Rs(e,t,n,r,a,o,s){let[i,l]=(0,R.useState)(null),d=(0,R.useRef)(0);(0,R.useEffect)(()=>{d.current+=1,l(null)},[e]);let c=(0,R.useCallback)((u,f)=>{if(n===void 0||r===void 0||a===void 0||o===void 0)return;let v=`${u.rightStart}:${f}`;l(v);let g=++d.current,{start:w,end:k}=Ls(u,f),y=o==="commit"&&s!==void 0?{kind:"file-lines",path:a,base:"commit",commit:s,start:w,end:k}:o==="staged"?{kind:"file-lines",path:a,base:"staged",start:w,end:k}:{kind:"file-lines",path:a,base:"worktree",start:w,end:k};n.query({sessionId:r,query:y}).then(x=>{if(g!==d.current)return;let C=ve(x,"file-lines");l(null),C!==null&&t(T=>To(T,u.rightStart,f,C.start,C.lines,C.eof))}).catch(()=>{g===d.current&&l(null)})},[n,r,a,o,s,t]);return{busy:i,run:c}}function Ls(e,t){let n=e.count;return t==="all"||n<=Yt?{start:e.rightStart,end:e.rightStart+n-1}:t==="down"?{start:e.rightStart,end:e.rightStart+Yt-1}:{start:e.rightStart+n-Yt,end:e.rightStart+n-1}}function ir(e,t=""){return e.map((n,r)=>(0,R.createElement)("span",{key:`${t}${r}`,style:n.style},n.text))}function $o(e,t,n,r){if(n===null)return null;let a=n.perCell.get(t);if(a===void 0||a.length===0)return null;let o=n.activeKey===t?n.activeRange:null;return tr(e,a,r,t,o,n.activeRef)}function sr(e,t,n,r,a=null,o=-1){let s={key:t,className:e,"data-r":o>=0?o:void 0};if(n==="")return(0,R.createElement)("div",s,"\xA0");let i=r(n)?.[0],l=$o(n,t,a,i);return l!==null?(0,R.createElement)("div",s,l):(0,R.createElement)("div",s,i===void 0?n:ir(i))}function Ir(e,t,n,r,a,o,s=null,i=-1){let l={key:t,className:e,"data-r":i>=0?i:void 0},d=o(n)?.[0]??[{text:n,style:{}}],c=$o(n,t,s,d);if(c!==null)return(0,R.createElement)("div",l,c);let[u,f,v]=No(d,r);return(0,R.createElement)("div",l,[...ir(u,"p"),(0,R.createElement)("span",{key:"w",className:a},f.length===0?"\xA0":ir(f)),...ir(v,"s")])}function Ds(e){return e.filter(t=>t.leftText!==null).map(t=>({no:t.leftNo,text:t.leftText}))}function As(e){return e.filter(t=>t.rightText!==null).map(t=>({no:t.rightNo,text:t.rightText}))}function zs(e,t,n,r,a,o){if(e.kind==="hunk")return[(0,R.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[Xo(e.gap,t,r,o)];let s=e.kind==="del"||e.kind==="mod"?"gp-diff-row--del":"",i=e.kind==="add"||e.kind==="mod"?"gp-diff-row--add":"",l=e.leftText===null?(0,R.createElement)("div",{key:`l${t}`,className:`gp-diff-cell ${s}`}):e.kind==="mod"&&e.leftWord!==void 0?Ir(`gp-diff-cell ${s}`,`l${t}`,e.leftText,e.leftWord,"gp-diff-word gp-diff-word--del",n,a,t):sr(`gp-diff-cell ${s}`,`l${t}`,e.leftText,n,a,t),d=e.rightText===null?(0,R.createElement)("div",{key:`r${t}`,className:`gp-diff-cell ${i}`}):e.kind==="mod"&&e.rightWord!==void 0?Ir(`gp-diff-cell ${i}`,`r${t}`,e.rightText,e.rightWord,"gp-diff-word gp-diff-word--add",n,a,t):sr(`gp-diff-cell ${i}`,`r${t}`,e.rightText,n,a,t);return[(0,R.createElement)("div",{key:`ln${t}`,className:"gp-diff-no"},e.leftNo??""),l,(0,R.createElement)("div",{key:`rn${t}`,className:"gp-diff-no"},e.rightNo??""),d]}function Fs(e,t,n,r,a,o){if(e.kind==="hunk")return[(0,R.createElement)("div",{key:`h${t}`,className:"gp-diff-row--hunk gp-diff-cell",style:{gridColumn:"1 / -1"},"data-r":t},e.text??"")];if(e.kind==="gap")return[Xo(e.gap,t,r,o)];let s=e.kind==="del",i=e.kind==="add",l=i?"gp-diff-row--add":s?"gp-diff-row--del":"",d=i?"+":s?"\u2212":"\xA0",c=e.rightText??e.leftText??"",u=i?e.rightWord:s?e.leftWord:void 0,f=i?"gp-diff-word gp-diff-word--add":"gp-diff-word gp-diff-word--del",v=`gp-diff-cell gp-diff-uni__code ${l}`,g=u!==void 0?Ir(v,`c${t}`,c,u,f,n,a,t):sr(v,`c${t}`,c,n,a,t);return[(0,R.createElement)("div",{key:`ol${t}`,className:"gp-diff-no"},e.leftNo??""),(0,R.createElement)("div",{key:`nl${t}`,className:"gp-diff-no"},e.rightNo??""),(0,R.createElement)("div",{key:`sg${t}`,className:`gp-diff-uni__sign ${l}`},d),g]}function Xo(e,t,n,r){let a=n.busy===`${e.rightStart}:all`,o=n.busy===`${e.rightStart}:up`,s=n.busy===`${e.rightStart}:down`,i=(c,u,f)=>(0,R.createElement)("button",{key:c,type:"button",className:"gp-gap__btn",disabled:n.busy!==null,onClick:v=>{v.stopPropagation(),n.run(e,c)}},f?r("common.loading"):u),l=[],d=e.count;return d<=Yt?l.push(i("all",r("diff.expandGap",{n:d}),a)):(e.atStart||l.push(i("up",r("diff.expandUp",{n:Yt}),o)),l.push(i("all",r("diff.expandGap",{n:d}),a)),l.push(i("down",r("diff.expandDown",{n:Yt}),s))),(0,R.createElement)("div",{key:`g${t}`,className:"gp-diff-row--gap",style:{gridColumn:"1 / -1"},"data-r":t},l)}function cr(e){return ko(e)}var re=require("react");var Hs=100;function Ko(e,t,n,r=!0){let[a,o]=(0,re.useState)(null),[s,i]=(0,re.useState)(!1),[l,d]=(0,re.useState)([]),c=Bt([t,...n],r,async(u,f)=>{i(!1);let[v,g]=await Promise.all([e.query({sessionId:t,query:{kind:"branches"}}),e.query({sessionId:t,query:{kind:"tags"}})]);if(!u())return;let w=ve(v,"branches"),k=ve(g,"tags");if(w===null){i(!0);return}if(o({current:w.current,defaultBranch:w.defaultBranch,local:w.local,remote:w.remote,tags:k?.tags??a?.tags??[]}),!f())return;let y=await e.query({sessionId:t,query:{kind:"authors"}});if(!u())return;let x=ve(y,"authors");d(x?.authors??[])},()=>i(!0));return{tree:a,treeError:s,authors:l,reload:c}}var Jo=2e4;function Bs(e,t,n){if(t===void 0)return e;let r=n.map(l=>({hash:l.hash,parents:l.parents})),a=new Set(r.map(l=>l.hash)),o=new Map;for(let l of[...e??[],...t])a.has(l.hash)||(o.delete(l.hash),o.set(l.hash,l.parents));let s=[...o],i=s.length>Jo?s.slice(s.length-Jo):s;return[...r,...i.map(([l,d])=>({hash:l,parents:d}))]}function Vo(e,t,n,r,a,o=!0){let[s,i]=(0,re.useState)({commits:[],topology:void 0,total:0,appliedFilter:n}),{commits:l,topology:d,total:c,appliedFilter:u}=s,[f,v]=(0,re.useState)(!1),[g,w]=(0,re.useState)(!1),k=(0,re.useRef)(0),y=(0,re.useRef)(!1),x=(0,re.useRef)(s),C=(0,re.useRef)(!1),T=(0,re.useRef)(()=>!1),F=(0,re.useRef)(o);F.current=o;let M=(0,re.useRef)(null),E=(0,re.useCallback)(async(I,K,U)=>{if(y.current)return;y.current=!0;let se=k.current;v(!0),w(!1);let de=await e.query({sessionId:t,query:{kind:"history",limit:Hs,skip:I,...K.ref?{ref:K.ref}:{},...K.search?{search:K.search}:{},...K.author?{author:K.author}:{},...K.since?{since:K.since}:{}}});if(!U()||se!==k.current)return;y.current=!1,v(!1);let L=ve(de,"history");if(L===null){w(!0);return}let ne=x.current,ae=I===0?L.commits:[...ne.commits,...L.commits],oe={commits:ae,topology:Bs(I===0?void 0:ne.topology,L.topology,ae),total:L.total,appliedFilter:K};x.current=oe,C.current=!0,i(oe)},[e,t]),J=(0,re.useRef)(n);Bt([t,...r,n.ref,n.search,n.author,n.since],o,async I=>{k.current+=1,y.current=!1,T.current=I,C.current=!1,J.current!==n&&(J.current=n,a(),M.current&&(M.current.scrollTop=0)),await E(0,n,I)},()=>{y.current=!1,v(!1),w(!0)});let te=c<0?!0:l.length<c,Z=(0,re.useCallback)(()=>{if(!F.current||!Qe.isVisible()||y.current||!C.current||!te||!T.current())return;let I=T.current;E(l.length,n,I).catch(()=>{I()&&(y.current=!1,v(!1),w(!0))})},[E,l.length,n,te]);return{commits:l,topology:d,appliedFilter:u,total:c,loading:f,listError:g,hasMore:te,listRef:M,loadMore:Z}}function qo(e,t,n,r=!0){let[a,o]=(0,re.useState)(null),[s,i]=(0,re.useState)(null),[l,d]=(0,re.useState)(!1),[c,u]=(0,re.useState)(null),[f,v]=(0,re.useState)(null),[g,w]=(0,re.useState)(!1),[k,y]=(0,re.useState)(n),[x,C]=(0,re.useState)(!1),T=(0,re.useRef)(0),F=(0,re.useRef)(null),M=(0,re.useRef)(new Map),E=(0,re.useCallback)((G,$)=>{let B=M.current;for(B.set(G,$);B.size>50;){let z=B.keys().next().value;if(z===void 0)break;B.delete(z)}},[]),J=(0,re.useCallback)(()=>{o(null),i(null),F.current=null},[]),te=(0,re.useCallback)(G=>{F.current===G.hash&&o(G)},[]),Z=(0,re.useCallback)(async G=>{F.current=G.hash,o(G),d(!1),T.current+=1,u(null),v(null),w(!1);let $=M.current.get(G.hash);if($!==void 0){i($);return}i(null);let B=await e.query({sessionId:t,query:{kind:"show",ref:G.hash}});if(F.current!==G.hash)return;let z=ve(B,"show");if(z!==null){let Y={commit:z.commit,body:z.body,stats:z.stats,insertions:z.insertions,deletions:z.deletions};E(G.hash,Y),i(Y)}else d(!0)},[e,t,E]),I=(0,re.useCallback)(async(G,$,B,z=!1)=>{let Y=++T.current;u({path:G,hash:$,shortHash:B}),v(null),w(!1),C(z);let S=await e.query({sessionId:t,query:{kind:"diff",path:G,base:"commit",commit:$,...z?{context:2e3}:{}}});if(Y!==T.current)return;let W=ve(S,"diff");W!==null?v({text:W.text,newLines:W.newLines,truncated:W.truncated}):w(!0)},[e,t]),K=(0,re.useCallback)(()=>{T.current+=1,u(null),v(null),w(!1),C(!1)},[]);(0,re.useEffect)(()=>{if(c===null)return;let G=$=>{$.key==="Escape"&&K()};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[c,K]);let[U,se]=(0,re.useState)(null),[de,L]=(0,re.useState)(null),ne=(0,re.useRef)(void 0),ae=(0,re.useRef)(null),oe=(0,re.useRef)(r);oe.current=r;let H=(0,re.useCallback)((G,$,B)=>{ne.current!==void 0&&clearTimeout(ne.current),ne.current=setTimeout(()=>{if(!oe.current||!Qe.isVisible())return;ae.current=G.hash,se({commit:G,x:$,y:B});let z=M.current.get(G.hash);if(z!==void 0){L(z.body);return}L(null),e.query({sessionId:t,query:{kind:"show",ref:G.hash}}).then(Y=>{if(ae.current!==G.hash)return;let S=ve(Y,"show");S!==null?(E(G.hash,{commit:S.commit,body:S.body,stats:S.stats,insertions:S.insertions,deletions:S.deletions}),L(S.body)):L("")})},260)},[e,t,E]),N=(0,re.useCallback)(()=>{ne.current!==void 0&&clearTimeout(ne.current),ae.current=null,se(null),L(null)},[]);return(0,re.useEffect)(()=>{r||N()},[r,N]),(0,re.useEffect)(()=>()=>{ne.current!==void 0&&clearTimeout(ne.current)},[]),{selected:a,detail:s,detailError:l,select:Z,resyncSelected:te,clearSelection:J,fileDiff:c,fileDiffData:f,fileDiffError:g,fileDiffMode:k,setFileDiffMode:y,fileDiffExpanded:x,openFileDiff:I,closeFileDiff:K,hover:U,hoverBody:de,onHoverEnter:H,onHoverLeave:N}}var vt=require("react"),Is=(e,t,n)=>Math.max(t,Math.min(n,e));function Os(e,t){try{let n=typeof localStorage<"u"?localStorage.getItem(e):null,r=n===null?NaN:Number(n);return Number.isFinite(r)?r:t}catch{return t}}function $s(e,t){try{typeof localStorage<"u"&&localStorage.setItem(e,String(Math.round(t)))}catch{}}function en(e){let{storageKey:t,initial:n,min:r,reserve:a,edge:o}=e,[s,i]=(0,vt.useState)(()=>Os(t,n)),l=(0,vt.useRef)(null),d=(0,vt.useRef)(null),c=(0,vt.useCallback)(f=>{let g=l.current?.parentElement?.clientWidth??Number.MAX_SAFE_INTEGER;d.current={x:f.clientX,w:s,max:Math.max(r,g-a)},f.preventDefault(),typeof document<"u"&&(document.body.style.cursor="col-resize",document.body.style.userSelect="none")},[s,r,a]);(0,vt.useEffect)(()=>{if(typeof window>"u")return;let f=g=>{let w=d.current;if(w===null)return;let k=g.clientX-w.x;i(Is(w.w+(o==="end"?k:-k),r,w.max))},v=()=>{d.current!==null&&(d.current=null,typeof document<"u"&&(document.body.style.cursor="",document.body.style.userSelect=""),i(g=>($s(t,g),g)))};return window.addEventListener("pointermove",f),window.addEventListener("pointerup",v),()=>{window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",v)}},[o,r,t]);let u=(0,vt.createElement)("div",{key:`rz-${t}`,ref:l,className:"gp-resizer",role:"separator","aria-orientation":"vertical",onPointerDown:c});return{width:s,divider:u}}var jo=require("react");function It(e,t,n,r,a=!1){return e.map(o=>(0,jo.createElement)("button",{key:o,type:"button",className:`gp-seg__btn${t===o?" gp-seg__btn--active":""}`,...a?{disabled:!0}:{},onClick:()=>n(o)},r(o)))}var Ee=require("react"),Uo=require("react-dom");function tn(e,t,n){switch(e){case"empty-message":return n("error.emptyMessage");case"not-a-git-repo":return n("error.notARepo");case"cwd-unavailable":return n("error.noCwd");case"local-changes-block":return n("error.localChangesBlock");case"not-ff":return n("error.notFastForward");case"push-rejected":return n("error.pushRejected");case"auth-failed":return n("error.authFailed");case"conflict":return n("error.conflict");case"revert-conflict":return n("error.revertConflict");case"revert-stuck":return n("error.revertStuck");case"revert-merge":return n("error.revertMerge");case"index-busy":return n("error.indexBusy");case"not-found":return n("error.notFound");case"branch-in-use":return n("error.branchInUse");case"nested-repo":return n("error.nestedRepo");case"nested-repo-partial":return n("error.nestedRepoPartial");case"stash-switch-failed":return n("error.stashSwitchFailed",{reason:t??""});case"invalid-name":case"invalid-index":return n("error.invalidName");default:return t??n("error.generic")}}function mn(e){return(0,Ee.createElement)("div",{key:"aihint",className:"gp-modal__hint"},e("ops.aiHint"))}function hn(e){return(0,Ee.createElement)("div",{key:"footer",className:"gp-modal__footer"},[(0,Ee.createElement)("button",{key:"cancel",type:"button",className:"gp-btn",onClick:e.onClose},e.t("common.cancel")),(0,Ee.createElement)("button",{key:"ok",type:"button",className:`gp-btn ${e.danger?"gp-btn--danger":"gp-btn--primary"}`,disabled:e.confirmDisabled,onClick:e.onConfirm},e.confirmLabel)])}function Ot(e){return typeof document>"u"?null:(0,Ee.createElement)(Xs,e)}function Xs({onClose:e,title:t,icon:n,hash:r,body:a,footer:o,overlay:s,portalKey:i,t:l}){let d=s!=null;(0,Ee.useEffect)(()=>{let u=f=>{f.key==="Escape"&&!d&&e()};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[e,d]);let c=(0,Ee.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{!d&&u.target===u.currentTarget&&e()}},(0,Ee.createElement)("div",{className:"gp-modal gp-modal--sm",role:"dialog","aria-modal":!0},[(0,Ee.createElement)("div",{key:"bar",className:"gp-modal__bar"},[n!==void 0?(0,Ee.createElement)("span",{key:"ic",className:"gp-modal__fileicon"},n):null,(0,Ee.createElement)("span",{key:"title",className:"gp-modal__path"},t),r!==void 0?(0,Ee.createElement)("span",{key:"hash",className:"gp-modal__hash"},r):null,(0,Ee.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),disabled:d,onClick:e},(0,Ee.createElement)(gt,{size:15}))]),(0,Ee.createElement)("div",{key:"body",className:"gp-modal__form"},a),o,s??null]));return(0,Uo.createPortal)(c,document.body,i)}function Js(e){return(0,Ee.createElement)("div",{key:"overlay",className:"gp-modal__overlay"},[(0,Ee.createElement)("div",{key:"sp",className:"gp-spinner"}),(0,Ee.createElement)("div",{key:"lb",className:"gp-modal__overlay-label"},e)])}function ot(e){let t=e.confirmBusy===!0&&e.busyLabel!==void 0;return Ot({onClose:e.onClose,title:e.title,portalKey:"confirm-modal",t:e.t,body:[(0,Ee.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},e.body),e.extra??null,mn(e.t),e.error!==null?(0,Ee.createElement)("div",{key:"err",className:"gp-feedback"},e.error):null],footer:hn({onClose:e.onClose,onConfirm:e.onConfirm,confirmLabel:e.confirmLabel,confirmDisabled:e.confirmBusy===!0,danger:e.danger,t:e.t}),...t?{overlay:Js(e.busyLabel)}:{}})}var ue=require("react");function Wo(e,t){return typeof document>"u"?null:(0,ue.createElement)(Ks,{target:e,...t})}function Ks({target:e,onClose:t,onCreate:n,error:r,t:a}){let[o,s]=(0,ue.useState)(""),[i,l]=(0,ue.useState)(!1),[d,c]=(0,ue.useState)(""),u=()=>{o.trim()!==""&&n(o.trim(),i?d:"")};return Ot({onClose:t,title:a("tag.createTitle"),icon:(0,ue.createElement)(on,{size:15}),hash:e.shortHash,portalKey:"tag-create-modal",t:a,body:[(0,ue.createElement)("input",{key:"name",className:"gp-input",placeholder:a("tag.namePlaceholder"),value:o,autoFocus:!0,onChange:f=>s(f.target.value),onKeyDown:f=>{f.key==="Enter"&&u()}}),(0,ue.createElement)("label",{key:"ann",className:"gp-modal__check"},[(0,ue.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:i,onChange:()=>l(f=>!f)}),a("tag.annotated")]),i?(0,ue.createElement)("textarea",{key:"msg",className:"gp-input gp-input--area",placeholder:a("tag.messagePlaceholder"),value:d,onChange:f=>c(f.target.value)}):null,mn(a),r!==null?(0,ue.createElement)("div",{key:"err",className:"gp-feedback"},r):null],footer:hn({onClose:t,onConfirm:u,confirmLabel:a("tag.create"),confirmDisabled:o.trim()==="",danger:!1,t:a})})}function Qo(e,t){return typeof document>"u"?null:(0,ue.createElement)(Vs,{target:e,...t})}function Vs({target:e,from:t,dirty:n,lostFiles:r,lostTotal:a,lostTruncated:o,busy:s,error:i,onReset:l,onClose:d,t:c}){let[u,f]=(0,ue.useState)("mixed"),[v,g]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{u!=="hard"&&g(!1)},[u]);let w=[{value:"mixed",label:"reset.modeMixed",hint:"reset.mixedHint"},{value:"soft",label:"reset.modeSoft",hint:"reset.softHint"},{value:"hard",label:"reset.modeHard",hint:"reset.hardHint"}],k=s||u==="hard"&&!v;return Ot({onClose:d,title:c("reset.title"),icon:(0,ue.createElement)(Xn,{size:15}),hash:e.shortHash,portalKey:"reset-modal",t:c,body:[(0,ue.createElement)("div",{key:"txt",className:"gp-modal__confirmtext"},c("reset.body",{from:t,to:e.shortHash})),(0,ue.createElement)("div",{key:"modes",className:"gp-reset__modes"},w.map(y=>(0,ue.createElement)("label",{key:y.value,className:`gp-reset__mode${u===y.value?" gp-reset__mode--on":""}${y.value==="hard"?" gp-reset__mode--danger":""}`},[(0,ue.createElement)("input",{key:"r",type:"radio",name:"gp-reset-mode",className:"gp-check",checked:u===y.value,onChange:()=>f(y.value)}),(0,ue.createElement)("span",{key:"tx",className:"gp-reset__modetext"},[(0,ue.createElement)("span",{key:"l",className:"gp-reset__modelabel"},c(y.label)),(0,ue.createElement)("span",{key:"h",className:"gp-reset__modehint"},c(y.hint))])]))),u==="hard"?(0,ue.createElement)("div",{key:"orphan",className:"gp-reset__dirtywarn"},c("reset.hardOrphan")):null,u==="hard"&&a>0?(0,ue.createElement)("div",{key:"lost",className:"gp-reset__lost"},[(0,ue.createElement)("div",{key:"w",className:"gp-reset__warn"},c("reset.hardWarn")),(0,ue.createElement)("ul",{key:"ul",className:"gp-reset__lostlist"},[...r.map(y=>(0,ue.createElement)("li",{key:y,title:y},y)),o?(0,ue.createElement)("li",{key:"_more",className:"gp-reset__lostmore"},c("reset.lostMore")):null])]):null,u==="hard"?(0,ue.createElement)("label",{key:"ack",className:"gp-modal__check gp-reset__ack"},[(0,ue.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:v,onChange:()=>g(y=>!y)}),c(a>0?"reset.hardAck":"reset.hardAckClean")]):null,n?(0,ue.createElement)("div",{key:"dirty",className:"gp-reset__dirtywarn"},c("ops.dirtyWarn")):null,mn(c),i!==null?(0,ue.createElement)("div",{key:"err",className:"gp-feedback"},i):null],footer:hn({onClose:d,onConfirm:()=>void l(u),confirmLabel:c("reset.confirm"),confirmDisabled:k,danger:u==="hard",t:c})})}var it=require("react");function Yo(e,t){return typeof document>"u"?null:(0,it.createElement)(qs,{target:e,...t})}function qs({target:e,from:t,dirty:n,busy:r,error:a,onConfirm:o,onClose:s,t:i}){let[l,d]=(0,it.useState)(!1),c=(u,f,v,g)=>(0,it.createElement)("label",{key:f,className:`gp-bpick__mode${l===u?" gp-bpick__mode--on":""}`},[(0,it.createElement)("input",{key:"r",type:"radio",name:"gp-switch-mode",className:"gp-check",checked:l===u,onChange:()=>d(u)}),(0,it.createElement)("span",{key:"tx",className:"gp-bpick__modetext"},[(0,it.createElement)("span",{key:"l",className:"gp-bpick__modelabel"},v),(0,it.createElement)("span",{key:"h",className:"gp-bpick__modehint"},g)])]);return ot({title:i("switch.confirmTitle"),body:i("switch.body",{from:t??i("switch.detached"),to:e.name}),extra:(0,it.createElement)("div",{key:"x",className:"gp-bpick__extra"},[e.createFrom===void 0?null:(0,it.createElement)("div",{key:"trk",className:"gp-bpick__note"},i("switch.trackingNote",{name:e.name,ref:e.createFrom})),n===0?null:(0,it.createElement)("div",{key:"dw",className:"gp-bpick__warn"},i("switch.dirtyWarn",{count:n})),n===0?null:(0,it.createElement)("div",{key:"md",className:"gp-bpick__modes"},[c(!1,"direct",i("switch.modeDirect"),i("switch.modeDirectHint")),c(!0,"stash",i("switch.modeStash",{count:n}),i("switch.modeStashHint"))])]),confirmLabel:i(l?"switch.confirmStash":"switch.confirm"),danger:!1,error:a,confirmBusy:r,busyLabel:i("switch.switching"),onConfirm:()=>o(l),onClose:s,t:i})}function js(e){let t=e.indexOf("/");return t<=0||t===e.length-1?null:{remote:e.slice(0,t),branch:e.slice(t+1)}}function Zo(e){let t=new Set(e.local.map(a=>a.name)),n=e.local.map(a=>({key:`local:${a.name}`,group:"local",label:a.name,name:a.name,reused:!1,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})),r=[];for(let a of e.remote){let o=js(a.name);if(o===null)continue;let s=t.has(o.branch);r.push({key:`remote:${a.name}`,group:"remote",label:a.name,name:o.branch,createFrom:s?void 0:a.name,reused:s,ahead:a.ahead,behind:a.behind,shortHash:a.shortHash})}return[...n,...r]}function ei(e,t){return e.name!==t}var _e=require("react");var Re=require("react"),ti=require("react-dom"),Us=140,Ws=260;function $t(e){let t=e?.placement??"above",n=e?.delayMs??Us,r=e?.maxWidth??Ws,[a,o]=(0,Re.useState)(null),[s,i]=(0,Re.useState)(!1),l=(0,Re.useRef)(!1),d=(0,Re.useRef)(void 0),c=(0,Re.useCallback)(C=>{l.current=C,i(C)},[]),u=(0,Re.useCallback)(()=>{d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),c(!1),o(null)},[c]),f=(0,Re.useCallback)((C,T)=>{let F=C.getBoundingClientRect(),M=C.closest('.gp-panel[data-layout="compact"]')!==null,E=M?F.left+F.width/2:F.left,J=Math.min(r,Math.max(80,window.innerWidth-16));o(t==="below"?{text:T,left:E,center:M,maxW:J,top:F.bottom+6}:{text:T,left:E,center:M,maxW:J,bottom:Math.max(8,window.innerHeight-F.top+6)})},[t,r]),v=(0,Re.useCallback)((C,T)=>{l.current||(d.current!==void 0&&clearTimeout(d.current),c(!1),d.current=setTimeout(()=>f(C,T),n))},[f,n,c]),g=(0,Re.useCallback)((C,T)=>{d.current!==void 0&&(clearTimeout(d.current),d.current=void 0),c(!0),f(C,T)},[f,c]),w=(0,Re.useRef)(null);(0,Re.useLayoutEffect)(()=>{let C=w.current;if(C===null||a===null)return;let T=8,F=window.innerWidth,M=window.innerHeight,E=C.getBoundingClientRect(),J=a.center===!0?T+E.width/2:T,te=a.center===!0?F-T-E.width/2:F-T-E.width,Z=Math.min(Math.max(a.left,J),Math.max(J,te)),I=Math.max(T,M-T-E.height),K=a.top===void 0?void 0:Math.min(Math.max(a.top,T),I),U=a.bottom===void 0?void 0:Math.min(Math.max(a.bottom,T),I);Z===a.left&&K===a.top&&U===a.bottom||o(se=>{if(se===null)return se;let de={...se,left:Z};return K!==void 0&&(de.top=K),U!==void 0&&(de.bottom=U),de})},[a]),(0,Re.useEffect)(()=>{if(!s)return;let C=F=>{let M=F.target;M instanceof Element&&M.closest(".gp-tip")!==null||u()},T=F=>{F.key==="Escape"&&u()};return document.addEventListener("pointerdown",C,!0),document.addEventListener("keydown",T,!0),()=>{document.removeEventListener("pointerdown",C,!0),document.removeEventListener("keydown",T,!0)}},[s,u]);let k=(0,Re.useCallback)(C=>({onMouseEnter:T=>v(T.currentTarget,C),onMouseLeave:()=>{l.current||u()},onFocus:T=>v(T.currentTarget,C),onBlur:()=>{l.current||u()}}),[v,u]),y={left:a?.left??0,maxWidth:a?.maxW??r};a?.top!==void 0&&(y.top=a.top),a?.bottom!==void 0&&(y.bottom=a.bottom);let x=a!==null&&typeof document<"u"?(0,ti.createPortal)((0,Re.createElement)("div",{ref:w,className:`gp-tip gp-tip--sb${a.center===!0?" gp-tip--center":""}`,style:y},a.text),document.body):null;return{tipProps:k,tipNode:x,hideTip:u,showTipNow:g}}function zt(e){return e.hasUpstream===!0&&e.ahead>0&&e.behind===0}function ni(e,t,n){if(e==="loading"||e===null)return(0,_e.createElement)("div",{className:"gp-pullscope gp-pullscope--loading"},t(n.loading));let r=t(n.line,{commits:e.commits,files:e.files,ins:e.insertions,del:e.deletions}),a=r.match(/(\+\d+)\s*\/\s*([-−]\d+)/);if(a===null)return(0,_e.createElement)("div",{className:"gp-pullscope"},r);let o=r.indexOf(a[0]);return(0,_e.createElement)("div",{className:"gp-pullscope"},[r.slice(0,o),(0,_e.createElement)("span",{key:"add",className:"gp-pullscope__add"},a[1])," / ",(0,_e.createElement)("span",{key:"del",className:"gp-pullscope__del"},a[2]),r.slice(o+a[0].length)])}function ri(e,t){return ni(e,t,{line:"status.pullScope",loading:"status.pullScopeLoading"})}function ai(e,t){return ni(e,t,{line:"status.pushScope",loading:"status.pushScopeLoading"})}function Qs(e){let t=e.replace(/^https?:\/\/[^/]+\//,"").replace(/\/+$/,""),n=t.split("/");return n.length>=2?n.slice(-2).join("/"):t}function Or(e,t){return(0,_e.createElement)(Ys,{snapshot:e,cb:t})}function Ys({snapshot:e,cb:t}){let{t:n}=t,{tipProps:r,tipNode:a,hideTip:o}=$t({placement:"above"}),s=e.remote??null,i=e.hasUpstream===!0,l=(()=>{if(s===null||s.hostKind!=="github")return null;let y=(0,_e.createElement)(Qa,{size:14});if(s.webUrl===null)return(0,_e.createElement)("span",{key:"r",className:"gp-statusbar__repo gp-statusbar__repo--none","aria-label":s.url,...r(s.url)},(0,_e.createElement)("span",{className:"gp-statusbar__ic"},y));let x=s.host!==null?n("status.openRepoOn",{host:s.host}):n("status.openRepo"),C=`${Qs(s.webUrl)} \xB7 ${x}`;return(0,_e.createElement)("a",{key:"r",className:"gp-statusbar__repo",href:s.webUrl,target:"_blank",rel:"noreferrer","aria-label":C,...r(C)},(0,_e.createElement)("span",{className:"gp-statusbar__ic"},y))})(),{ahead:d,behind:c,branch:u}=e,f=i&&c>0&&d===0,v=zt(e),g=!i&&u!==null&&s!==null,w=(()=>{let y,x="";return u===null?y=n("status.detached"):i?d===0&&c===0?(y=n("status.synced"),x=" gp-statusbar__state--ok"):d>0&&c>0?(y=n("status.diverged",{ahead:d,behind:c}),x=" gp-statusbar__state--warn"):c>0?(y=n("status.behind",{n:c}),x=" gp-statusbar__state--warn"):y=n("status.ahead",{n:d}):y=n("status.noUpstream"),t.syncError!==null?(0,_e.createElement)("span",{key:"error",className:"gp-statusbar__state gp-statusbar__state--warn",role:"alert",title:t.syncError},t.syncError):(0,_e.createElement)("span",{key:"s",className:`gp-statusbar__state${x}`},y)})(),k=[s!==null?(0,_e.createElement)("button",{key:"check",type:"button",className:"gp-icon-btn gp-statusbar__btn",disabled:t.syncBusy,"aria-label":n("status.check"),...r(n("status.checkTitle")),onClick:()=>{o(),t.onCheck()}},(0,_e.createElement)(Za,{size:13})):null,f?(0,_e.createElement)("button",{key:"pull",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pullBusy,"aria-label":n("status.pullTitle"),...r(n("status.pullTitle")),onClick:()=>{o(),t.onPull()}},[(0,_e.createElement)(Ya,{key:"i",size:12}),n("status.pull")]):null,v?(0,_e.createElement)("button",{key:"push",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.pushBusy,"aria-label":n("status.pushTitle"),...r(n("status.pushTitle")),onClick:()=>{o(),t.onPush()}},[(0,_e.createElement)(En,{key:"i",size:12}),n("status.push")]):null,g?(0,_e.createElement)("button",{key:"publish",type:"button",className:"gp-btn gp-btn--sm gp-statusbar__pull",disabled:t.publishBusy,"aria-label":n("status.publishTitle"),...r(n("status.publishTitle")),onClick:()=>{o(),t.onPublish()}},[(0,_e.createElement)(En,{key:"i",size:12}),n("status.publish")]):null];return(0,_e.createElement)("div",{key:"statusbar",className:`gp-statusbar${t.syncBusy?" gp-statusbar--busy":""}`},[l,(0,_e.createElement)("div",{key:"sync",className:"gp-statusbar__sync"},[w,...k]),a])}var st=require("react");function pr({remote:e,sessionId:t,snapshot:n,onAction:r,onClose:a,t:o,onBusyChange:s}){let i=JSON.stringify([t,n.root,n.branch,n.head]),l=(0,st.useRef)(i),d=(0,st.useRef)({scope:i,snapshot:n});d.current={scope:i,snapshot:n};let c=(0,st.useRef)(!1),u=(0,st.useRef)(!1),[f,v]=(0,st.useState)("loading"),[g,w]=(0,st.useState)(null),[k,y]=(0,st.useState)(!1),x=i===l.current;(0,st.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]),(0,st.useEffect)(()=>{(!x||!zt(n))&&(u.current||a())},[x,n,k,a]),(0,st.useEffect)(()=>{if(!x)return;let T=!0;return v("loading"),(async()=>{try{let F=await e.query({sessionId:t,query:{kind:"push-preview"}});if(!T||d.current.scope!==l.current)return;let M=ve(F,"push-preview");M!==null&&M.hasUpstream?v(M):(v(null),w(F.ok?o("error.generic"):tn(F.error.code,F.error.message,o)))}catch(F){if(!T||d.current.scope!==l.current)return;v(null),w(F instanceof Error?F.message:o("error.generic"))}})(),()=>{T=!1}},[e,t,i,x,o]);let C=async()=>{if(!(u.current||d.current.scope!==l.current||!zt(d.current.snapshot))){u.current=!0,w(null),y(!0),s?.(!0);try{let T=await r({kind:"push"});if(!c.current)return;T.ok?a():d.current.scope===l.current&&w(T.error??o("error.generic"))}catch(T){c.current&&d.current.scope===l.current&&w(T instanceof Error?T.message:o("error.generic"))}finally{u.current=!1,c.current&&y(!1),s?.(!1)}}};return x?ot({title:o("status.pushConfirmTitle"),body:o("status.pushConfirmBody",{branch:n.branch??"HEAD",ahead:n.ahead}),extra:f===null?null:ai(f,o),confirmLabel:o("status.pushConfirm"),danger:!1,error:g,confirmBusy:k,busyLabel:o("status.pushing"),onConfirm:()=>void C(),onClose:()=>{u.current||a()},t:o}):null}var $r=new Set,oi=22,ii=24,si=[["","overview.allTime"],["1 day ago","overview.today"],["7 days ago","overview.last7d"],["30 days ago","overview.last30d"]],Zs=30;function el(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n].kind!==t[n].kind||e[n].name!==t[n].name||e[n].head!==t[n].head)return!1;return!0}var tl=46,nl=260;function rl(e,t){let[n,r]=(0,p.useState)(!1);return(0,p.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=()=>r(e.clientWidth>0&&e.clientWidth<t);a();let o=new ResizeObserver(a);return o.observe(e),()=>o.disconnect()},[e,t]),n}function li({remote:e,sessionId:t,visible:n=!0,defaultDiffView:r,snapshot:a,onAction:o,onResync:s,compact:i,t:l}){let{signal:d,queryVisible:c,queryKey:u}=Fn(t,n,a.root),[f,v]=(0,p.useState)({ref:null,search:"",author:"",since:""}),[g,w]=(0,p.useState)(""),[k,y]=(0,p.useState)(!1),[x,C]=(0,p.useState)(!1),[T,F]=(0,p.useState)(null),M=rl(T,nl),[E,J]=(0,p.useState)(!1),te=(0,p.useId)(),[Z,I]=(0,p.useState)(new Set(["tags","remote"])),[K,U]=(0,p.useState)(0),se=[...u,K],de=()=>U(_=>_+1),[L,ne]=(0,p.useState)(null),[ae,oe]=(0,p.useState)(null),[H,N]=(0,p.useState)(null),[G,$]=(0,p.useState)(null),[B,z]=(0,p.useState)(null),[Y,S]=(0,p.useState)(!1),[W,be]=(0,p.useState)(!1),[ke,Le]=(0,p.useState)(null),[De,Te]=(0,p.useState)(!1),[Fe,Je]=(0,p.useState)(!1),[ft,xt]=(0,p.useState)(!1),[Ze,Ve]=(0,p.useState)(!1),[Oe,et]=(0,p.useState)(!1),[O,pe]=(0,p.useState)(!1),[me,le]=(0,p.useState)(null),[Ne,He]=(0,p.useState)("list"),[Ge,mt]=(0,p.useState)(null),[Be,Nt]=(0,p.useState)(!1),[dt,ct]=(0,p.useState)(!1);(0,p.useEffect)(()=>{if(!dt)return;let _=X=>{X.key==="Escape"&&ct(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[dt]),(0,p.useEffect)(()=>{!i&&dt&&ct(!1)},[i,dt]),(0,p.useEffect)(()=>{if(!Fe){le(null);return}let _=!0;return le("loading"),e.query({sessionId:t,query:{kind:"pull-preview"}}).then(X=>{if(!_)return;let we=ve(X,"pull-preview");le(we!==null&&we.hasUpstream?{commits:we.commits,files:we.files,insertions:we.insertions,deletions:we.deletions}:null)}),()=>{_=!1}},[Fe,e,t]);let{tree:Se,treeError:ht,authors:qe,reload:pt}=Ko(e,t,se,c),Et=(0,p.useMemo)(()=>{let _=new Map;if(Se===null)return _;for(let X of Zo(Se))ei(X,Se.current)&&_.set(X.key,X);return _},[Se]),kt=a.remote?.name??null,je=(0,p.useMemo)(()=>{let _=Se?.local??[],X=Se?.remote??[],we=Se?.defaultBranch??null,Kt=po(_,we),ma=go(X,kt,we),ha=fo(_,Se?.current??null,Kt);return{local:ha.nodes,localPinned:ha.pinned,localPrimary:Kt,remotePrimary:ma,remote:jn(uo(X,ma)),tags:jn(Se?.tags??[])}},[Se?.local,Se?.remote,Se?.tags,Se?.current,Se?.defaultBranch,kt]),Mt=_=>{z(null),mt(_)},ie=qo(e,t,r,c),{commits:Ue,topology:Ie,appliedFilter:Gt,loading:Ae,listError:yt,hasMore:ee,listRef:V,loadMore:he}=Vo(e,t,f,se,ie.clearSelection,c);(0,p.useEffect)(()=>{let _=setTimeout(()=>v(X=>X.search===g?X:{...X,search:g}),300);return()=>clearTimeout(_)},[g]);let tt=Ie!==void 0||Dr(Gt),_t=(0,p.useMemo)(()=>tt?so(Ue,Ie??[],a.graphStyle):Jn(Ue,a.graphStyle),[Ue,Ie,tt,a.graphStyle]),We=(0,p.useMemo)(()=>oo(_t),[_t]),ut=Math.max(Wt,We*Wt),b=i?tl:Zs,ye=i?`${ut}px minmax(0,1fr)`:`${ut}px minmax(120px,1fr) 72px 120px 96px`,$e=()=>{let _=V.current;_===null||!ee||_.scrollTop+_.clientHeight>=_.scrollHeight-240&&he()},nt=_=>{ie.select(_),i&&He("detail")},Jt=(0,p.useMemo)(()=>Date.now(),[Ue,d.sampledAt]),bt=(0,p.useMemo)(()=>ie.detail===null?[]:mo(ie.detail.stats.map(_=>({path:_.path,meta:_.status}))),[ie.detail]),fe=ie.selected,Pt=fe?.hash??null,[wn,Tr]=(0,p.useState)({hash:null,dirs:$r}),Nr=wn.hash===Pt?wn.dirs:$r,xn=(0,p.useCallback)(_=>{Tr(X=>{let we=X.hash===Pt?X.dirs:$r,Kt=new Set(we);return Kt.has(_)?Kt.delete(_):Kt.add(_),{hash:Pt,dirs:Kt}})},[Pt]);(0,p.useEffect)(()=>{if(fe===null)return;let _=Ue.find(X=>X.hash===fe.hash);_!==void 0&&_!==fe&&!el(_.refs,fe.refs)&&ie.resyncSelected(_)},[Ue,fe]);let nn=en({storageKey:"gp.overview.left",initial:200,min:130,reserve:360,edge:"end"}),kn=en({storageKey:"gp.overview.right",initial:340,min:190,reserve:360,edge:"start"}),_n=_=>v(X=>({...X,ref:_})),Dn=async(_,X)=>{if(!(L===null||Y)){z(null),S(!0);try{let we=await e.run({sessionId:t,action:{kind:"tag-create",name:_,commit:L.hash,...X.trim()!==""?{message:X}:{}}});we.ok?(ne(null),de()):z(tn(we.error.code,we.error.message,l))}finally{S(!1)}}},P=async _=>{if(!Y){z(null),S(!0);try{let X=await e.run({sessionId:t,action:{kind:"tag-delete",name:_}});X.ok?(oe(null),de()):z(tn(X.error.code,X.error.message,l))}finally{S(!1)}}},j=async()=>{if(!(H===null||Y)){z(null),S(!0);try{let _=await o({kind:"revert",commit:H.hash});_.ok?N(null):z(_.error??l("error.generic"))}finally{S(!1)}}},ce=async _=>{if(!(G===null||Y)){z(null),S(!0);try{let X=await o({kind:"reset",commit:G.hash,mode:_});X.ok?$(null):z(X.error??l("error.generic"))}finally{S(!1)}}},Me=async _=>{if(!(Ge===null||Be)){z(null),Nt(!0);try{let X=await o({kind:"branch-checkout",name:Ge.name,...Ge.createFrom===void 0?{}:{createFrom:Ge.createFrom},..._?{stashMessage:l("switch.stashMessage",{branch:Ge.name})}:{}});X.ok?(mt(null),Pe(!0)):z(X.error??l("error.generic"))}finally{Nt(!1)}}},Pe=async(_=!1)=>{if(!(W||a.remote===null)){_||Le(null),be(!0);try{let X=await o({kind:"fetch"});X.ok?Le(null):_||Le(X.error??l("error.generic"))}catch(X){_||Le(X instanceof Error?X.message:l("error.generic"))}finally{be(!1)}}},rn=async()=>{if(!De){z(null),Te(!0);try{let _=await o({kind:"pull-ff"});_.ok?Je(!1):z(_.error??l("error.generic"))}finally{Te(!1)}}},St=async()=>{if(!(Oe||a.remote===null)){z(null),et(!0);try{let _=await o({kind:"publish",remote:a.remote.name});_.ok?pe(!1):z(_.error??l("error.generic"))}finally{et(!1)}}},oa={syncBusy:W,syncError:ke,pullBusy:De,pushBusy:ft,publishBusy:Oe,onCheck:()=>void Pe(),onPull:()=>{z(null),Je(!0)},onPush:()=>{zt(a)&&!ft&&Ve(!0)},onPublish:()=>{z(null),pe(!0)},t:l},ia=ll(ie.fileDiff,{visible:c,data:ie.fileDiffData,error:ie.fileDiffError,mode:ie.fileDiffMode,onMode:ie.setFileDiffMode,expanded:ie.fileDiffExpanded,onExpand:_=>{ie.fileDiff!==null&&ie.openFileDiff(ie.fileDiff.path,ie.fileDiff.hash,ie.fileDiff.shortHash,_)},onClose:ie.closeFileDiff,remote:e,sessionId:t,compact:i,t:l}),sa=(0,p.useMemo)(()=>[...new Set(a.changes.filter(_=>_.status!=="untracked").map(_=>_.path))],[a.changes]),la=[L!==null?Wo(L,{onClose:()=>ne(null),onCreate:Dn,error:B,compact:i,t:l}):null,ae!==null?ot({title:l("tag.deleteTitle"),body:l("tag.deleteConfirm",{name:ae}),confirmLabel:l("tag.deleteTitle"),danger:!0,error:B,confirmBusy:Y,onConfirm:()=>void P(ae),onClose:()=>oe(null),t:l}):null,H!==null?ot({title:l("revert.title"),body:l("revert.body",{ref:`${H.shortHash} ${H.subject}`})+(a.dirty?`
816
+
817
+ ${l("ops.dirtyWarn")}`:""),confirmLabel:l("revert.confirm"),danger:!1,error:B,confirmBusy:Y,onConfirm:()=>void j(),onClose:()=>N(null),t:l}):null,G!==null?Qo(G,{from:a.head??G.shortHash,dirty:a.dirty,lostFiles:sa,lostTotal:sa.length,lostTruncated:a.truncated,busy:Y,error:B,onReset:ce,onClose:()=>$(null),t:l}):null,Fe?ot({title:l("status.pullConfirmTitle"),body:l("status.pullConfirmBody",{branch:a.branch??"HEAD",behind:a.behind}),extra:ri(me,l),confirmLabel:l("status.pullConfirm"),danger:!1,error:B,confirmBusy:De,busyLabel:l("status.pulling"),onConfirm:()=>void rn(),onClose:()=>Je(!1),t:l}):null,Ze?(0,p.createElement)(pr,{key:"push",remote:e,sessionId:t,snapshot:a,onAction:o,onClose:()=>Ve(!1),onBusyChange:xt,t:l}):null,O?ot({title:l("status.publishConfirmTitle"),body:l("status.publishConfirmBody",{branch:a.branch??"HEAD",remote:a.remote?.name??"origin"}),confirmLabel:l("status.publishConfirm"),danger:!1,error:B,confirmBusy:Oe,busyLabel:l("status.publishing"),onConfirm:()=>void St(),onClose:()=>pe(!1),t:l}):null,Ge!==null?Yo(Ge,{from:a.branch,dirty:a.dirty?Math.max(1,a.stats.fileCount):0,busy:Be,error:B,onConfirm:_=>void Me(_),onClose:()=>mt(null),t:l}):null],Ki=[{id:"",label:l("overview.allUsers")},...qe.map(_=>({id:_,label:_}))],Vi=si.map(([_,X])=>({id:_,label:l(X)})),qi=l(si.find(([_])=>_===f.since)?.[1]??"overview.allTime"),ji=f.author===""?l("overview.allUsers"):f.author,da=i?(0,p.createElement)("button",{key:"more",type:"button",className:`gp-btn gp-toolbar__more-toggle${f.author!==""||f.since!==""?" gp-btn--primary":""}`,title:l("overview.moreFilters"),"aria-label":l("overview.moreFilters"),"aria-expanded":E,...E?{"aria-controls":te}:{},onClick:()=>J(_=>!_)},(0,p.createElement)("span",{key:"c",className:`gp-toolbar__chev${E?" gp-toolbar__chev--up":""}`},(0,p.createElement)(Lt,{size:14,open:!0}))):null,Ui=(0,p.createElement)("button",{key:"fetch",type:"button",className:"gp-icon-btn",title:l("overview.fetch"),disabled:W,onClick:()=>void Pe()},(0,p.createElement)(ln,{size:14})),Wi=(0,p.createElement)(Xr.Menu,{key:"author",open:k,onClose:()=>y(!1),items:Ki,selectedId:f.author,onSelect:_=>{y(!1),v(X=>({...X,author:_}))},align:"start",portal:!0,className:"gp-filter",anchor:Nn(k,ji,()=>y(_=>!_))}),Qi=(0,p.createElement)(Xr.Menu,{key:"since",open:x,onClose:()=>C(!1),items:Vi,selectedId:f.since,onSelect:_=>{C(!1),v(X=>({...X,since:_}))},align:"start",portal:!0,className:"gp-filter",anchor:Nn(x,qi,()=>C(_=>!_))}),ca=(0,p.createElement)("input",{key:"search",className:"gp-search",placeholder:l(M||i?"overview.searchShort":"overview.search"),value:g,onChange:_=>w(_.target.value)}),pa=[Wi,Qi,Ui],Yi=i?[(0,p.createElement)("button",{key:"filter",type:"button",className:`gp-btn${f.ref!==null?" gp-btn--primary":""}`,title:l("overview.filterBranch"),onClick:()=>ct(!0)},[(0,p.createElement)(Xa,{key:"ic",size:13}),(0,p.createElement)("span",{key:"l",className:"gp-btn__label"},f.ref??l("overview.filterBranch"))]),ca,...da===null?[]:[da],...E?[(0,p.createElement)("div",{key:"more",id:te,className:"gp-toolbar__more"},pa)]:[]]:[ca,...pa],ua=(0,p.createElement)("div",{key:"mid",className:"gp-col gp-col--mid gp-history"},[(0,p.createElement)("div",{key:"tb",className:"gp-toolbar",ref:F},Yi),(0,p.createElement)("div",{key:"list",className:"gp-history__list",ref:V,onScroll:$e},Ue.length===0?(0,p.createElement)("div",{className:"gp-empty"},l(Ae?"common.loading":yt?"overview.loadFailed":"overview.noResults")):_t.map(_=>il(_,{selected:fe?.hash===_.commit.hash,current:!a.unborn&&a.head!==null&&a.head!==""&&_.commit.hash.startsWith(a.head),gridTpl:ye,laneCount:We,now:Jt,compact:i,rowH:b,onSelect:()=>nt(_.commit),onHoverEnter:ie.onHoverEnter,onHoverLeave:ie.onHoverLeave,t:l})))]),ga=_=>ie.detail!==null&&ie.detail.stats.length>0?(0,p.createElement)("div",{className:_},[(0,p.createElement)("span",{key:"f"},l("overview.changeSummary",{files:ie.detail.stats.length})),(0,p.createElement)("span",{key:"sep",className:"gp-detail__summary-sep"},"\xB7"),(0,p.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ie.detail.insertions}`),(0,p.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ie.detail.deletions}`)]):null,fa=fe===null?[(0,p.createElement)("div",{key:"empty",className:"gp-empty"},[(0,p.createElement)(In,{key:"i",size:20}),l("overview.selectCommit")])]:[(0,p.createElement)("div",{key:"files",className:"gp-detail__files"},ie.detail===null?(0,p.createElement)("div",{className:"gp-empty"},ie.detailError?l("overview.detailFailed"):l("common.loading")):[i?null:ga("gp-detail__summary"),sl(bt,{activePath:ie.fileDiff?.path??null,openTitle:l("overview.openFileDiff"),onOpen:_=>{fe!==null&&ie.openFileDiff(_,fe.hash,fe.shortHash)},collapsed:Nr,onToggleDir:xn,expandLabel:l("overview.expandDir"),collapseLabel:l("overview.collapseDir")})]),(0,p.createElement)("div",{key:"msg",className:"gp-detail__msg"},[(0,p.createElement)("div",{key:"subj",className:"gp-detail__subject"},fe.subject),(0,p.createElement)("div",{key:"meta",className:"gp-detail__meta"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},fe.shortHash),(0,p.createElement)("span",{key:"a"},fe.author),(0,p.createElement)("span",{key:"t"},Pn(fe.dateIso))]),(0,p.createElement)("div",{key:"ops",className:"gp-detail__ops"},(()=>{let _=fe.refs.filter(X=>X.kind==="tag");return[_.length>0?(0,p.createElement)("div",{key:"tags",className:"gp-detail__tags"},_.map(X=>(0,p.createElement)("span",{key:`tag-${X.name}`,className:"gp-ref-chip gp-ref-chip--tag gp-ref-chip--del",title:X.name},[(0,p.createElement)(on,{key:"i",size:11}),(0,p.createElement)("span",{key:"n",className:"gp-detail__tagname"},X.name),(0,p.createElement)("button",{key:"x",type:"button",className:"gp-ref-chip__x",title:l("tag.deleteOne",{name:X.name}),onClick:()=>{z(null),oe(X.name)}},(0,p.createElement)(gt,{size:11}))]))):null,(0,p.createElement)("div",{key:"actions",className:"gp-detail__actions"},[(0,p.createElement)("button",{key:"revert",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.revert"),onClick:()=>{z(null),N({hash:fe.hash,shortHash:fe.shortHash,subject:fe.subject})}},[(0,p.createElement)(Ua,{key:"i",size:12}),l("overview.revert")]),(0,p.createElement)("button",{key:"reset",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.reset"),onClick:()=>{z(null),s(),$({hash:fe.hash,shortHash:fe.shortHash,subject:fe.subject})}},[(0,p.createElement)(Xn,{key:"i",size:12}),l("overview.reset")]),(0,p.createElement)("button",{key:"addtag",type:"button",className:"gp-btn gp-btn--sm",title:l("overview.createTag"),onClick:()=>{z(null),ne({hash:fe.hash,shortHash:fe.shortHash})}},[(0,p.createElement)(on,{key:"i",size:12}),l("overview.createTag")])])]})()),ie.detail!==null&&ie.detail.body!==""?(0,p.createElement)("pre",{key:"body",className:"gp-detail__body"},ie.detail.body):(0,p.createElement)("div",{key:"nb",className:"gp-empty"},l("overview.noMessage"))])];return i?(0,p.createElement)("div",{className:"gp-overview gp-overview--compact"},[ia,...la,Ne==="detail"?(0,p.createElement)("div",{key:"detail",className:"gp-col gp-col--mid gp-detail"},[(0,p.createElement)("div",{key:"back",className:"gp-subhead"},[(0,p.createElement)("button",{key:"b",type:"button",className:"gp-subhead__back",onClick:()=>He("list")},[(0,p.createElement)(sn,{key:"i",size:14}),l("overview.backToList")]),ga("gp-detail__summary gp-detail__summary--inline")]),...fa]):ua,Or(a,oa),dt?ol(Se,ht,f.ref,Z,{onFilter:_=>{_n(_),ct(!1)},switchOptions:Et,onSwitch:_=>{ct(!1),Mt(_)},onToggle:_=>I(X=>{let we=new Set(X);return we.has(_)?we.delete(_):we.add(_),we}),onRetry:pt,onClose:()=>ct(!1),t:l},je):null]):(0,p.createElement)("div",{className:"gp-overview"},[ia,...la,(0,p.createElement)("div",{key:"left",className:"gp-col gp-col--left",style:{flex:`0 0 ${nn.width}px`}},[(0,p.createElement)("div",{key:"scroll",className:"gp-col-left__scroll"},di(Se,ht,f.ref,Z,{onFilter:_=>_n(_),switchOptions:Et,onSwitch:Mt,onToggle:_=>I(X=>{let we=new Set(X);return we.has(_)?we.delete(_):we.add(_),we}),onRetry:pt,t:l},je)),Or(a,oa)]),nn.divider,ua,kn.divider,(0,p.createElement)("div",{key:"right",className:"gp-col gp-col--right gp-detail",style:{flex:`0 0 ${kn.width}px`}},fa),al(ie.hover,ie.hoverBody,l)])}function al(e,t,n){if(e===null||typeof document>"u")return null;let r=460,a=Math.min(e.x+16,(typeof window<"u"?window.innerWidth:1200)-r-12),o=e.y+14,s=(0,p.createElement)("div",{className:"gp-hovercard",style:{left:a,top:o,maxWidth:r}},[(0,p.createElement)("div",{key:"subj",className:"gp-hovercard__subject"},e.commit.subject),(0,p.createElement)("div",{key:"meta",className:"gp-hovercard__meta"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},e.commit.shortHash),(0,p.createElement)("span",{key:"a"},e.commit.author),(0,p.createElement)("span",{key:"t"},Pn(e.commit.dateIso))]),t===null?(0,p.createElement)("div",{key:"l",className:"gp-hovercard__loading"},n("common.loading")):t===""?(0,p.createElement)("div",{key:"e",className:"gp-hovercard__loading"},n("overview.noMessage")):(0,p.createElement)("pre",{key:"body",className:"gp-hovercard__body"},t)]);return(0,ur.createPortal)(s,document.body,"commit-hovercard")}function di(e,t,n,r,a,o){if(t)return(0,p.createElement)("div",{className:"gp-empty"},[(0,p.createElement)("span",{key:"m"},a.t("overview.branchesError")),(0,p.createElement)("button",{key:"r",type:"button",className:"gp-btn",style:{marginTop:8},onClick:a.onRetry},a.t("common.retry"))]);if(e===null)return(0,p.createElement)("div",{className:"gp-empty"},a.t("common.loading"));let s=(d,c,u,f,v)=>{let g=d.name,w=f==="local"&&e.current===d.name,k=f==="local"&&o.localPrimary===d.name||f==="remote"&&o.remotePrimary===d.name,y=`gp-branch-row${n===g?" gp-branch-row--active":""}${w?" gp-branch-row--current":""}${k?" gp-branch-row--primary":""}`,x=a.switchOptions.get(`${f}:${d.name}`),C=[w?a.t("overview.currentBranch"):"",k?a.t("overview.primaryBranch"):""].filter(Boolean).join(" \xB7 "),T=w?(0,p.createElement)(no,{size:14}):k?(0,p.createElement)(ro,{size:14}):v,F=(M,E)=>E&&E>0?(0,p.createElement)("span",{key:M,className:"gp-branch-row__sync",title:a.t(M==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:E}),"aria-label":a.t(M==="ahead"?"overview.branchAhead":"overview.branchBehind",{n:E})},[(0,p.createElement)(ao,{key:"icon",size:12,direction:M}),(0,p.createElement)("span",{key:"count"},E)]):null;return(0,p.createElement)("div",{key:d.name,className:y,style:{paddingLeft:oi+u*ii},title:d.name,"data-current":w?"true":void 0,"data-primary":k?"true":void 0,onClick:()=>a.onFilter(n===g?null:g)},[(0,p.createElement)("span",{key:"i",className:`gp-branch-row__ic${w?" gp-branch-row__ic--current":k?" gp-branch-row__ic--primary":""}`,title:C||void 0,"aria-label":C||void 0},T),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},c),d.ahead||d.behind?(0,p.createElement)("span",{key:"t",className:"gp-branch-row__track"},[F("ahead",d.ahead),F("behind",d.behind)]):null,x===void 0?null:(0,p.createElement)("button",{key:"sw",type:"button",className:"gp-branch-row__switch",title:a.t(x.createFrom===void 0?"switch.rowTitle":"switch.rowTitleTrack",{name:x.name,ref:x.label}),onClick:M=>{M.stopPropagation(),a.onSwitch(x)}},a.t("switch.action"))])},i=(d,c,u,f,v)=>{for(let g of d){if(g.kind==="leaf"){v.push(s(g.branch,g.label,c,u,f));continue}let w=`${u}:${g.path}`,k=c===0,y=r.has(w)?!k:k;v.push((0,p.createElement)("div",{key:w,className:"gp-branch-row gp-branch-row--dir",style:{paddingLeft:oi+c*ii},title:g.path,role:"button",tabIndex:0,"aria-expanded":y,onClick:()=>a.onToggle(w),onKeyDown:x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),a.onToggle(w))}},[(0,p.createElement)("span",{key:"c",className:"gp-branch-row__chev"},(0,p.createElement)(Lt,{size:11,open:y})),(0,p.createElement)("span",{key:"i",className:"gp-branch-row__ic gp-branch-row__ic--folder"},(0,p.createElement)(ja,{size:13})),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},g.label)])),y&&(g.self!==null&&v.push(s(g.self,g.path,c+1,u,f)),i(g.children,c+1,u,f,v))}},l=(d,c,u,f,v,g=[])=>{let w=[];if(!r.has(d)){for(let k of g)w.push(s(k,k.name,0,d,f));i(v,0,d,f,w)}return(0,p.createElement)("div",{key:d,className:"gp-branch-group"},[(0,p.createElement)("div",{key:"head",className:"gp-branch-group__head",onClick:()=>a.onToggle(d)},[(0,p.createElement)(Lt,{key:"c",size:11,open:!r.has(d)}),`${a.t(c)} (${u})`]),...w])};return(0,p.createElement)("div",{},[(0,p.createElement)("div",{key:"head-row",className:"gp-branch-row",style:{fontWeight:600,justifyContent:"center",padding:"4px 10px"},onClick:()=>a.onFilter(null)},a.t("overview.head")),l("local","overview.local",e.local.length,(0,p.createElement)(Lr,{size:13}),o.local,o.localPinned),l("remote","overview.remote",e.remote.length,(0,p.createElement)(Lr,{size:13}),o.remote),l("tags","overview.tags",e.tags.length,(0,p.createElement)(on,{size:13}),o.tags)])}function ol(e,t,n,r,a,o){if(typeof document>"u")return null;let s=(0,p.createElement)("div",{className:"gp-sheet-backdrop",onClick:i=>{i.target===i.currentTarget&&a.onClose()}},(0,p.createElement)("div",{className:"gp-sheet",role:"dialog","aria-modal":!0},[(0,p.createElement)("div",{key:"bar",className:"gp-sheet__bar"},[(0,p.createElement)("span",{key:"title",className:"gp-sheet__title"},a.t("overview.filterBranch")),(0,p.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-sheet__close",title:a.t("common.close"),onClick:a.onClose},(0,p.createElement)(gt,{size:15}))]),(0,p.createElement)("div",{key:"body",className:"gp-sheet__body"},di(e,t,n,r,a,o))]));return(0,ur.createPortal)(s,document.body,"branch-filter-sheet")}function il(e,t){let n=e.commit,r=n.refs.map(o=>(0,p.createElement)("span",{key:o.name,className:`gp-ref-chip${o.head?" gp-ref-chip--head":""}${o.kind==="remote"?" gp-ref-chip--remote":""}${o.kind==="tag"?" gp-ref-chip--tag":""}`},o.name)),a=(0,p.createElement)("div",{key:"g",className:"gp-graph-cell"},(0,p.createElement)(lo,{row:e,laneCount:t.laneCount,rowH:t.rowH,current:t.current}));return t.compact?(0,p.createElement)("div",{key:n.hash,className:`gp-commit-row gp-commit-row--compact${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl,height:`${t.rowH}px`},onClick:t.onSelect},[a,(0,p.createElement)("div",{key:"tx",className:"gp-commit-lines"},[(0,p.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,p.createElement)("div",{key:"m",className:"gp-commit-sub"},[(0,p.createElement)("span",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,p.createElement)("span",{key:"a",className:"gp-commit-author"},n.author),(0,p.createElement)("span",{key:"d",className:"gp-commit-date"},Ft(n.dateIso,t.now,t.t))])])]):(0,p.createElement)("div",{key:n.hash,className:`gp-commit-row${t.selected?" gp-commit-row--active":""}`,style:{gridTemplateColumns:t.gridTpl},onClick:t.onSelect,onMouseEnter:o=>t.onHoverEnter(n,o.clientX,o.clientY),onMouseLeave:t.onHoverLeave},[a,(0,p.createElement)("div",{key:"s",className:"gp-commit-subject"},[...r,n.subject]),(0,p.createElement)("div",{key:"h",className:"gp-commit-hash"},n.shortHash),(0,p.createElement)("div",{key:"a",className:"gp-commit-author"},n.author),(0,p.createElement)("div",{key:"d",className:"gp-commit-date",title:Gn(n.dateIso)},Ft(n.dateIso,t.now,t.t))])}function sl(e,t){let n=[],r=(a,o)=>{for(let s of a)if(s.dir){let i=t.collapsed.has(s.path);n.push((0,p.createElement)("div",{key:s.path,className:"gp-tree-row gp-tree-row--dir",style:{paddingLeft:10+o*14},title:i?t.expandLabel:t.collapseLabel,role:"button",tabIndex:0,"aria-expanded":!i,onClick:()=>t.onToggleDir(s.path),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t.onToggleDir(s.path))}},[(0,p.createElement)(Lt,{key:"c",size:11,open:!i}),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},s.name)])),i||r(s.children,o+1)}else{let i=String(s.meta??"modified"),l=t.activePath===s.path;n.push((0,p.createElement)("div",{key:s.path,className:`gp-tree-row${l?" gp-tree-row--active":""}`,style:{paddingLeft:10+o*14},title:t.openTitle,onClick:()=>t.onOpen(s.path)},[(0,p.createElement)("span",{key:"st",className:`gp-status-badge ${cn(i)}`},(Un[i]??i[0]??"M").toUpperCase()),(0,p.createElement)("span",{key:"n",className:"gp-tree-name"},s.name)]))}};return r(e,0),(0,p.createElement)("div",{},n)}function ll(e,t){if(e===null||typeof document>"u")return null;let{visible:n,data:r,error:a,mode:o,onMode:s,expanded:i,onExpand:l,onClose:d,remote:c,sessionId:u,compact:f,t:v}=t,g=f?["unified","before","after"]:["unified","split","before","after"],w=f&&o==="split"?"unified":o,k=r!==null&&r.text!==""?(()=>{let E=cr(r.text);return(0,p.createElement)("span",{key:"sum",className:"gp-modal__sum"},[(0,p.createElement)("span",{key:"a",className:"gp-stats__add"},`+${E.add}`),(0,p.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${E.del}`)])})():null,y=(0,p.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${i?" gp-seg__btn--active":""}`,disabled:w!=="split"&&w!=="unified",title:v(i?"diff.collapse":"diff.expandAll"),onClick:()=>l(!i)},v(i?"diff.collapse":"diff.expandAll")),x=(0,p.createElement)("div",{key:"seg",className:"gp-seg"},It(g,w,s,E=>v(`diff.${E}`))),C=(0,p.createElement)("button",{key:"close",type:"button",className:"gp-icon-btn gp-modal__close",title:v("common.close"),onClick:d},(0,p.createElement)(gt,{size:15})),T=[(0,p.createElement)("span",{key:"fileicon",className:"gp-modal__fileicon"},(0,p.createElement)(qa,{size:15})),(0,p.createElement)("span",{key:"path",className:"gp-modal__path",title:e.path},dl(e.path)),(0,p.createElement)("span",{key:"hash",className:"gp-modal__hash"},e.shortHash),k,y],F=f?[(0,p.createElement)("div",{key:"brow1",className:"gp-modal__bar-row"},T),(0,p.createElement)("div",{key:"brow2",className:"gp-modal__bar-row gp-modal__bar-row--controls"},[x,C])]:[...T,x,C],M=(0,p.createElement)("div",{className:"gp-modal-backdrop",onClick:E=>{E.target===E.currentTarget&&d()}},(0,p.createElement)("div",{className:"gp-modal",role:"dialog","aria-modal":!0},[(0,p.createElement)("div",{key:"bar",className:"gp-modal__bar"},F),(0,p.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},r===null?(0,p.createElement)("div",{className:"gp-empty"},v(a?"overview.diffFailed":"common.loading")):(0,p.createElement)(dr,{key:"diff",visible:n,text:r.text,mode:w,path:e.path,remote:c,sessionId:u,base:"commit",commit:e.hash,expanded:i,truncated:r.truncated===!0,newLines:r.newLines,t:v}))]));return(0,ur.createPortal)(M,document.body,"file-diff-modal")}function dl(e){let t=e.lastIndexOf("/");return t<0?[(0,p.createElement)("span",{key:"n",className:"gp-modal__name"},e)]:[(0,p.createElement)("span",{key:"d",className:"gp-modal__dir"},e.slice(0,t+1)),(0,p.createElement)("span",{key:"n",className:"gp-modal__name"},e.slice(t+1))]}var m=require("react");var wt=require("react");function ci(e,t,n,r,a,o){let[s,i]=(0,wt.useState)([]),[l,d]=(0,wt.useState)(null),[c,u]=(0,wt.useState)(null),f=(0,wt.useRef)(null),v=(0,wt.useRef)(0);Bt([t,...o],r,async y=>{let x=await e.query({sessionId:t,query:{kind:"stash-list"}});if(!y())return;let C=ve(x,"stash-list");C!==null?i(C.entries):a()},a);let g=l!==null&&n.changes.some(y=>y.path===l.path);(0,wt.useEffect)(()=>{l===null||g||(f.current=null,d(null),u(null))},[l,g]);let w=[t,...o,l?.path,l?.base,l?.expand,l?.version];Bt(w,r&&g,async y=>{if(l===null)return;let x=l,C=await e.query({sessionId:t,query:{kind:"diff",path:x.path,base:x.base,...x.expand?{context:2e3}:{}}});if(!y()||f.current!==x)return;let T=ve(C,"diff");u(T!==null?{text:T.text,newLines:T.newLines,truncated:T.truncated}:{text:"",newLines:0})},()=>u({text:"",newLines:0}));let k=(0,wt.useCallback)((y,x,C=!1)=>{let T={path:y,base:x,expand:C,version:++v.current};f.current=T,d(T),u(null)},[]);return{stashes:s,diffPath:l,diffData:c,expanded:l?.expand??!1,showDiff:k}}var Ke=require("react");function pi({stats:e,compact:t=!1,t:n}){let r=Date.now(),a=[(0,Ke.createElement)("span",{key:"files",className:"gp-stats__item"},n("stats.files",{n:e.fileCount})),(0,Ke.createElement)("span",{key:"lines",className:"gp-stats__item"},[(0,Ke.createElement)("span",{key:"a",className:"gp-stats__add"},`+${e.insertions}`)," ",(0,Ke.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${e.deletions}`)])];e.staged>0&&a.push((0,Ke.createElement)("span",{key:"st",className:"gp-stats__item"},n("stats.staged",{n:e.staged}))),e.modified>0&&a.push((0,Ke.createElement)("span",{key:"mo",className:"gp-stats__item"},n("stats.modified",{n:e.modified}))),e.untracked>0&&a.push((0,Ke.createElement)("span",{key:"un",className:"gp-stats__item"},n("stats.untracked",{n:e.untracked}))),e.partial&&a.push((0,Ke.createElement)("span",{key:"partial",className:"gp-stats__item gp-stats__partial",title:n("stats.partialHint")},n("stats.partial")));let o=[];e.lastChangeAt!==null&&o.push((0,Ke.createElement)("span",{key:"lc",className:"gp-stats__item",title:Gn(e.lastChangeAt)},n("stats.lastChange",{time:Ft(e.lastChangeAt,r,n)}))),e.headCommittedAt!==null&&o.push((0,Ke.createElement)("span",{key:"hc",className:"gp-stats__item",title:Gn(e.headCommittedAt)},n("stats.lastCommit",{time:Ft(e.headCommittedAt,r,n)})));let s=o.length>0?(0,Ke.createElement)("span",{key:"times",className:"gp-stats__times"},o):null;return t?(0,Ke.createElement)("div",{className:"gp-stats gp-stats--compact"},(0,Ke.createElement)("div",{key:"main",className:"gp-stats__main"},a)):(0,Ke.createElement)("div",{className:"gp-stats"},s===null?a:[...a,s])}function gr(e){return e.path+(e.staged?":s":":w")}function ui(e){return e.endsWith(":s")?"s":e.endsWith(":w")?"w":null}function fr(e){return ui(e)===null?e:e.slice(0,-2)}function gi(e){let t=new Set,n=new Set,r={w:t,s:n};for(let a of e){let o=ui(a);o!==null&&r[o].add(fr(a))}return{paths:[...t].sort(),stagedOnly:[...n].filter(a=>!t.has(a)).sort()}}var yn=require("react");function fi({paths:e,stagedOnly:t,snapshot:n,busy:r,error:a,onConfirm:o,onClose:s,t:i}){let l=(0,yn.useMemo)(()=>{let c=new Set(e);return n.changes.filter(u=>u.status==="untracked"&&c.has(u.path)).length},[e,n]),d=t.length>0||l>0?(0,yn.createElement)("div",{key:"notes"},[t.length>0?(0,yn.createElement)("div",{key:"staged",className:"gp-modal__confirmtext"},i("changes.discardPickedStaged",{count:t.length})):null,l>0?(0,yn.createElement)("div",{key:"untracked",className:"gp-modal__confirmtext"},i("changes.discardPickedUntracked",{count:l})):null]):null;return ot({title:i("changes.discardPickedTitle"),body:i("changes.discardPickedBody",{count:e.length}),extra:d,confirmLabel:i("changes.discard"),danger:!0,error:a,confirmBusy:r,busyLabel:i("changes.discarding"),onConfirm:o,onClose:s,t:i})}var Xe=require("react");function mi(e){let{snapshot:t,busy:n,t:r}=e,[a,o]=(0,Xe.useState)(!1),s=(0,Xe.useRef)(!1),{tipProps:i,tipNode:l,hideTip:d}=$t({placement:"below"});(0,Xe.useEffect)(()=>{d()},[t,d]);let c=async()=>{if(!s.current){s.current=!0,o(!0);try{await e.onRefresh()}finally{s.current=!1,o(!1)}}},u=n||a,f=(v,g,w,k,y,x="")=>(0,Xe.createElement)("button",{key:v,type:"button",className:`gp-icon-btn gp-changes__${v}${x}`,"aria-label":r(g),disabled:u||k,...v==="refresh"?{"aria-busy":a}:{},...i(r(g)),onClick:()=>{d(),y()}},(0,Xe.createElement)("span",{"aria-hidden":!0},w));return(0,Xe.createElement)("div",{className:"gp-toolbar gp-changes__toolbar",role:"group","aria-label":r("changes.actions")},[f("stage-all","changes.stageAll",(0,Xe.createElement)(Ja,{size:16}),t.changes.length===0,e.onStageAll),f("unstage-all","changes.unstageAll",(0,Xe.createElement)(Ka,{size:16}),t.staged===0,e.onUnstageAll),f("discard-picked","changes.discardPicked",(0,Xe.createElement)($n,{size:16}),!e.hasDiscardTargets,e.onDiscard),f("stash","changes.stash",(0,Xe.createElement)(On,{size:16}),t.staged===0&&t.modified===0,e.onStash),f("push","status.pushTitle",(0,Xe.createElement)(En,{size:16}),!zt(t),e.onPush),f("refresh","changes.refresh",(0,Xe.createElement)(ln,{size:16}),!1,()=>void c(),a?" gp-changes__refresh--busy":""),l])}var Jr=28,hi=26,cl=8,pl=600;function yi({remote:e,sessionId:t,visible:n=!0,snapshot:r,onAction:a,onRefresh:o,compact:s,t:i}){let{queryVisible:l,queryKey:d}=Fn(t,n,r.root),[c,u]=(0,m.useState)(new Set),[f,v]=(0,m.useState)(""),[g,w]=(0,m.useState)(!1),[k,y]=(0,m.useState)(!1),[x,C]=(0,m.useState)(!1),[T,F]=(0,m.useState)(!1),M=k||T,[E,J]=(0,m.useState)(null),[te,Z]=(0,m.useState)(new Set),[I,K]=(0,m.useState)(null),[U,se]=(0,m.useState)(!1),{stashes:de,diffPath:L,diffData:ne,expanded:ae,showDiff:oe}=ci(e,t,r,l,()=>J(i("error.generic")),d),[H,N]=(0,m.useState)(()=>r.defaultDiffView),[G,$]=(0,m.useState)(!1),[B,z]=(0,m.useState)(!1),[Y,S]=(0,m.useState)(!1),[W,be]=(0,m.useState)(null),ke=or(),[Le,De]=(0,m.useState)("list"),[Te,Fe]=(0,m.useState)(!1),[Je,ft]=(0,m.useState)(!0),[xt,Ze]=(0,m.useState)(!1),[Ve,Oe]=(0,m.useState)(null),et=(0,m.useRef)(null),O=(0,m.useRef)(null),pe=(0,m.useCallback)(P=>{et.current=P,P!==null&&s&&Te&&P.focus()},[s,Te]),{setEl:me,viewport:le}=gn(),{tipProps:Ne,tipNode:He,hideTip:Ge,showTipNow:mt}=$t({placement:"above",maxWidth:300}),Be=(0,m.useMemo)(()=>r.changes.filter(P=>P.staged).sort(Kr),[r]),Nt=(0,m.useMemo)(()=>r.changes.filter(P=>!P.staged&&P.status!=="untracked").sort(Kr),[r]),dt=(0,m.useMemo)(()=>r.changes.filter(P=>P.status==="untracked").sort(Kr),[r]),ct=[{key:"staged",labelKey:"changes.groupStaged",items:Be},{key:"unstaged",labelKey:"changes.groupUnstaged",items:Nt},{key:"untracked",labelKey:"changes.groupUntracked",items:dt}],Se={staged:r.stats.staged,unstaged:r.stats.modified,untracked:r.stats.untracked},ht=ct.filter(P=>P.items.length>0||r.truncated&&Se[P.key]>0),{items:qe,tops:pt,totalH:Et}=(0,m.useMemo)(()=>{let P=[];for(let ce of ht){let Me=r.truncated?Se[ce.key]:ce.items.length;if(P.push({kind:"head",g:{key:ce.key,labelKey:ce.labelKey,count:Me,collapsible:ce.items.length>0}}),!te.has(ce.key))for(let Pe of ce.items)P.push({kind:"row",c:Pe})}let j=pn(P.map(ce=>ce.kind==="head"?hi:Jr));return{items:P,tops:j,totalH:j[P.length]}},[Be,Nt,dt,te,r.truncated,r.stats]),kt=le.height>0?le.height:pl,{first:je,last:Mt}=un(pt,le.top,kt,cl*Jr);(0,m.useEffect)(()=>{Ge()},[je,Mt,r,Ge]),(0,m.useEffect)(()=>{u(P=>{if(P.size===0)return P;let j=new Set(r.changes.map(Pe=>gr(Pe))),ce=new Set,Me=!1;for(let Pe of P)j.has(Pe)?ce.add(Pe):Me=!0;return Me?ce:P})},[r]),(0,m.useEffect)(()=>{if(!l||!Qe.isVisible()||!g||G||f.trim()!=="")return;let P=!0;return e.query({sessionId:t,query:{kind:"last-commit-message"}}).then(j=>{let ce=ve(j,"last-commit-message");P&&ce!==null&&(v(ce.message),$(!0))}),()=>{P=!1}},[g,G,f,e,t,l]),(0,m.useEffect)(()=>{L===null&&De("list")},[L]),(0,m.useEffect)(()=>{Le==="diff"&&Fe(!1)},[Le]),(0,m.useEffect)(()=>{if(!s||!Te||typeof document>"u")return;let P=j=>{if(B)return;let ce=O.current;ce!==null&&j.target instanceof Node&&ce.contains(j.target)||j.target instanceof Element&&j.target.closest(".gp-notice")!==null||Fe(!1)};return document.addEventListener("pointerdown",P),()=>document.removeEventListener("pointerdown",P)},[s,Te,B]);let ie=(0,m.useRef)(null),Ue=(0,m.useRef)(!1);(0,m.useEffect)(()=>{let P=Ue.current;Ue.current=s&&Te,s&&P&&!Te&&ie.current?.focus({preventScroll:!0})},[s,Te]),(0,m.useEffect)(()=>{K(null)},[r]),(0,m.useEffect)(()=>{S(!1)},[r]);let Ie=(0,m.useMemo)(()=>gi(c),[c]);(0,m.useEffect)(()=>{U&&Ie.paths.length===0&&se(!1)},[U,Ie]);let Gt=P=>{u(j=>{let ce=new Set(j);return ce.has(P)?ce.delete(P):ce.add(P),ce})},Ae=async P=>{if(M)return!1;y(!0),J(null),be(null);try{let j=await a(P);return j.ok?!0:(J(j.error??i("error.generic")),!1)}catch(j){return J(j instanceof Error?j.message:i("error.generic")),!1}finally{y(!1)}},yt=async()=>{let P=f.trim();if(P===""&&!g){J(i("error.emptyMessage"));return}let j=c.size>0?[...new Set([...c].map(Me=>fr(Me)))]:void 0;await Ae({kind:"commit",message:P,...j?{paths:j}:{},...g?{amend:!0}:{}})&&(v(""),u(new Set),w(!1),$(!1),Fe(!1))},ee=async P=>{await Ae({kind:"stash-push",...P.trim()!==""?{message:P}:{}})&&Ze(!1)},V=(P,j)=>{Ae({kind:"stash-apply",index:P,sha:j})},he=(P,j)=>{Ae({kind:"stash-pop",index:P,sha:j})},tt=async(P,j)=>{await Ae({kind:"stash-drop",index:P,sha:j})&&Oe(null)},_t=async()=>{let P=[...Ie.paths];if(P.length===0){se(!1);return}await Ae({kind:"discard",paths:P})&&se(!1)},We=(P,j)=>{switch(P){case"empty-diff":return i("error.emptyDiff");case"llm-unavailable":return i("error.llmUnavailable");case"suggest-disabled":return i("error.suggestDisabled");case"llm-error":case"llm-output":return j===void 0?i("error.llmFailed"):`${i("error.llmFailed")}: ${j}`;default:return j??i("error.generic")}},ut=async()=>{if(B)return;if(g&&!Y&&f.trim()!==""){S(!0),J(null),be(i("commit.suggestOverwrite"));return}S(!1);let P=c.size>0?[...new Set([...c].map(j=>fr(j)))]:void 0;z(!0),J(null),be(null);try{let j=await e.suggest({sessionId:t,...P&&P.length>0?{paths:P}:{}});j.ok?(v(j.value.message),j.value.truncated===!0&&be(i("commit.suggestTruncated")),et.current?.focus()):J(We(j.error.code,j.error.message))}catch(j){J(j instanceof Error?j.message:i("error.generic"))}finally{z(!1)}},b=P=>{Z(j=>{let ce=new Set(j);return ce.has(P)?ce.delete(P):ce.add(P),ce})},ye=ne!==null&&ne.text!==""?cr(ne.text):null,$e=en({storageKey:"gp.changes.left",initial:380,min:220,reserve:200,edge:"end"}),nt=(P,j)=>{oe(P,j),s&&De("diff")},Jt=s?["unified","before","after"]:["unified","split","before","after"],bt=s&&H==="split"?"unified":H,fe=f.trim(),Pt=fe.split(`
818
+ `)[0]??"",wn=M||B||fe==="",Tr=(0,m.createElement)("div",{key:"box",className:"gp-commitbox",ref:O},[(0,m.createElement)("div",{key:"msg",className:`gp-commitbox__msg-wrap${B?" gp-commitbox__msg-wrap--busy":""}`},[(0,m.createElement)("textarea",{key:"ta",className:"gp-commitbox__msg",placeholder:i("commit.placeholder"),value:f,ref:pe,readOnly:B,"aria-busy":B,onChange:P=>v(P.target.value)}),B?(0,m.createElement)("span",{key:"spin",className:"gp-commitbox__spin","aria-hidden":"true"}):null]),(0,m.createElement)("div",{key:"row",className:"gp-commitbox__row"},[(0,m.createElement)("label",{key:"amend",className:"gp-commitbox__amend"},[(0,m.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:g,disabled:B,onChange:()=>{w(P=>!P),$(!1)}}),i("commit.amend")]),(0,m.createElement)("div",{key:"actions",className:"gp-commitbox__actions"},[r.suggestEnabled!==!1?(0,m.createElement)("button",{key:"suggest",type:"button",className:"gp-btn",disabled:M||B||r.changes.length===0,onClick:()=>void ut(),title:i("commit.suggest")},[(0,m.createElement)(Va,{key:"ic",size:13}),i(B?"commit.suggesting":"commit.suggest")]):null,(0,m.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary",disabled:wn,onClick:()=>void yt()},i("commit.commit")),s?(0,m.createElement)("button",{key:"fold",type:"button",className:"gp-icon-btn gp-commitbox__fold",disabled:B,title:i("commit.collapse"),"aria-label":i("commit.collapse"),onClick:()=>Fe(!1)},(0,m.createElement)(Lt,{key:"i",size:13,open:!0})):null])])]),Nr=!s||Te?Tr:(0,m.createElement)("div",{key:"box",className:"gp-commitbar"},[(0,m.createElement)("button",{key:"open",type:"button",className:"gp-commitbar__open",ref:ie,title:i("commit.edit"),"aria-label":i("commit.edit"),onClick:()=>Fe(!0)},fe===""?(0,m.createElement)("span",{key:"ph",className:"gp-commitbar__ph"},i("commit.placeholder")):(0,m.createElement)("span",{key:"draft",className:"gp-commitbar__draft"},Pt)),(0,m.createElement)("button",{key:"commit",type:"button",className:"gp-btn gp-btn--primary gp-commitbar__commit",disabled:wn,onClick:()=>void yt()},i("commit.commit"))]),xn=i("changes.untrackedCollapsed"),nn=i(r.truncatedReason==="lossy"?"changes.truncatedLossy":r.truncatedReason==="cap"?"changes.truncatedCap":"changes.truncatedUnknown",{n:r.changes.length}),kn=[(0,m.createElement)(pi,{key:"stats",stats:r.stats,compact:s,t:i}),(0,m.createElement)(mi,{key:"toolbar",snapshot:r,busy:M,hasDiscardTargets:Ie.paths.length>0,onStageAll:()=>void Ae({kind:"stage-all"}),onUnstageAll:()=>void Ae({kind:"unstage-all"}),onDiscard:()=>{J(null),se(!0)},onStash:()=>{J(null),Ze(!0)},onPush:()=>{Ge(),C(!0)},onRefresh:o,t:i}),E!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},E):null,W!==null?(0,m.createElement)(At,{key:"notice",text:W,closeLabel:i("common.close"),onClose:()=>be(null)}):null,r.untrackedCollapsed===!0&&!ke.isDismissed(xn)?(0,m.createElement)(At,{key:"collapsed",status:!0,text:xn,closeLabel:i("common.close"),onClose:()=>ke.dismiss(xn)}):null,r.truncated&&!ke.isDismissed(nn)?(0,m.createElement)(At,{key:"truncated",status:!0,text:nn,closeLabel:i("common.close"),onClose:()=>ke.dismiss(nn)}):null,(0,m.createElement)("div",{key:"list",className:"gp-changes__list",ref:me},r.changes.length===0?(0,m.createElement)("div",{className:"gp-empty"},i("changes.noChanges")):(0,m.createElement)("div",{className:"gp-changes__vlist",style:{height:Et}},qe.slice(je,Mt).map((P,j)=>{let ce=je+j;if(P.kind==="head"){let St=P.g;return(0,m.createElement)("div",{key:`h:${St.key}`,className:"gp-changes__vrow",style:{top:pt[ce],height:hi}},(0,m.createElement)("div",{className:`gp-group-head${St.collapsible?"":" gp-group-head--static"}`,...St.collapsible?{onClick:()=>b(St.key)}:{}},[St.collapsible?(0,m.createElement)(Lt,{key:"chev",size:12,open:!te.has(St.key)}):(0,m.createElement)("span",{key:"chev",className:"gp-group-head__chev-spacer"}),`${i(St.labelKey)} (${St.count})`]))}let Me=P.c,Pe=gr(Me),rn=Me.staged?"staged":"worktree";return(0,m.createElement)("div",{key:Pe,className:"gp-changes__vrow",style:{top:pt[ce],height:Jr}},fl(Me,{selected:c.has(Pe),active:L?.path===Me.path&&L.base===rn,busy:M,armed:I===Pe,onToggle:()=>Gt(Pe),onOpen:()=>nt(Me.path,rn),onStage:()=>void Ae(Me.staged?{kind:"unstage",paths:[Me.path]}:{kind:"stage",paths:[Me.path]}),onDiscard:()=>{I===Pe?(Ae({kind:"discard",paths:[Me.path]}),K(null)):K(Pe)},tipProps:Ne,hideTip:Ge,showTipNow:mt,t:i}))}))),de.length>0?(0,m.createElement)("div",{key:"stashes",className:"gp-stash"},[(0,m.createElement)("div",{key:"head",className:"gp-group-head",onClick:()=>ft(P=>!P)},[(0,m.createElement)(Lt,{key:"chev",size:12,open:!Je}),`${i("stash.section")} (${de.length})`]),Je?null:(0,m.createElement)("div",{key:"items"},de.map(P=>gl(P,{busy:M,onApply:()=>V(P.index,P.sha),onPop:()=>he(P.index,P.sha),onDrop:()=>{J(null),Oe(P)},t:i})))]):null,Nr],_n=L===null?(0,m.createElement)("div",{className:"gp-empty"},i("changes.selectFile")):(0,m.createElement)("div",{className:"gp-diff"},[(0,m.createElement)("div",{key:"tb",className:`gp-diff__toolbar${s?" gp-diff__toolbar--compact":""}`},(()=>{let P=s?(0,m.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>De("list")},[(0,m.createElement)(sn,{key:"i",size:14}),i("changes.backToList")]):null,j=(0,m.createElement)("span",{key:"path",className:"gp-diff__path"},L.path),ce=ye?(0,m.createElement)("span",{key:"sum",className:"gp-stats__item",style:{marginLeft:"auto"}},[(0,m.createElement)("span",{key:"a",className:"gp-stats__add"},`+${ye.add}`)," ",(0,m.createElement)("span",{key:"d",className:"gp-stats__del"},`\u2212${ye.del}`)]):null,Me=(0,m.createElement)("button",{key:"expand",type:"button",className:`gp-seg__btn gp-diff__expand${ae?" gp-seg__btn--active":""}`,style:ye||s?{}:{marginLeft:"auto"},disabled:bt!=="split"&&bt!=="unified",title:i(ae?"diff.collapse":"diff.expandAll"),onClick:()=>void oe(L.path,L.base,!ae)},i(ae?"diff.collapse":"diff.expandAll")),Pe=(0,m.createElement)("div",{key:"seg",className:"gp-seg"},It(Jt,bt,N,rn=>i(`diff.${rn}`)));return s?[(0,m.createElement)("div",{key:"row1",className:"gp-diff__toolbar-row"},[P,j,ce]),(0,m.createElement)("div",{key:"row2",className:"gp-diff__toolbar-row gp-diff__toolbar-row--controls"},[Me,Pe])]:[P,j,ce,Me,Pe]})()),ne===null?(0,m.createElement)("div",{key:"scroll",className:"gp-diff__scroll"},(0,m.createElement)("div",{className:"gp-empty"},i("common.loading"))):(0,m.createElement)(dr,{key:"diff",visible:l,text:ne.text,mode:bt,path:L.path,remote:e,sessionId:t,base:L.base,expanded:ae,truncated:ne.truncated===!0,newLines:ne.newLines,t:i})]),Dn=[x?(0,m.createElement)(pr,{key:"remote-push",remote:e,sessionId:t,snapshot:r,onAction:a,onClose:()=>C(!1),onBusyChange:F,t:i}):null,xt?(0,m.createElement)(ul,{key:"push",onClose:()=>Ze(!1),onStash:ee,error:E,t:i}):null,Ve!==null?ot({title:i("stash.dropTitle"),body:i("stash.dropConfirm",{name:Ve.message}),confirmLabel:i("stash.drop"),danger:!0,error:E,onConfirm:()=>void tt(Ve.index,Ve.sha),onClose:()=>Oe(null),t:i}):null,U&&Ie.paths.length>0?(0,m.createElement)(fi,{key:"discard-picked",paths:Ie.paths,stagedOnly:Ie.stagedOnly,snapshot:r,busy:M,error:E,onConfirm:()=>void _t(),onClose:()=>se(!1),t:i}):null];return s?(0,m.createElement)("div",{className:"gp-changes gp-changes--compact"},[...Dn,He,Le==="diff"?(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},_n):(0,m.createElement)("div",{key:"left",className:"gp-changes__left"},kn)]):(0,m.createElement)("div",{className:"gp-changes"},[...Dn,He,(0,m.createElement)("div",{key:"left",className:"gp-changes__left",style:{flex:`0 0 ${$e.width}px`}},kn),$e.divider,(0,m.createElement)("div",{key:"right",className:"gp-changes__right"},_n)])}function ul({onClose:e,onStash:t,error:n,t:r}){let[a,o]=(0,m.useState)("");return Ot({onClose:e,title:r("stash.title"),icon:(0,m.createElement)(On,{size:15}),portalKey:"stash-push-modal",t:r,body:[(0,m.createElement)("input",{key:"msg",className:"gp-input",placeholder:r("stash.messagePlaceholder"),value:a,autoFocus:!0,onChange:s=>o(s.target.value),onKeyDown:s=>{s.key==="Enter"&&t(a)}}),mn(r),n!==null?(0,m.createElement)("div",{key:"err",className:"gp-feedback"},n):null],footer:hn({onClose:e,onConfirm:()=>void t(a),confirmLabel:r("stash.save"),confirmDisabled:!1,danger:!1,t:r})})}function gl(e,t){return(0,m.createElement)("div",{key:e.index,className:"gp-stash-row"},[(0,m.createElement)("div",{key:"info",className:"gp-stash-row__info"},[(0,m.createElement)("span",{key:"m",className:"gp-stash-row__msg",title:e.message},e.message),(0,m.createElement)("span",{key:"meta",className:"gp-stash-row__meta"},[e.branch!==null?(0,m.createElement)("span",{key:"b"},t.t("stash.onBranch",{branch:e.branch})):null,e.relTime!==""?(0,m.createElement)("span",{key:"t"},e.relTime):null])]),(0,m.createElement)("div",{key:"act",className:"gp-stash-row__actions"},[(0,m.createElement)("button",{key:"apply",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onApply},t.t("stash.apply")),(0,m.createElement)("button",{key:"pop",type:"button",className:"gp-btn gp-btn--sm",disabled:t.busy,onClick:t.onPop},t.t("stash.pop")),(0,m.createElement)("button",{key:"drop",type:"button",className:"gp-icon-btn",disabled:t.busy,title:t.t("stash.drop"),onClick:t.onDrop},(0,m.createElement)($n,{size:14}))])])}function Kr(e,t){return e.path.localeCompare(t.path)}function fl(e,t){let n=e.path.split("/").pop()??e.path,r=e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):"";return(0,m.createElement)("div",{key:gr(e),className:`gp-file-row${t.active?" gp-file-row--active":""}`,onClick:t.onOpen},[(0,m.createElement)("input",{key:"cb",type:"checkbox",className:"gp-check",checked:t.selected,onClick:a=>a.stopPropagation(),onChange:t.onToggle}),(0,m.createElement)("span",{key:"st",className:`gp-status-badge ${cn(e.status)}`},Un[e.status]??"?"),(0,m.createElement)("span",{key:"nm",className:"gp-tree-name",title:e.path},[n,r?(0,m.createElement)("span",{key:"d",style:{color:"var(--dsw-alias-label-tertiary)",marginLeft:6,fontSize:11}},r):null]),(0,m.createElement)("span",{key:"act",className:"gp-file-row__actions"},[(0,m.createElement)("button",{key:"stg",type:"button",className:"gp-icon-btn","aria-label":e.staged?t.t("changes.unstage"):t.t("changes.stage"),disabled:t.busy,...t.tipProps(e.staged?t.t("changes.unstageTip"):t.t("changes.stageTip")),onClick:a=>{a.stopPropagation(),t.hideTip(),t.onStage()}},e.staged?"\u2212":"+"),e.staged?null:(0,m.createElement)("button",{key:"dis",type:"button",className:"gp-icon-btn","aria-label":t.armed?t.t("changes.discardConfirm"):t.t("changes.discard"),style:t.armed?{color:"var(--dsw-alias-state-error-primary)"}:{},disabled:t.busy,...t.tipProps(t.armed?t.t("changes.discardTipArmed"):t.t("changes.discardTip")),onClick:a=>{if(a.stopPropagation(),t.armed){t.hideTip(),t.onDiscard();return}t.onDiscard(),t.showTipNow(a.currentTarget,t.t("changes.discardTipArmed"))}},"\u21BA")])])}var h=require("react"),Mi=require("react-dom");var ze=require("@deepseek-ai/dsh-client-ui-primitives");var ge=require("react");function Vr(e){if(!Number.isFinite(e)||e<0)return"";if(e<1024)return`${e} B`;let t=["KB","MB","GB","TB"],n=e/1024,r=0;for(;(n>=1024||Number(n.toFixed(1))>=1024)&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(1)} ${t[r]}`}var ml={bash:"Bash",c:"C",cpp:"C++",csharp:"C#",css:"CSS",dockerfile:"Dockerfile",go:"Go",html:"HTML",java:"Java",javascript:"JavaScript",json:"JSON",jsx:"JSX",kotlin:"Kotlin",markdown:"Markdown",php:"PHP",python:"Python",ruby:"Ruby",rust:"Rust",scss:"SCSS",shellscript:"Shell",sql:"SQL",swift:"Swift",toml:"TOML",tsx:"TSX",typescript:"TypeScript",vue:"Vue",xml:"XML",yaml:"YAML"};function bi(e){return ml[e]??hl(e)}function hl(e){return e.charAt(0).toUpperCase()+e.slice(1)}var bn=require("@deepseek-ai/dsh-client-ui-primitives");function yl(e,t){let n=bl(e.path);if(e.kind==="binary")return t("files.propsTypeBinary");let r=Mn(e.path);if((e.kind==="image"||e.kind==="tooLarge")&&r!==null){let i=r.slice(6).toUpperCase();return t("files.propsTypeFmt",{label:t("files.propsTypeImage",{fmt:i}),ext:n})}let a=(0,bn.languageForPath)(e.path),s=a!==void 0&&a!==""?bi(a):e.kind==="tooLarge"?t("files.propsTypeUnread"):t("files.propsTypeText");return n===""?s:t("files.propsTypeFmt",{label:s,ext:n})}function bl(e){let t=e.slice(e.lastIndexOf("/")+1),n=t.lastIndexOf(".");return n>0?t.slice(n+1):""}function Xt(e,t,n){return{label:e,value:typeof t=="string"?(0,ge.createElement)("span",{},t):t,key:n}}function qr(e,t,n){return(0,ge.createElement)("div",{key:n,className:"gp-props__group"},[e!==null?(0,ge.createElement)("div",{key:"t",className:"gp-props__group-title"},e):null,...t.map(r=>(0,ge.createElement)("div",{key:r.key,className:"gp-props__row"},[(0,ge.createElement)("span",{key:"l",className:"gp-props__label"},r.label),(0,ge.createElement)("span",{key:"v",className:"gp-props__value"},r.value)]))])}function vi(e,t,n){return(0,ge.createElement)("button",{type:"button",className:"gp-props__copy",title:t,"aria-label":t,onClick:n},(0,ge.createElement)("code",{className:"gp-props__mono"},e))}function vl(e,t,n){let r=[],a=e.filter(o=>o.path===t&&!o.isDirectory);a.some(o=>o.staged)&&r.push((0,ge.createElement)("span",{key:"staged",className:"gp-props__badge gp-status--added"},n("files.propsStaged")));for(let o of a)o.staged||o.status==="untracked"||r.push((0,ge.createElement)("span",{key:o.status,className:`gp-props__badge ${cn(o.status)}`},wl(o.status,n)));return r}function wl(e,t){switch(e){case"added":return t("files.stAdded");case"modified":return t("files.stModified");case"deleted":return t("files.stDeleted");case"renamed":return t("files.stRenamed");case"untracked":return t("files.propsUntracked");case"conflicted":return t("files.stConflicted");case"typechange":return t("files.stTypechange")}}function wi({input:e,snapshot:t,onClose:n,t:r}){let[a,o]=(0,ge.useState)(null);(0,ge.useEffect)(()=>{if(e.kind!=="image"||e.dataUrl===void 0)return;let x=!0,C=new Image;return C.onload=()=>{x&&o({w:C.naturalWidth,h:C.naturalHeight})},C.src=e.dataUrl,()=>{x=!1}},[e.kind,e.dataUrl]);let[s,i]=(0,ge.useState)(null),l=(0,ge.useRef)(void 0);(0,ge.useEffect)(()=>{i(null)},[e.path]),(0,ge.useEffect)(()=>()=>{l.current!==void 0&&clearTimeout(l.current)},[]);let d=x=>{(0,bn.writeClipboard)(x).then(C=>{i(C?"copied":"error"),l.current!==void 0&&clearTimeout(l.current),l.current=setTimeout(()=>i(null),1600)})},c=e.path.lastIndexOf("/"),u=c<0?e.path:e.path.slice(c+1),f=[Xt(r("files.propsName"),(0,ge.createElement)("span",{className:"gp-props__strong"},u),"name"),Xt(r("files.propsType"),yl(e,r),"type"),Xt(r("files.propsRelPath"),vi(e.path,r("files.propsCopyHint"),()=>d(e.path)),"rel")];if(t!==null){let x=`${t.root}/${e.path}`;f.push(Xt(r("files.propsAbsPath"),vi(x,r("files.propsCopyHint"),()=>d(x)),"abs"))}let v=[];if(e.size!==void 0){let x=e.size>=1024?(0,ge.createElement)("span",{},[(0,ge.createElement)("span",{key:"h",className:"gp-props__strong"},Vr(e.size)),(0,ge.createElement)("span",{key:"b",className:"gp-props__sub"},r("files.propsSizeBytes",{bytes:e.size.toLocaleString("en-US")}))]):(0,ge.createElement)("span",{className:"gp-props__strong"},Vr(e.size));v.push(Xt(r("files.propsSize"),x,"size"))}e.kind==="text"&&e.lines!==void 0&&v.push(Xt(r("files.propsLines"),(0,ge.createElement)("span",{className:"gp-props__strong"},String(e.lines)),"lines")),a!==null&&v.push(Xt(r("files.propsImageSize"),(0,ge.createElement)("span",{className:"gp-props__strong"},r("files.propsImageSizeFmt",a)),"dims"));let g=[];e.mtimeMs!==void 0&&g.push(Xt(r("files.propsMtime"),(0,ge.createElement)("span",{title:Ft(e.mtimeMs,Date.now(),r)},Pn(e.mtimeMs)),"mtime"));let w=[qr(null,f,"g-basic"),v.length>0?qr(r("files.propsGroupStats"),v,"g-stats"):null,g.length>0?qr(r("files.propsGroupTime"),g,"g-time"):null],k=[];t!==null&&(k.push(e.ignored?(0,ge.createElement)("span",{key:"ig",className:"gp-props__badge gp-props__badge--muted"},r("files.ignored")):bo(t.changes,e.path)?(0,ge.createElement)("span",{key:"un",className:"gp-props__badge gp-props__badge--muted"},r("files.propsUntracked")):(0,ge.createElement)("span",{key:"tr",className:"gp-props__badge gp-props__badge--ok"},r("files.propsTrackedYes"))),k.push(...vl(t.changes,e.path,r)));let y=(0,ge.createElement)("div",{key:"status",className:"gp-modal__footer gp-props__statusbar","aria-live":"polite"},[k.length>0?(0,ge.createElement)("span",{key:"chips",className:"gp-props__footer-chips"},k):null,s!==null?(0,ge.createElement)("span",{key:"fb",className:`gp-props__copied${s==="error"?" gp-props__copied--err":""}`},r(s==="copied"?"files.pathCopied":"files.pathCopyFailed")):null]);return Ot({onClose:n,title:r("files.propsTitle"),icon:(0,ge.createElement)(bn.FileTypeIcon,{path:e.path,size:15}),body:w,footer:y,portalKey:"file-props",t:r})}function jr(e){return e.kind!=="text"?!1:e.size!==void 0?e.size<Vn:new TextEncoder().encode(e.content??"").length<Vn}function xi(e){return e.startsWith("/")||/^[A-Za-z]:[/\\]/.test(e)||e.startsWith("\\\\")}function xl(e){let t=e.replace(/[/\\]+$/,""),n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"))+1;return t.slice(0,n)}function kl(e,t){if(!(!/^https?:/.test(e)&&!e.startsWith("dsh-app://app/"))&&xi(t)&&!/^[/\\]{2}/.test(t)&&!/[\x00-\x1f\x7f]/.test(t))return new URL(`api/file?path=${encodeURIComponent(t)}`,e).href}function _l(e,t,n){let r=n.search(/[?#]/),a;try{a=decodeURIComponent(r===-1?n:n.slice(0,r))}catch{return}if(a.length!==0&&!(!/^[a-z]:[/\\]/i.test(a)&&/^[a-z][a-z\d+.-]*:/i.test(a))){if(!xi(a)){if(t===void 0)return;a=xl(t)+a}return kl(e,a)}}function ki(e,t){return{resolve:n=>_l(e,t,n)}}function Wr(e){let t=e.endsWith("\r")?e.slice(0,-1):e,n=/^ {0,3}(`{3,}|~{3,})(.*)$/.exec(t);if(n===null)return null;let r=n[1][0],a=n[2].trim();return r==="`"&&a.includes("`")?null:{marker:r,length:n[1].length,info:a}}function Ur(e,t){let n=Wr(e);return n!==null&&n.marker===t.marker&&n.length>=t.length&&n.info===""}function Sl(e){return/^mermaid(\s|$)/i.test(e)}function _i(e){let t=e.split(`
819
+ `),n=[],r=[],a=null,o=null,s=!1,i=()=>{if(r.length===0)return;let l=r.join(`
820
+ `);r=[],l!==""&&n.push({kind:"markdown",text:l})};for(let l of t){if(a!==null&&o!==null){Ur(l,o)?(n.push({kind:"mermaid",source:a.join(`
821
+ `)}),a=null,o=null):a.push(l);continue}if(o!==null){r.push(l),Ur(l,o)&&(o=null);continue}let d=Wr(l);if(d!==null&&Sl(d.info)){i(),s=!0,a=[],o=d;continue}r.push(l),d!==null&&(o=d)}return a!==null&&n.push({kind:"mermaid",source:a.join(`
822
+ `)}),i(),s?n:[{kind:"markdown",text:e}]}function Si(e){let t=e.split(`
823
+ `),n=null;return t.map(r=>{if(n!==null)return Ur(r,n)&&(n=null),r;let a=Wr(r);return a!==null?(n=a,r):Cl(r)}).join(`
824
+ `)}function Cl(e){let t=/(`+)[\s\S]*?\1/g,n=/<kbd>([\s\S]*?)<\/kbd>/gi,r=(i,l)=>Tl(l),a="",o=0,s;for(;(s=t.exec(e))!==null;)a+=e.slice(o,s.index).replace(n,r),a+=s[0],o=s.index+s[0].length;return a+e.slice(o).replace(n,r)}function Tl(e){let t=0;for(let a of e.match(/`+/g)??[])t=Math.max(t,a.length);let n="`".repeat(t+1),r=e.startsWith("`")||e.endsWith("`")?" ":"";return`${n}${r}${e}${r}${n}`}var lt=require("react"),Nl=require.async,Qr;function El(){return Qr??=Nl("./client.mermaid.js").then(e=>e,e=>{throw Qr=void 0,e}),Qr}function Ci(){return typeof document<"u"&&document.body.hasAttribute("data-ds-dark-theme")?"dark":"default"}function Ti({source:e,t}){let[n,r]=(0,lt.useState)(null),[a,o]=(0,lt.useState)(!1),[s,i]=(0,lt.useState)(Ci);return(0,lt.useEffect)(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;let l=new MutationObserver(()=>i(Ci()));return l.observe(document.body,{attributes:!0,attributeFilter:["data-ds-dark-theme"]}),()=>l.disconnect()},[]),(0,lt.useEffect)(()=>{let l=!0;return r(null),o(!1),El().then(d=>d.renderMermaid(e,s)).then(d=>{l&&r(d)}).catch(()=>{l&&o(!0)}),()=>{l=!1}},[e,s]),n!==null?(0,lt.createElement)("div",{className:"gp-mermaid","data-mermaid":"",dangerouslySetInnerHTML:{__html:n}}):a?(0,lt.createElement)("pre",{className:"gp-mermaid__fallback","data-mermaid-fallback":""},(0,lt.createElement)("code",null,e)):(0,lt.createElement)("div",{className:"gp-mermaid gp-mermaid--loading","data-mermaid":"loading",role:"status"},(0,lt.createElement)("span",{className:"gp-mermaid__loading-text"},t("files.mermaidLoading")))}function Gi(e){return/\.(?:md|markdown)$/i.test(e)}function Yr(e){return/\.(?:html?|xhtml)$/i.test(e)}function Ml(e){return Gi(e)||Yr(e)}var Gl=256*1024,Pl=5e3,Ni=5e3,mr=20,Ei=12,Rl=600,Ll=2e3,Dl=1024*1024;function Pi(e,t){return t<=Ll&&e.length<=Dl}var Al=6e4,yr=new Map;function zl(e,t){let n=t.file.kind==="loading"?{kind:"idle"}:t.file;yr.set(e,{state:{...t,file:n},leftAt:Date.now()})}function Fl(e){let t=yr.get(e);return t===void 0?null:Date.now()-t.leftAt>Al?(yr.delete(e),null):t.state}function Zr({remote:e,sessionId:t,compact:n,worktreeGen:r,snapshot:a,t:o}){let s=(0,h.useRef)(void 0);s.current===void 0&&(s.current=Fl(t));let i=s.current,[l,d]=(0,h.useState)(()=>i?.dirs??new Map),[c,u]=(0,h.useState)(()=>i?.open??new Set([""])),[f,v]=(0,h.useState)(()=>i?.selected??null),[g,w]=(0,h.useState)(()=>i?.file??{kind:"idle"}),[k,y]=(0,h.useState)(()=>i?.renderMarkdown??!0),[x,C]=(0,h.useState)(()=>i?.wrap??!0),[T,F]=(0,h.useState)("idle"),[M,E]=(0,h.useState)("idle"),[J,te]=(0,h.useState)(!1),[Z,I]=(0,h.useState)(!1),[K,U]=(0,h.useState)(()=>i?.pane??"tree"),se=(0,h.useId)(),de=(0,h.useMemo)(()=>({code:{copyLabel:o("files.copy"),copiedLabel:o("files.copied")},footnotes:o("files.footnotes")}),[o]),L=(0,h.useMemo)(()=>g.kind==="text"&&g.absolutePath!==void 0?ki(document.baseURI,g.absolutePath):void 0,[g]),ne=(0,h.useMemo)(()=>{if(g.kind==="text")return _i(g.content).map(O=>O.kind==="mermaid"?O:{kind:"markdown",text:Si(O.text)})},[g]),ae=(0,h.useRef)(0),oe=en({storageKey:"gp.files.left",initial:300,min:180,reserve:220,edge:"end"}),H=(0,h.useCallback)(O=>{d(pe=>{let me=pe.get(O);if(me!==void 0&&me.status!=="error")return pe;let le=new Map(pe);return le.set(O,{status:"loading"}),le}),e.query({sessionId:t,query:{kind:"dir-list",path:O}}).then(pe=>{let me=ve(pe,"dir-list");d(le=>{let Ne=new Map(le);return Ne.set(O,me===null?{status:"error"}:{status:"ready",entries:me.entries,truncated:me.truncated}),Ne})}).catch(()=>{d(pe=>{let me=new Map(pe);return me.set(O,{status:"error"}),me})})},[e,t]);(0,h.useEffect)(()=>{H("")},[H]);let N=(0,h.useRef)(r);(0,h.useEffect)(()=>{N.current!==r&&(N.current=r,yr.delete(t),d(new Map),u(new Set([""])),v(null),w({kind:"idle"}),U("tree"),H(""))},[r,t,H]);let G=(0,h.useCallback)(O=>{u(pe=>{let me=new Set(pe);return me.has(O)?(me.delete(O),me):(me.add(O),l.get(O)===void 0&&H(O),me)})},[l,H]),$=(0,h.useCallback)(O=>{v(O),n&&U("preview"),y(!Yr(O)),F("idle"),E("idle"),te(!1);let pe=++ae.current;w({kind:"loading",path:O}),e.query({sessionId:t,query:{kind:"file-content",path:O}}).then(me=>{if(pe!==ae.current)return;let le=ve(me,"file-content");if(le===null){w({kind:"error",path:O,...me.ok?{}:{code:me.error.code}});return}let Ne={...le.size!==void 0?{size:le.size}:{},...le.mtimeMs!==void 0?{mtimeMs:le.mtimeMs}:{}};if(le.tooLarge===!0){w({kind:"tooLarge",path:O,...Ne});return}if(le.variant==="image"&&le.dataUrl!==void 0){w({kind:"image",path:O,dataUrl:le.dataUrl,...Ne});return}if(le.variant==="text"){w({kind:"text",path:O,content:le.content??"",lines:le.lines??0,...Ne,...le.absolutePath!==void 0?{absolutePath:le.absolutePath}:{}});return}w({kind:"binary",path:O,...Ne})}).catch(()=>{pe===ae.current&&w({kind:"error",path:O})})},[e,t,n]),B=(0,h.useRef)({dirs:l,open:c,selected:f,file:g,renderMarkdown:k,wrap:x,pane:K});B.current={dirs:l,open:c,selected:f,file:g,renderMarkdown:k,wrap:x,pane:K},(0,h.useEffect)(()=>()=>{zl(t,B.current)},[t]);let z=(0,h.useRef)(!1);(0,h.useEffect)(()=>{z.current||(z.current=!0,i!==null&&i.selected!==null&&g.kind==="idle"&&$(i.selected))},[i,g.kind,$]);let Y=(0,h.useMemo)(()=>Ri("",0,{dirs:l,open:c,selected:f,toggleDir:G,selectFile:$,t:o}),[l,c,f,G,$,o]),S=async()=>{if(f===null)return;let O=ae.current,pe=await(0,ze.writeClipboard)(f);O===ae.current&&F(pe?"copied":"error")},W=async()=>{if(g.kind!=="text"||!jr(g))return;let O=ae.current,pe=await(0,ze.writeClipboard)(g.content);O===ae.current&&E(pe?"copied":"error")},be=(()=>{if(f===null||g.kind!=="text"&&g.kind!=="image"&&g.kind!=="binary"&&g.kind!=="tooLarge")return null;let O=f.lastIndexOf("/"),pe=O<0?"":f.slice(0,O),me=O<0?f:f.slice(O+1),le=l.get(pe),Ne=le?.status==="ready"?le.entries.find(He=>!He.dir&&He.name===me):void 0;return{path:f,kind:g.kind,...g.size!==void 0?{size:g.size}:{},...g.mtimeMs!==void 0?{mtimeMs:g.mtimeMs}:{},...g.kind==="text"?{lines:g.lines}:{},...g.kind==="image"?{dataUrl:g.dataUrl}:{},ignored:Ne?.ignored===!0}})(),ke=(0,h.createElement)("div",{key:"left",className:"gp-files__tree",style:n?void 0:{flex:`0 0 ${oe.width}px`}},Y),Le=g.kind==="text"&&Ml(g.path),De=Le?(0,h.createElement)(ze.SegmentedControl,{key:"mode",className:"gp-files__mode-seg",id:se,label:o("files.previewMode"),value:k?"render":"source",options:[{value:"source",label:o("files.source")},{value:"render",label:o("files.render")}],onChange:O=>y(O==="render")}):null,Te=g.kind==="text"?(0,h.createElement)("button",{key:"full",type:"button",className:"gp-files__props",title:o("files.fullscreen"),"aria-label":o("files.fullscreen"),onClick:()=>I(!0)},(0,h.createElement)(Oa,{size:14})):null,Fe=g.kind==="text"&&(Le?!k:!0),Je=g.kind==="text"?Pi(g.content,g.lines):!1,ft=Fe?(0,h.createElement)("button",{key:"wrap",type:"button",className:"gp-files__props",title:o(Je?"files.wrap":"files.wrapDisabled"),"aria-label":o("files.wrap"),"aria-pressed":Je&&x,disabled:!Je,onClick:()=>C(O=>!O)},(0,h.createElement)($a,{size:14})):null,xt=(0,h.createElement)("button",{key:"props",type:"button",className:"gp-files__props",title:o("files.propsTitle"),"aria-label":o("files.propsTitle"),disabled:be===null,onClick:()=>te(!0)},(0,h.createElement)(eo,{size:14})),Ze=n?(0,h.createElement)("div",{key:"bar",className:"gp-files__bar gp-files__bar--compact"},[(0,h.createElement)("button",{key:"back",type:"button",className:"gp-subhead__back",onClick:()=>U("tree")},[(0,h.createElement)(sn,{key:"i",size:14}),o("files.backToTree")]),De,(0,h.createElement)("div",{key:"end",className:"gp-files__bar-end"},[ft,Te,xt])]):null,Ve=n?null:(0,h.createElement)("div",{key:"bar",className:"gp-files__bar"},[(0,h.createElement)("code",{key:"path",className:"gp-files__path",title:f??""},f??""),De,(0,h.createElement)("div",{key:"copy",className:"gp-files__copy-group"},[(0,h.createElement)("button",{key:"copy-path",type:"button",className:`gp-files__copy-path${T==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{S()}},o(T==="copied"?"files.pathCopied":T==="error"?"files.pathCopyFailed":"files.copyPath")),jr(g)?(0,h.createElement)("button",{key:"copy-content",type:"button",className:`gp-files__copy-path${M==="error"?" gp-files__copy-path--error":""}`,"aria-live":"polite",onClick:()=>{W()}},o(M==="copied"?"files.contentCopied":M==="error"?"files.contentCopyFailed":"files.copyContent")):null]),ft,Te,xt]),Oe=Le?[(0,h.createElement)("div",{key:"src",id:`${se}-source-panel`,role:"tabpanel","aria-labelledby":`${se}-source`,style:k?{display:"none"}:{display:"contents"}},k?null:hr(g,!1,x,de,L,ne,o)),(0,h.createElement)("div",{key:"rnd",id:`${se}-render-panel`,role:"tabpanel","aria-labelledby":`${se}-render`,style:k?{display:"contents"}:{display:"none"}},k?hr(g,!0,x,de,L,ne,o):null)]:hr(g,k,x,de,L,ne,o),et=(0,h.createElement)("div",{key:"right",className:"gp-files__preview"},[f!==null?n?Ze:Ve:null,(0,h.createElement)("div",{key:"content",className:"gp-files__preview-content"},Oe),Z&&f!==null&&g.kind==="text"?(0,h.createElement)(Hl,{key:"full",file:g,renderMarkdown:k,wrap:x,markdownLabels:de,pathImages:L,markdownSegments:ne,onClose:()=>I(!1),t:o}):null,be!==null&&J?(0,h.createElement)(wi,{key:"props-modal",input:be,snapshot:a,onClose:()=>te(!1),t:o}):null]);return n?(0,h.createElement)("div",{className:"gp-files gp-files--compact"},K==="preview"?et:ke):(0,h.createElement)("div",{className:"gp-files"},[ke,oe.divider,et])}function hr(e,t,n,r,a,o,s){if(e.kind==="text"&&t&&Gi(e.path)&&o!==void 0){let i={labels:r,variant:"body",...a!==void 0?{pathImages:a}:{}};return o.length===1&&o[0].kind==="markdown"?(0,h.createElement)("div",{className:"gp-files__markdown"},(0,h.createElement)(ze.MarkdownText,{text:o[0].text,...i})):(0,h.createElement)("div",{className:"gp-files__markdown"},o.map((l,d)=>l.kind==="mermaid"?(0,h.createElement)(Ti,{key:d,source:l.source,t:s}):(0,h.createElement)(ze.MarkdownText,{key:d,text:l.text,...i})))}return e.kind==="text"&&t&&Yr(e.path)?(0,h.createElement)("iframe",{className:"gp-files__html",title:e.path,srcDoc:e.content,sandbox:"allow-scripts",referrerPolicy:"no-referrer"}):Bl(e,n,s)}function Hl(e){let{file:t,renderMarkdown:n,wrap:r,markdownLabels:a,pathImages:o,markdownSegments:s,onClose:i,t:l}=e,d=(0,h.useRef)(null),c=(0,h.useRef)(null);return rr(d,i,c),typeof document>"u"||t.kind!=="text"?null:(0,Mi.createPortal)((0,h.createElement)("div",{className:"gp-modal-backdrop",onClick:u=>{u.target===u.currentTarget&&i()}},(0,h.createElement)("div",{ref:d,className:"gp-modal",role:"dialog","aria-modal":!0,"aria-label":l("files.fullscreen")},[(0,h.createElement)("div",{key:"bar",className:"gp-modal__bar"},[(0,h.createElement)("code",{key:"path",className:"gp-modal__path",title:t.path},t.path),(0,h.createElement)("button",{key:"close",ref:c,type:"button",className:"gp-icon-btn gp-modal__close",title:l("common.close"),"aria-label":l("common.close"),onClick:i},(0,h.createElement)(gt,{size:15}))]),(0,h.createElement)("div",{key:"scroll",className:"gp-modal__scroll"},(0,h.createElement)("div",{key:"body",className:"gp-files__preview-content"},hr(t,n,r,a,o,s,l)))])),document.body,"file-fullscreen")}function Ri(e,t,n){let r=n.dirs.get(e);if(r===void 0||r.status==="loading")return t===0?[(0,h.createElement)("div",{key:"l",className:"gp-empty"},n.t("common.loading"))]:[(0,h.createElement)("div",{key:`l${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("common.loading"))];if(r.status==="error")return[(0,h.createElement)("div",{key:`e${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.loadFailed"))];let a=[];for(let o of r.entries){let s=e===""?o.name:`${e}/${o.name}`;if(o.dir){let i=n.open.has(s);a.push((0,h.createElement)("button",{key:s,type:"button",className:`gp-tree-row gp-files__entry gp-files__entry--dir${o.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-expanded":i,"aria-label":o.ignored?`${o.name} (${n.t("files.ignored")})`:o.name,onClick:()=>n.toggleDir(s)},[(0,h.createElement)("span",{key:"i",className:"gp-tree-ic"},i?(0,h.createElement)(ze.IconFolderOpenRegular,{size:16}):(0,h.createElement)(ze.IconFolderCloseRegular,{size:16})),(0,h.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)])),i&&a.push(...Ri(s,t+1,n))}else{let i=n.selected===s;a.push((0,h.createElement)("button",{key:s,type:"button",className:`gp-tree-row gp-files__entry${i?" gp-tree-row--active":""}${o.ignored?" gp-tree-row--ignored":""}`,style:{paddingLeft:8+t*16},"aria-current":i?"true":void 0,"aria-label":o.ignored?`${o.name} (${n.t("files.ignored")})`:o.name,onClick:()=>n.selectFile(s)},[(0,h.createElement)("span",{key:"i",className:"gp-tree-ic"},(0,h.createElement)(ze.FileTypeIcon,{path:s,size:16})),(0,h.createElement)("span",{key:"n",className:"gp-tree-name"},o.name)]))}}return r.truncated&&a.push((0,h.createElement)("div",{key:`t${e}`,className:"gp-tree-row gp-tree-row--muted",style:{paddingLeft:8+t*16}},n.t("files.truncated"))),a}function Bl(e,t,n){switch(e.kind){case"idle":return(0,h.createElement)("div",{className:"gp-empty"},n("files.selectFile"));case"loading":return(0,h.createElement)("div",{className:"gp-empty"},n("common.loading"));case"error":return(0,h.createElement)("div",{className:"gp-empty"},e.code==="file-not-found"?n("files.notFound"):n("files.loadFailed"));case"tooLarge":return(0,h.createElement)("div",{className:"gp-empty"},n("files.tooLarge"));case"binary":return(0,h.createElement)("div",{className:"gp-empty"},n("files.binary"));case"image":return(0,h.createElement)(Rn,{src:e.dataUrl,alt:e.path,t:n,viewportClass:"gp-files__image"});case"text":return(0,h.createElement)(Ol,{content:e.content,path:e.path,wrap:t,t:n})}}function Il(e,t){if(t==="")return[];let n=[];for(let r=0;r<e.length;r++)for(let[a,o]of er(e[r],t))if(n.push({line:r,start:a,end:o}),n.length>=Qn)return n;return n}function Ol({content:e,path:t,wrap:n,t:r}){let a=(0,h.useMemo)(()=>{let S=e.split(`
825
+ `);return S.length>0&&S[S.length-1]===""&&S.pop(),S},[e]),o=e.length>Gl||a.length>Pl,s=o?void 0:(0,ze.languageForPath)(t),i=(0,ze.useCodeHighlighter)(s),l=(0,h.useMemo)(()=>o?void 0:i(a.join(`
826
+ `)),[o,i,a]),[d,c]=(0,h.useState)(!1),[u,f]=(0,h.useState)(""),[v,g]=(0,h.useState)(!1),[w,k]=(0,h.useState)(0),{setEl:y,viewport:x,elRef:C}=gn(),T=(0,h.useRef)(null),F=(0,h.useRef)(null);(0,h.useEffect)(()=>{c(!1),f(""),k(0)},[t]);let M=Zn(u,Yn),E=(0,h.useMemo)(()=>a.map(S=>S.toLowerCase()),[a]),J=v?M:M.toLowerCase(),te=v?a:E,Z=(0,h.useMemo)(()=>Il(te,J),[te,J]);(0,h.useEffect)(()=>{k(0)},[J]);let I=Z.length===0?0:Math.min(w,Z.length-1),K=(0,h.useMemo)(()=>{let S=new Map;for(let W of Z){let be=S.get(W.line)??[];be.push([W.start,W.end]),S.set(W.line,be)}return S},[Z]);(0,h.useEffect)(()=>{let S=W=>{if(!((W.ctrlKey||W.metaKey)&&(W.key==="f"||W.key==="F")))return;let be=C.current;be===null||be.offsetParent===null||(W.preventDefault(),c(!0),requestAnimationFrame(()=>T.current?.select()))};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[]);let U=a.length,se=n&&Pi(e,U),de=(0,h.useMemo)(()=>pn(new Array(U).fill(mr)),[U]),L=x.height>0?x.height:Rl,{first:ne,last:ae}=un(de,x.top,L,Ei*mr),oe=Z.length>0?Z[I].line:-1,{first:H,last:N}=se?{first:0,last:U}:Wn({first:ne,last:ae},oe,U,Ei);(0,h.useEffect)(()=>{if(oe<0)return;let S=requestAnimationFrame(()=>F.current?.scrollIntoView({block:"center",inline:"nearest"}));return()=>cancelAnimationFrame(S)},[I,Z,oe]);let G=(0,h.useCallback)(S=>{k(W=>Z.length===0?0:(W+S+Z.length)%Z.length)},[Z.length]),$=Z.length>0?Z[I]:null,B=d?(0,h.createElement)(nr,{inputRef:T,query:u,matches:Z.length,active:I,caseSensitive:v,onChange:f,onToggleCase:()=>g(S=>!S),onStep:G,onClose:()=>c(!1),t:r}):null,z=o||d?(0,h.createElement)("div",{key:"hd",className:"gp-files__header"},[o?(0,h.createElement)("div",{key:"note",className:"gp-files__note"},r("files.highlightOff")):null,B]):null,Y=[];for(let S=H;S<N;S++)Y.push((0,h.createElement)("div",{key:S,className:"gp-files__row",style:se?void 0:{top:S*mr}},[(0,h.createElement)("div",{key:"n",className:"gp-diff-no"},S+1),$l(a[S],S,l?.[S],K.get(S),$,F,r)]));return(0,h.createElement)("div",{className:`gp-files__code gp-diff__scroll${se?" gp-files__code--wrap":" gp-files__code--nowrap"}`,ref:y},[z,(0,h.createElement)("div",{key:"grid",className:"gp-files__single gp-files__single--virt",...se?{}:{style:{height:U*mr}}},Y)])}function $l(e,t,n,r,a,o,s){if(e==="")return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},"\xA0");if(e.length>Ni)return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},[e.slice(0,Ni),(0,h.createElement)("span",{key:"trunc",className:"gp-files__trunc"},s("files.lineTruncated"))]);if(r===void 0||r.length===0)return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},n!==void 0?n.map((l,d)=>(0,h.createElement)("span",{key:d,style:l.style},l.text)):e);let i=a!==null&&a.line===t?[a.start,a.end]:null;return(0,h.createElement)("div",{key:`c${t}`,className:"gp-diff-cell"},tr(e,r,n,`c${t}`,i,o))}var br=require("react"),Xl=620;function Li(e){let[t,n]=(0,br.useState)(!1);return(0,br.useLayoutEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let r=()=>n(e.clientWidth>0&&e.clientWidth<=Xl);r();let a=new ResizeObserver(r);return a.observe(e),()=>a.disconnect()},[e]),t}var vr=require("react");function Di(){let[e,t]=(0,vr.useState)(()=>Qe.isVisible());return(0,vr.useEffect)(()=>{let n=()=>t(Qe.isVisible()),r=Qe.subscribe(n);return n(),r},[]),e}var zi="gp.panel.fontDelta";function Jl(){if(typeof localStorage>"u")return 0;let e=Number(localStorage.getItem(zi));return e===-1||e===1?e:0}function Fi({ctx:e,sessionId:t,t:n}){let r=Di(),[a,o]=(0,q.useState)(Jl),[s,i]=(0,q.useState)(null),[l,d]=(0,q.useState)(null),c=Li(l),u=Hn(t),f=Vt(e),v=u.state==="error"&&u.error.code==="git-unavailable",g=u.state==="error"&&(u.error.code==="not-a-git-repo"||u.error.code==="git-unavailable"),w=v&&u.state==="error"&&u.error.isGitRepo===!0,k=g?"files":s!==null&&s.sessionId===t?s.tab:null,y=(0,q.useRef)({tabs:new Set});y.current.sessionId!==t&&(y.current={sessionId:t,tabs:new Set}),k!==null&&y.current.tabs.add(k);let x=y.current.tabs.has("files");(0,q.useEffect)(()=>{if(!Ct(t))return;if(g){i(null);return}if(s?.sessionId===t)return;let H=Ga(t);if(H!==null){i({sessionId:t,tab:H});return}let N=La(t);if(N!==null){i({sessionId:t,tab:N});return}u.state==="ready"&&i({sessionId:t,tab:u.snapshot.dirty?"changes":"overview"})},[t,u,g,s?.sessionId]),(0,q.useEffect)(()=>{if(Ct(t))return Pa(t,H=>i({sessionId:t,tab:H}))},[t]);let C=(0,q.useRef)({tab:null});C.current={sessionId:t,tab:k},(0,q.useEffect)(()=>()=>{let{sessionId:H,tab:N}=C.current;H!==void 0&&N!==null&&Ra(H,N)},[]);let T=r&&Ct(t),[F,M]=(0,q.useState)(0),[E,J]=(0,q.useState)(!1),te=async H=>{if(!Ct(t))return{ok:!1,error:n("error.noCwd")};let N=await f.run({sessionId:t,action:H});return N.ok?(jt(t).accept(N.snapshot),H.kind==="branch-checkout"&&M(G=>G+1),{ok:!0}):(H.kind==="branch-checkout"&&H.stashMessage!==void 0&&M(G=>G+1),jt(t).resync(),{ok:!1,error:tn(N.error.code,N.error.message,n)})},Z=H=>{o(H),typeof localStorage<"u"&&localStorage.setItem(zi,String(H))},I=[{key:"overview",label:n("tab.overview"),icon:(0,q.createElement)(In,{size:14})},{key:"changes",label:n("tab.changes"),icon:(0,q.createElement)(Ba,{size:14})},{key:"files",label:n("tab.files"),icon:(0,q.createElement)(Wa,{size:14})}],K=g?I.filter(H=>H.key==="files"):I,U=(0,q.useId)(),se=K.map(H=>({value:H.key,label:[(0,q.createElement)("span",{key:"i",className:"gp-tab__icon"},H.icon),(0,q.createElement)("span",{key:"l",className:"gp-tab__label"},H.label)],id:`${U}-${H.key}`,panelId:`${U}-${H.key}-panel`})),de=k??K[0]?.key??"overview",L=!Ct(t)||u.state==="no-cwd"?(0,q.createElement)("div",{className:"gp-empty"},n("error.noCwd")):g?null:u.state==="error"?(0,q.createElement)("div",{className:"gp-empty"},n("pill.unavailable")):u.state==="cold"||u.state==="loading"||k===null?(0,q.createElement)("div",{className:"gp-empty"},n("common.loading")):null,ne=H=>{if(L!==null)return H===de?L:null;if(!Ct(t))return null;if(g)return x?(0,q.createElement)(Zr,{key:t,remote:f,sessionId:t,compact:c,worktreeGen:F,snapshot:null,t:n}):null;if(u.state!=="ready")return null;let N=u.snapshot;return H==="overview"?y.current.tabs.has("overview")?(0,q.createElement)(li,{key:t,remote:f,sessionId:t,visible:T&&k==="overview",defaultDiffView:N.defaultDiffView,snapshot:N,onAction:te,onResync:()=>jt(t).resync(),compact:c,t:n}):null:H==="changes"?y.current.tabs.has("changes")?(0,q.createElement)(yi,{key:t,remote:f,sessionId:t,visible:T&&k==="changes",snapshot:N,onAction:te,onRefresh:()=>jt(t).refresh(),compact:c,t:n}):null:x?(0,q.createElement)(Zr,{key:t,remote:f,sessionId:t,compact:c,worktreeGen:F,snapshot:N,t:n}):null},ae=K.map(H=>(0,q.createElement)("div",{key:H.key,id:`${U}-${H.key}-panel`,role:"tabpanel","aria-labelledby":`${U}-${H.key}`,style:de===H.key?{display:"contents"}:{display:"none"}},ne(H.key))),oe=w?(0,q.createElement)("div",{className:"gp-files-wrap"},[E?null:(0,q.createElement)(At,{key:"notice",text:n("files.gitNotInstalled"),closeLabel:n("common.close"),onClose:()=>J(!0)}),...ae]):(0,q.createElement)("div",{style:{display:"contents"}},ae);return(0,q.createElement)("div",{className:"gp-panel",ref:d,"data-conversation-composer-overlay":"","data-font-delta":a,"data-layout":c?"compact":"wide"},[(0,q.createElement)("div",{key:"tabs",className:"gp-tabbar"},[(0,q.createElement)(Ai.SegmentedTabs,{key:"switcher",className:`gp-tabbar__tabs${K.length===1?" gp-tabbar__tabs--single":""}`,label:n("panel.tabs"),items:se,value:de,onChange:H=>{let N=K.find(G=>G.key===H);N!==void 0&&Ct(t)&&i({sessionId:t,tab:N.key})}}),(0,q.createElement)("div",{key:"trailing",className:"gp-tabbar__trailing"},[(0,q.createElement)("div",{key:"font",className:"gp-font",role:"group","aria-label":n("panel.fontSize")},[(0,q.createElement)("button",{key:"dec",type:"button",className:"gp-font__decrease","aria-pressed":a===-1,onClick:()=>Z(-1),"aria-label":n("panel.fontDecrease")},"A\u2212"),(0,q.createElement)("button",{key:"reset",type:"button",className:"gp-font__reset","aria-pressed":a===0,onClick:()=>Z(0),"aria-label":n("panel.fontReset")},"A"),(0,q.createElement)("button",{key:"inc",type:"button",className:"gp-font__increase","aria-pressed":a===1,onClick:()=>Z(1),"aria-label":n("panel.fontIncrease")},"A+")]),c?null:(0,q.createElement)(Kl,{key:"ver",remote:f,t:n})])]),(0,q.createElement)("div",{key:"body",className:"gp-body"},oe)])}function Kl({remote:e,t}){let[n,r]=(0,q.useState)({kind:"idle"}),{tipProps:a,tipNode:o}=$t({placement:"below",maxWidth:300});(0,q.useEffect)(()=>{let d=!0;return e.version({}).then(c=>{d&&"current"in c&&r(u=>({...u,info:c}))}),()=>{d=!1}},[e]);let s=async()=>{r(c=>({kind:"checking",info:c.info}));let d=await e.version({check:!0});r({kind:"idle",info:"current"in d?d:void 0})},i=n.info,l=n.kind==="checking"?(0,q.createElement)("span",{className:"gp-verbar__status"},t("version.checking")):i===void 0||!i.checkedRemote?null:i.error!==void 0?(0,q.createElement)("span",{className:"gp-verbar__status gp-verbar__status--err",title:i.error},i.error==="repository is not configured"?t("version.noRepo"):t("version.error")):i.updateAvailable&&i.latest!==void 0?(0,q.createElement)("span",{},[(0,q.createElement)("span",{key:"s",className:"gp-verbar__status gp-verbar__status--new"},t("version.updateAvailable",{latest:i.latest,current:i.current})),i.releaseUrl!==void 0?(0,q.createElement)("a",{key:"l",className:"gp-verbar__link",href:i.releaseUrl,target:"_blank",rel:"noreferrer",style:{marginLeft:8}},t("version.viewRelease")):null]):(0,q.createElement)("span",{className:"gp-verbar__status gp-verbar__status--ok"},t("version.upToDate",{current:i.current}));return(0,q.createElement)("div",{className:"gp-verbar"},[i!==void 0?(0,q.createElement)("span",{key:"tag",className:"gp-verbar__tag"},`v${i.current}`):null,l,(0,q.createElement)("button",{key:"btn",type:"button",className:"gp-verbar__btn",disabled:n.kind==="checking",onClick:()=>void s()},[(0,q.createElement)("span",{key:"i",className:"gp-tab__icon"},(0,q.createElement)(ln,{size:12})),t("version.check")]),i?.repositoryUrl!==void 0?(0,q.createElement)("a",{key:"gh",className:"gp-icon-btn gp-verbar__gh gp-verbar__gh--starred",href:i.repositoryUrl,target:"_blank",rel:"noreferrer","aria-label":t("version.openRepo"),...a(t("version.openRepo"))},(0,q.createElement)(to,{size:15})):null,o])}var Ce=require("react"),Oi=require("react-dom");var Hi="data-gp-tab-dot",vn,ea=null,Bi="",xr=null,wr;function Vl(e){if(typeof document>"u")return null;let t=document.querySelectorAll(Tn);for(let n of t)if((n.textContent??"").trim()===e)return n;return null}function ta(){let e=Vl(Bi);if(e===null)return;let t=e.querySelector(`[${Hi}]`);if(xr===null){t?.remove();return}let n=`gp-tab-dot gp-tab-dot--${xr}`;if(t!==null){t.className!==n&&(t.className=n);return}let r=document.createElement("span");r.className=n,r.setAttribute(Hi,""),r.setAttribute("aria-hidden","true"),e.appendChild(r)}function ql(){if(typeof document>"u"||typeof MutationObserver>"u")return;let e=document.querySelector(Ea);if(e!==ea){if(vn?.disconnect(),ea=e,e===null){vn=void 0;return}vn=new MutationObserver(()=>ta()),vn.observe(e,{childList:!0,subtree:!0})}}function jl(){vn?.disconnect(),vn=void 0,ea=null}function Ii(e,t,n){if(!(typeof document>"u")){if(n===null){na(e);return}wr=e,Bi=t,xr=n,ql(),ta()}}function na(e){wr!==void 0&&wr!==e||(wr=void 0,xr=null,ta(),jl())}function Ul(e){let t=e.replace(/[/\\]+$/,"").split(/[/\\]/);return t[t.length-1]||e}function Wl(){let[e,t]=(0,Ce.useState)(!1),[n,r]=(0,Ce.useState)(null),a=(0,Ce.useRef)(null);return(0,Ce.useLayoutEffect)(()=>{if(!e||a.current===null){r(null);return}let i=a.current.getBoundingClientRect();r({left:i.left,bottom:window.innerHeight-i.top+8})},[e]),{bind:{ref:i=>{a.current=i},onMouseEnter:()=>t(!0),onMouseLeave:()=>t(!1)},render:i=>!e||n===null||typeof document>"u"?null:(0,Oi.createPortal)((0,Ce.createElement)("div",{className:"gp-tip",style:{left:n.left,bottom:n.bottom}},i.map((l,d)=>(0,Ce.createElement)("div",{key:d,className:d===0?"gp-tip__path":"gp-tip__note"},l))),document.body)}}function Ql(e){let[t,n]=(0,Ce.useState)(!1);return(0,Ce.useEffect)(()=>{if(e===null||typeof ResizeObserver>"u")return;let a=e.closest("[data-conversation-region]")??document.body,o=()=>n(a.clientWidth>0&&a.clientWidth<Yl);o();let s=new ResizeObserver(o);return s.observe(a),()=>s.disconnect()},[e]),t}var Yl=620;function $i({sessionId:e,t}){let n=Hn(e),r=Wl(),[a,o]=(0,Ce.useState)(null),s=Ql(a),i=(0,Ce.useRef)(Symbol("gp-tab-dot")),l=n.state==="ready"&&n.snapshot.showInputPill===!1?n.snapshot.dirty?"dirty":"synced":null,d=t("panel.tab");if((0,Ce.useEffect)(()=>{Ii(i.current,d,l);let k=i.current;return()=>{na(k)}},[d,l]),n.state==="cold"||n.state==="loading"||n.state==="no-cwd")return null;if(n.state==="error")return n.error.code==="not-a-git-repo"||n.error.code==="git-unavailable"||n.error.showInputPill===!1?null:(0,Ce.createElement)("span",{className:"gp-pill gp-pill--degraded",title:n.error.detail??t("pill.unavailable")},t("pill.unavailable"));let c=n.snapshot;if(c.showInputPill===!1)return null;let u=Ul(c.root),f=c.branch??`(${t("pill.detached")})`,v=c.dirty,g=v?"gp-pill--dirty":"gp-pill--synced",w=()=>{if(Aa(d)){za(d);return}Ct(e)&&Ma(e,v?"changes":"overview"),Da(d)};return(0,Ce.createElement)("span",{className:"gp-pill-wrap",ref:o},[(0,Ce.createElement)("button",{key:"btn",type:"button",className:`gp-pill ${g}${s?" gp-pill--compact":""}`,onClick:w,ref:r.bind.ref,onMouseEnter:r.bind.onMouseEnter,onMouseLeave:r.bind.onMouseLeave},[(0,Ce.createElement)("span",{key:"dot",className:"gp-pill__dot","aria-hidden":"true"}),(0,Ce.createElement)("span",{key:"repo",className:"gp-pill__repo"},u),(0,Ce.createElement)("span",{key:"git",className:"gp-pill__git"},["(",(0,Ce.createElement)("span",{key:"b",className:"gp-pill__branch"},f),")"])]),r.render([c.root,t(v?"pill.dirty":"pill.synced")])])}var D=require("react"),Sr=require("@deepseek-ai/dsh-client-ui-primitives");function Xi(e,t,n){return t===""?"":e.find(a=>a.id===t)?.models.some(a=>a.id===n)===!0?n:""}function ra(e,t,n,r){if(n==="")return"";let o=e.find(s=>s.id===t)?.models.find(s=>s.id===n)?.reasoning?.efforts;return o!==void 0&&o.some(s=>s.id===r)?r:""}function Zl(e){for(let t of e){let n=t.schema?.dict;if(n!==void 0&&"showInputPill"in n||JSON.stringify(t.schema).includes("showInputPill"))return t.ns}}var ed="",kr={min:at.maxBytes.min/1024,max:at.maxBytes.max/1024},_r={min:at.timeoutMs.min/1e3,max:at.timeoutMs.max/1e3};function aa(e,t){return Math.min(t.max,Math.max(t.min,Math.floor(e)))}function td(e){let t=e.trim();if(t==="")return null;let n=Number(t);return Number.isFinite(n)?n:null}function Ji({ctx:e,t}){let[,n]=(0,D.useState)(0),[r,a]=(0,D.useState)(!1),[o,s]=(0,D.useState)(!1),[i,l]=(0,D.useState)(null),[d,c]=(0,D.useState)(null),[u,f]=(0,D.useState)(null),[v,g]=(0,D.useState)(null),[w,k]=(0,D.useState)(null),[y,x]=(0,D.useState)(null),[C,T]=(0,D.useState)(null),[F,M]=(0,D.useState)(null),[E,J]=(0,D.useState)([]),[te,Z]=(0,D.useState)([]),[I,K]=(0,D.useState)("idle"),[U,se]=(0,D.useState)(null),[de,L]=(0,D.useState)(!1),[ne,ae]=(0,D.useState)(!1),[oe,H]=(0,D.useState)(!1),N=()=>{n(b=>b+1)},G=e.get("configForms"),$=(0,D.useMemo)(()=>G?.describe(),[G]);(0,D.useEffect)(()=>{if($!==void 0)return $.ensure(),$.subscribe(N)},[$]);let B=$?.getSnapshot().view,z=(0,D.useMemo)(()=>B===void 0?void 0:Zl(B.namespaces),[B]),Y=(0,D.useMemo)(()=>G!==void 0&&z!==void 0?G.get(z):void 0,[G,z]);(0,D.useEffect)(()=>{if(Y!==void 0)return Y.subscribe(N)},[Y]);let S=Y?.getSnapshot(),W=Y!==void 0&&S!==void 0&&S.status==="ready",be=$?.getSnapshot().status,ke=i??(typeof S?.value?.showInputPill=="boolean"?S.value.showInputPill:!0),Le=d??(S?.value?.defaultDiffView==="split"?"split":"unified"),De=u??(S?.value?.graphStyle==="compact"?"compact":"parallel"),Te=v??(typeof S?.value?.suggestEnabled=="boolean"?S.value.suggestEnabled:!0),Fe=S?.value?.suggestLanguage,Je=w??(typeof Fe=="string"&&qn.includes(Fe)?Fe:Ar),ft=aa(typeof S?.value?.suggestMaxBytes=="number"?S.value.suggestMaxBytes/1024:at.maxBytes.default/1024,kr),xt=aa(typeof S?.value?.suggestMaxOutputTokens=="number"?S.value.suggestMaxOutputTokens:at.maxOutputTokens.default,at.maxOutputTokens),Ze=aa(typeof S?.value?.suggestTimeoutMs=="number"?S.value.suggestTimeoutMs/1e3:at.timeoutMs.default/1e3,_r),Ve=typeof S?.value?.suggestProvider=="string"?S.value.suggestProvider:"",Oe=typeof S?.value?.suggestModel=="string"?S.value.suggestModel:"",et=typeof S?.value?.suggestReasoningEffort=="string"?S.value.suggestReasoningEffort:"",O=U?.provider??Ve,pe=U!==null?U.model:Ve!==""?Oe:"",me=U!==null?U.effort:et,le=O!==""&&pe!==""?me:"",Ne=E.find(b=>b.id===O),He=Ne?.models.find(b=>b.id===pe),Ge=He?.reasoning?.efforts,mt=()=>{K("loading"),Vt(e).query({sessionId:ed,query:{kind:"model-catalog"}}).then(b=>{let ye=ve(b,"model-catalog");if(ye===null){K("error");return}J(ye.groups),Z(ye.failures),K("ready")}).catch(()=>{K("error")})};(0,D.useEffect)(()=>{W&&I==="idle"&&mt()},[W]);let Be=async(b,ye,$e)=>{if(Y!==void 0){s(!1),a(!0);try{let nt=await Y.set(b,ye);$e(),nt?(Ut(),setTimeout(()=>Ut(),1e3)):s(!0)}catch{$e(),s(!0)}finally{a(!1)}}},Nt=b=>(l(b),Be("showInputPill",b,()=>l(null))),dt=b=>b===Le?Promise.resolve():(c(b),Be("defaultDiffView",b,()=>c(null))),ct=b=>b===De?Promise.resolve():(f(b),Be("graphStyle",b,()=>f(null))),Se=b=>(g(b),Be("suggestEnabled",b,()=>g(null))),ht=b=>b===Je?Promise.resolve():(k(b),Be("suggestLanguage",b,()=>k(null))),qe=async(b,ye,$e)=>{if(Y===void 0)return;s(!1),a(!0),se({provider:b,model:ye,effort:$e});let nt=!1;try{let Jt=await Y.set("suggestProvider",b),bt=await Y.set("suggestModel",ye),fe=await Y.set("suggestReasoningEffort",$e);nt=Jt&&bt&&fe,nt?(Ut(),setTimeout(()=>Ut(),1e3)):s(!0)}catch{s(!0)}finally{a(!1),(b===""||ye!==""||!nt)&&se(null)}},pt=b=>{if(b==="")return qe("","","");let ye=Xi(E,b,pe),$e=ra(E,b,ye,me);return qe(b,ye,$e)},Et=b=>{if(b==="")return qe(O,"","");let ye=ra(E,O,b,me);return qe(O,b,ye)},kt=b=>qe(O,pe,b),je=(b,ye,$e,nt,Jt,bt)=>{let fe=b===null?null:td(b);if(fe===null)return bt(),Promise.resolve();let Pt=Math.min(ye.max,Math.max(ye.min,Math.floor(fe)));return Jt(String(Pt)),Be(nt,Pt*$e,bt)},Mt=b=>je(b,kr,1024,"suggestMaxBytes",x,()=>x(null)),ie=b=>je(b,at.maxOutputTokens,1,"suggestMaxOutputTokens",T,()=>T(null)),Ue=b=>je(b,_r,1e3,"suggestTimeoutMs",M,()=>M(null)),Ie=[{id:"",label:t("cfg.suggestModelSession")},...E.map(b=>({id:b.id,label:b.name}))],Gt=[{id:"",label:t("cfg.suggestModelPick")},...(Ne?.models??[]).map(b=>({id:b.id,label:b.name}))],Ae=[{id:"",label:t("cfg.suggestEffortUnset")},...(Ge??[]).map(b=>({id:b.id,label:b.name}))],yt=(b,ye,$e,nt)=>Nn(b,ye,$e,{disabled:nt,extraClass:"gp-cfg__select-trigger"}),ee=r||S?.writable===!1,V=O===""?t("cfg.suggestModelSession"):E.find(b=>b.id===O)?.name??O,he=pe===""?t("cfg.suggestModelPick"):He?.name??pe,tt=le===""?t("cfg.suggestEffortUnset"):Ge?.find(b=>b.id===le)?.name??le,_t=(0,D.createElement)(Sr.Menu,{key:"provider",open:de,onClose:()=>L(!1),items:Ie,selectedId:O,onSelect:b=>{L(!1),pt(b)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:yt(de,V,()=>L(b=>!b),ee||I==="loading")}),We=(0,D.createElement)(Sr.Menu,{key:"model",open:ne,onClose:()=>ae(!1),items:Gt,selectedId:pe,onSelect:b=>{ae(!1),Et(b)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:yt(ne,he,()=>ae(b=>!b),ee||Ne===void 0)}),ut=(0,D.createElement)(Sr.Menu,{key:"effort",open:oe,onClose:()=>H(!1),items:Ae,selectedId:le,onSelect:b=>{H(!1),kt(b)},align:"start",portal:!0,className:"gp-cfg__menu",anchor:yt(oe,tt,()=>H(b=>!b),ee)});return G===void 0?(0,D.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded")):W?(0,D.createElement)("div",{className:"gp-cfg"},[(0,D.createElement)("h3",{key:"title",className:"gp-cfg__title"},t("cfg.title")),(0,D.createElement)("label",{key:"row",className:"gp-cfg__row"},[(0,D.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:ke,disabled:r||S?.writable===!1,onChange:b=>{Nt(b.currentTarget.checked)}}),(0,D.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.toggle"))]),(0,D.createElement)("p",{key:"hint",className:"gp-cfg__hint"},t("cfg.hint")),(0,D.createElement)("h3",{key:"difftitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.diffTitle")),(0,D.createElement)("div",{key:"diffseg",className:"gp-seg gp-cfg__seg"},It(["unified","split"],Le,b=>{dt(b)},b=>t(b==="unified"?"cfg.diffUnified":"cfg.diffSplit"),r||S?.writable===!1)),(0,D.createElement)("p",{key:"diffhint",className:"gp-cfg__hint"},t("cfg.diffHint")),(0,D.createElement)("h3",{key:"graphtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.graphTitle")),(0,D.createElement)("div",{key:"graphseg",className:"gp-seg gp-cfg__seg"},It(["parallel","compact"],De,b=>{ct(b)},b=>t(b==="parallel"?"cfg.graphParallel":"cfg.graphCompact"),r||S?.writable===!1)),(0,D.createElement)("p",{key:"graphhint",className:"gp-cfg__hint"},t("cfg.graphHint")),(0,D.createElement)("h3",{key:"sgtitle",className:"gp-cfg__title",style:{marginTop:6}},t("cfg.suggestTitle")),(0,D.createElement)("label",{key:"sgrow",className:"gp-cfg__row"},[(0,D.createElement)("input",{key:"switch",type:"checkbox",role:"switch",className:"gp-cfg__switch",checked:Te,disabled:r||S?.writable===!1,onChange:b=>{Se(b.currentTarget.checked)}}),(0,D.createElement)("span",{key:"text",className:"gp-cfg__text"},t("cfg.suggestToggle"))]),(0,D.createElement)("p",{key:"sglangtitle",className:"gp-cfg__seglabel"},t("cfg.suggestLangLabel")),(0,D.createElement)("div",{key:"sglang",className:"gp-seg gp-cfg__seg",role:"group","aria-label":t("cfg.suggestLangLabel")},It([...qn],Je,b=>{ht(b)},b=>t(b==="auto"?"cfg.suggestLangAuto":b==="zh"?"cfg.suggestLangZh":"cfg.suggestLangEn"),r||S?.writable===!1)),(0,D.createElement)("p",{key:"sglanghint",className:"gp-cfg__rangehint"},t("cfg.suggestLangHint")),(0,D.createElement)("div",{key:"numax",className:"gp-cfg__numrow"},[(0,D.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-maxkib"},t("cfg.suggestMaxBytesLabel")),(0,D.createElement)("input",{key:"input",id:"gp-cfg-maxkib",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:kr.min,max:kr.max,"aria-describedby":"gp-cfg-maxkib-hint",value:y??String(ft),disabled:r||S?.writable===!1,onChange:b=>{x(b.currentTarget.value)},onBlur:()=>{Mt(y)},onKeyDown:b=>{b.key==="Enter"&&b.currentTarget.blur()}}),(0,D.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestMaxBytesUnit"))]),(0,D.createElement)("p",{key:"numaxhint",id:"gp-cfg-maxkib-hint",className:"gp-cfg__rangehint"},t("cfg.suggestMaxBytesHint")),(0,D.createElement)("div",{key:"nuout",className:"gp-cfg__numrow"},[(0,D.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-outtok"},t("cfg.suggestOutputLabel")),(0,D.createElement)("input",{key:"input",id:"gp-cfg-outtok",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:at.maxOutputTokens.min,max:at.maxOutputTokens.max,"aria-describedby":"gp-cfg-outtok-hint",value:C??String(xt),disabled:r||S?.writable===!1,onChange:b=>{T(b.currentTarget.value)},onBlur:()=>{ie(C)},onKeyDown:b=>{b.key==="Enter"&&b.currentTarget.blur()}}),(0,D.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestOutputUnit"))]),(0,D.createElement)("p",{key:"nuouthint",id:"gp-cfg-outtok-hint",className:"gp-cfg__rangehint"},t("cfg.suggestOutputHint")),(0,D.createElement)("div",{key:"nuto",className:"gp-cfg__numrow"},[(0,D.createElement)("label",{key:"lab",className:"gp-cfg__numlabel",htmlFor:"gp-cfg-timeout"},t("cfg.suggestTimeoutLabel")),(0,D.createElement)("input",{key:"input",id:"gp-cfg-timeout",type:"number",className:"gp-cfg__numinput",inputMode:"numeric",min:_r.min,max:_r.max,"aria-describedby":"gp-cfg-timeout-hint",value:F??String(Ze),disabled:r||S?.writable===!1,onChange:b=>{M(b.currentTarget.value)},onBlur:()=>{Ue(F)},onKeyDown:b=>{b.key==="Enter"&&b.currentTarget.blur()}}),(0,D.createElement)("span",{key:"unit",className:"gp-cfg__numunit"},t("cfg.suggestTimeoutUnit"))]),(0,D.createElement)("p",{key:"nutohint",id:"gp-cfg-timeout-hint",className:"gp-cfg__rangehint"},t("cfg.suggestTimeoutHint")),(0,D.createElement)("div",{key:"sgmodel",className:"gp-cfg__menur"},[(0,D.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestModelLabel")),_t]),O!==""?(0,D.createElement)("div",{key:"sgmodel2",className:"gp-cfg__menur"},[(0,D.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestProviderLabel")),We]):null,O!==""&&pe!==""&&Ge!==void 0&&Ge.length>0?(0,D.createElement)("div",{key:"sgeffort",className:"gp-cfg__menur"},[(0,D.createElement)("span",{key:"lab",className:"gp-cfg__menulabel"},t("cfg.suggestEffortLabel")),ut]):null,I==="loading"?(0,D.createElement)("p",{key:"sgload",className:"gp-cfg__rangehint"},t("cfg.suggestModelLoading")):I==="error"?(0,D.createElement)("p",{key:"sgerr",className:"gp-cfg__err",role:"alert"},[t("cfg.suggestModelFailed")," ",(0,D.createElement)("button",{key:"retry",type:"button",className:"gp-cfg__retry",onClick:()=>{mt()}},t("cfg.suggestModelRetry"))]):te.length>0?(0,D.createElement)("p",{key:"sgfail",className:"gp-cfg__rangehint"},`${t("cfg.suggestModelFailed")}: ${te.map(b=>b.name).join(", ")}`):E.length===0?(0,D.createElement)("p",{key:"sgempty",className:"gp-cfg__rangehint"},t("cfg.suggestModelEmpty")):null,(0,D.createElement)("p",{key:"sghint2",className:"gp-cfg__hint"},t("cfg.suggestHint")),o?(0,D.createElement)("p",{key:"error",className:"gp-cfg__err",role:"alert"},t("cfg.saveFailed")):null]):be==="idle"||be==="loading"?(0,D.createElement)("p",{className:"gp-cfg__hint"},t("common.loading")):(0,D.createElement)("p",{className:"gp-cfg__hint"},t("cfg.notLoaded"))}var Ln="gitPanel",nd=["dsh-git-panel","@xbzbing/dsh-git-panel"],rd=["slots","locale","connection"],ad="dsh-git-panel";function od(e){ya(),Sa(e),e.effect(()=>e.locale.register(Ln,{zh:ba,en:va})??void 0,"dsh-git-panel: dictionaries");let t=e.locale.bind(Ln),n=[],r=a=>{typeof a=="function"&&n.push(a)};r(e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"git-panel",order:30,locale:Ln,label:()=>t("panel.tab")},a=>(0,Cr.createElement)(Fi,{ctx:e,sessionId:a.sessionId,t})))),r(e.slots.inject("conversation.input.left",()=>e.slots.register({name:"conversation.input.left",id:"git-panel-pill",order:100,locale:Ln},a=>(0,Cr.createElement)($i,{sessionId:a.sessionId,t}))));for(let a of nd)r(e.slots.inject("plugins.bundle.config",()=>e.slots.register({name:"plugins.bundle.config",key:a,locale:Ln},o=>o.view==="summary"?t("cfg.title"):(0,Cr.createElement)(Ji,{ctx:e,t}))));e.effect(()=>{let a=e.on("connection/reset",()=>Ut());return()=>{typeof a=="function"&&a();for(let o of n.splice(0))try{o()}catch{}Na()}},"dsh-git-panel: lifecycle")}module.exports={name:ad,inject:rd,apply:od};
677
827
  return module.exports;
678
828
  } });