@pstdio/ui 0.2.4 → 0.3.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.
Files changed (30) hide show
  1. package/dist/chat-ui.js +705 -690
  2. package/dist/chat-ui.js.map +1 -1
  3. package/dist/components/chat-ui/agent-types.d.ts +11 -1
  4. package/dist/components/chat-ui/components/ai-message.d.ts +3 -10
  5. package/dist/components/chat-ui/components/chat-panel-alerts.stories.d.ts +9 -0
  6. package/dist/components/chat-ui/components/chat-panel.d.ts +2 -0
  7. package/dist/components/chat-ui/components/message-parts-renderer.stories.d.ts +1 -0
  8. package/dist/components/chat-ui/components/workspace-hub.d.ts +3 -0
  9. package/dist/components/chat-ui/index.d.ts +1 -0
  10. package/dist/components/menu-item.d.ts +0 -1
  11. package/dist/components/searchable-menu.d.ts +32 -0
  12. package/dist/components/searchable-menu.stories.d.ts +6 -0
  13. package/dist/components/searchable-menu.test.d.ts +1 -0
  14. package/dist/components/sidebar-tree/searchable-action-menu.d.ts +6 -0
  15. package/dist/components/sidebar-tree/sidebar-tree-searchable-action-menu.stories.d.ts +6 -0
  16. package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +2 -0
  17. package/dist/components/tickets/ticket-card.stories.d.ts +1 -0
  18. package/dist/empty-state-yGspgiPl.js +185 -0
  19. package/dist/empty-state-yGspgiPl.js.map +1 -0
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.js +1497 -1417
  22. package/dist/index.js.map +1 -1
  23. package/dist/theme/global.d.ts +10 -0
  24. package/dist/{theme-C7CIuIPZ.js → theme-BFV2Q048.js} +18 -8
  25. package/dist/theme-BFV2Q048.js.map +1 -0
  26. package/dist/theme.js +1 -1
  27. package/package.json +7 -7
  28. package/dist/empty-state-DHSKuwia.js +0 -160
  29. package/dist/empty-state-DHSKuwia.js.map +0 -1
  30. package/dist/theme-C7CIuIPZ.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as i, jsxs as b, Fragment as Ue } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as b, Fragment as Ve } from "react/jsx-runtime";
2
2
  import { c as y } from "react/compiler-runtime";
3
- import { chakra as wt, AbsoluteCenter as _t, IconButton as rt, defineSlotRecipe as Pt, createSlotRecipeContext as Rt, Text as re, Code as Xe, Button as me, HStack as st, Box as k, Flex as V, Tooltip as Ce, Portal as It, Kbd as vt, Spacer as Bt, Timeline as Mt, Span as pe, Avatar as se, Card as A, Link as it, Stack as he, Spinner as At, Skeleton as Dt } from "@chakra-ui/react";
4
- import { ArrowDownIcon as zt, ShieldX as $t, ShieldCheck as Et, Square as Ft, ArrowUp as Lt, Move as Ot, FileDown as Ht, FileUp as Wt, FileDiff as jt, Trash2 as Nt, FilePen as Ut, FileText as Vt, ListTree as qt, Terminal as lt, File as Gt, Globe as Kt, Search as Yt, AlertTriangle as Xt, DotIcon as Jt, ChevronUpIcon as Qt, MessageCircleIcon as Zt } from "lucide-react";
5
- import { StickToBottom as en, useStickToBottomContext as Ve } from "use-stick-to-bottom";
6
- import { S as ct } from "./tooltip-Dze4WXVl.js";
7
- import { useRef as je, useEffect as Ne, useState as oe } from "react";
8
- import { f as Oe, P as tn, g as nn, R as at, h as on } from "./rich-message-ZT2CEiwt.js";
3
+ import { chakra as Pt, AbsoluteCenter as It, IconButton as lt, defineSlotRecipe as vt, createSlotRecipeContext as At, Text as Y, Code as Qe, Button as Se, HStack as ke, Box as k, Flex as $, Tooltip as Ae, Portal as Bt, Kbd as Dt, Spacer as Mt, Timeline as zt, Span as ye, Avatar as ae, Card as E, Link as at, Stack as Te, Spinner as qe, Skeleton as Et } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as $t, ShieldX as Lt, ShieldCheck as Ft, Square as Ot, ArrowUp as Wt, Move as Ht, FileDown as jt, FileUp as Nt, FileDiff as Ut, Trash2 as Vt, FilePen as qt, FileText as Gt, ListTree as Kt, Terminal as ct, File as Xt, Globe as Yt, Search as Jt, AlertTriangle as dt, DotIcon as Qt, ChevronUpIcon as Zt, MessageCircleIcon as en } from "lucide-react";
5
+ import { StickToBottom as tn, useStickToBottomContext as Ge } from "use-stick-to-bottom";
6
+ import { S as ut } from "./tooltip-Dze4WXVl.js";
7
+ import { useRef as Ne, useEffect as Ue, useState as le } from "react";
8
+ import { f as We, P as nn, g as rn, R as ft, h as on } from "./rich-message-ZT2CEiwt.js";
9
9
  import "@lexical/react/LexicalCollaborationContext";
10
10
  import "@lexical/react/LexicalCollaborationPlugin";
11
11
  import "@lexical/react/LexicalComposer";
@@ -29,13 +29,13 @@ import "@lexical/react/LexicalAutoFocusPlugin";
29
29
  import "@lexical/react/LexicalHistoryPlugin";
30
30
  import "@lexical/react/LexicalOnChangePlugin";
31
31
  import "@lexical/react/LexicalTreeView";
32
- import { D as rn, a as dt, E as sn } from "./empty-state-DHSKuwia.js";
33
- const ln = {
32
+ import { D as sn, a as pt, A as Ze, E as ln } from "./empty-state-yGspgiPl.js";
33
+ const an = {
34
34
  "aria-roledescription": "conversation",
35
35
  initial: "instant",
36
36
  resize: "instant",
37
37
  role: "log"
38
- }, cn = wt(en, {
38
+ }, cn = Pt(tn, {
39
39
  base: {
40
40
  position: "relative",
41
41
  flex: 1,
@@ -44,42 +44,42 @@ const ln = {
44
44
  }
45
45
  }, {
46
46
  forwardProps: ["resize"],
47
- defaultProps: ln
48
- }), an = (t) => {
47
+ defaultProps: an
48
+ }), dn = (t) => {
49
49
  const e = y(9);
50
- let n, o;
50
+ let n, r;
51
51
  e[0] !== t ? ({
52
52
  children: n,
53
- ...o
54
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
53
+ ...r
54
+ } = t, e[0] = t, e[1] = n, e[2] = r) : (n = e[1], r = e[2]);
55
55
  const {
56
- contentRef: r,
56
+ contentRef: o,
57
57
  scrollRef: s
58
- } = Ve(), l = s, c = r;
59
- let a;
60
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
58
+ } = Ge(), l = s, a = o;
59
+ let c;
60
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
61
61
  p: "sm",
62
62
  "aria-live": "polite",
63
63
  role: "list"
64
- }, e[3] = a) : a = e[3];
64
+ }, e[3] = c) : c = e[3];
65
65
  let d;
