@pstdio/ui 0.25.0 → 0.26.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 (99) hide show
  1. package/README.md +8 -1
  2. package/dist/{MermaidComponent-BVdDqDRU.js → MermaidComponent-X__B6qib.js} +3 -3
  3. package/dist/{MermaidComponent-BVdDqDRU.js.map → MermaidComponent-X__B6qib.js.map} +1 -1
  4. package/dist/activity-timeline-BynMjXSB.js +283 -0
  5. package/dist/activity-timeline-BynMjXSB.js.map +1 -0
  6. package/dist/alert-ubcrW24X.js +33 -0
  7. package/dist/alert-ubcrW24X.js.map +1 -0
  8. package/dist/browser-storage-BinyFNJX.js +40 -0
  9. package/dist/browser-storage-BinyFNJX.js.map +1 -0
  10. package/dist/chat-ui.js +1515 -1429
  11. package/dist/chat-ui.js.map +1 -1
  12. package/dist/components/activity/index.d.ts +1 -3
  13. package/dist/components/chat-ui/components/chat-history-story.d.ts +14 -0
  14. package/dist/components/chat-ui/components/chat-input-history.d.ts +6 -0
  15. package/dist/components/chat-ui/components/chat-input.d.ts +2 -0
  16. package/dist/components/chat-ui/components/chat-panel-composer.d.ts +49 -0
  17. package/dist/components/chat-ui/components/use-chat-input-history.d.ts +16 -0
  18. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +1 -1
  19. package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
  20. package/dist/components/diff-viewer/code-editor.d.ts +2 -0
  21. package/dist/components/rich-text/index.d.ts +2 -0
  22. package/dist/components/rich-text/markdown-editor/markdown-editor-scrolling.play.d.ts +4 -0
  23. package/dist/components/rich-text/prompt-input/plugins/KeyboardShortcutPlugin.d.ts +3 -1
  24. package/dist/components/rich-text/prompt-input/plugins/keyboard-shortcuts.d.ts +2 -0
  25. package/dist/components/rich-text/prompt-input/prompt-input.d.ts +2 -0
  26. package/dist/components/{activity → rich-text/resource-activity-feed}/resource-activity-feed.d.ts +1 -1
  27. package/dist/components/rich-text/shared/plugins/FloatingTextFormatToolbarPlugin/should-show-floating-toolbar.d.ts +1 -0
  28. package/dist/data-table.js +6 -6
  29. package/dist/diff.js +524 -522
  30. package/dist/diff.js.map +1 -1
  31. package/dist/{edit-mode-data-table-B8UpWb7i.js → edit-mode-data-table-Nfmfi7bz.js} +23 -22
  32. package/dist/{edit-mode-data-table-B8UpWb7i.js.map → edit-mode-data-table-Nfmfi7bz.js.map} +1 -1
  33. package/dist/index.d.ts +2 -3
  34. package/dist/index.js +1766 -2232
  35. package/dist/index.js.map +1 -1
  36. package/dist/{kanban-renderer-toolbar-DzY6THJY.js → kanban-renderer-toolbar-Buek4icz.js} +34 -33
  37. package/dist/{kanban-renderer-toolbar-DzY6THJY.js.map → kanban-renderer-toolbar-Buek4icz.js.map} +1 -1
  38. package/dist/kanban-renderer.js +31 -30
  39. package/dist/kanban-renderer.js.map +1 -1
  40. package/dist/lazy-markdown-editor-PzIBc9-l.js +42 -0
  41. package/dist/lazy-markdown-editor-PzIBc9-l.js.map +1 -0
  42. package/dist/{list-row-BDoV_iMV.js → list-row-DHzRa9-O.js} +2 -2
  43. package/dist/{list-row-BDoV_iMV.js.map → list-row-DHzRa9-O.js.map} +1 -1
  44. package/dist/{markdown-gNucAjnF.js → markdown-BCfPxNpb.js} +323 -303
  45. package/dist/markdown-BCfPxNpb.js.map +1 -0
  46. package/dist/markdown-editor-CsJ4KNGu.js +1034 -0
  47. package/dist/markdown-editor-CsJ4KNGu.js.map +1 -0
  48. package/dist/{mermaid-renderer-CVnuKs-A.js → mermaid-renderer-D0YP0FmJ.js} +3 -3
  49. package/dist/{mermaid-renderer-CVnuKs-A.js.map → mermaid-renderer-D0YP0FmJ.js.map} +1 -1
  50. package/dist/mermaid.js +1 -1
  51. package/dist/{param-editor-CTx3mDxQ.js → param-editor-CFM2Nf3l.js} +2 -2
  52. package/dist/{param-editor-CTx3mDxQ.js.map → param-editor-CFM2Nf3l.js.map} +1 -1
  53. package/dist/param-editor-field-Bj-AGUY6.js +1728 -0
  54. package/dist/param-editor-field-Bj-AGUY6.js.map +1 -0
  55. package/dist/param-editor.d.ts +2 -0
  56. package/dist/param-editor.js +47 -0
  57. package/dist/param-editor.js.map +1 -0
  58. package/dist/prism-n5gcERyD.js +202 -0
  59. package/dist/prism-n5gcERyD.js.map +1 -0
  60. package/dist/radio-BfjibByI.js +51 -0
  61. package/dist/radio-BfjibByI.js.map +1 -0
  62. package/dist/rich-message-q6Y6QJOq.js +633 -0
  63. package/dist/rich-message-q6Y6QJOq.js.map +1 -0
  64. package/dist/rich-text.js +342 -178
  65. package/dist/rich-text.js.map +1 -1
  66. package/dist/scroll-area-BMbg1WcD.js +91 -0
  67. package/dist/scroll-area-BMbg1WcD.js.map +1 -0
  68. package/dist/slider-DBHjdxsU.js +1092 -0
  69. package/dist/slider-DBHjdxsU.js.map +1 -0
  70. package/dist/style.css +1 -1
  71. package/dist/terminal.js +96 -93
  72. package/dist/terminal.js.map +1 -1
  73. package/dist/theme/recipes/timeline.d.ts +9 -0
  74. package/dist/{theme-Dc7hVvMC.js → theme-AzJH4Om3.js} +10 -1
  75. package/dist/theme-AzJH4Om3.js.map +1 -0
  76. package/dist/{theme-preference-Bpobguh4.js → theme-preference-DxGW1qg-.js} +2 -2
  77. package/dist/{theme-preference-Bpobguh4.js.map → theme-preference-DxGW1qg-.js.map} +1 -1
  78. package/dist/theme.js +1 -1
  79. package/dist/{tree-list-CZvcg3_6.js → tree-list-CPjbGTvs.js} +2 -2
  80. package/dist/{tree-list-CZvcg3_6.js.map → tree-list-CPjbGTvs.js.map} +1 -1
  81. package/dist/{workspace-badge-BR_GgsAG.js → workspace-badge-CuOcmnZc.js} +2 -2
  82. package/dist/{workspace-badge-BR_GgsAG.js.map → workspace-badge-CuOcmnZc.js.map} +1 -1
  83. package/package.json +7 -2
  84. package/dist/browser-storage-DPtOQJx0.js +0 -127
  85. package/dist/browser-storage-DPtOQJx0.js.map +0 -1
  86. package/dist/lazy-markdown-editor-ClZPZuaU.js +0 -235
  87. package/dist/lazy-markdown-editor-ClZPZuaU.js.map +0 -1
  88. package/dist/markdown-editor-CAVqJ9yR.js +0 -1019
  89. package/dist/markdown-editor-CAVqJ9yR.js.map +0 -1
  90. package/dist/markdown-gNucAjnF.js.map +0 -1
  91. package/dist/param-editor-field-DteDEyeU.js +0 -2810
  92. package/dist/param-editor-field-DteDEyeU.js.map +0 -1
  93. package/dist/prompt-input-DNpRL5tI.js +0 -564
  94. package/dist/prompt-input-DNpRL5tI.js.map +0 -1
  95. package/dist/radio-cLMEBBZk.js +0 -76
  96. package/dist/radio-cLMEBBZk.js.map +0 -1
  97. package/dist/rich-message-CuPiKxKX.js +0 -78
  98. package/dist/rich-message-CuPiKxKX.js.map +0 -1
  99. package/dist/theme-Dc7hVvMC.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,23 +1,23 @@
1
- import { jsx as c, jsxs as k, Fragment as At } from "react/jsx-runtime";
2
- import { c as A } from "react/compiler-runtime";
3
- import { AbsoluteCenter as zn, IconButton as Pe, chakra as Gt, createSlotRecipeContext as Qn, defineSlotRecipe as qn, Text as U, Code as Bt, Button as Oe, HStack as Z, Box as P, Flex as be, Stack as j, Textarea as Wn, Tooltip as Ke, Portal as Yt, Kbd as Hn, Spacer as Vn, Link as Jt, Span as $e, Avatar as Ee, Timeline as Nn, Image as Zt, Card as Y, Spinner as kt, Badge as Un, Icon as dt, Skeleton as jn } from "@chakra-ui/react";
4
- import { ArrowDownIcon as Kn, ShieldX as Xn, ShieldCheck as Gn, Check as en, Pause as Yn, ArrowUp as Jn, Copy as Zn, Move as es, FileDown as ts, FileUp as ns, FileDiff as ss, Trash2 as tn, FilePen as os, FileText as rs, ListTree as is, Terminal as nn, ListTodo as ls, CircleQuestionMark as as, File as cs, Globe as us, Search as ds, AlertTriangle as sn, DotIcon as fs, ChevronUpIcon as ps, GripVertical as ms, Pencil as hs, MessageCircleIcon as gs } from "lucide-react";
5
- import { useStickToBottomContext as Ge, StickToBottom as bs } from "use-stick-to-bottom";
6
- import { S as Ye, T as Ct } from "./browser-storage-DPtOQJx0.js";
7
- import { Fragment as ys, useRef as ie, useEffect as J, useState as V } from "react";
8
- import { R as It, C as on } from "./lazy-markdown-editor-ClZPZuaU.js";
9
- import { a as ft, P as xs, g as Ss } from "./prompt-input-DNpRL5tI.js";
10
- import { R as ws, a as Ts, A as Ft } from "./radio-cLMEBBZk.js";
11
- import { E as As } from "./empty-state-Bo4HVrgr.js";
12
- import { useVirtualizer as ks } from "@tanstack/react-virtual";
13
- import { RichMessage as rn } from "./rich-message-CuPiKxKX.js";
14
- import { a as Cs, D as Is } from "./diff-bubble-DvUPRnfB.js";
15
- const _s = {
1
+ import { jsx as u, jsxs as k, Fragment as It } from "react/jsx-runtime";
2
+ import { c as C } from "react/compiler-runtime";
3
+ import { AbsoluteCenter as Wn, IconButton as Pe, chakra as Jt, createSlotRecipeContext as Hn, defineSlotRecipe as Nn, Text as U, Code as Lt, Button as Qe, HStack as oe, Box as D, Flex as ye, Stack as X, Textarea as Vn, Tooltip as Je, Portal as Zt, Kbd as Un, Spacer as jn, Link as en, Span as ze, Avatar as Ee, Timeline as Kn, Image as tn, Card as se, Spinner as _t, Badge as Xn, Icon as mt, Skeleton as Gn } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as Yn, ShieldX as Jn, ShieldCheck as Zn, Check as nn, Pause as es, ArrowUp as ts, Copy as ns, Move as ss, FileDown as os, FileUp as rs, FileDiff as is, Trash2 as sn, FilePen as ls, FileText as as, ListTree as cs, Terminal as on, ListTodo as us, CircleQuestionMark as ds, File as fs, Globe as ps, Search as ms, AlertTriangle as rn, DotIcon as hs, ChevronUpIcon as gs, GripVertical as bs, Pencil as ys, MessageCircleIcon as xs } from "lucide-react";
5
+ import { useStickToBottomContext as et, StickToBottom as Ss } from "use-stick-to-bottom";
6
+ import { S as tt, T as vt } from "./scroll-area-BMbg1WcD.js";
7
+ import { Fragment as ws, useRef as J, useEffect as Z, useState as W } from "react";
8
+ import { R as Mt, C as ln } from "./prism-n5gcERyD.js";
9
+ import { a as ht, P as Ts, R as an, g as As } from "./rich-message-q6Y6QJOq.js";
10
+ import { R as Cs, a as ks } from "./radio-BfjibByI.js";
11
+ import { E as Is } from "./empty-state-Bo4HVrgr.js";
12
+ import { useVirtualizer as _s } from "@tanstack/react-virtual";
13
+ import { A as $t } from "./alert-ubcrW24X.js";
14
+ import { a as vs, D as Ms } from "./diff-bubble-DvUPRnfB.js";
15
+ const Rs = {
16
16
  "aria-roledescription": "conversation",
17
17
  initial: "instant",
18
18
  resize: "instant",
19
19
  role: "log"
20
- }, Rs = Gt(bs, {
20
+ }, Ps = Jt(Ss, {
21
21
  base: {
22
22
  position: "relative",
23
23
  flex: 1,
@@ -26,44 +26,44 @@ const _s = {
26
26
  }
27
27
  }, {
28
28
  forwardProps: ["initial", "resize"],
29
- defaultProps: _s
30
- }), vs = (t) => {
31
- const e = A(10);
32
- let n, s;
29
+ defaultProps: Rs
30
+ }), Es = (t) => {
31
+ const e = C(10);
32
+ let n, o;
33
33
  e[0] !== t ? ({
34
34
  children: n,
35
- ...s
36
- } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
35
+ ...o
36
+ } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
37
37
  const {
38
- contentRef: o,
38
+ contentRef: s,
39
39
  scrollRef: r
40
- } = Ge(), i = r, l = o;
41
- let a, u;
40
+ } = et(), i = r, l = s;
41
+ let a, c;
42
42
  e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
43
43
  zIndex: 2
44
- }, u = {
44
+ }, c = {
45
45
  py: "sm",
46
46
  "aria-live": "polite",
47
47
  role: "list"
48
- }, e[3] = a, e[4] = u) : (a = e[3], u = e[4]);
48
+ }, e[3] = a, e[4] = c) : (a = e[3], c = e[4]);
49
49
  let d;
