@pstdio/ui 0.13.0 → 0.15.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 (79) hide show
  1. package/dist/MermaidComponent-DBJsTOmj.js +60 -0
  2. package/dist/MermaidComponent-DBJsTOmj.js.map +1 -0
  3. package/dist/chat-ui.js +1222 -1147
  4. package/dist/chat-ui.js.map +1 -1
  5. package/dist/components/bubble-button.d.ts +1 -1
  6. package/dist/components/chat-ui/components/chat-input-attachments.d.ts +12 -0
  7. package/dist/components/chat-ui/components/chat-input.d.ts +3 -0
  8. package/dist/components/chat-ui/components/chat-panel.d.ts +2 -0
  9. package/dist/components/chat-ui/components/message-parts-renderer.d.ts +1 -1
  10. package/dist/components/chat-ui/components/message-types.d.ts +90 -3
  11. package/dist/components/chat-ui/index.d.ts +2 -2
  12. package/dist/components/chat-ui/mocks/library/index.d.ts +2 -2
  13. package/dist/components/chat-ui/performance/chat-performance-fixtures.d.ts +1 -1
  14. package/dist/components/chat-ui/performance/chat-performance-story-utils.d.ts +1 -1
  15. package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +3 -3
  16. package/dist/components/chat-ui/tool-rendering/question-renderer.d.ts +1 -1
  17. package/dist/components/chat-ui/tool-rendering/shared.d.ts +2 -2
  18. package/dist/components/chat-ui/tool-rendering/todowrite-renderer.d.ts +1 -1
  19. package/dist/components/chat-ui/tool-rendering/types.d.ts +1 -1
  20. package/dist/components/data-renderer/data-renderer-board-column-header.d.ts +8 -0
  21. package/dist/components/data-renderer/data-renderer-board-group-section.d.ts +17 -0
  22. package/dist/components/data-renderer/data-renderer-board-move.d.ts +21 -0
  23. package/dist/components/data-renderer/data-renderer-board.d.ts +3 -2
  24. package/dist/components/data-renderer/data-renderer-content.d.ts +7 -2
  25. package/dist/components/data-renderer/data-renderer-enum-helpers.d.ts +3 -3
  26. package/dist/components/data-renderer/data-renderer-helpers.d.ts +2 -0
  27. package/dist/components/data-renderer/data-renderer.d.ts +2 -2
  28. package/dist/components/diff-viewer/diff-card-body.d.ts +16 -0
  29. package/dist/components/diff-viewer/diff-card.d.ts +1 -0
  30. package/dist/components/diff-viewer/diff-size.d.ts +1 -1
  31. package/dist/components/diff-viewer/diff-viewer-options-menu.d.ts +16 -0
  32. package/dist/components/icon-color-picker.d.ts +2 -6
  33. package/dist/components/list-row/list-row.types.d.ts +1 -1
  34. package/dist/components/mermaid-renderer/download-png.d.ts +7 -0
  35. package/dist/components/mermaid-renderer/index.d.ts +2 -0
  36. package/dist/components/mermaid-renderer/mermaid-error-state.d.ts +6 -0
  37. package/dist/components/mermaid-renderer/mermaid-fixtures.d.ts +9 -0
  38. package/dist/components/mermaid-renderer/mermaid-fullscreen.d.ts +10 -0
  39. package/dist/components/mermaid-renderer/mermaid-renderer.d.ts +8 -0
  40. package/dist/components/mermaid-renderer/mermaid-svg-view.d.ts +12 -0
  41. package/dist/components/mermaid-renderer/mermaid-toolbar.d.ts +12 -0
  42. package/dist/components/mermaid-renderer/mermaid-zoom.d.ts +6 -0
  43. package/dist/components/mermaid-renderer/svg-data-url.d.ts +6 -0
  44. package/dist/components/mermaid-renderer/use-mermaid-render.d.ts +5 -0
  45. package/dist/components/notification-center/index.d.ts +2 -0
  46. package/dist/components/notification-center/notification-center.d.ts +2 -0
  47. package/dist/components/notification-center/notification-center.types.d.ts +37 -0
  48. package/dist/components/palette-shortcut.d.ts +8 -0
  49. package/dist/components/search-modal-content.d.ts +20 -0
  50. package/dist/components/style-guide-data.d.ts +0 -6
  51. package/dist/components/tab-strip/tab-visibility-filter.d.ts +4 -2
  52. package/dist/components/tree-list/tree-list-visibility-filter.d.ts +11 -3
  53. package/dist/components/tree-list/tree-list.types.d.ts +7 -2
  54. package/dist/index.d.ts +9 -2
  55. package/dist/index.js +4641 -4326
  56. package/dist/index.js.map +1 -1
  57. package/dist/mermaid-renderer-CPGj6vsb.js +570 -0
  58. package/dist/mermaid-renderer-CPGj6vsb.js.map +1 -0
  59. package/dist/resource-badge-CeJTOn8F.js +188 -0
  60. package/dist/resource-badge-CeJTOn8F.js.map +1 -0
  61. package/dist/{rich-message-CEOSsdR2.js → rich-message-DNSEhxXh.js} +431 -519
  62. package/dist/rich-message-DNSEhxXh.js.map +1 -0
  63. package/dist/rich-text.js +405 -399
  64. package/dist/rich-text.js.map +1 -1
  65. package/dist/style.css +1 -1
  66. package/dist/theme/shadowless-default-config.d.ts +2 -0
  67. package/dist/{theme-D2LYEa0j.js → theme-25P7ij4C.js} +211 -241
  68. package/dist/theme-25P7ij4C.js.map +1 -0
  69. package/dist/theme.js +1 -1
  70. package/package.json +3 -2
  71. package/dist/MermaidComponent-Cz_Iob5U.js +0 -127
  72. package/dist/MermaidComponent-Cz_Iob5U.js.map +0 -1
  73. package/dist/components/chat-ui/agent-types.d.ts +0 -220
  74. package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -7
  75. package/dist/get-file-type-icon-ufFb0IkR.js +0 -102
  76. package/dist/get-file-type-icon-ufFb0IkR.js.map +0 -1
  77. package/dist/rich-message-CEOSsdR2.js.map +0 -1
  78. package/dist/theme/tokens/shadows.d.ts +0 -64
  79. package/dist/theme-D2LYEa0j.js.map +0 -1
package/dist/chat-ui.js CHANGED
@@ -1,11 +1,11 @@
1
- import { jsx as l, jsxs as T, Fragment as Lt } from "react/jsx-runtime";
2
- import { c as k } from "react/compiler-runtime";
3
- import { chakra as Pn, AbsoluteCenter as Ln, IconButton as vt, defineSlotRecipe as vn, createSlotRecipeContext as $n, Text as q, Code as Qt, Button as Ke, HStack as Ee, Box as I, Flex as Ce, Stack as Z, Textarea as On, Tooltip as it, Portal as Dn, Kbd as Fn, Spacer as zn, Timeline as qn, Span as Ue, Avatar as qe, Card as le, Link as Zt, Spinner as $t, Skeleton as Qn } from "@chakra-ui/react";
4
- import { ArrowDownIcon as Hn, ShieldX as Wn, ShieldCheck as Nn, Check as en, Square as Vn, ArrowUp as jn, Copy as Un, Move as Kn, FileDown as Gn, FileUp as Xn, FileDiff as Yn, Trash2 as Jn, FilePen as Zn, FileText as es, ListTree as ts, Terminal as tn, ListTodo as ns, CircleQuestionMark as ss, File as os, Globe as rs, Search as is, AlertTriangle as nn, DotIcon as ls, ChevronUpIcon as as, MessageCircleIcon as cs } from "lucide-react";
5
- import { StickToBottom as us, useStickToBottomContext as ct } from "use-stick-to-bottom";
6
- import { S as ut, T as sn } from "./get-file-type-icon-ufFb0IkR.js";
7
- import { useRef as Qe, useEffect as Te, useState as G } from "react";
8
- import { i as At, P as ds, h as fs, R as on, j as ps } from "./rich-message-CEOSsdR2.js";
1
+ import { jsx as a, jsxs as k, Fragment as Ot } from "react/jsx-runtime";
2
+ import { c as T } from "react/compiler-runtime";
3
+ import { chakra as Fn, AbsoluteCenter as zn, IconButton as $t, defineSlotRecipe as qn, createSlotRecipeContext as Hn, Text as X, Code as jt, Button as Ze, HStack as Me, Box as I, Flex as Re, Stack as Y, Textarea as Qn, Tooltip as dt, Portal as Wn, Kbd as Nn, Spacer as Vn, Timeline as jn, Span as Je, Avatar as We, Card as ue, Link as sn, Spinner as Ft, Image as Un, Skeleton as Kn } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as Gn, ShieldX as Xn, ShieldCheck as Yn, Check as rn, Square as Jn, ArrowUp as Zn, Copy as eo, Move as to, FileDown as no, FileUp as oo, FileDiff as so, Trash2 as ro, FilePen as io, FileText as lo, ListTree as ao, Terminal as ln, ListTodo as co, CircleQuestionMark as uo, File as fo, Globe as po, Search as mo, AlertTriangle as an, DotIcon as ho, ChevronUpIcon as go, MessageCircleIcon as bo } from "lucide-react";
5
+ import { StickToBottom as yo, useStickToBottomContext as mt } from "use-stick-to-bottom";
6
+ import { S as ht, R as zt, T as cn } from "./resource-badge-CeJTOn8F.js";
7
+ import { Fragment as xo, useRef as Ne, useEffect as Ae, useState as G } from "react";
8
+ import { i as Mt, P as So, h as To, R as un } from "./rich-message-DNSEhxXh.js";
9
9
  import "@lexical/react/LexicalCollaborationContext";
10
10
  import "@lexical/react/LexicalCollaborationPlugin";
11
11
  import "@lexical/react/LexicalComposer";
@@ -30,17 +30,18 @@ import "@lexical/markdown";
30
30
  import "@lexical/react/LexicalAutoFocusPlugin";
31
31
  import "@lexical/react/LexicalCheckListPlugin";
32
32
  import "@lexical/react/LexicalHistoryPlugin";
33
+ import "@lexical/react/LexicalMarkdownShortcutPlugin";
33
34
  import "@lexical/react/LexicalOnChangePlugin";
34
35
  import "@lexical/react/LexicalTreeView";
35
36
  import "@lexical/react/LexicalClickableLinkPlugin";