66
- return e[4] !== n || e[5] !== o || e[6] !== l || e[7] !== c ? (d = /* @__PURE__ */ i(ct, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: l, contentRef: c, contentProps: a, children: n }), e[4] = n, e[5] = o, e[6] = l, e[7] = c, e[8] = d) : d = e[8], d;
67
- }, dn = {
66
+ return e[4] !== n || e[5] !== r || e[6] !== l || e[7] !== a ? (d = /* @__PURE__ */ i(ut, { ...r, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: l, contentRef: a, contentProps: c, children: n }), e[4] = n, e[5] = r, e[6] = l, e[7] = a, e[8] = d) : d = e[8], d;
67
+ }, un = {
68
68
  axis: "horizontal",
69
69
  bottom: "md",
70
70
  zIndex: 2
71
- }, un = (t) => {
71
+ }, fn = (t) => {
72
72
  const e = y(4), {
73
73
  isAtBottom: n,
74
- scrollToBottom: o
75
- } = Ve();
76
- let r;
77
- return e[0] !== n || e[1] !== t || e[2] !== o ? (r = !n && /* @__PURE__ */ i(_t, { ...dn, children: /* @__PURE__ */ i(rt, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ i(zt, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = r) : r = e[3], r;
74
+ scrollToBottom: r
75
+ } = Ge();
76
+ let o;
77
+ return e[0] !== n || e[1] !== t || e[2] !== r ? (o = !n && /* @__PURE__ */ i(It, { ...un, children: /* @__PURE__ */ i(lt, { rounded: "full", onClick: () => r(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ i($t, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = r, e[3] = o) : o = e[3], o;
78
78
  }, He = {
79
79
  Root: cn,
80
- Viewport: an,
81
- ScrollToBottom: un
82
- }, fn = Pt({
80
+ Viewport: dn,
81
+ ScrollToBottom: fn
82
+ }, pn = vt({
83
83
  className: "ai-message",
84
84
  slots: ["root", "content"],
85
85
  base: {
@@ -89,6 +89,9 @@ const ln = {
89
89
  alignItems: "end",
90
90
  justifyContent: "end",
91
91
  gap: "sm",
92
+ animationName: "message-fade-in",
93
+ animationDuration: "200ms",
94
+ animationTimingFunction: "ease-out",
92
95
  "&:has(+ [data-scope='ai-message'][data-part='root'])": {
93
96
  mb: 0
94
97
  }
@@ -112,6 +115,8 @@ const ln = {
112
115
  border: "1px solid",
113
116
  borderColor: "border.muted",
114
117
  bg: "bg.subtle",
118
+ px: "xs",
119
+ py: "xs",
115
120
  width: "full",
116
121
  borderBottomRightRadius: 0
117
122
  }
@@ -142,24 +147,15 @@ const ln = {
142
147
  gap: "xs"
143
148
  },
144
149
  content: {
145
- px: "xs",
146
- py: "xs",
147
150
  textStyle: "xs"
148
151
  }
149
152
  },
150
- md: {
151
- content: {
152
- px: "xs",
153
- py: "xs"
154
- }
155
- },
153
+ md: {},
156
154
  lg: {
157
155
  root: {
158
156
  gap: "md"
159
157
  },
160
158
  content: {
161
- px: "sm",
162
- py: "xs",
163
159
  textStyle: "md"
164
160
  }
165
161
  }
@@ -188,270 +184,270 @@ const ln = {
188
184
  shape: "rounded"
189
185
  }
190
186
  }), {
191
- withProvider: pn,
192
- withContext: mn
193
- } = Rt({
194
- recipe: fn
195
- }), hn = pn("div", "root"), gn = mn("div", "content"), j = {
196
- Root: hn,
197
- Content: gn
198
- }, bn = (t) => {
187
+ withProvider: mn,
188
+ withContext: hn
189
+ } = At({
190
+ recipe: pn
191
+ }), gn = mn("div", "root"), bn = hn("div", "content"), V = {
192
+ Root: gn,
193
+ Content: bn
194
+ }, xn = (t) => {
199
195
  if (t == null) return null;
200
196
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
201
197
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
202
- }, Rr = (t) => {
198
+ }, vo = (t) => {
203
199
  const e = y(19), {
204
200
  toolName: n,
205
- toolInput: o,
206
- onApprove: r,
201
+ toolInput: r,
202
+ onApprove: o,
207
203
  onDeny: s
208
204
  } = t;
209
205
  let l;
210
- e[0] !== o ? (l = bn(o), e[0] = o, e[1] = l) : l = e[1];
211
- const c = l;
212
- let a;
213
- e[2] !== n ? (a = /* @__PURE__ */ b(re, { textStyle: "label/S/medium", color: "fg", children: [
206
+ e[0] !== r ? (l = xn(r), e[0] = r, e[1] = l) : l = e[1];
207
+ const a = l;
208
+ let c;
209
+ e[2] !== n ? (c = /* @__PURE__ */ b(Y, { textStyle: "label/S/medium", color: "fg", children: [
214
210
  "Allow ",
215
- /* @__PURE__ */ i(Xe, { size: "sm", children: n }),
211
+ /* @__PURE__ */ i(Qe, { size: "sm", children: n }),
216
212
  "?"
217
- ] }), e[2] = n, e[3] = a) : a = e[3];
213
+ ] }), e[2] = n, e[3] = c) : c = e[3];
218
214
  let d;
219
- e[4] !== c ? (d = c ? /* @__PURE__ */ i(Xe, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: c }) : null, e[4] = c, e[5] = d) : d = e[5];
220
- let u;
221
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ i($t, { size: 14 }), e[6] = u) : u = e[6];
215
+ e[4] !== a ? (d = a ? /* @__PURE__ */ i(Qe, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: a }) : null, e[4] = a, e[5] = d) : d = e[5];
222
216
  let f;
223
- e[7] !== s ? (f = /* @__PURE__ */ b(me, { size: "xs", variant: "outline", onClick: s, children: [
224
- u,
217
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ i(Lt, { size: 14 }), e[6] = f) : f = e[6];
218
+ let u;
219
+ e[7] !== s ? (u = /* @__PURE__ */ b(Se, { size: "xs", variant: "outline", onClick: s, children: [
220
+ f,
225
221
  "Deny"
226
- ] }), e[7] = s, e[8] = f) : f = e[8];
222
+ ] }), e[7] = s, e[8] = u) : u = e[8];
227
223
  let p;
228
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ i(Et, { size: 14 }), e[9] = p) : p = e[9];
224
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ i(Ft, { size: 14 }), e[9] = p) : p = e[9];
229
225
  let m;
230
- e[10] !== r ? (m = /* @__PURE__ */ b(me, { size: "xs", colorPalette: "green", onClick: r, children: [
226
+ e[10] !== o ? (m = /* @__PURE__ */ b(Se, { size: "xs", colorPalette: "green", onClick: o, children: [
231
227
  p,
232
228
  "Allow"
233
- ] }), e[10] = r, e[11] = m) : m = e[11];
234
- let g;
235
- e[12] !== f || e[13] !== m ? (g = /* @__PURE__ */ b(st, { gap: "xs", justifyContent: "flex-end", children: [
236
- f,
237
- m
238
- ] }), e[12] = f, e[13] = m, e[14] = g) : g = e[14];
229
+ ] }), e[10] = o, e[11] = m) : m = e[11];
239
230
  let h;
240
- return e[15] !== a || e[16] !== d || e[17] !== g ? (h = /* @__PURE__ */ i(k, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ b(V, { direction: "column", gap: "xs", children: [
241
- a,
231
+ e[12] !== u || e[13] !== m ? (h = /* @__PURE__ */ b(ke, { gap: "xs", justifyContent: "flex-end", children: [
232
+ u,
233
+ m
234
+ ] }), e[12] = u, e[13] = m, e[14] = h) : h = e[14];
235
+ let g;
236
+ return e[15] !== c || e[16] !== d || e[17] !== h ? (g = /* @__PURE__ */ i(k, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ b($, { direction: "column", gap: "xs", children: [
237
+ c,
242
238
  d,
243
- g
244
- ] }) }), e[15] = a, e[16] = d, e[17] = g, e[18] = h) : h = e[18], h;
245
- }, xn = (t) => {
239
+ h
240
+ ] }) }), e[15] = c, e[16] = d, e[17] = h, e[18] = g) : g = e[18], g;
241
+ }, yn = (t) => {
246
242
  const {
247
243
  previousUserMessageCount: e,
248
244
  userMessageCount: n
249
245
  } = t;
250
246
  return e === 0 ? !1 : n > e;
251
247
  };
252
- function yn(t) {
248
+ function Sn(t) {
253
249
  const e = y(4), {
254
250
  userMessageCount: n
255
251
  } = t, {
256
- scrollToBottom: o
257
- } = Ve(), r = je(n);
252
+ scrollToBottom: r
253
+ } = Ge(), o = Ne(n);
258
254
  let s, l;
259
- return e[0] !== o || e[1] !== n ? (s = () => {
260
- xn({
261
- previousUserMessageCount: r.current,
255
+ return e[0] !== r || e[1] !== n ? (s = () => {
256
+ yn({
257
+ previousUserMessageCount: o.current,
262
258
  userMessageCount: n
263
- }) && o(), r.current = n;
264
- }, l = [n, o], e[0] = o, e[1] = n, e[2] = s, e[3] = l) : (s = e[2], l = e[3]), Ne(s, l), null;
259
+ }) && r(), o.current = n;
260
+ }, l = [n, r], e[0] = r, e[1] = n, e[2] = s, e[3] = l) : (s = e[2], l = e[3]), Ue(s, l), null;
265
261
  }
266
- const Sn = (t) => {
262
+ const kn = (t) => {
267
263
  const e = y(22);
268
- let n, o, r, s;
264
+ let n, r, o, s;
269
265
  e[0] !== t ? ({
270
266
  title: s,
271
- shortcut: r,
267
+ shortcut: o,
272
268
  canInterrupt: n,
273
- ...o
274
- } = t, e[0] = t, e[1] = n, e[2] = o, e[3] = r, e[4] = s) : (n = e[1], o = e[2], r = e[3], s = e[4]);
275
- const l = o["aria-label"] ?? s;
276
- let c;
277
- e[5] !== n ? (c = n ? /* @__PURE__ */ i(Ft, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ i(Lt, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = c) : c = e[6];
278
- const a = c;
269
+ ...r
270
+ } = t, e[0] = t, e[1] = n, e[2] = r, e[3] = o, e[4] = s) : (n = e[1], r = e[2], o = e[3], s = e[4]);
271
+ const l = r["aria-label"] ?? s;
272
+ let a;
273
+ e[5] !== n ? (a = n ? /* @__PURE__ */ i(Ot, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ i(Wt, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = a) : a = e[6];
274
+ const c = a;
279
275
  let d;
280
- e[7] !== l || e[8] !== a || e[9] !== o || e[10] !== s ? (d = /* @__PURE__ */ i(rt, { "data-testid": "send-message-button", size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": l, title: s, ...o, children: a }), e[7] = l, e[8] = a, e[9] = o, e[10] = s, e[11] = d) : d = e[11];
281
- const u = d;
276
+ e[7] !== l || e[8] !== c || e[9] !== r || e[10] !== s ? (d = /* @__PURE__ */ i(lt, { "data-testid": "send-message-button", size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": l, title: s, ...r, children: c }), e[7] = l, e[8] = c, e[9] = r, e[10] = s, e[11] = d) : d = e[11];
277
+ const f = d;
282
278
  if (s) {
283
- let f;
284
- e[12] !== r || e[13] !== s ? (f = r ? /* @__PURE__ */ b(Ue, { children: [
279
+ let u;
280
+ e[12] !== o || e[13] !== s ? (u = o ? /* @__PURE__ */ b(Ve, { children: [
285
281
  s,
286
282
  " ",
287
- /* @__PURE__ */ i(vt, { fontSize: "xs", children: r })
288
- ] }) : s, e[12] = r, e[13] = s, e[14] = f) : f = e[14];
289
- const p = f;
283
+ /* @__PURE__ */ i(Dt, { fontSize: "xs", children: o })
284
+ ] }) : s, e[12] = o, e[13] = s, e[14] = u) : u = e[14];
285
+ const p = u;
290
286
  let m;
291
- e[15] !== u ? (m = /* @__PURE__ */ i(Ce.Trigger, { asChild: !0, children: u }), e[15] = u, e[16] = m) : m = e[16];
292
- let g;
293
- e[17] !== p ? (g = /* @__PURE__ */ i(It, { children: /* @__PURE__ */ i(Ce.Positioner, { children: /* @__PURE__ */ i(Ce.Content, { children: p }) }) }), e[17] = p, e[18] = g) : g = e[18];
287
+ e[15] !== f ? (m = /* @__PURE__ */ i(Ae.Trigger, { asChild: !0, children: f }), e[15] = f, e[16] = m) : m = e[16];
294
288
  let h;
295
- return e[19] !== m || e[20] !== g ? (h = /* @__PURE__ */ b(Ce.Root, { closeDelay: 50, openDelay: 100, children: [
289
+ e[17] !== p ? (h = /* @__PURE__ */ i(Bt, { children: /* @__PURE__ */ i(Ae.Positioner, { children: /* @__PURE__ */ i(Ae.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
290
+ let g;
291
+ return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ b(Ae.Root, { closeDelay: 50, openDelay: 100, children: [
296
292
  m,
297
- g
298
- ] }), e[19] = m, e[20] = g, e[21] = h) : h = e[21], h;
293
+ h
294
+ ] }), e[19] = m, e[20] = h, e[21] = g) : g = e[21], g;
299
295
  }
300
- return u;
301
- }, kn = (t) => {
296
+ return f;
297
+ }, Tn = (t) => {
302
298
  const e = y(66), {
303
299
  defaultState: n,
304
- onSubmit: o,
305
- onInterrupt: r,
300
+ onSubmit: r,
301
+ onInterrupt: o,
306
302
  streaming: s,
307
303
  attachedResources: l,
308
- onClearAttachments: c,
309
- isDisabled: a,
304
+ onClearAttachments: a,
305
+ isDisabled: c,
310
306
  onChange: d,
311
- placeholder: u,
312
- attachmentList: f,
307
+ placeholder: f,
308
+ attachmentList: u,
313
309
  actions: p,
314
310
  attachedToTop: m
315
- } = t, g = o === void 0 ? Tn : o, h = s === void 0 ? !1 : s;
311
+ } = t, h = r === void 0 ? wn : r, g = s === void 0 ? !1 : s;
316
312
  let T;
317
313
  e[0] !== l ? (T = l === void 0 ? [] : l, e[0] = l, e[1] = T) : T = e[1];
318
- const D = T, w = a === void 0 ? !1 : a, I = m === void 0 ? !1 : m, [z, q] = oe(!1), [de, ge] = oe(n), [ue, be] = oe(0);
319
- let G;
320
- e[2] !== n ? (G = () => Oe(n), e[2] = n, e[3] = G) : G = e[3];
321
- const [$, fe] = oe(G), N = je(null), E = je(d);
322
- let U, F;
323
- e[4] !== d ? (U = () => {
324
- E.current = d;
325
- }, F = [d], e[4] = d, e[5] = U, e[6] = F) : (U = e[5], F = e[6]), Ne(U, F);
326
- let L, v;
327
- e[7] !== n ? (v = () => {
328
- const _ = Oe(n);
329
- ge(n), be(Cn), fe(_), E.current?.(_);
330
- }, L = [n], e[7] = n, e[8] = L, e[9] = v) : (L = e[8], v = e[9]), Ne(v, L);
314
+ const L = T, w = c === void 0 ? !1 : c, pe = m === void 0 ? !1 : m, [q, P] = le(!1), [G, we] = le(n), [K, J] = le(0);
315
+ let X;
316
+ e[2] !== n ? (X = () => We(n), e[2] = n, e[3] = X) : X = e[3];
317
+ const [F, me] = le(X), Ce = Ne(null), he = Ne(d);
318
+ let Q, Z;
319
+ e[4] !== d ? (Q = () => {
320
+ he.current = d;
321
+ }, Z = [d], e[4] = d, e[5] = Q, e[6] = Z) : (Q = e[5], Z = e[6]), Ue(Q, Z);
322
+ let A, O;
323
+ e[7] !== n ? (O = () => {
324
+ const _ = We(n);
325
+ we(n), J(Cn), me(_), he.current?.(_);
326
+ }, A = [n], e[7] = n, e[8] = A, e[9] = O) : (A = e[8], O = e[9]), Ue(O, A);
331
327
  let B;
332
328
  e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = () => {
333
- const _ = N.current?.querySelector('[contenteditable="true"]');
329
+ const _ = Ce.current?.querySelector('[contenteditable="true"]');
334
330
  _ instanceof HTMLElement && _.focus();
335
331
  }, e[10] = B) : B = e[10];
336
- const K = B;
337
- let R;
338
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (R = () => {
339
- q(!0), K();
340
- }, e[11] = R) : R = e[11];
341
- const O = R;
342
- let M;
343
- e[12] !== n ? (M = (_) => {
344
- const Ct = _ === void 0 ? !1 : _;
345
- ge(n), be(wn);
346
- const Ye = Oe(n);
347
- fe(Ye), E.current?.(Ye), Ct && requestAnimationFrame(() => {
348
- K();
332
+ const ge = B;
333
+ let W;
334
+ e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => {
335
+ P(!0), ge();
336
+ }, e[11] = W) : W = e[11];
337
+ const be = W;
338
+ let D;
339
+ e[12] !== n ? (D = (_) => {
340
+ const Rt = _ === void 0 ? !1 : _;
341
+ we(n), J(_n);
342
+ const Je = We(n);
343
+ me(Je), he.current?.(Je), Rt && requestAnimationFrame(() => {
344
+ ge();
349
345
  });
350
- }, e[12] = n, e[13] = M) : M = e[13];
351
- const H = M;
352
- let S;
353
- e[14] !== D || e[15] !== w || e[16] !== c || e[17] !== r || e[18] !== g || e[19] !== H || e[20] !== h || e[21] !== $ ? (S = () => {
346
+ }, e[12] = n, e[13] = D) : D = e[13];
347
+ const H = D;
348
+ let M;
349
+ e[14] !== L || e[15] !== w || e[16] !== a || e[17] !== o || e[18] !== h || e[19] !== H || e[20] !== g || e[21] !== F ? (M = () => {
354
350
  if (w)
355
351
  return;
356
- if (h) {
357
- r?.();
352
+ if (g) {
353
+ o?.();
358
354
  return;
359
355
  }
360
- const _ = $.trim();
361
- _ && (g(_, D), H(!0), c?.());
362
- }, e[14] = D, e[15] = w, e[16] = c, e[17] = r, e[18] = g, e[19] = H, e[20] = h, e[21] = $, e[22] = S) : S = e[22];
363
- const P = S, C = h && !!r;
364
- let Y;
365
- e[23] !== u ? (Y = u ? /* @__PURE__ */ i(re, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: u }) : void 0, e[23] = u, e[24] = Y) : Y = e[24];
366
- const ve = Y, Be = I ? "-1px" : void 0, Me = I ? "0" : void 0, Ae = z ? "blue.border" : "border.muted", De = z ? "mid" : "low", ze = z ? 1 : 0, $e = z ? "blue.border" : "border";
367
- let X;
368
- e[25] !== $e ? (X = {
356
+ const _ = F.trim();
357
+ _ && (h(_, L), H(!0), a?.());
358
+ }, e[14] = L, e[15] = w, e[16] = a, e[17] = o, e[18] = h, e[19] = H, e[20] = g, e[21] = F, e[22] = M) : M = e[22];
359
+ const v = M, C = g && !!o;
360
+ let I;
361
+ e[23] !== f ? (I = f ? /* @__PURE__ */ i(Y, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: f }) : void 0, e[23] = f, e[24] = I) : I = e[24];
362
+ const j = I, N = pe ? "-1px" : void 0, S = pe ? "0" : void 0, z = q ? "blue.border" : "border.muted", R = q ? "mid" : "low", xe = q ? 1 : 0, $e = q ? "blue.border" : "border";
363
+ let ee;
364
+ e[25] !== $e ? (ee = {
369
365
  borderColor: $e,
370
366
  boxShadow: "mid",
371
367
  zIndex: 1
372
- }, e[25] = $e, e[26] = X) : X = e[26];
373
- let xe;
374
- e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (xe = {
368
+ }, e[25] = $e, e[26] = ee) : ee = e[26];
369
+ let _e;
370
+ e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_e = {
375
371
  borderColor: "blue.border",
376
372
  boxShadow: "mid",
377
373
  zIndex: 1
378
- }, e[27] = xe) : xe = e[27];
379
- let ye;
380
- e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ye = () => q(!1), e[28] = ye) : ye = e[28];
381
- let Se;
382
- e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Se = {
374
+ }, e[27] = _e) : _e = e[27];
375
+ let Re;
376
+ e[28] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Re = () => P(!1), e[28] = Re) : Re = e[28];
377
+ let Pe;
378
+ e[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Pe = {
383
379
  pr: "2xs"
384
- }, e[29] = Se) : Se = e[29];
385
- const Ee = !w;
386
- let J;
387
- e[30] !== d ? (J = (_) => {
388
- fe(_), d?.(_);
389
- }, e[30] = d, e[31] = J) : J = e[31];
390
- let Q;
391
- e[32] !== ue || e[33] !== de || e[34] !== P || e[35] !== ve || e[36] !== Ee || e[37] !== J ? (Q = /* @__PURE__ */ i(ct, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: Se, children: /* @__PURE__ */ i(tn, { defaultState: de, isEditable: Ee, placeholder: ve, onChange: J, onSubmit: P }, ue) }), e[32] = ue, e[33] = de, e[34] = P, e[35] = ve, e[36] = Ee, e[37] = J, e[38] = Q) : Q = e[38];
392
- let ke;
393
- e[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ke = /* @__PURE__ */ i(Bt, {}), e[39] = ke) : ke = e[39];
394
- const Fe = C ? "Stop Response" : "Message Sending", Le = h ? void 0 : "Enter";
395
- let Z;
396
- e[40] !== C || e[41] !== w || e[42] !== h || e[43] !== $ ? (Z = h && !C || !h && !$.trim() || w, e[40] = C, e[41] = w, e[42] = h, e[43] = $, e[44] = Z) : Z = e[44];
397
- let ee;
398
- e[45] !== C || e[46] !== P || e[47] !== Fe || e[48] !== Le || e[49] !== Z ? (ee = /* @__PURE__ */ i(Sn, { canInterrupt: C, title: Fe, shortcut: Le, onClick: P, disabled: Z }), e[45] = C, e[46] = P, e[47] = Fe, e[48] = Le, e[49] = Z, e[50] = ee) : ee = e[50];
380
+ }, e[29] = Pe) : Pe = e[29];
381
+ const Le = !w;
399
382
  let te;
400
- e[51] !== p || e[52] !== ee ? (te = /* @__PURE__ */ b(st, { gap: "1", mt: "md", children: [
401
- p,
402
- ke,
403
- ee
404
- ] }), e[51] = p, e[52] = ee, e[53] = te) : te = e[53];
383
+ e[30] !== d ? (te = (_) => {
384
+ me(_), d?.(_);
385
+ }, e[30] = d, e[31] = te) : te = e[31];
405
386
  let ne;
406
- e[54] !== f || e[55] !== Q || e[56] !== te ? (ne = /* @__PURE__ */ b(V, { direction: "column", color: "fg", children: [
407
- f,
408
- Q,
409
- te
410
- ] }), e[54] = f, e[55] = Q, e[56] = te, e[57] = ne) : ne = e[57];
411
- let Te;
412
- return e[58] !== Be || e[59] !== Me || e[60] !== Ae || e[61] !== De || e[62] !== ze || e[63] !== X || e[64] !== ne ? (Te = /* @__PURE__ */ i(k, { ref: N, position: "relative", width: "100%", paddingX: "lg", paddingY: "md", mt: Be, bg: "bg", borderRadius: "md", borderTopRadius: Me, borderWidth: "1px", borderStyle: "solid", borderColor: Ae, boxShadow: De, zIndex: ze, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: X, _focusWithin: xe, onClick: O, onBlur: ye, children: ne }), e[58] = Be, e[59] = Me, e[60] = Ae, e[61] = De, e[62] = ze, e[63] = X, e[64] = ne, e[65] = Te) : Te = e[65], Te;
387
+ e[32] !== K || e[33] !== G || e[34] !== v || e[35] !== j || e[36] !== Le || e[37] !== te ? (ne = /* @__PURE__ */ i(ut, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: Pe, children: /* @__PURE__ */ i(nn, { defaultState: G, isEditable: Le, placeholder: j, onChange: te, onSubmit: v }, K) }), e[32] = K, e[33] = G, e[34] = v, e[35] = j, e[36] = Le, e[37] = te, e[38] = ne) : ne = e[38];
388
+ let Ie;
389
+ e[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = /* @__PURE__ */ i(Mt, {}), e[39] = Ie) : Ie = e[39];
390
+ const Fe = C ? "Stop Response" : "Message Sending", Oe = g ? void 0 : "Enter";
391
+ let re;
392
+ e[40] !== C || e[41] !== w || e[42] !== g || e[43] !== F ? (re = g && !C || !g && !F.trim() || w, e[40] = C, e[41] = w, e[42] = g, e[43] = F, e[44] = re) : re = e[44];
393
+ let oe;
394
+ e[45] !== C || e[46] !== v || e[47] !== Fe || e[48] !== Oe || e[49] !== re ? (oe = /* @__PURE__ */ i(kn, { canInterrupt: C, title: Fe, shortcut: Oe, onClick: v, disabled: re }), e[45] = C, e[46] = v, e[47] = Fe, e[48] = Oe, e[49] = re, e[50] = oe) : oe = e[50];
395
+ let se;
396
+ e[51] !== p || e[52] !== oe ? (se = /* @__PURE__ */ b(ke, { gap: "1", mt: "md", children: [
397
+ p,
398
+ Ie,
399
+ oe
400
+ ] }), e[51] = p, e[52] = oe, e[53] = se) : se = e[53];
401
+ let ie;
402
+ e[54] !== u || e[55] !== ne || e[56] !== se ? (ie = /* @__PURE__ */ b($, { direction: "column", color: "fg", children: [
403
+ u,
404
+ ne,
405
+ se
406
+ ] }), e[54] = u, e[55] = ne, e[56] = se, e[57] = ie) : ie = e[57];
407
+ let ve;
408
+ return e[58] !== N || e[59] !== S || e[60] !== z || e[61] !== R || e[62] !== xe || e[63] !== ee || e[64] !== ie ? (ve = /* @__PURE__ */ i(k, { ref: Ce, position: "relative", width: "100%", paddingX: "lg", paddingY: "md", mt: N, bg: "bg", borderRadius: "md", borderTopRadius: S, borderWidth: "1px", borderStyle: "solid", borderColor: z, boxShadow: R, zIndex: xe, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: ee, _focusWithin: _e, onClick: be, onBlur: Re, children: ie }), e[58] = N, e[59] = S, e[60] = z, e[61] = R, e[62] = xe, e[63] = ee, e[64] = ie, e[65] = ve) : ve = e[65], ve;
413
409
  };
414
- function Tn() {
410
+ function wn() {
415
411
  }
416
412
  function Cn(t) {
417
413
  return t + 1;
418
414
  }
419
- function wn(t) {
415
+ function _n(t) {
420
416
  return t + 1;
421
417
  }
422
- const _n = (t = "") => JSON.stringify(nn(t)), Pn = 360, Rn = "min(20vh, 8rem)", In = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : e + n.text.length, 0), vn = (t) => t.role !== "user" ? !1 : In(t) > Pn, Bn = (t) => {
418
+ const Rn = (t = "") => JSON.stringify(rn(t)), Pn = 360, In = "min(20vh, 8rem)", vn = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : e + n.text.length, 0), An = (t) => t.role !== "user" ? !1 : vn(t) > Pn, Bn = (t) => {
423
419
  const e = y(8);
424
- let n, o;
420
+ let n, r;
425
421
  e[0] !== t ? ({
426
422
  children: n,
427
- ...o
428
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
429
- let r;
430
- e[3] !== n ? (r = /* @__PURE__ */ i(at, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = r) : r = e[4];
423
+ ...r
424
+ } = t, e[0] = t, e[1] = n, e[2] = r) : (n = e[1], r = e[2]);
425
+ let o;
426
+ e[3] !== n ? (o = /* @__PURE__ */ i(ft, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
431
427
  let s;
432
- return e[5] !== o || e[6] !== r ? (s = /* @__PURE__ */ i(k, { ...o, children: r }), e[5] = o, e[6] = r, e[7] = s) : s = e[7], s;
433
- }, Mn = Bn, ut = {
434
- shell: lt,
435
- ls: qt,
436
- read_file: Vt,
437
- write_file: Ut,
438
- delete_file: Nt,
439
- patch: jt,
440
- upload_files: Wt,
441
- download_file: Ht,
442
- move_file: Ot
443
- }, An = {
444
- dot: Jt,
445
- danger: Xt,
446
- search: Yt,
447
- browser: Kt,
448
- file: Gt,
449
- terminal: lt,
450
- ...ut
451
- }, Je = "dot", Dn = (t) => Object.hasOwn(ut, t), zn = (t) => An[t], ft = (t) => {
452
- if (!t) return Je;
428
+ return e[5] !== r || e[6] !== o ? (s = /* @__PURE__ */ i(k, { ...r, children: o }), e[5] = r, e[6] = o, e[7] = s) : s = e[7], s;
429
+ }, Dn = Bn, mt = {
430
+ shell: ct,
431
+ ls: Kt,
432
+ read_file: Gt,
433
+ write_file: qt,
434
+ delete_file: Vt,
435
+ patch: Ut,
436
+ upload_files: Nt,
437
+ download_file: jt,
438
+ move_file: Ht
439
+ }, Mn = {
440
+ dot: Qt,
441
+ danger: dt,
442
+ search: Jt,
443
+ browser: Yt,
444
+ file: Xt,
445
+ terminal: ct,
446
+ ...mt
447
+ }, et = "dot", zn = (t) => Object.hasOwn(mt, t), En = (t) => Mn[t], ht = (t) => {
448
+ if (!t) return et;
453
449
  const e = t.replace(/^tool-/, "");
454
- if (Dn(e)) return e;
450
+ if (zn(e)) return e;
455
451
  switch (e) {
456
452
  case "read":
457
453
  return "file";
@@ -471,52 +467,52 @@ const _n = (t = "") => JSON.stringify(nn(t)), Pn = 360, Rn = "min(20vh, 8rem)",
471
467
  case "file":
472
468
  return "file";
473
469
  default:
474
- return Je;
470
+ return et;
475
471
  }
476
472
  };
477
- function qe(t) {
473
+ function Ke(t) {
478
474
  const e = t.lastIndexOf("/");
479
475
  return e >= 0 ? t.slice(e + 1) : t;
480
476
  }
481
- function we(t) {
477
+ function Be(t) {
482
478
  if (!t) return null;
483
479
  const e = t.split(" ")[0].trim();
484
480
  if (e === "/dev/null") return null;
485
481
  let n = e;
486
482
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
487
483
  }
488
- const Pe = (t) => t.startsWith("--- "), Ge = (t) => t.startsWith("+++ "), Ke = (t) => t.startsWith("@@"), $n = (t) => t.startsWith("+") && !(Ge(t) || t === "+++"), En = (t) => t.startsWith("-") && !(Pe(t) || t === "---"), Fn = (t, e) => {
484
+ const Me = (t) => t.startsWith("--- "), Xe = (t) => t.startsWith("+++ "), Ye = (t) => t.startsWith("@@"), $n = (t) => t.startsWith("+") && !(Xe(t) || t === "+++"), Ln = (t) => t.startsWith("-") && !(Me(t) || t === "---"), Fn = (t, e) => {
489
485
  t.has(e) || t.set(e, {
490
486
  additions: 0,
491
487
  deletions: 0
492
488
  });
493
- }, Ln = (t, e) => {
489
+ }, On = (t, e) => {
494
490
  const n = t.get(e);
495
491
  n && (n.additions += 1);
496
- }, On = (t, e) => {
492
+ }, Wn = (t, e) => {
497
493
  const n = t.get(e);
498
494
  n && (n.deletions += 1);
499
495
  }, Hn = (t, e, n) => {
500
- if (Pe(t))
496
+ if (Me(t))
501
497
  return {
502
498
  ...e,
503
- lastMinusHeader: we(t.slice(4)),
499
+ lastMinusHeader: Be(t.slice(4)),
504
500
  inHunk: !1
505
501
  };
506
- if (Ge(t)) {
507
- const r = we(t.slice(4)) ?? e.lastMinusHeader;
508
- return r && Fn(n, r), {
502
+ if (Xe(t)) {
503
+ const o = Be(t.slice(4)) ?? e.lastMinusHeader;
504
+ return o && Fn(n, o), {
509
505
  ...e,
510
- currentPath: r,
506
+ currentPath: o,
511
507
  inHunk: !1
512
508
  };
513
509
  }
514
- return e.currentPath ? Ke(t) ? {
510
+ return e.currentPath ? Ye(t) ? {
515
511
  ...e,
516
512
  inHunk: !0
517
- } : e.inHunk ? $n(t) ? (Ln(n, e.currentPath), e) : (En(t) && On(n, e.currentPath), e) : e : e;
513
+ } : e.inHunk ? $n(t) ? (On(n, e.currentPath), e) : (Ln(t) && Wn(n, e.currentPath), e) : e : e;
518
514
  };
519
- function pt(t) {
515
+ function gt(t) {
520
516
  if (!t || typeof t != "string") return [];
521
517
  const e = /* @__PURE__ */ new Map();
522
518
  let n = {
@@ -524,34 +520,34 @@ function pt(t) {
524
520
  lastMinusHeader: null,
525
521
  inHunk: !1
526
522
  };
527
- const o = t.split(/\r?\n/);
528
- for (const r of o)
529
- n = Hn(r, n, e);
530
- return Array.from(e.entries()).map(([r, {
523
+ const r = t.split(/\r?\n/);
524
+ for (const o of r)
525
+ n = Hn(o, n, e);
526
+ return Array.from(e.entries()).map(([o, {
531
527
  additions: s,
532
528
  deletions: l
533
529
  }]) => ({
534
- filePath: r,
530
+ filePath: o,
535
531
  additions: s,
536
532
  deletions: l
537
533
  }));
538
534
  }
539
- function Wn(t) {
540
- return pt(t).map((e) => ({
535
+ function jn(t) {
536
+ return gt(t).map((e) => ({
541
537
  kind: "diff",
542
- fileName: qe(e.filePath),
538
+ fileName: Ke(e.filePath),
543
539
  filePath: e.filePath,
544
540
  additions: e.additions,
545
541
  deletions: e.deletions
546
542
  }));
547
543
  }
548
- function jn(t) {
549
- return pt(t).map((e) => e.filePath);
544
+ function Nn(t) {
545
+ return gt(t).map((e) => e.filePath);
550
546
  }
551
- const mt = (t) => Pe(t) || t.startsWith("diff --git "), Nn = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Un = (t, e, n) => {
547
+ const bt = (t) => Me(t) || t.startsWith("diff --git "), Un = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Vn = (t, e, n) => {
552
548
  if (t.startsWith(" ")) {
553
- const o = t.slice(1);
554
- e.push(o), n.push(o);
549
+ const r = t.slice(1);
550
+ e.push(r), n.push(r);
555
551
  return;
556
552
  }
557
553
  if (t.startsWith("-")) {
@@ -559,294 +555,294 @@ const mt = (t) => Pe(t) || t.startsWith("diff --git "), Nn = (t) => t.startsWith
559
555
  return;
560
556
  }
561
557
  t.startsWith("+") && n.push(t.slice(1));
562
- }, Vn = (t, e, n, o) => {
563
- let r = e;
564
- for (; r < t.length; ) {
565
- const s = t[r] || "";
566
- if (mt(s) || Ke(s) || Nn(s))
558
+ }, qn = (t, e, n, r) => {
559
+ let o = e;
560
+ for (; o < t.length; ) {
561
+ const s = t[o] || "";
562
+ if (bt(s) || Ye(s) || Un(s))
567
563
  break;
568
- Un(s, n, o), r += 1;
564
+ Vn(s, n, r), o += 1;
569
565
  }
570
- return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), r;
571
- }, qn = (t, e) => {
572
- const n = we((t[e] || "").slice(4)), o = t[e + 1] || "";
573
- if (!Ge(o)) return {
566
+ return (n.length > 0 || r.length > 0) && (n.push(""), r.push("")), o;
567
+ }, Gn = (t, e) => {
568
+ const n = Be((t[e] || "").slice(4)), r = t[e + 1] || "";
569
+ if (!Xe(r)) return {
574
570
  nextIndex: e + 1
575
571
  };
576
- const s = we(o.slice(4)) ?? n ?? "", l = [], c = [];
577
- let a = e + 2;
578
- for (; a < t.length; ) {
579
- const d = t[a] || "";
580
- if (mt(d)) break;
581
- if (!Ke(d)) {
582
- a += 1;
572
+ const s = Be(r.slice(4)) ?? n ?? "", l = [], a = [];
573
+ let c = e + 2;
574
+ for (; c < t.length; ) {
575
+ const d = t[c] || "";
576
+ if (bt(d)) break;
577
+ if (!Ye(d)) {
578
+ c += 1;
583
579
  continue;
584
580
  }
585
- a = Vn(t, a + 1, l, c);
581
+ c = qn(t, c + 1, l, a);
586
582
  }
587
583
  return {
588
- nextIndex: a,
584
+ nextIndex: c,
589
585
  preview: {
590
586
  filePath: s,
591
587
  original: l.join(`
592
588
  `),
593
- modified: c.join(`
589
+ modified: a.join(`
594
590
  `)
595
591
  }
596
592
  };
597
593
  };
598
- function Gn(t) {
594
+ function Kn(t) {
599
595
  if (!t || typeof t != "string") return [];
600
596
  const e = t.split(/\r?\n/), n = [];
601
- let o = 0;
602
- for (; o < e.length; ) {
603
- const r = e[o] || "";
604
- if (!Pe(r)) {
605
- o += 1;
597
+ let r = 0;
598
+ for (; r < e.length; ) {
599
+ const o = e[r] || "";
600
+ if (!Me(o)) {
601
+ r += 1;
606
602
  continue;
607
603
  }
608
604
  const {
609
605
  nextIndex: s,
610
606
  preview: l
611
- } = qn(e, o);
612
- l && n.push(l), o = Math.max(s, o + 1);
607
+ } = Gn(e, r);
608
+ l && n.push(l), r = Math.max(s, r + 1);
613
609
  }
614
610
  return n;
615
611
  }
616
- const Kn = {
612
+ const Xn = {
617
613
  apply_patch: "Apply patch",
618
614
  read: "Read file",
619
615
  bash: "Run",
620
616
  grep: "Search files",
621
617
  glob: "Find files",
622
618
  skill: "Load skill"
623
- }, Qe = {
619
+ }, tt = {
624
620
  pending: "queued",
625
621
  error: "failed",
626
622
  "output-error": "failed",
627
623
  "input-streaming": "running",
628
624
  "input-available": "queued"
629
- }, ht = (t) => t.replace(/^tool-/, ""), Yn = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Xn = (t) => ht(t.tool ?? "tool"), Jn = (t) => {
630
- const e = ht(t);
631
- return Kn[e] ?? Yn(e.replace(/_/g, " "));
632
- }, Qn = (t) => !t || typeof t != "string" ? null : Qe[t] ? Qe[t] : t.includes("stream") ? "running" : null, gt = (t) => t === "error" || t === "output-error", ie = (t) => gt(t.state?.status) ? {
625
+ }, xt = (t) => t.replace(/^tool-/, ""), Yn = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Jn = (t) => xt(t.tool ?? "tool"), Qn = (t) => {
626
+ const e = xt(t);
627
+ return Xn[e] ?? Yn(e.replace(/_/g, " "));
628
+ }, Zn = (t) => !t || typeof t != "string" ? null : tt[t] ? tt[t] : t.includes("stream") ? "running" : null, yt = (t) => t === "error" || t === "output-error", ce = (t) => yt(t.state?.status) ? {
633
629
  type: "icon",
634
630
  icon: "danger"
635
631
  } : {
636
632
  type: "icon",
637
- icon: ft(Xn(t))
638
- }, le = (t, e, n) => {
639
- const r = [{
633
+ icon: ht(Jn(t))
634
+ }, de = (t, e, n) => {
635
+ const o = [{
640
636
  kind: "text",
641
- text: n ?? Jn(t.tool ?? "tool"),
637
+ text: n ?? Qn(t.tool ?? "tool"),
642
638
  bold: !0
643
639
  }];
644
- e && r.push({
640
+ e && o.push({
645
641
  kind: "text",
646
642
  text: e,
647
643
  muted: !0
648
644
  });
649
- const s = Qn(t.state?.status);
650
- return s && r.push({
645
+ const s = Zn(t.state?.status);
646
+ return s && o.push({
651
647
  kind: "text",
652
648
  text: s,
653
649
  muted: !0
654
- }), r;
655
- }, ce = (t) => {
650
+ }), o;
651
+ }, ue = (t) => {
656
652
  const e = t.state?.input;
657
653
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
658
- }, Re = (t) => {
654
+ }, ze = (t) => {
659
655
  const e = t.state?.output;
660
656
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
661
- }, x = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, _e = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Zn = (t, e) => {
662
- const n = _e(t.state);
663
- return n ? _e(n[e]) : null;
664
- }, eo = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), to = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), bt = (t) => {
665
- const e = Re(t);
666
- return [Zn(t, "metadata"), _e(e?.metadata)].filter(Boolean);
667
- }, no = (t) => {
668
- const e = _e(t);
657
+ }, x = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, De = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, er = (t, e) => {
658
+ const n = De(t.state);
659
+ return n ? De(n[e]) : null;
660
+ }, tr = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), nr = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), St = (t) => {
661
+ const e = ze(t);
662
+ return [er(t, "metadata"), De(e?.metadata)].filter(Boolean);
663
+ }, rr = (t) => {
664
+ const e = De(t);
669
665
  if (!e) return null;
670
666
  const n = x(e.filePath) ?? x(e.relativePath) ?? x(e.path);
671
667
  return n ? {
672
- filePath: eo(n),
668
+ filePath: tr(n),
673
669
  additions: typeof e.additions == "number" ? e.additions : 0,
674
670
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
675
671
  diff: x(e.diff) ?? void 0,
676
672
  before: x(e.before) ?? void 0,
677
673
  after: x(e.after) ?? void 0
678
674
  } : null;
679
- }, xt = (t) => {
675
+ }, kt = (t) => {
680
676
  const e = [];
681
- for (const n of bt(t)) {
682
- const o = Array.isArray(n.files) ? n.files : [];
683
- for (const r of o) {
684
- const s = no(r);
677
+ for (const n of St(t)) {
678
+ const r = Array.isArray(n.files) ? n.files : [];
679
+ for (const o of r) {
680
+ const s = rr(o);
685
681
  s && e.push(s);
686
682
  }
687
683
  }
688
684
  return e;
689
- }, oo = (t) => {
690
- const e = ce(t), n = x(e?.diff);
685
+ }, or = (t) => {
686
+ const e = ue(t), n = x(e?.diff);
691
687
  if (n) return n;
692
- for (const s of bt(t)) {
688
+ for (const s of St(t)) {
693
689
  const l = x(s.diff);
694
690
  if (l) return l;
695
691
  }
696
- const o = xt(t).map((s) => s.diff).filter((s) => !!s);
697
- if (o.length > 0) return o.join(`
692
+ const r = kt(t).map((s) => s.diff).filter((s) => !!s);
693
+ if (r.length > 0) return r.join(`
698
694
  `);
699
- const r = x(e?.patchText);
700
- return r && to(r) ? r : null;
701
- }, ro = (t) => {
695
+ const o = x(e?.patchText);
696
+ return o && nr(o) ? o : null;
697
+ }, sr = (t) => {
702
698
  const e = /* @__PURE__ */ new Set(), n = [];
703
- for (const o of t)
704
- e.has(o.filePath) || (e.add(o.filePath), n.push({
699
+ for (const r of t)
700
+ e.has(r.filePath) || (e.add(r.filePath), n.push({
705
701
  kind: "diff",
706
- fileName: qe(o.filePath),
707
- filePath: o.filePath,
708
- additions: o.additions,
709
- deletions: o.deletions
702
+ fileName: Ke(r.filePath),
703
+ filePath: r.filePath,
704
+ additions: r.additions,
705
+ deletions: r.deletions
710
706
  }));
711
707
  return n;
712
- }, so = (t) => Array.from(new Set(t.map((e) => e.filePath))), Ie = (t) => {
713
- const e = Re(t);
708
+ }, ir = (t) => Array.from(new Set(t.map((e) => e.filePath))), Ee = (t) => {
709
+ const e = ze(t);
714
710
  return x(t.state?.output) ?? x(e?.returnDisplay) ?? x(e?.preview) ?? x(e?.stdout);
715
- }, io = (t) => {
711
+ }, lr = (t) => {
716
712
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
717
713
  return e ? {
718
714
  skillName: x(e[1]) ?? void 0,
719
715
  content: x(e[2]) ?? ""
720
716
  } : null;
721
- }, lo = (t) => {
722
- const e = ce(t);
717
+ }, ar = (t) => {
718
+ const e = ue(t);
723
719
  return x(e?.name) ?? x(e?.skillName) ?? x(e?.skill) ?? x(e?.skill_name) ?? void 0;
724
- }, co = (t) => ({
720
+ }, cr = (t) => ({
725
721
  kind: "link",
726
- text: qe(t),
722
+ text: Ke(t),
727
723
  filePath: t
728
- }), ae = (t, e) => !gt(t.state?.status) || !t.state?.errorText ? e : [{
724
+ }), fe = (t, e) => !yt(t.state?.status) || !t.state?.errorText ? e : [{
729
725
  type: "comment",
730
726
  text: t.state.errorText
731
- }, ...e], ao = (t) => {
732
- const e = oo(t), n = xt(t), o = le(t, void 0, "Apply patch"), r = Wn(e ?? void 0);
733
- r.length > 0 ? o.push(...r) : o.push(...ro(n));
734
- const s = [], l = Gn(e ?? void 0);
735
- for (const c of l)
727
+ }, ...e], dr = (t) => {
728
+ const e = or(t), n = kt(t), r = de(t, void 0, "Apply patch"), o = jn(e ?? void 0);
729
+ o.length > 0 ? r.push(...o) : r.push(...sr(n));
730
+ const s = [], l = Kn(e ?? void 0);
731
+ for (const a of l)
736
732
  s.push({
737
733
  type: "diff",
738
734
  language: "diff",
739
- original: c.original,
740
- modified: c.modified,
735
+ original: a.original,
736
+ modified: a.modified,
741
737
  sideBySide: !1
742
738
  });
743
739
  if (s.length === 0)
744
- for (const c of n)
745
- !c.before && !c.after || s.push({
740
+ for (const a of n)
741
+ !a.before && !a.after || s.push({
746
742
  type: "diff",
747
743
  language: "diff",
748
- original: c.before ?? "",
749
- modified: c.after ?? "",
744
+ original: a.before ?? "",
745
+ modified: a.after ?? "",
750
746
  sideBySide: !1
751
747
  });
752
748
  if (s.length === 0) {
753
- const c = jn(e ?? void 0);
754
- c.length === 0 && c.push(...so(n)), c.length > 0 && s.push({
749
+ const a = Nn(e ?? void 0);
750
+ a.length === 0 && a.push(...ir(n)), a.length > 0 && s.push({
755
751
  type: "references",
756
- references: c
752
+ references: a
757
753
  });
758
754
  }
759
755
  return {
760
- indicator: ie(t),
761
- title: o,
762
- blocks: ae(t, s)
763
- };
764
- }, uo = (t) => {
765
- const e = ce(t), n = Re(t), o = x(e?.filePath) ?? x(e?.file) ?? x(n?.filePath) ?? x(n?.file) ?? x(n?.path) ?? void 0, r = le(t, void 0, "Read file");
766
- return o && r.push(co(o)), {
767
- indicator: ie(t),
756
+ indicator: ce(t),
768
757
  title: r,
769
- blocks: ae(t, [])
758
+ blocks: fe(t, s)
759
+ };
760
+ }, ur = (t) => {
761
+ const e = ue(t), n = ze(t), r = x(e?.filePath) ?? x(e?.file) ?? x(n?.filePath) ?? x(n?.file) ?? x(n?.path) ?? void 0, o = de(t, void 0, "Read file");
762
+ return r && o.push(cr(r)), {
763
+ indicator: ce(t),
764
+ title: o,
765
+ blocks: fe(t, [])
770
766
  };
771
- }, fo = (t) => {
772
- const e = ce(t), n = Re(t), o = x(e?.command) ?? void 0, r = le(t, o, "Run command"), s = [], l = Ie(t);
767
+ }, fr = (t) => {
768
+ const e = ue(t), n = ze(t), r = x(e?.command) ?? void 0, o = de(t, r, "Run command"), s = [], l = Ee(t);
773
769
  l && s.push({
774
770
  type: "code",
775
771
  language: "text",
776
772
  code: l
777
773
  });
778
- const c = x(n?.stderr);
779
- return c && c !== l && s.push({
774
+ const a = x(n?.stderr);
775
+ return a && a !== l && s.push({
780
776
  type: "code",
781
777
  language: "text",
782
- code: c
778
+ code: a
783
779
  }), typeof n?.exitCode == "number" && s.push({
784
780
  type: "text",
785
781
  text: `Exit code: ${n.exitCode}`
786
782
  }), {
787
- indicator: ie(t),
788
- title: r,
789
- blocks: ae(t, s)
783
+ indicator: ce(t),
784
+ title: o,
785
+ blocks: fe(t, s)
790
786
  };
791
- }, po = (t) => {
792
- const e = ce(t), n = Ie(t), o = x(e?.pattern) ?? void 0, r = le(t, o, "Search files"), s = n ? [{
787
+ }, pr = (t) => {
788
+ const e = ue(t), n = Ee(t), r = x(e?.pattern) ?? void 0, o = de(t, r, "Search files"), s = n ? [{
793
789
  type: "code",
794
790
  language: "text",
795
791
  code: n
796
792
  }] : [];
797
793
  return {
798
- indicator: ie(t),
799
- title: r,
800
- blocks: ae(t, s)
794
+ indicator: ce(t),
795
+ title: o,
796
+ blocks: fe(t, s)
801
797
  };
802
- }, mo = (t) => {
803
- const e = ce(t), n = Ie(t), o = x(e?.pattern) ?? void 0, r = le(t, o, "Find files"), s = [];
798
+ }, mr = (t) => {
799
+ const e = ue(t), n = Ee(t), r = x(e?.pattern) ?? void 0, o = de(t, r, "Find files"), s = [];
804
800
  if (n) {
805
- const l = n.split(/\r?\n/).map((c) => c.trim()).filter((c) => c.length > 0);
801
+ const l = n.split(/\r?\n/).map((a) => a.trim()).filter((a) => a.length > 0);
806
802
  l.length > 0 && s.push({
807
803
  type: "references",
808
804
  references: l
809
805
  });
810
806
  }
811
807
  return {
812
- indicator: ie(t),
813
- title: r,
814
- blocks: ae(t, s)
808
+ indicator: ce(t),
809
+ title: o,
810
+ blocks: fe(t, s)
815
811
  };
816
- }, ho = (t) => {
817
- const e = Ie(t), n = e ? io(e) : null, o = lo(t) ?? n?.skillName, r = le(t, o, "Load skill"), s = n?.content ?? e, l = s ? [{
812
+ }, hr = (t) => {
813
+ const e = Ee(t), n = e ? lr(e) : null, r = ar(t) ?? n?.skillName, o = de(t, r, "Load skill"), s = n?.content ?? e, l = s ? [{
818
814
  type: "code",
819
815
  language: "markdown",
820
816
  code: s
821
817
  }] : [];
822
818
  return {
823
- indicator: ie(t),
824
- title: r,
825
- blocks: ae(t, l)
819
+ indicator: ce(t),
820
+ title: o,
821
+ blocks: fe(t, l)
826
822
  };
827
- }, Ze = () => ({
828
- apply_patch: ao,
829
- read: uo,
830
- bash: fo,
831
- grep: po,
832
- glob: mo,
833
- skill: ho
834
- }), et = {
823
+ }, nt = () => ({
824
+ apply_patch: dr,
825
+ read: ur,
826
+ bash: fr,
827
+ grep: pr,
828
+ glob: mr,
829
+ skill: hr
830
+ }), rt = {
835
831
  pending: "queued",
836
832
  error: "failed",
837
833
  "output-error": "failed",
838
834
  "input-streaming": "running",
839
835
  "input-available": "queued"
840
- }, yt = (t) => t.replace(/^tool-/, ""), go = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), bo = (t) => {
841
- const e = yt(t ?? "tool").replace(/_/g, " ");
842
- return go(e);
843
- }, St = (t) => t === "error" || t === "output-error", xo = (t) => St(t.state?.status) ? {
836
+ }, Tt = (t) => t.replace(/^tool-/, ""), gr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), br = (t) => {
837
+ const e = Tt(t ?? "tool").replace(/_/g, " ");
838
+ return gr(e);
839
+ }, wt = (t) => t === "error" || t === "output-error", xr = (t) => wt(t.state?.status) ? {
844
840
  type: "icon",
845
841
  icon: "danger"
846
842
  } : {
847
843
  type: "icon",
848
- icon: ft(t.tool ?? "tool")
849
- }, yo = (t) => !t || typeof t != "string" ? null : et[t] ? et[t] : t.includes("stream") ? "running" : null, tt = (t) => {
844
+ icon: ht(t.tool ?? "tool")
845
+ }, yr = (t) => !t || typeof t != "string" ? null : rt[t] ? rt[t] : t.includes("stream") ? "running" : null, ot = (t) => {
850
846
  if (typeof t == "string") return t;
851
847
  if (t == null) return null;
852
848
  try {
@@ -854,159 +850,159 @@ const Kn = {
854
850
  } catch {
855
851
  return null;
856
852
  }
857
- }, So = (t) => {
853
+ }, Sr = (t) => {
858
854
  const e = [];
859
- St(t.state?.status) && t.state?.errorText && e.push({
855
+ wt(t.state?.status) && t.state?.errorText && e.push({
860
856
  type: "comment",
861
857
  text: t.state.errorText
862
858
  });
863
- const n = tt(t.state?.input);
859
+ const n = ot(t.state?.input);
864
860
  n && e.push({
865
861
  type: "code",
866
862
  language: "json",
867
863
  code: n
868
864
  });
869
- const o = tt(t.state?.output);
870
- return o && e.push({
865
+ const r = ot(t.state?.output);
866
+ return r && e.push({
871
867
  type: "code",
872
868
  language: "json",
873
- code: o
869
+ code: r
874
870
  }), e;
875
- }, ko = (t) => {
871
+ }, kr = (t) => {
876
872
  const e = [{
877
873
  kind: "text",
878
- text: bo(t.tool),
874
+ text: br(t.tool),
879
875
  bold: !0
880
- }], n = yo(t.state?.status);
876
+ }], n = yr(t.state?.status);
881
877
  return n && e.push({
882
878
  kind: "text",
883
879
  text: n,
884
880
  muted: !0
885
881
  }), {
886
- indicator: xo(t),
882
+ indicator: xr(t),
887
883
  title: e,
888
- blocks: So(t)
884
+ blocks: Sr(t)
889
885
  };
890
- }, To = (t) => t ? {
891
- ...Ze(),
886
+ }, Tr = (t) => t ? {
887
+ ...nt(),
892
888
  ...t
893
- } : Ze(), Co = (t, e) => {
889
+ } : nt(), wr = (t, e) => {
894
890
  const n = t.tool ?? "tool";
895
- return e[n] ?? e[yt(n)];
896
- }, wo = (t, e, n) => {
897
- const o = Co(t, e);
898
- if (o) {
899
- const r = o(t, n);
900
- if (r) return r;
891
+ return e[n] ?? e[Tt(n)];
892
+ }, Cr = (t, e, n) => {
893
+ const r = wr(t, e);
894
+ if (r) {
895
+ const o = r(t, n);
896
+ if (o) return o;
901
897
  }
902
- return ko(t);
903
- }, _o = (t, e) => {
904
- const n = To(e?.toolRenderers);
898
+ return kr(t);
899
+ }, _r = (t, e) => {
900
+ const n = Tr(e?.toolRenderers);
905
901
  return {
906
- items: t.map((r) => wo(r, n, e))
902
+ items: t.map((o) => Cr(o, n, e))
907
903
  };
908
- }, W = Mt, kt = (t, e, n, o = !1) => {
909
- o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
904
+ }, U = zt, Ct = (t, e, n, r = !1) => {
905
+ r && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
910
906
  };
911
- function Po(t) {
907
+ function Rr(t) {
912
908
  const e = y(6), {
913
909
  seg: n
914
910
  } = t;
915
- let o;
916
- e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ i(se.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
917
911
  let r;
918
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ i(se.Fallback, {}), e[3] = r) : r = e[3];
912
+ e[0] !== n.alt || e[1] !== n.src ? (r = /* @__PURE__ */ i(ae.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = r) : r = e[2];
913
+ let o;
914
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(ae.Fallback, {}), e[3] = o) : o = e[3];
919
915
  let s;
920
- return e[4] !== o ? (s = /* @__PURE__ */ b(se.Root, { width: "1.5rem", height: "1.5rem", children: [
921
- o,
922
- r
923
- ] }), e[4] = o, e[5] = s) : s = e[5], s;
916
+ return e[4] !== r ? (s = /* @__PURE__ */ b(ae.Root, { width: "1.5rem", height: "1.5rem", children: [
917
+ r,
918
+ o
919
+ ] }), e[4] = r, e[5] = s) : s = e[5], s;
924
920
  }
925
- function Ro(t) {
921
+ function Pr(t) {
926
922
  const e = y(9), {
927
923
  seg: n,
928
- onOpenFile: o
929
- } = t, r = n.additions ?? 0, s = n.deletions ?? 0;
924
+ onOpenFile: r
925
+ } = t, o = n.additions ?? 0, s = n.deletions ?? 0;
930
926
  let l;
931
- e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (l = () => {
932
- const a = n.filePath ?? n.fileName;
933
- o?.(a);
934
- }, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = l) : l = e[3];
935
- let c;
936
- return e[4] !== n.fileName || e[5] !== r || e[6] !== s || e[7] !== l ? (c = /* @__PURE__ */ i(dt, { fileName: n.fileName, additions: r, deletions: s, onClickFileLink: l }), e[4] = n.fileName, e[5] = r, e[6] = s, e[7] = l, e[8] = c) : c = e[8], c;
927
+ e[0] !== r || e[1] !== n.fileName || e[2] !== n.filePath ? (l = () => {
928
+ const c = n.filePath ?? n.fileName;
929
+ r?.(c);
930
+ }, e[0] = r, e[1] = n.fileName, e[2] = n.filePath, e[3] = l) : l = e[3];
931
+ let a;
932
+ return e[4] !== n.fileName || e[5] !== o || e[6] !== s || e[7] !== l ? (a = /* @__PURE__ */ i(pt, { fileName: n.fileName, additions: o, deletions: s, onClickFileLink: l }), e[4] = n.fileName, e[5] = o, e[6] = s, e[7] = l, e[8] = a) : a = e[8], a;
937
933
  }
938
- function Io(t) {
934
+ function Ir(t) {
939
935
  const e = y(13), {
940
936
  seg: n,
941
- onOpenFile: o
942
- } = t, r = n.bold ? "medium" : void 0, s = !!(n.href || n.filePath), l = n.href ?? "#", c = (n.muted, "fg.muted"), a = s ? "pointer" : "default";
937
+ onOpenFile: r
938
+ } = t, o = n.bold ? "medium" : void 0, s = !!(n.href || n.filePath), l = n.href ?? "#", a = (n.muted, "fg.muted"), c = s ? "pointer" : "default";
943
939
  let d;
944
- e[0] !== o || e[1] !== n ? (d = (m) => kt(m, n, o, !0), e[0] = o, e[1] = n, e[2] = d) : d = e[2];
945
- const u = n.muted ? "fg.muted" : "fg.blue-dark";
946
- let f;
947
- e[3] !== u ? (f = {
940
+ e[0] !== r || e[1] !== n ? (d = (m) => Ct(m, n, r, !0), e[0] = r, e[1] = n, e[2] = d) : d = e[2];
941
+ const f = n.muted ? "fg.muted" : "fg.blue-dark";
942
+ let u;
943
+ e[3] !== f ? (u = {
948
944
  textDecoration: "underline",
949
- color: u
950
- }, e[3] = u, e[4] = f) : f = e[4];
945
+ color: f
946
+ }, e[3] = f, e[4] = u) : u = e[4];
951
947
  let p;
952
- return e[5] !== r || e[6] !== n.text || e[7] !== l || e[8] !== c || e[9] !== a || e[10] !== d || e[11] !== f ? (p = /* @__PURE__ */ i(it, { href: l, fontWeight: r, color: c, textDecoration: "none", cursor: a, onClick: d, _hover: f, children: n.text }), e[5] = r, e[6] = n.text, e[7] = l, e[8] = c, e[9] = a, e[10] = d, e[11] = f, e[12] = p) : p = e[12], p;
948
+ return e[5] !== o || e[6] !== n.text || e[7] !== l || e[8] !== a || e[9] !== c || e[10] !== d || e[11] !== u ? (p = /* @__PURE__ */ i(at, { href: l, fontWeight: o, color: a, textDecoration: "none", cursor: c, onClick: d, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = l, e[8] = a, e[9] = c, e[10] = d, e[11] = u, e[12] = p) : p = e[12], p;
953
949
  }
954
- function vo(t) {
950
+ function vr(t) {
955
951
  const e = y(12), {
956
952
  seg: n,
957
- onOpenFile: o
958
- } = t, r = n.bold ? "medium" : void 0, s = n.href ?? "#", l = n.muted ? "fg.muted" : "accent.primary";
959
- let c;
960
- e[0] !== o || e[1] !== n ? (c = (f) => kt(f, n, o), e[0] = o, e[1] = n, e[2] = c) : c = e[2];
961
- const a = n.muted ? "fg.muted" : "accent.primary";
953
+ onOpenFile: r
954
+ } = t, o = n.bold ? "medium" : void 0, s = n.href ?? "#", l = n.muted ? "fg.muted" : "accent.primary";
955
+ let a;
956
+ e[0] !== r || e[1] !== n ? (a = (u) => Ct(u, n, r), e[0] = r, e[1] = n, e[2] = a) : a = e[2];
957
+ const c = n.muted ? "fg.muted" : "accent.primary";
962
958
  let d;
963
- e[3] !== a ? (d = {
964
- color: a,
959
+ e[3] !== c ? (d = {
960
+ color: c,
965
961
  textDecoration: "underline"
966
- }, e[3] = a, e[4] = d) : d = e[4];
967
- let u;
968
- return e[5] !== r || e[6] !== n.text || e[7] !== s || e[8] !== l || e[9] !== c || e[10] !== d ? (u = /* @__PURE__ */ i(it, { href: s, fontWeight: r, color: l, textDecoration: "underline", onClick: c, _hover: d, children: n.text }), e[5] = r, e[6] = n.text, e[7] = s, e[8] = l, e[9] = c, e[10] = d, e[11] = u) : u = e[11], u;
962
+ }, e[3] = c, e[4] = d) : d = e[4];
963
+ let f;
964
+ return e[5] !== o || e[6] !== n.text || e[7] !== s || e[8] !== l || e[9] !== a || e[10] !== d ? (f = /* @__PURE__ */ i(at, { href: s, fontWeight: o, color: l, textDecoration: "underline", onClick: a, _hover: d, children: n.text }), e[5] = o, e[6] = n.text, e[7] = s, e[8] = l, e[9] = a, e[10] = d, e[11] = f) : f = e[11], f;
969
965
  }
970
- function Bo(t) {
966
+ function Ar(t) {
971
967
  const e = y(6), {
972
968
  seg: n,
973
- isClickable: o
974
- } = t, r = n.bold ? "medium" : void 0, s = o && !n.muted ? "fg" : "fg.muted";
969
+ isClickable: r
970
+ } = t, o = n.bold ? "medium" : void 0, s = r && !n.muted ? "fg" : "fg.muted";
975
971
  let l;
976
972
  e[0] !== s ? (l = {
977
973
  color: s
978
974
  }, e[0] = s, e[1] = l) : l = e[1];
979
- let c;
980
- return e[2] !== n.text || e[3] !== r || e[4] !== l ? (c = /* @__PURE__ */ i(pe, { fontWeight: r, color: "fg.muted", _groupHover: l, children: n.text }), e[2] = n.text, e[3] = r, e[4] = l, e[5] = c) : c = e[5], c;
975
+ let a;
976
+ return e[2] !== n.text || e[3] !== o || e[4] !== l ? (a = /* @__PURE__ */ i(ye, { fontWeight: o, color: "fg.muted", _groupHover: l, children: n.text }), e[2] = n.text, e[3] = o, e[4] = l, e[5] = a) : a = e[5], a;
981
977
  }
982
- function Mo(t) {
978
+ function Br(t) {
983
979
  const e = y(11), {
984
980
  seg: n,
985
- isClickable: o,
986
- onOpenFile: r
981
+ isClickable: r,
982
+ onOpenFile: o
987
983
  } = t;
988
984
  switch (n.kind) {
989
985
  case "avatar": {
990
986
  let s;
991
- return e[0] !== n ? (s = /* @__PURE__ */ i(Po, { seg: n }), e[0] = n, e[1] = s) : s = e[1], s;
987
+ return e[0] !== n ? (s = /* @__PURE__ */ i(Rr, { seg: n }), e[0] = n, e[1] = s) : s = e[1], s;
992
988
  }
993
989
  case "diff": {
994
990
  let s;
995
- return e[2] !== r || e[3] !== n ? (s = /* @__PURE__ */ i(Ro, { seg: n, onOpenFile: r }), e[2] = r, e[3] = n, e[4] = s) : s = e[4], s;
991
+ return e[2] !== o || e[3] !== n ? (s = /* @__PURE__ */ i(Pr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = s) : s = e[4], s;
996
992
  }
997
993
  case "link": {
998
994
  let s;
999
- return e[5] !== r || e[6] !== n ? (s = n.variant === "bubble" ? /* @__PURE__ */ i(Io, { seg: n, onOpenFile: r }) : /* @__PURE__ */ i(vo, { seg: n, onOpenFile: r }), e[5] = r, e[6] = n, e[7] = s) : s = e[7], s;
995
+ return e[5] !== o || e[6] !== n ? (s = n.variant === "bubble" ? /* @__PURE__ */ i(Ir, { seg: n, onOpenFile: o }) : /* @__PURE__ */ i(vr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = s) : s = e[7], s;
1000
996
  }
1001
997
  case "text": {
1002
998
  let s;
1003
- return e[8] !== o || e[9] !== n ? (s = /* @__PURE__ */ i(Bo, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = s) : s = e[10], s;
999
+ return e[8] !== r || e[9] !== n ? (s = /* @__PURE__ */ i(Ar, { seg: n, isClickable: r }), e[8] = r, e[9] = n, e[10] = s) : s = e[10], s;
1004
1000
  }
1005
1001
  default:
1006
1002
  return null;
1007
1003
  }
1008
1004
  }
1009
- function Ao(t) {
1005
+ function Dr(t) {
1010
1006
  const e = y(10), {
1011
1007
  ind: n
1012
1008
  } = t;
@@ -1014,166 +1010,166 @@ function Ao(t) {
1014
1010
  return null;
1015
1011
  if (n.type === "icon") {
1016
1012
  let l;
1017
- e[0] !== n.icon ? (l = zn(n.icon), e[0] = n.icon, e[1] = l) : l = e[1];
1018
- const c = l;
1019
- let a;
1020
- return e[2] !== c ? (a = /* @__PURE__ */ i(W.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ i(pe, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ i(c, { size: 14, strokeWidth: 1 }) }) }), e[2] = c, e[3] = a) : a = e[3], a;
1013
+ e[0] !== n.icon ? (l = En(n.icon), e[0] = n.icon, e[1] = l) : l = e[1];
1014
+ const a = l;
1015
+ let c;
1016
+ return e[2] !== a ? (c = /* @__PURE__ */ i(U.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ i(ye, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ i(a, { size: 14, strokeWidth: 1 }) }) }), e[2] = a, e[3] = c) : c = e[3], c;
1021
1017
  }
1022
- let o;
1023
- e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ i(se.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
1024
1018
  let r;
1025
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ i(se.Fallback, {}), e[7] = r) : r = e[7];
1019
+ e[4] !== n.alt || e[5] !== n.src ? (r = /* @__PURE__ */ i(ae.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = r) : r = e[6];
1020
+ let o;
1021
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(ae.Fallback, {}), e[7] = o) : o = e[7];
1026
1022
  let s;
1027
- return e[8] !== o ? (s = /* @__PURE__ */ i(W.Indicator, { children: /* @__PURE__ */ b(se.Root, { boxSize: "full", children: [
1028
- o,
1029
- r
1030
- ] }) }), e[8] = o, e[9] = s) : s = e[9], s;
1023
+ return e[8] !== r ? (s = /* @__PURE__ */ i(U.Indicator, { children: /* @__PURE__ */ b(ae.Root, { boxSize: "full", children: [
1024
+ r,
1025
+ o
1026
+ ] }) }), e[8] = r, e[9] = s) : s = e[9], s;
1031
1027
  }
1032
- function Do(t) {
1028
+ function Mr(t) {
1033
1029
  const e = y(5), {
1034
1030
  code: n,
1035
- language: o
1036
- } = t, r = o ? `${o} code block` : "code block";
1031
+ language: r
1032
+ } = t, o = r ? `${r} code block` : "code block";
1037
1033
  let s;
1038
1034
  e[0] !== n ? (s = /* @__PURE__ */ i(k, { as: "code", children: n }), e[0] = n, e[1] = s) : s = e[1];
1039
1035
  let l;
1040
- return e[2] !== r || e[3] !== s ? (l = /* @__PURE__ */ i(k, { as: "pre", background: "bg.muted", color: "fg", borderRadius: "md", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", overflowX: "auto", whiteSpace: "pre", "aria-label": r, children: s }), e[2] = r, e[3] = s, e[4] = l) : l = e[4], l;
1036
+ return e[2] !== o || e[3] !== s ? (l = /* @__PURE__ */ i(k, { as: "pre", background: "bg.muted", color: "fg", borderRadius: "md", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", overflowX: "auto", whiteSpace: "pre", "aria-label": o, children: s }), e[2] = o, e[3] = s, e[4] = l) : l = e[4], l;
1041
1037
  }
1042
- function zo(t) {
1038
+ function zr(t) {
1043
1039
  const e = y(26), {
1044
1040
  b: n,
1045
- onOpenFile: o
1041
+ onOpenFile: r
1046
1042
  } = t;
1047
1043
  switch (n.type) {
1048
1044
  case "comment": {
1049
- let r;
1050
- e[0] !== n.text ? (r = /* @__PURE__ */ i(A.Body, { children: n.text }), e[0] = n.text, e[1] = r) : r = e[1];
1045
+ let o;
1046
+ e[0] !== n.text ? (o = /* @__PURE__ */ i(E.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1051
1047
  let s;
1052
- e[2] !== n.reactions ? (s = n.reactions?.clap ? /* @__PURE__ */ i(A.Footer, { children: /* @__PURE__ */ b(me, { children: [
1048
+ e[2] !== n.reactions ? (s = n.reactions?.clap ? /* @__PURE__ */ i(E.Footer, { children: /* @__PURE__ */ b(Se, { children: [
1053
1049
  "👏 ",
1054
1050
  n.reactions.clap
1055
1051
  ] }) }) : null, e[2] = n.reactions, e[3] = s) : s = e[3];
1056
1052
  let l;
1057
- return e[4] !== r || e[5] !== s ? (l = /* @__PURE__ */ b(A.Root, { children: [
1058
- r,
1053
+ return e[4] !== o || e[5] !== s ? (l = /* @__PURE__ */ b(E.Root, { children: [
1054
+ o,
1059
1055
  s
1060
- ] }), e[4] = r, e[5] = s, e[6] = l) : l = e[6], l;
1056
+ ] }), e[4] = o, e[5] = s, e[6] = l) : l = e[6], l;
1061
1057
  }
1062
1058
  case "code": {
1063
- let r;
1064
- return e[7] !== n.code || e[8] !== n.language ? (r = /* @__PURE__ */ i(A.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(A.Body, { padding: "0", children: /* @__PURE__ */ i(Do, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = r) : r = e[9], r;
1059
+ let o;
1060
+ return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ i(E.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(E.Body, { padding: "0", children: /* @__PURE__ */ i(Mr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1065
1061
  }
1066
1062
  case "diff": {
1067
- const r = n.sideBySide ?? !1;
1063
+ const o = n.sideBySide ?? !1;
1068
1064
  let s;
1069
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== r ? (s = /* @__PURE__ */ i(A.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(A.Body, { padding: "0", children: /* @__PURE__ */ i(k, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ i(rn, { original: n.original, modified: n.modified, language: n.language, sideBySide: r, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = r, e[14] = s) : s = e[14], s;
1065
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (s = /* @__PURE__ */ i(E.Root, { border: "0", padding: "0", children: /* @__PURE__ */ i(E.Body, { padding: "0", children: /* @__PURE__ */ i(k, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ i(sn, { original: n.original, modified: n.modified, language: n.language, sideBySide: o, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = o, e[14] = s) : s = e[14], s;
1070
1066
  }
1071
1067
  case "text": {
1072
- let r;
1073
- return e[15] !== n.text ? (r = /* @__PURE__ */ i(A.Root, { background: "transparent", children: /* @__PURE__ */ i(A.Body, { padding: "sm", children: /* @__PURE__ */ i(re, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = r) : r = e[16], r;
1068
+ let o;
1069
+ return e[15] !== n.text ? (o = /* @__PURE__ */ i(E.Root, { background: "transparent", children: /* @__PURE__ */ i(E.Body, { padding: "sm", children: /* @__PURE__ */ i(Y, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1074
1070
  }
1075
1071
  case "references": {
1076
- let r;
1077
- e[17] !== n.references ? (r = n.references.map($o), e[17] = n.references, e[18] = r) : r = e[18];
1072
+ let o;
1073
+ e[17] !== n.references ? (o = n.references.map(Er), e[17] = n.references, e[18] = o) : o = e[18];
1078
1074
  let s;
1079
- return e[19] !== r ? (s = /* @__PURE__ */ i(he, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: r }), e[19] = r, e[20] = s) : s = e[20], s;
1075
+ return e[19] !== o ? (s = /* @__PURE__ */ i(Te, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[19] = o, e[20] = s) : s = e[20], s;
1080
1076
  }
1081
1077
  case "component": {
1082
- let r;
1083
- e[21] !== n || e[22] !== o ? (r = n.render({
1084
- onOpenFile: o
1085
- }), e[21] = n, e[22] = o, e[23] = r) : r = e[23];
1078
+ let o;
1079
+ e[21] !== n || e[22] !== r ? (o = n.render({
1080
+ onOpenFile: r
1081
+ }), e[21] = n, e[22] = r, e[23] = o) : o = e[23];
1086
1082
  let s;
1087
- return e[24] !== r ? (s = /* @__PURE__ */ i(Ue, { children: r }), e[24] = r, e[25] = s) : s = e[25], s;
1083
+ return e[24] !== o ? (s = /* @__PURE__ */ i(Ve, { children: o }), e[24] = o, e[25] = s) : s = e[25], s;
1088
1084
  }
1089
1085
  }
1090
1086
  }
1091
- function $o(t) {
1087
+ function Er(t) {
1092
1088
  return /* @__PURE__ */ i(on, { fileName: t }, t);
1093
1089
  }
1094
- function Eo(t) {
1090
+ function $r(t) {
1095
1091
  const e = y(22), {
1096
1092
  item: n,
1097
- itemKey: o,
1098
- isOpen: r,
1093
+ itemKey: r,
1094
+ isOpen: o,
1099
1095
  canExpand: s,
1100
1096
  hasBlocks: l,
1101
- onToggle: c,
1102
- onOpenFile: a
1097
+ onToggle: a,
1098
+ onOpenFile: c
1103
1099
  } = t;
1104
1100
  let d;
1105
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ i(W.Separator, {}), e[0] = d) : d = e[0];
1106
- let u;
1107
- e[1] !== n.indicator ? (u = /* @__PURE__ */ b(W.Connector, { children: [
1108
- d,
1109
- /* @__PURE__ */ i(Ao, { ind: n.indicator })
1110
- ] }), e[1] = n.indicator, e[2] = u) : u = e[2];
1101
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ i(U.Separator, {}), e[0] = d) : d = e[0];
1111
1102
  let f;
1112
- e[3] !== s || e[4] !== r || e[5] !== n.title || e[6] !== o || e[7] !== a || e[8] !== c ? (f = n.title.length > 0 && /* @__PURE__ */ i(W.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: s ? "pointer" : "default", onClick: s ? () => c(o) : void 0, children: /* @__PURE__ */ b(pe, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1113
- /* @__PURE__ */ i(pe, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((h, T) => /* @__PURE__ */ i(Mo, { seg: h, isClickable: s, onOpenFile: a }, T)) }),
1114
- s ? /* @__PURE__ */ i(pe, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: r ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1103
+ e[1] !== n.indicator ? (f = /* @__PURE__ */ b(U.Connector, { children: [
1104
+ d,
1105
+ /* @__PURE__ */ i(Dr, { ind: n.indicator })
1106
+ ] }), e[1] = n.indicator, e[2] = f) : f = e[2];
1107
+ let u;
1108
+ e[3] !== s || e[4] !== o || e[5] !== n.title || e[6] !== r || e[7] !== c || e[8] !== a ? (u = n.title.length > 0 && /* @__PURE__ */ i(U.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: s ? "pointer" : "default", onClick: s ? () => a(r) : void 0, children: /* @__PURE__ */ b(ye, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1109
+ /* @__PURE__ */ i(ye, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((g, T) => /* @__PURE__ */ i(Br, { seg: g, isClickable: s, onOpenFile: c }, T)) }),
1110
+ s ? /* @__PURE__ */ i(ye, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1115
1111
  color: "fg"
1116
- }, children: /* @__PURE__ */ i(Qt, { size: 12 }) }) : null
1117
- ] }) }), e[3] = s, e[4] = r, e[5] = n.title, e[6] = o, e[7] = a, e[8] = c, e[9] = f) : f = e[9];
1112
+ }, children: /* @__PURE__ */ i(Zt, { size: 12 }) }) : null
1113
+ ] }) }), e[3] = s, e[4] = o, e[5] = n.title, e[6] = r, e[7] = c, e[8] = a, e[9] = u) : u = e[9];
1118
1114
  let p;
1119
- e[10] !== l || e[11] !== r || e[12] !== n.blocks || e[13] !== a ? (p = l ? /* @__PURE__ */ i(k, { display: "grid", gridTemplateRows: r ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: r ? /* @__PURE__ */ i(k, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((h, T) => /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(zo, { b: h, onOpenFile: a }) }, T)) }) : null }) : null, e[10] = l, e[11] = r, e[12] = n.blocks, e[13] = a, e[14] = p) : p = e[14];
1115
+ e[10] !== l || e[11] !== o || e[12] !== n.blocks || e[13] !== c ? (p = l ? /* @__PURE__ */ i(k, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ i(k, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((g, T) => /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(zr, { b: g, onOpenFile: c }) }, T)) }) : null }) : null, e[10] = l, e[11] = o, e[12] = n.blocks, e[13] = c, e[14] = p) : p = e[14];
1120
1116
  let m;
1121
- e[15] !== f || e[16] !== p ? (m = /* @__PURE__ */ b(W.Content, { pb: "xs", children: [
1122
- f,
1123
- p
1124
- ] }), e[15] = f, e[16] = p, e[17] = m) : m = e[17];
1125
- let g;
1126
- return e[18] !== o || e[19] !== u || e[20] !== m ? (g = /* @__PURE__ */ b(W.Item, { gap: "xs", children: [
1117
+ e[15] !== u || e[16] !== p ? (m = /* @__PURE__ */ b(U.Content, { pb: "xs", children: [
1127
1118
  u,
1119
+ p
1120
+ ] }), e[15] = u, e[16] = p, e[17] = m) : m = e[17];
1121
+ let h;
1122
+ return e[18] !== r || e[19] !== f || e[20] !== m ? (h = /* @__PURE__ */ b(U.Item, { gap: "xs", children: [
1123
+ f,
1128
1124
  m
1129
- ] }, o), e[18] = o, e[19] = u, e[20] = m, e[21] = g) : g = e[21], g;
1125
+ ] }, r), e[18] = r, e[19] = f, e[20] = m, e[21] = h) : h = e[21], h;
1130
1126
  }
1131
- function Fo(t) {
1127
+ function Lr(t) {
1132
1128
  const e = y(11), {
1133
1129
  data: n,
1134
- onOpenFile: o
1130
+ onOpenFile: r
1135
1131
  } = t;
1136
- let r;
1137
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = {}, e[0] = r) : r = e[0];
1138
- const [s, l] = oe(r), c = Lo;
1139
- let a;
1140
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (p) => {
1132
+ let o;
1133
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1134
+ const [s, l] = le(o), a = Fr;
1135
+ let c;
1136
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (p) => {
1141
1137
  l((m) => ({
1142
1138
  ...m,
1143
1139
  [p]: !m[p]
1144
1140
  }));
1145
- }, e[1] = a) : a = e[1];
1146
- const d = a;
1147
- let u;
1148
- if (e[2] !== n.items || e[3] !== s || e[4] !== o) {
1141
+ }, e[1] = c) : c = e[1];
1142
+ const d = c;
1143
+ let f;
1144
+ if (e[2] !== n.items || e[3] !== s || e[4] !== r) {
1149
1145
  let p;
1150
- e[6] !== s || e[7] !== o ? (p = (m, g) => {
1151
- const h = c(m, g), T = (m.blocks?.length ?? 0) > 0, D = (m.expandable ?? !0) && T, w = D ? s[h] ?? !1 : T;
1152
- return /* @__PURE__ */ i(Eo, { item: m, itemKey: h, isOpen: w, canExpand: D, hasBlocks: T, onToggle: d, onOpenFile: o }, h);
1153
- }, e[6] = s, e[7] = o, e[8] = p) : p = e[8], u = n.items.map(p), e[2] = n.items, e[3] = s, e[4] = o, e[5] = u;
1146
+ e[6] !== s || e[7] !== r ? (p = (m, h) => {
1147
+ const g = a(m, h), T = (m.blocks?.length ?? 0) > 0, L = (m.expandable ?? !0) && T, w = L ? s[g] ?? !1 : T;
1148
+ return /* @__PURE__ */ i($r, { item: m, itemKey: g, isOpen: w, canExpand: L, hasBlocks: T, onToggle: d, onOpenFile: r }, g);
1149
+ }, e[6] = s, e[7] = r, e[8] = p) : p = e[8], f = n.items.map(p), e[2] = n.items, e[3] = s, e[4] = r, e[5] = f;
1154
1150
  } else
1155
- u = e[5];
1156
- let f;
1157
- return e[9] !== u ? (f = /* @__PURE__ */ i(W.Root, { children: u }), e[9] = u, e[10] = f) : f = e[10], f;
1151
+ f = e[5];
1152
+ let u;
1153
+ return e[9] !== f ? (u = /* @__PURE__ */ i(U.Root, { children: f }), e[9] = f, e[10] = u) : u = e[10], u;
1158
1154
  }
1159
- function Lo(t, e) {
1155
+ function Fr(t, e) {
1160
1156
  return t.id ? `id:${t.id}` : `idx:${e}`;
1161
1157
  }
1162
- function Oo(t) {
1158
+ function Or(t) {
1163
1159
  const e = y(6), {
1164
1160
  invocations: n,
1165
- labeledBlocks: o,
1166
- onOpenFile: r
1161
+ labeledBlocks: r,
1162
+ onOpenFile: o
1167
1163
  } = t;
1168
1164
  let s;
1169
- e[0] !== n || e[1] !== o ? (s = _o(n, {
1170
- labeledBlocks: o
1171
- }), e[0] = n, e[1] = o, e[2] = s) : s = e[2];
1165
+ e[0] !== n || e[1] !== r ? (s = _r(n, {
1166
+ labeledBlocks: r
1167
+ }), e[0] = n, e[1] = r, e[2] = s) : s = e[2];
1172
1168
  const l = s;
1173
- let c;
1174
- return e[3] !== l || e[4] !== r ? (c = /* @__PURE__ */ i(Fo, { data: l, onOpenFile: r }), e[3] = l, e[4] = r, e[5] = c) : c = e[5], c;
1169
+ let a;
1170
+ return e[3] !== l || e[4] !== o ? (a = /* @__PURE__ */ i(Lr, { data: l, onOpenFile: o }), e[3] = l, e[4] = o, e[5] = a) : a = e[5], a;
1175
1171
  }
1176
- const Ho = (t) => t.type === "tool", We = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Wo = (t) => {
1172
+ const Wr = (t) => t.type === "tool", je = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Hr = (t) => {
1177
1173
  if (t.message && t.message.trim().length > 0)
1178
1174
  return t.message;
1179
1175
  const {
@@ -1189,36 +1185,42 @@ const Ho = (t) => t.type === "tool", We = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
1189
1185
  default:
1190
1186
  return "An error occurred.";
1191
1187
  }
1192
- }, jo = (t, e) => {
1188
+ }, jr = {
1189
+ info: "blue",
1190
+ warning: "orange",
1191
+ error: "red",
1192
+ success: "green",
1193
+ loading: "blue"
1194
+ }, Nr = (t, e) => {
1193
1195
  const n = [];
1194
- let o = e;
1195
- for (; o < t.length; ) {
1196
- const r = t[o];
1197
- if (!Ho(r)) break;
1198
- n.push(r), o += 1;
1196
+ let r = e;
1197
+ for (; r < t.length; ) {
1198
+ const o = t[r];
1199
+ if (!Wr(o)) break;
1200
+ n.push(o), r += 1;
1199
1201
  }
1200
1202
  return {
1201
1203
  invocations: n,
1202
- nextIndex: o - 1
1204
+ nextIndex: r - 1
1203
1205
  };
1204
1206
  };
1205
- function Tt(t) {
1207
+ function _t(t) {
1206
1208
  const e = y(7), {
1207
1209
  message: n,
1208
- onOpenFile: o,
1209
- toolInvocationTimeline: r
1210
- } = t, s = r ?? Oo;
1210
+ onOpenFile: r,
1211
+ toolInvocationTimeline: o
1212
+ } = t, s = o ?? Or;
1211
1213
  let l;
1212
1214
  e[0] !== n.parts ? (l = n.parts ?? [], e[0] = n.parts, e[1] = l) : l = e[1];
1213
- const c = l;
1214
- let a;
1215
- if (e[2] !== s || e[3] !== n.id || e[4] !== o || e[5] !== c) {
1215
+ const a = l;
1216
+ let c;
1217
+ if (e[2] !== s || e[3] !== n.id || e[4] !== r || e[5] !== a) {
1216
1218
  const d = [];
1217
- for (let u = 0; u < c.length; u = u + 1, u) {
1218
- const f = c[u], p = `${n.id}-${u}`;
1219
- e: switch (f.type) {
1219
+ for (let f = 0; f < a.length; f = f + 1, f) {
1220
+ const u = a[f], p = `${n.id}-${f}`;
1221
+ e: switch (u.type) {
1220
1222
  case "text": {
1221
- d.push(/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(Mn, { children: f.text }) }, p));
1223
+ d.push(/* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(Dn, { children: u.text }) }, p));
1222
1224
  break e;
1223
1225
  }
1224
1226
  case "reasoning": {
@@ -1228,57 +1230,54 @@ function Tt(t) {
1228
1230
  fontSize: ".75rem !important",
1229
1231
  fontWeight: "normal !important"
1230
1232
  }
1231
- }, children: /* @__PURE__ */ i(at, { defaultState: f.text, fullWidth: !0 }) }, p));
1233
+ }, children: /* @__PURE__ */ i(ft, { defaultState: u.text, fullWidth: !0 }) }, p));
1232
1234
  break e;
1233
1235
  }
1234
1236
  case "tool": {
1235
1237
  const {
1236
1238
  invocations: m,
1237
- nextIndex: g
1238
- } = jo(c, u);
1239
- u = g, d.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(s, { invocations: m, labeledBlocks: !0, onOpenFile: o }) }, p));
1240
- break e;
1241
- }
1242
- case "loading": {
1243
- d.push(/* @__PURE__ */ b(k, { display: "flex", alignItems: "center", gap: "2", py: "2", children: [
1244
- /* @__PURE__ */ i(At, { size: "sm" }),
1245
- /* @__PURE__ */ i(re, { fontSize: "sm", color: "fg.muted", children: "Thinking..." })
1246
- ] }, p));
1239
+ nextIndex: h
1240
+ } = Nr(a, f);
1241
+ f = h, d.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(s, { invocations: m, labeledBlocks: !0, onOpenFile: r }) }, p));
1247
1242
  break e;
1248
1243
  }
1249
1244
  case "error": {
1250
- d.push(/* @__PURE__ */ i(k, { py: "2", children: /* @__PURE__ */ i(re, { fontSize: "sm", color: "fg.error", children: Wo(f) }) }, p));
1245
+ d.push(/* @__PURE__ */ i(k, { py: "2", width: "full", children: /* @__PURE__ */ i(Ze, { borderRadius: "xs", status: "error", colorPalette: "red", title: Hr(u), size: "sm" }) }, p));
1251
1246
  break e;
1252
1247
  }
1253
1248
  case "token_usage": {
1254
- d.push(/* @__PURE__ */ i(k, { py: "1", children: /* @__PURE__ */ b(re, { fontSize: "xs", color: "fg.subtle", children: [
1249
+ d.push(/* @__PURE__ */ i(k, { children: /* @__PURE__ */ b(Y, { fontSize: "xs", color: "fg.subtle", children: [
1255
1250
  "Tokens: ",
1256
- We(f.inputTokens),
1251
+ je(u.inputTokens),
1257
1252
  " in / ",
1258
- We(f.outputTokens),
1253
+ je(u.outputTokens),
1259
1254
  " out",
1260
- f.cacheReadTokens ? ` / ${We(f.cacheReadTokens)} cache read` : ""
1255
+ u.cacheReadTokens ? ` / ${je(u.cacheReadTokens)} cache read` : ""
1261
1256
  ] }) }, p));
1262
1257
  break e;
1263
1258
  }
1259
+ case "alert": {
1260
+ d.push(/* @__PURE__ */ i(k, { width: "full", children: /* @__PURE__ */ i(Ze, { borderRadius: "xs", status: u.status === "loading" ? "info" : u.status, colorPalette: jr[u.status], title: u.title, icon: u.status === "loading" ? /* @__PURE__ */ i(qe, { size: "sm" }) : void 0, size: "sm", children: u.message }) }, p));
1261
+ break e;
1262
+ }
1264
1263
  default:
1265
1264
  d.push(null);
1266
1265
  }
1267
1266
  }
1268
- a = /* @__PURE__ */ i(Ue, { children: d }), e[2] = s, e[3] = n.id, e[4] = o, e[5] = c, e[6] = a;
1267
+ c = /* @__PURE__ */ i(Ve, { children: d }), e[2] = s, e[3] = n.id, e[4] = r, e[5] = a, e[6] = c;
1269
1268
  } else
1270
- a = e[6];
1271
- return a;
1269
+ c = e[6];
1270
+ return c;
1272
1271
  }
1273
- const No = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Uo = (t) => {
1272
+ const Ur = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Vr = (t) => {
1274
1273
  const e = t.parts ?? [];
1275
- return e.length === 0 || e.some((o) => o.type === "text" && "text" in o) ? !1 : e.some((o) => o.type === "reasoning" || o.type === "tool");
1276
- }, Vo = (t) => {
1274
+ return e.length === 0 || e.some((r) => r.type === "text" && "text" in r) ? !1 : e.some((r) => r.type === "reasoning" || r.type === "tool");
1275
+ }, qr = (t) => {
1277
1276
  const e = [];
1278
1277
  for (const n of t) {
1279
- const o = e[e.length - 1];
1280
- if (o && o.role === n.role && Uo(n)) {
1281
- o.parts = [...o.parts ?? [], ...n.parts ?? []];
1278
+ const r = e[e.length - 1];
1279
+ if (r && r.role === n.role && Vr(n)) {
1280
+ r.parts = [...r.parts ?? [], ...n.parts ?? []];
1282
1281
  continue;
1283
1282
  }
1284
1283
  e.push({
@@ -1287,136 +1286,152 @@ const No = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
1287
1286
  });
1288
1287
  }
1289
1288
  return e;
1290
- }, qo = (t) => {
1289
+ }, Gr = (t) => {
1291
1290
  const e = [], n = [];
1292
- for (const o of t)
1293
- o.role === "user" ? e.push({
1294
- userMessage: o,
1291
+ for (const r of t)
1292
+ r.role === "user" ? e.push({
1293
+ userMessage: r,
1295
1294
  responses: []
1296
- }) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
1295
+ }) : e.length > 0 ? e[e.length - 1].responses.push(r) : n.push(r);
1297
1296
  return {
1298
1297
  groups: e,
1299
1298
  leadingResponses: n
1300
1299
  };
1301
- }, nt = (t, e) => {
1302
- const n = No(t.role);
1303
- return /* @__PURE__ */ i(j.Root, { from: n, children: /* @__PURE__ */ i(j.Content, { from: n, children: /* @__PURE__ */ i(Tt, { message: t, streaming: e }) }) }, t.id);
1304
- }, Ir = (t) => {
1305
- const e = y(24), {
1300
+ }, st = (t, e) => {
1301
+ const n = Ur(t.role);
1302
+ return /* @__PURE__ */ i(V.Root, { from: n, children: /* @__PURE__ */ i(V.Content, { from: n, children: /* @__PURE__ */ i(_t, { message: t, streaming: e }) }) }, t.id);
1303
+ }, Ao = (t) => {
1304
+ const e = y(27), {
1306
1305
  messages: n,
1307
- streaming: o,
1308
- emptyStateTitle: r,
1306
+ streaming: r,
1307
+ emptyStateTitle: o,
1309
1308
  emptyStateDescription: s,
1310
1309
  emptyStateContent: l,
1311
- loadingContent: c,
1312
- chatInputPlaceholder: a,
1310
+ loadingContent: a,
1311
+ chatInputPlaceholder: c,
1313
1312
  chatInputDefaultValue: d,
1314
- onSubmitMessage: u,
1315
- onChatInputChange: f,
1313
+ onSubmitMessage: f,
1314
+ onChatInputChange: u,
1316
1315
  actions: p,
1317
1316
  repoMenu: m,
1318
- attachedResources: g,
1319
- onClearAttachments: h,
1317
+ attachedResources: h,
1318
+ onClearAttachments: g,
1320
1319
  attachmentList: T,
1321
- approvalPrompt: D,
1322
- workspaceHub: w
1323
- } = t, I = o === void 0 ? !1 : o, z = d === void 0 ? "" : d, q = Vo(n), de = q.length > 0, ge = q.reduce(Go, 0), {
1324
- groups: ue,
1325
- leadingResponses: be
1326
- } = qo(q), [G, $] = oe(Ko), fe = I ? c ?? l : l, N = !!w;
1327
- let E;
1328
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = (S) => {
1329
- $((P) => {
1330
- const C = new Set(P);
1331
- return C.has(S) ? C.delete(S) : C.add(S), C;
1320
+ approvalPrompt: L,
1321
+ workspaceHub: w,
1322
+ workspaceInitializing: pe,
1323
+ inputDisabled: q
1324
+ } = t, P = r === void 0 ? !1 : r, G = d === void 0 ? "" : d, we = pe === void 0 ? !1 : pe, K = q === void 0 ? !1 : q, J = qr(n), X = J.length > 0, F = J.reduce(Kr, 0), {
1325
+ groups: me,
1326
+ leadingResponses: Ce
1327
+ } = Gr(J), [he, Q] = le(Xr), Z = P ? a ?? l : l, A = !!w, O = P && X && !we;
1328
+ let B;
1329
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = (S) => {
1330
+ Q((z) => {
1331
+ const R = new Set(z);
1332
+ return R.has(S) ? R.delete(S) : R.add(S), R;
1332
1333
  });
1333
- }, e[0] = E) : E = e[0];
1334
- const U = E, F = He, L = de ? /* @__PURE__ */ b(he, { gap: "sm", children: [
1335
- be.map((S) => nt(S, I)),
1336
- ue.map((S) => {
1337
- const P = vn(S.userMessage), C = G.has(S.userMessage.id);
1334
+ }, e[0] = B) : B = e[0];
1335
+ const ge = B, W = He, be = X ? /* @__PURE__ */ b(Te, { gap: "sm", children: [
1336
+ Ce.map((S) => st(S, P)),
1337
+ me.map((S) => {
1338
+ const z = An(S.userMessage), R = he.has(S.userMessage.id);
1338
1339
  return /* @__PURE__ */ b(k, { children: [
1339
1340
  /* @__PURE__ */ b(k, { position: "sticky", top: "0", zIndex: 1, children: [
1340
1341
  /* @__PURE__ */ b(k, { position: "relative", children: [
1341
- /* @__PURE__ */ i(j.Root, { from: "user", children: /* @__PURE__ */ i(j.Content, { from: "user", maxH: P && !C ? Rn : void 0, overflowY: "hidden", children: /* @__PURE__ */ i(Tt, { message: S.userMessage, streaming: I }) }) }),
1342
- P && !C && /* @__PURE__ */ i(V, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: "flex-end", alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", children: /* @__PURE__ */ i(me, { size: "2xs", variant: "solid", onClick: () => U(S.userMessage.id), children: "Show more" }) })
1342
+ /* @__PURE__ */ i(V.Root, { from: "user", children: /* @__PURE__ */ i(V.Content, { from: "user", maxH: z && !R ? In : void 0, overflowY: "hidden", children: /* @__PURE__ */ i(_t, { message: S.userMessage, streaming: P }) }) }),
1343
+ z && !R && /* @__PURE__ */ i($, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: "flex-end", alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", children: /* @__PURE__ */ i(Se, { size: "2xs", variant: "solid", onClick: () => ge(S.userMessage.id), children: "Show more" }) })
1343
1344
  ] }),
1344
- P && C && /* @__PURE__ */ i(V, { justifyContent: "flex-end", mt: "2xs", mb: "sm", children: /* @__PURE__ */ i(me, { size: "2xs", variant: "ghost", onClick: () => U(S.userMessage.id), children: "Show less" }) })
1345
+ z && R && /* @__PURE__ */ i($, { justifyContent: "flex-end", mt: "2xs", mb: "sm", children: /* @__PURE__ */ i(Se, { size: "2xs", variant: "ghost", onClick: () => ge(S.userMessage.id), children: "Show less" }) })
1345
1346
  ] }),
1346
- S.responses.map((Y) => nt(Y, I))
1347
+ S.responses.map((xe) => st(xe, P))
1347
1348
  ] }, S.userMessage.id);
1348
1349
  })
1349
- ] }) : fe ?? /* @__PURE__ */ i(sn, { icon: /* @__PURE__ */ i(Zt, { size: 48, strokeWidth: 1.5 }), title: r, description: s });
1350
- let v;
1351
- e[1] !== F.Viewport || e[2] !== L ? (v = /* @__PURE__ */ i(F.Viewport, { children: L }), e[1] = F.Viewport, e[2] = L, e[3] = v) : v = e[3];
1352
- let B;
1353
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = /* @__PURE__ */ i(He.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[4] = B) : B = e[4];
1354
- const K = N ? "0" : "xs";
1355
- let R;
1356
- e[5] !== z ? (R = _n(z), e[5] = z, e[6] = R) : R = e[6];
1357
- let O;
1358
- e[7] !== p || e[8] !== g || e[9] !== T || e[10] !== a || e[11] !== N || e[12] !== f || e[13] !== h || e[14] !== u || e[15] !== I || e[16] !== R ? (O = /* @__PURE__ */ i(kn, { placeholder: a, defaultState: R, streaming: I, onSubmit: u, onChange: f, actions: p, attachedResources: g, onClearAttachments: h, attachmentList: T, attachedToTop: N }), e[7] = p, e[8] = g, e[9] = T, e[10] = a, e[11] = N, e[12] = f, e[13] = h, e[14] = u, e[15] = I, e[16] = R, e[17] = O) : O = e[17];
1350
+ ] }) : Z ?? /* @__PURE__ */ i(ln, { icon: /* @__PURE__ */ i(en, { size: 48, strokeWidth: 1.5 }), title: o, description: s });
1351
+ let D;
1352
+ e[1] !== W.Viewport || e[2] !== be ? (D = /* @__PURE__ */ i(W.Viewport, { children: be }), e[1] = W.Viewport, e[2] = be, e[3] = D) : D = e[3];
1353
+ let H;
1354
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = /* @__PURE__ */ i(He.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[4] = H) : H = e[4];
1359
1355
  let M;
1360
- e[18] !== K || e[19] !== O || e[20] !== w ? (M = /* @__PURE__ */ b(he, { px: "sm", gap: K, children: [
1356
+ e[5] !== O ? (M = O ? /* @__PURE__ */ b(ke, { gap: "xs", px: "sm", py: "2xs", children: [
1357
+ /* @__PURE__ */ i(qe, { size: "xs", color: "fg.muted" }),
1358
+ /* @__PURE__ */ i(Y, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
1359
+ ] }) : null, e[5] = O, e[6] = M) : M = e[6];
1360
+ const v = A ? "0" : "xs";
1361
+ let C;
1362
+ e[7] !== G ? (C = Rn(G), e[7] = G, e[8] = C) : C = e[8];
1363
+ let I;
1364
+ e[9] !== p || e[10] !== h || e[11] !== T || e[12] !== c || e[13] !== A || e[14] !== K || e[15] !== u || e[16] !== g || e[17] !== f || e[18] !== P || e[19] !== C ? (I = /* @__PURE__ */ i(Tn, { placeholder: c, defaultState: C, streaming: P, onSubmit: f, onChange: u, actions: p, attachedResources: h, onClearAttachments: g, attachmentList: T, isDisabled: K, attachedToTop: A }), e[9] = p, e[10] = h, e[11] = T, e[12] = c, e[13] = A, e[14] = K, e[15] = u, e[16] = g, e[17] = f, e[18] = P, e[19] = C, e[20] = I) : I = e[20];
1365
+ let j;
1366
+ e[21] !== v || e[22] !== I || e[23] !== w ? (j = /* @__PURE__ */ b(Te, { px: "sm", gap: v, children: [
1361
1367
  w,
1362
- O
1363
- ] }), e[18] = K, e[19] = O, e[20] = w, e[21] = M) : M = e[21];
1364
- let H;
1365
- return e[22] !== m ? (H = /* @__PURE__ */ i(V, { p: "2xs", justifyContent: "flex-end", children: m }), e[22] = m, e[23] = H) : H = e[23], /* @__PURE__ */ b(V, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
1368
+ I
1369
+ ] }), e[21] = v, e[22] = I, e[23] = w, e[24] = j) : j = e[24];
1370
+ let N;
1371
+ return e[25] !== m ? (N = /* @__PURE__ */ i($, { p: "2xs", justifyContent: "flex-end", children: m }), e[25] = m, e[26] = N) : N = e[26], /* @__PURE__ */ b($, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
1366
1372
  /* @__PURE__ */ b(He.Root, { children: [
1367
- /* @__PURE__ */ i(yn, { userMessageCount: ge }),
1368
- v,
1369
- B
1373
+ /* @__PURE__ */ i(Sn, { userMessageCount: F }),
1374
+ D,
1375
+ H
1370
1376
  ] }),
1371
- D,
1377
+ L,
1372
1378
  M,
1373
- H
1379
+ j,
1380
+ N
1374
1381
  ] });
1375
1382
  };
1376
- function Go(t, e) {
1383
+ function Kr(t, e) {
1377
1384
  return t + (e.role === "user" ? 1 : 0);
1378
1385
  }
1379
- function Ko() {
1386
+ function Xr() {
1380
1387
  return /* @__PURE__ */ new Set();
1381
1388
  }
1382
- const ot = (t) => /* @__PURE__ */ i(he, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ i(Dt, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), vr = () => {
1389
+ const it = (t) => /* @__PURE__ */ i(Te, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ i(Et, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), Bo = () => {
1383
1390
  const t = y(2);
1384
1391
  let e;
1385
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ i(j.Root, { from: "user", children: /* @__PURE__ */ i(j.Content, { from: "user", children: ot(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
1392
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ i(V.Root, { from: "user", children: /* @__PURE__ */ i(V.Content, { from: "user", children: it(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
1386
1393
  let n;
1387
- return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ b(he, { minH: "full", py: "xs", gap: "0", children: [
1394
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ b(Te, { minH: "full", py: "xs", gap: "0", children: [
1388
1395
  e,
1389
- /* @__PURE__ */ i(j.Root, { from: "assistant", children: /* @__PURE__ */ i(j.Content, { from: "assistant", children: ot(["76%", "62%", "40%"]) }) })
1396
+ /* @__PURE__ */ i(V.Root, { from: "assistant", children: /* @__PURE__ */ i(V.Content, { from: "assistant", children: it(["76%", "62%", "40%"]) }) })
1390
1397
  ] }), t[1] = n) : n = t[1], n;
1391
- }, Br = (t) => {
1392
- const e = y(8), {
1398
+ }, Do = (t) => {
1399
+ const e = y(14), {
1393
1400
  changesLabel: n,
1394
- additions: o,
1395
- deletions: r,
1396
- action: s
1397
- } = t;
1398
- let l;
1399
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = {
1401
+ additions: r,
1402
+ deletions: o,
1403
+ action: s,
1404
+ status: l,
1405
+ statusLabel: a
1406
+ } = t, c = l === void 0 ? "ready" : l, d = r > 0 || o > 0, f = c === "error" ? "border.error" : "border.muted", u = c === "error" ? "bg.error" : "bg.subtle";
1407
+ let p;
1408
+ e[0] !== r || e[1] !== n || e[2] !== o || e[3] !== d || e[4] !== c || e[5] !== a ? (p = c === "loading" ? /* @__PURE__ */ b(ke, { gap: "xs", minW: "0", children: [
1409
+ /* @__PURE__ */ i(qe, { size: "xs", color: "fg.muted" }),
1410
+ /* @__PURE__ */ i(Y, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: a ?? "Setting up workspace..." })
1411
+ ] }) : c === "error" ? /* @__PURE__ */ b(ke, { gap: "xs", minW: "0", children: [
1412
+ /* @__PURE__ */ i(dt, { size: 14, color: "var(--chakra-colors-fg-error)" }),
1413
+ /* @__PURE__ */ i(Y, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: a ?? "Workspace setup failed" })
1414
+ ] }) : d ? /* @__PURE__ */ i(pt, { label: n, additions: r, deletions: o, variant: "ghost", size: "small", _hover: {
1400
1415
  background: "transparent"
1401
- }, e[0] = l) : l = e[0];
1402
- let c;
1403
- e[1] !== o || e[2] !== n || e[3] !== r ? (c = /* @__PURE__ */ i(dt, { label: n, additions: o, deletions: r, variant: "ghost", size: "small", _hover: l }), e[1] = o, e[2] = n, e[3] = r, e[4] = c) : c = e[4];
1404
- let a;
1405
- return e[5] !== s || e[6] !== c ? (a = /* @__PURE__ */ b(V, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "xs", borderBottomRadius: "0", bg: "bg.subtle", children: [
1406
- c,
1407
- s
1408
- ] }), e[5] = s, e[6] = c, e[7] = a) : a = e[7], a;
1416
+ } }) : /* @__PURE__ */ i($, { flex: "1" }), e[0] = r, e[1] = n, e[2] = o, e[3] = d, e[4] = c, e[5] = a, e[6] = p) : p = e[6];
1417
+ let m;
1418
+ e[7] !== s ? (m = s ? /* @__PURE__ */ i($, { flexShrink: 0, ml: "auto", children: s }) : null, e[7] = s, e[8] = m) : m = e[8];
1419
+ let h;
1420
+ return e[9] !== f || e[10] !== u || e[11] !== p || e[12] !== m ? (h = /* @__PURE__ */ b($, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: f, borderRadius: "xs", borderBottomRadius: "0", bg: u, children: [
1421
+ p,
1422
+ m
1423
+ ] }), e[9] = f, e[10] = u, e[11] = p, e[12] = m, e[13] = h) : h = e[13], h;
1409
1424
  };
1410
1425
  export {
1411
- Rr as ApprovalPrompt,
1412
- yn as AutoScroll,
1413
- kn as ChatInput,
1414
- j as ChatMessage,
1415
- Ir as ChatPanel,
1426
+ vo as ApprovalPrompt,
1427
+ Sn as AutoScroll,
1428
+ Tn as ChatInput,
1429
+ V as ChatMessage,
1430
+ Ao as ChatPanel,
1416
1431
  He as ChatPrimitives,
1417
- vr as ChatSkeleton,
1418
- Br as ChatWorkspaceHub,
1419
- Sn as SendButton,
1420
- _n as createSerializedPromptState
1432
+ Bo as ChatSkeleton,
1433
+ Do as ChatWorkspaceHub,
1434
+ kn as SendButton,
1435
+ Rn as createSerializedPromptState
1421
1436
  };
1422
1437
  //# sourceMappingURL=chat-ui.js.map