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