36
- import { C as rn, R as ms, a as hs, D as gs, b as ln, A as Ht, E as bs } from "./radio-DJtQY9po.js";
37
- import { useVirtualizer as ys } from "@tanstack/react-virtual";
38
- const xs = {
37
+ import { C as dn, R as wo, a as ko, D as Co, b as fn, A as Ut, E as Ao } from "./radio-DJtQY9po.js";
38
+ import { useVirtualizer as _o } from "@tanstack/react-virtual";
39
+ const Ro = {
39
40
  "aria-roledescription": "conversation",
40
41
  initial: "instant",
41
42
  resize: "instant",
42
43
  role: "log"
43
- }, Ss = Pn(us, {
44
+ }, Io = Fn(yo, {
44
45
  base: {
45
46
  position: "relative",
46
47
  flex: 1,
@@ -49,18 +50,18 @@ const xs = {
49
50
  }
50
51
  }, {
51
52
  forwardProps: ["initial", "resize"],
52
- defaultProps: xs
53
- }), ks = (t) => {
54
- const e = k(10);
55
- let n, o;
53
+ defaultProps: Ro
54
+ }), Po = (t) => {
55
+ const e = T(10);
56
+ let n, s;
56
57
  e[0] !== t ? ({
57
58
  children: n,
58
- ...o
59
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
59
+ ...s
60
+ } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
60
61
  const {
61
- contentRef: s,
62
+ contentRef: o,
62
63
  scrollRef: r
63
- } = ct(), i = r, a = s;
64
+ } = mt(), i = r, l = o;
64
65
  let c, u;
65
66
  e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
66
67
  zIndex: 2
@@ -70,23 +71,23 @@ const xs = {
70
71
  role: "list"
71
72
  }, e[3] = c, e[4] = u) : (c = e[3], u = e[4]);
72
73
  let d;
73
- return e[5] !== n || e[6] !== o || e[7] !== i || e[8] !== a ? (d = /* @__PURE__ */ l(ut, { ...o, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: a, verticalScrollbarProps: c, contentProps: u, children: n }), e[5] = n, e[6] = o, e[7] = i, e[8] = a, e[9] = d) : d = e[9], d;
74
- }, Ts = {
74
+ return e[5] !== n || e[6] !== s || e[7] !== i || e[8] !== l ? (d = /* @__PURE__ */ a(ht, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: l, verticalScrollbarProps: c, contentProps: u, children: n }), e[5] = n, e[6] = s, e[7] = i, e[8] = l, e[9] = d) : d = e[9], d;
75
+ }, Mo = {
75
76
  axis: "horizontal",
76
77
  bottom: "md",
77
78
  zIndex: 2
78
- }, ws = (t) => {
79
- const e = k(4), {
79
+ }, Eo = (t) => {
80
+ const e = T(4), {
80
81
  isAtBottom: n,
81
- scrollToBottom: o
82
- } = ct();
83
- let s;
84
- return e[0] !== n || e[1] !== t || e[2] !== o ? (s = !n && /* @__PURE__ */ l(Ln, { ...Ts, children: /* @__PURE__ */ l(vt, { rounded: "full", onClick: () => o(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ l(Hn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = o, e[3] = s) : s = e[3], s;
85
- }, Rt = {
86
- Root: Ss,
87
- Viewport: ks,
88
- ScrollToBottom: ws
89
- }, Cs = vn({
82
+ scrollToBottom: s
83
+ } = mt();
84
+ let o;
85
+ return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ a(zn, { ...Mo, children: /* @__PURE__ */ a($t, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ a(Gn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
86
+ }, Et = {
87
+ Root: Io,
88
+ Viewport: Po,
89
+ ScrollToBottom: Eo
90
+ }, vo = qn({
90
91
  className: "ai-message",
91
92
  slots: ["root", "content"],
92
93
  base: {
@@ -196,611 +197,681 @@ const xs = {
196
197
  shape: "rounded"
197
198
  }
198
199
  }), {
199
- withProvider: _s,
200
- withContext: As
201
- } = $n({
202
- recipe: Cs
203
- }), Rs = _s("div", "root"), Is = As("div", "content"), we = {
204
- Root: Rs,
205
- Content: Is
206
- }, Ms = (t) => {
200
+ withProvider: Lo,
201
+ withContext: Do
202
+ } = Hn({
203
+ recipe: vo
204
+ }), Bo = Lo("div", "root"), Oo = Do("div", "content"), _e = {
205
+ Root: Bo,
206
+ Content: Oo
207
+ }, $o = (t) => {
207
208
  if (t == null) return null;
208
209
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
209
210
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
210
- }, ji = (t) => {
211
- const e = k(19), {
211
+ }, cl = (t) => {
212
+ const e = T(19), {
212
213
  toolName: n,
213
- toolInput: o,
214
- onApprove: s,
214
+ toolInput: s,
215
+ onApprove: o,
215
216
  onDeny: r
216
217
  } = t;
217
218
  let i;
218
- e[0] !== o ? (i = Ms(o), e[0] = o, e[1] = i) : i = e[1];
219
- const a = i;
219
+ e[0] !== s ? (i = $o(s), e[0] = s, e[1] = i) : i = e[1];
220
+ const l = i;
220
221
  let c;
221
- e[2] !== n ? (c = /* @__PURE__ */ T(q, { textStyle: "label/S/medium", color: "fg", children: [
222
+ e[2] !== n ? (c = /* @__PURE__ */ k(X, { textStyle: "label/S/medium", color: "fg", children: [
222
223
  "Allow ",
223
- /* @__PURE__ */ l(Qt, { size: "sm", children: n }),
224
+ /* @__PURE__ */ a(jt, { size: "sm", children: n }),
224
225
  "?"
225
226
  ] }), e[2] = n, e[3] = c) : c = e[3];
226
227
  let u;
227
- e[4] !== a ? (u = a ? /* @__PURE__ */ l(ut, { maxH: "6rem", children: /* @__PURE__ */ l(Qt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: a }) }) : null, e[4] = a, e[5] = u) : u = e[5];
228
+ e[4] !== l ? (u = l ? /* @__PURE__ */ a(ht, { maxH: "6rem", children: /* @__PURE__ */ a(jt, { size: "sm", whiteSpace: "pre-wrap", display: "block", width: "100%", children: l }) }) : null, e[4] = l, e[5] = u) : u = e[5];
228
229
  let d;
229
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ l(Wn, { size: 14 }), e[6] = d) : d = e[6];
230
- let p;
231
- e[7] !== r ? (p = /* @__PURE__ */ T(Ke, { size: "xs", variant: "outline", onClick: r, children: [
230
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ a(Xn, { size: 14 }), e[6] = d) : d = e[6];
231
+ let f;
232
+ e[7] !== r ? (f = /* @__PURE__ */ k(Ze, { size: "xs", variant: "outline", onClick: r, children: [
232
233
  d,
233
234
  "Deny"
234
- ] }), e[7] = r, e[8] = p) : p = e[8];
235
+ ] }), e[7] = r, e[8] = f) : f = e[8];
235
236
  let m;
236
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ l(Nn, { size: 14 }), e[9] = m) : m = e[9];
237
- let f;
238
- e[10] !== s ? (f = /* @__PURE__ */ T(Ke, { size: "xs", colorPalette: "green", onClick: s, children: [
237
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ a(Yn, { size: 14 }), e[9] = m) : m = e[9];
238
+ let p;
239
+ e[10] !== o ? (p = /* @__PURE__ */ k(Ze, { size: "xs", colorPalette: "green", onClick: o, children: [
239
240
  m,
240
241
  "Allow"
241
- ] }), e[10] = s, e[11] = f) : f = e[11];
242
+ ] }), e[10] = o, e[11] = p) : p = e[11];
242
243
  let h;
243
- e[12] !== p || e[13] !== f ? (h = /* @__PURE__ */ T(Ee, { gap: "xs", justifyContent: "flex-end", children: [
244
- p,
245
- f
246
- ] }), e[12] = p, e[13] = f, e[14] = h) : h = e[14];
244
+ e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ k(Me, { gap: "xs", justifyContent: "flex-end", children: [
245
+ f,
246
+ p
247
+ ] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
247
248
  let g;
248
- return e[15] !== c || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ l(I, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ T(Ce, { direction: "column", gap: "xs", children: [
249
+ return e[15] !== c || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ a(I, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ k(Re, { direction: "column", gap: "xs", children: [
249
250
  c,
250
251
  u,
251
252
  h
252
253
  ] }) }), e[15] = c, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
253
- }, Es = (t) => {
254
+ }, Fo = "md", zo = "neutral", ul = (t) => {
255
+ const e = T(17), {
256
+ attachments: n,
257
+ onSelect: s,
258
+ onRemove: o,
259
+ renderBadge: r,
260
+ size: i,
261
+ tone: l
262
+ } = t;
263
+ let c;
264
+ e[0] !== n ? (c = n === void 0 ? [] : n, e[0] = n, e[1] = c) : c = e[1];
265
+ const u = c, d = i === void 0 ? Fo : i, f = l === void 0 ? zo : l;
266
+ if (u.length === 0)
267
+ return null;
268
+ let m;
269
+ if (e[2] !== u || e[3] !== o || e[4] !== s || e[5] !== r || e[6] !== d || e[7] !== f) {
270
+ let h;
271
+ e[9] !== o || e[10] !== s || e[11] !== r || e[12] !== d || e[13] !== f ? (h = (g) => {
272
+ const y = s ? () => s(g) : void 0, b = o ? () => o(g) : void 0;
273
+ if (r) {
274
+ const x = r({
275
+ attachmentId: g,
276
+ onSelect: y,
277
+ onRemove: b,
278
+ size: d,
279
+ tone: f
280
+ });
281
+ return /* @__PURE__ */ a(xo, { children: x }, g);
282
+ }
283
+ return /* @__PURE__ */ a(zt, { fileName: g, onSelect: y, onRemove: b, size: d, tone: f }, g);
284
+ }, e[9] = o, e[10] = s, e[11] = r, e[12] = d, e[13] = f, e[14] = h) : h = e[14], m = u.map(h), e[2] = u, e[3] = o, e[4] = s, e[5] = r, e[6] = d, e[7] = f, e[8] = m;
285
+ } else
286
+ m = e[8];
287
+ let p;
288
+ return e[15] !== m ? (p = /* @__PURE__ */ a(Y, { marginBottom: "sm", gap: "1", flexDir: "row", flexWrap: "wrap", children: m }), e[15] = m, e[16] = p) : p = e[16], p;
289
+ }, qo = (t) => {
254
290
  const {
255
291
  previousUserMessageCount: e,
256
292
  userMessageCount: n
257
293
  } = t;
258
294
  return e === 0 ? !1 : n > e;
259
295
  };
260
- function Bs(t) {
261
- const e = k(4), {
296
+ function Ho(t) {
297
+ const e = T(4), {
262
298
  userMessageCount: n
263
299
  } = t, {
264
- scrollToBottom: o
265
- } = ct(), s = Qe(n);
300
+ scrollToBottom: s
301
+ } = mt(), o = Ne(n);
266
302
  let r, i;
267
- return e[0] !== o || e[1] !== n ? (r = () => {
268
- Es({
269
- previousUserMessageCount: s.current,
303
+ return e[0] !== s || e[1] !== n ? (r = () => {
304
+ qo({
305
+ previousUserMessageCount: o.current,
270
306
  userMessageCount: n
271
- }) && o(), s.current = n;
272
- }, i = [n, o], e[0] = o, e[1] = n, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), Te(r, i), null;
307
+ }) && s(), o.current = n;
308
+ }, i = [n, s], e[0] = s, e[1] = n, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), Ae(r, i), null;
273
309
  }
274
- const an = (t) => t.trim().length > 0, Ps = (t) => {
310
+ const pn = (t) => t.trim().length > 0, Qo = (t) => {
275
311
  const {
276
312
  isDisabled: e,
277
313
  streaming: n,
278
- text: o
314
+ text: s
279
315
  } = t;
280
- return e || n || !an(o) ? "none" : "submit";
281
- }, Ls = (t) => {
316
+ return e || n || !pn(s) ? "none" : "submit";
317
+ }, Wo = (t) => {
282
318
  const {
283
319
  canInterrupt: e,
284
320
  isDisabled: n,
285
- streaming: o,
286
- text: s
321
+ streaming: s,
322
+ text: o
323
+ } = t;
324
+ return n ? "none" : s ? e ? "interrupt" : "none" : pn(o) ? "submit" : "none";
325
+ }, mn = 200, No = (t, e = mn) => t.length > 0 && t.split(/\r\n|\r|\n/).length > e, Vo = (t) => {
326
+ const {
327
+ onAttachFiles: e,
328
+ onAttachText: n,
329
+ textAttachmentPasteLineThreshold: s
287
330
  } = t;
288
- return n ? "none" : o ? e ? "interrupt" : "none" : an(s) ? "submit" : "none";
289
- }, vs = (t) => {
331
+ return {
332
+ onDragOver: (l) => {
333
+ !e || !Array.from(l.dataTransfer.types).includes("Files") || l.preventDefault();
334
+ },
335
+ onDropCapture: (l) => {
336
+ const c = Array.from(l.dataTransfer.files ?? []);
337
+ c.length === 0 || !e || (l.preventDefault(), e(c));
338
+ },
339
+ onPasteCapture: (l) => {
340
+ const c = Array.from(l.clipboardData.files ?? []);
341
+ if (c.length > 0 && e) {
342
+ l.preventDefault(), e(c);
343
+ return;
344
+ }
345
+ const u = l.clipboardData.getData("text/plain");
346
+ n && No(u, s) && (l.preventDefault(), n(u));
347
+ }
348
+ };
349
+ }, jo = (t) => {
290
350
  t.preventDefault();
291
- }, cn = (t) => {
292
- const e = k(7), {
351
+ }, hn = (t) => {
352
+ const e = T(7), {
293
353
  option: n
294
354
  } = t;
295
- let o;
296
- e[0] !== n.label ? (o = /* @__PURE__ */ l(q, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = o) : o = e[1];
297
355
  let s;
298
- e[2] !== n.description ? (s = n.description ? /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = s) : s = e[3];
356
+ e[0] !== n.label ? (s = /* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
357
+ let o;
358
+ e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
299
359
  let r;
300
- return e[4] !== o || e[5] !== s ? (r = /* @__PURE__ */ T(Z, { gap: "0", minWidth: "0", children: [
301
- o,
302
- s
303
- ] }), e[4] = o, e[5] = s, e[6] = r) : r = e[6], r;
304
- }, $s = (t) => {
305
- const e = k(12), {
360
+ return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ k(Y, { gap: "0", minWidth: "0", children: [
361
+ s,
362
+ o
363
+ ] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
364
+ }, Uo = (t) => {
365
+ const e = T(12), {
306
366
  option: n,
307
- name: o,
308
- checked: s,
367
+ name: s,
368
+ checked: o,
309
369
  editable: r,
310
370
  onToggle: i
311
- } = t, a = !r, c = r ? void 0 : "true";
371
+ } = t, l = !r, c = r ? void 0 : "true";
312
372
  let u;
313
373
  e[0] !== r ? (u = r ? void 0 : {
314
374
  tabIndex: -1
315
375
  }, e[0] = r, e[1] = u) : u = e[1];
316
376
  const d = r ? i : void 0;
317
- let p;
318
- e[2] !== n ? (p = /* @__PURE__ */ l(cn, { option: n }), e[2] = n, e[3] = p) : p = e[3];
377
+ let f;
378
+ e[2] !== n ? (f = /* @__PURE__ */ a(hn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
319
379
  let m;
320
- return e[4] !== s || e[5] !== o || e[6] !== a || e[7] !== c || e[8] !== u || e[9] !== d || e[10] !== p ? (m = /* @__PURE__ */ l(rn, { name: o, checked: s, readOnly: a, "aria-readonly": c, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: p }), e[4] = s, e[5] = o, e[6] = a, e[7] = c, e[8] = u, e[9] = d, e[10] = p, e[11] = m) : m = e[11], m;
321
- }, Os = (t) => {
322
- const e = k(17), {
380
+ return e[4] !== o || e[5] !== s || e[6] !== l || e[7] !== c || e[8] !== u || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ a(dn, { name: s, checked: o, readOnly: l, "aria-readonly": c, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = l, e[7] = c, e[8] = u, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
381
+ }, Ko = (t) => {
382
+ const e = T(17), {
323
383
  question: n,
324
- questionIndex: o,
325
- name: s,
384
+ questionIndex: s,
385
+ name: o,
326
386
  selectedOption: r,
327
387
  editable: i,
328
- onToggleOption: a
388
+ onToggleOption: l
329
389
  } = t, c = r ?? null, u = !i, d = i ? void 0 : "true";
330
- let p;
331
- e[0] !== i || e[1] !== a || e[2] !== n || e[3] !== o ? (p = i ? (h) => {
332
- h.value && a?.(n, o, h.value);
333
- } : void 0, e[0] = i, e[1] = a, e[2] = n, e[3] = o, e[4] = p) : p = e[4];
390
+ let f;
391
+ e[0] !== i || e[1] !== l || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
392
+ h.value && l?.(n, s, h.value);
393
+ } : void 0, e[0] = i, e[1] = l, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
334
394
  let m;
335
395
  if (e[5] !== i || e[6] !== n.options) {
336
396
  let h;
337
- e[8] !== i ? (h = (g) => /* @__PURE__ */ l(ms, { value: g.label, inputProps: i ? void 0 : {
397
+ e[8] !== i ? (h = (g) => /* @__PURE__ */ a(wo, { value: g.label, inputProps: i ? void 0 : {
338
398
  tabIndex: -1
339
- }, alignItems: "flex-start", children: /* @__PURE__ */ l(cn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], m = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = m;
399
+ }, alignItems: "flex-start", children: /* @__PURE__ */ a(hn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], m = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = m;
340
400
  } else
341
401
  m = e[7];
342
- let f;
343
- return e[10] !== s || e[11] !== c || e[12] !== u || e[13] !== d || e[14] !== p || e[15] !== m ? (f = /* @__PURE__ */ l(hs, { name: s, value: c, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: p, children: m }), e[10] = s, e[11] = c, e[12] = u, e[13] = d, e[14] = p, e[15] = m, e[16] = f) : f = e[16], f;
344
- }, Ds = (t) => {
345
- const e = k(4), {
402
+ let p;
403
+ return e[10] !== o || e[11] !== c || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ a(ko, { name: o, value: c, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = o, e[11] = c, e[12] = u, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
404
+ }, Go = (t) => {
405
+ const e = T(4), {
346
406
  items: n
347
407
  } = t;
348
- let o;
349
- e[0] !== n ? (o = n.map(Fs), e[0] = n, e[1] = o) : o = e[1];
350
408
  let s;
351
- return e[2] !== o ? (s = /* @__PURE__ */ l(Z, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: o }), e[2] = o, e[3] = s) : s = e[3], s;
352
- }, un = (t) => {
353
- const e = k(19), {
409
+ e[0] !== n ? (s = n.map(Xo), e[0] = n, e[1] = s) : s = e[1];
410
+ let o;
411
+ return e[2] !== s ? (o = /* @__PURE__ */ a(Y, { as: "ul", gap: "0", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
412
+ }, gn = (t) => {
413
+ const e = T(19), {
354
414
  questions: n,
355
- editable: o,
356
- selectedOptionsByQuestion: s,
415
+ editable: s,
416
+ selectedOptionsByQuestion: o,
357
417
  customAnswersByQuestion: r,
358
418
  onToggleOption: i,
359
- onCustomAnswerChange: a
360
- } = t, c = o === void 0 ? !1 : o;
419
+ onCustomAnswerChange: l
420
+ } = t, c = s === void 0 ? !1 : s;
361
421
  let u;
362
- e[0] !== s ? (u = s === void 0 ? {} : s, e[0] = s, e[1] = u) : u = e[1];
422
+ e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
363
423
  const d = u;
364
- let p;
365
- e[2] !== r ? (p = r === void 0 ? {} : r, e[2] = r, e[3] = p) : p = e[3];
366
- const m = p;
367
424
  let f;
368
- if (e[4] !== m || e[5] !== c || e[6] !== a || e[7] !== i || e[8] !== n || e[9] !== d) {
425
+ e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
426
+ const m = f;
427
+ let p;
428
+ if (e[4] !== m || e[5] !== c || e[6] !== l || e[7] !== i || e[8] !== n || e[9] !== d) {
369
429
  let g;
370
- e[11] !== m || e[12] !== c || e[13] !== a || e[14] !== i || e[15] !== d ? (g = (b, y) => {
371
- const x = b.id ?? `question-${y}`, _ = b.multiple ? "checkbox" : "radio", C = d[x] ?? [];
372
- return /* @__PURE__ */ T(Z, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
373
- /* @__PURE__ */ l(q, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
374
- _ === "radio" ? /* @__PURE__ */ l(Os, { question: b, questionIndex: y, name: x, selectedOption: C[0], editable: c, onToggleOption: i }) : b.options.map((w) => /* @__PURE__ */ l($s, { option: w, name: x, checked: C.includes(w.label), editable: c, onToggle: () => i?.(b, y, w.label) }, w.label)),
375
- b.allowCustomAnswer ? /* @__PURE__ */ l(On, { readOnly: !c, "aria-readonly": c ? void 0 : "true", value: m[x] ?? "", placeholder: c ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "xs", resize: c ? "vertical" : "none", color: "fg", onChange: (w) => a?.(b, y, w.currentTarget.value) }) : null
430
+ e[11] !== m || e[12] !== c || e[13] !== l || e[14] !== i || e[15] !== d ? (g = (y, b) => {
431
+ const x = y.id ?? `question-${b}`, C = y.multiple ? "checkbox" : "radio", A = d[x] ?? [];
432
+ return /* @__PURE__ */ k(Y, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
433
+ /* @__PURE__ */ a(X, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: y.question }),
434
+ C === "radio" ? /* @__PURE__ */ a(Ko, { question: y, questionIndex: b, name: x, selectedOption: A[0], editable: c, onToggleOption: i }) : y.options.map((w) => /* @__PURE__ */ a(Uo, { option: w, name: x, checked: A.includes(w.label), editable: c, onToggle: () => i?.(y, b, w.label) }, w.label)),
435
+ y.allowCustomAnswer ? /* @__PURE__ */ a(Qn, { readOnly: !c, "aria-readonly": c ? void 0 : "true", value: m[x] ?? "", placeholder: c ? "Answer..." : "Custom answer", "aria-label": y.question, rows: 2, borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "xs", resize: c ? "vertical" : "none", color: "fg", onChange: (w) => l?.(y, b, w.currentTarget.value) }) : null
376
436
  ] }, x);
377
- }, e[11] = m, e[12] = c, e[13] = a, e[14] = i, e[15] = d, e[16] = g) : g = e[16], f = n.map(g), e[4] = m, e[5] = c, e[6] = a, e[7] = i, e[8] = n, e[9] = d, e[10] = f;
437
+ }, e[11] = m, e[12] = c, e[13] = l, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = c, e[6] = l, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
378
438
  } else
379
- f = e[10];
439
+ p = e[10];
380
440
  let h;
381
- return e[17] !== f ? (h = /* @__PURE__ */ l(Z, { as: "form", gap: "sm", onSubmit: vs, "aria-label": "Question form", children: f }), e[17] = f, e[18] = h) : h = e[18], h;
441
+ return e[17] !== p ? (h = /* @__PURE__ */ a(Y, { as: "form", gap: "sm", onSubmit: jo, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
382
442
  };
383
- function Fs(t, e) {
384
- return /* @__PURE__ */ l(I, { as: "li", children: /* @__PURE__ */ l(rn, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
443
+ function Xo(t, e) {
444
+ return /* @__PURE__ */ a(I, { as: "li", children: /* @__PURE__ */ a(dn, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
385
445
  tabIndex: -1
386
- }, size: "xs", children: /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
446
+ }, size: "xs", children: /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
387
447
  }
388
- const ae = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
389
- id: ae(e, n),
448
+ const de = (t, e) => t.id ?? `question-${e}`, Dt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
449
+ id: de(e, n),
390
450
  question: e.question,
391
451
  multiple: !!e.multiple,
392
452
  required: !!e.required,
393
453
  allowCustomAnswer: !!e.allowCustomAnswer,
394
- options: e.options.map((o) => ({
395
- label: o.label,
396
- description: o.description ?? ""
454
+ options: e.options.map((s) => ({
455
+ label: s.label,
456
+ description: s.description ?? ""
397
457
  }))
398
- }))) : "", zs = (t, e, n) => {
399
- const o = [];
400
- for (let s = 0; s < t.questions.length; s += 1) {
401
- const r = t.questions[s], i = ae(r, s), a = e[i] ?? [], c = n[i]?.trim(), u = c ? [...a, c] : a;
402
- u.length !== 0 && o.push(`${r.question}: ${u.join(", ")}`);
458
+ }))) : "", Yo = (t, e, n) => {
459
+ const s = [];
460
+ for (let o = 0; o < t.questions.length; o += 1) {
461
+ const r = t.questions[o], i = de(r, o), l = e[i] ?? [], c = n[i]?.trim(), u = c ? [...l, c] : l;
462
+ u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
403
463
  }
404
- return o;
405
- }, qs = (t) => typeof t != "string", Ot = (t, e) => {
406
- if (qs(e)) return e;
464
+ return s;
465
+ }, Jo = (t) => typeof t != "string", qt = (t, e) => {
466
+ if (Jo(e)) return e;
407
467
  const n = e.trim();
408
468
  if (n.length === 0) return {};
409
- const o = {};
410
- for (let s = 0; s < t.questions.length; s += 1) {
411
- const r = t.questions[s];
412
- r.allowCustomAnswer && (o[ae(r, s)] = n);
469
+ const s = {};
470
+ for (let o = 0; o < t.questions.length; o += 1) {
471
+ const r = t.questions[o];
472
+ r.allowCustomAnswer && (s[de(r, o)] = n);
413
473
  }
414
- return o;
415
- }, Qs = (t, e, n) => {
474
+ return s;
475
+ }, Zo = (t, e, n) => {
416
476
  if (!t) return typeof n == "string" ? n.trim() : "";
417
- const o = Ot(t, n), s = zs(t, e, o), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((a) => a.allowCustomAnswer);
418
- return r.length > 0 && !i && s.push(`Additional response: ${r}`), s.join(`
477
+ const s = qt(t, n), o = Yo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((l) => l.allowCustomAnswer);
478
+ return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
419
479
  `);
420
- }, Hs = (t, e, n) => {
421
- const o = Ot(t, n);
422
- return t.questions.map((s, r) => {
423
- const i = ae(s, r), a = e[i] ?? [], c = o[i]?.trim();
424
- return c ? [...a, c] : a;
480
+ }, es = (t, e, n) => {
481
+ const s = qt(t, n);
482
+ return t.questions.map((o, r) => {
483
+ const i = de(o, r), l = e[i] ?? [], c = s[i]?.trim();
484
+ return c ? [...l, c] : l;
425
485
  });
426
- }, Ws = (t, e, n) => {
486
+ }, ts = (t, e, n) => {
427
487
  if (!t) return !1;
428
- const o = Ot(t, n);
429
- for (let s = 0; s < t.questions.length; s += 1) {
430
- const r = t.questions[s];
488
+ const s = qt(t, n);
489
+ for (let o = 0; o < t.questions.length; o += 1) {
490
+ const r = t.questions[o];
431
491
  if (!r.required) continue;
432
- const i = ae(r, s);
433
- if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && o[i]?.trim()))
492
+ const i = de(r, o);
493
+ if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
434
494
  return !0;
435
495
  }
436
496
  return !1;
437
- }, Ns = (t) => t.questions.map((e, n) => ({
438
- id: ae(e, n),
497
+ }, ns = (t) => t.questions.map((e, n) => ({
498
+ id: de(e, n),
439
499
  question: e.question,
440
500
  options: e.options,
441
501
  multiple: !!e.multiple,
442
502
  required: !!e.required,
443
503
  allowCustomAnswer: !!e.allowCustomAnswer
444
- })), Vs = (t, e, n, o) => {
445
- const s = ae(t, e);
446
- return (n[s] ?? []).length > 0 || !!o[s]?.trim();
447
- }, js = (t) => {
448
- const e = k(22), {
504
+ })), os = (t, e, n, s) => {
505
+ const o = de(t, e);
506
+ return (n[o] ?? []).length > 0 || !!s[o]?.trim();
507
+ }, ss = (t) => {
508
+ const e = T(22), {
449
509
  question: n,
450
- sourceQuestion: o,
451
- questionIndex: s,
510
+ sourceQuestion: s,
511
+ questionIndex: o,
452
512
  isActive: r,
453
513
  selectedOptionsByQuestion: i,
454
- customAnswersByQuestion: a,
514
+ customAnswersByQuestion: l,
455
515
  onSelectStep: c
456
516
  } = t;
457
517
  let u;
458
- e[0] !== a || e[1] !== s || e[2] !== i || e[3] !== o ? (u = Vs(o, s, i, a), e[0] = a, e[1] = s, e[2] = i, e[3] = o, e[4] = u) : u = e[4];
459
- const d = u, p = d ? "answered" : "not answered", m = r ? "outline" : "ghost", f = `question-step-tab-${n.id}`, h = `${n.question} (${p})`, g = `question-step-panel-${n.id}`;
460
- let b;
461
- e[5] !== c || e[6] !== s ? (b = () => c(s), e[5] = c, e[6] = s, e[7] = b) : b = e[7];
518
+ e[0] !== l || e[1] !== o || e[2] !== i || e[3] !== s ? (u = os(s, o, i, l), e[0] = l, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
519
+ const d = u, f = d ? "answered" : "not answered", m = r ? "outline" : "ghost", p = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
462
520
  let y;
463
- e[8] !== d || e[9] !== s ? (y = d ? /* @__PURE__ */ l(en, { "aria-hidden": "true" }) : s + 1, e[8] = d, e[9] = s, e[10] = y) : y = e[10];
521
+ e[5] !== c || e[6] !== o ? (y = () => c(o), e[5] = c, e[6] = o, e[7] = y) : y = e[7];
522
+ let b;
523
+ e[8] !== d || e[9] !== o ? (b = d ? /* @__PURE__ */ a(rn, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = b) : b = e[10];
464
524
  let x;
465
- e[11] !== r || e[12] !== f || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== y || e[17] !== m ? (x = /* @__PURE__ */ l(Ke, { id: f, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: b, children: y }), e[11] = r, e[12] = f, e[13] = h, e[14] = g, e[15] = b, e[16] = y, e[17] = m, e[18] = x) : x = e[18];
466
- let _;
467
- return e[19] !== n.question || e[20] !== x ? (_ = /* @__PURE__ */ l(sn, { content: n.question, showArrow: !0, children: x }), e[19] = n.question, e[20] = x, e[21] = _) : _ = e[21], _;
468
- }, Us = (t) => {
469
- const e = k(31), {
525
+ e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== y || e[16] !== b || e[17] !== m ? (x = /* @__PURE__ */ a(Ze, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: y, children: b }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = y, e[16] = b, e[17] = m, e[18] = x) : x = e[18];
526
+ let C;
527
+ return e[19] !== n.question || e[20] !== x ? (C = /* @__PURE__ */ a(cn, { content: n.question, showArrow: !0, children: x }), e[19] = n.question, e[20] = x, e[21] = C) : C = e[21], C;
528
+ }, rs = (t) => {
529
+ const e = T(31), {
470
530
  questionPrompt: n,
471
- selectedOptionsByQuestion: o,
472
- customAnswersByQuestion: s,
531
+ selectedOptionsByQuestion: s,
532
+ customAnswersByQuestion: o,
473
533
  onToggleOption: r,
474
534
  onCustomAnswerChange: i
475
535
  } = t, {
476
- questions: a
477
- } = t, [c, u] = G(0), d = Math.min(c, a.length - 1), p = a[d], m = a.length > 1;
478
- let f;
479
- e[0] !== s || e[1] !== m || e[2] !== n.questions || e[3] !== a || e[4] !== d || e[5] !== o ? (f = m ? /* @__PURE__ */ l(Ee, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: a.map((B, M) => /* @__PURE__ */ l(js, { question: B, sourceQuestion: n.questions[M], questionIndex: M, isActive: M === d, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onSelectStep: u }, B.id)) }) : null, e[0] = s, e[1] = m, e[2] = n.questions, e[3] = a, e[4] = d, e[5] = o, e[6] = f) : f = e[6];
480
- const h = `question-step-panel-${p.id}`, g = m ? "tabpanel" : void 0, b = m ? `question-step-tab-${p.id}` : void 0;
481
- let y;
482
- e[7] !== p ? (y = [p], e[7] = p, e[8] = y) : y = e[8];
536
+ questions: l
537
+ } = t, [c, u] = G(0), d = Math.min(c, l.length - 1), f = l[d], m = l.length > 1;
538
+ let p;
539
+ e[0] !== o || e[1] !== m || e[2] !== n.questions || e[3] !== l || e[4] !== d || e[5] !== s ? (p = m ? /* @__PURE__ */ a(Me, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: l.map((M, P) => /* @__PURE__ */ a(ss, { question: M, sourceQuestion: n.questions[P], questionIndex: P, isActive: P === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, M.id)) }) : null, e[0] = o, e[1] = m, e[2] = n.questions, e[3] = l, e[4] = d, e[5] = s, e[6] = p) : p = e[6];
540
+ const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, y = m ? `question-step-tab-${f.id}` : void 0;
541
+ let b;
542
+ e[7] !== f ? (b = [f], e[7] = f, e[8] = b) : b = e[8];
483
543
  let x;
484
- e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (B, M, P) => {
485
- r(n.questions[d], d, P);
544
+ e[9] !== r || e[10] !== n.questions || e[11] !== d ? (x = (M, P, v) => {
545
+ r(n.questions[d], d, v);
486
546
  }, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = x) : x = e[12];
487
- let _;
488
- e[13] !== i || e[14] !== n.questions || e[15] !== d ? (_ = (B, M, P) => {
489
- i(n.questions[d], d, P);
490
- }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = _) : _ = e[16];
491
547
  let C;
492
- e[17] !== s || e[18] !== o || e[19] !== y || e[20] !== x || e[21] !== _ ? (C = /* @__PURE__ */ l(un, { questions: y, editable: !0, selectedOptionsByQuestion: o, customAnswersByQuestion: s, onToggleOption: x, onCustomAnswerChange: _ }), e[17] = s, e[18] = o, e[19] = y, e[20] = x, e[21] = _, e[22] = C) : C = e[22];
548
+ e[13] !== i || e[14] !== n.questions || e[15] !== d ? (C = (M, P, v) => {
549
+ i(n.questions[d], d, v);
550
+ }, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = C) : C = e[16];
551
+ let A;
552
+ e[17] !== o || e[18] !== s || e[19] !== b || e[20] !== x || e[21] !== C ? (A = /* @__PURE__ */ a(gn, { questions: b, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: x, onCustomAnswerChange: C }), e[17] = o, e[18] = s, e[19] = b, e[20] = x, e[21] = C, e[22] = A) : A = e[22];
493
553
  let w;
494
- e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== C ? (w = /* @__PURE__ */ l(Z, { id: h, role: g, "aria-labelledby": b, gap: "0", children: C }), e[23] = h, e[24] = g, e[25] = b, e[26] = C, e[27] = w) : w = e[27];
495
- let R;
496
- return e[28] !== f || e[29] !== w ? (R = /* @__PURE__ */ T(Z, { gap: "xs", pb: "sm", children: [
497
- f,
554
+ e[23] !== h || e[24] !== g || e[25] !== y || e[26] !== A ? (w = /* @__PURE__ */ a(Y, { id: h, role: g, "aria-labelledby": y, gap: "0", children: A }), e[23] = h, e[24] = g, e[25] = y, e[26] = A, e[27] = w) : w = e[27];
555
+ let _;
556
+ return e[28] !== p || e[29] !== w ? (_ = /* @__PURE__ */ k(Y, { gap: "xs", pb: "sm", children: [
557
+ p,
498
558
  w
499
- ] }), e[28] = f, e[29] = w, e[30] = R) : R = e[30], R;
500
- }, Ks = (t) => {
501
- const e = k(8), {
559
+ ] }), e[28] = p, e[29] = w, e[30] = _) : _ = e[30], _;
560
+ }, is = (t) => {
561
+ const e = T(8), {
502
562
  questionPrompt: n
503
563
  } = t;
504
- let o;
505
- e[0] !== n ? (o = Ns(n), e[0] = n, e[1] = o) : o = e[1];
506
- const s = o;
564
+ let s;
565
+ e[0] !== n ? (s = ns(n), e[0] = n, e[1] = s) : s = e[1];
566
+ const o = s;
507
567
  let r;
508
- e[2] !== n ? (r = Bt(n), e[2] = n, e[3] = r) : r = e[3];
568
+ e[2] !== n ? (r = Dt(n), e[2] = n, e[3] = r) : r = e[3];
509
569
  const i = r;
510
- let a;
511
- return e[4] !== t || e[5] !== i || e[6] !== s ? (a = /* @__PURE__ */ l(Us, { ...t, questions: s }, i), e[4] = t, e[5] = i, e[6] = s, e[7] = a) : a = e[7], a;
512
- }, Gs = (t) => {
513
- const e = k(22);
514
- let n, o, s, r;
570
+ let l;
571
+ return e[4] !== t || e[5] !== i || e[6] !== o ? (l = /* @__PURE__ */ a(rs, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = l) : l = e[7], l;
572
+ }, ls = (t) => {
573
+ const e = T(22);
574
+ let n, s, o, r;
515
575
  e[0] !== t ? ({
516
576
  title: r,
517
- shortcut: s,
577
+ shortcut: o,
518
578
  canInterrupt: n,
519
- ...o
520
- } = 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]);
521
- const i = o["aria-label"] ?? r;
522
- let a;
523
- e[5] !== n ? (a = n ? /* @__PURE__ */ l(Vn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ l(jn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = a) : a = e[6];
524
- const c = a;
579
+ ...s
580
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = o, e[4] = r) : (n = e[1], s = e[2], o = e[3], r = e[4]);
581
+ const i = s["aria-label"] ?? r;
582
+ let l;
583
+ e[5] !== n ? (l = n ? /* @__PURE__ */ a(Jn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ a(Zn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = l) : l = e[6];
584
+ const c = l;
525
585
  let u;
526
- e[7] !== i || e[8] !== c || e[9] !== o || e[10] !== r ? (u = /* @__PURE__ */ l(vt, { "data-testid": "send-message-button", size: "sm", variant: "primary", borderRadius: "full", "aria-label": i, title: r, ...o, children: c }), e[7] = i, e[8] = c, e[9] = o, e[10] = r, e[11] = u) : u = e[11];
586
+ e[7] !== i || e[8] !== c || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ a($t, { "data-testid": "send-message-button", size: "sm", variant: "primary", borderRadius: "full", "aria-label": i, title: r, ...s, children: c }), e[7] = i, e[8] = c, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
527
587
  const d = u;
528
588
  if (r) {
529
- let p;
530
- e[12] !== s || e[13] !== r ? (p = s ? /* @__PURE__ */ T(Lt, { children: [
589
+ let f;
590
+ e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ k(Ot, { children: [
531
591
  r,
532
592
  " ",
533
- /* @__PURE__ */ l(Fn, { fontSize: "xs", children: s })
534
- ] }) : r, e[12] = s, e[13] = r, e[14] = p) : p = e[14];
535
- const m = p;
536
- let f;
537
- e[15] !== d ? (f = /* @__PURE__ */ l(it.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = f) : f = e[16];
593
+ /* @__PURE__ */ a(Nn, { fontSize: "xs", children: o })
594
+ ] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
595
+ const m = f;
596
+ let p;
597
+ e[15] !== d ? (p = /* @__PURE__ */ a(dt.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
538
598
  let h;
539
- e[17] !== m ? (h = /* @__PURE__ */ l(Dn, { children: /* @__PURE__ */ l(it.Positioner, { children: /* @__PURE__ */ l(it.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
599
+ e[17] !== m ? (h = /* @__PURE__ */ a(Wn, { children: /* @__PURE__ */ a(dt.Positioner, { children: /* @__PURE__ */ a(dt.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
540
600
  let g;
541
- return e[19] !== f || e[20] !== h ? (g = /* @__PURE__ */ T(it.Root, { closeDelay: 50, openDelay: 100, children: [
542
- f,
601
+ return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ k(dt.Root, { closeDelay: 50, openDelay: 100, children: [
602
+ p,
543
603
  h
544
- ] }), e[19] = f, e[20] = h, e[21] = g) : g = e[21], g;
604
+ ] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
545
605
  }
546
606
  return d;
547
- }, Xs = (t) => {
548
- const e = k(94), {
607
+ }, as = (t) => {
608
+ const e = T(2), {
609
+ placeholder: n
610
+ } = t;
611
+ if (!n)
612
+ return null;
613
+ let s;
614
+ return e[0] !== n ? (s = /* @__PURE__ */ a(X, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: n }), e[0] = n, e[1] = s) : s = e[1], s;
615
+ }, cs = (t) => {
616
+ const e = T(100), {
549
617
  defaultState: n,
550
- onSubmit: o,
551
- onInterrupt: s,
552
- streaming: r,
553
- attachedResources: i,
554
- onClearAttachments: a,
555
- isDisabled: c,
556
- onChange: u,
557
- placeholder: d,
558
- attachmentList: p,
559
- actions: m,
560
- attachedToTop: f,
561
- questionPrompt: h,
562
- autoFocus: g
563
- } = t, b = o === void 0 ? Ys : o, y = r === void 0 ? !1 : r;
564
- let x;
565
- e[0] !== i ? (x = i === void 0 ? [] : i, e[0] = i, e[1] = x) : x = e[1];
566
- const _ = x, C = c === void 0 ? !1 : c, w = f === void 0 ? !1 : f, R = g === void 0 ? !1 : g, [B, M] = G(!1), [P, Q] = G(n), [L, H] = G(0);
618
+ onSubmit: s,
619
+ onInterrupt: o,
620
+ onAttachFiles: r,
621
+ onAttachText: i,
622
+ textAttachmentPasteLineThreshold: l,
623
+ streaming: c,
624
+ attachedResources: u,
625
+ onClearAttachments: d,
626
+ isDisabled: f,
627
+ onChange: m,
628
+ placeholder: p,
629
+ attachmentList: h,
630
+ actions: g,
631
+ attachedToTop: y,
632
+ questionPrompt: b,
633
+ autoFocus: x
634
+ } = t, C = s === void 0 ? us : s, A = l === void 0 ? mn : l, w = c === void 0 ? !1 : c;
635
+ let _;
636
+ e[0] !== u ? (_ = u === void 0 ? [] : u, e[0] = u, e[1] = _) : _ = e[1];
637
+ const M = _, P = f === void 0 ? !1 : f, v = y === void 0 ? !1 : y, L = x === void 0 ? !1 : x, [H, J] = G(!1), [B, ve] = G(n), [je, Le] = G(0);
638
+ let he;
639
+ e[2] !== n ? (he = () => Mt(n), e[2] = n, e[3] = he) : he = e[3];
640
+ const [F, z] = G(he);
567
641
  let ee;
568
- e[2] !== n ? (ee = () => At(n), e[2] = n, e[3] = ee) : ee = e[3];
569
- const [_e, Ae] = G(ee);
570
- let $;
571
- e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = {}, e[4] = $) : $ = e[4];
572
- const [E, te] = G($);
573
- let W;
574
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = {}, e[5] = W) : W = e[5];
575
- const [O, fe] = G(W), Re = Qe(null), We = Qe(u);
576
- let Pe;
577
- e[6] !== h ? (Pe = Bt(h), e[6] = h, e[7] = Pe) : Pe = e[7];
578
- const Ye = Qe(Pe);
579
- let Le, ne;
580
- e[8] !== u ? (Le = () => {
581
- We.current = u;
582
- }, ne = [u], e[8] = u, e[9] = Le, e[10] = ne) : (Le = e[9], ne = e[10]), Te(Le, ne);
583
- let se, Ne;
584
- e[11] !== n ? (se = () => {
585
- const A = At(n);
586
- Q(n), H(Js), Ae(A), te({}), fe({}), We.current?.(A);
587
- }, Ne = [n], e[11] = n, e[12] = se, e[13] = Ne) : (se = e[12], Ne = e[13]), Te(se, Ne);
588
- let pe;
589
- e[14] !== h ? (pe = Bt(h), e[14] = h, e[15] = pe) : pe = e[15];
590
- const X = pe;
591
- let me, he;
592
- e[16] !== X ? (me = () => {
593
- Ye.current !== X && (Ye.current = X, te({}), fe({}));
594
- }, he = [X], e[16] = X, e[17] = me, e[18] = he) : (me = e[17], he = e[18]), Te(me, he);
595
- let oe;
596
- e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (oe = () => {
597
- const A = Re.current?.querySelector('[contenteditable="true"]');
598
- A instanceof HTMLElement && A.focus();
599
- }, e[19] = oe) : oe = e[19];
600
- const Ie = oe;
601
- let ve, N;
602
- e[20] !== R ? (ve = () => {
603
- if (!R)
642
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ee = {}, e[4] = ee) : ee = e[4];
643
+ const [E, ge] = G(ee);
644
+ let be;
645
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (be = {}, e[5] = be) : be = e[5];
646
+ const [O, De] = G(be), Ue = Ne(null), Ke = Ne(m);
647
+ let Be;
648
+ e[6] !== b ? (Be = Dt(b), e[6] = b, e[7] = Be) : Be = e[7];
649
+ const Ie = Ne(Be);
650
+ let te, Ge;
651
+ e[8] !== m ? (te = () => {
652
+ Ke.current = m;
653
+ }, Ge = [m], e[8] = m, e[9] = te, e[10] = Ge) : (te = e[9], Ge = e[10]), Ae(te, Ge);
654
+ let ye, ne;
655
+ e[11] !== n ? (ye = () => {
656
+ const R = Mt(n);
657
+ ve(n), Le(ds), z(R), ge({}), De({}), Ke.current?.(R);
658
+ }, ne = [n], e[11] = n, e[12] = ye, e[13] = ne) : (ye = e[12], ne = e[13]), Ae(ye, ne);
659
+ let xe;
660
+ e[14] !== b ? (xe = Dt(b), e[14] = b, e[15] = xe) : xe = e[15];
661
+ const oe = xe;
662
+ let se, re;
663
+ e[16] !== oe ? (se = () => {
664
+ Ie.current !== oe && (Ie.current = oe, ge({}), De({}));
665
+ }, re = [oe], e[16] = oe, e[17] = se, e[18] = re) : (se = e[17], re = e[18]), Ae(se, re);
666
+ let Oe;
667
+ e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Oe = () => {
668
+ const R = Ue.current?.querySelector('[contenteditable="true"]');
669
+ R instanceof HTMLElement && R.focus();
670
+ }, e[19] = Oe) : Oe = e[19];
671
+ const ie = Oe;
672
+ let Se, Q;
673
+ e[20] !== L ? (Se = () => {
674
+ if (!L)
604
675
  return;
605
- const A = requestAnimationFrame(() => {
606
- const Se = Re.current?.querySelector('[contenteditable="true"]');
607
- Se instanceof HTMLElement && Se.focus(), M(!0);
676
+ const R = requestAnimationFrame(() => {
677
+ const ke = Ue.current?.querySelector('[contenteditable="true"]');
678
+ ke instanceof HTMLElement && ke.focus(), J(!0);
608
679
  });
609
- return () => cancelAnimationFrame(A);
610
- }, N = [R], e[20] = R, e[21] = ve, e[22] = N) : (ve = e[21], N = e[22]), Te(ve, N);
611
- let ge;
612
- e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ge = () => {
613
- M(!0), Ie();
614
- }, e[23] = ge) : ge = e[23];
615
- const be = ge;
616
- let V;
617
- e[24] !== n ? (V = (A) => {
618
- const Se = A === void 0 ? !1 : A;
619
- Q(n), H(Zs);
620
- const ie = At(n);
621
- Ae(ie), te({}), fe({}), We.current?.(ie), Se && requestAnimationFrame(() => {
622
- Ie();
680
+ return () => cancelAnimationFrame(R);
681
+ }, Q = [L], e[20] = L, e[21] = Se, e[22] = Q) : (Se = e[21], Q = e[22]), Ae(Se, Q);
682
+ let W;
683
+ e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (W = () => {
684
+ J(!0), ie();
685
+ }, e[23] = W) : W = e[23];
686
+ const Te = W;
687
+ let N;
688
+ e[24] !== n ? (N = (R) => {
689
+ const ke = R === void 0 ? !1 : R;
690
+ ve(n), Le(fs);
691
+ const ce = Mt(n);
692
+ z(ce), ge({}), De({}), Ke.current?.(ce), ke && requestAnimationFrame(() => {
693
+ ie();
623
694
  });
624
- }, e[24] = n, e[25] = V) : V = e[25];
625
- const Y = V, D = y && !!s;
626
- let F, z, j;
627
- if (e[26] !== D || e[27] !== O || e[28] !== C || e[29] !== h || e[30] !== E || e[31] !== y || e[32] !== _e) {
628
- z = h ? Qs(h, E, O) : _e.trim();
629
- const A = Ws(h, E, O);
630
- F = {
631
- canInterrupt: D,
632
- isDisabled: C || A,
633
- streaming: y,
634
- text: z
635
- }, j = Ls(F), e[26] = D, e[27] = O, e[28] = C, e[29] = h, e[30] = E, e[31] = y, e[32] = _e, e[33] = F, e[34] = z, e[35] = j;
695
+ }, e[24] = n, e[25] = N) : N = e[25];
696
+ const Z = N, V = w && !!o;
697
+ let $, D, j;
698
+ if (e[26] !== V || e[27] !== O || e[28] !== P || e[29] !== b || e[30] !== E || e[31] !== w || e[32] !== F) {
699
+ D = b ? Zo(b, E, O) : F.trim();
700
+ const R = ts(b, E, O);
701
+ $ = {
702
+ canInterrupt: V,
703
+ isDisabled: P || R,
704
+ streaming: w,
705
+ text: D
706
+ }, j = Wo($), e[26] = V, e[27] = O, e[28] = P, e[29] = b, e[30] = E, e[31] = w, e[32] = F, e[33] = $, e[34] = D, e[35] = j;
636
707
  } else
637
- F = e[33], z = e[34], j = e[35];
708
+ $ = e[33], D = e[34], j = e[35];
638
709
  const U = j;
639
- let K;
640
- e[36] !== _ || e[37] !== O || e[38] !== a || e[39] !== b || e[40] !== h || e[41] !== Y || e[42] !== z || e[43] !== E ? (K = () => {
641
- if (!z)
710
+ let le;
711
+ e[36] !== M || e[37] !== O || e[38] !== d || e[39] !== C || e[40] !== b || e[41] !== Z || e[42] !== D || e[43] !== E ? (le = () => {
712
+ if (!D)
642
713
  return;
643
- const A = h ? {
644
- answers: Hs(h, E, O)
714
+ const R = b ? {
715
+ answers: es(b, E, O)
645
716
  } : void 0;
646
- b(z, _, A), Y(!0), a?.();
647
- }, e[36] = _, e[37] = O, e[38] = a, e[39] = b, e[40] = h, e[41] = Y, e[42] = z, e[43] = E, e[44] = K) : K = e[44];
648
- const J = K;
649
- let re;
650
- e[45] !== s || e[46] !== J ? (re = (A) => {
651
- if (A === "interrupt") {
652
- s?.();
717
+ C(D, M, R), Z(!0), d?.();
718
+ }, e[36] = M, e[37] = O, e[38] = d, e[39] = C, e[40] = b, e[41] = Z, e[42] = D, e[43] = E, e[44] = le) : le = e[44];
719
+ const q = le;
720
+ let we;
721
+ e[45] !== o || e[46] !== q ? (we = (R) => {
722
+ if (R === "interrupt") {
723
+ o?.();
653
724
  return;
654
725
  }
655
- A === "submit" && J();
656
- }, e[45] = s, e[46] = J, e[47] = re) : re = e[47];
657
- const v = re;
658
- let ye;
659
- e[48] !== F || e[49] !== v ? (ye = () => {
660
- v(Ps(F));
661
- }, e[48] = F, e[49] = v, e[50] = ye) : ye = e[50];
662
- const xe = ye;
663
- let Je;
664
- e[51] !== U || e[52] !== v ? (Je = () => {
665
- v(U);
666
- }, e[51] = U, e[52] = v, e[53] = Je) : Je = e[53];
667
- const mt = Je;
668
- let Ze;
669
- e[54] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ze = (A, Se, ie) => {
670
- const Ve = ae(A, Se);
671
- te((je) => {
672
- const _t = je[Ve] ?? [], qt = _t.includes(ie);
673
- return A.multiple ? {
674
- ...je,
675
- [Ve]: qt ? _t.filter((Bn) => Bn !== ie) : [..._t, ie]
726
+ R === "submit" && q();
727
+ }, e[45] = o, e[46] = q, e[47] = we) : we = e[47];
728
+ const K = we;
729
+ let nt;
730
+ e[48] !== $ || e[49] !== K ? (nt = () => K(Qo($)), e[48] = $, e[49] = K, e[50] = nt) : nt = e[50];
731
+ const xt = nt;
732
+ let ot;
733
+ e[51] !== U || e[52] !== K ? (ot = () => K(U), e[51] = U, e[52] = K, e[53] = ot) : ot = e[53];
734
+ const St = ot;
735
+ let st;
736
+ e[54] !== r || e[55] !== i || e[56] !== A ? (st = Vo({
737
+ onAttachFiles: r,
738
+ onAttachText: i,
739
+ textAttachmentPasteLineThreshold: A
740
+ }), e[54] = r, e[55] = i, e[56] = A, e[57] = st) : st = e[57];
741
+ const ae = st;
742
+ let rt;
743
+ e[58] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (rt = (R, ke, ce) => {
744
+ const Xe = de(R, ke);
745
+ ge((Ye) => {
746
+ const Pt = Ye[Xe] ?? [], Vt = Pt.includes(ce);
747
+ return R.multiple ? {
748
+ ...Ye,
749
+ [Xe]: Vt ? Pt.filter(($n) => $n !== ce) : [...Pt, ce]
676
750
  } : {
677
- ...je,
678
- [Ve]: qt ? [] : [ie]
751
+ ...Ye,
752
+ [Xe]: Vt ? [] : [ce]
679
753
  };
680
754
  });
681
- }, e[54] = Ze) : Ze = e[54];
682
- const Mn = Ze;
683
- let et;
684
- e[55] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (et = (A, Se, ie) => {
685
- const Ve = ae(A, Se);
686
- fe((je) => ({
687
- ...je,
688
- [Ve]: ie
755
+ }, e[58] = rt) : rt = e[58];
756
+ const Bn = rt;
757
+ let it;
758
+ e[59] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (it = (R, ke, ce) => {
759
+ const Xe = de(R, ke);
760
+ De((Ye) => ({
761
+ ...Ye,
762
+ [Xe]: ce
689
763
  }));
690
- }, e[55] = et) : et = e[55];
691
- const En = et;
692
- let tt;
693
- e[56] !== d ? (tt = d ? /* @__PURE__ */ l(q, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: d }) : void 0, e[56] = d, e[57] = tt) : tt = e[57];
694
- const ht = tt, gt = w ? "-1px" : void 0, bt = w ? "0" : void 0, yt = B ? "blue.border" : "border.muted", xt = B ? "mid" : "low", St = B ? 1 : 0, kt = B ? "blue.border" : "border";
764
+ }, e[59] = it) : it = e[59];
765
+ const On = it, Tt = v ? "-1px" : void 0, wt = v ? "0" : void 0, kt = H ? "blue.border" : "border.muted", Ct = H ? 1 : 0, At = H ? "blue.border" : "border";
695
766
  let $e;
696
- e[58] !== kt ? ($e = {
697
- borderColor: kt,
698
- boxShadow: "mid",
767
+ e[60] !== At ? ($e = {
768
+ borderColor: At,
699
769
  zIndex: 1
700
- }, e[58] = kt, e[59] = $e) : $e = e[59];
701
- let nt;
702
- e[60] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (nt = {
770
+ }, e[60] = At, e[61] = $e) : $e = e[61];
771
+ let lt;
772
+ e[62] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (lt = {
703
773
  borderColor: "blue.border",
704
- boxShadow: "mid",
705
774
  zIndex: 1
706
- }, e[60] = nt) : nt = e[60];
707
- let st;
708
- e[61] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (st = () => M(!1), e[61] = st) : st = e[61];
709
- let Oe;
710
- e[62] !== O || e[63] !== L || e[64] !== P || e[65] !== xe || e[66] !== C || e[67] !== u || e[68] !== ht || e[69] !== h || e[70] !== E ? (Oe = h ? /* @__PURE__ */ l(Ks, { questionPrompt: h, selectedOptionsByQuestion: E, customAnswersByQuestion: O, onToggleOption: Mn, onCustomAnswerChange: En }) : /* @__PURE__ */ l(ut, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
711
- pr: "2xs"
712
- }, children: /* @__PURE__ */ l(ds, { defaultState: P, isEditable: !C, placeholder: ht, onChange: (A) => {
713
- Ae(A), u?.(A);
714
- }, onSubmit: xe }, L) }), e[62] = O, e[63] = L, e[64] = P, e[65] = xe, e[66] = C, e[67] = u, e[68] = ht, e[69] = h, e[70] = E, e[71] = Oe) : Oe = e[71];
715
- let ot;
716
- e[72] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ot = /* @__PURE__ */ l(zn, {}), e[72] = ot) : ot = e[72];
717
- const Tt = D ? "Stop Response" : "Message Sending", wt = y ? void 0 : "Enter", Ct = U === "none";
718
- let De;
719
- e[73] !== D || e[74] !== mt || e[75] !== Tt || e[76] !== wt || e[77] !== Ct ? (De = /* @__PURE__ */ l(Gs, { canInterrupt: D, title: Tt, shortcut: wt, onClick: mt, disabled: Ct }), e[73] = D, e[74] = mt, e[75] = Tt, e[76] = wt, e[77] = Ct, e[78] = De) : De = e[78];
775
+ }, e[62] = lt) : lt = e[62];
776
+ let at;
777
+ e[63] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (at = () => J(!1), e[63] = at) : at = e[63];
720
778
  let Fe;
721
- e[79] !== m || e[80] !== De ? (Fe = /* @__PURE__ */ T(Ee, { gap: "1", mt: "md", children: [
722
- m,
723
- ot,
724
- De
725
- ] }), e[79] = m, e[80] = De, e[81] = Fe) : Fe = e[81];
779
+ e[64] !== h ? (Fe = h ? /* @__PURE__ */ a(I, { mb: "xs", children: h }) : null, e[64] = h, e[65] = Fe) : Fe = e[65];
726
780
  let ze;
727
- e[82] !== p || e[83] !== Oe || e[84] !== Fe ? (ze = /* @__PURE__ */ T(Ce, { direction: "column", color: "fg", children: [
728
- p,
729
- Oe,
730
- Fe
731
- ] }), e[82] = p, e[83] = Oe, e[84] = Fe, e[85] = ze) : ze = e[85];
732
- let rt;
733
- return e[86] !== gt || e[87] !== bt || e[88] !== yt || e[89] !== xt || e[90] !== St || e[91] !== $e || e[92] !== ze ? (rt = /* @__PURE__ */ l(I, { ref: Re, position: "relative", width: "100%", paddingX: "xs", paddingY: "md", mt: gt, bg: "bg", borderRadius: "md", borderTopRadius: bt, borderWidth: "1px", borderStyle: "solid", borderColor: yt, boxShadow: xt, zIndex: St, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: $e, _focusWithin: nt, onClick: be, onBlur: st, children: ze }), e[86] = gt, e[87] = bt, e[88] = yt, e[89] = xt, e[90] = St, e[91] = $e, e[92] = ze, e[93] = rt) : rt = e[93], rt;
781
+ e[66] !== O || e[67] !== je || e[68] !== B || e[69] !== xt || e[70] !== P || e[71] !== m || e[72] !== p || e[73] !== b || e[74] !== E ? (ze = b ? /* @__PURE__ */ a(is, { questionPrompt: b, selectedOptionsByQuestion: E, customAnswersByQuestion: O, onToggleOption: Bn, onCustomAnswerChange: On }) : /* @__PURE__ */ a(ht, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
782
+ pr: "2xs"
783
+ }, children: /* @__PURE__ */ a(So, { defaultState: B, isEditable: !P, placeholder: /* @__PURE__ */ a(as, { placeholder: p }), onChange: (R) => {
784
+ z(R), m?.(R);
785
+ }, onSubmit: xt }, je) }), e[66] = O, e[67] = je, e[68] = B, e[69] = xt, e[70] = P, e[71] = m, e[72] = p, e[73] = b, e[74] = E, e[75] = ze) : ze = e[75];
786
+ let ct;
787
+ e[76] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ct = /* @__PURE__ */ a(Vn, {}), e[76] = ct) : ct = e[76];
788
+ const _t = V ? "Stop Response" : "Message Sending", Rt = w ? void 0 : "Enter", It = U === "none";
789
+ let qe;
790
+ e[77] !== V || e[78] !== St || e[79] !== _t || e[80] !== Rt || e[81] !== It ? (qe = /* @__PURE__ */ a(ls, { canInterrupt: V, title: _t, shortcut: Rt, onClick: St, disabled: It }), e[77] = V, e[78] = St, e[79] = _t, e[80] = Rt, e[81] = It, e[82] = qe) : qe = e[82];
791
+ let He;
792
+ e[83] !== g || e[84] !== qe ? (He = /* @__PURE__ */ k(Me, { gap: "1", mt: "md", children: [
793
+ g,
794
+ ct,
795
+ qe
796
+ ] }), e[83] = g, e[84] = qe, e[85] = He) : He = e[85];
797
+ let Qe;
798
+ e[86] !== Fe || e[87] !== ze || e[88] !== He ? (Qe = /* @__PURE__ */ k(Re, { direction: "column", color: "fg", children: [
799
+ Fe,
800
+ ze,
801
+ He
802
+ ] }), e[86] = Fe, e[87] = ze, e[88] = He, e[89] = Qe) : Qe = e[89];
803
+ let ut;
804
+ return e[90] !== ae.onDragOver || e[91] !== ae.onDropCapture || e[92] !== ae.onPasteCapture || e[93] !== Tt || e[94] !== wt || e[95] !== kt || e[96] !== Ct || e[97] !== $e || e[98] !== Qe ? (ut = /* @__PURE__ */ a(I, { ref: Ue, position: "relative", width: "100%", paddingX: "xs", paddingY: "xs", mt: Tt, bg: "bg", borderRadius: "xs", borderTopRadius: wt, borderWidth: "1px", borderStyle: "solid", borderColor: kt, zIndex: Ct, transition: "border-color 0.2s ease-in-out", _hover: $e, _focusWithin: lt, onPasteCapture: ae.onPasteCapture, onDropCapture: ae.onDropCapture, onDragOver: ae.onDragOver, onClick: Te, onBlur: at, children: Qe }), e[90] = ae.onDragOver, e[91] = ae.onDropCapture, e[92] = ae.onPasteCapture, e[93] = Tt, e[94] = wt, e[95] = kt, e[96] = Ct, e[97] = $e, e[98] = Qe, e[99] = ut) : ut = e[99], ut;
734
805
  };
735
- function Ys() {
806
+ function us() {
736
807
  }
737
- function Js(t) {
808
+ function ds(t) {
738
809
  return t + 1;
739
810
  }
740
- function Zs(t) {
811
+ function fs(t) {
741
812
  return t + 1;
742
813
  }
743
- const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh, 4rem)", dn = "min(70dvh, calc(100dvh - 12rem), 22rem)", It = 1, oo = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
814
+ const ps = (t = "") => JSON.stringify(To(t)), ms = 360, hs = 4, gs = "min(10vh, 4rem)", bn = "min(70dvh, calc(100dvh - 12rem), 22rem)", vt = 1, bs = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
744
815
  lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
745
816
  textLength: e.textLength + n.text.length
746
817
  }, {
747
818
  lineCount: 0,
748
819
  textLength: 0
749
- }), ro = (t) => {
820
+ }), ys = (t) => {
750
821
  if (t.role !== "user") return !1;
751
822
  const {
752
823
  lineCount: e,
753
824
  textLength: n
754
- } = oo(t);
755
- return n > to || e > no;
756
- }, io = (t, e) => {
825
+ } = bs(t);
826
+ return n > ms || e > hs;
827
+ }, xs = (t, e) => {
757
828
  const n = Math.max(0, t.scrollHeight - t.clientHeight);
758
- return e === 0 || n <= It ? !1 : e < 0 ? t.scrollTop > It : t.scrollTop < n - It;
759
- }, lo = (t) => t.type === "text", ao = (t) => (t.parts ?? []).filter(lo).map((e) => e.text.trim()).filter(Boolean).join(`
829
+ return e === 0 || n <= vt ? !1 : e < 0 ? t.scrollTop > vt : t.scrollTop < n - vt;
830
+ }, Ss = (t) => t.type === "text", Ts = (t) => (t.parts ?? []).filter(Ss).map((e) => e.text.trim()).filter(Boolean).join(`
760
831
 
761
- `), co = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
832
+ `), ws = (t, e, n) => t.createdAt ? new Intl.DateTimeFormat(e, {
762
833
  hour: "numeric",
763
834
  minute: "2-digit",
764
835
  timeZone: n
765
- }).format(new Date(t.createdAt)) : "", Pt = (t) => {
766
- const e = k(20), {
836
+ }).format(new Date(t.createdAt)) : "", Bt = (t) => {
837
+ const e = T(20), {
767
838
  message: n,
768
- alwaysVisible: o,
769
- copyAlwaysVisible: s
770
- } = t, r = o === void 0 ? !1 : o, i = s === void 0 ? r : s, [a, c] = G(!1), u = Qe(null);
839
+ alwaysVisible: s,
840
+ copyAlwaysVisible: o
841
+ } = t, r = s === void 0 ? !1 : s, i = o === void 0 ? r : o, [l, c] = G(!1), u = Ne(null);
771
842
  let d;
772
- e[0] !== n ? (d = ao(n), e[0] = n, e[1] = d) : d = e[1];
773
- const p = d;
843
+ e[0] !== n ? (d = Ts(n), e[0] = n, e[1] = d) : d = e[1];
844
+ const f = d;
774
845
  let m;
775
- e[2] !== n ? (m = co(n), e[2] = n, e[3] = m) : m = e[3];
776
- const f = m;
846
+ e[2] !== n ? (m = ws(n), e[2] = n, e[3] = m) : m = e[3];
847
+ const p = m;
777
848
  let h, g;
778
849
  e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (h = () => () => {
779
850
  u.current !== null && window.clearTimeout(u.current);
780
- }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Te(h, g);
781
- let b;
782
- e[6] !== p ? (b = async () => {
783
- if (p)
851
+ }, g = [], e[4] = h, e[5] = g) : (h = e[4], g = e[5]), Ae(h, g);
852
+ let y;
853
+ e[6] !== f ? (y = async () => {
854
+ if (f)
784
855
  try {
785
- await navigator.clipboard.writeText(p), c(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => c(!1), 1200);
856
+ await navigator.clipboard.writeText(f), c(!0), u.current !== null && window.clearTimeout(u.current), u.current = window.setTimeout(() => c(!1), 1200);
786
857
  } catch {
787
858
  c(!1);
788
859
  }
789
- }, e[6] = p, e[7] = b) : b = e[7];
790
- const y = b;
791
- if (!p && !f)
860
+ }, e[6] = f, e[7] = y) : y = e[7];
861
+ const b = y;
862
+ if (!f && !p)
792
863
  return null;
793
- const x = r ? "1" : "0", _ = r ? "auto" : "none";
794
- let C;
795
- e[8] !== f ? (C = f ? /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg.muted", children: f }) : null, e[8] = f, e[9] = C) : C = e[9];
864
+ const x = r ? "1" : "0", C = r ? "auto" : "none";
865
+ let A;
866
+ e[8] !== p ? (A = p ? /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: p }) : null, e[8] = p, e[9] = A) : A = e[9];
796
867
  let w;
797
- e[10] !== i || e[11] !== y || e[12] !== p || e[13] !== a ? (w = p ? /* @__PURE__ */ l(I, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Wt, children: /* @__PURE__ */ l(sn, { content: a ? "Copied" : "Copy message", children: /* @__PURE__ */ l(vt, { "aria-label": a ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: y, children: a ? /* @__PURE__ */ l(en, { size: 12 }) : /* @__PURE__ */ l(Un, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = y, e[12] = p, e[13] = a, e[14] = w) : w = e[14];
798
- let R;
799
- return e[15] !== w || e[16] !== x || e[17] !== _ || e[18] !== C ? (R = /* @__PURE__ */ T(Ee, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: _, transition: "opacity 120ms ease", css: Wt, children: [
800
- C,
868
+ e[10] !== i || e[11] !== b || e[12] !== f || e[13] !== l ? (w = f ? /* @__PURE__ */ a(I, { opacity: i ? "1" : "0", pointerEvents: i ? "auto" : "none", transition: "opacity 120ms ease", css: Kt, children: /* @__PURE__ */ a(cn, { content: l ? "Copied" : "Copy message", children: /* @__PURE__ */ a($t, { "aria-label": l ? "Copied" : "Copy message", variant: "ghost", size: "2xs", onClick: b, children: l ? /* @__PURE__ */ a(rn, { size: 12 }) : /* @__PURE__ */ a(eo, { size: 12 }) }) }) }) : null, e[10] = i, e[11] = b, e[12] = f, e[13] = l, e[14] = w) : w = e[14];
869
+ let _;
870
+ return e[15] !== w || e[16] !== x || e[17] !== C || e[18] !== A ? (_ = /* @__PURE__ */ k(Me, { "data-chat-message-action-panel": "true", gap: "2xs", minH: "6", opacity: x, pointerEvents: C, transition: "opacity 120ms ease", css: Kt, children: [
871
+ A,
801
872
  w
802
- ] }), e[15] = w, e[16] = x, e[17] = _, e[18] = C, e[19] = R) : R = e[19], R;
803
- }, Wt = {
873
+ ] }), e[15] = w, e[16] = x, e[17] = C, e[18] = A, e[19] = _) : _ = e[19], _;
874
+ }, Kt = {
804
875
  "[data-chat-message-with-actions]:hover &, [data-chat-message-with-actions]:focus-within &": {
805
876
  opacity: 1,
806
877
  pointerEvents: "auto"
@@ -813,44 +884,44 @@ const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh,
813
884
  opacity: 1,
814
885
  pointerEvents: "auto"
815
886
  }
816
- }, uo = (t) => {
817
- const e = k(8);
818
- let n, o;
887
+ }, ks = (t) => {
888
+ const e = T(8);
889
+ let n, s;
819
890
  e[0] !== t ? ({
820
891
  children: n,
821
- ...o
822
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
823
- let s;
824
- e[3] !== n ? (s = /* @__PURE__ */ l(on, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = s) : s = e[4];
892
+ ...s
893
+ } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
894
+ let o;
895
+ e[3] !== n ? (o = /* @__PURE__ */ a(un, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
825
896
  let r;
826
- return e[5] !== o || e[6] !== s ? (r = /* @__PURE__ */ l(I, { ...o, children: s }), e[5] = o, e[6] = s, e[7] = r) : r = e[7], r;
827
- }, fo = uo, dt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), po = (t) => {
828
- const e = dt(t), n = e.replace(/_/g, "");
897
+ return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ a(I, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
898
+ }, Cs = ks, gt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), As = (t) => {
899
+ const e = gt(t), n = e.replace(/_/g, "");
829
900
  return [.../* @__PURE__ */ new Set([t, e, n])];
830
- }, fn = {
831
- shell: tn,
832
- ls: ts,
833
- read_file: es,
834
- write_file: Zn,
835
- delete_file: Jn,
836
- patch: Yn,
837
- upload_files: Xn,
838
- download_file: Gn,
839
- move_file: Kn
840
- }, mo = {
841
- dot: ls,
842
- danger: nn,
843
- search: is,
844
- browser: rs,
845
- file: os,
846
- question: ss,
847
- todo: ns,
848
- terminal: tn,
849
- ...fn
850
- }, Nt = "dot", ho = (t) => Object.hasOwn(fn, t), go = (t) => mo[t], pn = (t) => {
851
- if (!t) return Nt;
852
- const e = dt(t);
853
- if (ho(e)) return e;
901
+ }, yn = {
902
+ shell: ln,
903
+ ls: ao,
904
+ read_file: lo,
905
+ write_file: io,
906
+ delete_file: ro,
907
+ patch: so,
908
+ upload_files: oo,
909
+ download_file: no,
910
+ move_file: to
911
+ }, _s = {
912
+ dot: ho,
913
+ danger: an,
914
+ search: mo,
915
+ browser: po,
916
+ file: fo,
917
+ question: uo,
918
+ todo: co,
919
+ terminal: ln,
920
+ ...yn
921
+ }, Gt = "dot", Rs = (t) => Object.hasOwn(yn, t), Is = (t) => _s[t], xn = (t) => {
922
+ if (!t) return Gt;
923
+ const e = gt(t);
924
+ if (Rs(e)) return e;
854
925
  const n = e.replace(/_/g, "");
855
926
  switch (e) {
856
927
  case "read":
@@ -877,52 +948,52 @@ const eo = (t = "") => JSON.stringify(fs(t)), to = 360, no = 4, so = "min(10vh,
877
948
  case "file":
878
949
  return "file";
879
950
  default:
880
- return n === "todowrite" || n === "todo" ? "todo" : Nt;
951
+ return n === "todowrite" || n === "todo" ? "todo" : Gt;
881
952
  }
882
953
  };
883
- function Dt(t) {
954
+ function Ht(t) {
884
955
  const e = t.lastIndexOf("/");
885
956
  return e >= 0 ? t.slice(e + 1) : t;
886
957
  }
887
- function lt(t) {
958
+ function ft(t) {
888
959
  if (!t) return null;
889
960
  const e = t.split(" ")[0].trim();
890
961
  if (e === "/dev/null") return null;
891
962
  let n = e;
892
963
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
893
964
  }
894
- const ft = (t) => t.startsWith("--- "), Ft = (t) => t.startsWith("+++ "), zt = (t) => t.startsWith("@@"), bo = (t) => t.startsWith("+") && !(Ft(t) || t === "+++"), yo = (t) => t.startsWith("-") && !(ft(t) || t === "---"), xo = (t, e) => {
965
+ const bt = (t) => t.startsWith("--- "), Qt = (t) => t.startsWith("+++ "), Wt = (t) => t.startsWith("@@"), Ps = (t) => t.startsWith("+") && !(Qt(t) || t === "+++"), Ms = (t) => t.startsWith("-") && !(bt(t) || t === "---"), Es = (t, e) => {
895
966
  t.has(e) || t.set(e, {
896
967
  additions: 0,
897
968
  deletions: 0
898
969
  });
899
- }, So = (t, e) => {
970
+ }, vs = (t, e) => {
900
971
  const n = t.get(e);
901
972
  n && (n.additions += 1);
902
- }, ko = (t, e) => {
973
+ }, Ls = (t, e) => {
903
974
  const n = t.get(e);
904
975
  n && (n.deletions += 1);
905
- }, To = (t, e, n) => {
906
- if (ft(t))
976
+ }, Ds = (t, e, n) => {
977
+ if (bt(t))
907
978
  return {
908
979
  ...e,
909
- lastMinusHeader: lt(t.slice(4)),
980
+ lastMinusHeader: ft(t.slice(4)),
910
981
  inHunk: !1
911
982
  };
912
- if (Ft(t)) {
913
- const s = lt(t.slice(4)) ?? e.lastMinusHeader;
914
- return s && xo(n, s), {
983
+ if (Qt(t)) {
984
+ const o = ft(t.slice(4)) ?? e.lastMinusHeader;
985
+ return o && Es(n, o), {
915
986
  ...e,
916
- currentPath: s,
987
+ currentPath: o,
917
988
  inHunk: !1
918
989
  };
919
990
  }
920
- return e.currentPath ? zt(t) ? {
991
+ return e.currentPath ? Wt(t) ? {
921
992
  ...e,
922
993
  inHunk: !0
923
- } : e.inHunk ? bo(t) ? (So(n, e.currentPath), e) : (yo(t) && ko(n, e.currentPath), e) : e : e;
994
+ } : e.inHunk ? Ps(t) ? (vs(n, e.currentPath), e) : (Ms(t) && Ls(n, e.currentPath), e) : e : e;
924
995
  };
925
- function mn(t) {
996
+ function Sn(t) {
926
997
  if (!t || typeof t != "string") return [];
927
998
  const e = /* @__PURE__ */ new Map();
928
999
  let n = {
@@ -930,34 +1001,34 @@ function mn(t) {
930
1001
  lastMinusHeader: null,
931
1002
  inHunk: !1
932
1003
  };
933
- const o = t.split(/\r?\n/);
934
- for (const s of o)
935
- n = To(s, n, e);
936
- return Array.from(e.entries()).map(([s, {
1004
+ const s = t.split(/\r?\n/);
1005
+ for (const o of s)
1006
+ n = Ds(o, n, e);
1007
+ return Array.from(e.entries()).map(([o, {
937
1008
  additions: r,
938
1009
  deletions: i
939
1010
  }]) => ({
940
- filePath: s,
1011
+ filePath: o,
941
1012
  additions: r,
942
1013
  deletions: i
943
1014
  }));
944
1015
  }
945
- function wo(t) {
946
- return mn(t).map((e) => ({
1016
+ function Bs(t) {
1017
+ return Sn(t).map((e) => ({
947
1018
  kind: "diff",
948
- fileName: Dt(e.filePath),
1019
+ fileName: Ht(e.filePath),
949
1020
  filePath: e.filePath,
950
1021
  additions: e.additions,
951
1022
  deletions: e.deletions
952
1023
  }));
953
1024
  }
954
- function Co(t) {
955
- return mn(t).map((e) => e.filePath);
1025
+ function Os(t) {
1026
+ return Sn(t).map((e) => e.filePath);
956
1027
  }
957
- const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Ao = (t, e, n) => {
1028
+ const Tn = (t) => bt(t) || t.startsWith("diff --git "), $s = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Fs = (t, e, n) => {
958
1029
  if (t.startsWith(" ")) {
959
- const o = t.slice(1);
960
- e.push(o), n.push(o);
1030
+ const s = t.slice(1);
1031
+ e.push(s), n.push(s);
961
1032
  return;
962
1033
  }
963
1034
  if (t.startsWith("-")) {
@@ -965,30 +1036,30 @@ const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith
965
1036
  return;
966
1037
  }
967
1038
  t.startsWith("+") && n.push(t.slice(1));
968
- }, Ro = (t, e, n, o) => {
969
- let s = e;
970
- for (; s < t.length; ) {
971
- const r = t[s] || "";
972
- if (hn(r) || zt(r) || _o(r))
1039
+ }, zs = (t, e, n, s) => {
1040
+ let o = e;
1041
+ for (; o < t.length; ) {
1042
+ const r = t[o] || "";
1043
+ if (Tn(r) || Wt(r) || $s(r))
973
1044
  break;
974
- Ao(r, n, o), s += 1;
1045
+ Fs(r, n, s), o += 1;
975
1046
  }
976
- return (n.length > 0 || o.length > 0) && (n.push(""), o.push("")), s;
977
- }, Io = (t, e) => {
978
- const n = lt((t[e] || "").slice(4)), o = t[e + 1] || "";
979
- if (!Ft(o)) return {
1047
+ return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
1048
+ }, qs = (t, e) => {
1049
+ const n = ft((t[e] || "").slice(4)), s = t[e + 1] || "";
1050
+ if (!Qt(s)) return {
980
1051
  nextIndex: e + 1
981
1052
  };
982
- const r = lt(o.slice(4)) ?? n ?? "", i = [], a = [];
1053
+ const r = ft(s.slice(4)) ?? n ?? "", i = [], l = [];
983
1054
  let c = e + 2;
984
1055
  for (; c < t.length; ) {
985
1056
  const u = t[c] || "";
986
- if (hn(u)) break;
987
- if (!zt(u)) {
1057
+ if (Tn(u)) break;
1058
+ if (!Wt(u)) {
988
1059
  c += 1;
989
1060
  continue;
990
1061
  }
991
- c = Ro(t, c + 1, i, a);
1062
+ c = zs(t, c + 1, i, l);
992
1063
  }
993
1064
  return {
994
1065
  nextIndex: c,
@@ -996,30 +1067,30 @@ const hn = (t) => ft(t) || t.startsWith("diff --git "), _o = (t) => t.startsWith
996
1067
  filePath: r,
997
1068
  original: i.join(`
998
1069
  `),
999
- modified: a.join(`
1070
+ modified: l.join(`
1000
1071
  `)
1001
1072
  }
1002
1073
  };
1003
1074
  };
1004
- function Mo(t) {
1075
+ function Hs(t) {
1005
1076
  if (!t || typeof t != "string") return [];
1006
1077
  const e = t.split(/\r?\n/), n = [];
1007
- let o = 0;
1008
- for (; o < e.length; ) {
1009
- const s = e[o] || "";
1010
- if (!ft(s)) {
1011
- o += 1;
1078
+ let s = 0;
1079
+ for (; s < e.length; ) {
1080
+ const o = e[s] || "";
1081
+ if (!bt(o)) {
1082
+ s += 1;
1012
1083
  continue;
1013
1084
  }
1014
1085
  const {
1015
1086
  nextIndex: r,
1016
1087
  preview: i
1017
- } = Io(e, o);
1018
- i && n.push(i), o = Math.max(r, o + 1);
1088
+ } = qs(e, s);
1089
+ i && n.push(i), s = Math.max(r, s + 1);
1019
1090
  }
1020
1091
  return n;
1021
1092
  }
1022
- const Eo = {
1093
+ const Qs = {
1023
1094
  apply_patch: "Apply patch",
1024
1095
  bash: "Run command",
1025
1096
  edit: "Edit file",
@@ -1028,7 +1099,7 @@ const Eo = {
1028
1099
  read: "Read file",
1029
1100
  skill: "Load skill",
1030
1101
  todowrite: "Update todos"
1031
- }, Vt = {
1102
+ }, Xt = {
1032
1103
  pending: "queued",
1033
1104
  error: "failed",
1034
1105
  "output-error": "failed",
@@ -1037,126 +1108,126 @@ const Eo = {
1037
1108
  running: "running",
1038
1109
  completed: "completed",
1039
1110
  failed: "failed"
1040
- }, gn = (t) => t.replace(/^tool-/, "").toLowerCase(), Bo = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Po = (t) => gn(t.tool ?? "tool"), Lo = (t) => {
1041
- const e = gn(t);
1042
- return Eo[e] ?? Bo(e.replace(/_/g, " "));
1043
- }, vo = (t) => {
1111
+ }, wn = (t) => t.replace(/^tool-/, "").toLowerCase(), Ws = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Ns = (t) => wn(t.tool ?? "tool"), Vs = (t) => {
1112
+ const e = wn(t);
1113
+ return Qs[e] ?? Ws(e.replace(/_/g, " "));
1114
+ }, js = (t) => {
1044
1115
  const e = t.state?.status ?? t.status;
1045
1116
  if (!e || typeof e != "string") return null;
1046
1117
  const n = e.replace(/-/g, "_");
1047
- return Vt[n] ? Vt[n] : n.includes("stream") ? "running" : null;
1048
- }, bn = (t) => {
1118
+ return Xt[n] ? Xt[n] : n.includes("stream") ? "running" : null;
1119
+ }, kn = (t) => {
1049
1120
  const e = t.state?.status ?? t.status;
1050
1121
  return e === "error" || e === "output-error" || e === "failed";
1051
- }, ce = (t) => bn(t) ? {
1122
+ }, fe = (t) => kn(t) ? {
1052
1123
  type: "icon",
1053
1124
  icon: "danger"
1054
1125
  } : {
1055
1126
  type: "icon",
1056
- icon: pn(Po(t))
1057
- }, ue = (t, e, n) => {
1058
- const s = [{
1127
+ icon: xn(Ns(t))
1128
+ }, pe = (t, e, n) => {
1129
+ const o = [{
1059
1130
  kind: "text",
1060
- text: n ?? Lo(t.tool ?? "tool"),
1131
+ text: n ?? Vs(t.tool ?? "tool"),
1061
1132
  bold: !0
1062
1133
  }];
1063
- e && s.push({
1134
+ e && o.push({
1064
1135
  kind: "text",
1065
1136
  text: e,
1066
1137
  muted: !0
1067
1138
  });
1068
- const r = vo(t);
1069
- return r && r !== "completed" && s.push({
1139
+ const r = js(t);
1140
+ return r && r !== "completed" && o.push({
1070
1141
  kind: "text",
1071
1142
  text: r,
1072
1143
  muted: !0
1073
- }), s;
1074
- }, Be = (t) => {
1144
+ }), o;
1145
+ }, Ee = (t) => {
1075
1146
  const e = t.state?.input;
1076
1147
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1077
- }, Ge = (t) => {
1148
+ }, et = (t) => {
1078
1149
  const e = t.state?.output;
1079
1150
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
1080
- }, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, at = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, $o = (t, e) => {
1081
- const n = at(t.state);
1082
- return n ? at(n[e]) : null;
1083
- }, Oo = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Do = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), yn = (t) => {
1084
- const e = Ge(t);
1085
- return [$o(t, "metadata"), at(e?.metadata)].filter(Boolean);
1086
- }, Fo = (t) => {
1087
- const e = at(t);
1151
+ }, S = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, pt = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Us = (t, e) => {
1152
+ const n = pt(t.state);
1153
+ return n ? pt(n[e]) : null;
1154
+ }, Ks = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Gs = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), Cn = (t) => {
1155
+ const e = et(t);
1156
+ return [Us(t, "metadata"), pt(e?.metadata)].filter(Boolean);
1157
+ }, Xs = (t) => {
1158
+ const e = pt(t);
1088
1159
  if (!e) return null;
1089
1160
  const n = S(e.filePath) ?? S(e.relativePath) ?? S(e.path);
1090
1161
  return n ? {
1091
- filePath: Oo(n),
1162
+ filePath: Ks(n),
1092
1163
  additions: typeof e.additions == "number" ? e.additions : 0,
1093
1164
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
1094
1165
  diff: S(e.diff) ?? void 0,
1095
1166
  before: S(e.before) ?? void 0,
1096
1167
  after: S(e.after) ?? void 0
1097
1168
  } : null;
1098
- }, xn = (t) => {
1169
+ }, An = (t) => {
1099
1170
  const e = [];
1100
- for (const n of yn(t)) {
1101
- const o = Array.isArray(n.files) ? n.files : [];
1102
- for (const s of o) {
1103
- const r = Fo(s);
1171
+ for (const n of Cn(t)) {
1172
+ const s = Array.isArray(n.files) ? n.files : [];
1173
+ for (const o of s) {
1174
+ const r = Xs(o);
1104
1175
  r && e.push(r);
1105
1176
  }
1106
1177
  }
1107
1178
  return e;
1108
- }, zo = (t) => {
1109
- const e = Be(t), n = S(e?.diff);
1179
+ }, Ys = (t) => {
1180
+ const e = Ee(t), n = S(e?.diff);
1110
1181
  if (n) return n;
1111
- for (const r of yn(t)) {
1182
+ for (const r of Cn(t)) {
1112
1183
  const i = S(r.diff);
1113
1184
  if (i) return i;
1114
1185
  }
1115
- const o = xn(t).map((r) => r.diff).filter((r) => !!r);
1116
- if (o.length > 0) return o.join(`
1186
+ const s = An(t).map((r) => r.diff).filter((r) => !!r);
1187
+ if (s.length > 0) return s.join(`
1117
1188
  `);
1118
- const s = S(e?.patchText);
1119
- return s && Do(s) ? s : null;
1120
- }, qo = (t) => {
1189
+ const o = S(e?.patchText);
1190
+ return o && Gs(o) ? o : null;
1191
+ }, Js = (t) => {
1121
1192
  const e = /* @__PURE__ */ new Set(), n = [];
1122
- for (const o of t)
1123
- e.has(o.filePath) || (e.add(o.filePath), n.push({
1193
+ for (const s of t)
1194
+ e.has(s.filePath) || (e.add(s.filePath), n.push({
1124
1195
  kind: "diff",
1125
- fileName: Dt(o.filePath),
1126
- filePath: o.filePath,
1127
- additions: o.additions,
1128
- deletions: o.deletions
1196
+ fileName: Ht(s.filePath),
1197
+ filePath: s.filePath,
1198
+ additions: s.additions,
1199
+ deletions: s.deletions
1129
1200
  }));
1130
1201
  return n;
1131
- }, Qo = (t) => Array.from(new Set(t.map((e) => e.filePath))), pt = (t) => {
1132
- const e = Ge(t);
1202
+ }, Zs = (t) => Array.from(new Set(t.map((e) => e.filePath))), yt = (t) => {
1203
+ const e = et(t);
1133
1204
  return S(t.state?.output) ?? S(e?.returnDisplay) ?? S(e?.preview) ?? S(e?.stdout) ?? S(e?.content);
1134
- }, Ho = (t) => {
1205
+ }, er = (t) => {
1135
1206
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
1136
1207
  return e ? {
1137
1208
  skillName: S(e[1]) ?? void 0,
1138
1209
  content: S(e[2]) ?? ""
1139
1210
  } : null;
1140
- }, Wo = (t) => {
1141
- const e = Be(t);
1211
+ }, tr = (t) => {
1212
+ const e = Ee(t);
1142
1213
  return S(e?.name) ?? S(e?.skillName) ?? S(e?.skill) ?? S(e?.skill_name) ?? void 0;
1143
- }, Sn = (t) => ({
1214
+ }, _n = (t) => ({
1144
1215
  kind: "link",
1145
- text: Dt(t),
1216
+ text: Ht(t),
1146
1217
  filePath: t
1147
- }), de = (t, e) => !bn(t) || !t.state?.errorText ? e : [{
1218
+ }), me = (t, e) => !kn(t) || !t.state?.errorText ? e : [{
1148
1219
  type: "comment",
1149
1220
  text: t.state.errorText
1150
- }, ...e], kn = (t) => Mo(t ?? void 0).map((e) => ({
1221
+ }, ...e], Rn = (t) => Hs(t ?? void 0).map((e) => ({
1151
1222
  type: "diff",
1152
1223
  language: "diff",
1153
1224
  original: e.original,
1154
1225
  modified: e.modified,
1155
1226
  sideBySide: !1
1156
- })), No = (t) => wo(t ?? void 0), Vo = (t) => Co(t ?? void 0), jo = (t) => {
1157
- const e = zo(t), n = xn(t), o = ue(t, void 0, "Apply patch"), s = No(e);
1158
- s.length > 0 ? o.push(...s) : o.push(...qo(n));
1159
- const r = [...kn(e)];
1227
+ })), nr = (t) => Bs(t ?? void 0), or = (t) => Os(t ?? void 0), sr = (t) => {
1228
+ const e = Ys(t), n = An(t), s = pe(t, void 0, "Apply patch"), o = nr(e);
1229
+ o.length > 0 ? s.push(...o) : s.push(...Js(n));
1230
+ const r = [...Rn(e)];
1160
1231
  if (r.length === 0)
1161
1232
  for (const i of n)
1162
1233
  !i.before && !i.after || r.push({
@@ -1167,252 +1238,252 @@ const Eo = {
1167
1238
  sideBySide: !1
1168
1239
  });
1169
1240
  if (r.length === 0) {
1170
- const i = Vo(e);
1171
- i.length === 0 && i.push(...Qo(n)), i.length > 0 && r.push({
1241
+ const i = or(e);
1242
+ i.length === 0 && i.push(...Zs(n)), i.length > 0 && r.push({
1172
1243
  type: "references",
1173
1244
  references: i
1174
1245
  });
1175
1246
  }
1176
1247
  return {
1177
- indicator: ce(t),
1178
- title: o,
1179
- blocks: de(t, r)
1248
+ indicator: fe(t),
1249
+ title: s,
1250
+ blocks: me(t, r)
1180
1251
  };
1181
- }, Uo = (t, e) => [{
1252
+ }, rr = (t, e) => [{
1182
1253
  type: "diff",
1183
1254
  language: "text",
1184
1255
  original: t,
1185
1256
  modified: e,
1186
1257
  sideBySide: !1
1187
- }], Ko = (t) => {
1188
- const e = Be(t), n = Ge(t), o = S(e?.filePath) ?? S(e?.file_path) ?? S(n?.filePath) ?? void 0, s = S(n?.oldString) ?? S(e?.old_string) ?? void 0, r = S(n?.newString) ?? S(e?.new_string) ?? void 0, i = ue(t, void 0, "Edit file");
1189
- o && i.push(Sn(o));
1190
- const a = s !== void 0 && r !== void 0 ? Uo(s, r) : kn(S(n?.diff));
1258
+ }], ir = (t) => {
1259
+ const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(n?.filePath) ?? void 0, o = S(n?.oldString) ?? S(e?.old_string) ?? void 0, r = S(n?.newString) ?? S(e?.new_string) ?? void 0, i = pe(t, void 0, "Edit file");
1260
+ s && i.push(_n(s));
1261
+ const l = o !== void 0 && r !== void 0 ? rr(o, r) : Rn(S(n?.diff));
1191
1262
  return {
1192
- indicator: ce(t),
1263
+ indicator: fe(t),
1193
1264
  title: i,
1194
- blocks: de(t, a)
1265
+ blocks: me(t, l)
1195
1266
  };
1196
- }, Xe = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Go = (t) => {
1267
+ }, tt = (t) => typeof t == "object" && t !== null && !Array.isArray(t), lr = (t) => {
1197
1268
  try {
1198
1269
  const e = JSON.parse(t);
1199
- return Xe(e) ? e : null;
1270
+ return tt(e) ? e : null;
1200
1271
  } catch {
1201
1272
  return null;
1202
1273
  }
1203
- }, Xo = (t) => Xe(t) ? t : typeof t == "string" && t.trim().length > 0 ? Go(t) : null, He = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Me = (t) => {
1204
- const e = He(t);
1274
+ }, ar = (t) => tt(t) ? t : typeof t == "string" && t.trim().length > 0 ? lr(t) : null, Ve = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Pe = (t) => {
1275
+ const e = Ve(t);
1205
1276
  if (e) return e;
1206
1277
  if (Array.isArray(t)) {
1207
- const n = t.map(Me).filter((o) => o !== null);
1278
+ const n = t.map(Pe).filter((s) => s !== null);
1208
1279
  return n.length > 0 ? n.join(`
1209
1280
  `) : null;
1210
1281
  }
1211
- return Xe(t) ? Me(t.response) ?? Me(t.answer) ?? Me(t.text) ?? Me(t.answers) : null;
1212
- }, Yo = (t) => {
1282
+ return tt(t) ? Pe(t.response) ?? Pe(t.answer) ?? Pe(t.text) ?? Pe(t.answers) : null;
1283
+ }, cr = (t) => {
1213
1284
  if (typeof t == "string" && t.trim().length > 0)
1214
1285
  return {
1215
1286
  label: t,
1216
1287
  description: void 0
1217
1288
  };
1218
- if (!Xe(t)) return null;
1219
- const e = He(t.label);
1289
+ if (!tt(t)) return null;
1290
+ const e = Ve(t.label);
1220
1291
  return e ? {
1221
1292
  label: e,
1222
- description: He(t.description) ?? void 0
1293
+ description: Ve(t.description) ?? void 0
1223
1294
  } : null;
1224
- }, Jo = (t, e) => {
1225
- if (!Xe(t)) return null;
1226
- const n = He(t.question);
1295
+ }, ur = (t, e) => {
1296
+ if (!tt(t)) return null;
1297
+ const n = Ve(t.question);
1227
1298
  if (!n) return null;
1228
- const o = Array.isArray(t.options) ? t.options.map(Yo).filter((i) => i !== null) : [], s = He(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : s === "freeform" || s === "text";
1229
- return o.length === 0 && !r ? null : {
1230
- id: He(t.id) ?? `question-${e}`,
1299
+ const s = Array.isArray(t.options) ? t.options.map(cr).filter((i) => i !== null) : [], o = Ve(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o === "freeform" || o === "text";
1300
+ return s.length === 0 && !r ? null : {
1301
+ id: Ve(t.id) ?? `question-${e}`,
1231
1302
  question: n,
1232
- options: o,
1233
- multiple: typeof t.multiple == "boolean" ? t.multiple : s === "multi_choice" || s === "multiple_choice",
1303
+ options: s,
1304
+ multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
1234
1305
  required: typeof t.required == "boolean" ? t.required : !1,
1235
1306
  allowCustomAnswer: r
1236
1307
  };
1237
- }, Zo = (t) => {
1238
- const e = Xo(t);
1308
+ }, dr = (t) => {
1309
+ const e = ar(t);
1239
1310
  if (!e || !Array.isArray(e.questions)) return null;
1240
- const n = e.questions.map(Jo).filter((o) => o !== null);
1311
+ const n = e.questions.map(ur).filter((s) => s !== null);
1241
1312
  return n.length === 0 ? null : {
1242
1313
  type: "question-form",
1243
1314
  questions: n
1244
1315
  };
1245
- }, er = (t) => {
1316
+ }, fr = (t) => {
1246
1317
  const {
1247
1318
  buildBaseTitle: e,
1248
1319
  buildIndicator: n,
1249
- prependErrorBlock: o
1320
+ prependErrorBlock: s
1250
1321
  } = t;
1251
- return (s) => {
1252
- const r = Me(s.state?.output) ?? Me(s.state?.metadata), i = Zo(s.state?.input);
1322
+ return (o) => {
1323
+ const r = Pe(o.state?.output) ?? Pe(o.state?.metadata), i = dr(o.state?.input);
1253
1324
  if (!r && !i) return null;
1254
- const a = i ? `${i.questions.length} field${i.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [i];
1325
+ const l = i ? `${i.questions.length} field${i.questions.length === 1 ? "" : "s"}` : void 0, c = r ? [] : [i];
1255
1326
  return {
1256
- indicator: n(s),
1257
- title: e(s, a, "Question"),
1258
- blocks: o(s, c),
1327
+ indicator: n(o),
1328
+ title: e(o, l, "Question"),
1329
+ blocks: s(o, c),
1259
1330
  expandable: !1
1260
1331
  };
1261
1332
  };
1262
- }, tr = (t) => {
1263
- const e = Be(t), n = Ge(t), o = S(e?.filePath) ?? S(e?.file_path) ?? S(e?.file) ?? S(n?.filePath) ?? S(n?.file) ?? S(n?.path) ?? void 0, s = ue(t, void 0, "Read file");
1264
- return o && s.push(Sn(o)), {
1265
- indicator: ce(t),
1266
- title: s,
1267
- blocks: de(t, [])
1333
+ }, pr = (t) => {
1334
+ const e = Ee(t), n = et(t), s = S(e?.filePath) ?? S(e?.file_path) ?? S(e?.file) ?? S(n?.filePath) ?? S(n?.file) ?? S(n?.path) ?? void 0, o = pe(t, void 0, "Read file");
1335
+ return s && o.push(_n(s)), {
1336
+ indicator: fe(t),
1337
+ title: o,
1338
+ blocks: me(t, [])
1268
1339
  };
1269
- }, nr = (t) => {
1270
- const e = Be(t), n = Ge(t), o = S(e?.command) ?? void 0, s = ue(t, o, "Run command"), r = [], i = pt(t);
1340
+ }, mr = (t) => {
1341
+ const e = Ee(t), n = et(t), s = S(e?.command) ?? void 0, o = pe(t, s, "Run command"), r = [], i = yt(t);
1271
1342
  i && r.push({
1272
1343
  type: "code",
1273
1344
  language: "text",
1274
1345
  code: i
1275
1346
  });
1276
- const a = S(n?.stderr);
1277
- return a && a !== i && r.push({
1347
+ const l = S(n?.stderr);
1348
+ return l && l !== i && r.push({
1278
1349
  type: "code",
1279
1350
  language: "text",
1280
- code: a
1351
+ code: l
1281
1352
  }), typeof n?.exitCode == "number" && r.push({
1282
1353
  type: "text",
1283
1354
  text: `Exit code: ${n.exitCode}`
1284
1355
  }), {
1285
- indicator: ce(t),
1286
- title: s,
1287
- blocks: de(t, r)
1356
+ indicator: fe(t),
1357
+ title: o,
1358
+ blocks: me(t, r)
1288
1359
  };
1289
- }, sr = (t) => {
1290
- const e = Be(t), n = pt(t), o = S(e?.pattern) ?? void 0, s = ue(t, o, "Search files"), r = n ? [{
1360
+ }, hr = (t) => {
1361
+ const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Search files"), r = n ? [{
1291
1362
  type: "code",
1292
1363
  language: "text",
1293
1364
  code: n
1294
1365
  }] : [];
1295
1366
  return {
1296
- indicator: ce(t),
1297
- title: s,
1298
- blocks: de(t, r)
1367
+ indicator: fe(t),
1368
+ title: o,
1369
+ blocks: me(t, r)
1299
1370
  };
1300
- }, or = (t) => {
1301
- const e = Be(t), n = pt(t), o = S(e?.pattern) ?? void 0, s = ue(t, o, "Find files"), r = [];
1371
+ }, gr = (t) => {
1372
+ const e = Ee(t), n = yt(t), s = S(e?.pattern) ?? void 0, o = pe(t, s, "Find files"), r = [];
1302
1373
  if (n) {
1303
- const i = n.split(/\r?\n/).map((a) => a.trim()).filter((a) => a.length > 0);
1374
+ const i = n.split(/\r?\n/).map((l) => l.trim()).filter((l) => l.length > 0);
1304
1375
  i.length > 0 && r.push({
1305
1376
  type: "references",
1306
1377
  references: i
1307
1378
  });
1308
1379
  }
1309
1380
  return {
1310
- indicator: ce(t),
1311
- title: s,
1312
- blocks: de(t, r)
1381
+ indicator: fe(t),
1382
+ title: o,
1383
+ blocks: me(t, r)
1313
1384
  };
1314
- }, rr = (t) => {
1315
- const e = pt(t), n = e ? Ho(e) : null, o = Wo(t) ?? n?.skillName, s = ue(t, o, "Load skill"), r = n?.content ?? e, i = r ? [{
1385
+ }, br = (t) => {
1386
+ const e = yt(t), n = e ? er(e) : null, s = tr(t) ?? n?.skillName, o = pe(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
1316
1387
  type: "code",
1317
1388
  language: "markdown",
1318
1389
  code: r
1319
1390
  }] : [];
1320
1391
  return {
1321
- indicator: ce(t),
1322
- title: s,
1323
- blocks: de(t, i)
1392
+ indicator: fe(t),
1393
+ title: o,
1394
+ blocks: me(t, i)
1324
1395
  };
1325
- }, Mt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, Tn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, ir = (t) => {
1326
- const e = Tn(t);
1396
+ }, Lt = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, In = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, yr = (t) => {
1397
+ const e = In(t);
1327
1398
  if (!e) return null;
1328
- const n = Mt(e.content) ?? Mt(e.title);
1399
+ const n = Lt(e.content) ?? Lt(e.title);
1329
1400
  if (!n) return null;
1330
- const o = Mt(e.status);
1401
+ const s = Lt(e.status);
1331
1402
  return {
1332
1403
  label: n,
1333
- checked: o === "completed"
1404
+ checked: s === "completed"
1334
1405
  };
1335
- }, jt = (t) => {
1406
+ }, Yt = (t) => {
1336
1407
  if (!t) return {
1337
1408
  items: [],
1338
1409
  explicit: !1
1339
1410
  };
1340
1411
  const e = (() => {
1341
1412
  if (Array.isArray(t)) return t;
1342
- const n = Tn(t);
1413
+ const n = In(t);
1343
1414
  return !n || !Array.isArray(n.todos) ? null : n.todos;
1344
1415
  })();
1345
1416
  return e ? {
1346
- items: e.map(ir).filter((n) => n !== null),
1417
+ items: e.map(yr).filter((n) => n !== null),
1347
1418
  explicit: !0
1348
1419
  } : {
1349
1420
  items: [],
1350
1421
  explicit: !1
1351
1422
  };
1352
- }, lr = (t) => {
1423
+ }, xr = (t) => {
1353
1424
  const {
1354
1425
  buildBaseTitle: e,
1355
1426
  buildIndicator: n,
1356
- prependErrorBlock: o
1427
+ prependErrorBlock: s
1357
1428
  } = t;
1358
- return (s) => {
1359
- const r = jt(s.state?.input), i = jt(s.state?.output), a = i.explicit ? i : r;
1360
- if (!a.explicit) return null;
1361
- const c = a.items, u = `${c.length} item${c.length === 1 ? "" : "s"}`, d = e(s, u, "Update todos");
1429
+ return (o) => {
1430
+ const r = Yt(o.state?.input), i = Yt(o.state?.output), l = i.explicit ? i : r;
1431
+ if (!l.explicit) return null;
1432
+ const c = l.items, u = `${c.length} item${c.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
1362
1433
  if (c.length === 0)
1363
1434
  return {
1364
- indicator: n(s),
1435
+ indicator: n(o),
1365
1436
  title: d,
1366
- blocks: o(s, [{
1437
+ blocks: s(o, [{
1367
1438
  type: "comment",
1368
1439
  text: "No todos"
1369
1440
  }])
1370
1441
  };
1371
- const p = [{
1442
+ const f = [{
1372
1443
  type: "todo-list",
1373
1444
  items: c
1374
1445
  }];
1375
1446
  return {
1376
- indicator: n(s),
1447
+ indicator: n(o),
1377
1448
  title: d,
1378
- blocks: o(s, p)
1449
+ blocks: s(o, f)
1379
1450
  };
1380
1451
  };
1381
- }, ar = er({
1382
- buildBaseTitle: ue,
1383
- buildIndicator: ce,
1384
- prependErrorBlock: de
1385
- }), Ut = lr({
1386
- buildBaseTitle: ue,
1387
- buildIndicator: ce,
1388
- prependErrorBlock: de
1389
- }), Kt = () => ({
1390
- apply_patch: jo,
1391
- bash: nr,
1392
- edit: Ko,
1393
- glob: or,
1394
- grep: sr,
1395
- question: ar,
1396
- read: tr,
1397
- skill: rr,
1398
- todo_write: Ut,
1399
- todowrite: Ut
1400
- }), Gt = {
1452
+ }, Sr = fr({
1453
+ buildBaseTitle: pe,
1454
+ buildIndicator: fe,
1455
+ prependErrorBlock: me
1456
+ }), Jt = xr({
1457
+ buildBaseTitle: pe,
1458
+ buildIndicator: fe,
1459
+ prependErrorBlock: me
1460
+ }), Zt = () => ({
1461
+ apply_patch: sr,
1462
+ bash: mr,
1463
+ edit: ir,
1464
+ glob: gr,
1465
+ grep: hr,
1466
+ question: Sr,
1467
+ read: pr,
1468
+ skill: br,
1469
+ todo_write: Jt,
1470
+ todowrite: Jt
1471
+ }), en = {
1401
1472
  pending: "queued",
1402
1473
  error: "failed",
1403
1474
  "output-error": "failed",
1404
1475
  "input-streaming": "running",
1405
1476
  "input-available": "queued"
1406
- }, cr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), ur = (t) => {
1407
- const e = dt(t ?? "tool").replace(/_/g, " ");
1408
- return cr(e);
1409
- }, wn = (t) => t === "error" || t === "output-error", dr = (t) => wn(t.state?.status) ? {
1477
+ }, Tr = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), wr = (t) => {
1478
+ const e = gt(t ?? "tool").replace(/_/g, " ");
1479
+ return Tr(e);
1480
+ }, Pn = (t) => t === "error" || t === "output-error", kr = (t) => Pn(t.state?.status) ? {
1410
1481
  type: "icon",
1411
1482
  icon: "danger"
1412
1483
  } : {
1413
1484
  type: "icon",
1414
- icon: pn(t.tool ?? "tool")
1415
- }, fr = (t) => !t || typeof t != "string" ? null : Gt[t] ? Gt[t] : t.includes("stream") ? "running" : null, Xt = (t) => {
1485
+ icon: xn(t.tool ?? "tool")
1486
+ }, Cr = (t) => !t || typeof t != "string" ? null : en[t] ? en[t] : t.includes("stream") ? "running" : null, tn = (t) => {
1416
1487
  if (typeof t == "string") return t;
1417
1488
  if (t == null) return null;
1418
1489
  try {
@@ -1420,113 +1491,113 @@ const Eo = {
1420
1491
  } catch {
1421
1492
  return null;
1422
1493
  }
1423
- }, pr = (t) => {
1494
+ }, Ar = (t) => {
1424
1495
  const e = [];
1425
- wn(t.state?.status) && t.state?.errorText && e.push({
1496
+ Pn(t.state?.status) && t.state?.errorText && e.push({
1426
1497
  type: "comment",
1427
1498
  text: t.state.errorText
1428
1499
  });
1429
- const n = Xt(t.state?.input);
1500
+ const n = tn(t.state?.input);
1430
1501
  n && e.push({
1431
1502
  type: "code",
1432
1503
  language: "json",
1433
1504
  code: n
1434
1505
  });
1435
- const o = Xt(t.state?.output);
1436
- return o && e.push({
1506
+ const s = tn(t.state?.output);
1507
+ return s && e.push({
1437
1508
  type: "code",
1438
1509
  language: "json",
1439
- code: o
1510
+ code: s
1440
1511
  }), e;
1441
- }, mr = (t) => {
1512
+ }, _r = (t) => {
1442
1513
  const e = [{
1443
1514
  kind: "text",
1444
- text: ur(t.tool),
1515
+ text: wr(t.tool),
1445
1516
  bold: !0
1446
- }], n = fr(t.state?.status);
1517
+ }], n = Cr(t.state?.status);
1447
1518
  return n && e.push({
1448
1519
  kind: "text",
1449
1520
  text: n,
1450
1521
  muted: !0
1451
1522
  }), {
1452
- indicator: dr(t),
1523
+ indicator: kr(t),
1453
1524
  title: e,
1454
- blocks: pr(t)
1525
+ blocks: Ar(t)
1455
1526
  };
1456
- }, hr = (t) => t ? {
1457
- ...Kt(),
1527
+ }, Rr = (t) => t ? {
1528
+ ...Zt(),
1458
1529
  ...t
1459
- } : Kt(), gr = (t, e) => {
1530
+ } : Zt(), Ir = (t, e) => {
1460
1531
  const n = t.tool ?? "tool";
1461
- for (const o of po(n)) {
1462
- const s = e[o];
1463
- if (s) return s;
1532
+ for (const s of As(n)) {
1533
+ const o = e[s];
1534
+ if (o) return o;
1464
1535
  }
1465
- }, br = (t, e, n) => {
1466
- const o = gr(t, e);
1467
- if (o) {
1468
- const s = o(t, n);
1469
- if (s) return s;
1536
+ }, Pr = (t, e, n) => {
1537
+ const s = Ir(t, e);
1538
+ if (s) {
1539
+ const o = s(t, n);
1540
+ if (o) return o;
1470
1541
  }
1471
- return mr(t);
1472
- }, yr = (t, e) => {
1473
- const n = hr(e?.toolRenderers);
1542
+ return _r(t);
1543
+ }, Mr = (t, e) => {
1544
+ const n = Rr(e?.toolRenderers);
1474
1545
  return {
1475
- items: t.map((s) => br(s, n, e))
1546
+ items: t.map((o) => Pr(o, n, e))
1476
1547
  };
1477
- }, ke = qn, Cn = (t, e, n, o = !1) => {
1478
- o && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1548
+ }, Ce = jn, Mn = (t, e, n, s = !1) => {
1549
+ s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
1479
1550
  };
1480
- function xr(t) {
1481
- const e = k(6), {
1551
+ function Er(t) {
1552
+ const e = T(6), {
1482
1553
  seg: n
1483
1554
  } = t;
1484
- let o;
1485
- e[0] !== n.alt || e[1] !== n.src ? (o = /* @__PURE__ */ l(qe.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = o) : o = e[2];
1486
1555
  let s;
1487
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l(qe.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = s) : s = e[3];
1556
+ e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ a(We.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
1557
+ let o;
1558
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ a(We.Fallback, { background: "bg.muted", color: "fg.muted" }), e[3] = o) : o = e[3];
1488
1559
  let r;
1489
- return e[4] !== o ? (r = /* @__PURE__ */ T(qe.Root, { width: "1.5rem", height: "1.5rem", children: [
1490
- o,
1491
- s
1492
- ] }), e[4] = o, e[5] = r) : r = e[5], r;
1560
+ return e[4] !== s ? (r = /* @__PURE__ */ k(We.Root, { width: "1.5rem", height: "1.5rem", children: [
1561
+ s,
1562
+ o
1563
+ ] }), e[4] = s, e[5] = r) : r = e[5], r;
1493
1564
  }
1494
- function Sr(t) {
1495
- const e = k(9), {
1565
+ function vr(t) {
1566
+ const e = T(9), {
1496
1567
  seg: n,
1497
- onOpenFile: o
1498
- } = t, s = n.additions ?? 0, r = n.deletions ?? 0;
1568
+ onOpenFile: s
1569
+ } = t, o = n.additions ?? 0, r = n.deletions ?? 0;
1499
1570
  let i;
1500
- e[0] !== o || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1571
+ e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
1501
1572
  const c = n.filePath ?? n.fileName;
1502
- o?.(c);
1503
- }, e[0] = o, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1504
- let a;
1505
- return e[4] !== n.fileName || e[5] !== s || e[6] !== r || e[7] !== i ? (a = /* @__PURE__ */ l(ln, { fileName: n.fileName, additions: s, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = s, e[6] = r, e[7] = i, e[8] = a) : a = e[8], a;
1573
+ s?.(c);
1574
+ }, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
1575
+ let l;
1576
+ return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (l = /* @__PURE__ */ a(fn, { fileName: n.fileName, additions: o, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = o, e[6] = r, e[7] = i, e[8] = l) : l = e[8], l;
1506
1577
  }
1507
- function kr(t) {
1508
- const e = k(13), {
1578
+ function Lr(t) {
1579
+ const e = T(13), {
1509
1580
  seg: n,
1510
- onOpenFile: o
1511
- } = t, s = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", a = (n.muted, "fg.muted"), c = r ? "pointer" : "default";
1581
+ onOpenFile: s
1582
+ } = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", l = (n.muted, "fg.muted"), c = r ? "pointer" : "default";
1512
1583
  let u;
1513
- e[0] !== o || e[1] !== n ? (u = (f) => Cn(f, n, o, !0), e[0] = o, e[1] = n, e[2] = u) : u = e[2];
1584
+ e[0] !== s || e[1] !== n ? (u = (p) => Mn(p, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
1514
1585
  const d = n.muted ? "fg.muted" : "fg.blue-dark";
1515
- let p;
1516
- e[3] !== d ? (p = {
1586
+ let f;
1587
+ e[3] !== d ? (f = {
1517
1588
  textDecoration: "underline",
1518
1589
  color: d
1519
- }, e[3] = d, e[4] = p) : p = e[4];
1590
+ }, e[3] = d, e[4] = f) : f = e[4];
1520
1591
  let m;
1521
- return e[5] !== s || e[6] !== n.text || e[7] !== i || e[8] !== a || e[9] !== c || e[10] !== u || e[11] !== p ? (m = /* @__PURE__ */ l(Zt, { href: i, fontWeight: s, color: a, textDecoration: "none", cursor: c, onClick: u, _hover: p, children: n.text }), e[5] = s, e[6] = n.text, e[7] = i, e[8] = a, e[9] = c, e[10] = u, e[11] = p, e[12] = m) : m = e[12], m;
1592
+ return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== l || e[9] !== c || e[10] !== u || e[11] !== f ? (m = /* @__PURE__ */ a(sn, { href: i, fontWeight: o, color: l, textDecoration: "none", cursor: c, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = l, e[9] = c, e[10] = u, e[11] = f, e[12] = m) : m = e[12], m;
1522
1593
  }
1523
- function Tr(t) {
1524
- const e = k(12), {
1594
+ function Dr(t) {
1595
+ const e = T(12), {
1525
1596
  seg: n,
1526
- onOpenFile: o
1527
- } = t, s = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1528
- let a;
1529
- e[0] !== o || e[1] !== n ? (a = (p) => Cn(p, n, o), e[0] = o, e[1] = n, e[2] = a) : a = e[2];
1597
+ onOpenFile: s
1598
+ } = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
1599
+ let l;
1600
+ e[0] !== s || e[1] !== n ? (l = (f) => Mn(f, n, s), e[0] = s, e[1] = n, e[2] = l) : l = e[2];
1530
1601
  const c = n.muted ? "fg.muted" : "accent.primary";
1531
1602
  let u;
1532
1603
  e[3] !== c ? (u = {
@@ -1534,246 +1605,252 @@ function Tr(t) {
1534
1605
  textDecoration: "underline"
1535
1606
  }, e[3] = c, e[4] = u) : u = e[4];
1536
1607
  let d;
1537
- return e[5] !== s || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== a || e[10] !== u ? (d = /* @__PURE__ */ l(Zt, { href: r, fontWeight: s, color: i, textDecoration: "underline", onClick: a, _hover: u, children: n.text }), e[5] = s, e[6] = n.text, e[7] = r, e[8] = i, e[9] = a, e[10] = u, e[11] = d) : d = e[11], d;
1608
+ return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== l || e[10] !== u ? (d = /* @__PURE__ */ a(sn, { href: r, fontWeight: o, color: i, textDecoration: "underline", onClick: l, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = r, e[8] = i, e[9] = l, e[10] = u, e[11] = d) : d = e[11], d;
1538
1609
  }
1539
- function wr(t) {
1540
- const e = k(6), {
1610
+ function Br(t) {
1611
+ const e = T(6), {
1541
1612
  seg: n,
1542
- isClickable: o
1543
- } = t, s = n.bold ? "medium" : void 0, r = o && !n.muted ? "fg" : "fg.muted";
1613
+ isClickable: s
1614
+ } = t, o = n.bold ? "medium" : void 0, r = s && !n.muted ? "fg" : "fg.muted";
1544
1615
  let i;
1545
1616
  e[0] !== r ? (i = {
1546
1617
  color: r
1547
1618
  }, e[0] = r, e[1] = i) : i = e[1];
1548
- let a;
1549
- return e[2] !== n.text || e[3] !== s || e[4] !== i ? (a = /* @__PURE__ */ l(Ue, { fontWeight: s, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = s, e[4] = i, e[5] = a) : a = e[5], a;
1619
+ let l;
1620
+ return e[2] !== n.text || e[3] !== o || e[4] !== i ? (l = /* @__PURE__ */ a(Je, { fontWeight: o, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = o, e[4] = i, e[5] = l) : l = e[5], l;
1550
1621
  }
1551
- function Cr(t) {
1552
- const e = k(11), {
1622
+ function Or(t) {
1623
+ const e = T(11), {
1553
1624
  seg: n,
1554
- isClickable: o,
1555
- onOpenFile: s
1625
+ isClickable: s,
1626
+ onOpenFile: o
1556
1627
  } = t;
1557
1628
  switch (n.kind) {
1558
1629
  case "avatar": {
1559
1630
  let r;
1560
- return e[0] !== n ? (r = /* @__PURE__ */ l(xr, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1631
+ return e[0] !== n ? (r = /* @__PURE__ */ a(Er, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
1561
1632
  }
1562
1633
  case "diff": {
1563
1634
  let r;
1564
- return e[2] !== s || e[3] !== n ? (r = /* @__PURE__ */ l(Sr, { seg: n, onOpenFile: s }), e[2] = s, e[3] = n, e[4] = r) : r = e[4], r;
1635
+ return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ a(vr, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
1565
1636
  }
1566
1637
  case "link": {
1567
1638
  let r;
1568
- return e[5] !== s || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ l(kr, { seg: n, onOpenFile: s }) : /* @__PURE__ */ l(Tr, { seg: n, onOpenFile: s }), e[5] = s, e[6] = n, e[7] = r) : r = e[7], r;
1639
+ return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ a(Lr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ a(Dr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
1569
1640
  }
1570
1641
  case "text": {
1571
1642
  let r;
1572
- return e[8] !== o || e[9] !== n ? (r = /* @__PURE__ */ l(wr, { seg: n, isClickable: o }), e[8] = o, e[9] = n, e[10] = r) : r = e[10], r;
1643
+ return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ a(Br, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
1573
1644
  }
1574
1645
  default:
1575
1646
  return null;
1576
1647
  }
1577
1648
  }
1578
- function _r(t) {
1579
- const e = k(10), {
1649
+ function $r(t) {
1650
+ const e = T(10), {
1580
1651
  ind: n
1581
1652
  } = t;
1582
1653
  if (!n || n.type === "none")
1583
1654
  return null;
1584
1655
  if (n.type === "icon") {
1585
1656
  let i;
1586
- e[0] !== n.icon ? (i = go(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1587
- const a = i;
1657
+ e[0] !== n.icon ? (i = Is(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
1658
+ const l = i;
1588
1659
  let c;
1589
- return e[2] !== a ? (c = /* @__PURE__ */ l(ke.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ l(Ue, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ l(a, { size: 14, strokeWidth: 1 }) }) }), e[2] = a, e[3] = c) : c = e[3], c;
1660
+ return e[2] !== l ? (c = /* @__PURE__ */ a(Ce.Indicator, { outline: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ a(l, { size: 14, strokeWidth: 1 }) }) }), e[2] = l, e[3] = c) : c = e[3], c;
1590
1661
  }
1591
- let o;
1592
- e[4] !== n.alt || e[5] !== n.src ? (o = /* @__PURE__ */ l(qe.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = o) : o = e[6];
1593
1662
  let s;
1594
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ l(qe.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = s) : s = e[7];
1663
+ e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ a(We.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
1664
+ let o;
1665
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ a(We.Fallback, { background: "bg.muted", color: "fg.muted" }), e[7] = o) : o = e[7];
1595
1666
  let r;
1596
- return e[8] !== o ? (r = /* @__PURE__ */ l(ke.Indicator, { children: /* @__PURE__ */ T(qe.Root, { boxSize: "full", children: [
1597
- o,
1598
- s
1599
- ] }) }), e[8] = o, e[9] = r) : r = e[9], r;
1667
+ return e[8] !== s ? (r = /* @__PURE__ */ a(Ce.Indicator, { children: /* @__PURE__ */ k(We.Root, { boxSize: "full", children: [
1668
+ s,
1669
+ o
1670
+ ] }) }), e[8] = s, e[9] = r) : r = e[9], r;
1600
1671
  }
1601
- function Ar(t) {
1602
- const e = k(5), {
1672
+ function Fr(t) {
1673
+ const e = T(5), {
1603
1674
  code: n,
1604
- language: o
1605
- } = t, s = o ? `${o} code block` : "code block";
1675
+ language: s
1676
+ } = t, o = s ? `${s} code block` : "code block";
1606
1677
  let r;
1607
- e[0] !== n ? (r = /* @__PURE__ */ l(I, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1678
+ e[0] !== n ? (r = /* @__PURE__ */ a(I, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
1608
1679
  let i;
1609
- return e[2] !== s || e[3] !== r ? (i = /* @__PURE__ */ l(ut, { background: "bg.code", color: "fg", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ l(I, { 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;
1680
+ return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ a(ht, { background: "bg.code", color: "fg", borderRadius: "md", showHorizontalScrollbar: !0, showVerticalScrollbar: !1, children: /* @__PURE__ */ a(I, { as: "pre", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", whiteSpace: "pre", "aria-label": o, children: r }) }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
1610
1681
  }
1611
- function Rr(t) {
1612
- const e = k(30), {
1682
+ function zr(t) {
1683
+ const e = T(30), {
1613
1684
  b: n,
1614
- onOpenFile: o
1685
+ onOpenFile: s
1615
1686
  } = t;
1616
1687
  switch (n.type) {
1617
1688
  case "comment": {
1618
- let s;
1619
- e[0] !== n.text ? (s = /* @__PURE__ */ l(le.Body, { children: n.text }), e[0] = n.text, e[1] = s) : s = e[1];
1689
+ let o;
1690
+ e[0] !== n.text ? (o = /* @__PURE__ */ a(ue.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
1620
1691
  let r;
1621
- e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ l(le.Footer, { children: /* @__PURE__ */ T(Ke, { children: [
1692
+ e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ a(ue.Footer, { children: /* @__PURE__ */ k(Ze, { children: [
1622
1693
  "👏 ",
1623
1694
  n.reactions.clap
1624
1695
  ] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
1625
1696
  let i;
1626
- return e[4] !== s || e[5] !== r ? (i = /* @__PURE__ */ T(le.Root, { children: [
1627
- s,
1697
+ return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ k(ue.Root, { children: [
1698
+ o,
1628
1699
  r
1629
- ] }), e[4] = s, e[5] = r, e[6] = i) : i = e[6], i;
1700
+ ] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
1630
1701
  }
1631
1702
  case "code": {
1632
- let s;
1633
- return e[7] !== n.code || e[8] !== n.language ? (s = /* @__PURE__ */ l(le.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(le.Body, { padding: "0", children: /* @__PURE__ */ l(Ar, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = s) : s = e[9], s;
1703
+ let o;
1704
+ return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(Fr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
1634
1705
  }
1635
1706
  case "diff": {
1636
- const s = n.sideBySide ?? !1;
1707
+ const o = n.sideBySide ?? !1;
1637
1708
  let r;
1638
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== s ? (r = /* @__PURE__ */ l(le.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(le.Body, { padding: "0", children: /* @__PURE__ */ l(I, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ l(gs, { 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;
1709
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ a(ue.Root, { border: "0", padding: "0", children: /* @__PURE__ */ a(ue.Body, { padding: "0", children: /* @__PURE__ */ a(I, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ a(Co, { original: n.original, modified: n.modified, language: n.language, sideBySide: o, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = o, e[14] = r) : r = e[14], r;
1639
1710
  }
1640
1711
  case "text": {
1641
- let s;
1642
- return e[15] !== n.text ? (s = /* @__PURE__ */ l(le.Root, { background: "transparent", children: /* @__PURE__ */ l(le.Body, { padding: "sm", children: /* @__PURE__ */ l(q, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = s) : s = e[16], s;
1712
+ let o;
1713
+ return e[15] !== n.text ? (o = /* @__PURE__ */ a(ue.Root, { background: "transparent", children: /* @__PURE__ */ a(ue.Body, { padding: "sm", children: /* @__PURE__ */ a(X, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
1643
1714
  }
1644
1715
  case "todo-list": {
1645
- let s;
1646
- return e[17] !== n.items ? (s = /* @__PURE__ */ l(Ds, { items: n.items }), e[17] = n.items, e[18] = s) : s = e[18], s;
1716
+ let o;
1717
+ return e[17] !== n.items ? (o = /* @__PURE__ */ a(Go, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
1647
1718
  }
1648
1719
  case "question-form": {
1649
- let s;
1650
- return e[19] !== n.questions ? (s = /* @__PURE__ */ l(un, { questions: n.questions }), e[19] = n.questions, e[20] = s) : s = e[20], s;
1720
+ let o;
1721
+ return e[19] !== n.questions ? (o = /* @__PURE__ */ a(gn, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
1651
1722
  }
1652
1723
  case "references": {
1653
- let s;
1654
- e[21] !== n.references ? (s = n.references.map(Ir), e[21] = n.references, e[22] = s) : s = e[22];
1724
+ let o;
1725
+ e[21] !== n.references ? (o = n.references.map(qr), e[21] = n.references, e[22] = o) : o = e[22];
1655
1726
  let r;
1656
- return e[23] !== s ? (r = /* @__PURE__ */ l(Z, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: s }), e[23] = s, e[24] = r) : r = e[24], r;
1727
+ return e[23] !== o ? (r = /* @__PURE__ */ a(Y, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
1657
1728
  }
1658
1729
  case "component": {
1659
- let s;
1660
- e[25] !== n || e[26] !== o ? (s = n.render({
1661
- onOpenFile: o
1662
- }), e[25] = n, e[26] = o, e[27] = s) : s = e[27];
1730
+ let o;
1731
+ e[25] !== n || e[26] !== s ? (o = n.render({
1732
+ onOpenFile: s
1733
+ }), e[25] = n, e[26] = s, e[27] = o) : o = e[27];
1663
1734
  let r;
1664
- return e[28] !== s ? (r = /* @__PURE__ */ l(Lt, { children: s }), e[28] = s, e[29] = r) : r = e[29], r;
1735
+ return e[28] !== o ? (r = /* @__PURE__ */ a(Ot, { children: o }), e[28] = o, e[29] = r) : r = e[29], r;
1665
1736
  }
1666
1737
  }
1667
1738
  }
1668
- function Ir(t) {
1669
- return /* @__PURE__ */ l(ps, { fileName: t }, t);
1739
+ function qr(t) {
1740
+ return /* @__PURE__ */ a(zt, { fileName: t }, t);
1670
1741
  }
1671
- function Mr(t) {
1672
- const e = k(23), {
1742
+ function Hr(t) {
1743
+ const e = T(23), {
1673
1744
  item: n,
1674
- itemKey: o,
1675
- isOpen: s,
1745
+ itemKey: s,
1746
+ isOpen: o,
1676
1747
  canExpand: r,
1677
1748
  hasBlocks: i,
1678
- onToggle: a,
1749
+ onToggle: l,
1679
1750
  onOpenFile: c
1680
1751
  } = t;
1681
1752
  let u;
1682
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(ke.Separator, {}), e[0] = u) : u = e[0];
1753
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ a(Ce.Separator, {}), e[0] = u) : u = e[0];
1683
1754
  let d;
1684
- e[1] !== n.indicator ? (d = /* @__PURE__ */ T(ke.Connector, { children: [
1755
+ e[1] !== n.indicator ? (d = /* @__PURE__ */ k(Ce.Connector, { children: [
1685
1756
  u,
1686
- /* @__PURE__ */ l(_r, { ind: n.indicator })
1757
+ /* @__PURE__ */ a($r, { ind: n.indicator })
1687
1758
  ] }), e[1] = n.indicator, e[2] = d) : d = e[2];
1688
- const p = s ? "auto" : "20px";
1759
+ const f = o ? "auto" : "20px";
1689
1760
  let m;
1690
- e[3] !== r || e[4] !== s || e[5] !== n.title || e[6] !== o || e[7] !== c || e[8] !== a ? (m = n.title.length > 0 && /* @__PURE__ */ l(ke.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: r ? "pointer" : "default", onClick: r ? () => a(o) : void 0, children: /* @__PURE__ */ T(Ue, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1691
- /* @__PURE__ */ l(Ue, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((b, y) => /* @__PURE__ */ l(Cr, { seg: b, isClickable: r, onOpenFile: c }, y)) }),
1692
- r ? /* @__PURE__ */ l(Ue, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: s ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1761
+ e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== c || e[8] !== l ? (m = n.title.length > 0 && /* @__PURE__ */ a(Ce.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: r ? "pointer" : "default", onClick: r ? () => l(s) : void 0, children: /* @__PURE__ */ k(Je, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1762
+ /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((y, b) => /* @__PURE__ */ a(Or, { seg: y, isClickable: r, onOpenFile: c }, b)) }),
1763
+ r ? /* @__PURE__ */ a(Je, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1693
1764
  color: "fg"
1694
- }, children: /* @__PURE__ */ l(as, { size: 12 }) }) : null
1695
- ] }) }), e[3] = r, e[4] = s, e[5] = n.title, e[6] = o, e[7] = c, e[8] = a, e[9] = m) : m = e[9];
1696
- let f;
1697
- e[10] !== i || e[11] !== s || e[12] !== n.blocks || e[13] !== c ? (f = i ? /* @__PURE__ */ l(I, { display: "grid", gridTemplateRows: s ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: s ? /* @__PURE__ */ l(I, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, y) => /* @__PURE__ */ l(I, { children: /* @__PURE__ */ l(Rr, { b, onOpenFile: c }) }, y)) }) : null }) : null, e[10] = i, e[11] = s, e[12] = n.blocks, e[13] = c, e[14] = f) : f = e[14];
1765
+ }, children: /* @__PURE__ */ a(go, { size: 12 }) }) : null
1766
+ ] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = c, e[8] = l, e[9] = m) : m = e[9];
1767
+ let p;
1768
+ e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== c ? (p = i ? /* @__PURE__ */ a(I, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ a(I, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((y, b) => /* @__PURE__ */ a(I, { children: /* @__PURE__ */ a(zr, { b: y, onOpenFile: c }) }, b)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = c, e[14] = p) : p = e[14];
1698
1769
  let h;
1699
- e[15] !== p || e[16] !== m || e[17] !== f ? (h = /* @__PURE__ */ T(ke.Content, { pb: "xs", h: p, overflow: "hidden", children: [
1770
+ e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ k(Ce.Content, { pb: "xs", h: f, overflow: "hidden", children: [
1700
1771
  m,
1701
- f
1702
- ] }), e[15] = p, e[16] = m, e[17] = f, e[18] = h) : h = e[18];
1772
+ p
1773
+ ] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
1703
1774
  let g;
1704
- return e[19] !== o || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ T(ke.Item, { gap: "xs", children: [
1775
+ return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ k(Ce.Item, { gap: "xs", children: [
1705
1776
  d,
1706
1777
  h
1707
- ] }, o), e[19] = o, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1778
+ ] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
1708
1779
  }
1709
- function Er(t) {
1710
- const e = k(11), {
1780
+ function Qr(t) {
1781
+ const e = T(11), {
1711
1782
  data: n,
1712
- onOpenFile: o
1783
+ onOpenFile: s
1713
1784
  } = t;
1714
- let s;
1715
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = {}, e[0] = s) : s = e[0];
1716
- const [r, i] = G(s), a = Br;
1785
+ let o;
1786
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
1787
+ const [r, i] = G(o), l = Wr;
1717
1788
  let c;
1718
1789
  e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = (m) => {
1719
- i((f) => ({
1720
- ...f,
1721
- [m]: !f[m]
1790
+ i((p) => ({
1791
+ ...p,
1792
+ [m]: !p[m]
1722
1793
  }));
1723
1794
  }, e[1] = c) : c = e[1];
1724
1795
  const u = c;
1725
1796
  let d;
1726
- if (e[2] !== n.items || e[3] !== r || e[4] !== o) {
1797
+ if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
1727
1798
  let m;
1728
- e[6] !== r || e[7] !== o ? (m = (f, h) => {
1729
- const g = a(f, h), b = (f.blocks?.length ?? 0) > 0, y = (f.expandable ?? !0) && b, x = y ? r[g] ?? !1 : b;
1730
- return /* @__PURE__ */ l(Mr, { item: f, itemKey: g, isOpen: x, canExpand: y, hasBlocks: b, onToggle: u, onOpenFile: o }, g);
1731
- }, e[6] = r, e[7] = o, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = o, e[5] = d;
1799
+ e[6] !== r || e[7] !== s ? (m = (p, h) => {
1800
+ const g = l(p, h), y = (p.blocks?.length ?? 0) > 0, b = (p.expandable ?? !0) && y, x = b ? r[g] ?? !1 : y;
1801
+ return /* @__PURE__ */ a(Hr, { item: p, itemKey: g, isOpen: x, canExpand: b, hasBlocks: y, onToggle: u, onOpenFile: s }, g);
1802
+ }, e[6] = r, e[7] = s, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
1732
1803
  } else
1733
1804
  d = e[5];
1734
- let p;
1735
- return e[9] !== d ? (p = /* @__PURE__ */ l(ke.Root, { children: d }), e[9] = d, e[10] = p) : p = e[10], p;
1805
+ let f;
1806
+ return e[9] !== d ? (f = /* @__PURE__ */ a(Ce.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
1736
1807
  }
1737
- function Br(t, e) {
1808
+ function Wr(t, e) {
1738
1809
  return t.id ? `id:${t.id}` : `idx:${e}`;
1739
1810
  }
1740
- const Pr = (t) => dt(t.tool ?? "").replace(/_/g, "") === "question", Lr = (t) => {
1811
+ const Nr = (t) => gt(t.tool ?? "").replace(/_/g, "") === "question", Vr = (t) => {
1741
1812
  const e = t.state?.output;
1742
1813
  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;
1743
1814
  };
1744
- function vr(t) {
1745
- const e = k(8), {
1815
+ function jr(t) {
1816
+ const e = T(8), {
1746
1817
  invocations: n,
1747
- labeledBlocks: o,
1748
- hideQuestionForms: s,
1818
+ labeledBlocks: s,
1819
+ hideQuestionForms: o,
1749
1820
  onOpenFile: r
1750
- } = t, i = s === void 0 ? !1 : s;
1751
- let a, c;
1752
- if (e[0] !== i || e[1] !== n || e[2] !== o) {
1821
+ } = t, i = o === void 0 ? !1 : o;
1822
+ let l, c;
1823
+ if (e[0] !== i || e[1] !== n || e[2] !== s) {
1753
1824
  c = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1754
1825
  e: {
1755
- const p = i ? n.filter($r) : n;
1756
- if (p.length === 0) {
1826
+ const f = i ? n.filter(Ur) : n;
1827
+ if (f.length === 0) {
1757
1828
  c = null;
1758
1829
  break e;
1759
1830
  }
1760
- a = yr(p, {
1761
- labeledBlocks: o
1831
+ l = Mr(f, {
1832
+ labeledBlocks: s
1762
1833
  });
1763
1834
  }
1764
- e[0] = i, e[1] = n, e[2] = o, e[3] = a, e[4] = c;
1835
+ e[0] = i, e[1] = n, e[2] = s, e[3] = l, e[4] = c;
1765
1836
  } else
1766
- a = e[3], c = e[4];
1837
+ l = e[3], c = e[4];
1767
1838
  if (c !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
1768
1839
  return c;
1769
- const u = a;
1840
+ const u = l;
1770
1841
  let d;
1771
- return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ l(Er, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
1842
+ return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ a(Qr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
1772
1843
  }
1773
- function $r(t) {
1774
- return !Pr(t) || Lr(t);
1844
+ function Ur(t) {
1845
+ return !Nr(t) || Vr(t);
1775
1846
  }
1776
- const Or = (t) => t.type === "tool", Et = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Dr = (t) => {
1847
+ const Kr = (t) => t.type === "tool", Nt = (t) => t.filename ?? t.url.split("/").pop() ?? "attachment", Gr = /\.(avif|bmp|gif|jpe?g|png|svg|webp)$/i, Xr = (t) => t.mediaType?.startsWith("image/") || Gr.test(Nt(t)), Yr = (t) => Xr(t) ? /* @__PURE__ */ a(Un, { src: t.url, alt: `${Nt(t)} preview thumbnail`, boxSize: "18px", borderRadius: "xs", objectFit: "cover" }) : void 0, Jr = (t, e) => {
1848
+ if (e) {
1849
+ e(t.url);
1850
+ return;
1851
+ }
1852
+ typeof window < "u" && window.open(t.url, "_blank", "noopener,noreferrer");
1853
+ }, Zr = (t) => {
1777
1854
  if (t.message && t.message.trim().length > 0)
1778
1855
  return t.message;
1779
1856
  const {
@@ -1789,100 +1866,95 @@ const Or = (t) => t.type === "tool", Et = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
1789
1866
  default:
1790
1867
  return "An error occurred.";
1791
1868
  }
1792
- }, Fr = {
1869
+ }, ei = {
1793
1870
  info: "blue",
1794
1871
  warning: "orange",
1795
1872
  error: "red",
1796
1873
  success: "green",
1797
1874
  loading: "blue"
1798
- }, zr = (t, e) => {
1875
+ }, ti = (t, e) => {
1799
1876
  const n = [];
1800
- let o = e;
1801
- for (; o < t.length; ) {
1802
- const s = t[o];
1803
- if (!Or(s)) break;
1804
- n.push(s), o += 1;
1877
+ let s = e;
1878
+ for (; s < t.length; ) {
1879
+ const o = t[s];
1880
+ if (!Kr(o)) break;
1881
+ n.push(o), s += 1;
1805
1882
  }
1806
1883
  return {
1807
1884
  invocations: n,
1808
- nextIndex: o - 1
1885
+ nextIndex: s - 1
1809
1886
  };
1810
1887
  };
1811
- function _n(t) {
1812
- const e = k(8), {
1888
+ function En(t) {
1889
+ const e = T(8), {
1813
1890
  message: n,
1814
- hideQuestionForms: o,
1815
- onOpenFile: s,
1891
+ hideQuestionForms: s,
1892
+ onOpenFile: o,
1816
1893
  toolInvocationTimeline: r
1817
- } = t, i = o === void 0 ? !1 : o, a = r ?? vr;
1894
+ } = t, i = s === void 0 ? !1 : s, l = r ?? jr;
1818
1895
  let c;
1819
1896
  e[0] !== n.parts ? (c = n.parts ?? [], e[0] = n.parts, e[1] = c) : c = e[1];
1820
1897
  const u = c;
1821
1898
  let d;
1822
- if (e[2] !== a || e[3] !== i || e[4] !== n.id || e[5] !== s || e[6] !== u) {
1823
- const p = [];
1899
+ if (e[2] !== l || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
1900
+ const f = [];
1824
1901
  for (let m = 0; m < u.length; m = m + 1, m) {
1825
- const f = u[m], h = `${n.id}-${m}`;
1826
- e: switch (f.type) {
1902
+ const p = u[m], h = `${n.id}-${m}`;
1903
+ e: switch (p.type) {
1827
1904
  case "text": {
1828
- p.push(/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(fo, { children: f.text }) }, h));
1905
+ f.push(/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(Cs, { children: p.text }) }, h));
1829
1906
  break e;
1830
1907
  }
1831
1908
  case "reasoning": {
1832
- p.push(/* @__PURE__ */ l(I, { padding: "0", css: {
1909
+ f.push(/* @__PURE__ */ a(I, { padding: "0", css: {
1833
1910
  "& .rich-text, & .rich-text *": {
1834
1911
  color: "fg.subtle !important",
1835
1912
  fontSize: ".75rem !important",
1836
1913
  fontWeight: "normal !important"
1837
1914
  }
1838
- }, children: /* @__PURE__ */ l(on, { defaultState: f.text, fullWidth: !0 }) }, h));
1915
+ }, children: /* @__PURE__ */ a(un, { defaultState: p.text, fullWidth: !0 }) }, h));
1839
1916
  break e;
1840
1917
  }
1841
1918
  case "tool": {
1842
1919
  const {
1843
1920
  invocations: g,
1844
- nextIndex: b
1845
- } = zr(u, m);
1846
- m = b, p.push(/* @__PURE__ */ l(I, { width: "full", children: /* @__PURE__ */ l(a, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: s }) }, h));
1921
+ nextIndex: y
1922
+ } = ti(u, m);
1923
+ m = y, f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(l, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
1847
1924
  break e;
1848
1925
  }
1849
- case "error": {
1850
- p.push(/* @__PURE__ */ l(I, { py: "2", width: "full", children: /* @__PURE__ */ l(Ht, { borderRadius: "xs", status: "error", colorPalette: "red", title: Dr(f), size: "sm" }) }, h));
1926
+ case "file": {
1927
+ f.push(/* @__PURE__ */ a(I, { width: "fit-content", children: /* @__PURE__ */ a(zt, { fileName: Nt(p), size: "sm", tone: "neutral", icon: Yr(p), onSelect: () => Jr(p, o) }) }, h));
1851
1928
  break e;
1852
1929
  }
1853
- case "token_usage": {
1854
- p.push(/* @__PURE__ */ l(I, { children: /* @__PURE__ */ T(q, { fontSize: "xs", color: "fg.subtle", children: [
1855
- "Tokens: ",
1856
- Et(f.inputTokens),
1857
- " in / ",
1858
- Et(f.outputTokens),
1859
- " out",
1860
- f.cacheReadTokens ? ` / ${Et(f.cacheReadTokens)} cache read` : ""
1861
- ] }) }, h));
1930
+ case "error": {
1931
+ f.push(/* @__PURE__ */ a(I, { py: "2", width: "full", children: /* @__PURE__ */ a(Ut, { borderRadius: "xs", status: "error", colorPalette: "red", title: Zr(p), size: "sm" }) }, h));
1862
1932
  break e;
1863
1933
  }
1934
+ case "token_usage":
1935
+ break e;
1864
1936
  case "alert": {
1865
- p.push(/* @__PURE__ */ l(I, { width: "full", children: /* @__PURE__ */ l(Ht, { borderRadius: "xs", status: f.status === "loading" ? "info" : f.status, colorPalette: Fr[f.status], title: f.title, icon: f.status === "loading" ? /* @__PURE__ */ l($t, { size: "sm" }) : void 0, size: "sm", children: f.message }) }, h));
1937
+ f.push(/* @__PURE__ */ a(I, { width: "full", children: /* @__PURE__ */ a(Ut, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: ei[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ a(Ft, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
1866
1938
  break e;
1867
1939
  }
1868
1940
  default:
1869
- p.push(null);
1941
+ f.push(null);
1870
1942
  }
1871
1943
  }
1872
- d = /* @__PURE__ */ l(Lt, { children: p }), e[2] = a, e[3] = i, e[4] = n.id, e[5] = s, e[6] = u, e[7] = d;
1944
+ d = /* @__PURE__ */ a(Ot, { children: f }), e[2] = l, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
1873
1945
  } else
1874
1946
  d = e[7];
1875
1947
  return d;
1876
1948
  }
1877
- const qr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Qr = (t) => {
1949
+ const ni = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", oi = (t) => {
1878
1950
  const e = t.parts ?? [];
1879
- return e.length === 0 || e.some((o) => o.type === "text" && "text" in o) ? !1 : e.some((o) => o.type === "reasoning" || o.type === "tool");
1880
- }, Hr = (t) => {
1951
+ return e.length === 0 || e.some((s) => s.type === "text" && "text" in s) ? !1 : e.some((s) => s.type === "reasoning" || s.type === "tool");
1952
+ }, si = (t) => {
1881
1953
  const e = [];
1882
1954
  for (const n of t) {
1883
- const o = e[e.length - 1];
1884
- if (o && o.role === n.role && Qr(n)) {
1885
- o.parts = [...o.parts ?? [], ...n.parts ?? []];
1955
+ const s = e[e.length - 1];
1956
+ if (s && s.role === n.role && oi(n)) {
1957
+ s.parts = [...s.parts ?? [], ...n.parts ?? []];
1886
1958
  continue;
1887
1959
  }
1888
1960
  e.push({
@@ -1891,325 +1963,328 @@ const qr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
1891
1963
  });
1892
1964
  }
1893
1965
  return e;
1894
- }, Wr = (t) => {
1966
+ }, ri = (t) => {
1895
1967
  const e = [], n = [];
1896
- for (const o of t)
1897
- o.role === "user" ? e.push({
1898
- userMessage: o,
1968
+ for (const s of t)
1969
+ s.role === "user" ? e.push({
1970
+ userMessage: s,
1899
1971
  responses: []
1900
- }) : e.length > 0 ? e[e.length - 1].responses.push(o) : n.push(o);
1972
+ }) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
1901
1973
  return {
1902
1974
  groups: e,
1903
1975
  leadingResponses: n
1904
1976
  };
1905
- }, An = 720, Nr = 1, Vr = 3, jr = 20, Yt = 1, Ur = 4, Rn = 8, Kr = (t, e) => [...t.map((n) => ({
1977
+ }, vn = 720, ii = 1, li = 3, ai = 20, nn = 1, ci = 4, Ln = 8, ui = (t, e) => [...t.map((n) => ({
1906
1978
  type: "leading-response",
1907
1979
  key: n.id,
1908
1980
  message: n
1909
- })), ...e.map((n, o) => ({
1981
+ })), ...e.map((n, s) => ({
1910
1982
  type: "group",
1911
1983
  key: n.userMessage.id,
1912
1984
  group: n,
1913
- groupIndex: o
1914
- }))], Gr = (t, e) => {
1985
+ groupIndex: s
1986
+ }))], di = (t, e) => {
1915
1987
  if (t === 0) return 0;
1916
- const n = t * An + (t - 1) * Rn;
1988
+ const n = t * vn + (t - 1) * Ln;
1917
1989
  return Math.max(n - e, 0);
1918
- }, Xr = (t) => t?.clientHeight || Nr, Yr = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= Yt && Math.abs(t.totalSize - e.totalSize) <= Yt, Jr = (t, e) => ({
1990
+ }, fi = (t) => t?.clientHeight || ii, pi = (t, e) => Math.abs(t.scrollTop - e.scrollTop) <= nn && Math.abs(t.totalSize - e.totalSize) <= nn, mi = (t, e) => ({
1919
1991
  scrollTop: t?.scrollTop ?? 0,
1920
1992
  totalSize: e
1921
- }), Zr = (t) => {
1922
- const e = k(8), {
1993
+ }), hi = (t) => {
1994
+ const e = T(8), {
1923
1995
  itemCount: n,
1924
- onReady: o,
1925
- scrollRef: s,
1996
+ onReady: s,
1997
+ scrollRef: o,
1926
1998
  totalSize: r
1927
- } = t, i = Qe(o);
1928
- let a, c;
1929
- e[0] !== o ? (a = () => {
1930
- i.current = o;
1931
- }, c = [o], e[0] = o, e[1] = a, e[2] = c) : (a = e[1], c = e[2]), Te(a, c);
1999
+ } = t, i = Ne(s);
2000
+ let l, c;
2001
+ e[0] !== s ? (l = () => {
2002
+ i.current = s;
2003
+ }, c = [s], e[0] = s, e[1] = l, e[2] = c) : (l = e[1], c = e[2]), Ae(l, c);
1932
2004
  let u, d;
1933
- e[3] !== n || e[4] !== s || e[5] !== r ? (u = () => {
2005
+ e[3] !== n || e[4] !== o || e[5] !== r ? (u = () => {
1934
2006
  if (n === 0 || typeof requestAnimationFrame > "u") {
1935
2007
  i.current?.();
1936
2008
  return;
1937
2009
  }
1938
- let p = 0, m = 0, f = 0, h = null;
2010
+ let f = 0, m = 0, p = 0, h = null;
1939
2011
  const g = () => {
1940
2012
  m = m + 1;
1941
- const b = Jr(s.current, r);
1942
- if (f = h && Yr(b, h) ? f + 1 : 0, h = b, f >= Vr || m >= jr) {
2013
+ const y = mi(o.current, r);
2014
+ if (p = h && pi(y, h) ? p + 1 : 0, h = y, p >= li || m >= ai) {
1943
2015
  i.current?.();
1944
2016
  return;
1945
2017
  }
1946
- p = requestAnimationFrame(g);
2018
+ f = requestAnimationFrame(g);
1947
2019
  };
1948
- return p = requestAnimationFrame(g), () => cancelAnimationFrame(p);
1949
- }, 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]), Te(u, d);
1950
- }, ei = (t) => {
1951
- const e = k(7), {
2020
+ return f = requestAnimationFrame(g), () => cancelAnimationFrame(f);
2021
+ }, d = [n, o, r], e[3] = n, e[4] = o, e[5] = r, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), Ae(u, d);
2022
+ }, gi = (t) => {
2023
+ const e = T(7), {
1952
2024
  label: n,
1953
- onClick: o,
1954
- actionPanel: s
1955
- } = t, r = s ? "space-between" : "flex-end";
2025
+ onClick: s,
2026
+ actionPanel: o
2027
+ } = t, r = o ? "space-between" : "flex-end";
1956
2028
  let i;
1957
- e[0] !== n || e[1] !== o ? (i = /* @__PURE__ */ l(Ke, { size: "2xs", variant: "solid", pointerEvents: "auto", onClick: o, children: n }), e[0] = n, e[1] = o, e[2] = i) : i = e[2];
1958
- let a;
1959
- return e[3] !== s || e[4] !== r || e[5] !== i ? (a = /* @__PURE__ */ T(Ce, { 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: [
1960
- s,
2029
+ e[0] !== n || e[1] !== s ? (i = /* @__PURE__ */ a(Ze, { size: "2xs", variant: "outline", pointerEvents: "auto", onClick: s, children: n }), e[0] = n, e[1] = s, e[2] = i) : i = e[2];
2030
+ let l;
2031
+ return e[3] !== o || e[4] !== r || e[5] !== i ? (l = /* @__PURE__ */ k(Re, { 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: [
2032
+ o,
1961
2033
  i
1962
- ] }), e[3] = s, e[4] = r, e[5] = i, e[6] = a) : a = e[6], a;
1963
- }, In = (t, e, n = !1) => {
1964
- const o = qr(t.role);
1965
- return /* @__PURE__ */ l(we.Root, { from: o, children: /* @__PURE__ */ T(we.Content, { from: o, children: [
1966
- /* @__PURE__ */ l(_n, { message: t, streaming: e, hideQuestionForms: n }),
1967
- o === "assistant" || o === "user" ? /* @__PURE__ */ l(Pt, { message: t, alwaysVisible: o === "user", copyAlwaysVisible: o !== "user" }) : null
2034
+ ] }), e[3] = o, e[4] = r, e[5] = i, e[6] = l) : l = e[6], l;
2035
+ }, Dn = (t, e, n = !1) => {
2036
+ const s = ni(t.role);
2037
+ return /* @__PURE__ */ a(_e.Root, { from: s, children: /* @__PURE__ */ k(_e.Content, { from: s, children: [
2038
+ /* @__PURE__ */ a(En, { message: t, streaming: e, hideQuestionForms: n }),
2039
+ s === "assistant" || s === "user" ? /* @__PURE__ */ a(Bt, { message: t, alwaysVisible: s === "user", copyAlwaysVisible: s !== "user" }) : null
1968
2040
  ] }) });
1969
- }, ti = (t) => {
1970
- io(t.currentTarget, t.deltaY) && t.stopPropagation();
1971
- }, ni = (t, e) => {
2041
+ }, bi = (t) => {
2042
+ xs(t.currentTarget, t.deltaY) && t.stopPropagation();
2043
+ }, yi = (t, e) => {
1972
2044
  if (t)
1973
- return e ? dn : so;
1974
- }, si = (t) => {
2045
+ return e ? bn : gs;
2046
+ }, xi = (t) => {
1975
2047
  if (t)
1976
- return dn;
1977
- }, oi = (t) => {
1978
- const e = k(43), {
2048
+ return bn;
2049
+ }, Si = (t) => {
2050
+ const e = T(43), {
1979
2051
  group: n,
1980
- streaming: o,
1981
- hideQuestionForms: s,
2052
+ streaming: s,
2053
+ hideQuestionForms: o,
1982
2054
  isExpanded: r,
1983
2055
  onToggleStickyMessage: i
1984
2056
  } = t;
1985
- let a, c, u;
1986
- e[0] !== n.userMessage || e[1] !== r ? (a = ro(n.userMessage), c = a && r, u = ni(a, r), e[0] = n.userMessage, e[1] = r, e[2] = a, e[3] = c, e[4] = u) : (a = e[2], c = e[3], u = e[4]);
2057
+ let l, c, u;
2058
+ e[0] !== n.userMessage || e[1] !== r ? (l = ys(n.userMessage), c = l && r, u = yi(l, r), e[0] = n.userMessage, e[1] = r, e[2] = l, e[3] = c, e[4] = u) : (l = e[2], c = e[3], u = e[4]);
1987
2059
  const d = u;
1988
- let p;
1989
- e[5] !== n.userMessage.id || e[6] !== i ? (p = () => i(n.userMessage.id), e[5] = n.userMessage.id, e[6] = i, e[7] = p) : p = e[7];
1990
- const m = p, f = a ? "0" : void 0, h = a ? "relative" : void 0, g = a ? r ? "expanded" : "collapsed" : void 0;
1991
- let b;
1992
- e[8] !== c ? (b = si(c), e[8] = c, e[9] = b) : b = e[9];
1993
- const y = c ? "auto" : "visible", x = a ? "xs" : void 0, _ = a ? "xs" : void 0, C = c ? "3rem" : void 0, w = c ? ti : void 0;
1994
- let R;
1995
- e[10] !== n.userMessage || e[11] !== o ? (R = /* @__PURE__ */ l(_n, { message: n.userMessage, streaming: o }), e[10] = n.userMessage, e[11] = o, e[12] = R) : R = e[12];
1996
- let B;
1997
- e[13] !== w || e[14] !== R || e[15] !== g || e[16] !== b || e[17] !== y || e[18] !== x || e[19] !== _ || e[20] !== C ? (B = /* @__PURE__ */ l(I, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: b, minH: "0", overflowY: y, px: x, py: _, pb: C, onWheel: w, children: R }), e[13] = w, e[14] = R, e[15] = g, e[16] = b, e[17] = y, e[18] = x, e[19] = _, e[20] = C, e[21] = B) : B = e[21];
2060
+ let f;
2061
+ e[5] !== n.userMessage.id || e[6] !== i ? (f = () => i(n.userMessage.id), e[5] = n.userMessage.id, e[6] = i, e[7] = f) : f = e[7];
2062
+ const m = f, p = l ? "0" : void 0, h = l ? "relative" : void 0, g = l ? r ? "expanded" : "collapsed" : void 0;
2063
+ let y;
2064
+ e[8] !== c ? (y = xi(c), e[8] = c, e[9] = y) : y = e[9];
2065
+ const b = c ? "auto" : "visible", x = l ? "xs" : void 0, C = l ? "xs" : void 0, A = c ? "3rem" : void 0, w = c ? bi : void 0;
2066
+ let _;
2067
+ e[10] !== n.userMessage || e[11] !== s ? (_ = /* @__PURE__ */ a(En, { message: n.userMessage, streaming: s }), e[10] = n.userMessage, e[11] = s, e[12] = _) : _ = e[12];
1998
2068
  let M;
1999
- e[22] !== n.userMessage || e[23] !== a || e[24] !== r || e[25] !== m ? (M = a ? /* @__PURE__ */ l(ei, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ l(Pt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ l(Pt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[22] = n.userMessage, e[23] = a, e[24] = r, e[25] = m, e[26] = M) : M = e[26];
2069
+ e[13] !== w || e[14] !== _ || e[15] !== g || e[16] !== y || e[17] !== b || e[18] !== x || e[19] !== C || e[20] !== A ? (M = /* @__PURE__ */ a(I, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: y, minH: "0", overflowY: b, px: x, py: C, pb: A, onWheel: w, children: _ }), e[13] = w, e[14] = _, e[15] = g, e[16] = y, e[17] = b, e[18] = x, e[19] = C, e[20] = A, e[21] = M) : M = e[21];
2000
2070
  let P;
2001
- e[27] !== d || e[28] !== B || e[29] !== M || e[30] !== f || e[31] !== h ? (P = /* @__PURE__ */ l(I, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ l(we.Root, { from: "user", children: /* @__PURE__ */ T(we.Content, { from: "user", maxH: d, overflow: "hidden", p: f, position: h, children: [
2002
- B,
2003
- M
2004
- ] }) }) }), e[27] = d, e[28] = B, e[29] = M, e[30] = f, e[31] = h, e[32] = P) : P = e[32];
2005
- let Q;
2006
- if (e[33] !== n.responses || e[34] !== s || e[35] !== o) {
2007
- let H;
2008
- e[37] !== s || e[38] !== o ? (H = (ee) => /* @__PURE__ */ l(I, { children: In(ee, o, s) }, ee.id), e[37] = s, e[38] = o, e[39] = H) : H = e[39], Q = n.responses.map(H), e[33] = n.responses, e[34] = s, e[35] = o, e[36] = Q;
2009
- } else
2010
- Q = e[36];
2071
+ e[22] !== n.userMessage || e[23] !== l || e[24] !== r || e[25] !== m ? (P = l ? /* @__PURE__ */ a(gi, { label: r ? "Show less" : "Show more", onClick: m, actionPanel: /* @__PURE__ */ a(Bt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }) }) : /* @__PURE__ */ a(Bt, { message: n.userMessage, alwaysVisible: !0, copyAlwaysVisible: !1 }), e[22] = n.userMessage, e[23] = l, e[24] = r, e[25] = m, e[26] = P) : P = e[26];
2072
+ let v;
2073
+ e[27] !== d || e[28] !== M || e[29] !== P || e[30] !== p || e[31] !== h ? (v = /* @__PURE__ */ a(I, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ k(_e.Content, { from: "user", maxH: d, overflow: "hidden", p, position: h, children: [
2074
+ M,
2075
+ P
2076
+ ] }) }) }), e[27] = d, e[28] = M, e[29] = P, e[30] = p, e[31] = h, e[32] = v) : v = e[32];
2011
2077
  let L;
2012
- return e[40] !== P || e[41] !== Q ? (L = /* @__PURE__ */ T(I, { children: [
2013
- P,
2014
- Q
2015
- ] }), e[40] = P, e[41] = Q, e[42] = L) : L = e[42], L;
2016
- }, ri = (t, e) => {
2078
+ if (e[33] !== n.responses || e[34] !== o || e[35] !== s) {
2079
+ let J;
2080
+ e[37] !== o || e[38] !== s ? (J = (B) => /* @__PURE__ */ a(I, { children: Dn(B, s, o) }, B.id), e[37] = o, e[38] = s, e[39] = J) : J = e[39], L = n.responses.map(J), e[33] = n.responses, e[34] = o, e[35] = s, e[36] = L;
2081
+ } else
2082
+ L = e[36];
2083
+ let H;
2084
+ return e[40] !== v || e[41] !== L ? (H = /* @__PURE__ */ k(I, { children: [
2085
+ v,
2086
+ L
2087
+ ] }), e[40] = v, e[41] = L, e[42] = H) : H = e[42], H;
2088
+ }, Ti = (t, e) => {
2017
2089
  const {
2018
2090
  groups: n,
2019
- streaming: o,
2020
- hideActiveQuestionForms: s,
2091
+ streaming: s,
2092
+ hideActiveQuestionForms: o,
2021
2093
  expandedStickyMessageIds: r,
2022
2094
  onToggleStickyMessage: i
2023
2095
  } = e;
2024
- return t.type === "leading-response" ? In(t.message, o, n.length > 0 || s) : /* @__PURE__ */ l(oi, { group: t.group, streaming: o, hideQuestionForms: t.groupIndex < n.length - 1 || s, isExpanded: r.has(t.group.userMessage.id), onToggleStickyMessage: i });
2025
- }, ii = (t) => {
2096
+ return t.type === "leading-response" ? Dn(t.message, s, n.length > 0 || o) : /* @__PURE__ */ a(Si, { group: t.group, streaming: s, hideQuestionForms: t.groupIndex < n.length - 1 || o, isExpanded: r.has(t.group.userMessage.id), onToggleStickyMessage: i });
2097
+ }, wi = (t) => {
2026
2098
  const {
2027
2099
  leadingResponses: e,
2028
2100
  groups: n,
2029
- streaming: o,
2030
- hideActiveQuestionForms: s,
2101
+ streaming: s,
2102
+ hideActiveQuestionForms: o,
2031
2103
  expandedStickyMessageIds: r,
2032
2104
  onToggleStickyMessage: i,
2033
- onReady: a
2105
+ onReady: l
2034
2106
  } = t, {
2035
2107
  scrollRef: c
2036
- } = ct(), u = Kr(e, n), d = Xr(c.current), p = ys({
2108
+ } = mt(), u = ui(e, n), d = fi(c.current), f = _o({
2037
2109
  count: u.length,
2038
2110
  getScrollElement: () => c.current,
2039
- estimateSize: () => An,
2040
- getItemKey: (f) => u[f]?.key ?? f,
2041
- overscan: Ur,
2042
- gap: Rn,
2111
+ estimateSize: () => vn,
2112
+ getItemKey: (p) => u[p]?.key ?? p,
2113
+ overscan: ci,
2114
+ gap: Ln,
2043
2115
  initialRect: {
2044
2116
  width: 0,
2045
2117
  height: d
2046
2118
  },
2047
- initialOffset: () => Gr(u.length, d)
2048
- }), m = p.getTotalSize();
2049
- return Zr({
2119
+ initialOffset: () => di(u.length, d)
2120
+ }), m = f.getTotalSize();
2121
+ return hi({
2050
2122
  itemCount: u.length,
2051
- onReady: a,
2123
+ onReady: l,
2052
2124
  scrollRef: c,
2053
2125
  totalSize: m
2054
- }), /* @__PURE__ */ l(I, { px: "xs", children: /* @__PURE__ */ l(I, { position: "relative", width: "100%", style: {
2126
+ }), /* @__PURE__ */ a(I, { px: "xs", children: /* @__PURE__ */ a(I, { position: "relative", width: "100%", style: {
2055
2127
  height: m
2056
- }, children: p.getVirtualItems().map((f) => {
2057
- const h = u[f.index];
2058
- return h ? /* @__PURE__ */ l(I, { ref: p.measureElement, "data-index": f.index, "data-chat-message-list-item": h.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2059
- top: f.start
2060
- }, children: ri(h, {
2128
+ }, children: f.getVirtualItems().map((p) => {
2129
+ const h = u[p.index];
2130
+ return h ? /* @__PURE__ */ a(I, { ref: f.measureElement, "data-index": p.index, "data-chat-message-list-item": h.type, position: "absolute", top: "0", left: "0", width: "100%", style: {
2131
+ top: p.start
2132
+ }, children: Ti(h, {
2061
2133
  groups: n,
2062
- streaming: o,
2063
- hideActiveQuestionForms: s,
2134
+ streaming: s,
2135
+ hideActiveQuestionForms: o,
2064
2136
  expandedStickyMessageIds: r,
2065
2137
  onToggleStickyMessage: i
2066
- }) }, f.key) : null;
2138
+ }) }, p.key) : null;
2067
2139
  }) }) });
2068
- }, Ui = (t) => {
2069
- const e = k(62), {
2140
+ }, dl = (t) => {
2141
+ const e = T(64), {
2070
2142
  conversationKey: n,
2071
- messages: o,
2072
- loading: s,
2143
+ messages: s,
2144
+ loading: o,
2073
2145
  streaming: r,
2074
2146
  emptyStateTitle: i,
2075
- emptyStateDescription: a,
2147
+ emptyStateDescription: l,
2076
2148
  emptyStateContent: c,
2077
2149
  loaderComponent: u,
2078
2150
  chatInputPlaceholder: d,
2079
- chatInputDefaultValue: p,
2151
+ chatInputDefaultValue: f,
2080
2152
  onSubmitMessage: m,
2081
- onInterrupt: f,
2082
- onChatInputChange: h,
2083
- actions: g,
2084
- repoMenu: b,
2085
- attachedResources: y,
2086
- onClearAttachments: x,
2087
- attachmentList: _,
2088
- approvalPrompt: C,
2089
- workspaceHub: w,
2090
- workspaceInitializing: R,
2091
- inputDisabled: B,
2092
- chatInputQuestionPrompt: M,
2093
- chatInputAutoFocus: P
2094
- } = t, Q = s === void 0 ? !1 : s, L = r === void 0 ? !1 : r, H = p === void 0 ? "" : p, ee = R === void 0 ? !1 : R, _e = B === void 0 ? !1 : B, Ae = P === void 0 ? !1 : P;
2095
- let $, E, te, W;
2096
- if (e[0] !== n || e[1] !== o) {
2097
- const v = Hr(o);
2098
- $ = v.length > 0;
2099
- const ye = n ?? v[0]?.id;
2100
- E = $ ? ye ?? "active-conversation" : null, W = v.reduce(li, 0), te = Wr(v), e[0] = n, e[1] = o, e[2] = $, e[3] = E, e[4] = te, e[5] = W;
2153
+ onInterrupt: p,
2154
+ onAttachFiles: h,
2155
+ onAttachText: g,
2156
+ onChatInputChange: y,
2157
+ actions: b,
2158
+ repoMenu: x,
2159
+ attachedResources: C,
2160
+ onClearAttachments: A,
2161
+ attachmentList: w,
2162
+ approvalPrompt: _,
2163
+ workspaceHub: M,
2164
+ workspaceInitializing: P,
2165
+ inputDisabled: v,
2166
+ chatInputQuestionPrompt: L,
2167
+ chatInputAutoFocus: H
2168
+ } = t, J = o === void 0 ? !1 : o, B = r === void 0 ? !1 : r, ve = f === void 0 ? "" : f, je = P === void 0 ? !1 : P, Le = v === void 0 ? !1 : v, he = H === void 0 ? !1 : H;
2169
+ let F, z, ee, E;
2170
+ if (e[0] !== n || e[1] !== s) {
2171
+ const q = si(s);
2172
+ F = q.length > 0;
2173
+ const we = n ?? q[0]?.id;
2174
+ z = F ? we ?? "active-conversation" : null, E = q.reduce(ki, 0), ee = ri(q), e[0] = n, e[1] = s, e[2] = F, e[3] = z, e[4] = ee, e[5] = E;
2101
2175
  } else
2102
- $ = e[2], E = e[3], te = e[4], W = e[5];
2176
+ F = e[2], z = e[3], ee = e[4], E = e[5];
2103
2177
  const {
2104
- groups: O,
2105
- leadingResponses: fe
2106
- } = te, [Re, We] = G(ai), [Pe, Ye] = G(null), Le = !$ && Q;
2107
- let ne;
2108
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ne = /* @__PURE__ */ l(cs, { size: 48, strokeWidth: 1.5 }), e[6] = ne) : ne = e[6];
2109
- let se;
2110
- e[7] !== a || e[8] !== i ? (se = /* @__PURE__ */ l(bs, { icon: ne, title: i, description: a }), e[7] = a, e[8] = i, e[9] = se) : se = e[9];
2111
- const pe = Le ? u : c ?? se, X = !!w, me = !!M, he = L && $ && !ee, oe = !E || Pe === E;
2178
+ groups: ge,
2179
+ leadingResponses: be
2180
+ } = ee, [O, De] = G(Ci), [Ue, Ke] = G(null), Be = !F && J;
2112
2181
  let Ie;
2113
- e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = (v) => {
2114
- We((ye) => {
2115
- const xe = new Set(ye);
2116
- return xe.has(v) ? xe.delete(v) : xe.add(v), xe;
2182
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ie = /* @__PURE__ */ a(bo, { size: 48, strokeWidth: 1.5 }), e[6] = Ie) : Ie = e[6];
2183
+ let te;
2184
+ e[7] !== l || e[8] !== i ? (te = /* @__PURE__ */ a(Ao, { icon: Ie, title: i, description: l }), e[7] = l, e[8] = i, e[9] = te) : te = e[9];
2185
+ const ye = Be ? u : c ?? te, ne = !!M, xe = !!L, oe = B && F && !je, se = !z || Ue === z;
2186
+ let re;
2187
+ e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = (q) => {
2188
+ De((we) => {
2189
+ const K = new Set(we);
2190
+ return K.has(q) ? K.delete(q) : K.add(q), K;
2117
2191
  });
2118
- }, e[10] = Ie) : Ie = e[10];
2119
- const ve = Ie;
2192
+ }, e[10] = re) : re = e[10];
2193
+ const Oe = re;
2194
+ let ie;
2195
+ e[11] !== E ? (ie = /* @__PURE__ */ a(Ho, { userMessageCount: E }), e[11] = E, e[12] = ie) : ie = e[12];
2196
+ const Se = se ? "visible" : "hidden";
2197
+ let Q;
2198
+ e[13] !== ye || e[14] !== O || e[15] !== ge || e[16] !== F || e[17] !== xe || e[18] !== be || e[19] !== z || e[20] !== B ? (Q = F ? /* @__PURE__ */ a(wi, { leadingResponses: be, groups: ge, streaming: B, hideActiveQuestionForms: xe, expandedStickyMessageIds: O, onToggleStickyMessage: Oe, onReady: () => Ke(z) }, z) : ye, e[13] = ye, e[14] = O, e[15] = ge, e[16] = F, e[17] = xe, e[18] = be, e[19] = z, e[20] = B, e[21] = Q) : Q = e[21];
2199
+ let W;
2200
+ e[22] !== Se || e[23] !== Q ? (W = /* @__PURE__ */ a(Et.Viewport, { visibility: Se, children: Q }), e[22] = Se, e[23] = Q, e[24] = W) : W = e[24];
2201
+ let Te;
2202
+ e[25] !== se ? (Te = se ? /* @__PURE__ */ a(Et.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[25] = se, e[26] = Te) : Te = e[26];
2120
2203
  let N;
2121
- e[11] !== W ? (N = /* @__PURE__ */ l(Bs, { userMessageCount: W }), e[11] = W, e[12] = N) : N = e[12];
2122
- const ge = oe ? "visible" : "hidden";
2123
- let be;
2124
- e[13] !== pe || e[14] !== Re || e[15] !== O || e[16] !== $ || e[17] !== me || e[18] !== fe || e[19] !== E || e[20] !== L ? (be = $ ? /* @__PURE__ */ l(ii, { leadingResponses: fe, groups: O, streaming: L, hideActiveQuestionForms: me, expandedStickyMessageIds: Re, onToggleStickyMessage: ve, onReady: () => Ye(E) }, E) : pe, e[13] = pe, e[14] = Re, e[15] = O, e[16] = $, e[17] = me, e[18] = fe, e[19] = E, e[20] = L, e[21] = be) : be = e[21];
2125
- let V;
2126
- e[22] !== ge || e[23] !== be ? (V = /* @__PURE__ */ l(Rt.Viewport, { visibility: ge, children: be }), e[22] = ge, e[23] = be, e[24] = V) : V = e[24];
2127
- let Y;
2128
- e[25] !== oe ? (Y = oe ? /* @__PURE__ */ l(Rt.ScrollToBottom, { "aria-label": "Scroll to latest message" }) : null, e[25] = oe, e[26] = Y) : Y = e[26];
2204
+ e[27] !== ie || e[28] !== W || e[29] !== Te ? (N = /* @__PURE__ */ k(Et.Root, { children: [
2205
+ ie,
2206
+ W,
2207
+ Te
2208
+ ] }), e[27] = ie, e[28] = W, e[29] = Te, e[30] = N) : N = e[30];
2209
+ let Z;
2210
+ e[31] !== oe ? (Z = oe ? /* @__PURE__ */ k(Me, { gap: "xs", px: "sm", py: "2xs", children: [
2211
+ /* @__PURE__ */ a(Ft, { size: "xs", color: "fg.muted" }),
2212
+ /* @__PURE__ */ a(X, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
2213
+ ] }) : null, e[31] = oe, e[32] = Z) : Z = e[32];
2214
+ const V = ne ? "0" : "xs";
2215
+ let $;
2216
+ e[33] !== ve ? ($ = ps(ve), e[33] = ve, e[34] = $) : $ = e[34];
2129
2217
  let D;
2130
- e[27] !== N || e[28] !== V || e[29] !== Y ? (D = /* @__PURE__ */ T(Rt.Root, { children: [
2131
- N,
2132
- V,
2133
- Y
2134
- ] }), e[27] = N, e[28] = V, e[29] = Y, e[30] = D) : D = e[30];
2135
- let F;
2136
- e[31] !== he ? (F = he ? /* @__PURE__ */ T(Ee, { gap: "xs", px: "sm", py: "2xs", children: [
2137
- /* @__PURE__ */ l($t, { size: "xs", color: "fg.muted" }),
2138
- /* @__PURE__ */ l(q, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
2139
- ] }) : null, e[31] = he, e[32] = F) : F = e[32];
2140
- const z = X ? "0" : "xs";
2218
+ e[35] !== b || e[36] !== C || e[37] !== w || e[38] !== he || e[39] !== d || e[40] !== L || e[41] !== ne || e[42] !== Le || e[43] !== h || e[44] !== g || e[45] !== y || e[46] !== A || e[47] !== p || e[48] !== m || e[49] !== B || e[50] !== $ ? (D = /* @__PURE__ */ a(cs, { placeholder: d, defaultState: $, streaming: B, onSubmit: m, onInterrupt: p, onAttachFiles: h, onAttachText: g, onChange: y, actions: b, attachedResources: C, onClearAttachments: A, attachmentList: w, isDisabled: Le, attachedToTop: ne, questionPrompt: L, autoFocus: he }), e[35] = b, e[36] = C, e[37] = w, e[38] = he, e[39] = d, e[40] = L, e[41] = ne, e[42] = Le, e[43] = h, e[44] = g, e[45] = y, e[46] = A, e[47] = p, e[48] = m, e[49] = B, e[50] = $, e[51] = D) : D = e[51];
2141
2219
  let j;
2142
- e[33] !== H ? (j = eo(H), e[33] = H, e[34] = j) : j = e[34];
2220
+ e[52] !== V || e[53] !== D || e[54] !== M ? (j = /* @__PURE__ */ k(Y, { px: "xs", gap: V, children: [
2221
+ M,
2222
+ D
2223
+ ] }), e[52] = V, e[53] = D, e[54] = M, e[55] = j) : j = e[55];
2143
2224
  let U;
2144
- e[35] !== g || e[36] !== y || e[37] !== _ || e[38] !== Ae || e[39] !== d || e[40] !== M || e[41] !== X || e[42] !== _e || e[43] !== h || e[44] !== x || e[45] !== f || e[46] !== m || e[47] !== L || e[48] !== j ? (U = /* @__PURE__ */ l(Xs, { placeholder: d, defaultState: j, streaming: L, onSubmit: m, onInterrupt: f, onChange: h, actions: g, attachedResources: y, onClearAttachments: x, attachmentList: _, isDisabled: _e, attachedToTop: X, questionPrompt: M, autoFocus: Ae }), e[35] = g, e[36] = y, e[37] = _, e[38] = Ae, e[39] = d, e[40] = M, e[41] = X, e[42] = _e, e[43] = h, e[44] = x, e[45] = f, e[46] = m, e[47] = L, e[48] = j, e[49] = U) : U = e[49];
2145
- let K;
2146
- e[50] !== z || e[51] !== U || e[52] !== w ? (K = /* @__PURE__ */ T(Z, { px: "xs", gap: z, children: [
2147
- w,
2225
+ e[56] !== x ? (U = /* @__PURE__ */ a(Re, { p: "2xs", justifyContent: "flex-end", children: x }), e[56] = x, e[57] = U) : U = e[57];
2226
+ let le;
2227
+ return e[58] !== _ || e[59] !== N || e[60] !== Z || e[61] !== j || e[62] !== U ? (le = /* @__PURE__ */ k(Re, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2228
+ N,
2229
+ _,
2230
+ Z,
2231
+ j,
2148
2232
  U
2149
- ] }), e[50] = z, e[51] = U, e[52] = w, e[53] = K) : K = e[53];
2150
- let J;
2151
- e[54] !== b ? (J = /* @__PURE__ */ l(Ce, { p: "2xs", justifyContent: "flex-end", children: b }), e[54] = b, e[55] = J) : J = e[55];
2152
- let re;
2153
- return e[56] !== C || e[57] !== D || e[58] !== F || e[59] !== K || e[60] !== J ? (re = /* @__PURE__ */ T(Ce, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
2154
- D,
2155
- C,
2156
- F,
2157
- K,
2158
- J
2159
- ] }), e[56] = C, e[57] = D, e[58] = F, e[59] = K, e[60] = J, e[61] = re) : re = e[61], re;
2233
+ ] }), e[58] = _, e[59] = N, e[60] = Z, e[61] = j, e[62] = U, e[63] = le) : le = e[63], le;
2160
2234
  };
2161
- function li(t, e) {
2235
+ function ki(t, e) {
2162
2236
  return t + (e.role === "user" ? 1 : 0);
2163
2237
  }
2164
- function ai() {
2238
+ function Ci() {
2165
2239
  return /* @__PURE__ */ new Set();
2166
2240
  }
2167
- const Jt = (t) => /* @__PURE__ */ l(Z, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ l(Qn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), Ki = () => {
2168
- const t = k(2);
2241
+ const on = (t) => /* @__PURE__ */ a(Y, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ a(Kn, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), fl = () => {
2242
+ const t = T(2);
2169
2243
  let e;
2170
- t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ l(we.Root, { from: "user", children: /* @__PURE__ */ l(we.Content, { from: "user", children: Jt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2244
+ t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ a(_e.Root, { from: "user", children: /* @__PURE__ */ a(_e.Content, { from: "user", children: on(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
2171
2245
  let n;
2172
- return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ T(Z, { minH: "full", py: "xs", gap: "0", children: [
2246
+ return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ k(Y, { minH: "full", py: "xs", gap: "0", children: [
2173
2247
  e,
2174
- /* @__PURE__ */ l(we.Root, { from: "assistant", children: /* @__PURE__ */ l(we.Content, { from: "assistant", children: Jt(["76%", "62%", "40%"]) }) })
2248
+ /* @__PURE__ */ a(_e.Root, { from: "assistant", children: /* @__PURE__ */ a(_e.Content, { from: "assistant", children: on(["76%", "62%", "40%"]) }) })
2175
2249
  ] }), t[1] = n) : n = t[1], n;
2176
- }, Gi = (t) => {
2177
- const e = k(14), {
2250
+ }, pl = (t) => {
2251
+ const e = T(14), {
2178
2252
  changesLabel: n,
2179
- additions: o,
2180
- deletions: s,
2253
+ additions: s,
2254
+ deletions: o,
2181
2255
  action: r,
2182
2256
  status: i,
2183
- statusLabel: a
2184
- } = t, c = i === void 0 ? "ready" : i, u = o > 0 || s > 0, d = c === "error" ? "border.error" : "border.muted", p = c === "error" ? "bg.error" : "bg.subtle";
2257
+ statusLabel: l
2258
+ } = t, c = i === void 0 ? "ready" : i, u = s > 0 || o > 0, d = c === "error" ? "border.error" : "border.muted", f = c === "error" ? "bg.error" : "bg.subtle";
2185
2259
  let m;
2186
- e[0] !== o || e[1] !== n || e[2] !== s || e[3] !== u || e[4] !== c || e[5] !== a ? (m = c === "loading" ? /* @__PURE__ */ T(Ee, { gap: "xs", minW: "0", children: [
2187
- /* @__PURE__ */ l($t, { size: "xs", color: "fg.muted" }),
2188
- /* @__PURE__ */ l(q, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: a ?? "Setting up workspace..." })
2189
- ] }) : c === "error" ? /* @__PURE__ */ T(Ee, { gap: "xs", minW: "0", children: [
2190
- /* @__PURE__ */ l(nn, { size: 14, color: "var(--chakra-colors-fg-error)" }),
2191
- /* @__PURE__ */ l(q, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: a ?? "Workspace setup failed" })
2192
- ] }) : u ? /* @__PURE__ */ l(ln, { label: n, additions: o, deletions: s, variant: "ghost", size: "small", _hover: {
2260
+ e[0] !== s || e[1] !== n || e[2] !== o || e[3] !== u || e[4] !== c || e[5] !== l ? (m = c === "loading" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
2261
+ /* @__PURE__ */ a(Ft, { size: "xs", color: "fg.muted" }),
2262
+ /* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: l ?? "Setting up workspace..." })
2263
+ ] }) : c === "error" ? /* @__PURE__ */ k(Me, { gap: "xs", minW: "0", children: [
2264
+ /* @__PURE__ */ a(an, { size: 14, color: "var(--chakra-colors-fg-error)" }),
2265
+ /* @__PURE__ */ a(X, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: l ?? "Workspace setup failed" })
2266
+ ] }) : u ? /* @__PURE__ */ a(fn, { label: n, additions: s, deletions: o, variant: "ghost", size: "small", _hover: {
2193
2267
  background: "transparent"
2194
- } }) : /* @__PURE__ */ l(Ce, { flex: "1" }), e[0] = o, e[1] = n, e[2] = s, e[3] = u, e[4] = c, e[5] = a, e[6] = m) : m = e[6];
2195
- let f;
2196
- e[7] !== r ? (f = r ? /* @__PURE__ */ l(Ce, { flexShrink: 0, ml: "auto", children: r }) : null, e[7] = r, e[8] = f) : f = e[8];
2268
+ } }) : /* @__PURE__ */ a(Re, { flex: "1" }), e[0] = s, e[1] = n, e[2] = o, e[3] = u, e[4] = c, e[5] = l, e[6] = m) : m = e[6];
2269
+ let p;
2270
+ e[7] !== r ? (p = r ? /* @__PURE__ */ a(Re, { flexShrink: 0, ml: "auto", children: r }) : null, e[7] = r, e[8] = p) : p = e[8];
2197
2271
  let h;
2198
- return e[9] !== d || e[10] !== p || e[11] !== m || e[12] !== f ? (h = /* @__PURE__ */ T(Ce, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: d, borderRadius: "xs", borderBottomRadius: "0", bg: p, children: [
2272
+ return e[9] !== d || e[10] !== f || e[11] !== m || e[12] !== p ? (h = /* @__PURE__ */ k(Re, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: d, borderRadius: "xs", borderBottomRadius: "0", bg: f, children: [
2199
2273
  m,
2200
- f
2201
- ] }), e[9] = d, e[10] = p, e[11] = m, e[12] = f, e[13] = h) : h = e[13], h;
2274
+ p
2275
+ ] }), e[9] = d, e[10] = f, e[11] = m, e[12] = p, e[13] = h) : h = e[13], h;
2202
2276
  };
2203
2277
  export {
2204
- ji as ApprovalPrompt,
2205
- Bs as AutoScroll,
2206
- Xs as ChatInput,
2207
- we as ChatMessage,
2208
- Ui as ChatPanel,
2209
- Rt as ChatPrimitives,
2210
- Ki as ChatSkeleton,
2211
- Gi as ChatWorkspaceHub,
2212
- Gs as SendButton,
2213
- eo as createSerializedPromptState
2278
+ cl as ApprovalPrompt,
2279
+ ul as AttachmentList,
2280
+ Ho as AutoScroll,
2281
+ cs as ChatInput,
2282
+ _e as ChatMessage,
2283
+ dl as ChatPanel,
2284
+ Et as ChatPrimitives,
2285
+ fl as ChatSkeleton,
2286
+ pl as ChatWorkspaceHub,
2287
+ ls as SendButton,
2288
+ ps as createSerializedPromptState
2214
2289
  };
2215
2290
  //# sourceMappingURL=chat-ui.js.map