50
- return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ c(Ye, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
51
- }, Ms = {
50
+ return e[5] !== n || e[6] !== o || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ u(tt, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: a, contentProps: c, children: n }), e[5] = n, e[6] = o, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
51
+ }, Ds = {
52
52
  axis: "horizontal",
53
53
  bottom: "md",
54
54
  zIndex: 2
55
- }, Ps = (t) => {
56
- const e = A(4), {
55
+ }, Bs = (t) => {
56
+ const e = C(4), {
57
57
  isAtBottom: n,
58
- scrollToBottom: s
59
- } = Ge();
60
- let o;
61
- return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ c(zn, { ...Ms, children: /* @__PURE__ */ c(Pe, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ c(Kn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
62
- }, pt = {
63
- Root: Rs,
64
- Viewport: vs,
65
- ScrollToBottom: Ps
66
- }, Es = qn({
58
+ scrollToBottom: o
59
+ } = et();
60
+ let s;
61
+ return e[0] !== n || e[1] !== t || e[2] !== o ? (s = !n && /* @__PURE__ */ u(Wn, { ...Ds, children: /* @__PURE__ */ u(Pe, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ u(Yn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = s) : s = e[3], s;
62
+ }, gt = {
63
+ Root: Ps,
64
+ Viewport: Es,
65
+ ScrollToBottom: Bs
66
+ }, Fs = Nn({
67
67
  className: "ai-message",
68
68
  slots: ["root", "content"],
69
69
  base: {
@@ -170,102 +170,102 @@ const _s = {
170
170
  shape: "rounded"
171
171
  }
172
172
  }), {
173
- withProvider: Ds,
174
- withContext: Bs
175
- } = Qn({
176
- recipe: Es
177
- }), Fs = Ds("div", "root"), Ls = Bs("div", "content"), ge = {
178
- Root: Fs,
179
- Content: Ls
180
- }, $s = (t) => {
173
+ withProvider: Ls,
174
+ withContext: $s
175
+ } = Hn({
176
+ recipe: Fs
177
+ }), Os = Ls("div", "root"), zs = $s("div", "content"), be = {
178
+ Root: Os,
179
+ Content: zs
180
+ }, Qs = (t) => {
181
181
  if (t == null) return null;
182
182
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
183
183
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
184
- }, yl = (t) => {
185
- const e = A(19), {
184
+ }, kl = (t) => {
185
+ const e = C(19), {
186
186
  toolName: n,
187
- toolInput: s,
188
- onApprove: o,
187
+ toolInput: o,
188
+ onApprove: s,
189
189
  onDeny: r
190
190
  } = t;
191
191
  let i;
192
- e[0] !== s ? (i = $s(s), e[0] = s, e[1] = i) : i = e[1];
192
+ e[0] !== o ? (i = Qs(o), e[0] = o, e[1] = i) : i = e[1];
193
193
  const l = i;
194
194
  let a;
195
195
  e[2] !== n ? (a = /* @__PURE__ */ k(U, { textStyle: "label/S/medium", color: "fg", children: [
196
196
  "Allow ",
197
- /* @__PURE__ */ c(Bt, { size: "sm", children: n }),
197
+ /* @__PURE__ */ u(Lt, { size: "sm", children: n }),
198
198
  "?"
199
199
  ] }), e[2] = n, e[3] = a) : a = e[3];
200
- let u;
201
- e[4] !== l ? (u = l ? /* @__PURE__ */ c(Ye, { maxH: "6rem", children: /* @__PURE__ */ c(Bt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
200
+ let c;
201
+ e[4] !== l ? (c = l ? /* @__PURE__ */ u(tt, { maxH: "6rem", children: /* @__PURE__ */ u(Lt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = c) : c = e[5];
202
202
  let d;
203
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(Xn, { size: 14 }), e[6] = d) : d = e[6];
203
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ u(Jn, { size: 14 }), e[6] = d) : d = e[6];
204
204
  let f;
205
- e[7] !== r ? (f = /* @__PURE__ */ k(Oe, { size: "xs", variant: "outline", onClick: r, children: [
205
+ e[7] !== r ? (f = /* @__PURE__ */ k(Qe, { size: "xs", variant: "outline", onClick: r, children: [
206
206
  d,
207
207
  "Deny"
208
208
  ] }), e[7] = r, e[8] = f) : f = e[8];
209
- let p;
210
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ c(Gn, { size: 14 }), e[9] = p) : p = e[9];
211
209
  let m;
212
- e[10] !== o ? (m = /* @__PURE__ */ k(Oe, { size: "xs", colorPalette: "green", onClick: o, children: [
213
- p,
210
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ u(Zn, { size: 14 }), e[9] = m) : m = e[9];
211
+ let p;
212
+ e[10] !== s ? (p = /* @__PURE__ */ k(Qe, { size: "xs", colorPalette: "green", onClick: s, children: [
213
+ m,
214
214
  "Allow"
215
- ] }), e[10] = o, e[11] = m) : m = e[11];
215
+ ] }), e[10] = s, e[11] = p) : p = e[11];
216
216
  let h;
217
- e[12] !== f || e[13] !== m ? (h = /* @__PURE__ */ k(Z, { gap: "xs", justifyContent: "flex-end", children: [
217
+ e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ k(oe, { gap: "xs", justifyContent: "flex-end", children: [
218
218
  f,
219
- m
220
- ] }), e[12] = f, e[13] = m, e[14] = h) : h = e[14];
219
+ p
220
+ ] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
221
221
  let g;
222
- return e[15] !== a || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ c(P, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(be, { direction: "column", gap: "xs", children: [
222
+ return e[15] !== a || e[16] !== c || e[17] !== h ? (g = /* @__PURE__ */ u(D, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(ye, { direction: "column", gap: "xs", children: [
223
223
  a,
224
- u,
224
+ c,
225
225
  h
226
- ] }) }), e[15] = a, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
227
- }, Os = "md", zs = "neutral", xl = (t) => {
228
- const e = A(17), {
226
+ ] }) }), e[15] = a, e[16] = c, e[17] = h, e[18] = g) : g = e[18], g;
227
+ }, qs = "md", Ws = "neutral", Il = (t) => {
228
+ const e = C(17), {
229
229
  attachments: n,
230
- onSelect: s,
231
- onRemove: o,
230
+ onSelect: o,
231
+ onRemove: s,
232
232
  renderBadge: r,
233
233
  size: i,
234
234
  tone: l
235
235
  } = t;
236
236
  let a;
237
237
  e[0] !== n ? (a = n === void 0 ? [] : n, e[0] = n, e[1] = a) : a = e[1];
238
- const u = a, d = i === void 0 ? Os : i, f = l === void 0 ? zs : l;
239
- if (u.length === 0)
238
+ const c = a, d = i === void 0 ? qs : i, f = l === void 0 ? Ws : l;
239
+ if (c.length === 0)
240
240
  return null;
241
- let p;
242
- if (e[2] !== u || e[3] !== o || e[4] !== s || e[5] !== r || e[6] !== d || e[7] !== f) {
241
+ let m;
242
+ if (e[2] !== c || e[3] !== s || e[4] !== o || e[5] !== r || e[6] !== d || e[7] !== f) {
243
243
  let h;
244
- e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
245
- const b = s ? () => s(g) : void 0, x = o ? () => o(g) : void 0;
244
+ e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
245
+ const b = o ? () => o(g) : void 0, y = s ? () => s(g) : void 0;
246
246
  if (r) {
247
- const y = r({
247
+ const x = r({
248
248
  attachmentId: g,
249
249
  onSelect: b,
250
- onRemove: x,
250
+ onRemove: y,
251
251
  size: d,
252
252
  tone: f
253
253
  });
254
- return /* @__PURE__ */ c(ys, { children: y }, g);
254
+ return /* @__PURE__ */ u(ws, { children: x }, g);
255
255
  }
256
- return /* @__PURE__ */ c(It, { fileName: g, onSelect: b, onRemove: x, size: d, tone: f }, g);
257
- }, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], p = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = p;
256
+ return /* @__PURE__ */ u(Mt, { fileName: g, onSelect: b, onRemove: y, size: d, tone: f }, g);
257
+ }, e[9] = s, e[10] = o, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = c.map(h), e[2] = c, e[3] = s, e[4] = o, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
258
258
  } else
259
- p = e[8];
260
- let m;
261
- return e[15] !== p ? (m = /* @__PURE__ */ c(j, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: p }), e[15] = p, e[16] = m) : m = e[16], m;
262
- }, Qs = (t) => {
259
+ m = e[8];
260
+ let p;
261
+ return e[15] !== m ? (p = /* @__PURE__ */ u(X, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
262
+ }, Hs = (t) => {
263
263
  const {
264
264
  previousUserMessageCount: e,
265
265
  userMessageCount: n
266
266
  } = t;
267
267
  return e === 0 ? !1 : n > e;
268
- }, qs = (t) => {
268
+ }, Ns = (t) => {
269
269
  const e = t.conversationKey ?? null;
270
270
  return t.state.conversationKey !== e ? {
271
271
  shouldScroll: !1,
@@ -274,7 +274,7 @@ const _s = {
274
274
  userMessageCount: t.userMessageCount
275
275
  }
276
276
  } : {
277
- shouldScroll: Qs({
277
+ shouldScroll: Hs({
278
278
  previousUserMessageCount: t.state.userMessageCount,
279
279
  userMessageCount: t.userMessageCount
280
280
  }),
@@ -283,56 +283,56 @@ const _s = {
283
283
  userMessageCount: Math.max(t.state.userMessageCount, t.userMessageCount)
284
284
  }
285
285
  };
286
- }, Ws = (t) => {
287
- const e = qs(t);
286
+ }, Vs = (t) => {
287
+ const e = Ns(t);
288
288
  return e.shouldScroll && t.scrollToBottom("instant"), e;
289
289
  };
290
- function Hs(t) {
291
- const e = A(8), {
290
+ function Us(t) {
291
+ const e = C(8), {
292
292
  conversationKey: n,
293
- userMessageCount: s
293
+ userMessageCount: o
294
294
  } = t, {
295
- scrollToBottom: o
296
- } = Ge(), r = n ?? null;
295
+ scrollToBottom: s
296
+ } = et(), r = n ?? null;
297
297
  let i;
298
- e[0] !== r || e[1] !== s ? (i = {
298
+ e[0] !== r || e[1] !== o ? (i = {
299
299
  conversationKey: r,
300
- userMessageCount: s
301
- }, e[0] = r, e[1] = s, e[2] = i) : i = e[2];
302
- const l = ie(i);
303
- let a, u;
304
- return e[3] !== n || e[4] !== o || e[5] !== s ? (a = () => {
305
- const d = Ws({
300
+ userMessageCount: o
301
+ }, e[0] = r, e[1] = o, e[2] = i) : i = e[2];
302
+ const l = J(i);
303
+ let a, c;
304
+ return e[3] !== n || e[4] !== s || e[5] !== o ? (a = () => {
305
+ const d = Vs({
306
306
  state: l.current,
307
307
  conversationKey: n,
308
- userMessageCount: s,
309
- scrollToBottom: o
308
+ userMessageCount: o,
309
+ scrollToBottom: s
310
310
  });
311
311
  l.current = d.state;
312
- }, u = [n, s, o], e[3] = n, e[4] = o, e[5] = s, e[6] = a, e[7] = u) : (a = e[6], u = e[7]), J(a, u), null;
312
+ }, c = [n, o, s], e[3] = n, e[4] = s, e[5] = o, e[6] = a, e[7] = c) : (a = e[6], c = e[7]), Z(a, c), null;
313
313
  }
314
- const ln = (t) => t.trim().length > 0, Vs = (t) => {
314
+ const cn = (t) => t.trim().length > 0, js = (t) => {
315
315
  const {
316
316
  canSubmit: e,
317
317
  isDisabled: n,
318
- text: s
318
+ text: o
319
319
  } = t;
320
- return n || !e || !ln(s) ? "none" : "submit";
321
- }, Ns = (t) => {
320
+ return n || !e || !cn(o) ? "none" : "submit";
321
+ }, Ks = (t) => {
322
322
  const {
323
323
  canInterrupt: e,
324
324
  canSubmit: n,
325
- hasQuestionPrompt: s,
326
- isDisabled: o,
325
+ hasQuestionPrompt: o,
326
+ isDisabled: s,
327
327
  streaming: r,
328
328
  text: i
329
329
  } = t;
330
- return o ? "none" : n && ln(i) ? "submit" : r && !s && e ? "interrupt" : "none";
331
- }, an = 200, Us = (t, e = an) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, js = (t) => {
330
+ return s ? "none" : n && cn(i) ? "submit" : r && !o && e ? "interrupt" : "none";
331
+ }, un = 200, Xs = (t, e = un) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, Gs = (t) => {
332
332
  const {
333
333
  onAttachFiles: e,
334
334
  onAttachText: n,
335
- textAttachmentPasteLineThreshold: s
335
+ textAttachmentPasteLineThreshold: o
336
336
  } = t;
337
337
  return {
338
338
  onDragOver: (l) => {
@@ -348,467 +348,547 @@ const ln = (t) => t.trim().length > 0, Vs = (t) => {
348
348
  l.preventDefault(), e(a);
349
349
  return;
350
350
  }
351
- const u = l.clipboardData.getData("text/plain");
352
- n && Us(u, s) && (l.preventDefault(), n(u));
351
+ const c = l.clipboardData.getData("text/plain");
352
+ n && Xs(c, o) && (l.preventDefault(), n(c));
353
353
  }
354
354
  };
355
- }, Ks = (t) => {
355
+ }, Ys = (t) => {
356
356
  t.preventDefault();
357
- }, cn = (t) => {
358
- const e = A(7), {
357
+ }, dn = (t) => {
358
+ const e = C(7), {
359
359
  option: n
360
360
  } = t;
361
- let s;
362
- e[0] !== n.label ? (s = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
363
361
  let o;
364
- e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
362
+ e[0] !== n.label ? (o = /* @__PURE__ */ u(U, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
363
+ let s;
364
+ e[2] !== n.description ? (s = n.description ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = s) : s = e[3];
365
365
  let r;
366
- return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ k(j, { gap: "0", minWidth: "0", children: [
367
- s,
368
- o
369
- ] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
370
- }, Xs = (t) => {
371
- const e = A(12), {
366
+ return e[4] !== o || e[5] !== s ? (r = /* @__PURE__ */ k(X, { gap: "0", minWidth: "0", children: [
367
+ o,
368
+ s
369
+ ] }), e[4] = o, e[5] = s, e[6] = r) : r = e[6], r;
370
+ }, Js = (t) => {
371
+ const e = C(12), {
372
372
  option: n,
373
- name: s,
374
- checked: o,
373
+ name: o,
374
+ checked: s,
375
375
  editable: r,
376
376
  onToggle: i
377
377
  } = t, l = !r, a = r ? void 0 : "true";
378
- let u;
379
- e[0] !== r ? (u = r ? void 0 : {
378
+ let c;
379
+ e[0] !== r ? (c = r ? void 0 : {
380
380
  tabIndex: -1
381
- }, e[0] = r, e[1] = u) : u = e[1];
381
+ }, e[0] = r, e[1] = c) : c = e[1];
382
382
  const d = r ? i : void 0;
383
383
  let f;
384
- e[2] !== n ? (f = /* @__PURE__ */ c(cn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
385
- let p;
386
- return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== d || e[10] !== f ? (p = /* @__PURE__ */ c(on, { name: s, checked: o, readOnly: l, "aria-readonly": a, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = a, e[8] = u, e[9] = d, e[10] = f, e[11] = p) : p = e[11], p;
387
- }, Gs = (t) => {
388
- const e = A(17), {
384
+ e[2] !== n ? (f = /* @__PURE__ */ u(dn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
385
+ let m;
386
+ return e[4] !== s || e[5] !== o || e[6] !== l || e[7] !== a || e[8] !== c || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ u(ln, { name: o, checked: s, readOnly: l, "aria-readonly": a, inputProps: c, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = s, e[5] = o, e[6] = l, e[7] = a, e[8] = c, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
387
+ }, Zs = (t) => {
388
+ const e = C(17), {
389
389
  question: n,
390
- questionIndex: s,
391
- name: o,
390
+ questionIndex: o,
391
+ name: s,
392
392
  selectedOption: r,
393
393
  editable: i,
394
394
  onToggleOption: l
395
- } = t, a = r ?? null, u = !i, d = i ? void 0 : "true";
395
+ } = t, a = r ?? null, c = !i, d = i ? void 0 : "true";
396
396
  let f;
397
- e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
398
- h.value && l?.(n, s, h.value);
399
- } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
400
- let p;
397
+ e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== o ? (f = i ? (h) => {
398
+ h.value && l?.(n, o, h.value);
399
+ } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = o, e[4] = f) : f = e[4];
400
+ let m;
401
401
  if (e[5] !== i || e[6] !== n.options) {
402
402
  let h;
403
- e[8] !== i ? (h = (g) => /* @__PURE__ */ c(ws, { value: g.label, inputProps: i ? void 0 : {
403
+ e[8] !== i ? (h = (g) => /* @__PURE__ */ u(Cs, { value: g.label, inputProps: i ? void 0 : {
404
404
  tabIndex: -1
405
- }, alignItems: "flex-start", children: /* @__PURE__ */ c(cn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], p = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = p;
405
+ }, alignItems: "flex-start", children: /* @__PURE__ */ u(dn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], m = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = m;
406
406
  } else
407
- p = e[7];
408
- let m;
409
- return e[10] !== o || e[11] !== a || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== p ? (m = /* @__PURE__ */ c(Ts, { name: o, value: a, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: p }), e[10] = o, e[11] = a, e[12] = u, e[13] = d, e[14] = f, e[15] = p, e[16] = m) : m = e[16], m;
410
- }, Ys = (t) => {
411
- const e = A(4), {
407
+ m = e[7];
408
+ let p;
409
+ return e[10] !== s || e[11] !== a || e[12] !== c || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ u(ks, { name: s, value: a, readOnly: c, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = s, e[11] = a, e[12] = c, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
410
+ }, eo = (t) => {
411
+ const e = C(4), {
412
412
  items: n
413
413
  } = t;
414
- let s;
415
- e[0] !== n ? (s = n.map(Js), e[0] = n, e[1] = s) : s = e[1];
416
414
  let o;
417
- return e[2] !== s ? (o = /* @__PURE__ */ c(j, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
418
- }, un = (t) => {
419
- const e = A(19), {
415
+ e[0] !== n ? (o = n.map(to), e[0] = n, e[1] = o) : o = e[1];
416
+ let s;
417
+ return e[2] !== o ? (s = /* @__PURE__ */ u(X, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: o }), e[2] = o, e[3] = s) : s = e[3], s;
418
+ }, fn = (t) => {
419
+ const e = C(19), {
420
420
  questions: n,
421
- editable: s,
422
- selectedOptionsByQuestion: o,
421
+ editable: o,
422
+ selectedOptionsByQuestion: s,
423
423
  customAnswersByQuestion: r,
424
424
  onToggleOption: i,
425
425
  onCustomAnswerChange: l
426
- } = t, a = s === void 0 ? !1 : s;
427
- let u;
428
- e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
429
- const d = u;
426
+ } = t, a = o === void 0 ? !1 : o;
427
+ let c;
428
+ e[0] !== s ? (c = s === void 0 ? {} : s, e[0] = s, e[1] = c) : c = e[1];
429
+ const d = c;
430
430
  let f;
431
431
  e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
432
- const p = f;
433
- let m;
434
- if (e[4] !== p || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
432
+ const m = f;
433
+ let p;
434
+ if (e[4] !== m || e[5] !== a || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
435
435
  let g;
436
- e[11] !== p || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, x) => {
437
- const y = b.id ?? `question-${x}`, T = b.multiple ? "checkbox" : "radio", S = d[y] ?? [];
438
- return /* @__PURE__ */ k(j, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
439
- /* @__PURE__ */ c(U, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
440
- T === "radio" ? /* @__PURE__ */ c(Gs, { question: b, questionIndex: x, name: y, selectedOption: S[0], editable: a, onToggleOption: i }) : b.options.map((w) => /* @__PURE__ */ c(Xs, { option: w, name: y, checked: S.includes(w.label), editable: a, onToggle: () => i?.(b, x, w.label) }, w.label)),
441
- b.allowCustomAnswer ? /* @__PURE__ */ c(Wn, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: p[y] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (w) => l?.(b, x, w.currentTarget.value) }) : null
442
- ] }, y);
443
- }, e[11] = p, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], m = n.map(g), e[4] = p, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = m;
436
+ e[11] !== m || e[12] !== a || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (b, y) => {
437
+ const x = b.id ?? `question-${y}`, S = b.multiple ? "checkbox" : "radio", A = d[x] ?? [];
438
+ return /* @__PURE__ */ k(X, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
439
+ /* @__PURE__ */ u(U, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
440
+ S === "radio" ? /* @__PURE__ */ u(Zs, { question: b, questionIndex: y, name: x, selectedOption: A[0], editable: a, onToggleOption: i }) : b.options.map((T) => /* @__PURE__ */ u(Js, { option: T, name: x, checked: A.includes(T.label), editable: a, onToggle: () => i?.(b, y, T.label) }, T.label)),
441
+ b.allowCustomAnswer ? /* @__PURE__ */ u(Vn, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: m[x] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.subtle", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (T) => l?.(b, y, T.currentTarget.value) }) : null
442
+ ] }, x);
443
+ }, e[11] = m, e[12] = a, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = a, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
444
444
  } else
445
- m = e[10];
445
+ p = e[10];
446
446
  let h;
447
- return e[17] !== m ? (h = /* @__PURE__ */ c(j, { as: "form", gap: "sm", onSubmit: Ks, "aria-label": "Question form", children: m }), e[17] = m, e[18] = h) : h = e[18], h;
447
+ return e[17] !== p ? (h = /* @__PURE__ */ u(X, { as: "form", gap: "sm", onSubmit: Ys, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
448
448
  };
449
- function Js(t, e) {
450
- return /* @__PURE__ */ c(P, { as: "li", children: /* @__PURE__ */ c(on, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
449
+ function to(t, e) {
450
+ return /* @__PURE__ */ u(D, { as: "li", children: /* @__PURE__ */ u(ln, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
451
451
  tabIndex: -1
452
- }, size: "xs", children: /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
452
+ }, size: "xs", children: /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
453
453
  }
454
- const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
455
- const o = le(e, n), r = t[o] ?? [], i = r.includes(s);
454
+ const de = (t, e) => t.id ?? `question-${e}`, no = (t, e, n, o) => {
455
+ const s = de(e, n), r = t[s] ?? [], i = r.includes(o);
456
456
  return e.multiple ? {
457
457
  ...t,
458
- [o]: i ? r.filter((l) => l !== s) : [...r, s]
458
+ [s]: i ? r.filter((l) => l !== o) : [...r, o]
459
459
  } : {
460
460
  ...t,
461
- [o]: i ? [] : [s]
461
+ [s]: i ? [] : [o]
462
462
  };
463
- }, bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
464
- id: le(e, n),
463
+ }, St = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
464
+ id: de(e, n),
465
465
  question: e.question,
466
466
  multiple: !!e.multiple,
467
467
  required: !!e.required,
468
468
  allowCustomAnswer: !!e.allowCustomAnswer,
469
- options: e.options.map((s) => ({
470
- label: s.label,
471
- description: s.description ?? ""
469
+ options: e.options.map((o) => ({
470
+ label: o.label,
471
+ description: o.description ?? ""
472
472
  }))
473
- }))) : "", eo = (t, e, n) => {
474
- const s = [];
475
- for (let o = 0; o < t.questions.length; o += 1) {
476
- const r = t.questions[o], i = le(r, o), l = e[i] ?? [], a = n[i]?.trim(), u = a ? [...l, a] : l;
477
- u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
473
+ }))) : "", so = (t, e, n) => {
474
+ const o = [];
475
+ for (let s = 0; s < t.questions.length; s += 1) {
476
+ const r = t.questions[s], i = de(r, s), l = e[i] ?? [], a = n[i]?.trim(), c = a ? [...l, a] : l;
477
+ c.length !== 0 && o.push(`${r.question}: ${c.join(", ")}`);
478
478
  }
479
- return s;
480
- }, to = (t) => typeof t != "string", _t = (t, e) => {
481
- if (to(e)) return e;
479
+ return o;
480
+ }, oo = (t) => typeof t != "string", Rt = (t, e) => {
481
+ if (oo(e)) return e;
482
482
  const n = e.trim();
483
483
  if (n.length === 0) return {};
484
- const s = {};
485
- for (let o = 0; o < t.questions.length; o += 1) {
486
- const r = t.questions[o];
487
- r.allowCustomAnswer && (s[le(r, o)] = n);
484
+ const o = {};
485
+ for (let s = 0; s < t.questions.length; s += 1) {
486
+ const r = t.questions[s];
487
+ r.allowCustomAnswer && (o[de(r, s)] = n);
488
488
  }
489
- return s;
490
- }, no = (t, e, n) => {
489
+ return o;
490
+ }, ro = (t, e, n) => {
491
491
  if (!t) return typeof n == "string" ? n.trim() : "";
492
- const s = _t(t, n), o = eo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
493
- return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
492
+ const o = Rt(t, n), s = so(t, e, o), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
493
+ return r.length > 0 && !i && s.push(`Additional response: ${r}`), s.join(`
494
494
  `);
495
- }, so = (t, e, n) => {
496
- const s = _t(t, n);
497
- return t.questions.map((o, r) => {
498
- const i = le(o, r), l = e[i] ?? [], a = s[i]?.trim();
495
+ }, io = (t, e, n) => {
496
+ const o = Rt(t, n);
497
+ return t.questions.map((s, r) => {
498
+ const i = de(s, r), l = e[i] ?? [], a = o[i]?.trim();
499
499
  return a ? [...l, a] : l;
500
500
  });
501
- }, oo = (t, e, n) => {
501
+ }, lo = (t, e, n) => {
502
502
  if (!t) return !1;
503
- const s = _t(t, n);
504
- for (let o = 0; o < t.questions.length; o += 1) {
505
- const r = t.questions[o];
503
+ const o = Rt(t, n);
504
+ for (let s = 0; s < t.questions.length; s += 1) {
505
+ const r = t.questions[s];
506
506
  if (!r.required) continue;
507
- const i = le(r, o);
508
- if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
507
+ const i = de(r, s);
508
+ if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && o[i]?.trim()))
509
509
  return !0;
510
510
  }
511
511
  return !1;
512
- }, ro = (t) => t.questions.map((e, n) => ({
513
- id: le(e, n),
512
+ }, ao = (t) => t.questions.map((e, n) => ({
513
+ id: de(e, n),
514
514
  question: e.question,
515
515
  options: e.options,
516
516
  multiple: !!e.multiple,
517
517
  required: !!e.required,
518
518
  allowCustomAnswer: !!e.allowCustomAnswer
519
- })), io = (t, e, n, s) => {
520
- const o = le(t, e);
521
- return (n[o] ?? []).length > 0 || !!s[o]?.trim();
522
- }, lo = (t) => {
523
- const e = A(22), {
519
+ })), co = (t, e, n, o) => {
520
+ const s = de(t, e);
521
+ return (n[s] ?? []).length > 0 || !!o[s]?.trim();
522
+ }, uo = (t) => {
523
+ const e = C(22), {
524
524
  question: n,
525
- sourceQuestion: s,
526
- questionIndex: o,
525
+ sourceQuestion: o,
526
+ questionIndex: s,
527
527
  isActive: r,
528
528
  selectedOptionsByQuestion: i,
529
529
  customAnswersByQuestion: l,
530
530
  onSelectStep: a
531
531
  } = t;
532
- let u;
533
- e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = io(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
534
- const d = u, f = d ? "answered" : "not answered", p = r ? "outline" : "ghost", m = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
532
+ let c;
533
+ e[0] !== l || e[1] !== s || e[2] !== i || e[3] !== o ? (c = co(o, s, i, l), e[0] = l, e[1] = s, e[2] = i, e[3] = o, e[4] = c) : c = e[4];
534
+ const d = c, f = d ? "answered" : "not answered", m = r ? "outline" : "ghost", p = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
535
535
  let b;
536
- e[5] !== a || e[6] !== o ? (b = () => a(o), e[5] = a, e[6] = o, e[7] = b) : b = e[7];
537
- let x;
538
- e[8] !== d || e[9] !== o ? (x = d ? /* @__PURE__ */ c(en, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = x) : x = e[10];
536
+ e[5] !== a || e[6] !== s ? (b = () => a(s), e[5] = a, e[6] = s, e[7] = b) : b = e[7];
539
537
  let y;
540
- e[11] !== r || e[12] !== m || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== x || e[17] !== p ? (y = /* @__PURE__ */ c(Oe, { id: m, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: p, minW: "8", onClick: b, children: x }), e[11] = r, e[12] = m, e[13] = h, e[14] = g, e[15] = b, e[16] = x, e[17] = p, e[18] = y) : y = e[18];
541
- let T;
542
- return e[19] !== n.question || e[20] !== y ? (T = /* @__PURE__ */ c(Ct, { content: n.question, children: y }), e[19] = n.question, e[20] = y, e[21] = T) : T = e[21], T;
543
- }, ao = (t) => {
544
- const e = A(31), {
538
+ e[8] !== d || e[9] !== s ? (y = d ? /* @__PURE__ */ u(nn, { "aria-hidden": "true" }) : s + 1, e[8] = d, e[9] = s, e[10] = y) : y = e[10];
539
+ let x;
540
+ e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== y || e[17] !== m ? (x = /* @__PURE__ */ u(Qe, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: b, children: y }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = b, e[16] = y, e[17] = m, e[18] = x) : x = e[18];
541
+ let S;
542
+ return e[19] !== n.question || e[20] !== x ? (S = /* @__PURE__ */ u(vt, { content: n.question, children: x }), e[19] = n.question, e[20] = x, e[21] = S) : S = e[21], S;
543
+ }, fo = (t) => {
544
+ const e = C(31), {
545
545
  questionPrompt: n,
546
- selectedOptionsByQuestion: s,
547
- customAnswersByQuestion: o,
546
+ selectedOptionsByQuestion: o,
547
+ customAnswersByQuestion: s,
548
548
  onToggleOption: r,
549
549
  onCustomAnswerChange: i
550
550
  } = t, {
551
551
  questions: l
552
- } = t, [a, u] = V(0), d = Math.min(a, l.length - 1), f = l[d], p = l.length > 1;
553
- let m;
554
- e[0] !== o || e[1] !== p || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (m = p ? /* @__PURE__ */ c(Z, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((_, R) => /* @__PURE__ */ c(lo, { question: _, sourceQuestion: n.questions[R], questionIndex: R, isActive: R === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, _.id)) }) : null, e[0] = o, e[1] = p, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = m) : m = e[6];
555
- const h = `question-step-panel-${f.id}`, g = p ? "tabpanel" : void 0, b = p ? `question-step-tab-${f.id}` : void 0;
556
- let x;
557
- e[7] !== f ? (x = [f], e[7] = f, e[8] = x) : x = e[8];
552
+ } = t, [a, c] = W(0), d = Math.min(a, l.length - 1), f = l[d], m = l.length > 1;
553
+ let p;
554
+ e[0] !== s || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== o ? (p = m ? /* @__PURE__ */ u(oe, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((I, _) => /* @__PURE__ */ u(uo, { question: I, sourceQuestion: n.questions[_], questionIndex: _, isActive: _ === d, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: c }, I.id)) }) : null, e[0] = s, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = o, e[6] = p) : p = e[6];
555
+ const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, b = m ? `question-step-tab-${f.id}` : void 0;
558
556
  let y;
559
- e[9] !== r || e[10] !== n.questions || e[11] !== d ? (y = (_, R, L) => {
560
- r(n.questions[d], d, L);
561
- }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = y) : y = e[12];
562
- let T;
563
- e[13] !== i || e[14] !== n.questions || e[15] !== d ? (T = (_, R, L) => {
564
- i(n.questions[d], d, L);
565
- }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = T) : T = e[16];
557
+ e[7] !== f ? (y = [f], e[7] = f, e[8] = y) : y = e[8];
558
+ let x;
559
+ e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (I, _, P) => {
560
+ r(n.questions[d], d, P);
561
+ }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = x) : x = e[12];
566
562
  let S;
567
- e[17] !== o || e[18] !== s || e[19] !== x || e[20] !== y || e[21] !== T ? (S = /* @__PURE__ */ c(un, { questions: x, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: y, onCustomAnswerChange: T }), e[17] = o, e[18] = s, e[19] = x, e[20] = y, e[21] = T, e[22] = S) : S = e[22];
563
+ e[13] !== i || e[14] !== n.questions || e[15] !== d ? (S = (I, _, P) => {
564
+ i(n.questions[d], d, P);
565
+ }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = S) : S = e[16];
566
+ let A;
567
+ e[17] !== s || e[18] !== o || e[19] !== y || e[20] !== x || e[21] !== S ? (A = /* @__PURE__ */ u(fn, { questions: y, editable: !0, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onToggleOption: x, onCustomAnswerChange: S }), e[17] = s, e[18] = o, e[19] = y, e[20] = x, e[21] = S, e[22] = A) : A = e[22];
568
+ let T;
569
+ e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== A ? (T = /* @__PURE__ */ u(X, { id: h, role: g, "aria-labelledby": b, gap: "0", children: A }), e[23] = h, e[24] = g, e[25] = b, e[26] = A, e[27] = T) : T = e[27];
568
570
  let w;
569
- e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== S ? (w = /* @__PURE__ */ c(j, { id: h, role: g, "aria-labelledby": b, gap: "0", children: S }), e[23] = h, e[24] = g, e[25] = b, e[26] = S, e[27] = w) : w = e[27];
570
- let C;
571
- return e[28] !== m || e[29] !== w ? (C = /* @__PURE__ */ k(j, { gap: "xs", pb: "sm", children: [
572
- m,
573
- w
574
- ] }), e[28] = m, e[29] = w, e[30] = C) : C = e[30], C;
575
- }, co = (t) => {
576
- const e = A(8), {
571
+ return e[28] !== p || e[29] !== T ? (w = /* @__PURE__ */ k(X, { gap: "xs", pb: "sm", children: [
572
+ p,
573
+ T
574
+ ] }), e[28] = p, e[29] = T, e[30] = w) : w = e[30], w;
575
+ }, po = (t) => {
576
+ const e = C(8), {
577
577
  questionPrompt: n
578
578
  } = t;
579
- let s;
580
- e[0] !== n ? (s = ro(n), e[0] = n, e[1] = s) : s = e[1];
581
- const o = s;
579
+ let o;
580
+ e[0] !== n ? (o = ao(n), e[0] = n, e[1] = o) : o = e[1];
581
+ const s = o;
582
582
  let r;
583
- e[2] !== n ? (r = bt(n), e[2] = n, e[3] = r) : r = e[3];
583
+ e[2] !== n ? (r = St(n), e[2] = n, e[3] = r) : r = e[3];
584
584
  const i = r;
585
585
  let l;
586
- return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ c(ao, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
587
- }, Lt = "7", uo = (t) => {
588
- const e = A(22);
589
- let n, s, o, r;
586
+ return e[4] !== t || e[5] !== i || e[6] !== s ? (l = /* @__PURE__ */ u(fo, { ...t, questions: s }, i), e[4] = t, e[5] = i, e[6] = s, e[7] = l) : l = e[7], l;
587
+ }, Ot = "7", mo = (t) => {
588
+ const e = C(22);
589
+ let n, o, s, r;
590
590
  e[0] !== t ? ({
591
591
  title: r,
592
- shortcut: o,
592
+ shortcut: s,
593
593
  canInterrupt: n,
594
- ...s
595
- } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = o, e[4] = r) : (n = e[1], s = e[2], o = e[3], r = e[4]);
596
- const i = s["aria-label"] ?? r;
594
+ ...o
595
+ } = t, e[0] = t, e[1] = n, e[2] = o, e[3] = s, e[4] = r) : (n = e[1], o = e[2], s = e[3], r = e[4]);
596
+ const i = o["aria-label"] ?? r;
597
597
  let l;
598
- e[5] !== n ? (l = n ? /* @__PURE__ */ c(Yn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ c(Jn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
598
+ e[5] !== n ? (l = n ? /* @__PURE__ */ u(es, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ u(ts, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
599
599
  const a = l;
600
- let u;
601
- e[7] !== i || e[8] !== a || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ c(Pe, { "data-testid": "send-message-button", size: "xs", variant: "primary", "aria-label": i, title: r, ...s, children: a }), e[7] = i, e[8] = a, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
602
- const d = u;
600
+ let c;
601
+ e[7] !== i || e[8] !== a || e[9] !== o || e[10] !== r ? (c = /* @__PURE__ */ u(Pe, { "data-testid": "send-message-button", size: "xs", variant: "primary", "aria-label": i, title: r, ...o, children: a }), e[7] = i, e[8] = a, e[9] = o, e[10] = r, e[11] = c) : c = e[11];
602
+ const d = c;
603
603
  if (r) {
604
604
  let f;
605
- e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(At, { children: [
605
+ e[12] !== s || e[13] !== r ? (f = s ? /* @__PURE__ */ k(It, { children: [
606
606
  r,
607
607
  " ",
608
- /* @__PURE__ */ c(Hn, { fontSize: "xs", children: o })
609
- ] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
610
- const p = f;
611
- let m;
612
- e[15] !== d ? (m = /* @__PURE__ */ c(Ke.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = m) : m = e[16];
608
+ /* @__PURE__ */ u(Un, { fontSize: "xs", children: s })
609
+ ] }) : r, e[12] = s, e[13] = r, e[14] = f) : f = e[14];
610
+ const m = f;
611
+ let p;
612
+ e[15] !== d ? (p = /* @__PURE__ */ u(Je.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
613
613
  let h;
614
- e[17] !== p ? (h = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(Ke.Positioner, { children: /* @__PURE__ */ c(Ke.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
614
+ e[17] !== m ? (h = /* @__PURE__ */ u(Zt, { children: /* @__PURE__ */ u(Je.Positioner, { children: /* @__PURE__ */ u(Je.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
615
615
  let g;
616
- return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ k(Ke.Root, { closeDelay: 50, openDelay: 100, children: [
617
- m,
616
+ return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ k(Je.Root, { closeDelay: 50, openDelay: 100, children: [
617
+ p,
618
618
  h
619
- ] }), e[19] = m, e[20] = h, e[21] = g) : g = e[21], g;
619
+ ] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
620
620
  }
621
621
  return d;
622
- }, fo = (t) => {
623
- const e = A(2), {
622
+ }, pn = 10, ho = (t) => {
623
+ const e = [];
624
+ for (let n = t.length - 1; n >= 0 && e.length < pn; n--) {
625
+ const o = t[n];
626
+ if (o.role !== "user") continue;
627
+ const s = o.parts.flatMap((r) => r.type === "text" ? [r.text] : []).join("");
628
+ s.trim() && e.push(s);
629
+ }
630
+ return e;
631
+ }, go = (t, e, n, o) => o === 0 ? null : t === null ? e === "previous" && n === "" ? {
632
+ index: 0
633
+ } : null : e === "previous" ? {
634
+ index: Math.min(t + 1, o - 1)
635
+ } : {
636
+ index: t === 0 ? null : t - 1
637
+ }, bo = (t) => {
638
+ const e = C(24), {
639
+ recentUserMessages: n,
640
+ text: o,
641
+ blocked: s,
642
+ resetKey: r,
643
+ onChange: i
644
+ } = t, l = J(null), a = J(null);
645
+ let c, d;
646
+ if (e[0] !== s || e[1] !== n || e[2] !== r) {
647
+ c = n.slice(0, pn);
648
+ const _ = JSON.stringify(c);
649
+ d = JSON.stringify([_, r, s]), e[0] = s, e[1] = n, e[2] = r, e[3] = c, e[4] = d;
650
+ } else
651
+ c = e[3], d = e[4];
652
+ const f = d, m = J(f);
653
+ let p, h;
654
+ e[5] !== f ? (p = () => {
655
+ m.current !== f && (m.current = f, a.current = null);
656
+ }, h = [f], e[5] = f, e[6] = p, e[7] = h) : (p = e[6], h = e[7]), Z(p, h);
657
+ let g;
658
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = () => {
659
+ a.current = null;
660
+ }, e[8] = g) : g = e[8];
661
+ const b = g;
662
+ let y;
663
+ e[9] !== i || e[10] !== c ? (y = (_) => {
664
+ a.current !== null && _ !== c[a.current] && b(), i(_);
665
+ }, e[9] = i, e[10] = c, e[11] = y) : y = e[11];
666
+ const x = y;
667
+ let S;
668
+ e[12] !== s || e[13] !== i || e[14] !== c || e[15] !== o ? (S = (_) => {
669
+ if (s)
670
+ return !1;
671
+ const P = go(a.current, _, o, c.length);
672
+ if (!P)
673
+ return !1;
674
+ a.current = P.index;
675
+ const M = P.index === null ? "" : c[P.index];
676
+ return l.current?.setEditorValue(M), i(M), !0;
677
+ }, e[12] = s, e[13] = i, e[14] = c, e[15] = o, e[16] = S) : S = e[16];
678
+ const A = S;
679
+ let T, w;
680
+ e[17] !== A ? (T = () => A("previous"), w = () => A("next"), e[17] = A, e[18] = T, e[19] = w) : (T = e[18], w = e[19]);
681
+ let I;
682
+ return e[20] !== x || e[21] !== T || e[22] !== w ? (I = {
683
+ editorRef: l,
684
+ reset: b,
685
+ change: x,
686
+ recallPrevious: T,
687
+ recallNext: w
688
+ }, e[20] = x, e[21] = T, e[22] = w, e[23] = I) : I = e[23], I;
689
+ }, yo = (t) => {
690
+ const e = C(2), {
624
691
  placeholder: n
625
692
  } = t;
626
693
  if (!n)
627
694
  return null;
628
- let s;
629
- return e[0] !== n ? (s = /* @__PURE__ */ c(U, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = s) : s = e[1], s;
630
- }, mt = "border.accent-light", yt = (t) => {
695
+ let o;
696
+ return e[0] !== n ? (o = /* @__PURE__ */ u(U, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = o) : o = e[1], o;
697
+ }, bt = "border.accent-light", wt = (t) => {
631
698
  const e = t?.querySelector('[contenteditable="true"]');
632
699
  e instanceof HTMLElement && e.focus();
633
- }, $t = (t, e) => requestAnimationFrame(() => {
634
- yt(t), e?.();
635
- }), po = (t) => {
700
+ }, zt = (t, e) => requestAnimationFrame(() => {
701
+ wt(t), e?.();
702
+ }), xo = (t, e, n, o) => {
703
+ const s = C(10);
704
+ let r, i;
705
+ s[0] !== e || s[1] !== t || s[2] !== o ? (r = () => {
706
+ if (!e)
707
+ return;
708
+ const c = zt(t.current, () => o(!0));
709
+ return () => cancelAnimationFrame(c);
710
+ }, i = [e, t, o], s[0] = e, s[1] = t, s[2] = o, s[3] = r, s[4] = i) : (r = s[3], i = s[4]), Z(r, i);
711
+ let l, a;
712
+ s[5] !== t || s[6] !== n || s[7] !== o ? (l = () => {
713
+ if (n === 0)
714
+ return;
715
+ const c = zt(t.current, () => o(!0));
716
+ return () => cancelAnimationFrame(c);
717
+ }, a = [n, t, o], s[5] = t, s[6] = n, s[7] = o, s[8] = l, s[9] = a) : (l = s[8], a = s[9]), Z(l, a);
718
+ }, So = (t) => {
636
719
  const {
637
720
  defaultState: e,
638
- onSubmit: n = () => {
721
+ recentUserMessages: n = [],
722
+ onSubmit: o = () => {
639
723
  },
640
724
  onInterrupt: s,
641
- onAttachFiles: o,
642
- onAttachText: r,
643
- textAttachmentPasteLineThreshold: i = an,
644
- streaming: l = !1,
645
- attachedResources: a = [],
646
- onClearAttachments: u,
647
- isDisabled: d = !1,
648
- submitDisabled: f = !1,
725
+ onAttachFiles: r,
726
+ onAttachText: i,
727
+ textAttachmentPasteLineThreshold: l = un,
728
+ streaming: a = !1,
729
+ attachedResources: c = [],
730
+ onClearAttachments: d,
731
+ isDisabled: f = !1,
732
+ submitDisabled: m = !1,
649
733
  onChange: p,
650
- placeholder: m,
651
- attachmentList: h,
652
- actions: g,
653
- attachedToTop: b = !1,
734
+ placeholder: h,
735
+ attachmentList: g,
736
+ actions: b,
737
+ attachedToTop: y = !1,
654
738
  recessed: x = !1,
655
- questionPrompt: y,
656
- autoFocus: T = !1,
657
- focusSignal: S = 0,
739
+ questionPrompt: S,
740
+ autoFocus: A = !1,
741
+ focusSignal: T = 0,
658
742
  submitTitle: w,
659
- references: C = [],
743
+ references: I = [],
660
744
  onAddReference: _
661
- } = t, R = x ? "border.subtle" : "border", [L, E] = V(!1), [Q, M] = V(!1), [D, B] = V(e), [$, O] = V(0), [F, z] = V(() => ft(e)), [v, W] = V({}), [H, K] = V({}), oe = ie(null), xe = ie(p), Se = ie(bt(y));
662
- J(() => {
663
- xe.current = p;
664
- }, [p]), J(() => {
665
- const q = ft(e);
666
- B(e), O((ne) => ne + 1), z(q), W({}), K({}), xe.current?.(q);
745
+ } = t, P = x ? "border.subtle" : "border", [M, z] = W(!1), [B, E] = W(!1), [F, L] = W(e), [$, O] = W(0), [H, R] = W(() => ht(e)), [q, V] = W({}), [j, K] = W({}), G = J(null), Se = J(p), re = J(St(S));
746
+ Z(() => {
747
+ Se.current = p;
748
+ }, [p]), Z(() => {
749
+ const Q = ht(e);
750
+ L(e), O((Y) => Y + 1), R(Q), V({}), K({}), Se.current?.(Q);
667
751
  }, [e]);
668
- const ee = bt(y);
669
- J(() => {
670
- Se.current !== ee && (Se.current = ee, W({}), K({}));
671
- }, [ee]), J(() => {
672
- if (!T) return;
673
- const q = $t(oe.current, () => M(!0));
674
- return () => cancelAnimationFrame(q);
675
- }, [T]), J(() => {
676
- if (S === 0) return;
677
- const q = $t(oe.current, () => M(!0));
678
- return () => cancelAnimationFrame(q);
679
- }, [S]);
680
- const Te = () => {
681
- M(!0), yt(oe.current);
682
- }, Be = (q = !1) => {
683
- B(e), O((se) => se + 1);
684
- const ne = ft(e);
685
- z(ne), W({}), K({}), xe.current?.(ne), q && requestAnimationFrame(() => {
686
- yt(oe.current);
752
+ const ie = St(S);
753
+ Z(() => {
754
+ re.current !== ie && (re.current = ie, V({}), K({}));
755
+ }, [ie]), xo(G, A, T, E);
756
+ const ee = bo({
757
+ recentUserMessages: n,
758
+ text: H,
759
+ blocked: f || M || !!S,
760
+ resetKey: JSON.stringify([e, $, ie]),
761
+ onChange: (Q) => {
762
+ R(Q), p?.(Q);
763
+ }
764
+ }), te = () => {
765
+ E(!0), wt(G.current);
766
+ }, ne = (Q = !1) => {
767
+ O((Y) => Y + 1), V({}), K({}), ee.reset(), ee.change(ht(e)), Q && requestAnimationFrame(() => {
768
+ wt(G.current);
687
769
  });
688
- }, X = y ? no(y, v, H) : F.trim(), G = oo(y, v, H), de = {
689
- canInterrupt: l && !y && !!s,
690
- canSubmit: !f,
691
- hasQuestionPrompt: !!y,
692
- isDisabled: d || L || G,
693
- streaming: l,
694
- text: X
695
- }, te = Ns(de), fe = l && !y ? "Queue message" : "Send message", Fe = async () => {
696
- if (!X) return;
697
- const q = y ? {
698
- answers: so(y, v, H)
770
+ }, le = S ? ro(S, q, j) : H.trim(), Te = lo(S, q, j), ae = {
771
+ canInterrupt: a && !S && !!s,
772
+ canSubmit: !m,
773
+ hasQuestionPrompt: !!S,
774
+ isDisabled: f || M || Te,
775
+ streaming: a,
776
+ text: le
777
+ }, ce = Ks(ae), Be = a && !S ? "Queue message" : "Send message", Fe = async () => {
778
+ if (!le) return;
779
+ const Q = S ? {
780
+ answers: io(S, q, j)
699
781
  } : void 0;
700
- E(!0);
782
+ ee.reset(), z(!0);
701
783
  try {
702
- await n(X, a, q), Be(!0), u?.();
784
+ await o(le, c, Q), ne(!0), d?.();
703
785
  } catch {
704
786
  } finally {
705
- E(!1);
787
+ z(!1);
706
788
  }
707
- }, Ae = (q) => {
708
- q === "interrupt" && s?.(), q === "submit" && Fe();
709
- }, we = js({
710
- onAttachFiles: o,
711
- onAttachText: r,
712
- textAttachmentPasteLineThreshold: i
713
- }), nt = (q, ne, se) => {
714
- W((pe) => Zs(pe, q, ne, se));
715
- }, st = (q, ne, se) => {
716
- const pe = le(q, ne);
717
- K((Dt) => ({
718
- ...Dt,
719
- [pe]: se
789
+ }, Ne = (Q) => {
790
+ Q === "interrupt" && s?.(), Q === "submit" && Fe();
791
+ }, Le = Gs({
792
+ onAttachFiles: r,
793
+ onAttachText: i,
794
+ textAttachmentPasteLineThreshold: l
795
+ }), it = (Q, Y, Ve) => {
796
+ V((we) => no(we, Q, Y, Ve));
797
+ }, lt = (Q, Y, Ve) => {
798
+ const we = de(Q, Y);
799
+ K(($e) => ({
800
+ ...$e,
801
+ [we]: Ve
720
802
  }));
721
803
  };
722
- return /* @__PURE__ */ c(P, { ref: oe, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: b ? "-1px" : void 0, bg: "bg", borderRadius: "xs", borderTopRadius: b ? "0" : void 0, borderWidth: "1px", borderStyle: "solid", borderColor: Q ? mt : R, zIndex: Q ? 1 : 0, transition: "border-color 0.2s ease-in-out", _hover: {
723
- borderColor: Q ? mt : R,
804
+ return /* @__PURE__ */ u(D, { ref: G, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: y ? "-1px" : void 0, bg: "bg", borderRadius: "xs", borderTopRadius: y ? "0" : void 0, borderWidth: "1px", borderStyle: "solid", borderColor: B ? bt : P, zIndex: B ? 1 : 0, transition: "border-color 0.2s ease-in-out", _hover: {
805
+ borderColor: B ? bt : P,
724
806
  zIndex: 1
725
807
  }, _focusWithin: {
726
- borderColor: mt,
808
+ borderColor: bt,
727
809
  zIndex: 1
728
- }, onPasteCapture: we.onPasteCapture, onDropCapture: we.onDropCapture, onDragOver: we.onDragOver, onClick: Te, onBlur: () => M(!1), children: /* @__PURE__ */ k(be, { direction: "column", color: "fg", gap: "xs", children: [
729
- h ? /* @__PURE__ */ c(P, { children: h }) : null,
730
- y ? /* @__PURE__ */ c(co, { questionPrompt: y, selectedOptionsByQuestion: v, customAnswersByQuestion: H, onToggleOption: nt, onCustomAnswerChange: st }) : (
810
+ }, onPasteCapture: Le.onPasteCapture, onDropCapture: Le.onDropCapture, onDragOver: Le.onDragOver, onClick: te, onBlur: () => E(!1), children: /* @__PURE__ */ k(ye, { direction: "column", color: "fg", gap: "xs", children: [
811
+ g ? /* @__PURE__ */ u(D, { children: g }) : null,
812
+ S ? /* @__PURE__ */ u(po, { questionPrompt: S, selectedOptionsByQuestion: q, customAnswersByQuestion: j, onToggleOption: it, onCustomAnswerChange: lt }) : (
731
813
  // The editor is its own composer row: it centres a single line at the shared
732
814
  // control height and grows with content, never shrinking below it, so the row
733
815
  // aligns with the toolbar beneath it.
734
- /* @__PURE__ */ c(Ye, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
816
+ /* @__PURE__ */ u(tt, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
735
817
  pr: "2xs"
736
- }, children: /* @__PURE__ */ c(be, { minH: Lt, align: "center", children: /* @__PURE__ */ c(xs, { defaultState: D, isEditable: !d && !L, placeholder: /* @__PURE__ */ c(fo, { placeholder: m }), onChange: (q) => {
737
- z(q), p?.(q);
738
- }, onSubmit: () => Ae(Vs(de)), references: C, onAddReference: _ }, $) }) })
818
+ }, children: /* @__PURE__ */ u(ye, { minH: Ot, align: "center", children: /* @__PURE__ */ u(Ts, { ref: ee.editorRef, onRecallPrevious: ee.recallPrevious, onRecallNext: ee.recallNext, defaultState: F, isEditable: !f && !M, placeholder: /* @__PURE__ */ u(yo, { placeholder: h }), onChange: ee.change, onSubmit: () => Ne(js(ae)), references: I, onAddReference: _ }, $) }) })
739
819
  ),
740
- /* @__PURE__ */ k(Z, { gap: "1", minH: Lt, align: "center", children: [
741
- g,
742
- /* @__PURE__ */ c(Vn, {}),
743
- /* @__PURE__ */ c(uo, { canInterrupt: te === "interrupt", title: te === "interrupt" ? "Stop Response" : w ?? fe, shortcut: te === "submit" ? "Enter" : void 0, onClick: () => Ae(te), disabled: te === "none" })
820
+ /* @__PURE__ */ k(oe, { gap: "1", minH: Ot, align: "center", children: [
821
+ b,
822
+ /* @__PURE__ */ u(jn, {}),
823
+ /* @__PURE__ */ u(mo, { canInterrupt: ce === "interrupt", title: ce === "interrupt" ? "Stop Response" : w ?? Be, shortcut: ce === "submit" ? "Enter" : void 0, onClick: () => Ne(ce), disabled: ce === "none" })
744
824
  ] })
745
825
  ] }) });
746
- }, Qe = (t) => typeof t == "object" && t !== null && !Array.isArray(t), mo = (t) => {
826
+ }, We = (t) => typeof t == "object" && t !== null && !Array.isArray(t), wo = (t) => {
747
827
  try {
748
828
  const e = JSON.parse(t);
749
- return Qe(e) ? e : null;
829
+ return We(e) ? e : null;
750
830
  } catch {
751
831
  return null;
752
832
  }
753
- }, ho = (t) => Qe(t) ? t : typeof t == "string" && t.trim().length > 0 ? mo(t) : null, De = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, re = (t) => {
833
+ }, To = (t) => We(t) ? t : typeof t == "string" && t.trim().length > 0 ? wo(t) : null, De = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ue = (t) => {
754
834
  const e = De(t);
755
835
  if (e) return e;
756
836
  if (Array.isArray(t)) {
757
- const n = t.map(re).filter((s) => s !== null);
837
+ const n = t.map(ue).filter((o) => o !== null);
758
838
  return n.length > 0 ? n.join(`
759
839
  `) : null;
760
840
  }
761
- return Qe(t) ? re(t.response) ?? re(t.answer) ?? re(t.text) ?? re(t.answers) : null;
762
- }, go = (t) => {
841
+ return We(t) ? ue(t.response) ?? ue(t.answer) ?? ue(t.text) ?? ue(t.answers) : null;
842
+ }, Ao = (t) => {
763
843
  if (typeof t == "string" && t.trim().length > 0)
764
844
  return {
765
845
  label: t,
766
846
  description: void 0
767
847
  };
768
- if (!Qe(t)) return null;
848
+ if (!We(t)) return null;
769
849
  const e = De(t.label);
770
850
  return e ? {
771
851
  label: e,
772
852
  description: De(t.description) ?? void 0
773
853
  } : null;
774
- }, bo = (t, e) => {
775
- if (!Qe(t)) return null;
854
+ }, Co = (t, e) => {
855
+ if (!We(t)) return null;
776
856
  const n = De(t.question);
777
857
  if (!n) return null;
778
- const s = Array.isArray(t.options) ? t.options.map(go).filter((i) => i !== null) : [], o = De(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : s.length === 0 || o === "freeform" || o === "text";
858
+ const o = Array.isArray(t.options) ? t.options.map(Ao).filter((i) => i !== null) : [], s = De(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o.length === 0 || s === "freeform" || s === "text";
779
859
  return {
780
860
  id: De(t.id) ?? `question-${e}`,
781
861
  question: n,
782
- options: s,
783
- multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
862
+ options: o,
863
+ multiple: typeof t.multiple == "boolean" ? t.multiple : s === "multi_choice" || s === "multiple_choice",
784
864
  required: typeof t.required == "boolean" ? t.required : !0,
785
865
  allowCustomAnswer: r
786
866
  };
787
- }, dn = (t) => {
788
- const e = ho(t);
867
+ }, mn = (t) => {
868
+ const e = To(t);
789
869
  if (!e || !Array.isArray(e.questions)) return null;
790
- const n = e.questions.map(bo).filter((s) => s !== null);
870
+ const n = e.questions.map(Co).filter((o) => o !== null);
791
871
  return n.length === 0 ? null : {
792
872
  questions: n
793
873
  };
794
- }, yo = (t) => t.tool.toLowerCase() === "question", xo = (t) => {
874
+ }, ko = (t) => t.tool.toLowerCase() === "question", Io = (t) => {
795
875
  for (let e = t.length - 1; e >= 0; e -= 1) {
796
876
  const n = t[e];
797
877
  if (n.role === "assistant")
798
- for (let s = n.parts.length - 1; s >= 0; s -= 1) {
799
- const o = n.parts[s];
800
- if (o.type !== "tool" || !yo(o)) continue;
801
- return re(o.state?.output) ?? re(o.state?.metadata) ? void 0 : dn(o.state?.input) ?? void 0;
878
+ for (let o = n.parts.length - 1; o >= 0; o -= 1) {
879
+ const s = n.parts[o];
880
+ if (s.type !== "tool" || !ko(s)) continue;
881
+ return ue(s.state?.output) ?? ue(s.state?.metadata) ? void 0 : mn(s.state?.input) ?? void 0;
802
882
  }
803
883
  }
804
- }, So = (t = "") => JSON.stringify(Ss(t)), fn = {
884
+ }, hn = {
805
885
  animationName: "message-fade-in",
806
886
  animationDuration: "200ms",
807
887
  animationTimingFunction: "ease-out"
808
- }, wo = (t) => {
888
+ }, _o = (t) => {
809
889
  const e = /* @__PURE__ */ new Set(), n = new Set(t.state.seenKeys);
810
- for (const s of t.itemKeys)
811
- t.state.initialized && !n.has(s) && e.add(s), n.add(s);
890
+ for (const o of t.itemKeys)
891
+ t.state.initialized && !n.has(o) && e.add(o), n.add(o);
812
892
  return {
813
893
  animatedKeys: e,
814
894
  state: {
@@ -816,70 +896,70 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
816
896
  seenKeys: n
817
897
  }
818
898
  };
819
- }, To = (t, e) => {
899
+ }, vo = (t, e) => {
820
900
  if (t.length !== e.length) return !1;
821
901
  for (let n = 0; n < t.length; n += 1) if (t[n] !== e[n]) return !1;
822
902
  return !0;
823
- }, Ao = (t) => {
824
- const e = ie({
903
+ }, Mo = (t) => {
904
+ const e = J({
825
905
  initialized: !1,
826
906
  seenKeys: /* @__PURE__ */ new Set()
827
- }), n = ie(null);
828
- if (n.current && To(n.current.itemKeys, t))
907
+ }), n = J(null);
908
+ if (n.current && vo(n.current.itemKeys, t))
829
909
  return n.current.animatedKeys;
830
- const s = wo({
910
+ const o = _o({
831
911
  itemKeys: t,
832
912
  state: e.current
833
913
  });
834
- return e.current = s.state, n.current = {
914
+ return e.current = o.state, n.current = {
835
915
  itemKeys: [...t],
836
- animatedKeys: s.animatedKeys
837
- }, s.animatedKeys;
838
- }, ko = (t) => t.type === "text", Co = (t) => (t.parts ?? []).filter(ko).map((e) => e.text.trim()).filter(Boolean).join(`
916
+ animatedKeys: o.animatedKeys
917
+ }, o.animatedKeys;
918
+ }, Ro = (t) => t.type === "text", Po = (t) => (t.parts ?? []).filter(Ro).map((e) => e.text.trim()).filter(Boolean).join(`
839
919
 
840
- `), Io = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
920
+ `), Eo = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
841
921
  hour: "numeric",
842
922
  minute: "2-digit",
843
923
  timeZone: n
844
- }).format(new Date(t.createdAt)) : "", xt = (t) => {
845
- const e = A(20), {
924
+ }).format(new Date(t.createdAt)) : "", Tt = (t) => {
925
+ const e = C(20), {
846
926
  message: n,
847
- alwaysVisible: s,
848
- copyAlwaysVisible: o
849
- } = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, a] = V(!1), u = ie(null);
927
+ alwaysVisible: o,
928
+ copyAlwaysVisible: s
929
+ } = t, r = o === void 0 ? !1 : o, i = s === void 0 ? r : s, [l, a] = W(!1), c = J(null);
850
930
  let d;
851
- e[0] !== n ? (d = Co(n), e[0] = n, e[1] = d) : d = e[1];
931
+ e[0] !== n ? (d = Po(n), e[0] = n, e[1] = d) : d = e[1];
852
932
  const f = d;
853
- let p;
854
- e[2] !== n ? (p = Io(n), e[2] = n, e[3] = p) : p = e[3];
855
- const m = p;
933
+ let m;
934
+ e[2] !== n ? (m = Eo(n), e[2] = n, e[3] = m) : m = e[3];
935
+ const p = m;
856
936
  let h, g;
857
937
  e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
858
- u.current !== null && window.clearTimeout(u.current);
859
- }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), J(h, g);
938
+ c.current !== null && window.clearTimeout(c.current);
939
+ }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Z(h, g);
860
940
  let b;
861
941
  e[6] !== f ? (b = async () => {
862
942
  if (f)
863
943
  try {
864
- await navigator.clipboard.writeText(f), a(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => a(!1), 1200);
944
+ await navigator.clipboard.writeText(f), a(!0), c.current !== null && window.clearTimeout(c.current), c.current = window.setTimeout(() => a(!1), 1200);
865
945
  } catch {
866
946
  a(!1);
867
947
  }
868
948
  }, e[6] = f, e[7] = b) : b = e[7];
869
- const x = b;
870
- if (!f && !m)
949
+ const y = b;
950
+ if (!f && !p)
871
951
  return null;
872
- const y = r ? "1" : "0", T = r ? "auto" : "none";
873
- let S;
874
- e[8] !== m ? (S = m ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", children: m }) : null, e[8] = m, e[9] = S) : S = e[9];
952
+ const x = r ? "1" : "0", S = r ? "auto" : "none";
953
+ let A;
954
+ e[8] !== p ? (A = p ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = A) : A = e[9];
955
+ let T;
956
+ e[10] !== i || e[11] !== y || e[12] !== f || e[13] !== l ? (T = f ? /* @__PURE__ */ u(D, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Qt, children: /* @__PURE__ */ u(vt, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ u(Pe, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: y, children: l ? /* @__PURE__ */ u(nn, { size: 12 }) : /* @__PURE__ */ u(ns, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = y, e[12] = f, e[13] = l, e[14] = T) : T = e[14];
875
957
  let w;
876
- e[10] !== i || e[11] !== x || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ c(P, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Ot, children: /* @__PURE__ */ c(Ct, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ c(Pe, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: x, children: l ? /* @__PURE__ */ c(en, { size: 12 }) : /* @__PURE__ */ c(Zn, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = x, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
877
- let C;
878
- return e[15] !== w || e[16] !== y || e[17] !== T || e[18] !== S ? (C = /* @__PURE__ */ k(Z, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: y, pointerEvents: T, transition: "opacity 120ms ease", css: Ot, children: [
879
- S,
880
- w
881
- ] }), e[15] = w, e[16] = y, e[17] = T, e[18] = S, e[19] = C) : C = e[19], C;
882
- }, Ot = {
958
+ return e[15] !== T || e[16] !== x || e[17] !== S || e[18] !== A ? (w = /* @__PURE__ */ k(oe, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: S, transition: "opacity 120ms ease", css: Qt, children: [
959
+ A,
960
+ T
961
+ ] }), e[15] = T, e[16] = x, e[17] = S, e[18] = A, e[19] = w) : w = e[19], w;
962
+ }, Qt = {
883
963
  "[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
884
964
  opacity: 1,
885
965
  pointerEvents: "auto"
@@ -892,44 +972,44 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
892
972
  opacity: 1,
893
973
  pointerEvents: "auto"
894
974
  }
895
- }, _o = (t) => {
896
- const e = A(8);
897
- let n, s;
975
+ }, Do = (t) => {
976
+ const e = C(8);
977
+ let n, o;
898
978
  e[0] !== t ? ({
899
979
  children: n,
900
- ...s
901
- } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
902
- let o;
903
- e[3] !== n ? (o = /* @__PURE__ */ c(rn, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
980
+ ...o
981
+ } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
982
+ let s;
983
+ e[3] !== n ? (s = /* @__PURE__ */ u(an, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = s) : s = e[4];
904
984
  let r;
905
- return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ c(P, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
906
- }, Ro = _o, Je = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), vo = (t) => {
907
- const e = Je(t), n = e.replace(/_/g, "");
985
+ return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ u(D, { ...o, children: s }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
986
+ }, Bo = Do, nt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), Fo = (t) => {
987
+ const e = nt(t), n = e.replace(/_/g, "");
908
988
  return [.../* @__PURE__ */ new Set([t, e, n])];
909
- }, pn = {
910
- shell: nn,
911
- ls: is,
912
- read_file: rs,
913
- write_file: os,
914
- delete_file: tn,
915
- patch: ss,
916
- upload_files: ns,
917
- download_file: ts,
918
- move_file: es
919
- }, Mo = {
920
- dot: fs,
921
- danger: sn,
922
- search: ds,
923
- browser: us,
924
- file: cs,
925
- question: as,
926
- todo: ls,
927
- terminal: nn,
928
- ...pn
929
- }, zt = "dot", Po = (t) => Object.hasOwn(pn, t), Eo = (t) => Mo[t], mn = (t) => {
930
- if (!t) return zt;
931
- const e = Je(t);
932
- if (Po(e)) return e;
989
+ }, gn = {
990
+ shell: on,
991
+ ls: cs,
992
+ read_file: as,
993
+ write_file: ls,
994
+ delete_file: sn,
995
+ patch: is,
996
+ upload_files: rs,
997
+ download_file: os,
998
+ move_file: ss
999
+ }, Lo = {
1000
+ dot: hs,
1001
+ danger: rn,
1002
+ search: ms,
1003
+ browser: ps,
1004
+ file: fs,
1005
+ question: ds,
1006
+ todo: us,
1007
+ terminal: on,
1008
+ ...gn
1009
+ }, qt = "dot", $o = (t) => Object.hasOwn(gn, t), Oo = (t) => Lo[t], bn = (t) => {
1010
+ if (!t) return qt;
1011
+ const e = nt(t);
1012
+ if ($o(e)) return e;
933
1013
  const n = e.replace(/_/g, "");
934
1014
  switch (e) {
935
1015
  case "read":
@@ -956,52 +1036,52 @@ const le = (t, e) => t.id ?? `question-${e}`, Zs = (t, e, n, s) => {
956
1036
  case "file":
957
1037
  return "file";
958
1038
  default:
959
- return n === "todowrite" || n === "todo" ? "todo" : zt;
1039
+ return n === "todowrite" || n === "todo" ? "todo" : qt;
960
1040
  }
961
1041
  };
962
- function Rt(t) {
1042
+ function Pt(t) {
963
1043
  const e = t.lastIndexOf("/");
964
1044
  return e >= 0 ? t.slice(e + 1) : t;
965
1045
  }
966
- function Xe(t) {
1046
+ function Ze(t) {
967
1047
  if (!t) return null;
968
1048
  const e = t.split(" ")[0].trim();
969
1049
  if (e === "/dev/null") return null;
970
1050
  let n = e;
971
1051
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
972
1052
  }
973
- const Ze = (t) => t.startsWith("--- "), vt = (t) => t.startsWith("+++ "), Mt = (t) => t.startsWith("@@"), Do = (t) => t.startsWith("+") && !(vt(t) || t === "+++"), Bo = (t) => t.startsWith("-") && !(Ze(t) || t === "---"), Fo = (t, e) => {
1053
+ const st = (t) => t.startsWith("--- "), Et = (t) => t.startsWith("+++ "), Dt = (t) => t.startsWith("@@"), zo = (t) => t.startsWith("+") && !(Et(t) || t === "+++"), Qo = (t) => t.startsWith("-") && !(st(t) || t === "---"), qo = (t, e) => {
974
1054
  t.has(e) || t.set(e, {
975
1055
  additions: 0,
976
1056
  deletions: 0
977
1057
  });
978
- }, Lo = (t, e) => {
1058
+ }, Wo = (t, e) => {
979
1059
  const n = t.get(e);
980
1060
  n && (n.additions += 1);
981
- }, $o = (t, e) => {
1061
+ }, Ho = (t, e) => {
982
1062
  const n = t.get(e);
983
1063
  n && (n.deletions += 1);
984
- }, Oo = (t, e, n) => {
985
- if (Ze(t))
1064
+ }, No = (t, e, n) => {
1065
+ if (st(t))
986
1066
  return {
987
1067
  ...e,
988
- lastMinusHeader: Xe(t.slice(4)),
1068
+ lastMinusHeader: Ze(t.slice(4)),
989
1069
  inHunk: !1
990
1070
  };
991
- if (vt(t)) {
992
- const o = Xe(t.slice(4)) ?? e.lastMinusHeader;
993
- return o && Fo(n, o), {
1071
+ if (Et(t)) {
1072
+ const s = Ze(t.slice(4)) ?? e.lastMinusHeader;
1073
+ return s && qo(n, s), {
994
1074
  ...e,
995
- currentPath: o,
1075
+ currentPath: s,
996
1076
  inHunk: !1
997
1077
  };
998
1078
  }
999
- return e.currentPath ? Mt(t) ? {
1079
+ return e.currentPath ? Dt(t) ? {
1000
1080
  ...e,
1001
1081
  inHunk: !0
1002
- } : e.inHunk ? Do(t) ? (Lo(n, e.currentPath), e) : (Bo(t) && $o(n, e.currentPath), e) : e : e;
1082
+ } : e.inHunk ? zo(t) ? (Wo(n, e.currentPath), e) : (Qo(t) && Ho(n, e.currentPath), e) : e : e;
1003
1083
  };
1004
- function hn(t) {
1084
+ function yn(t) {
1005
1085
  if (!t || typeof t != "string") return [];
1006
1086
  const e = /* @__PURE__ */ new Map();
1007
1087
  let n = {
@@ -1009,34 +1089,34 @@ function hn(t) {
1009
1089
  lastMinusHeader: null,
1010
1090
  inHunk: !1
1011
1091
  };
1012
- const s = t.split(/\r?\n/);
1013
- for (const o of s)
1014
- n = Oo(o, n, e);
1015
- return Array.from(e.entries()).map(([o, {
1092
+ const o = t.split(/\r?\n/);
1093
+ for (const s of o)
1094
+ n = No(s, n, e);
1095
+ return Array.from(e.entries()).map(([s, {
1016
1096
  additions: r,
1017
1097
  deletions: i
1018
1098
  }]) => ({
1019
- filePath: o,
1099
+ filePath: s,
1020
1100
  additions: r,
1021
1101
  deletions: i
1022
1102
  }));
1023
1103
  }
1024
- function zo(t) {
1025
- return hn(t).map((e) => ({
1104
+ function Vo(t) {
1105
+ return yn(t).map((e) => ({
1026
1106
  kind: "diff",
1027
- fileName: Rt(e.filePath),
1107
+ fileName: Pt(e.filePath),
1028
1108
  filePath: e.filePath,
1029
1109
  additions: e.additions,
1030
1110
  deletions: e.deletions
1031
1111
  }));
1032
1112
  }
1033
- function Qo(t) {
1034
- return hn(t).map((e) => e.filePath);
1113
+ function Uo(t) {
1114
+ return yn(t).map((e) => e.filePath);
1035
1115
  }
1036
- const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Wo = (t, e, n) => {
1116
+ const xn = (t) => st(t) || t.startsWith("diff --git "), jo = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Ko = (t, e, n) => {
1037
1117
  if (t.startsWith(" ")) {
1038
- const s = t.slice(1);
1039
- e.push(s), n.push(s);
1118
+ const o = t.slice(1);
1119
+ e.push(o), n.push(o);
1040
1120
  return;
1041
1121
  }
1042
1122
  if (t.startsWith("-")) {
@@ -1044,30 +1124,30 @@ const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith
1044
1124
  return;
1045
1125
  }
1046
1126
  t.startsWith("+") && n.push(t.slice(1));
1047
- }, Ho = (t, e, n, s) => {
1048
- let o = e;
1049
- for (; o < t.length; ) {
1050
- const r = t[o] || "";
1051
- if (gn(r) || Mt(r) || qo(r))
1127
+ }, Xo = (t, e, n, o) => {
1128
+ let s = e;
1129
+ for (; s < t.length; ) {
1130
+ const r = t[s] || "";
1131
+ if (xn(r) || Dt(r) || jo(r))
1052
1132
  break;
1053
- Wo(r, n, s), o += 1;
1133
+ Ko(r, n, o), s += 1;
1054
1134
  }
1055
- return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
1056
- }, Vo = (t, e) => {
1057
- const n = Xe((t[e] || "").slice(4)), s = t[e + 1] || "";
1058
- if (!vt(s)) return {
1135
+ return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), s;
1136
+ }, Go = (t, e) => {
1137
+ const n = Ze((t[e] || "").slice(4)), o = t[e + 1] || "";
1138
+ if (!Et(o)) return {
1059
1139
  nextIndex: e + 1
1060
1140
  };
1061
- const r = Xe(s.slice(4)) ?? n ?? "", i = [], l = [];
1141
+ const r = Ze(o.slice(4)) ?? n ?? "", i = [], l = [];
1062
1142
  let a = e + 2;
1063
1143
  for (; a < t.length; ) {
1064
- const u = t[a] || "";
1065
- if (gn(u)) break;
1066
- if (!Mt(u)) {
1144
+ const c = t[a] || "";
1145
+ if (xn(c)) break;
1146
+ if (!Dt(c)) {
1067
1147
  a += 1;
1068
1148
  continue;
1069
1149
  }
1070
- a = Ho(t, a + 1, i, l);
1150
+ a = Xo(t, a + 1, i, l);
1071
1151
  }
1072
1152
  return {
1073
1153
  nextIndex: a,
@@ -1080,25 +1160,25 @@ const gn = (t) => Ze(t) || t.startsWith("diff --git "), qo = (t) => t.startsWith
1080
1160
  }
1081
1161
  };
1082
1162
  };
1083
- function No(t) {
1163
+ function Yo(t) {
1084
1164
  if (!t || typeof t != "string") return [];
1085
1165
  const e = t.split(/\r?\n/), n = [];
1086
- let s = 0;
1087
- for (; s < e.length; ) {
1088
- const o = e[s] || "";
1089
- if (!Ze(o)) {
1090
- s += 1;
1166
+ let o = 0;
1167
+ for (; o < e.length; ) {
1168
+ const s = e[o] || "";
1169
+ if (!st(s)) {
1170
+ o += 1;
1091
1171
  continue;
1092
1172
  }
1093
1173
  const {
1094
1174
  nextIndex: r,
1095
1175
  preview: i
1096
- } = Vo(e, s);
1097
- i && n.push(i), s = Math.max(r, s + 1);
1176
+ } = Go(e, o);
1177
+ i && n.push(i), o = Math.max(r, o + 1);
1098
1178
  }
1099
1179
  return n;
1100
1180
  }
1101
- const Uo = {
1181
+ const Jo = {
1102
1182
  apply_patch: "Apply patch",
1103
1183
  bash: "Run command",
1104
1184
  edit: "Edit file",
@@ -1107,143 +1187,143 @@ const Uo = {
1107
1187
  read: "Read file",
1108
1188
  skill: "Load skill",
1109
1189
  todowrite: "Update todos"
1110
- }, Qt = {
1190
+ }, Wt = {
1111
1191
  error: "failed",
1112
1192
  "output-error": "failed",
1113
1193
  input_streaming: "running",
1114
1194
  running: "running",
1115
1195
  completed: "completed",
1116
1196
  failed: "failed"
1117
- }, bn = (t) => t.replace(/^tool-/, "").toLowerCase(), jo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ko = (t) => bn(t.tool ?? "tool"), Xo = (t) => {
1118
- const e = bn(t);
1119
- return Uo[e] ?? jo(e.replace(/_/g, " "));
1120
- }, Go = (t) => {
1197
+ }, Sn = (t) => t.replace(/^tool-/, "").toLowerCase(), Zo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), er = (t) => Sn(t.tool ?? "tool"), tr = (t) => {
1198
+ const e = Sn(t);
1199
+ return Jo[e] ?? Zo(e.replace(/_/g, " "));
1200
+ }, nr = (t) => {
1121
1201
  const e = t.state?.status ?? t.status;
1122
1202
  if (!e || typeof e != "string") return null;
1123
1203
  const n = e.replace(/-/g, "_");
1124
- return Qt[n] ? Qt[n] : n.includes("stream") ? "running" : null;
1125
- }, yn = (t) => {
1204
+ return Wt[n] ? Wt[n] : n.includes("stream") ? "running" : null;
1205
+ }, wn = (t) => {
1126
1206
  const e = t.state?.status ?? t.status;
1127
1207
  return e === "error" || e === "output-error" || e === "failed";
1128
- }, ae = (t) => yn(t) ? {
1208
+ }, fe = (t) => wn(t) ? {
1129
1209
  type: "icon",
1130
1210
  icon: "danger"
1131
1211
  } : {
1132
1212
  type: "icon",
1133
- icon: mn(Ko(t))
1134
- }, ce = (t, e, n, s) => {
1213
+ icon: bn(er(t))
1214
+ }, pe = (t, e, n, o) => {
1135
1215
  const r = [{
1136
1216
  kind: "text",
1137
- text: n ?? Xo(t.tool ?? "tool"),
1217
+ text: n ?? tr(t.tool ?? "tool"),
1138
1218
  bold: !0
1139
1219
  }];
1140
1220
  e && r.push({
1141
1221
  kind: "text",
1142
1222
  text: e,
1143
1223
  muted: !0,
1144
- ...s === "monospace" ? {
1224
+ ...o === "monospace" ? {
1145
1225
  truncate: !0,
1146
1226
  monospace: !0
1147
1227
  } : {}
1148
1228
  });
1149
- const i = Go(t);
1229
+ const i = nr(t);
1150
1230
  return i && i !== "completed" && r.push({
1151
1231
  kind: "text",
1152
1232
  text: i,
1153
1233
  muted: !0
1154
1234
  }), r;
1155
- }, ye = (t) => {
1235
+ }, xe = (t) => {
1156
1236
  const e = t.state?.input;
1157
1237
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1158
- }, qe = (t) => {
1238
+ }, He = (t) => {
1159
1239
  const e = t.state?.output;
1160
1240
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1161
- }, I = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, ze = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Yo = (t, e) => {
1162
- const n = ze(t.state);
1163
- return n ? ze(n[e]) : null;
1164
- }, xn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Jo = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Sn = (t) => {
1241
+ }, v = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, qe = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, sr = (t, e) => {
1242
+ const n = qe(t.state);
1243
+ return n ? qe(n[e]) : null;
1244
+ }, Tn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), or = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), An = (t) => {
1245
+ const e = He(t);
1246
+ return [sr(t, "metadata"), qe(e?.metadata)].filter(Boolean);
1247
+ }, rr = (t) => {
1165
1248
  const e = qe(t);
1166
- return [Yo(t, "metadata"), ze(e?.metadata)].filter(Boolean);
1167
- }, Zo = (t) => {
1168
- const e = ze(t);
1169
1249
  if (!e) return null;
1170
- const n = I(e.filePath) ?? I(e.relativePath) ?? I(e.path);
1250
+ const n = v(e.filePath) ?? v(e.relativePath) ?? v(e.path);
1171
1251
  return n ? {
1172
- filePath: xn(n),
1252
+ filePath: Tn(n),
1173
1253
  additions: typeof e.additions == "number" ? e.additions : 0,
1174
1254
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
1175
- diff: I(e.diff) ?? void 0,
1176
- before: I(e.before) ?? void 0,
1177
- after: I(e.after) ?? void 0
1255
+ diff: v(e.diff) ?? void 0,
1256
+ before: v(e.before) ?? void 0,
1257
+ after: v(e.after) ?? void 0
1178
1258
  } : null;
1179
- }, wn = (t) => {
1259
+ }, Cn = (t) => {
1180
1260
  const e = [];
1181
- for (const n of Sn(t)) {
1182
- const s = Array.isArray(n.files) ? n.files : [];
1183
- for (const o of s) {
1184
- const r = Zo(o);
1261
+ for (const n of An(t)) {
1262
+ const o = Array.isArray(n.files) ? n.files : [];
1263
+ for (const s of o) {
1264
+ const r = rr(s);
1185
1265
  r && e.push(r);
1186
1266
  }
1187
1267
  }
1188
1268
  return e;
1189
- }, er = (t) => {
1190
- const e = ye(t), s = (Array.isArray(e?.changes) ? e.changes : []).map((o) => I(ze(o)?.path)).filter((o) => !!o).map(xn);
1191
- return Array.from(new Set(s));
1192
- }, tr = (t) => {
1193
- const e = ye(t), n = I(e?.diff);
1269
+ }, ir = (t) => {
1270
+ const e = xe(t), o = (Array.isArray(e?.changes) ? e.changes : []).map((s) => v(qe(s)?.path)).filter((s) => !!s).map(Tn);
1271
+ return Array.from(new Set(o));
1272
+ }, lr = (t) => {
1273
+ const e = xe(t), n = v(e?.diff);
1194
1274
  if (n) return n;
1195
- for (const r of Sn(t)) {
1196
- const i = I(r.diff);
1275
+ for (const r of An(t)) {
1276
+ const i = v(r.diff);
1197
1277
  if (i) return i;
1198
1278
  }
1199
- const s = wn(t).map((r) => r.diff).filter((r) => !!r);
1200
- if (s.length > 0) return s.join(`
1279
+ const o = Cn(t).map((r) => r.diff).filter((r) => !!r);
1280
+ if (o.length > 0) return o.join(`
1201
1281
  `);
1202
- const o = I(e?.patchText);
1203
- return o && Jo(o) ? o : null;
1204
- }, nr = (t) => {
1282
+ const s = v(e?.patchText);
1283
+ return s && or(s) ? s : null;
1284
+ }, ar = (t) => {
1205
1285
  const e = /* @__PURE__ */ new Set(), n = [];
1206
- for (const s of t)
1207
- e.has(s.filePath) || (e.add(s.filePath), n.push({
1286
+ for (const o of t)
1287
+ e.has(o.filePath) || (e.add(o.filePath), n.push({
1208
1288
  kind: "diff",
1209
- fileName: Rt(s.filePath),
1210
- filePath: s.filePath,
1211
- additions: s.additions,
1212
- deletions: s.deletions
1289
+ fileName: Pt(o.filePath),
1290
+ filePath: o.filePath,
1291
+ additions: o.additions,
1292
+ deletions: o.deletions
1213
1293
  }));
1214
1294
  return n;
1215
- }, sr = (t) => Array.from(new Set(t.map((e) => e.filePath))), et = (t) => {
1216
- const e = qe(t);
1217
- return I(t.state?.output) ?? I(e?.returnDisplay) ?? I(e?.preview) ?? I(e?.stdout) ?? I(e?.content);
1218
- }, or = (t) => {
1295
+ }, cr = (t) => Array.from(new Set(t.map((e) => e.filePath))), ot = (t) => {
1296
+ const e = He(t);
1297
+ return v(t.state?.output) ?? v(e?.returnDisplay) ?? v(e?.preview) ?? v(e?.stdout) ?? v(e?.content);
1298
+ }, ur = (t) => {
1219
1299
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
1220
1300
  return e ? {
1221
- skillName: I(e[1]) ?? void 0,
1222
- content: I(e[2]) ?? ""
1301
+ skillName: v(e[1]) ?? void 0,
1302
+ content: v(e[2]) ?? ""
1223
1303
  } : null;
1224
- }, rr = (t) => {
1225
- const e = ye(t);
1226
- return I(e?.name) ?? I(e?.skillName) ?? I(e?.skill) ?? I(e?.skill_name) ?? void 0;
1227
- }, Pt = (t, e) => ({
1304
+ }, dr = (t) => {
1305
+ const e = xe(t);
1306
+ return v(e?.name) ?? v(e?.skillName) ?? v(e?.skill) ?? v(e?.skill_name) ?? void 0;
1307
+ }, Bt = (t, e) => ({
1228
1308
  kind: "link",
1229
- text: Rt(t),
1309
+ text: Pt(t),
1230
1310
  filePath: t,
1231
1311
  ...e ? {
1232
1312
  variant: e
1233
1313
  } : {}
1234
- }), ue = (t, e) => !yn(t) || !t.state?.errorText ? e : [{
1314
+ }), me = (t, e) => !wn(t) || !t.state?.errorText ? e : [{
1235
1315
  type: "comment",
1236
1316
  text: t.state.errorText
1237
- }, ...e], Tn = (t) => No(t ?? void 0).map((e) => ({
1317
+ }, ...e], kn = (t) => Yo(t ?? void 0).map((e) => ({
1238
1318
  type: "diff",
1239
1319
  language: "diff",
1240
1320
  original: e.original,
1241
1321
  modified: e.modified,
1242
1322
  sideBySide: !1
1243
- })), ir = (t) => zo(t ?? void 0), lr = (t) => Qo(t ?? void 0), ar = (t) => {
1244
- const e = tr(t), n = wn(t), s = er(t), o = ce(t, void 0, "Apply patch"), r = ir(e);
1245
- r.length > 0 ? o.push(...r) : n.length > 0 ? o.push(...nr(n)) : o.push(...s.map((l) => Pt(l, "bubble")));
1246
- const i = [...Tn(e)];
1323
+ })), fr = (t) => Vo(t ?? void 0), pr = (t) => Uo(t ?? void 0), mr = (t) => {
1324
+ const e = lr(t), n = Cn(t), o = ir(t), s = pe(t, void 0, "Apply patch"), r = fr(e);
1325
+ r.length > 0 ? s.push(...r) : n.length > 0 ? s.push(...ar(n)) : s.push(...o.map((l) => Bt(l, "bubble")));
1326
+ const i = [...kn(e)];
1247
1327
  if (i.length === 0)
1248
1328
  for (const l of n)
1249
1329
  !l.before && !l.after || i.push({
@@ -1254,92 +1334,92 @@ const Uo = {
1254
1334
  sideBySide: !1
1255
1335
  });
1256
1336
  if (i.length === 0) {
1257
- const l = lr(e);
1258
- l.length === 0 && l.push(...sr(n)), l.length === 0 && l.push(...s), l.length > 0 && i.push({
1337
+ const l = pr(e);
1338
+ l.length === 0 && l.push(...cr(n)), l.length === 0 && l.push(...o), l.length > 0 && i.push({
1259
1339
  type: "references",
1260
1340
  references: l
1261
1341
  });
1262
1342
  }
1263
1343
  return {
1264
- indicator: ae(t),
1265
- title: o,
1266
- blocks: ue(t, i)
1344
+ indicator: fe(t),
1345
+ title: s,
1346
+ blocks: me(t, i)
1267
1347
  };
1268
- }, cr = (t, e) => [{
1348
+ }, hr = (t, e) => [{
1269
1349
  type: "diff",
1270
1350
  language: "text",
1271
1351
  original: t,
1272
1352
  modified: e,
1273
1353
  sideBySide: !1
1274
- }], ur = (t) => {
1275
- const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(n?.filePath) ?? void 0, o = I(n?.oldString) ?? I(e?.old_string) ?? void 0, r = I(n?.newString) ?? I(e?.new_string) ?? void 0, i = ce(t, void 0, "Edit file");
1276
- s && i.push(Pt(s));
1277
- const l = o !== void 0 && r !== void 0 ? cr(o, r) : Tn(I(n?.diff));
1354
+ }], gr = (t) => {
1355
+ const e = xe(t), n = He(t), o = v(e?.filePath) ?? v(e?.file_path) ?? v(n?.filePath) ?? void 0, s = v(n?.oldString) ?? v(e?.old_string) ?? void 0, r = v(n?.newString) ?? v(e?.new_string) ?? void 0, i = pe(t, void 0, "Edit file");
1356
+ o && i.push(Bt(o));
1357
+ const l = s !== void 0 && r !== void 0 ? hr(s, r) : kn(v(n?.diff));
1278
1358
  return {
1279
- indicator: ae(t),
1359
+ indicator: fe(t),
1280
1360
  title: i,
1281
- blocks: ue(t, l)
1361
+ blocks: me(t, l)
1282
1362
  };
1283
- }, dr = (t) => {
1363
+ }, br = (t) => {
1284
1364
  const {
1285
1365
  buildBaseTitle: e,
1286
1366
  buildIndicator: n,
1287
- prependErrorBlock: s
1367
+ prependErrorBlock: o
1288
1368
  } = t;
1289
- return (o) => {
1290
- const r = re(o.state?.output) ?? re(o.state?.metadata), i = dn(o.state?.input), l = i ? {
1369
+ return (s) => {
1370
+ const r = ue(s.state?.output) ?? ue(s.state?.metadata), i = mn(s.state?.input), l = i ? {
1291
1371
  type: "question-form",
1292
1372
  questions: i.questions
1293
1373
  } : null;
1294
1374
  if (!r && !l) return null;
1295
- const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0, u = r ? [] : [l];
1375
+ const a = l ? `${l.questions.length} field${l.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [l];
1296
1376
  return {
1297
- indicator: n(o),
1298
- title: e(o, a, "Question"),
1299
- blocks: s(o, u),
1377
+ indicator: n(s),
1378
+ title: e(s, a, "Question"),
1379
+ blocks: o(s, c),
1300
1380
  expandable: !1
1301
1381
  };
1302
1382
  };
1303
- }, fr = (t) => {
1304
- const e = ye(t), n = qe(t), s = I(e?.filePath) ?? I(e?.file_path) ?? I(e?.file) ?? I(n?.filePath) ?? I(n?.file) ?? I(n?.path) ?? void 0, o = ce(t, void 0, "Read file");
1305
- return s && o.push(Pt(s)), {
1306
- indicator: ae(t),
1307
- title: o,
1308
- blocks: ue(t, [])
1383
+ }, yr = (t) => {
1384
+ const e = xe(t), n = He(t), o = v(e?.filePath) ?? v(e?.file_path) ?? v(e?.file) ?? v(n?.filePath) ?? v(n?.file) ?? v(n?.path) ?? void 0, s = pe(t, void 0, "Read file");
1385
+ return o && s.push(Bt(o)), {
1386
+ indicator: fe(t),
1387
+ title: s,
1388
+ blocks: me(t, [])
1309
1389
  };
1310
- }, An = (t, e) => {
1311
- const n = ye(t), s = qe(t), o = I(n?.command) ?? void 0, r = ce(t, o, e, "monospace"), i = [], l = et(t);
1390
+ }, In = (t, e) => {
1391
+ const n = xe(t), o = He(t), s = v(n?.command) ?? void 0, r = pe(t, s, e, "monospace"), i = [], l = ot(t);
1312
1392
  l && i.push({
1313
1393
  type: "code",
1314
1394
  language: "text",
1315
1395
  code: l
1316
1396
  });
1317
- const a = I(s?.stderr);
1397
+ const a = v(o?.stderr);
1318
1398
  return a && a !== l && i.push({
1319
1399
  type: "code",
1320
1400
  language: "text",
1321
1401
  code: a
1322
- }), typeof s?.exitCode == "number" && i.push({
1402
+ }), typeof o?.exitCode == "number" && i.push({
1323
1403
  type: "text",
1324
- text: `Exit code: ${s.exitCode}`
1404
+ text: `Exit code: ${o.exitCode}`
1325
1405
  }), {
1326
- indicator: ae(t),
1406
+ indicator: fe(t),
1327
1407
  title: r,
1328
- blocks: ue(t, i)
1408
+ blocks: me(t, i)
1329
1409
  };
1330
- }, pr = (t) => An(t, "Run command"), mr = (t) => An(t, "Shell"), hr = (t) => {
1331
- const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Search files"), r = n ? [{
1410
+ }, xr = (t) => In(t, "Run command"), Sr = (t) => In(t, "Shell"), wr = (t) => {
1411
+ const e = xe(t), n = ot(t), o = v(e?.pattern) ?? void 0, s = pe(t, o, "Search files"), r = n ? [{
1332
1412
  type: "code",
1333
1413
  language: "text",
1334
1414
  code: n
1335
1415
  }] : [];
1336
1416
  return {
1337
- indicator: ae(t),
1338
- title: o,
1339
- blocks: ue(t, r)
1417
+ indicator: fe(t),
1418
+ title: s,
1419
+ blocks: me(t, r)
1340
1420
  };
1341
- }, gr = (t) => {
1342
- const e = ye(t), n = et(t), s = I(e?.pattern) ?? void 0, o = ce(t, s, "Find files"), r = [];
1421
+ }, Tr = (t) => {
1422
+ const e = xe(t), n = ot(t), o = v(e?.pattern) ?? void 0, s = pe(t, o, "Find files"), r = [];
1343
1423
  if (n) {
1344
1424
  const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
1345
1425
  i.length > 0 && r.push({
@@ -1348,63 +1428,63 @@ const Uo = {
1348
1428
  });
1349
1429
  }
1350
1430
  return {
1351
- indicator: ae(t),
1352
- title: o,
1353
- blocks: ue(t, r)
1431
+ indicator: fe(t),
1432
+ title: s,
1433
+ blocks: me(t, r)
1354
1434
  };
1355
- }, br = (t) => {
1356
- const e = et(t), n = e ? or(e) : null, s = rr(t) ?? n?.skillName, o = ce(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
1435
+ }, Ar = (t) => {
1436
+ const e = ot(t), n = e ? ur(e) : null, o = dr(t) ?? n?.skillName, s = pe(t, o, "Load skill"), r = n?.content ?? e, i = r ? [{
1357
1437
  type: "code",
1358
1438
  language: "markdown",
1359
1439
  code: r
1360
1440
  }] : [];
1361
1441
  return {
1362
- indicator: ae(t),
1363
- title: o,
1364
- blocks: ue(t, i)
1442
+ indicator: fe(t),
1443
+ title: s,
1444
+ blocks: me(t, i)
1365
1445
  };
1366
- }, ht = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, kn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, yr = (t) => {
1367
- const e = kn(t);
1446
+ }, yt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, _n = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Cr = (t) => {
1447
+ const e = _n(t);
1368
1448
  if (!e) return null;
1369
- const n = ht(e.content) ?? ht(e.title);
1449
+ const n = yt(e.content) ?? yt(e.title);
1370
1450
  if (!n) return null;
1371
- const s = ht(e.status);
1451
+ const o = yt(e.status);
1372
1452
  return {
1373
1453
  label: n,
1374
- checked: s === "completed"
1454
+ checked: o === "completed"
1375
1455
  };
1376
- }, qt = (t) => {
1456
+ }, Ht = (t) => {
1377
1457
  if (!t) return {
1378
1458
  items: [],
1379
1459
  explicit: !1
1380
1460
  };
1381
1461
  const e = (() => {
1382
1462
  if (Array.isArray(t)) return t;
1383
- const n = kn(t);
1463
+ const n = _n(t);
1384
1464
  return !n || !Array.isArray(n.todos) ? null : n.todos;
1385
1465
  })();
1386
1466
  return e ? {
1387
- items: e.map(yr).filter((n) => n !== null),
1467
+ items: e.map(Cr).filter((n) => n !== null),
1388
1468
  explicit: !0
1389
1469
  } : {
1390
1470
  items: [],
1391
1471
  explicit: !1
1392
1472
  };
1393
- }, xr = (t) => {
1473
+ }, kr = (t) => {
1394
1474
  const {
1395
1475
  buildBaseTitle: e,
1396
1476
  buildIndicator: n,
1397
- prependErrorBlock: s
1477
+ prependErrorBlock: o
1398
1478
  } = t;
1399
- return (o) => {
1400
- const r = qt(o.state?.input), i = qt(o.state?.output), l = i.explicit ? i : r;
1479
+ return (s) => {
1480
+ const r = Ht(s.state?.input), i = Ht(s.state?.output), l = i.explicit ? i : r;
1401
1481
  if (!l.explicit) return null;
1402
- const a = l.items, u = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
1482
+ const a = l.items, c = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(s, c, "Update todos");
1403
1483
  if (a.length === 0)
1404
1484
  return {
1405
- indicator: n(o),
1485
+ indicator: n(s),
1406
1486
  title: d,
1407
- blocks: s(o, [{
1487
+ blocks: o(s, [{
1408
1488
  type: "comment",
1409
1489
  text: "No todos"
1410
1490
  }])
@@ -1414,45 +1494,45 @@ const Uo = {
1414
1494
  items: a
1415
1495
  }];
1416
1496
  return {
1417
- indicator: n(o),
1497
+ indicator: n(s),
1418
1498
  title: d,
1419
- blocks: s(o, f)
1499
+ blocks: o(s, f)
1420
1500
  };
1421
1501
  };
1422
- }, Sr = dr({
1423
- buildBaseTitle: ce,
1424
- buildIndicator: ae,
1425
- prependErrorBlock: ue
1426
- }), Wt = xr({
1427
- buildBaseTitle: ce,
1428
- buildIndicator: ae,
1429
- prependErrorBlock: ue
1430
- }), Ht = () => ({
1431
- apply_patch: ar,
1432
- bash: pr,
1433
- edit: ur,
1434
- glob: gr,
1435
- grep: hr,
1436
- question: Sr,
1437
- read: fr,
1438
- shell: mr,
1439
- skill: br,
1440
- todo_write: Wt,
1441
- todowrite: Wt
1442
- }), Vt = {
1502
+ }, Ir = br({
1503
+ buildBaseTitle: pe,
1504
+ buildIndicator: fe,
1505
+ prependErrorBlock: me
1506
+ }), Nt = kr({
1507
+ buildBaseTitle: pe,
1508
+ buildIndicator: fe,
1509
+ prependErrorBlock: me
1510
+ }), Vt = () => ({
1511
+ apply_patch: mr,
1512
+ bash: xr,
1513
+ edit: gr,
1514
+ glob: Tr,
1515
+ grep: wr,
1516
+ question: Ir,
1517
+ read: yr,
1518
+ shell: Sr,
1519
+ skill: Ar,
1520
+ todo_write: Nt,
1521
+ todowrite: Nt
1522
+ }), Ut = {
1443
1523
  error: "failed",
1444
1524
  "output-error": "failed",
1445
1525
  "input-streaming": "running"
1446
- }, wr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Cn = (t) => {
1447
- const e = Je(t ?? "tool").replace(/_/g, " ");
1448
- return wr(e);
1449
- }, In = (t) => t === "error" || t === "output-error", Tr = (t) => In(t.state?.status) ? {
1526
+ }, _r = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), vn = (t) => {
1527
+ const e = nt(t ?? "tool").replace(/_/g, " ");
1528
+ return _r(e);
1529
+ }, Mn = (t) => t === "error" || t === "output-error", vr = (t) => Mn(t.state?.status) ? {
1450
1530
  type: "icon",
1451
1531
  icon: "danger"
1452
1532
  } : {
1453
1533
  type: "icon",
1454
- icon: mn(t.tool ?? "tool")
1455
- }, Ar = (t) => !t || typeof t != "string" ? null : Vt[t] ? Vt[t] : t.includes("stream") ? "running" : null, kr = (t) => {
1534
+ icon: bn(t.tool ?? "tool")
1535
+ }, Mr = (t) => !t || typeof t != "string" ? null : Ut[t] ? Ut[t] : t.includes("stream") ? "running" : null, Rr = (t) => {
1456
1536
  if (typeof t == "string") return t;
1457
1537
  if (t == null) return null;
1458
1538
  try {
@@ -1460,31 +1540,31 @@ const Uo = {
1460
1540
  } catch {
1461
1541
  return null;
1462
1542
  }
1463
- }, St = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(St) : typeof t == "object" ? Object.values(t).every(St) : !1, tt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Cr = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), Nt = (t) => !!t?.startsWith("image/"), Ir = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, _n = (t, e) => {
1464
- const n = tt(t);
1543
+ }, At = (t) => t == null ? !0 : typeof t == "string" ? t.trim().length === 0 : Array.isArray(t) ? t.length === 0 || t.every(At) : typeof t == "object" ? Object.values(t).every(At) : !1, rt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, N = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pr = (t) => N(t.mime_type) ?? N(t.mediaType) ?? N(t.mimeType), jt = (t) => !!t?.startsWith("image/"), Er = /\.(avif|bmp|gif|jpe?g|png|svg|webp)(\?.*)?$/i, Rn = (t, e) => {
1544
+ const n = rt(t);
1465
1545
  if (!n) return null;
1466
- const s = Cr(n), o = N(n.data);
1467
- if (o && Nt(s))
1546
+ const o = Pr(n), s = N(n.data);
1547
+ if (s && jt(o))
1468
1548
  return {
1469
1549
  type: "image",
1470
- src: `data:${s};base64,${o}`,
1550
+ src: `data:${o};base64,${s}`,
1471
1551
  alt: e
1472
1552
  };
1473
1553
  const r = N(n.url) ?? N(n.src);
1474
- return r && (Nt(s) || Ir.test(r)) ? {
1554
+ return r && (jt(o) || Er.test(r)) ? {
1475
1555
  type: "image",
1476
1556
  src: r,
1477
1557
  alt: e
1478
1558
  } : null;
1479
- }, Rn = (t) => {
1480
- const e = tt(t);
1559
+ }, Pn = (t) => {
1560
+ const e = rt(t);
1481
1561
  if (!e) return null;
1482
- const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), s = N(e.content) ?? N(e.body) ?? N(e.text);
1483
- return !n || s === null ? null : {
1562
+ const n = N(e.path) ?? N(e.filePath) ?? N(e.filename), o = N(e.content) ?? N(e.body) ?? N(e.text);
1563
+ return !n || o === null ? null : {
1484
1564
  filePath: n,
1485
- content: s
1565
+ content: o
1486
1566
  };
1487
- }, _r = {
1567
+ }, Dr = {
1488
1568
  css: "css",
1489
1569
  html: "html",
1490
1570
  js: "js",
@@ -1496,88 +1576,88 @@ const Uo = {
1496
1576
  tsx: "tsx",
1497
1577
  yaml: "yaml",
1498
1578
  yml: "yaml"
1499
- }, Rr = (t) => {
1579
+ }, Br = (t) => {
1500
1580
  const e = t.split(".").pop()?.toLowerCase();
1501
- return e ? _r[e] ?? e : "text";
1502
- }, Ut = (t, e) => e.length === 0 ? [] : [{
1581
+ return e ? Dr[e] ?? e : "text";
1582
+ }, Kt = (t, e) => e.length === 0 ? [] : [{
1503
1583
  type: "text",
1504
1584
  text: t
1505
- }, ...e], vr = (t, e) => {
1585
+ }, ...e], Fr = (t, e) => {
1506
1586
  const n = [];
1507
- for (const s of t) {
1508
- const o = tt(s), r = N(o?.type);
1587
+ for (const o of t) {
1588
+ const s = rt(o), r = N(s?.type);
1509
1589
  if (r === "image") {
1510
- const i = _n(s, e);
1590
+ const i = Rn(o, e);
1511
1591
  i && n.push(i);
1512
1592
  continue;
1513
1593
  }
1514
1594
  if (r === "text") {
1515
- const i = N(o?.text);
1595
+ const i = N(s?.text);
1516
1596
  i && n.push({
1517
1597
  type: "text",
1518
1598
  text: i
1519
1599
  });
1520
1600
  continue;
1521
1601
  }
1522
- n.push(...wt(s, e));
1602
+ n.push(...Ct(o, e));
1523
1603
  }
1524
1604
  return n;
1525
- }, Mr = (t) => {
1526
- const e = Rn(t);
1605
+ }, Lr = (t) => {
1606
+ const e = Pn(t);
1527
1607
  return e ? [{
1528
1608
  type: "code",
1529
- language: Rr(e.filePath),
1609
+ language: Br(e.filePath),
1530
1610
  code: e.content
1531
1611
  }] : null;
1532
- }, Pr = (t) => {
1533
- const e = tt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), s = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
1534
- return !n && !s ? null : [{
1612
+ }, $r = (t) => {
1613
+ const e = rt(t), n = N(e?.attachment_name) ?? N(e?.attachmentName), o = N(e?.attachment_file_id) ?? N(e?.attachmentFileId);
1614
+ return !n && !o ? null : [{
1535
1615
  type: "text",
1536
- text: n ?? `Attachment ${s}`
1616
+ text: n ?? `Attachment ${o}`
1537
1617
  }];
1538
- }, wt = (t, e) => {
1539
- if (St(t)) return [];
1540
- const n = _n(t, e);
1618
+ }, Ct = (t, e) => {
1619
+ if (At(t)) return [];
1620
+ const n = Rn(t, e);
1541
1621
  if (n) return [n];
1542
- if (Array.isArray(t)) return vr(t, e);
1543
- const s = Mr(t);
1544
- if (s) return s;
1545
- const o = Pr(t);
1622
+ if (Array.isArray(t)) return Fr(t, e);
1623
+ const o = Lr(t);
1546
1624
  if (o) return o;
1547
- const r = kr(t);
1625
+ const s = $r(t);
1626
+ if (s) return s;
1627
+ const r = Rr(t);
1548
1628
  return r?.trim() ? [{
1549
1629
  type: "code",
1550
1630
  language: typeof t == "string" ? "text" : "json",
1551
1631
  code: r
1552
1632
  }] : [];
1553
- }, Er = (t) => {
1554
- const e = [], n = Cn(t.tool);
1555
- return In(t.state?.status) && t.state?.errorText && e.push({
1633
+ }, Or = (t) => {
1634
+ const e = [], n = vn(t.tool);
1635
+ return Mn(t.state?.status) && t.state?.errorText && e.push({
1556
1636
  type: "comment",
1557
1637
  text: t.state.errorText
1558
- }), e.push(...Ut("Input", wt(t.state?.input, `${n} input`))), e.push(...Ut("Output", wt(t.state?.output, `${n} output`))), e;
1559
- }, Dr = (t) => {
1638
+ }), e.push(...Kt("Input", Ct(t.state?.input, `${n} input`))), e.push(...Kt("Output", Ct(t.state?.output, `${n} output`))), e;
1639
+ }, zr = (t) => {
1560
1640
  const e = [{
1561
1641
  kind: "text",
1562
- text: Cn(t.tool),
1642
+ text: vn(t.tool),
1563
1643
  bold: !0
1564
- }], n = Rn(t.state?.output);
1644
+ }], n = Pn(t.state?.output);
1565
1645
  n && e.push({
1566
1646
  kind: "link",
1567
1647
  text: n.filePath,
1568
1648
  filePath: n.filePath
1569
1649
  });
1570
- const s = Ar(t.state?.status);
1571
- return s && e.push({
1650
+ const o = Mr(t.state?.status);
1651
+ return o && e.push({
1572
1652
  kind: "text",
1573
- text: s,
1653
+ text: o,
1574
1654
  muted: !0
1575
1655
  }), {
1576
- indicator: Tr(t),
1656
+ indicator: vr(t),
1577
1657
  title: e,
1578
- blocks: Er(t)
1658
+ blocks: Or(t)
1579
1659
  };
1580
- }, Br = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, Fr = (t) => {
1660
+ }, Qr = (t) => t.kind === "text" || t.kind === "link" ? t.text.trim().length > 0 : t.kind === "diff" ? t.fileName.trim().length > 0 : !0, qr = (t) => {
1581
1661
  switch (t.type) {
1582
1662
  case "comment":
1583
1663
  case "code":
@@ -1597,355 +1677,355 @@ const Uo = {
1597
1677
  case "component":
1598
1678
  return !0;
1599
1679
  }
1600
- }, Lr = (t) => {
1601
- const e = t.title.some(Br), n = (t.blocks ?? []).some(Fr);
1680
+ }, Wr = (t) => {
1681
+ const e = t.title.some(Qr), n = (t.blocks ?? []).some(qr);
1602
1682
  return e || n;
1603
- }, $r = (t) => t ? {
1604
- ...Ht(),
1683
+ }, Hr = (t) => t ? {
1684
+ ...Vt(),
1605
1685
  ...t
1606
- } : Ht(), Or = (t, e) => {
1686
+ } : Vt(), Nr = (t, e) => {
1607
1687
  const n = t.tool ?? "tool";
1608
- for (const s of vo(n)) {
1609
- const o = e[s];
1610
- if (o) return o;
1688
+ for (const o of Fo(n)) {
1689
+ const s = e[o];
1690
+ if (s) return s;
1611
1691
  }
1612
- }, zr = (t, e, n) => {
1613
- const s = Or(t, e);
1614
- if (s) {
1615
- const o = s(t, n);
1616
- if (o) return o;
1692
+ }, Vr = (t, e, n) => {
1693
+ const o = Nr(t, e);
1694
+ if (o) {
1695
+ const s = o(t, n);
1696
+ if (s) return s;
1617
1697
  }
1618
- return Dr(t);
1619
- }, Qr = (t, e) => {
1620
- const n = $r(e?.toolRenderers);
1698
+ return zr(t);
1699
+ }, Ur = (t, e) => {
1700
+ const n = Hr(e?.toolRenderers);
1621
1701
  return {
1622
- items: t.map((o) => zr(o, n, e)).filter(Lr)
1702
+ items: t.map((s) => Vr(s, n, e)).filter(Wr)
1623
1703
  };
1624
- }, vn = (t, e, n, s = !1) => {
1625
- s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1704
+ }, En = (t, e, n, o = !1) => {
1705
+ o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1626
1706
  };
1627
- function qr(t) {
1628
- const e = A(6), {
1707
+ function jr(t) {
1708
+ const e = C(6), {
1629
1709
  seg: n
1630
1710
  } = t;
1631
- let s;
1632
- e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
1633
1711
  let o;
1634
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = o) : o = e[3];
1712
+ e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ u(Ee.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
1713
+ let s;
1714
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ u(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = s) : s = e[3];
1635
1715
  let r;
1636
- return e[4] !== s ? (r = /* @__PURE__ */ k(Ee.Root, { width: "1.5rem", height: "1.5rem", children: [
1637
- s,
1638
- o
1639
- ] }), e[4] = s, e[5] = r) : r = e[5], r;
1716
+ return e[4] !== o ? (r = /* @__PURE__ */ k(Ee.Root, { width: "1.5rem", height: "1.5rem", children: [
1717
+ o,
1718
+ s
1719
+ ] }), e[4] = o, e[5] = r) : r = e[5], r;
1640
1720
  }
1641
- function Wr(t) {
1642
- const e = A(9), {
1721
+ function Kr(t) {
1722
+ const e = C(9), {
1643
1723
  seg: n,
1644
- onOpenFile: s
1645
- } = t, o = n.additions ?? 0, r = n.deletions ?? 0;
1724
+ onOpenFile: o
1725
+ } = t, s = n.additions ?? 0, r = n.deletions ?? 0;
1646
1726
  let i;
1647
- e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1727
+ e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1648
1728
  const a = n.filePath ?? n.fileName;
1649
- s?.(a);
1650
- }, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1729
+ o?.(a);
1730
+ }, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1651
1731
  let l;
1652
- return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ c(Cs, { fileName: n.fileName, additions: o, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = o, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
1732
+ return e[4] !== n.fileName || e[5] !== s || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ u(vs, { fileName: n.fileName, additions: s, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = s, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
1653
1733
  }
1654
- function Hr(t) {
1655
- const e = A(13), {
1734
+ function Xr(t) {
1735
+ const e = C(13), {
1656
1736
  seg: n,
1657
- onOpenFile: s
1658
- } = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
1659
- let u;
1660
- e[0] !== s || e[1] !== n ? (u = (m) => vn(m, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
1737
+ onOpenFile: o
1738
+ } = t, s = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
1739
+ let c;
1740
+ e[0] !== o || e[1] !== n ? (c = (p) => En(p, n, o, !0), e[0] = o, e[1] = n, e[2] = c) : c = e[2];
1661
1741
  const d = n.muted ? "fg.muted" : "fg.blue-dark";
1662
1742
  let f;
1663
1743
  e[3] !== d ? (f = {
1664
1744
  textDecoration: "underline",
1665
1745
  color: d
1666
1746
  }, e[3] = d, e[4] = f) : f = e[4];
1667
- let p;
1668
- return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== u || e[11] !== f ? (p = /* @__PURE__ */ c(Jt, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: a, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = u, e[11] = f, e[12] = p) : p = e[12], p;
1747
+ let m;
1748
+ return e[5] !== s || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== a || e[10] !== c || e[11] !== f ? (m = /* @__PURE__ */ u(en, { href: i, fontWeight: s, color: l, textDecoration: "none", cursor: a, onClick: c, _hover: f, children: n.text }), e[5] = s, e[6] = n.text, e[7] = i, e[8] = l, e[9] = a, e[10] = c, e[11] = f, e[12] = m) : m = e[12], m;
1669
1749
  }
1670
- function Vr(t) {
1671
- const e = A(12), {
1750
+ function Gr(t) {
1751
+ const e = C(12), {
1672
1752
  seg: n,
1673
- onOpenFile: s
1674
- } = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1753
+ onOpenFile: o
1754
+ } = t, s = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1675
1755
  let l;
1676
- e[0] !== s || e[1] !== n ? (l = (f) => vn(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
1756
+ e[0] !== o || e[1] !== n ? (l = (f) => En(f, n, o), e[0] = o, e[1] = n, e[2] = l) : l = e[2];
1677
1757
  const a = n.muted ? "fg.muted" : "accent.primary";
1678
- let u;
1679
- e[3] !== a ? (u = {
1758
+ let c;
1759
+ e[3] !== a ? (c = {
1680
1760
  color: a,
1681
1761
  textDecoration: "underline"
1682
- }, e[3] = a, e[4] = u) : u = e[4];
1762
+ }, e[3] = a, e[4] = c) : c = e[4];
1683
1763
  let d;
1684
- return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ c(Jt, { href: r, fontWeight: o, color: i, textDecoration: "underline", onClick: l, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = u, e[11] = d) : d = e[11], d;
1764
+ return e[5] !== s || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== c ? (d = /* @__PURE__ */ u(en, { href: r, fontWeight: s, color: i, textDecoration: "underline", onClick: l, _hover: c, children: n.text }), e[5] = s, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = c, e[11] = d) : d = e[11], d;
1685
1765
  }
1686
- function Nr(t) {
1687
- const e = A(14), {
1766
+ function Yr(t) {
1767
+ const e = C(14), {
1688
1768
  seg: n,
1689
- isClickable: s
1690
- } = t, o = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, u = n.truncate ? "nowrap" : void 0, d = s && !n.muted ? "fg" : "fg.muted";
1769
+ isClickable: o
1770
+ } = t, s = n.bold ? "medium" : void 0, r = n.monospace ? "mono/XS" : void 0, i = n.truncate ? "0" : void 0, l = n.truncate ? "hidden" : void 0, a = n.truncate ? "ellipsis" : void 0, c = n.truncate ? "nowrap" : void 0, d = o && !n.muted ? "fg" : "fg.muted";
1691
1771
  let f;
1692
1772
  e[0] !== d ? (f = {
1693
1773
  color: d
1694
1774
  }, e[0] = d, e[1] = f) : f = e[1];
1695
- let p;
1696
- e[2] !== n.text || e[3] !== o || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== u || e[9] !== f ? (p = /* @__PURE__ */ c($e, { fontWeight: o, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: u, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = o, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = u, e[9] = f, e[10] = p) : p = e[10];
1697
- const m = p;
1775
+ let m;
1776
+ e[2] !== n.text || e[3] !== s || e[4] !== r || e[5] !== i || e[6] !== l || e[7] !== a || e[8] !== c || e[9] !== f ? (m = /* @__PURE__ */ u(ze, { fontWeight: s, textStyle: r, color: "fg.muted", minW: i, overflow: l, textOverflow: a, whiteSpace: c, _groupHover: f, children: n.text }), e[2] = n.text, e[3] = s, e[4] = r, e[5] = i, e[6] = l, e[7] = a, e[8] = c, e[9] = f, e[10] = m) : m = e[10];
1777
+ const p = m;
1698
1778
  if (!n.truncate)
1699
- return m;
1779
+ return p;
1700
1780
  let h;
1701
- return e[11] !== n.text || e[12] !== m ? (h = /* @__PURE__ */ c(Ct, { content: n.text, children: m }), e[11] = n.text, e[12] = m, e[13] = h) : h = e[13], h;
1781
+ return e[11] !== n.text || e[12] !== p ? (h = /* @__PURE__ */ u(vt, { content: n.text, children: p }), e[11] = n.text, e[12] = p, e[13] = h) : h = e[13], h;
1702
1782
  }
1703
- function Ur(t) {
1704
- const e = A(11), {
1783
+ function Jr(t) {
1784
+ const e = C(11), {
1705
1785
  seg: n,
1706
- isClickable: s,
1707
- onOpenFile: o
1786
+ isClickable: o,
1787
+ onOpenFile: s
1708
1788
  } = t;
1709
1789
  switch (n.kind) {
1710
1790
  case "avatar": {
1711
1791
  let r;
1712
- return e[0] !== n ? (r = /* @__PURE__ */ c(qr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1792
+ return e[0] !== n ? (r = /* @__PURE__ */ u(jr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1713
1793
  }
1714
1794
  case "diff": {
1715
1795
  let r;
1716
- return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ c(Wr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
1796
+ return e[2] !== s || e[3] !== n ? (r = /* @__PURE__ */ u(Kr, { seg: n, onOpenFile: s }), e[2] = s, e[3] = n, e[4] = r) : r = e[4], r;
1717
1797
  }
1718
1798
  case "link": {
1719
1799
  let r;
1720
- return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ c(Hr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ c(Vr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
1800
+ return e[5] !== s || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ u(Xr, { seg: n, onOpenFile: s }) : /* @__PURE__ */ u(Gr, { seg: n, onOpenFile: s }), e[5] = s, e[6] = n, e[7] = r) : r = e[7], r;
1721
1801
  }
1722
1802
  case "text": {
1723
1803
  let r;
1724
- return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ c(Nr, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
1804
+ return e[8] !== o || e[9] !== n ? (r = /* @__PURE__ */ u(Yr, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = r) : r = e[10], r;
1725
1805
  }
1726
1806
  default:
1727
1807
  return null;
1728
1808
  }
1729
1809
  }
1730
- const he = Nn;
1731
- function jr(t) {
1732
- const e = A(10), {
1810
+ const ge = Kn;
1811
+ function Zr(t) {
1812
+ const e = C(10), {
1733
1813
  ind: n
1734
1814
  } = t;
1735
1815
  if (!n || n.type === "none")
1736
1816
  return null;
1737
1817
  if (n.type === "icon") {
1738
1818
  let i;
1739
- e[0] !== n.icon ? (i = Eo(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1819
+ e[0] !== n.icon ? (i = Oo(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1740
1820
  const l = i;
1741
1821
  let a;
1742
- return e[2] !== l ? (a = /* @__PURE__ */ c(he.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ c(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
1822
+ return e[2] !== l ? (a = /* @__PURE__ */ u(ge.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ u(ze, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ u(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = a) : a = e[3], a;
1743
1823
  }
1744
- let s;
1745
- e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ c(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
1746
1824
  let o;
1747
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ c(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = o) : o = e[7];
1825
+ e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ u(Ee.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
1826
+ let s;
1827
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ u(Ee.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = s) : s = e[7];
1748
1828
  let r;
1749
- return e[8] !== s ? (r = /* @__PURE__ */ c(he.Indicator, { children: /* @__PURE__ */ k(Ee.Root, { boxSize: "full", children: [
1750
- s,
1751
- o
1752
- ] }) }), e[8] = s, e[9] = r) : r = e[9], r;
1829
+ return e[8] !== o ? (r = /* @__PURE__ */ u(ge.Indicator, { children: /* @__PURE__ */ k(Ee.Root, { boxSize: "full", children: [
1830
+ o,
1831
+ s
1832
+ ] }) }), e[8] = o, e[9] = r) : r = e[9], r;
1753
1833
  }
1754
- function Kr(t) {
1755
- const e = A(5), {
1834
+ function ei(t) {
1835
+ const e = C(5), {
1756
1836
  code: n,
1757
- language: s
1758
- } = t, o = s ? `${s} code block` : "code block";
1837
+ language: o
1838
+ } = t, s = o ? `${o} code block` : "code block";
1759
1839
  let r;
1760
- e[0] !== n ? (r = /* @__PURE__ */ c(P, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1840
+ e[0] !== n ? (r = /* @__PURE__ */ u(D, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1761
1841
  let i;
1762
- return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ c(Ye, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ c(P, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
1842
+ return e[2] !== s || e[3] !== r ? (i = /* @__PURE__ */ u(tt, { background: "bg.code", color: "fg.muted", borderWidth: "1px", borderColor: "border.subtle", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ u(D, { as: "pre", padding: "sm", textStyle: "mono/XS", whiteSpace: "pre", "aria-label": s, children: r }) }), e[2] = s, e[3] = r, e[4] = i) : i = e[4], i;
1763
1843
  }
1764
- function Xr(t) {
1765
- const e = A(38), {
1844
+ function ti(t) {
1845
+ const e = C(38), {
1766
1846
  b: n,
1767
- onOpenFile: s
1847
+ onOpenFile: o
1768
1848
  } = t;
1769
1849
  switch (n.type) {
1770
1850
  case "comment": {
1771
- let o;
1772
- e[0] !== n.text ? (o = /* @__PURE__ */ c(Y.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1851
+ let s;
1852
+ e[0] !== n.text ? (s = /* @__PURE__ */ u(se.Body, { children: n.text }), e[0] = n.text, e[1] = s) : s = e[1];
1773
1853
  let r;
1774
- e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ c(Y.Footer, { children: /* @__PURE__ */ k(Oe, { children: [
1854
+ e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ u(se.Footer, { children: /* @__PURE__ */ k(Qe, { children: [
1775
1855
  "👏 ",
1776
1856
  n.reactions.clap
1777
1857
  ] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
1778
1858
  let i;
1779
- return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ k(Y.Root, { children: [
1780
- o,
1859
+ return e[4] !== s || e[5] !== r ? (i = /* @__PURE__ */ k(se.Root, { children: [
1860
+ s,
1781
1861
  r
1782
- ] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
1862
+ ] }), e[4] = s, e[5] = r, e[6] = i) : i = e[6], i;
1783
1863
  }
1784
1864
  case "code": {
1785
- let o;
1786
- return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(Kr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1865
+ let s;
1866
+ return e[7] !== n.code || e[8] !== n.language ? (s = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", children: /* @__PURE__ */ u(se.Body, { padding: "0", children: /* @__PURE__ */ u(ei, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = s) : s = e[9], s;
1787
1867
  }
1788
1868
  case "diff": {
1789
- const o = n.sideBySide ?? !1;
1869
+ const s = n.sideBySide ?? !1;
1790
1870
  let r;
1791
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", children: /* @__PURE__ */ c(Y.Body, { padding: "0", children: /* @__PURE__ */ c(P, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ c(Is, { 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] = r) : r = e[14], r;
1871
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== s ? (r = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", children: /* @__PURE__ */ u(se.Body, { padding: "0", children: /* @__PURE__ */ u(D, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ u(Ms, { original: n.original, modified: n.modified, language: n.language, sideBySide: s, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = s, e[14] = r) : r = e[14], r;
1792
1872
  }
1793
1873
  case "text": {
1794
- let o;
1795
- return e[15] !== n.text ? (o = /* @__PURE__ */ c(Y.Root, { background: "transparent", children: /* @__PURE__ */ c(Y.Body, { padding: "sm", children: /* @__PURE__ */ c(U, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1874
+ let s;
1875
+ return e[15] !== n.text ? (s = /* @__PURE__ */ u(se.Root, { background: "transparent", children: /* @__PURE__ */ u(se.Body, { padding: "sm", children: /* @__PURE__ */ u(U, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = s) : s = e[16], s;
1796
1876
  }
1797
1877
  case "todo-list": {
1798
- let o;
1799
- return e[17] !== n.items ? (o = /* @__PURE__ */ c(Ys, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
1878
+ let s;
1879
+ return e[17] !== n.items ? (s = /* @__PURE__ */ u(eo, { items: n.items }), e[17] = n.items, e[18] = s) : s = e[18], s;
1800
1880
  }
1801
1881
  case "question-form": {
1802
- let o;
1803
- return e[19] !== n.questions ? (o = /* @__PURE__ */ c(un, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
1882
+ let s;
1883
+ return e[19] !== n.questions ? (s = /* @__PURE__ */ u(fn, { questions: n.questions }), e[19] = n.questions, e[20] = s) : s = e[20], s;
1804
1884
  }
1805
1885
  case "references": {
1806
- let o;
1807
- e[21] !== n.references ? (o = n.references.map(Gr), e[21] = n.references, e[22] = o) : o = e[22];
1886
+ let s;
1887
+ e[21] !== n.references ? (s = n.references.map(ni), e[21] = n.references, e[22] = s) : s = e[22];
1808
1888
  let r;
1809
- return e[23] !== o ? (r = /* @__PURE__ */ c(j, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
1889
+ return e[23] !== s ? (r = /* @__PURE__ */ u(X, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: s }), e[23] = s, e[24] = r) : r = e[24], r;
1810
1890
  }
1811
1891
  case "image": {
1812
1892
  if (!n.src.trim())
1813
1893
  return null;
1814
- let o;
1815
- e[25] !== n.alt || e[26] !== n.src ? (o = /* @__PURE__ */ c(Zt, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = o) : o = e[27];
1894
+ let s;
1895
+ e[25] !== n.alt || e[26] !== n.src ? (s = /* @__PURE__ */ u(tn, { src: n.src, alt: n.alt, maxH: "18rem", maxW: "full", objectFit: "contain", borderRadius: "sm", borderWidth: "1px", borderColor: "border.subtle" }), e[25] = n.alt, e[26] = n.src, e[27] = s) : s = e[27];
1816
1896
  let r;
1817
- e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ c(U, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
1897
+ e[28] !== n.caption ? (r = n.caption ? /* @__PURE__ */ u(U, { mt: "2xs", textStyle: "label/XS/regular", color: "fg.muted", children: n.caption }) : null, e[28] = n.caption, e[29] = r) : r = e[29];
1818
1898
  let i;
1819
- return e[30] !== o || e[31] !== r ? (i = /* @__PURE__ */ c(Y.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ k(Y.Body, { padding: "0", children: [
1820
- o,
1899
+ return e[30] !== s || e[31] !== r ? (i = /* @__PURE__ */ u(se.Root, { border: "0", padding: "0", background: "transparent", children: /* @__PURE__ */ k(se.Body, { padding: "0", children: [
1900
+ s,
1821
1901
  r
1822
- ] }) }), e[30] = o, e[31] = r, e[32] = i) : i = e[32], i;
1902
+ ] }) }), e[30] = s, e[31] = r, e[32] = i) : i = e[32], i;
1823
1903
  }
1824
1904
  case "component": {
1825
- let o;
1826
- e[33] !== n || e[34] !== s ? (o = n.render({
1827
- onOpenFile: s
1828
- }), e[33] = n, e[34] = s, e[35] = o) : o = e[35];
1905
+ let s;
1906
+ e[33] !== n || e[34] !== o ? (s = n.render({
1907
+ onOpenFile: o
1908
+ }), e[33] = n, e[34] = o, e[35] = s) : s = e[35];
1829
1909
  let r;
1830
- return e[36] !== o ? (r = /* @__PURE__ */ c(At, { children: o }), e[36] = o, e[37] = r) : r = e[37], r;
1910
+ return e[36] !== s ? (r = /* @__PURE__ */ u(It, { children: s }), e[36] = s, e[37] = r) : r = e[37], r;
1831
1911
  }
1832
1912
  }
1833
1913
  }
1834
- function Gr(t) {
1835
- return /* @__PURE__ */ c(It, { fileName: t }, t);
1914
+ function ni(t) {
1915
+ return /* @__PURE__ */ u(Mt, { fileName: t }, t);
1836
1916
  }
1837
- function Yr(t) {
1838
- const e = A(23), {
1917
+ function si(t) {
1918
+ const e = C(23), {
1839
1919
  item: n,
1840
- itemKey: s,
1841
- isOpen: o,
1920
+ itemKey: o,
1921
+ isOpen: s,
1842
1922
  canExpand: r,
1843
1923
  hasBlocks: i,
1844
1924
  onToggle: l,
1845
1925
  onOpenFile: a
1846
1926
  } = t;
1847
- let u;
1848
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(he.Separator, {}), e[0] = u) : u = e[0];
1927
+ let c;
1928
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(ge.Separator, {}), e[0] = c) : c = e[0];
1849
1929
  let d;
1850
- e[1] !== n.indicator ? (d = /* @__PURE__ */ k(he.Connector, { children: [
1851
- u,
1852
- /* @__PURE__ */ c(jr, { ind: n.indicator })
1930
+ e[1] !== n.indicator ? (d = /* @__PURE__ */ k(ge.Connector, { children: [
1931
+ c,
1932
+ /* @__PURE__ */ u(Zr, { ind: n.indicator })
1853
1933
  ] }), e[1] = n.indicator, e[2] = d) : d = e[2];
1854
- const f = o ? "auto" : "20px";
1855
- let p;
1856
- e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== a || e[8] !== l ? (p = n.title.length > 0 && /* @__PURE__ */ c(he.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k($e, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
1857
- /* @__PURE__ */ c($e, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, x) => /* @__PURE__ */ c(Ur, { seg: b, isClickable: r, onOpenFile: a }, x)) }),
1858
- r ? /* @__PURE__ */ c($e, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
1859
- color: "fg"
1860
- }, children: /* @__PURE__ */ c(ps, { size: 12 }) }) : null
1861
- ] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = a, e[8] = l, e[9] = p) : p = e[9];
1934
+ const f = s ? "auto" : "20px";
1862
1935
  let m;
1863
- e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== a ? (m = i ? /* @__PURE__ */ c(P, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ c(P, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, x) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Xr, { b, onOpenFile: a }) }, x)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = a, e[14] = m) : m = e[14];
1936
+ e[3] !== r || e[4] !== s || e[5] !== n.title || e[6] !== o || e[7] !== a || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ u(ge.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", minW: "0", width: "full", overflow: "hidden", cursor: r ? "pointer" : "default", onClick: r ? () => l(o) : void 0, children: /* @__PURE__ */ k(ze, { display: "flex", alignItems: "center", gap: "sm", flexWrap: "nowrap", minW: "0", width: "full", children: [
1937
+ /* @__PURE__ */ u(ze, { display: "flex", alignItems: "center", gap: "xs", flexWrap: "nowrap", minW: "0", flex: "1", overflow: "hidden", children: n.title.map((b, y) => /* @__PURE__ */ u(Jr, { seg: b, isClickable: r, onOpenFile: a }, y)) }),
1938
+ r ? /* @__PURE__ */ u(ze, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: s ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", flexShrink: "0", _groupHover: {
1939
+ color: "fg"
1940
+ }, children: /* @__PURE__ */ u(gs, { size: 12 }) }) : null
1941
+ ] }) }), e[3] = r, e[4] = s, e[5] = n.title, e[6] = o, e[7] = a, e[8] = l, e[9] = m) : m = e[9];
1942
+ let p;
1943
+ e[10] !== i || e[11] !== s || e[12] !== n.blocks || e[13] !== a ? (p = i ? /* @__PURE__ */ u(D, { display: "grid", gridTemplateRows: s ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: s ? /* @__PURE__ */ u(D, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, y) => /* @__PURE__ */ u(D, { children: /* @__PURE__ */ u(ti, { b, onOpenFile: a }) }, y)) }) : null }) : null, e[10] = i, e[11] = s, e[12] = n.blocks, e[13] = a, e[14] = p) : p = e[14];
1864
1944
  let h;
1865
- e[15] !== f || e[16] !== p || e[17] !== m ? (h = /* @__PURE__ */ k(he.Content, { h: f, children: [
1866
- p,
1867
- m
1868
- ] }), e[15] = f, e[16] = p, e[17] = m, e[18] = h) : h = e[18];
1945
+ e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ k(ge.Content, { h: f, children: [
1946
+ m,
1947
+ p
1948
+ ] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
1869
1949
  let g;
1870
- return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(he.Item, { gap: "xs", children: [
1950
+ return e[19] !== o || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(ge.Item, { gap: "xs", children: [
1871
1951
  d,
1872
1952
  h
1873
- ] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1953
+ ] }, o), e[19] = o, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1874
1954
  }
1875
- function Jr(t) {
1876
- const e = A(11), {
1955
+ function oi(t) {
1956
+ const e = C(11), {
1877
1957
  data: n,
1878
- onOpenFile: s
1958
+ onOpenFile: o
1879
1959
  } = t;
1880
- let o;
1881
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1882
- const [r, i] = V(o), l = Zr;
1960
+ let s;
1961
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {}, e[0] = s) : s = e[0];
1962
+ const [r, i] = W(s), l = ri;
1883
1963
  let a;
1884
- e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (p) => {
1885
- i((m) => ({
1886
- ...m,
1887
- [p]: !m[p]
1964
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (m) => {
1965
+ i((p) => ({
1966
+ ...p,
1967
+ [m]: !p[m]
1888
1968
  }));
1889
1969
  }, e[1] = a) : a = e[1];
1890
- const u = a;
1970
+ const c = a;
1891
1971
  let d;
1892
- if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
1893
- let p;
1894
- e[6] !== r || e[7] !== s ? (p = (m, h) => {
1895
- const g = l(m, h), b = (m.blocks?.length ?? 0) > 0, x = (m.expandable ?? !0) && b, y = x ? r[g] ?? !1 : b;
1896
- return /* @__PURE__ */ c(Yr, { item: m, itemKey: g, isOpen: y, canExpand: x, hasBlocks: b, onToggle: u, onOpenFile: s }, g);
1897
- }, e[6] = r, e[7] = s, e[8] = p) : p = e[8], d = n.items.map(p), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
1972
+ if (e[2] !== n.items || e[3] !== r || e[4] !== o) {
1973
+ let m;
1974
+ e[6] !== r || e[7] !== o ? (m = (p, h) => {
1975
+ const g = l(p, h), b = (p.blocks?.length ?? 0) > 0, y = (p.expandable ?? !0) && b, x = y ? r[g] ?? !1 : b;
1976
+ return /* @__PURE__ */ u(si, { item: p, itemKey: g, isOpen: x, canExpand: y, hasBlocks: b, onToggle: c, onOpenFile: o }, g);
1977
+ }, e[6] = r, e[7] = o, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = o, e[5] = d;
1898
1978
  } else
1899
1979
  d = e[5];
1900
1980
  let f;
1901
- return e[9] !== d ? (f = /* @__PURE__ */ c(he.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1981
+ return e[9] !== d ? (f = /* @__PURE__ */ u(ge.Root, { variant: "tool", children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1902
1982
  }
1903
- function Zr(t, e) {
1983
+ function ri(t, e) {
1904
1984
  return t.id ? `id:${t.id}` : `idx:${e}`;
1905
1985
  }
1906
- const ei = (t) => Je(t.tool ?? "").replace(/_/g, "") === "question", ti = (t) => {
1986
+ const ii = (t) => nt(t.tool ?? "").replace(/_/g, "") === "question", li = (t) => {
1907
1987
  const e = t.state?.output;
1908
1988
  return typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : e && typeof e == "object" ? Object.keys(e).length > 0 : e != null;
1909
1989
  };
1910
- function ni(t) {
1911
- const e = A(8), {
1990
+ function ai(t) {
1991
+ const e = C(8), {
1912
1992
  invocations: n,
1913
- labeledBlocks: s,
1914
- hideQuestionForms: o,
1993
+ labeledBlocks: o,
1994
+ hideQuestionForms: s,
1915
1995
  onOpenFile: r
1916
- } = t, i = o === void 0 ? !1 : o;
1996
+ } = t, i = s === void 0 ? !1 : s;
1917
1997
  let l, a;
1918
- if (e[0] !== i || e[1] !== n || e[2] !== s) {
1998
+ if (e[0] !== i || e[1] !== n || e[2] !== o) {
1919
1999
  a = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1920
2000
  e: {
1921
- const f = i ? n.filter(si) : n;
2001
+ const f = i ? n.filter(ci) : n;
1922
2002
  if (f.length === 0) {
1923
2003
  a = null;
1924
2004
  break e;
1925
2005
  }
1926
- l = Qr(f, {
1927
- labeledBlocks: s
2006
+ l = Ur(f, {
2007
+ labeledBlocks: o
1928
2008
  });
1929
2009
  }
1930
- e[0] = i, e[1] = n, e[2] = s, e[3] = l, e[4] = a;
2010
+ e[0] = i, e[1] = n, e[2] = o, e[3] = l, e[4] = a;
1931
2011
  } else
1932
2012
  l = e[3], a = e[4];
1933
2013
  if (a !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1934
2014
  return a;
1935
- const u = l;
2015
+ const c = l;
1936
2016
  let d;
1937
- return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ c(Jr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
2017
+ return e[5] !== c || e[6] !== r ? (d = /* @__PURE__ */ u(oi, { data: c, onOpenFile: r }), e[5] = c, e[6] = r, e[7] = d) : d = e[7], d;
1938
2018
  }
1939
- function si(t) {
1940
- return !ei(t) || ti(t);
2019
+ function ci(t) {
2020
+ return !ii(t) || li(t);
1941
2021
  }
1942
- const oi = (t) => t.type === "tool", Et = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", ri = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, ii = (t) => t.mediaType?.startsWith("image/") || ri.test(Et(t)), li = (t) => ii(t) ? /* @__PURE__ */ c(Zt, { src: t.url, alt: `${Et(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, ai = (t, e) => {
2022
+ const ui = (t) => t.type === "tool", Ft = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", di = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, fi = (t) => t.mediaType?.startsWith("image/") || di.test(Ft(t)), pi = (t) => fi(t) ? /* @__PURE__ */ u(tn, { src: t.url, alt: `${Ft(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, mi = (t, e) => {
1943
2023
  if (e) {
1944
2024
  e(t.url);
1945
2025
  return;
1946
2026
  }
1947
2027
  typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
1948
- }, ci = (t) => {
2028
+ }, hi = (t) => {
1949
2029
  if (t.message && t.message.trim().length > 0)
1950
2030
  return t.message;
1951
2031
  const {
@@ -1961,737 +2041,743 @@ const oi = (t) => t.type === "tool", Et = (t) => t.filename ?? t.url.split("/").
1961
2041
  default:
1962
2042
  return "An error occurred.";
1963
2043
  }
1964
- }, ui = {
2044
+ }, gi = {
1965
2045
  info: "blue",
1966
2046
  warning: "orange",
1967
2047
  error: "red",
1968
2048
  success: "green",
1969
2049
  loading: "blue"
1970
- }, di = (t, e) => {
2050
+ }, bi = (t, e) => {
1971
2051
  const n = [];
1972
- let s = e;
1973
- for (; s < t.length; ) {
1974
- const o = t[s];
1975
- if (!oi(o)) break;
1976
- n.push(o), s += 1;
2052
+ let o = e;
2053
+ for (; o < t.length; ) {
2054
+ const s = t[o];
2055
+ if (!ui(s)) break;
2056
+ n.push(s), o += 1;
1977
2057
  }
1978
2058
  return {
1979
2059
  invocations: n,
1980
- nextIndex: s - 1
2060
+ nextIndex: o - 1
1981
2061
  };
1982
2062
  };
1983
- function Mn(t) {
1984
- const e = A(8), {
2063
+ function Dn(t) {
2064
+ const e = C(8), {
1985
2065
  message: n,
1986
- hideQuestionForms: s,
1987
- onOpenFile: o,
2066
+ hideQuestionForms: o,
2067
+ onOpenFile: s,
1988
2068
  toolInvocationTimeline: r
1989
- } = t, i = s === void 0 ? !1 : s, l = r ?? ni;
2069
+ } = t, i = o === void 0 ? !1 : o, l = r ?? ai;
1990
2070
  let a;
1991
2071
  e[0] !== n.parts ? (a = n.parts ?? [], e[0] = n.parts, e[1] = a) : a = e[1];
1992
- const u = a;
2072
+ const c = a;
1993
2073
  let d;
1994
- if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
2074
+ if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== s || e[6] !== c) {
1995
2075
  const f = [];
1996
- for (let p = 0; p < u.length; p = p + 1, p) {
1997
- const m = u[p], h = `${n.id}-${p}`;
1998
- e: switch (m.type) {
2076
+ for (let m = 0; m < c.length; m = m + 1, m) {
2077
+ const p = c[m], h = `${n.id}-${m}`;
2078
+ e: switch (p.type) {
1999
2079
  case "text": {
2000
- f.push(/* @__PURE__ */ c("div", { children: /* @__PURE__ */ c(Ro, { children: m.text }) }, h));
2080
+ f.push(/* @__PURE__ */ u("div", { children: /* @__PURE__ */ u(Bo, { children: p.text }) }, h));
2001
2081
  break e;
2002
2082
  }
2003
2083
  case "reasoning": {
2004
- f.push(/* @__PURE__ */ c(P, { padding: "0", css: {
2084
+ f.push(/* @__PURE__ */ u(D, { padding: "0", css: {
2005
2085
  "& .rich-text, & .rich-text *": {
2006
2086
  color: "fg.subtle !important",
2007
2087
  fontSize: ".75rem !important",
2008
2088
  fontWeight: "normal !important"
2009
2089
  }
2010
- }, children: /* @__PURE__ */ c(rn, { defaultState: m.text, fullWidth: !0 }) }, h));
2090
+ }, children: /* @__PURE__ */ u(an, { defaultState: p.text, fullWidth: !0 }) }, h));
2011
2091
  break e;
2012
2092
  }
2013
2093
  case "tool": {
2014
2094
  const {
2015
2095
  invocations: g,
2016
2096
  nextIndex: b
2017
- } = di(u, p);
2018
- p = b, f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
2097
+ } = bi(c, m);
2098
+ m = b, f.push(/* @__PURE__ */ u(D, { width: "full", children: /* @__PURE__ */ u(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: s }) }, h));
2019
2099
  break e;
2020
2100
  }
2021
2101
  case "file": {
2022
- f.push(/* @__PURE__ */ c(P, { width: "fit-content", children: /* @__PURE__ */ c(It, { fileName: Et(m), size: "sm", tone: "neutral", icon: li(m), onSelect: () => ai(m, o) }) }, h));
2102
+ f.push(/* @__PURE__ */ u(D, { width: "fit-content", children: /* @__PURE__ */ u(Mt, { fileName: Ft(p), size: "sm", tone: "neutral", icon: pi(p), onSelect: () => mi(p, s) }) }, h));
2023
2103
  break e;
2024
2104
  }
2025
2105
  case "error": {
2026
- f.push(/* @__PURE__ */ c(P, { py: "2", width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: "error", colorPalette: "red", title: ci(m), size: "sm" }) }, h));
2106
+ f.push(/* @__PURE__ */ u(D, { py: "2", width: "full", children: /* @__PURE__ */ u($t, { borderRadius: "xs", status: "error", colorPalette: "red", title: hi(p), size: "sm" }) }, h));
2027
2107
  break e;
2028
2108
  }
2029
2109
  case "token_usage":
2030
2110
  break e;
2031
2111
  case "alert": {
2032
- f.push(/* @__PURE__ */ c(P, { width: "full", children: /* @__PURE__ */ c(Ft, { borderRadius: "xs", status: m.status === "loading" ? "info" : m.status, colorPalette: ui[m.status], title: m.title, icon: m.status === "loading" ? /* @__PURE__ */ c(kt, { size: "sm" }) : void 0, size: "sm", children: m.message }) }, h));
2112
+ f.push(/* @__PURE__ */ u(D, { width: "full", children: /* @__PURE__ */ u($t, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: gi[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ u(_t, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
2033
2113
  break e;
2034
2114
  }
2035
2115
  default:
2036
2116
  f.push(null);
2037
2117
  }
2038
2118
  }
2039
- d = /* @__PURE__ */ c(At, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
2119
+ d = /* @__PURE__ */ u(It, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = s, e[6] = c, e[7] = d;
2040
2120
  } else
2041
2121
  d = e[7];
2042
2122
  return d;
2043
2123
  }
2044
- const fi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Pn = (t) => t.text.trim().length > 0, pi = (t) => t.title.trim().length > 0 || !!t.message?.trim(), mi = (t) => {
2124
+ const yi = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Bn = (t) => t.text.trim().length > 0, xi = (t) => t.title.trim().length > 0 || !!t.message?.trim(), Si = (t) => {
2045
2125
  switch (t.type) {
2046
2126
  case "text":
2047
2127
  case "reasoning":
2048
- return Pn(t);
2128
+ return Bn(t);
2049
2129
  case "tool":
2050
2130
  case "file":
2051
2131
  case "error":
2052
2132
  return !0;
2053
2133
  case "alert":
2054
- return pi(t);
2134
+ return xi(t);
2055
2135
  default:
2056
2136
  return !1;
2057
2137
  }
2058
- }, hi = (t) => t.type === "reasoning" || t.type === "tool", gi = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(hi), bi = (t) => {
2138
+ }, wi = (t) => t.type === "reasoning" || t.type === "tool", Ti = (t) => t.role === "user" || t.parts.length === 0 ? !1 : t.parts.every(wi), Ai = (t) => {
2059
2139
  if (t.length === 0) return null;
2060
2140
  const [e, ...n] = t;
2061
2141
  return e ? {
2062
2142
  ...e,
2063
2143
  role: "assistant",
2064
- parts: t.flatMap((s) => s.parts),
2144
+ parts: t.flatMap((o) => o.parts),
2065
2145
  modelId: n.at(-1)?.modelId ?? e.modelId,
2066
2146
  providerId: n.at(-1)?.providerId ?? e.providerId
2067
2147
  } : null;
2068
- }, yi = (t, e = {}) => {
2148
+ }, Ci = (t, e = {}) => {
2069
2149
  const n = [];
2070
- let s = [];
2071
- const o = () => {
2072
- s = [];
2150
+ let o = [];
2151
+ const s = () => {
2152
+ o = [];
2073
2153
  };
2074
2154
  for (const r of t) {
2075
- const i = (r.parts ?? []).filter(mi);
2155
+ const i = (r.parts ?? []).filter(Si);
2076
2156
  if (i.length === 0) continue;
2077
2157
  const l = {
2078
2158
  ...r,
2079
2159
  parts: i
2080
2160
  };
2081
2161
  if (l.role === "user") {
2082
- o(), n.push(l);
2162
+ s(), n.push(l);
2083
2163
  continue;
2084
2164
  }
2085
- if (gi(l)) {
2086
- s.push(l);
2165
+ if (Ti(l)) {
2166
+ o.push(l);
2087
2167
  continue;
2088
2168
  }
2089
- if (s.length > 0) {
2169
+ if (o.length > 0) {
2090
2170
  n.push({
2091
2171
  ...l,
2092
- parts: [...s.flatMap((a) => a.parts), ...l.parts]
2093
- }), o();
2172
+ parts: [...o.flatMap((a) => a.parts), ...l.parts]
2173
+ }), s();
2094
2174
  continue;
2095
2175
  }
2096
2176
  n.push(l);
2097
2177
  }
2098
- if (e.streaming && s.length > 0) {
2099
- const r = bi(s);
2178
+ if (e.streaming && o.length > 0) {
2179
+ const r = Ai(o);
2100
2180
  r && n.push(r);
2101
2181
  }
2102
2182
  return n;
2103
- }, En = (t) => {
2183
+ }, Fn = (t) => {
2104
2184
  const e = t.at(-1);
2105
- return e?.role !== "assistant" ? null : e.parts.some((s) => s.type === "text" && Pn(s)) ? e.id : null;
2106
- }, xi = (t) => {
2185
+ return e?.role !== "assistant" ? null : e.parts.some((o) => o.type === "text" && Bn(o)) ? e.id : null;
2186
+ }, ki = (t) => {
2107
2187
  const e = [], n = [];
2108
- for (const s of t)
2109
- s.role === "user" ? e.push({
2110
- userMessage: s,
2188
+ for (const o of t)
2189
+ o.role === "user" ? e.push({
2190
+ userMessage: o,
2111
2191
  responses: []
2112
- }) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
2192
+ }) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
2113
2193
  return {
2114
2194
  groups: e,
2115
2195
  leadingResponses: n
2116
2196
  };
2117
- }, Dn = (t) => {
2118
- const e = A(18), {
2197
+ }, Ln = (t) => {
2198
+ const e = C(18), {
2119
2199
  message: n,
2120
- streaming: s,
2121
- hideQuestionForms: o,
2200
+ streaming: o,
2201
+ hideQuestionForms: s,
2122
2202
  animate: r,
2123
2203
  showAssistantActions: i
2124
- } = t, l = o === void 0 ? !1 : o, a = r === void 0 ? !1 : r;
2125
- let u;
2126
- e[0] !== n.role ? (u = fi(n.role), e[0] = n.role, e[1] = u) : u = e[1];
2127
- const d = u, f = d === "user" || d === "assistant" && i, p = a ? fn : void 0;
2128
- let m;
2129
- e[2] !== l || e[3] !== n || e[4] !== s ? (m = /* @__PURE__ */ c(Mn, { message: n, streaming: s, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = s, e[5] = m) : m = e[5];
2204
+ } = t, l = s === void 0 ? !1 : s, a = r === void 0 ? !1 : r;
2205
+ let c;
2206
+ e[0] !== n.role ? (c = yi(n.role), e[0] = n.role, e[1] = c) : c = e[1];
2207
+ const d = c, f = d === "user" || d === "assistant" && i, m = a ? hn : void 0;
2208
+ let p;
2209
+ e[2] !== l || e[3] !== n || e[4] !== o ? (p = /* @__PURE__ */ u(Dn, { message: n, streaming: o, hideQuestionForms: l }), e[2] = l, e[3] = n, e[4] = o, e[5] = p) : p = e[5];
2130
2210
  let h;
2131
- e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ c(xt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
2211
+ e[6] !== d || e[7] !== n || e[8] !== f ? (h = f ? /* @__PURE__ */ u(Tt, { message: n, alwaysVisible: d === "user", copyAlwaysVisible: d !== "user" }) : null, e[6] = d, e[7] = n, e[8] = f, e[9] = h) : h = e[9];
2132
2212
  let g;
2133
- e[10] !== d || e[11] !== m || e[12] !== h ? (g = /* @__PURE__ */ k(ge.Content, { from: d, children: [
2134
- m,
2213
+ e[10] !== d || e[11] !== p || e[12] !== h ? (g = /* @__PURE__ */ k(be.Content, { from: d, children: [
2214
+ p,
2135
2215
  h
2136
- ] }), e[10] = d, e[11] = m, e[12] = h, e[13] = g) : g = e[13];
2216
+ ] }), e[10] = d, e[11] = p, e[12] = h, e[13] = g) : g = e[13];
2137
2217
  let b;
2138
- return e[14] !== d || e[15] !== p || e[16] !== g ? (b = /* @__PURE__ */ c(ge.Root, { from: d, ...p, children: g }), e[14] = d, e[15] = p, e[16] = g, e[17] = b) : b = e[17], b;
2139
- }, Si = (t) => {
2140
- const e = A(7), {
2218
+ return e[14] !== d || e[15] !== m || e[16] !== g ? (b = /* @__PURE__ */ u(be.Root, { from: d, ...m, children: g }), e[14] = d, e[15] = m, e[16] = g, e[17] = b) : b = e[17], b;
2219
+ }, Ii = (t) => {
2220
+ const e = C(7), {
2141
2221
  label: n,
2142
- onClick: s,
2143
- actionPanel: o
2144
- } = t, r = o ? "space-between" : "flex-end";
2222
+ onClick: o,
2223
+ actionPanel: s
2224
+ } = t, r = s ? "space-between" : "flex-end";
2145
2225
  let i;
2146
- e[0] !== n || e[1] !== s ? (i = /* @__PURE__ */ c(Oe, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: s, children: n }), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
2226
+ e[0] !== n || e[1] !== o ? (i = /* @__PURE__ */ u(Qe, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: o, children: n }), e[0] = n, e[1] = o, e[2] = i) : i = e[2];
2147
2227
  let l;
2148
- return e[3] !== o || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(be, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
2149
- o,
2228
+ return e[3] !== s || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(ye, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: r, alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", pointerEvents: "none", children: [
2229
+ s,
2150
2230
  i
2151
- ] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2152
- }, wi = 360, Ti = 4, Ai = "min(10vh, 4rem)", Bn = "min(70dvh, calc(100dvh - 12rem), 22rem)", gt = 1, ki = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
2231
+ ] }), e[3] = s, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2232
+ }, _i = 360, vi = 4, Mi = "min(10vh, 4rem)", $n = "min(70dvh, calc(100dvh - 12rem), 22rem)", xt = 1, Ri = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
2153
2233
  lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
2154
2234
  textLength: e.textLength + n.text.length
2155
2235
  }, {
2156
2236
  lineCount: 0,
2157
2237
  textLength: 0
2158
- }), Ci = (t) => {
2238
+ }), Pi = (t) => {
2159
2239
  if (t.role !== "user") return !1;
2160
2240
  const {
2161
2241
  lineCount: e,
2162
2242
  textLength: n
2163
- } = ki(t);
2164
- return n > wi || e > Ti;
2165
- }, Ii = (t, e) => {
2243
+ } = Ri(t);
2244
+ return n > _i || e > vi;
2245
+ }, Ei = (t, e) => {
2166
2246
  const n = Math.max(0, t.scrollHeight - t.clientHeight);
2167
- return e === 0 || n <= gt ? !1 : e < 0 ? t.scrollTop > gt : t.scrollTop < n - gt;
2168
- }, Fn = 720, _i = 1, Ri = 3, vi = 20, jt = 1, Mi = 4, Ln = 8, Pi = (t, e) => {
2169
- const n = En(t);
2170
- return [...t.map((s) => ({
2247
+ return e === 0 || n <= xt ? !1 : e < 0 ? t.scrollTop > xt : t.scrollTop < n - xt;
2248
+ }, On = 720, Di = 1, Bi = 3, Fi = 20, Xt = 1, Li = 4, zn = 8, $i = (t, e) => {
2249
+ const n = Fn(t);
2250
+ return [...t.map((o) => ({
2171
2251
  type: "leading-response",
2172
- key: s.id,
2173
- message: s,
2174
- showAssistantActions: s.id === n
2175
- })), ...e.map((s, o) => ({
2252
+ key: o.id,
2253
+ message: o,
2254
+ showAssistantActions: o.id === n
2255
+ })), ...e.map((o, s) => ({
2176
2256
  type: "group",
2177
- key: s.userMessage.id,
2178
- group: s,
2179
- groupIndex: o
2257
+ key: o.userMessage.id,
2258
+ group: o,
2259
+ groupIndex: s
2180
2260
  }))];
2181
- }, Ei = (t, e) => {
2261
+ }, Oi = (t, e) => {
2182
2262
  if (t === 0) return 0;
2183
- const n = t * Fn + (t - 1) * Ln;
2263
+ const n = t * On + (t - 1) * zn;
2184
2264
  return Math.max(n - e, 0);
2185
- }, Di = (t) => t?.clientHeight || _i, Bi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= jt && Math.abs(t.totalSize - e.totalSize) <= jt, Fi = (t, e) => ({
2265
+ }, zi = (t) => t?.clientHeight || Di, Qi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= Xt && Math.abs(t.totalSize - e.totalSize) <= Xt, qi = (t, e) => ({
2186
2266
  scrollTop: t?.scrollTop ?? 0,
2187
2267
  totalSize: e
2188
- }), Li = (t) => {
2189
- const e = A(8), {
2268
+ }), Wi = (t) => {
2269
+ const e = C(8), {
2190
2270
  itemCount: n,
2191
- onReady: s,
2192
- scrollRef: o,
2271
+ onReady: o,
2272
+ scrollRef: s,
2193
2273
  totalSize: r
2194
- } = t, i = ie(s);
2274
+ } = t, i = J(o);
2195
2275
  let l, a;
2196
- e[0] !== s ? (l = () => {
2197
- i.current = s;
2198
- }, a = [s], e[0] = s, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), J(l, a);
2199
- let u, d;
2200
- e[3] !== n || e[4] !== o || e[5] !== r ? (u = () => {
2276
+ e[0] !== o ? (l = () => {
2277
+ i.current = o;
2278
+ }, a = [o], e[0] = o, e[1] = l, e[2] = a) : (l = e[1], a = e[2]), Z(l, a);
2279
+ let c, d;
2280
+ e[3] !== n || e[4] !== s || e[5] !== r ? (c = () => {
2201
2281
  if (n === 0 || typeof requestAnimationFrame > "u") {
2202
2282
  i.current?.();
2203
2283
  return;
2204
2284
  }
2205
- let f = 0, p = 0, m = 0, h = null;
2285
+ let f = 0, m = 0, p = 0, h = null;
2206
2286
  const g = () => {
2207
- p = p + 1;
2208
- const b = Fi(o.current, r);
2209
- if (m = h && Bi(b, h) ? m + 1 : 0, h = b, m >= Ri || p >= vi) {
2287
+ m = m + 1;
2288
+ const b = qi(s.current, r);
2289
+ if (p = h && Qi(b, h) ? p + 1 : 0, h = b, p >= Bi || m >= Fi) {
2210
2290
  i.current?.();
2211
2291
  return;
2212
2292
  }
2213
2293
  f = requestAnimationFrame(g);
2214
2294
  };
2215
2295
  return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
2216
- }, d = [n, o, r], e[3] = n, e[4] = o, e[5] = r, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), J(u, d);
2217
- }, $i = (t) => {
2218
- Ii(t.currentTarget, t.deltaY) && t.stopPropagation();
2219
- }, Oi = (t, e) => {
2296
+ }, d = [n, s, r], e[3] = n, e[4] = s, e[5] = r, e[6] = c, e[7] = d) : (c = e[6], d = e[7]), Z(c, d);
2297
+ }, Hi = (t) => {
2298
+ Ei(t.currentTarget, t.deltaY) && t.stopPropagation();
2299
+ }, Ni = (t, e) => {
2220
2300
  if (t)
2221
- return e ? Bn : Ai;
2222
- }, zi = (t) => {
2301
+ return e ? $n : Mi;
2302
+ }, Vi = (t) => {
2223
2303
  if (t)
2224
- return Bn;
2225
- }, Qi = (t) => {
2226
- const e = A(50), {
2304
+ return $n;
2305
+ }, Ui = (t) => {
2306
+ const e = C(50), {
2227
2307
  group: n,
2228
- streaming: s,
2229
- hideQuestionForms: o,
2308
+ streaming: o,
2309
+ hideQuestionForms: s,
2230
2310
  isExpanded: r,
2231
2311
  animate: i,
2232
2312
  onToggleStickyMessage: l
2233
2313
  } = t;
2234
- let a, u, d;
2235
- e[0] !== n.userMessage || e[1] !== r ? (a = Ci(n.userMessage), u = a && r, d = Oi(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = u, e[4] = d) : (a = e[2], u = e[3], d = e[4]);
2314
+ let a, c, d;
2315
+ e[0] !== n.userMessage || e[1] !== r ? (a = Pi(n.userMessage), c = a && r, d = Ni(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = c, e[4] = d) : (a = e[2], c = e[3], d = e[4]);
2236
2316
  const f = d;
2237
- let p;
2238
- e[5] !== n.userMessage.id || e[6] !== l ? (p = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = p) : p = e[7];
2239
- const m = p;
2317
+ let m;
2318
+ e[5] !== n.userMessage.id || e[6] !== l ? (m = () => l(n.userMessage.id), e[5] = n.userMessage.id, e[6] = l, e[7] = m) : m = e[7];
2319
+ const p = m;
2240
2320
  let h;
2241
- e[8] !== n.responses ? (h = En(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
2242
- const g = h, b = i ? fn : void 0, x = a ? "0" : void 0, y = a ? "relative" : void 0, T = a ? r ? "expanded" : "collapsed" : void 0;
2243
- let S;
2244
- e[10] !== u ? (S = zi(u), e[10] = u, e[11] = S) : S = e[11];
2245
- const w = u ? "auto" : "visible", C = a ? "xs" : void 0, _ = a ? "xs" : void 0, R = u ? "3rem" : void 0, L = u ? $i : void 0;
2246
- let E;
2247
- e[12] !== n.userMessage || e[13] !== s ? (E = /* @__PURE__ */ c(Mn, { message: n.userMessage, streaming: s }), e[12] = n.userMessage, e[13] = s, e[14] = E) : E = e[14];
2248
- let Q;
2249
- e[15] !== _ || e[16] !== R || e[17] !== L || e[18] !== E || e[19] !== T || e[20] !== S || e[21] !== w || e[22] !== C ? (Q = /* @__PURE__ */ c(P, { "data-sticky-user-message-content": T, display: "flex", flexDirection: "column", gap: "sm", maxH: S, minH: "0", overflowY: w, px: C, py: _, pb: R, onWheel: L, children: E }), e[15] = _, e[16] = R, e[17] = L, e[18] = E, e[19] = T, e[20] = S, e[21] = w, e[22] = C, e[23] = Q) : Q = e[23];
2321
+ e[8] !== n.responses ? (h = Fn(n.responses), e[8] = n.responses, e[9] = h) : h = e[9];
2322
+ const g = h, b = i ? hn : void 0, y = a ? "0" : void 0, x = a ? "relative" : void 0, S = a ? r ? "expanded" : "collapsed" : void 0;
2323
+ let A;
2324
+ e[10] !== c ? (A = Vi(c), e[10] = c, e[11] = A) : A = e[11];
2325
+ const T = c ? "auto" : "visible", w = a ? "xs" : void 0, I = a ? "xs" : void 0, _ = c ? "3rem" : void 0, P = c ? Hi : void 0;
2250
2326
  let M;
2251
- e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== m ? (M = a ? /* @__PURE__ */ c(Si, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ c(xt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = m, e[28] = M) : M = e[28];
2252
- let D;
2253
- e[29] !== f || e[30] !== Q || e[31] !== M || e[32] !== x || e[33] !== y ? (D = /* @__PURE__ */ k(ge.Content, { from: "user", maxH: f, overflow: "hidden", p: x, position: y, children: [
2254
- Q,
2255
- M
2256
- ] }), e[29] = f, e[30] = Q, e[31] = M, e[32] = x, e[33] = y, e[34] = D) : D = e[34];
2327
+ e[12] !== n.userMessage || e[13] !== o ? (M = /* @__PURE__ */ u(Dn, { message: n.userMessage, streaming: o }), e[12] = n.userMessage, e[13] = o, e[14] = M) : M = e[14];
2328
+ let z;
2329
+ e[15] !== I || e[16] !== _ || e[17] !== P || e[18] !== M || e[19] !== S || e[20] !== A || e[21] !== T || e[22] !== w ? (z = /* @__PURE__ */ u(D, { "data-sticky-user-message-content": S, display: "flex", flexDirection: "column", gap: "sm", maxH: A, minH: "0", overflowY: T, px: w, py: I, pb: _, onWheel: P, children: M }), e[15] = I, e[16] = _, e[17] = P, e[18] = M, e[19] = S, e[20] = A, e[21] = T, e[22] = w, e[23] = z) : z = e[23];
2257
2330
  let B;
2258
- e[35] !== D || e[36] !== b ? (B = /* @__PURE__ */ c(P, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ c(ge.Root, { from: "user", ...b, children: D }) }), e[35] = D, e[36] = b, e[37] = B) : B = e[37];
2259
- let $;
2260
- if (e[38] !== g || e[39] !== n.responses || e[40] !== o || e[41] !== s) {
2261
- let F;
2262
- e[43] !== g || e[44] !== o || e[45] !== s ? (F = (z) => /* @__PURE__ */ c(P, { children: /* @__PURE__ */ c(Dn, { message: z, streaming: s, hideQuestionForms: o, showAssistantActions: z.id === g }) }, z.id), e[43] = g, e[44] = o, e[45] = s, e[46] = F) : F = e[46], $ = n.responses.map(F), e[38] = g, e[39] = n.responses, e[40] = o, e[41] = s, e[42] = $;
2331
+ e[24] !== n.userMessage || e[25] !== a || e[26] !== r || e[27] !== p ? (B = a ? /* @__PURE__ */ u(Ii, { label: r ? "Show less" : "Show more", onClick: p, actionPanel: /* @__PURE__ */ u(Tt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ u(Tt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[24] = n.userMessage, e[25] = a, e[26] = r, e[27] = p, e[28] = B) : B = e[28];
2332
+ let E;
2333
+ e[29] !== f || e[30] !== z || e[31] !== B || e[32] !== y || e[33] !== x ? (E = /* @__PURE__ */ k(be.Content, { from: "user", maxH: f, overflow: "hidden", p: y, position: x, children: [
2334
+ z,
2335
+ B
2336
+ ] }), e[29] = f, e[30] = z, e[31] = B, e[32] = y, e[33] = x, e[34] = E) : E = e[34];
2337
+ let F;
2338
+ e[35] !== E || e[36] !== b ? (F = /* @__PURE__ */ u(D, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ u(be.Root, { from: "user", ...b, children: E }) }), e[35] = E, e[36] = b, e[37] = F) : F = e[37];
2339
+ let L;
2340
+ if (e[38] !== g || e[39] !== n.responses || e[40] !== s || e[41] !== o) {
2341
+ let O;
2342
+ e[43] !== g || e[44] !== s || e[45] !== o ? (O = (H) => /* @__PURE__ */ u(D, { children: /* @__PURE__ */ u(Ln, { message: H, streaming: o, hideQuestionForms: s, showAssistantActions: H.id === g }) }, H.id), e[43] = g, e[44] = s, e[45] = o, e[46] = O) : O = e[46], L = n.responses.map(O), e[38] = g, e[39] = n.responses, e[40] = s, e[41] = o, e[42] = L;
2263
2343
  } else
2264
- $ = e[42];
2265
- let O;
2266
- return e[47] !== B || e[48] !== $ ? (O = /* @__PURE__ */ k(P, { children: [
2267
- B,
2268
- $
2269
- ] }), e[47] = B, e[48] = $, e[49] = O) : O = e[49], O;
2270
- }, qi = (t, e) => {
2344
+ L = e[42];
2345
+ let $;
2346
+ return e[47] !== F || e[48] !== L ? ($ = /* @__PURE__ */ k(D, { children: [
2347
+ F,
2348
+ L
2349
+ ] }), e[47] = F, e[48] = L, e[49] = $) : $ = e[49], $;
2350
+ }, ji = (t, e) => {
2271
2351
  const {
2272
2352
  groups: n,
2273
- streaming: s,
2274
- hideActiveQuestionForms: o,
2353
+ streaming: o,
2354
+ hideActiveQuestionForms: s,
2275
2355
  expandedStickyMessageIds: r,
2276
2356
  animatedItemKeys: i,
2277
2357
  onToggleStickyMessage: l
2278
2358
  } = e;
2279
- return t.type === "leading-response" ? /* @__PURE__ */ c(Dn, { message: t.message, streaming: s, hideQuestionForms: n.length > 0 || o, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ c(Qi, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
2280
- }, Wi = (t) => {
2359
+ return t.type === "leading-response" ? /* @__PURE__ */ u(Ln, { message: t.message, streaming: o, hideQuestionForms: n.length > 0 || s, animate: i.has(t.key), showAssistantActions: t.showAssistantActions }) : /* @__PURE__ */ u(Ui, { group: t.group, streaming: o, hideQuestionForms: t.groupIndex < n.length - 1 || s, isExpanded: r.has(t.group.userMessage.id), animate: i.has(t.key), onToggleStickyMessage: l });
2360
+ }, Ki = (t) => {
2281
2361
  const {
2282
2362
  leadingResponses: e,
2283
2363
  groups: n,
2284
- streaming: s,
2285
- hideActiveQuestionForms: o,
2364
+ streaming: o,
2365
+ hideActiveQuestionForms: s,
2286
2366
  expandedStickyMessageIds: r,
2287
2367
  onToggleStickyMessage: i,
2288
2368
  onReady: l
2289
2369
  } = t, {
2290
2370
  scrollRef: a
2291
- } = Ge(), u = Pi(e, n), d = Ao(u.map((h) => h.key)), f = Di(a.current), p = ks({
2292
- count: u.length,
2371
+ } = et(), c = $i(e, n), d = Mo(c.map((h) => h.key)), f = zi(a.current), m = _s({
2372
+ count: c.length,
2293
2373
  getScrollElement: () => a.current,
2294
- estimateSize: () => Fn,
2295
- getItemKey: (h) => u[h]?.key ?? h,
2296
- overscan: Mi,
2297
- gap: Ln,
2374
+ estimateSize: () => On,
2375
+ getItemKey: (h) => c[h]?.key ?? h,
2376
+ overscan: Li,
2377
+ gap: zn,
2298
2378
  initialRect: {
2299
2379
  width: 0,
2300
2380
  height: f
2301
2381
  },
2302
- initialOffset: () => Ei(u.length, f)
2303
- }), m = p.getTotalSize();
2304
- return Li({
2305
- itemCount: u.length,
2382
+ initialOffset: () => Oi(c.length, f)
2383
+ }), p = m.getTotalSize();
2384
+ return Wi({
2385
+ itemCount: c.length,
2306
2386
  onReady: l,
2307
2387
  scrollRef: a,
2308
- totalSize: m
2309
- }), /* @__PURE__ */ c(P, { px: "xs", children: /* @__PURE__ */ c(P, { position: "relative", width: "100%", style: {
2310
- height: m
2311
- }, children: p.getVirtualItems().map((h) => {
2312
- const g = u[h.index];
2313
- return g ? /* @__PURE__ */ c(P, { ref: p.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2388
+ totalSize: p
2389
+ }), /* @__PURE__ */ u(D, { px: "xs", children: /* @__PURE__ */ u(D, { position: "relative", width: "100%", style: {
2390
+ height: p
2391
+ }, children: m.getVirtualItems().map((h) => {
2392
+ const g = c[h.index];
2393
+ return g ? /* @__PURE__ */ u(D, { ref: m.measureElement, "data-index": h.index, "data-chat-message-list-item": g.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2314
2394
  top: h.start
2315
- }, children: qi(g, {
2395
+ }, children: ji(g, {
2316
2396
  groups: n,
2317
- streaming: s,
2318
- hideActiveQuestionForms: o,
2397
+ streaming: o,
2398
+ hideActiveQuestionForms: s,
2319
2399
  expandedStickyMessageIds: r,
2320
2400
  animatedItemKeys: d,
2321
2401
  onToggleStickyMessage: i
2322
2402
  }) }, h.key) : null;
2323
2403
  }) }) });
2324
- }, Hi = (t) => {
2325
- const e = A(48), {
2404
+ }, Xi = (t = "") => JSON.stringify(As(t)), Gi = (t) => {
2405
+ const e = C(48), {
2326
2406
  item: n,
2327
- index: s,
2328
- isFirst: o,
2407
+ index: o,
2408
+ isFirst: s,
2329
2409
  isLast: r,
2330
2410
  isEditing: i,
2331
2411
  isDragTarget: l,
2332
2412
  onEdit: a,
2333
- onRemove: u,
2413
+ onRemove: c,
2334
2414
  onDragStart: d,
2335
2415
  onDragEnd: f,
2336
- onDragOver: p,
2337
- onDrop: m
2338
- } = t, h = !!a, g = !!u, b = !o || !r, x = `Drag queued follow-up ${s + 1}`, y = o ? "0" : "1px", T = l ? "border.accent-light" : "border.subtle", S = o ? "0" : "2xs", w = i ? "bg.muted" : void 0;
2339
- let C;
2340
- e[0] !== n.id || e[1] !== p ? (C = (H) => p(H, n.id), e[0] = n.id, e[1] = p, e[2] = C) : C = e[2];
2341
- let _;
2342
- e[3] !== n.id || e[4] !== m ? (_ = (H) => m(H, n.id), e[3] = n.id, e[4] = m, e[5] = _) : _ = e[5];
2343
- const R = b ? "grab" : "default", L = !b;
2344
- let E;
2345
- e[6] !== n.id || e[7] !== d ? (E = (H) => {
2346
- H.dataTransfer.effectAllowed = "move", H.dataTransfer.setData("text/plain", n.id), d(n.id);
2347
- }, e[6] = n.id, e[7] = d, e[8] = E) : E = e[8];
2348
- let Q;
2349
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ c(dt, { as: ms, boxSize: "14px" }), e[9] = Q) : Q = e[9];
2416
+ onDragOver: m,
2417
+ onDrop: p
2418
+ } = t, h = !!a, g = !!c, b = !s || !r, y = `Drag queued follow-up ${o + 1}`, x = s ? "0" : "1px", S = l ? "border.accent-light" : "border.subtle", A = s ? "0" : "2xs", T = i ? "bg.muted" : void 0;
2419
+ let w;
2420
+ e[0] !== n.id || e[1] !== m ? (w = (V) => m(V, n.id), e[0] = n.id, e[1] = m, e[2] = w) : w = e[2];
2421
+ let I;
2422
+ e[3] !== n.id || e[4] !== p ? (I = (V) => p(V, n.id), e[3] = n.id, e[4] = p, e[5] = I) : I = e[5];
2423
+ const _ = b ? "grab" : "default", P = !b;
2350
2424
  let M;
2351
- e[10] !== b || e[11] !== x || e[12] !== f || e[13] !== R || e[14] !== L || e[15] !== E ? (M = /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", draggable: b, "aria-label": x, title: x, color: "fg.muted", cursor: R, disabled: L, onDragStart: E, onDragEnd: f, children: Q }), e[10] = b, e[11] = x, e[12] = f, e[13] = R, e[14] = L, e[15] = E, e[16] = M) : M = e[16];
2352
- let D;
2353
- e[17] !== n.prompt ? (D = /* @__PURE__ */ c(U, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = D) : D = e[18];
2425
+ e[6] !== n.id || e[7] !== d ? (M = (V) => {
2426
+ V.dataTransfer.effectAllowed = "move", V.dataTransfer.setData("text/plain", n.id), d(n.id);
2427
+ }, e[6] = n.id, e[7] = d, e[8] = M) : M = e[8];
2428
+ let z;
2429
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = /* @__PURE__ */ u(mt, { as: bs, boxSize: "14px" }), e[9] = z) : z = e[9];
2354
2430
  let B;
2355
- e[19] !== n.attachments ? (B = n.attachments?.length ? /* @__PURE__ */ k(Un, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
2431
+ e[10] !== b || e[11] !== y || e[12] !== f || e[13] !== _ || e[14] !== P || e[15] !== M ? (B = /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", draggable: b, "aria-label": y, title: y, color: "fg.muted", cursor: _, disabled: P, onDragStart: M, onDragEnd: f, children: z }), e[10] = b, e[11] = y, e[12] = f, e[13] = _, e[14] = P, e[15] = M, e[16] = B) : B = e[16];
2432
+ let E;
2433
+ e[17] !== n.prompt ? (E = /* @__PURE__ */ u(U, { textStyle: "label/S/regular", color: "fg", lineClamp: 2, minWidth: "0", children: n.prompt }), e[17] = n.prompt, e[18] = E) : E = e[18];
2434
+ let F;
2435
+ e[19] !== n.attachments ? (F = n.attachments?.length ? /* @__PURE__ */ k(Xn, { width: "fit-content", size: "sm", variant: "outline", colorPalette: "gray", children: [
2356
2436
  n.attachments.length,
2357
2437
  " attachments"
2358
- ] }) : null, e[19] = n.attachments, e[20] = B) : B = e[20];
2438
+ ] }) : null, e[19] = n.attachments, e[20] = F) : F = e[20];
2439
+ let L;
2440
+ e[21] !== E || e[22] !== F ? (L = /* @__PURE__ */ k(X, { gap: "2xs", flex: "1", minWidth: "0", children: [
2441
+ E,
2442
+ F
2443
+ ] }), e[21] = E, e[22] = F, e[23] = L) : L = e[23];
2359
2444
  let $;
2360
- e[21] !== D || e[22] !== B ? ($ = /* @__PURE__ */ k(j, { gap: "2xs", flex: "1", minWidth: "0", children: [
2361
- D,
2362
- B
2363
- ] }), e[21] = D, e[22] = B, e[23] = $) : $ = e[23];
2445
+ e[24] !== h || e[25] !== n || e[26] !== a ? ($ = h ? /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ u(mt, { as: ys, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = $) : $ = e[27];
2364
2446
  let O;
2365
- e[24] !== h || e[25] !== n || e[26] !== a ? (O = h ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Edit queued follow-up", onClick: () => a?.(n), children: /* @__PURE__ */ c(dt, { as: hs, boxSize: "14px" }) }) : null, e[24] = h, e[25] = n, e[26] = a, e[27] = O) : O = e[27];
2366
- let F;
2367
- e[28] !== g || e[29] !== n.id || e[30] !== u ? (F = g ? /* @__PURE__ */ c(Pe, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => u?.(n.id), children: /* @__PURE__ */ c(dt, { as: tn, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = u, e[31] = F) : F = e[31];
2368
- let z;
2369
- e[32] !== O || e[33] !== F ? (z = /* @__PURE__ */ k(Z, { gap: "2xs", flexShrink: 0, children: [
2370
- O,
2371
- F
2372
- ] }), e[32] = O, e[33] = F, e[34] = z) : z = e[34];
2373
- let v;
2374
- e[35] !== M || e[36] !== $ || e[37] !== z ? (v = /* @__PURE__ */ k(Z, { gap: "xs", alignItems: "flex-start", children: [
2375
- M,
2447
+ e[28] !== g || e[29] !== n.id || e[30] !== c ? (O = g ? /* @__PURE__ */ u(Pe, { size: "2xs", variant: "ghost", "aria-label": "Remove queued follow-up", colorPalette: "red", onClick: () => c?.(n.id), children: /* @__PURE__ */ u(mt, { as: sn, boxSize: "14px" }) }) : null, e[28] = g, e[29] = n.id, e[30] = c, e[31] = O) : O = e[31];
2448
+ let H;
2449
+ e[32] !== $ || e[33] !== O ? (H = /* @__PURE__ */ k(oe, { gap: "2xs", flexShrink: 0, children: [
2376
2450
  $,
2377
- z
2378
- ] }), e[35] = M, e[36] = $, e[37] = z, e[38] = v) : v = e[38];
2379
- let W;
2380
- return e[39] !== n.id || e[40] !== y || e[41] !== T || e[42] !== v || e[43] !== S || e[44] !== w || e[45] !== C || e[46] !== _ ? (W = /* @__PURE__ */ c(P, { minWidth: "0", borderTopWidth: y, borderColor: T, paddingTop: S, paddingBottom: "2xs", bg: w, onDragOver: C, onDrop: _, "data-queued-follow-up-id": n.id, children: v }), e[39] = n.id, e[40] = y, e[41] = T, e[42] = v, e[43] = S, e[44] = w, e[45] = C, e[46] = _, e[47] = W) : W = e[47], W;
2381
- }, Vi = (t) => {
2382
- const e = A(24), {
2451
+ O
2452
+ ] }), e[32] = $, e[33] = O, e[34] = H) : H = e[34];
2453
+ let R;
2454
+ e[35] !== B || e[36] !== L || e[37] !== H ? (R = /* @__PURE__ */ k(oe, { gap: "xs", alignItems: "flex-start", children: [
2455
+ B,
2456
+ L,
2457
+ H
2458
+ ] }), e[35] = B, e[36] = L, e[37] = H, e[38] = R) : R = e[38];
2459
+ let q;
2460
+ return e[39] !== n.id || e[40] !== x || e[41] !== S || e[42] !== R || e[43] !== A || e[44] !== T || e[45] !== w || e[46] !== I ? (q = /* @__PURE__ */ u(D, { minWidth: "0", borderTopWidth: x, borderColor: S, paddingTop: A, paddingBottom: "2xs", bg: T, onDragOver: w, onDrop: I, "data-queued-follow-up-id": n.id, children: R }), e[39] = n.id, e[40] = x, e[41] = S, e[42] = R, e[43] = A, e[44] = T, e[45] = w, e[46] = I, e[47] = q) : q = e[47], q;
2461
+ }, Yi = (t) => {
2462
+ const e = C(24), {
2383
2463
  items: n,
2384
- editingItemId: s,
2385
- onEdit: o,
2464
+ editingItemId: o,
2465
+ onEdit: s,
2386
2466
  onRemove: r,
2387
2467
  onMove: i
2388
- } = t, [l, a] = V(null), [u, d] = V(null);
2468
+ } = t, [l, a] = W(null), [c, d] = W(null);
2389
2469
  if (n.length === 0)
2390
2470
  return null;
2391
2471
  let f;
2392
- e[0] !== l ? (f = (x, y) => {
2393
- !l || l === y || (x.preventDefault(), x.dataTransfer.dropEffect = "move", d(y));
2472
+ e[0] !== l ? (f = (y, x) => {
2473
+ !l || l === x || (y.preventDefault(), y.dataTransfer.dropEffect = "move", d(x));
2394
2474
  }, e[0] = l, e[1] = f) : f = e[1];
2395
- const p = f;
2396
- let m;
2397
- e[2] !== l || e[3] !== n || e[4] !== i ? (m = (x, y) => {
2398
- x.preventDefault();
2399
- const T = l ?? x.dataTransfer.getData("text/plain");
2400
- if (a(null), d(null), !T || T === y)
2475
+ const m = f;
2476
+ let p;
2477
+ e[2] !== l || e[3] !== n || e[4] !== i ? (p = (y, x) => {
2478
+ y.preventDefault();
2479
+ const S = l ?? y.dataTransfer.getData("text/plain");
2480
+ if (a(null), d(null), !S || S === x)
2401
2481
  return;
2402
- const S = n.findIndex((_) => _.id === T), w = n.findIndex((_) => _.id === y);
2403
- if (S === -1 || w === -1 || S === w)
2482
+ const A = n.findIndex((I) => I.id === S), T = n.findIndex((I) => I.id === x);
2483
+ if (A === -1 || T === -1 || A === T)
2404
2484
  return;
2405
- const C = w < S ? "up" : "down";
2406
- i?.(T, C, Math.abs(w - S));
2407
- }, e[2] = l, e[3] = n, e[4] = i, e[5] = m) : m = e[5];
2408
- const h = m;
2485
+ const w = T < A ? "up" : "down";
2486
+ i?.(S, w, Math.abs(T - A));
2487
+ }, e[2] = l, e[3] = n, e[4] = i, e[5] = p) : p = e[5];
2488
+ const h = p;
2409
2489
  let g;
2410
- if (e[6] !== u || e[7] !== s || e[8] !== p || e[9] !== h || e[10] !== n || e[11] !== o || e[12] !== r) {
2411
- let x;
2412
- e[14] !== u || e[15] !== s || e[16] !== p || e[17] !== h || e[18] !== n.length || e[19] !== o || e[20] !== r ? (x = (y, T) => /* @__PURE__ */ c(Hi, { item: y, index: T, isFirst: T === 0, isLast: T === n.length - 1, isEditing: s === y.id, isDragTarget: u === y.id, onEdit: o, onRemove: r, onDragStart: a, onDragEnd: () => {
2490
+ if (e[6] !== c || e[7] !== o || e[8] !== m || e[9] !== h || e[10] !== n || e[11] !== s || e[12] !== r) {
2491
+ let y;
2492
+ e[14] !== c || e[15] !== o || e[16] !== m || e[17] !== h || e[18] !== n.length || e[19] !== s || e[20] !== r ? (y = (x, S) => /* @__PURE__ */ u(Gi, { item: x, index: S, isFirst: S === 0, isLast: S === n.length - 1, isEditing: o === x.id, isDragTarget: c === x.id, onEdit: s, onRemove: r, onDragStart: a, onDragEnd: () => {
2413
2493
  a(null), d(null);
2414
- }, onDragOver: p, onDrop: h }, y.id), e[14] = u, e[15] = s, e[16] = p, e[17] = h, e[18] = n.length, e[19] = o, e[20] = r, e[21] = x) : x = e[21], g = n.map(x), e[6] = u, e[7] = s, e[8] = p, e[9] = h, e[10] = n, e[11] = o, e[12] = r, e[13] = g;
2494
+ }, onDragOver: m, onDrop: h }, x.id), e[14] = c, e[15] = o, e[16] = m, e[17] = h, e[18] = n.length, e[19] = s, e[20] = r, e[21] = y) : y = e[21], g = n.map(y), e[6] = c, e[7] = o, e[8] = m, e[9] = h, e[10] = n, e[11] = s, e[12] = r, e[13] = g;
2415
2495
  } else
2416
2496
  g = e[13];
2417
2497
  let b;
2418
- return e[22] !== g ? (b = /* @__PURE__ */ c(j, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
2419
- }, Ni = (t) => {
2420
- const e = Math.max(0, Math.floor(t));
2421
- if (e < 60) return `${e}s`;
2422
- const n = Math.floor(e / 60);
2423
- return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
2424
- }, Ui = (t) => {
2425
- const e = A(9), {
2426
- hidden: n
2427
- } = t, s = n === void 0 ? !1 : n, [o, r] = V(0);
2428
- let i;
2429
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
2430
- const l = ie(i);
2431
- let a, u;
2432
- if (e[1] !== s ? (a = () => {
2433
- if (s)
2434
- return;
2435
- const m = () => r((Date.now() - l.current) / 1e3);
2436
- m();
2437
- const h = setInterval(m, 1e3);
2438
- return () => clearInterval(h);
2439
- }, u = [s], e[1] = s, e[2] = a, e[3] = u) : (a = e[2], u = e[3]), J(a, u), s)
2440
- return null;
2441
- let d;
2442
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
2443
- let f;
2444
- e[5] !== o ? (f = Ni(o), e[5] = o, e[6] = f) : f = e[6];
2445
- let p;
2446
- return e[7] !== f ? (p = /* @__PURE__ */ k(Z, { gap: "2xs", px: "sm", py: "xs", children: [
2447
- d,
2448
- /* @__PURE__ */ c(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
2449
- ] }), e[7] = f, e[8] = p) : p = e[8], p;
2450
- }, ji = (t) => {
2451
- const e = A(19), {
2498
+ return e[22] !== g ? (b = /* @__PURE__ */ u(X, { gap: "2xs", paddingX: "0", paddingY: "xs", borderWidth: "1px", borderBottomWidth: "0", borderColor: "border", borderTopRadius: "xs", background: "bg", children: g }), e[22] = g, e[23] = b) : b = e[23], b;
2499
+ }, Ji = (t) => {
2500
+ const e = C(19), {
2452
2501
  queuedFollowUps: n,
2453
- defaultValue: s,
2454
- onChange: o,
2502
+ defaultValue: o,
2503
+ onChange: s,
2455
2504
  onSubmit: r,
2456
2505
  onUpdate: i
2457
- } = t, [l, a] = V(null), [u, d] = V(""), [f, p] = V(0), m = l ? u : s;
2506
+ } = t, [l, a] = W(null), [c, d] = W(""), [f, m] = W(0), p = l ? c : o;
2458
2507
  let h, g;
2459
2508
  e[0] !== l || e[1] !== n ? (h = () => {
2460
- l && (n.some((R) => R.id === l) || (a(null), d("")));
2461
- }, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), J(h, g);
2509
+ l && (n.some((_) => _.id === l) || (a(null), d("")));
2510
+ }, g = [l, n], e[0] = l, e[1] = n, e[2] = h, e[3] = g) : (h = e[2], g = e[3]), Z(h, g);
2462
2511
  let b;
2463
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (R) => {
2464
- a(R.id), d(R.prompt), p(Xi);
2512
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (b = (_) => {
2513
+ a(_.id), d(_.prompt), m(el);
2465
2514
  }, e[4] = b) : b = e[4];
2466
- const x = b;
2467
- let y;
2468
- e[5] !== l || e[6] !== o ? (y = (R) => {
2469
- l || o?.(R);
2470
- }, e[5] = l, e[6] = o, e[7] = y) : y = e[7];
2471
- const T = y;
2472
- let S;
2473
- e[8] !== l || e[9] !== r || e[10] !== i ? (S = (R, L, E) => {
2515
+ const y = b;
2516
+ let x;
2517
+ e[5] !== l || e[6] !== s ? (x = (_) => {
2518
+ l || s?.(_);
2519
+ }, e[5] = l, e[6] = s, e[7] = x) : x = e[7];
2520
+ const S = x;
2521
+ let A;
2522
+ e[8] !== l || e[9] !== r || e[10] !== i ? (A = (_, P, M) => {
2474
2523
  if (l) {
2475
- i?.(l, R), a(null), d("");
2524
+ i?.(l, _), a(null), d("");
2476
2525
  return;
2477
2526
  }
2478
- return r?.(R, L, E);
2479
- }, e[8] = l, e[9] = r, e[10] = i, e[11] = S) : S = e[11];
2480
- const w = S, C = !!l;
2481
- let _;
2482
- return e[12] !== T || e[13] !== l || e[14] !== f || e[15] !== m || e[16] !== w || e[17] !== C ? (_ = {
2483
- change: T,
2484
- edit: x,
2527
+ return r?.(_, P, M);
2528
+ }, e[8] = l, e[9] = r, e[10] = i, e[11] = A) : A = e[11];
2529
+ const T = A, w = !!l;
2530
+ let I;
2531
+ return e[12] !== S || e[13] !== l || e[14] !== f || e[15] !== p || e[16] !== T || e[17] !== w ? (I = {
2532
+ change: S,
2533
+ edit: y,
2485
2534
  editingItemId: l,
2486
2535
  focusSignal: f,
2487
- inputValue: m,
2488
- isEditing: C,
2489
- submit: w
2490
- }, e[12] = T, e[13] = l, e[14] = f, e[15] = m, e[16] = w, e[17] = C, e[18] = _) : _ = e[18], _;
2491
- }, Ki = (t) => {
2492
- const e = A(44), {
2493
- actions: n,
2494
- attachedResources: s,
2495
- attachmentList: o,
2496
- chatInputAutoFocus: r,
2497
- chatInputPlaceholder: i,
2498
- chatInputQuestionPrompt: l,
2499
- chatInputReferences: a,
2500
- hasWorkspaceHub: u,
2501
- inputDisabled: d,
2502
- submitDisabled: f,
2503
- onAttachFiles: p,
2504
- onAttachText: m,
2505
- onChatInputAddReference: h,
2506
- onClearAttachments: g,
2507
- onInterrupt: b,
2508
- onQueuedFollowUpMove: x,
2509
- onQueuedFollowUpRemove: y,
2536
+ inputValue: p,
2537
+ isEditing: w,
2538
+ submit: T
2539
+ }, e[12] = S, e[13] = l, e[14] = f, e[15] = p, e[16] = T, e[17] = w, e[18] = I) : I = e[18], I;
2540
+ }, Zi = (t) => {
2541
+ const e = C(46), {
2542
+ conversationKey: n,
2543
+ recentUserMessages: o,
2544
+ actions: s,
2545
+ attachedResources: r,
2546
+ attachmentList: i,
2547
+ chatInputAutoFocus: l,
2548
+ chatInputPlaceholder: a,
2549
+ chatInputQuestionPrompt: c,
2550
+ chatInputReferences: d,
2551
+ hasWorkspaceHub: f,
2552
+ inputDisabled: m,
2553
+ submitDisabled: p,
2554
+ onAttachFiles: h,
2555
+ onAttachText: g,
2556
+ onChatInputAddReference: b,
2557
+ onClearAttachments: y,
2558
+ onInterrupt: x,
2559
+ onQueuedFollowUpMove: S,
2560
+ onQueuedFollowUpRemove: A,
2510
2561
  onQueuedFollowUpUpdate: T,
2511
- queuedComposer: S,
2512
- queuedFollowUps: w,
2513
- streaming: C,
2514
- workspaceHub: _
2515
- } = t, R = w.length > 0, L = u ? "2xs" : "xs", E = u ? "2xs" : "0", Q = u ? "2xs" : void 0, M = u ? "1px" : void 0, D = u ? "border" : void 0, B = u ? "sm" : void 0, $ = u ? "bg.subtle" : void 0, O = T ? S.edit : void 0;
2516
- let F;
2517
- e[0] !== x || e[1] !== y || e[2] !== S.editingItemId || e[3] !== w || e[4] !== O ? (F = /* @__PURE__ */ c(Vi, { items: w, editingItemId: S.editingItemId, onEdit: O, onRemove: y, onMove: x }), e[0] = x, e[1] = y, e[2] = S.editingItemId, e[3] = w, e[4] = O, e[5] = F) : F = e[5];
2518
- let z;
2519
- e[6] !== S.inputValue ? (z = So(S.inputValue), e[6] = S.inputValue, e[7] = z) : z = e[7];
2520
- const v = S.isEditing ? "Save queued follow-up" : void 0;
2521
- let W;
2522
- e[8] !== n || e[9] !== s || e[10] !== o || e[11] !== r || e[12] !== i || e[13] !== l || e[14] !== a || e[15] !== R || e[16] !== u || e[17] !== d || e[18] !== p || e[19] !== m || e[20] !== h || e[21] !== g || e[22] !== b || e[23] !== S.change || e[24] !== S.focusSignal || e[25] !== S.submit || e[26] !== C || e[27] !== f || e[28] !== v || e[29] !== z ? (W = /* @__PURE__ */ c(po, { placeholder: i, defaultState: z, streaming: C, onSubmit: S.submit, onInterrupt: b, onAttachFiles: p, onAttachText: m, onChange: S.change, actions: n, attachedResources: s, onClearAttachments: g, attachmentList: o, isDisabled: d, submitDisabled: f, attachedToTop: R, recessed: u, questionPrompt: l, autoFocus: r, focusSignal: S.focusSignal, submitTitle: v, references: a, onAddReference: h }), e[8] = n, e[9] = s, e[10] = o, e[11] = r, e[12] = i, e[13] = l, e[14] = a, e[15] = R, e[16] = u, e[17] = d, e[18] = p, e[19] = m, e[20] = h, e[21] = g, e[22] = b, e[23] = S.change, e[24] = S.focusSignal, e[25] = S.submit, e[26] = C, e[27] = f, e[28] = v, e[29] = z, e[30] = W) : W = e[30];
2523
- let H;
2524
- e[31] !== E || e[32] !== W || e[33] !== Q || e[34] !== M || e[35] !== D || e[36] !== B || e[37] !== $ || e[38] !== F || e[39] !== _ ? (H = /* @__PURE__ */ k(j, { gap: E, p: Q, borderWidth: M, borderColor: D, borderRadius: B, bg: $, children: [
2525
- _,
2526
- F,
2527
- W
2528
- ] }), e[31] = E, e[32] = W, e[33] = Q, e[34] = M, e[35] = D, e[36] = B, e[37] = $, e[38] = F, e[39] = _, e[40] = H) : H = e[40];
2562
+ queuedComposer: w,
2563
+ queuedFollowUps: I,
2564
+ streaming: _,
2565
+ workspaceHub: P
2566
+ } = t, M = I.length > 0, z = f ? "2xs" : "xs", B = f ? "2xs" : "0", E = f ? "2xs" : void 0, F = f ? "1px" : void 0, L = f ? "border" : void 0, $ = f ? "sm" : void 0, O = f ? "bg.subtle" : void 0, H = T ? w.edit : void 0;
2567
+ let R;
2568
+ e[0] !== S || e[1] !== A || e[2] !== w.editingItemId || e[3] !== I || e[4] !== H ? (R = /* @__PURE__ */ u(Yi, { items: I, editingItemId: w.editingItemId, onEdit: H, onRemove: A, onMove: S }), e[0] = S, e[1] = A, e[2] = w.editingItemId, e[3] = I, e[4] = H, e[5] = R) : R = e[5];
2569
+ let q;
2570
+ e[6] !== w.inputValue ? (q = Xi(w.inputValue), e[6] = w.inputValue, e[7] = q) : q = e[7];
2571
+ const V = w.isEditing ? "Save queued follow-up" : void 0;
2572
+ let j;
2573
+ e[8] !== s || e[9] !== r || e[10] !== i || e[11] !== l || e[12] !== a || e[13] !== c || e[14] !== d || e[15] !== n || e[16] !== M || e[17] !== f || e[18] !== m || e[19] !== h || e[20] !== g || e[21] !== b || e[22] !== y || e[23] !== x || e[24] !== w.change || e[25] !== w.focusSignal || e[26] !== w.submit || e[27] !== o || e[28] !== _ || e[29] !== p || e[30] !== V || e[31] !== q ? (j = /* @__PURE__ */ u(So, { recentUserMessages: o, placeholder: a, defaultState: q, streaming: _, onSubmit: w.submit, onInterrupt: x, onAttachFiles: h, onAttachText: g, onChange: w.change, actions: s, attachedResources: r, onClearAttachments: y, attachmentList: i, isDisabled: m, submitDisabled: p, attachedToTop: M, recessed: f, questionPrompt: c, autoFocus: l, focusSignal: w.focusSignal, submitTitle: V, references: d, onAddReference: b }, n), e[8] = s, e[9] = r, e[10] = i, e[11] = l, e[12] = a, e[13] = c, e[14] = d, e[15] = n, e[16] = M, e[17] = f, e[18] = m, e[19] = h, e[20] = g, e[21] = b, e[22] = y, e[23] = x, e[24] = w.change, e[25] = w.focusSignal, e[26] = w.submit, e[27] = o, e[28] = _, e[29] = p, e[30] = V, e[31] = q, e[32] = j) : j = e[32];
2529
2574
  let K;
2530
- return e[41] !== L || e[42] !== H ? (K = /* @__PURE__ */ c(j, { px: L, gap: "0", children: H }), e[41] = L, e[42] = H, e[43] = K) : K = e[43], K;
2531
- }, Sl = (t) => {
2532
- const e = A(78), {
2575
+ e[33] !== B || e[34] !== j || e[35] !== E || e[36] !== F || e[37] !== L || e[38] !== $ || e[39] !== O || e[40] !== R || e[41] !== P ? (K = /* @__PURE__ */ k(X, { gap: B, p: E, borderWidth: F, borderColor: L, borderRadius: $, bg: O, children: [
2576
+ P,
2577
+ R,
2578
+ j
2579
+ ] }), e[33] = B, e[34] = j, e[35] = E, e[36] = F, e[37] = L, e[38] = $, e[39] = O, e[40] = R, e[41] = P, e[42] = K) : K = e[42];
2580
+ let G;
2581
+ return e[43] !== z || e[44] !== K ? (G = /* @__PURE__ */ u(X, { px: z, gap: "0", children: K }), e[43] = z, e[44] = K, e[45] = G) : G = e[45], G;
2582
+ };
2583
+ function el(t) {
2584
+ return t + 1;
2585
+ }
2586
+ const tl = (t) => {
2587
+ const e = Math.max(0, Math.floor(t));
2588
+ if (e < 60) return `${e}s`;
2589
+ const n = Math.floor(e / 60);
2590
+ return n < 60 ? `${n}m ${String(e % 60).padStart(2, "0")}s` : `${Math.floor(n / 60)}h ${String(n % 60).padStart(2, "0")}m`;
2591
+ }, nl = (t) => {
2592
+ const e = C(9), {
2593
+ hidden: n
2594
+ } = t, o = n === void 0 ? !1 : n, [s, r] = W(0);
2595
+ let i;
2596
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = Date.now(), e[0] = i) : i = e[0];
2597
+ const l = J(i);
2598
+ let a, c;
2599
+ if (e[1] !== o ? (a = () => {
2600
+ if (o)
2601
+ return;
2602
+ const p = () => r((Date.now() - l.current) / 1e3);
2603
+ p();
2604
+ const h = setInterval(p, 1e3);
2605
+ return () => clearInterval(h);
2606
+ }, c = [o], e[1] = o, e[2] = a, e[3] = c) : (a = e[2], c = e[3]), Z(a, c), o)
2607
+ return null;
2608
+ let d;
2609
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ u(_t, { size: "xs", color: "fg.muted" }), e[4] = d) : d = e[4];
2610
+ let f;
2611
+ e[5] !== s ? (f = tl(s), e[5] = s, e[6] = f) : f = e[6];
2612
+ let m;
2613
+ return e[7] !== f ? (m = /* @__PURE__ */ k(oe, { gap: "2xs", px: "sm", py: "xs", children: [
2614
+ d,
2615
+ /* @__PURE__ */ u(U, { fontFamily: "mono", fontSize: "xs", color: "fg.muted", letterSpacing: "-0.2px", children: f })
2616
+ ] }), e[7] = f, e[8] = m) : m = e[8], m;
2617
+ }, _l = (t) => {
2618
+ const e = C(82), {
2533
2619
  conversationKey: n,
2534
- messages: s,
2535
- loading: o,
2620
+ messages: o,
2621
+ loading: s,
2536
2622
  streaming: r,
2537
2623
  emptyStateTitle: i,
2538
2624
  emptyStateDescription: l,
2539
2625
  emptyStateContent: a,
2540
- loaderComponent: u,
2626
+ loaderComponent: c,
2541
2627
  chatInputPlaceholder: d,
2542
2628
  chatInputDefaultValue: f,
2543
- onSubmitMessage: p,
2544
- onInterrupt: m,
2629
+ onSubmitMessage: m,
2630
+ onInterrupt: p,
2545
2631
  onAttachFiles: h,
2546
2632
  onAttachText: g,
2547
2633
  onChatInputChange: b,
2548
- actions: x,
2549
- attachedResources: y,
2550
- onClearAttachments: T,
2551
- attachmentList: S,
2552
- approvalPrompt: w,
2553
- workspaceHub: C,
2554
- workspaceInitializing: _,
2555
- inputDisabled: R,
2556
- submitDisabled: L,
2557
- chatInputQuestionPrompt: E,
2558
- chatInputAutoFocus: Q,
2559
- queuedFollowUps: M,
2560
- onQueuedFollowUpUpdate: D,
2561
- onQueuedFollowUpRemove: B,
2562
- onQueuedFollowUpMove: $,
2563
- chatInputReferences: O,
2564
- onChatInputAddReference: F
2565
- } = t, z = o === void 0 ? !1 : o, v = r === void 0 ? !1 : r, W = f === void 0 ? "" : f, H = _ === void 0 ? !1 : _, K = R === void 0 ? !1 : R, oe = L === void 0 ? !1 : L, xe = Q === void 0 ? !1 : Q;
2634
+ actions: y,
2635
+ attachedResources: x,
2636
+ onClearAttachments: S,
2637
+ attachmentList: A,
2638
+ approvalPrompt: T,
2639
+ workspaceHub: w,
2640
+ workspaceInitializing: I,
2641
+ inputDisabled: _,
2642
+ submitDisabled: P,
2643
+ chatInputQuestionPrompt: M,
2644
+ chatInputAutoFocus: z,
2645
+ queuedFollowUps: B,
2646
+ onQueuedFollowUpUpdate: E,
2647
+ onQueuedFollowUpRemove: F,
2648
+ onQueuedFollowUpMove: L,
2649
+ chatInputReferences: $,
2650
+ onChatInputAddReference: O
2651
+ } = t, H = s === void 0 ? !1 : s, R = r === void 0 ? !1 : r, q = f === void 0 ? "" : f, V = I === void 0 ? !1 : I, j = _ === void 0 ? !1 : _, K = P === void 0 ? !1 : P, G = z === void 0 ? !1 : z;
2566
2652
  let Se;
2567
- e[0] !== M ? (Se = M === void 0 ? [] : M, e[0] = M, e[1] = Se) : Se = e[1];
2568
- const ee = Se;
2569
- let Te;
2570
- e[2] !== O ? (Te = O === void 0 ? [] : O, e[2] = O, e[3] = Te) : Te = e[3];
2571
- const Be = Te;
2572
- let X, G, de, te, fe;
2573
- if (e[4] !== n || e[5] !== s || e[6] !== v) {
2574
- const me = yi(s, {
2575
- streaming: v
2653
+ e[0] !== B ? (Se = B === void 0 ? [] : B, e[0] = B, e[1] = Se) : Se = e[1];
2654
+ const re = Se;
2655
+ let ie;
2656
+ e[2] !== $ ? (ie = $ === void 0 ? [] : $, e[2] = $, e[3] = ie) : ie = e[3];
2657
+ const ee = ie;
2658
+ let te, ne, le, Te, ae;
2659
+ if (e[4] !== n || e[5] !== o || e[6] !== R) {
2660
+ const he = Ci(o, {
2661
+ streaming: R
2576
2662
  });
2577
- X = me.length > 0, de = n ?? me[0]?.id, G = X ? de ?? "active-conversation" : null, fe = me.reduce(Gi, 0), te = xi(me), e[4] = n, e[5] = s, e[6] = v, e[7] = X, e[8] = G, e[9] = de, e[10] = te, e[11] = fe;
2663
+ te = he.length > 0, le = n ?? he[0]?.id, ne = te ? le ?? "active-conversation" : null, ae = he.reduce(sl, 0), Te = ki(he), e[4] = n, e[5] = o, e[6] = R, e[7] = te, e[8] = ne, e[9] = le, e[10] = Te, e[11] = ae;
2578
2664
  } else
2579
- X = e[7], G = e[8], de = e[9], te = e[10], fe = e[11];
2665
+ te = e[7], ne = e[8], le = e[9], Te = e[10], ae = e[11];
2580
2666
  const {
2581
- groups: Fe,
2582
- leadingResponses: Ae
2583
- } = te, [we, nt] = V(Yi), [st, q] = V(null), ne = !X && z;
2584
- let se;
2585
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = /* @__PURE__ */ c(gs, { size: 48, strokeWidth: 1.5 }), e[12] = se) : se = e[12];
2586
- let pe;
2587
- e[13] !== l || e[14] !== i ? (pe = /* @__PURE__ */ c(As, { icon: se, title: i, description: l }), e[13] = l, e[14] = i, e[15] = pe) : pe = e[15];
2588
- const ot = ne ? u : a ?? pe, rt = !!C;
2589
- let We;
2590
- e[16] !== E || e[17] !== s ? (We = E ?? xo(s), e[16] = E, e[17] = s, e[18] = We) : We = e[18];
2591
- const Le = We, it = !!Le, lt = v && X && !H && !Le, He = !G || st === G;
2592
- let Ve;
2593
- e[19] !== W || e[20] !== b || e[21] !== D || e[22] !== p || e[23] !== ee ? (Ve = {
2594
- queuedFollowUps: ee,
2595
- defaultValue: W,
2667
+ groups: ce,
2668
+ leadingResponses: Be
2669
+ } = Te, [Fe, Ne] = W(ol), [Le, it] = W(null), lt = !te && H;
2670
+ let Q;
2671
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ u(xs, { size: 48, strokeWidth: 1.5 }), e[12] = Q) : Q = e[12];
2672
+ let Y;
2673
+ e[13] !== l || e[14] !== i ? (Y = /* @__PURE__ */ u(Is, { icon: Q, title: i, description: l }), e[13] = l, e[14] = i, e[15] = Y) : Y = e[15];
2674
+ const we = lt ? c : a ?? Y, $e = !!w;
2675
+ let Ue;
2676
+ e[16] !== M || e[17] !== o ? (Ue = M ?? Io(o), e[16] = M, e[17] = o, e[18] = Ue) : Ue = e[18];
2677
+ const Oe = Ue, at = !!Oe, ct = R && te && !V && !Oe, je = !ne || Le === ne;
2678
+ let Ke;
2679
+ e[19] !== q || e[20] !== b || e[21] !== E || e[22] !== m || e[23] !== re ? (Ke = {
2680
+ queuedFollowUps: re,
2681
+ defaultValue: q,
2596
2682
  onChange: b,
2597
- onSubmit: p,
2598
- onUpdate: D
2599
- }, e[19] = W, e[20] = b, e[21] = D, e[22] = p, e[23] = ee, e[24] = Ve) : Ve = e[24];
2600
- const at = ji(Ve);
2601
- let Ne;
2602
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ne = (me) => {
2603
- nt((On) => {
2604
- const je = new Set(On);
2605
- return je.has(me) ? je.delete(me) : je.add(me), je;
2683
+ onSubmit: m,
2684
+ onUpdate: E
2685
+ }, e[19] = q, e[20] = b, e[21] = E, e[22] = m, e[23] = re, e[24] = Ke) : Ke = e[24];
2686
+ const ut = Ji(Ke);
2687
+ let Xe;
2688
+ e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Xe = (he) => {
2689
+ Ne((qn) => {
2690
+ const Ye = new Set(qn);
2691
+ return Ye.has(he) ? Ye.delete(he) : Ye.add(he), Ye;
2606
2692
  });
2607
- }, e[25] = Ne) : Ne = e[25];
2608
- const $n = Ne, ct = de ?? null;
2609
- let ke;
2610
- e[26] !== ct || e[27] !== fe ? (ke = /* @__PURE__ */ c(Hs, { conversationKey: ct, userMessageCount: fe }), e[26] = ct, e[27] = fe, e[28] = ke) : ke = e[28];
2611
- const ut = He ? "visible" : "hidden";
2693
+ }, e[25] = Xe) : Xe = e[25];
2694
+ const Qn = Xe, dt = le ?? null;
2695
+ let Ae;
2696
+ e[26] !== dt || e[27] !== ae ? (Ae = /* @__PURE__ */ u(Us, { conversationKey: dt, userMessageCount: ae }), e[26] = dt, e[27] = ae, e[28] = Ae) : Ae = e[28];
2697
+ const ft = je ? "visible" : "hidden";
2612
2698
  let Ce;
2613
- e[29] !== ot || e[30] !== we || e[31] !== Fe || e[32] !== X || e[33] !== it || e[34] !== Ae || e[35] !== G || e[36] !== v ? (Ce = X ? /* @__PURE__ */ c(Wi, { leadingResponses: Ae, groups: Fe, streaming: v, hideActiveQuestionForms: it, expandedStickyMessageIds: we, onToggleStickyMessage: $n, onReady: () => q(G) }, G) : ot, e[29] = ot, e[30] = we, e[31] = Fe, e[32] = X, e[33] = it, e[34] = Ae, e[35] = G, e[36] = v, e[37] = Ce) : Ce = e[37];
2699
+ e[29] !== we || e[30] !== Fe || e[31] !== ce || e[32] !== te || e[33] !== at || e[34] !== Be || e[35] !== ne || e[36] !== R ? (Ce = te ? /* @__PURE__ */ u(Ki, { leadingResponses: Be, groups: ce, streaming: R, hideActiveQuestionForms: at, expandedStickyMessageIds: Fe, onToggleStickyMessage: Qn, onReady: () => it(ne) }, ne) : we, e[29] = we, e[30] = Fe, e[31] = ce, e[32] = te, e[33] = at, e[34] = Be, e[35] = ne, e[36] = R, e[37] = Ce) : Ce = e[37];
2700
+ let ke;
2701
+ e[38] !== ft || e[39] !== Ce ? (ke = /* @__PURE__ */ u(gt.Viewport, { visibility: ft, children: Ce }), e[38] = ft, e[39] = Ce, e[40] = ke) : ke = e[40];
2614
2702
  let Ie;
2615
- e[38] !== ut || e[39] !== Ce ? (Ie = /* @__PURE__ */ c(pt.Viewport, { visibility: ut, children: Ce }), e[38] = ut, e[39] = Ce, e[40] = Ie) : Ie = e[40];
2703
+ e[41] !== je ? (Ie = je ? /* @__PURE__ */ u(gt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = je, e[42] = Ie) : Ie = e[42];
2616
2704
  let _e;
2617
- e[41] !== He ? (_e = He ? /* @__PURE__ */ c(pt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[41] = He, e[42] = _e) : _e = e[42];
2618
- let Re;
2619
- e[43] !== ke || e[44] !== Ie || e[45] !== _e ? (Re = /* @__PURE__ */ k(pt.Root, { children: [
2705
+ e[43] !== Ae || e[44] !== ke || e[45] !== Ie ? (_e = /* @__PURE__ */ k(gt.Root, { children: [
2706
+ Ae,
2620
2707
  ke,
2621
- Ie,
2622
- _e
2623
- ] }), e[43] = ke, e[44] = Ie, e[45] = _e, e[46] = Re) : Re = e[46];
2708
+ Ie
2709
+ ] }), e[43] = Ae, e[44] = ke, e[45] = Ie, e[46] = _e) : _e = e[46];
2624
2710
  let ve;
2625
- e[47] !== lt || e[48] !== v ? (ve = v ? /* @__PURE__ */ c(Ui, { hidden: !lt }) : null, e[47] = lt, e[48] = v, e[49] = ve) : ve = e[49];
2711
+ e[47] !== ct || e[48] !== R ? (ve = R ? /* @__PURE__ */ u(nl, { hidden: !ct }) : null, e[47] = ct, e[48] = R, e[49] = ve) : ve = e[49];
2712
+ const pt = n ?? o[0]?.id;
2626
2713
  let Me;
2627
- e[50] !== x || e[51] !== Le || e[52] !== y || e[53] !== S || e[54] !== xe || e[55] !== d || e[56] !== Be || e[57] !== rt || e[58] !== K || e[59] !== h || e[60] !== g || e[61] !== F || e[62] !== T || e[63] !== m || e[64] !== $ || e[65] !== B || e[66] !== D || e[67] !== at || e[68] !== ee || e[69] !== v || e[70] !== oe || e[71] !== C ? (Me = /* @__PURE__ */ c(Ki, { actions: x, attachedResources: y, attachmentList: S, chatInputAutoFocus: xe, chatInputPlaceholder: d, chatInputQuestionPrompt: Le, chatInputReferences: Be, hasWorkspaceHub: rt, inputDisabled: K, submitDisabled: oe, onAttachFiles: h, onAttachText: g, onChatInputAddReference: F, onClearAttachments: T, onInterrupt: m, onQueuedFollowUpMove: $, onQueuedFollowUpRemove: B, onQueuedFollowUpUpdate: D, queuedComposer: at, queuedFollowUps: ee, streaming: v, workspaceHub: C }), e[50] = x, e[51] = Le, e[52] = y, e[53] = S, e[54] = xe, e[55] = d, e[56] = Be, e[57] = rt, e[58] = K, e[59] = h, e[60] = g, e[61] = F, e[62] = T, e[63] = m, e[64] = $, e[65] = B, e[66] = D, e[67] = at, e[68] = ee, e[69] = v, e[70] = oe, e[71] = C, e[72] = Me) : Me = e[72];
2628
- let Ue;
2629
- return e[73] !== w || e[74] !== Re || e[75] !== ve || e[76] !== Me ? (Ue = /* @__PURE__ */ k(be, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2630
- Re,
2631
- w,
2714
+ e[50] !== o ? (Me = ho(o), e[50] = o, e[51] = Me) : Me = e[51];
2715
+ let Re;
2716
+ e[52] !== y || e[53] !== Oe || e[54] !== x || e[55] !== A || e[56] !== G || e[57] !== d || e[58] !== ee || e[59] !== $e || e[60] !== j || e[61] !== h || e[62] !== g || e[63] !== O || e[64] !== S || e[65] !== p || e[66] !== L || e[67] !== F || e[68] !== E || e[69] !== ut || e[70] !== re || e[71] !== R || e[72] !== K || e[73] !== pt || e[74] !== Me || e[75] !== w ? (Re = /* @__PURE__ */ u(Zi, { conversationKey: pt, recentUserMessages: Me, actions: y, attachedResources: x, attachmentList: A, chatInputAutoFocus: G, chatInputPlaceholder: d, chatInputQuestionPrompt: Oe, chatInputReferences: ee, hasWorkspaceHub: $e, inputDisabled: j, submitDisabled: K, onAttachFiles: h, onAttachText: g, onChatInputAddReference: O, onClearAttachments: S, onInterrupt: p, onQueuedFollowUpMove: L, onQueuedFollowUpRemove: F, onQueuedFollowUpUpdate: E, queuedComposer: ut, queuedFollowUps: re, streaming: R, workspaceHub: w }), e[52] = y, e[53] = Oe, e[54] = x, e[55] = A, e[56] = G, e[57] = d, e[58] = ee, e[59] = $e, e[60] = j, e[61] = h, e[62] = g, e[63] = O, e[64] = S, e[65] = p, e[66] = L, e[67] = F, e[68] = E, e[69] = ut, e[70] = re, e[71] = R, e[72] = K, e[73] = pt, e[74] = Me, e[75] = w, e[76] = Re) : Re = e[76];
2717
+ let Ge;
2718
+ return e[77] !== T || e[78] !== _e || e[79] !== ve || e[80] !== Re ? (Ge = /* @__PURE__ */ k(ye, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2719
+ _e,
2720
+ T,
2632
2721
  ve,
2633
- Me
2634
- ] }), e[73] = w, e[74] = Re, e[75] = ve, e[76] = Me, e[77] = Ue) : Ue = e[77], Ue;
2722
+ Re
2723
+ ] }), e[77] = T, e[78] = _e, e[79] = ve, e[80] = Re, e[81] = Ge) : Ge = e[81], Ge;
2635
2724
  };
2636
- function Xi(t) {
2637
- return t + 1;
2638
- }
2639
- function Gi(t, e) {
2725
+ function sl(t, e) {
2640
2726
  return t + (e.role === "user" ? 1 : 0);
2641
2727
  }
2642
- function Yi() {
2728
+ function ol() {
2643
2729
  return /* @__PURE__ */ new Set();
2644
2730
  }
2645
- const Kt = (t) => /* @__PURE__ */ c(j, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ c(jn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), wl = () => {
2646
- const t = A(2);
2731
+ const Gt = (t) => /* @__PURE__ */ u(X, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ u(Gn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), vl = () => {
2732
+ const t = C(2);
2647
2733
  let e;
2648
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ c(ge.Root, { from: "user", children: /* @__PURE__ */ c(ge.Content, { from: "user", children: Kt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2734
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ u(be.Root, { from: "user", children: /* @__PURE__ */ u(be.Content, { from: "user", children: Gt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2649
2735
  let n;
2650
- return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(j, { minH: "full", py: "xs", gap: "0", children: [
2736
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(X, { minH: "full", py: "xs", gap: "0", children: [
2651
2737
  e,
2652
- /* @__PURE__ */ c(ge.Root, { from: "assistant", children: /* @__PURE__ */ c(ge.Content, { from: "assistant", children: Kt(["76%", "62%", "40%"]) }) })
2738
+ /* @__PURE__ */ u(be.Root, { from: "assistant", children: /* @__PURE__ */ u(be.Content, { from: "assistant", children: Gt(["76%", "62%", "40%"]) }) })
2653
2739
  ] }), t[1] = n) : n = t[1], n;
2654
- }, Ji = 3, Xt = 10, Zi = 26, Tt = 4, el = (t, e) => {
2740
+ }, rl = 3, Yt = 10, il = 26, kt = 4, ll = (t, e) => {
2655
2741
  if (e === null) return 0;
2656
2742
  const n = Math.abs(t - e);
2657
- return n >= Tt ? 0 : (1 + Math.cos(Math.PI * n / Tt)) / 2;
2658
- }, tl = (t, e) => {
2743
+ return n >= kt ? 0 : (1 + Math.cos(Math.PI * n / kt)) / 2;
2744
+ }, al = (t, e) => {
2659
2745
  if (e === null) return "fg.subtle";
2660
2746
  const n = Math.abs(t - e);
2661
- return n < 0.5 ? "fg" : n < Tt ? "fg.muted" : "fg.subtle";
2662
- }, nl = (t) => {
2663
- const e = A(11), {
2747
+ return n < 0.5 ? "fg" : n < kt ? "fg.muted" : "fg.subtle";
2748
+ }, cl = (t) => {
2749
+ const e = C(11), {
2664
2750
  item: n,
2665
- position: s
2666
- } = t, o = `${s.left}px`, r = `${s.top}px`;
2751
+ position: o
2752
+ } = t, s = `${o.left}px`, r = `${o.top}px`;
2667
2753
  let i;
2668
- e[0] !== n.message ? (i = /* @__PURE__ */ c(U, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
2754
+ e[0] !== n.message ? (i = /* @__PURE__ */ u(U, { textStyle: "label/S/medium", color: "fg", lineClamp: 2, children: n.message }), e[0] = n.message, e[1] = i) : i = e[1];
2669
2755
  let l;
2670
- e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
2756
+ e[2] !== n.reply ? (l = n.reply ? /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", lineClamp: 2, children: n.reply }) : null, e[2] = n.reply, e[3] = l) : l = e[3];
2671
2757
  let a;
2672
- e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(j, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
2758
+ e[4] !== i || e[5] !== l ? (a = /* @__PURE__ */ k(X, { gap: "1.5", p: "3", bg: "bg.elevated", borderWidth: "1px", borderColor: "border", borderRadius: "lg", children: [
2673
2759
  i,
2674
2760
  l
2675
2761
  ] }), e[4] = i, e[5] = l, e[6] = a) : a = e[6];
2676
- let u;
2677
- return e[7] !== o || e[8] !== r || e[9] !== a ? (u = /* @__PURE__ */ c(Yt, { children: /* @__PURE__ */ c(P, { position: "fixed", left: o, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = o, e[8] = r, e[9] = a, e[10] = u) : u = e[10], u;
2678
- }, Tl = (t) => {
2679
- const e = A(22), {
2762
+ let c;
2763
+ return e[7] !== s || e[8] !== r || e[9] !== a ? (c = /* @__PURE__ */ u(Zt, { children: /* @__PURE__ */ u(D, { position: "fixed", left: s, ml: "2xs", top: r, transform: "translateY(-50%)", w: "80", maxW: "80", zIndex: "popover", pointerEvents: "none", children: a }) }), e[7] = s, e[8] = r, e[9] = a, e[10] = c) : c = e[10], c;
2764
+ }, Ml = (t) => {
2765
+ const e = C(22), {
2680
2766
  items: n,
2681
- onSelect: s,
2682
- floating: o
2683
- } = t, r = o === void 0 ? !1 : o, [i, l] = V(null), [a, u] = V(null);
2684
- if (n.length < Ji)
2767
+ onSelect: o,
2768
+ floating: s
2769
+ } = t, r = s === void 0 ? !1 : s, [i, l] = W(null), [a, c] = W(null);
2770
+ if (n.length < rl)
2685
2771
  return null;
2686
2772
  let d;
2687
- e[0] !== n.length ? (d = (S) => {
2688
- const w = S.currentTarget.getBoundingClientRect(), C = (S.clientY - w.top) / w.height, _ = Math.min(n.length - 1, Math.max(0, C * n.length - 0.5)), R = Math.round(_);
2689
- l(_), u({
2690
- left: w.right,
2691
- top: w.top + (R + 0.5) / n.length * w.height
2773
+ e[0] !== n.length ? (d = (A) => {
2774
+ const T = A.currentTarget.getBoundingClientRect(), w = (A.clientY - T.top) / T.height, I = Math.min(n.length - 1, Math.max(0, w * n.length - 0.5)), _ = Math.round(I);
2775
+ l(I), c({
2776
+ left: T.right,
2777
+ top: T.top + (_ + 0.5) / n.length * T.height
2692
2778
  });
2693
2779
  }, e[0] = n.length, e[1] = d) : d = e[1];
2694
- const f = d, p = i === null ? null : Math.round(i), m = p === null ? null : n[p];
2780
+ const f = d, m = i === null ? null : Math.round(i), p = m === null ? null : n[m];
2695
2781
  let h;
2696
2782
  e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => l(null), e[2] = h) : h = e[2];
2697
2783
  let g;
@@ -2703,100 +2789,100 @@ const Kt = (t) => /* @__PURE__ */ c(j, { gap: "xs", w: "full", children: t.map((
2703
2789
  bg: "bg"
2704
2790
  } : {}, e[3] = r, e[4] = g) : g = e[4];
2705
2791
  let b;
2706
- if (e[5] !== n || e[6] !== s || e[7] !== i) {
2707
- let S;
2708
- e[9] !== s || e[10] !== i ? (S = (w, C) => /* @__PURE__ */ c(Gt.button, { type: "button", h: "2px", w: `${Xt + (Zi - Xt) * el(C, i)}px`, bg: tl(C, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${C + 1}`, onClick: () => s?.(w.id) }, w.id), e[9] = s, e[10] = i, e[11] = S) : S = e[11], b = n.map(S), e[5] = n, e[6] = s, e[7] = i, e[8] = b;
2792
+ if (e[5] !== n || e[6] !== o || e[7] !== i) {
2793
+ let A;
2794
+ e[9] !== o || e[10] !== i ? (A = (T, w) => /* @__PURE__ */ u(Jt.button, { type: "button", h: "2px", w: `${Yt + (il - Yt) * ll(w, i)}px`, bg: al(w, i), borderRadius: "1px", transition: "width 80ms linear, background-color 80ms linear", "aria-label": `Jump to message ${w + 1}`, onClick: () => o?.(T.id) }, T.id), e[9] = o, e[10] = i, e[11] = A) : A = e[11], b = n.map(A), e[5] = n, e[6] = o, e[7] = i, e[8] = b;
2709
2795
  } else
2710
2796
  b = e[8];
2711
- let x;
2712
- e[12] !== f || e[13] !== g || e[14] !== b ? (x = /* @__PURE__ */ c(be, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = x) : x = e[15];
2713
2797
  let y;
2714
- e[16] !== m || e[17] !== a ? (y = m && a ? /* @__PURE__ */ c(nl, { item: m, position: a }) : null, e[16] = m, e[17] = a, e[18] = y) : y = e[18];
2715
- let T;
2716
- return e[19] !== x || e[20] !== y ? (T = /* @__PURE__ */ k(P, { position: "relative", w: "10", flexShrink: 0, children: [
2717
- x,
2718
- y
2719
- ] }), e[19] = x, e[20] = y, e[21] = T) : T = e[21], T;
2720
- }, sl = (t) => {
2721
- const e = A(13), {
2798
+ e[12] !== f || e[13] !== g || e[14] !== b ? (y = /* @__PURE__ */ u(ye, { direction: "column", align: "flex-start", gap: "1.5", px: "1.5", py: "2", w: "10", onPointerMove: f, onPointerLeave: h, ...g, children: b }), e[12] = f, e[13] = g, e[14] = b, e[15] = y) : y = e[15];
2799
+ let x;
2800
+ e[16] !== p || e[17] !== a ? (x = p && a ? /* @__PURE__ */ u(cl, { item: p, position: a }) : null, e[16] = p, e[17] = a, e[18] = x) : x = e[18];
2801
+ let S;
2802
+ return e[19] !== y || e[20] !== x ? (S = /* @__PURE__ */ k(D, { position: "relative", w: "10", flexShrink: 0, children: [
2803
+ y,
2804
+ x
2805
+ ] }), e[19] = y, e[20] = x, e[21] = S) : S = e[21], S;
2806
+ }, ul = (t) => {
2807
+ const e = C(13), {
2722
2808
  status: n,
2723
- statusLabel: s,
2724
- additions: o,
2809
+ statusLabel: o,
2810
+ additions: s,
2725
2811
  deletions: r
2726
2812
  } = t;
2727
2813
  if (n === "loading") {
2728
- let u;
2729
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(kt, { size: "xs", color: "fg.muted" }), e[0] = u) : u = e[0];
2730
- const d = s ?? "Setting up workspace...";
2814
+ let c;
2815
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(_t, { size: "xs", color: "fg.muted" }), e[0] = c) : c = e[0];
2816
+ const d = o ?? "Setting up workspace...";
2731
2817
  let f;
2732
- return e[1] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
2733
- u,
2734
- /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
2818
+ return e[1] !== d ? (f = /* @__PURE__ */ k(oe, { gap: "2xs", minW: "0", children: [
2819
+ c,
2820
+ /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.muted", truncate: !0, children: d })
2735
2821
  ] }), e[1] = d, e[2] = f) : f = e[2], f;
2736
2822
  }
2737
2823
  if (n === "error") {
2738
- let u;
2739
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ c(sn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = u) : u = e[3];
2740
- const d = s ?? "Workspace setup failed";
2824
+ let c;
2825
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ u(rn, { size: 14, color: "var(--chakra-colors-fg-error)" }), e[3] = c) : c = e[3];
2826
+ const d = o ?? "Workspace setup failed";
2741
2827
  let f;
2742
- return e[4] !== d ? (f = /* @__PURE__ */ k(Z, { gap: "2xs", minW: "0", children: [
2743
- u,
2744
- /* @__PURE__ */ c(U, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
2828
+ return e[4] !== d ? (f = /* @__PURE__ */ k(oe, { gap: "2xs", minW: "0", children: [
2829
+ c,
2830
+ /* @__PURE__ */ u(U, { textStyle: "label/XS/regular", color: "fg.error", truncate: !0, children: d })
2745
2831
  ] }), e[4] = d, e[5] = f) : f = e[5], f;
2746
2832
  }
2747
- if (o <= 0 && r <= 0)
2833
+ if (s <= 0 && r <= 0)
2748
2834
  return null;
2749
2835
  let i;
2750
- e[6] !== o ? (i = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.success", children: [
2836
+ e[6] !== s ? (i = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.success", children: [
2751
2837
  "+",
2752
- o
2753
- ] }), e[6] = o, e[7] = i) : i = e[7];
2838
+ s
2839
+ ] }), e[6] = s, e[7] = i) : i = e[7];
2754
2840
  let l;
2755
2841
  e[8] !== r ? (l = /* @__PURE__ */ k(U, { textStyle: "label/XS/medium", color: "fg.error", children: [
2756
2842
  "−",
2757
2843
  r
2758
2844
  ] }), e[8] = r, e[9] = l) : l = e[9];
2759
2845
  let a;
2760
- return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(Z, { gap: "2xs", children: [
2846
+ return e[10] !== i || e[11] !== l ? (a = /* @__PURE__ */ k(oe, { gap: "2xs", children: [
2761
2847
  i,
2762
2848
  l
2763
2849
  ] }), e[10] = i, e[11] = l, e[12] = a) : a = e[12], a;
2764
- }, Al = (t) => {
2765
- const e = A(13), {
2850
+ }, Rl = (t) => {
2851
+ const e = C(13), {
2766
2852
  workspaceControl: n,
2767
- additions: s,
2768
- deletions: o,
2853
+ additions: o,
2854
+ deletions: s,
2769
2855
  action: r,
2770
2856
  status: i,
2771
2857
  statusLabel: l
2772
2858
  } = t, a = i === void 0 ? "ready" : i;
2773
- let u;
2774
- e[0] !== s || e[1] !== o || e[2] !== a || e[3] !== l ? (u = /* @__PURE__ */ c(sl, { status: a, statusLabel: l, additions: s, deletions: o }), e[0] = s, e[1] = o, e[2] = a, e[3] = l, e[4] = u) : u = e[4];
2859
+ let c;
2860
+ e[0] !== o || e[1] !== s || e[2] !== a || e[3] !== l ? (c = /* @__PURE__ */ u(ul, { status: a, statusLabel: l, additions: o, deletions: s }), e[0] = o, e[1] = s, e[2] = a, e[3] = l, e[4] = c) : c = e[4];
2775
2861
  let d;
2776
- e[5] !== u || e[6] !== n ? (d = /* @__PURE__ */ k(Z, { gap: "sm", minW: "0", children: [
2862
+ e[5] !== c || e[6] !== n ? (d = /* @__PURE__ */ k(oe, { gap: "sm", minW: "0", children: [
2777
2863
  n,
2778
- u
2779
- ] }), e[5] = u, e[6] = n, e[7] = d) : d = e[7];
2864
+ c
2865
+ ] }), e[5] = c, e[6] = n, e[7] = d) : d = e[7];
2780
2866
  let f;
2781
- e[8] !== r ? (f = r ? /* @__PURE__ */ c(be, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
2782
- let p;
2783
- return e[10] !== d || e[11] !== f ? (p = /* @__PURE__ */ k(be, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
2867
+ e[8] !== r ? (f = r ? /* @__PURE__ */ u(ye, { flexShrink: 0, children: r }) : null, e[8] = r, e[9] = f) : f = e[9];
2868
+ let m;
2869
+ return e[10] !== d || e[11] !== f ? (m = /* @__PURE__ */ k(ye, { align: "center", justify: "space-between", gap: "sm", minW: "0", pl: "xs", pr: "2xs", py: "2xs", children: [
2784
2870
  d,
2785
2871
  f
2786
- ] }), e[10] = d, e[11] = f, e[12] = p) : p = e[12], p;
2872
+ ] }), e[10] = d, e[11] = f, e[12] = m) : m = e[12], m;
2787
2873
  };
2788
2874
  export {
2789
- yl as ApprovalPrompt,
2790
- xl as AttachmentList,
2791
- Hs as AutoScroll,
2792
- po as ChatInput,
2793
- ge as ChatMessage,
2794
- Sl as ChatPanel,
2795
- pt as ChatPrimitives,
2796
- wl as ChatSkeleton,
2797
- Al as ChatWorkspaceHub,
2798
- Tl as ConversationBrowse,
2799
- uo as SendButton,
2800
- So as createSerializedPromptState
2875
+ kl as ApprovalPrompt,
2876
+ Il as AttachmentList,
2877
+ Us as AutoScroll,
2878
+ So as ChatInput,
2879
+ be as ChatMessage,
2880
+ _l as ChatPanel,
2881
+ gt as ChatPrimitives,
2882
+ vl as ChatSkeleton,
2883
+ Rl as ChatWorkspaceHub,
2884
+ Ml as ConversationBrowse,
2885
+ mo as SendButton,
2886
+ Xi as createSerializedPromptState
2801
2887
  };
2802
2888
  //# sourceMappingURL=chat-ui.js.map