@carto/ps-react-ui 4.4.0-chat-ui.1 → 4.4.0-chat-ui.3

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 (42) hide show
  1. package/dist/chat.js +1123 -393
  2. package/dist/chat.js.map +1 -1
  3. package/dist/components.js +141 -159
  4. package/dist/components.js.map +1 -1
  5. package/dist/copy-button-DGL1tyli.js +26 -0
  6. package/dist/copy-button-DGL1tyli.js.map +1 -0
  7. package/dist/index-BnyeR7Qx.js +6601 -0
  8. package/dist/index-BnyeR7Qx.js.map +1 -0
  9. package/dist/types/chat/const.d.ts +1 -0
  10. package/dist/types/chat/containers/styles.d.ts +6 -0
  11. package/dist/types/chat/feedback/chat-tool-code-area.d.ts +4 -0
  12. package/dist/types/chat/feedback/chat-tool-full-view-dialog.d.ts +2 -0
  13. package/dist/types/chat/feedback/chat-tool-group.d.ts +2 -0
  14. package/dist/types/chat/feedback/chat-tool-trace.d.ts +3 -0
  15. package/dist/types/chat/feedback/get-tool-label.d.ts +2 -0
  16. package/dist/types/chat/feedback/index.d.ts +4 -1
  17. package/dist/types/chat/feedback/styles.d.ts +149 -3
  18. package/dist/types/chat/index.d.ts +6 -3
  19. package/dist/types/chat/types.d.ts +58 -5
  20. package/dist/widgets/toolbar-actions.js +101 -6693
  21. package/dist/widgets/toolbar-actions.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/chat/bubbles/styles.ts +42 -0
  24. package/src/chat/const.ts +1 -0
  25. package/src/chat/containers/styles.ts +6 -0
  26. package/src/chat/feedback/chat-tool-code-area.test.tsx +23 -0
  27. package/src/chat/feedback/chat-tool-code-area.tsx +71 -0
  28. package/src/chat/feedback/chat-tool-full-view-dialog.test.tsx +39 -0
  29. package/src/chat/feedback/chat-tool-full-view-dialog.tsx +121 -0
  30. package/src/chat/feedback/chat-tool-group.test.tsx +84 -0
  31. package/src/chat/feedback/chat-tool-group.tsx +156 -0
  32. package/src/chat/feedback/chat-tool-trace.test.tsx +81 -0
  33. package/src/chat/feedback/chat-tool-trace.tsx +187 -0
  34. package/src/chat/feedback/get-tool-label.test.tsx +91 -0
  35. package/src/chat/feedback/get-tool-label.ts +13 -0
  36. package/src/chat/feedback/index.ts +4 -1
  37. package/src/chat/feedback/styles.ts +153 -4
  38. package/src/chat/index.ts +14 -3
  39. package/src/chat/types.ts +64 -5
  40. package/dist/types/chat/feedback/chat-tools.d.ts +0 -2
  41. package/src/chat/feedback/chat-tools.test.tsx +0 -23
  42. package/src/chat/feedback/chat-tools.tsx +0 -54
package/dist/chat.js CHANGED
@@ -1,17 +1,19 @@
1
- import { jsx as d, jsxs as y, Fragment as K } from "react/jsx-runtime";
2
- import { c as T } from "react/compiler-runtime";
3
- import { styled as H, Typography as $, Box as x, Link as Y, ButtonBase as X, Fab as J, IconButton as O, FilledInput as V, FormHelperText as q, FormControl as Q, Accordion as Z, AccordionSummary as ee, AccordionDetails as te, CircularProgress as oe } from "@mui/material";
4
- import { ErrorOutline as N, ArrowUpward as ne, KeyboardArrowDown as le, Close as re, StopCircleOutlined as se, ArrowUpwardOutlined as ie, ThumbUp as ae, ThumbUpOutlined as ce, ThumbDown as de, ThumbDownOutlined as me, ExpandMore as pe, CheckCircleOutline as fe } from "@mui/icons-material";
5
- import { keyframes as P } from "@mui/material/styles";
6
- import { useRef as ue } from "react";
7
- const j = 768, Ee = 300, Fe = 100, G = H($)(() => ({
1
+ import { jsx as a, jsxs as T, Fragment as Te } from "react/jsx-runtime";
2
+ import { c as z } from "react/compiler-runtime";
3
+ import { styled as se, Typography as _, Box as y, Link as ke, ButtonBase as Se, Fab as _e, IconButton as O, FilledInput as $e, FormHelperText as Ae, FormControl as Ie, DialogTitle as Re, DialogContent as Ee, Dialog as Le, createSvgIcon as ae, Tooltip as De, Button as re, Collapse as le, CircularProgress as ze } from "@mui/material";
4
+ import { ErrorOutline as ge, ArrowUpward as Be, KeyboardArrowDown as Fe, Close as he, StopCircleOutlined as We, ArrowUpwardOutlined as Me, ThumbUp as He, ThumbUpOutlined as Oe, ThumbDown as Pe, ThumbDownOutlined as Ve, ArrowRight as xe, Error as Ue, CheckCircle as je, ChevronRight as Ne } from "@mui/icons-material";
5
+ import { keyframes as N } from "@mui/material/styles";
6
+ import { useRef as be, forwardRef as ce, useState as ie, useEffect as Ge } from "react";
7
+ import { C as Xe } from "./copy-button-DGL1tyli.js";
8
+ import { a as Ye } from "./index-BnyeR7Qx.js";
9
+ const q = 768, Mt = 300, Ht = 100, Ke = 126, ye = se(_)(() => ({
8
10
  whiteSpace: "pre-wrap",
9
11
  overflowX: "clip",
10
12
  overflowWrap: "break-word",
11
13
  maxWidth: "100%"
12
14
  }));
13
- G.displayName = "ChatMessageOverflow";
14
- const A = {
15
+ ye.displayName = "ChatMessageOverflow";
16
+ const H = {
15
17
  agentMessageContainer: (t) => ({
16
18
  width: "100%",
17
19
  display: "flex",
@@ -23,6 +25,48 @@ const A = {
23
25
  },
24
26
  "& + .PsChat--user-message": {
25
27
  marginTop: t.spacing(3)
28
+ },
29
+ "& > p:first-of-type": {
30
+ marginTop: 0
31
+ },
32
+ "& table": {
33
+ alignSelf: "stretch",
34
+ display: "block",
35
+ overflowX: "auto",
36
+ maxWidth: "100%",
37
+ borderCollapse: "collapse",
38
+ margin: t.spacing(1, 0),
39
+ fontSize: "0.875em"
40
+ },
41
+ "& th, & td": {
42
+ border: `1px solid ${t.palette.divider}`,
43
+ padding: t.spacing(0.5, 1),
44
+ textAlign: "left"
45
+ },
46
+ "& th": {
47
+ backgroundColor: t.palette.action.hover,
48
+ fontWeight: 600
49
+ },
50
+ "& tr:nth-of-type(even) td": {
51
+ backgroundColor: t.palette.action.hover
52
+ },
53
+ "& ul.contains-task-list": {
54
+ listStyle: "none",
55
+ paddingLeft: 0
56
+ },
57
+ '& .task-list-item input[type="checkbox"]': {
58
+ marginRight: t.spacing(0.5)
59
+ },
60
+ "& del": {
61
+ textDecoration: "line-through",
62
+ opacity: 0.7
63
+ },
64
+ "& > ul, & > ol": {
65
+ margin: t.spacing(1, 0),
66
+ paddingLeft: t.spacing(3),
67
+ "& > li + li": {
68
+ marginTop: t.spacing(1)
69
+ }
26
70
  }
27
71
  }),
28
72
  userMessageContainer: {
@@ -161,125 +205,125 @@ const A = {
161
205
  }
162
206
  }
163
207
  };
164
- function Oe(t) {
165
- const e = T(11), {
166
- children: n,
167
- muted: o,
168
- topContext: i,
169
- sx: r
170
- } = t, m = o === void 0 ? !1 : o;
171
- let a;
172
- e[0] !== i ? (a = i && /* @__PURE__ */ d(x, { sx: A.userMessageTop, children: i }), e[0] = i, e[1] = a) : a = e[1];
173
- const s = m ? A.muted : void 0;
174
- let l;
175
- e[2] !== r || e[3] !== s ? (l = {
176
- ...A.userMessage,
177
- ...s,
178
- ...r
179
- }, e[2] = r, e[3] = s, e[4] = l) : l = e[4];
208
+ function Ot(t) {
209
+ const e = z(11), {
210
+ children: o,
211
+ muted: r,
212
+ topContext: l,
213
+ sx: n
214
+ } = t, u = r === void 0 ? !1 : r;
215
+ let s;
216
+ e[0] !== l ? (s = l && /* @__PURE__ */ a(y, { sx: H.userMessageTop, children: l }), e[0] = l, e[1] = s) : s = e[1];
217
+ const i = u ? H.muted : void 0;
180
218
  let c;
181
- e[5] !== n || e[6] !== l ? (c = /* @__PURE__ */ d(G, { className: "PsChat--user-message-inner", variant: "body2", sx: l, children: n }), e[5] = n, e[6] = l, e[7] = c) : c = e[7];
182
- let p;
183
- return e[8] !== a || e[9] !== c ? (p = /* @__PURE__ */ y(x, { className: "PsChat--user-message", sx: A.userMessageContainer, children: [
184
- a,
185
- c
186
- ] }), e[8] = a, e[9] = c, e[10] = p) : p = e[10], p;
219
+ e[2] !== n || e[3] !== i ? (c = {
220
+ ...H.userMessage,
221
+ ...i,
222
+ ...n
223
+ }, e[2] = n, e[3] = i, e[4] = c) : c = e[4];
224
+ let d;
225
+ e[5] !== o || e[6] !== c ? (d = /* @__PURE__ */ a(ye, { className: "PsChat--user-message-inner", variant: "body2", sx: c, children: o }), e[5] = o, e[6] = c, e[7] = d) : d = e[7];
226
+ let x;
227
+ return e[8] !== s || e[9] !== d ? (x = /* @__PURE__ */ T(y, { className: "PsChat--user-message", sx: H.userMessageContainer, children: [
228
+ s,
229
+ d
230
+ ] }), e[8] = s, e[9] = d, e[10] = x) : x = e[10], x;
187
231
  }
188
- const he = (t) => {
189
- const e = T(6);
190
- let n, o;
232
+ const Je = (t) => {
233
+ const e = z(6);
234
+ let o, r;
191
235
  e[0] !== t ? ({
192
- className: n,
193
- ...o
194
- } = t, e[0] = t, e[1] = n, e[2] = o) : (n = e[1], o = e[2]);
195
- const i = `PsChat--agent-message ${n ?? ""}`;
196
- let r;
197
- return e[3] !== o || e[4] !== i ? (r = /* @__PURE__ */ d(x, { className: i, ...o }), e[3] = o, e[4] = i, e[5] = r) : r = e[5], r;
198
- }, ge = H(he)(({
236
+ className: o,
237
+ ...r
238
+ } = t, e[0] = t, e[1] = o, e[2] = r) : (o = e[1], r = e[2]);
239
+ const l = `PsChat--agent-message ${o ?? ""}`;
240
+ let n;
241
+ return e[3] !== r || e[4] !== l ? (n = /* @__PURE__ */ a(y, { className: l, ...r }), e[3] = r, e[4] = l, e[5] = n) : n = e[5], n;
242
+ }, qe = se(Je)(({
199
243
  theme: t
200
- }) => A.agentMessageContainer(t));
201
- ge.displayName = "ChatAgentMessage";
202
- function Pe(t) {
203
- const e = T(13), {
204
- errors: n,
205
- icon: o,
206
- actions: i,
207
- sx: r
244
+ }) => H.agentMessageContainer(t));
245
+ qe.displayName = "ChatAgentMessage";
246
+ function Pt(t) {
247
+ const e = z(13), {
248
+ errors: o,
249
+ icon: r,
250
+ actions: l,
251
+ sx: n
208
252
  } = t;
209
- let m;
210
- e[0] !== r ? (m = {
211
- ...A.errorMessage,
212
- ...r
213
- }, e[0] = r, e[1] = m) : m = e[1];
214
- let a;
215
- e[2] !== o ? (a = o ?? /* @__PURE__ */ d(N, { fontSize: "medium", color: "error" }), e[2] = o, e[3] = a) : a = e[3];
253
+ let u;
254
+ e[0] !== n ? (u = {
255
+ ...H.errorMessage,
256
+ ...n
257
+ }, e[0] = n, e[1] = u) : u = e[1];
216
258
  let s;
217
- e[4] !== n ? (s = n.map(xe), e[4] = n, e[5] = s) : s = e[5];
218
- let l;
219
- e[6] !== i ? (l = i?.length ? /* @__PURE__ */ d(x, { sx: A.errorActions, children: (i ?? []).map(be) }) : null, e[6] = i, e[7] = l) : l = e[7];
259
+ e[2] !== r ? (s = r ?? /* @__PURE__ */ a(ge, { fontSize: "medium", color: "error" }), e[2] = r, e[3] = s) : s = e[3];
260
+ let i;
261
+ e[4] !== o ? (i = o.map(Ze), e[4] = o, e[5] = i) : i = e[5];
220
262
  let c;
221
- return e[8] !== m || e[9] !== a || e[10] !== s || e[11] !== l ? (c = /* @__PURE__ */ y(x, { sx: m, children: [
222
- a,
263
+ e[6] !== l ? (c = l?.length ? /* @__PURE__ */ a(y, { sx: H.errorActions, children: (l ?? []).map(Qe) }) : null, e[6] = l, e[7] = c) : c = e[7];
264
+ let d;
265
+ return e[8] !== u || e[9] !== s || e[10] !== i || e[11] !== c ? (d = /* @__PURE__ */ T(y, { sx: u, children: [
223
266
  s,
224
- l
225
- ] }), e[8] = m, e[9] = a, e[10] = s, e[11] = l, e[12] = c) : c = e[12], c;
267
+ i,
268
+ c
269
+ ] }), e[8] = u, e[9] = s, e[10] = i, e[11] = c, e[12] = d) : d = e[12], d;
226
270
  }
227
- function be(t, e) {
228
- return /* @__PURE__ */ y("span", { children: [
229
- e > 0 && /* @__PURE__ */ d($, { component: "span", variant: "body2", sx: A.errorActionSeparator, children: "·" }),
230
- /* @__PURE__ */ d(Y, { component: "button", variant: "body2", onClick: t.onClick, sx: A.errorAction, children: t.label })
271
+ function Qe(t, e) {
272
+ return /* @__PURE__ */ T("span", { children: [
273
+ e > 0 && /* @__PURE__ */ a(_, { component: "span", variant: "body2", sx: H.errorActionSeparator, children: "·" }),
274
+ /* @__PURE__ */ a(ke, { component: "button", variant: "body2", onClick: t.onClick, sx: H.errorAction, children: t.label })
231
275
  ] }, e);
232
276
  }
233
- function xe(t, e) {
234
- return /* @__PURE__ */ d($, { variant: "subtitle2", color: "error.relatedDark", children: t }, e);
277
+ function Ze(t, e) {
278
+ return /* @__PURE__ */ a(_, { variant: "subtitle2", color: "error.relatedDark", children: t }, e);
235
279
  }
236
- function Ce(t) {
237
- const e = T(17);
238
- let n, o, i, r;
280
+ function et(t) {
281
+ const e = z(17);
282
+ let o, r, l, n;
239
283
  e[0] !== t ? ({
240
- label: o,
241
- color: n,
242
- sx: r,
243
- ...i
244
- } = t, e[0] = t, e[1] = n, e[2] = o, e[3] = i, e[4] = r) : (n = e[1], o = e[2], i = e[3], r = e[4]);
245
- let m;
246
- e[5] !== n ? (m = n ? {
247
- backgroundColor: n
248
- } : void 0, e[5] = n, e[6] = m) : m = e[6];
249
- let a;
250
- e[7] !== r || e[8] !== m ? (a = {
251
- ...A.suggestionButton,
252
- ...m,
253
- ...r
254
- }, e[7] = r, e[8] = m, e[9] = a) : a = e[9];
284
+ label: r,
285
+ color: o,
286
+ sx: n,
287
+ ...l
288
+ } = t, e[0] = t, e[1] = o, e[2] = r, e[3] = l, e[4] = n) : (o = e[1], r = e[2], l = e[3], n = e[4]);
289
+ let u;
290
+ e[5] !== o ? (u = o ? {
291
+ backgroundColor: o
292
+ } : void 0, e[5] = o, e[6] = u) : u = e[6];
255
293
  let s;
256
- e[10] !== o ? (s = /* @__PURE__ */ d($, { color: "inherit", variant: "body2", children: o }), e[10] = o, e[11] = s) : s = e[11];
257
- let l;
258
- e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ d(ne, {}), e[12] = l) : l = e[12];
294
+ e[7] !== n || e[8] !== u ? (s = {
295
+ ...H.suggestionButton,
296
+ ...u,
297
+ ...n
298
+ }, e[7] = n, e[8] = u, e[9] = s) : s = e[9];
299
+ let i;
300
+ e[10] !== r ? (i = /* @__PURE__ */ a(_, { color: "inherit", variant: "body2", children: r }), e[10] = r, e[11] = i) : i = e[11];
259
301
  let c;
260
- return e[13] !== i || e[14] !== a || e[15] !== s ? (c = /* @__PURE__ */ y(X, { sx: a, ...i, children: [
261
- s,
262
- l
263
- ] }), e[13] = i, e[14] = a, e[15] = s, e[16] = c) : c = e[16], c;
302
+ e[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ a(Be, {}), e[12] = c) : c = e[12];
303
+ let d;
304
+ return e[13] !== l || e[14] !== s || e[15] !== i ? (d = /* @__PURE__ */ T(Se, { sx: s, ...l, children: [
305
+ i,
306
+ c
307
+ ] }), e[13] = l, e[14] = s, e[15] = i, e[16] = d) : d = e[16], d;
264
308
  }
265
- const ye = P`
309
+ const tt = N`
266
310
  0% {
267
311
  background-position: 150% 0;
268
312
  }
269
313
  100% {
270
314
  background-position: -50% 0;
271
315
  }
272
- `, ve = P`
316
+ `, ot = N`
273
317
  0% { transform: scale(0.68); opacity: 0.7; }
274
318
  40% { transform: scale(1); opacity: 1; }
275
319
  80% { transform: scale(0.6); opacity: 0.65; }
276
320
  100% { transform: scale(0.68); opacity: 0.7; }
277
- `, Te = P`
321
+ `, nt = N`
278
322
  0% { transform: scale(1); }
279
323
  40% { transform: scale(0.75); }
280
324
  80% { transform: scale(1.125); }
281
325
  100% { transform: scale(1); }
282
- `, z = {
326
+ `, w = {
283
327
  thinking: {
284
328
  display: "flex",
285
329
  alignItems: "center",
@@ -298,7 +342,7 @@ const ye = P`
298
342
  backgroundClip: "text",
299
343
  WebkitBackgroundClip: "text",
300
344
  WebkitTextFillColor: "transparent",
301
- animation: `${ye} 2s ease-in-out infinite`,
345
+ animation: `${tt} 2s ease-in-out infinite`,
302
346
  animationDuration: "2s"
303
347
  },
304
348
  loader: {
@@ -316,7 +360,7 @@ const ye = P`
316
360
  backgroundColor: ({
317
361
  palette: t
318
362
  }) => t.action.disabled,
319
- animation: `${ve} 1s ease-in-out infinite`
363
+ animation: `${ot} 1s ease-in-out infinite`
320
364
  },
321
365
  loaderInnerCircle: {
322
366
  position: "absolute",
@@ -326,84 +370,301 @@ const ye = P`
326
370
  backgroundColor: ({
327
371
  palette: t
328
372
  }) => t.text.primary,
329
- animation: `${Te} 1s ease-in-out infinite`
373
+ animation: `${nt} 1s ease-in-out infinite`
330
374
  },
331
- tools: {
375
+ // --- Tool Trace styles ---
376
+ traceHeader: {
377
+ display: "flex",
378
+ alignItems: "center",
379
+ padding: 0,
380
+ paddingLeft: ({
381
+ spacing: t
382
+ }) => t(0.5),
383
+ borderRadius: ({
384
+ spacing: t
385
+ }) => t(0.5),
386
+ width: "fit-content",
387
+ color: ({
388
+ palette: t
389
+ }) => t.text.secondary,
390
+ "&:hover": {
391
+ backgroundColor: ({
392
+ palette: t
393
+ }) => t.action.hover
394
+ }
395
+ },
396
+ traceChevron: {
397
+ color: ({
398
+ palette: t
399
+ }) => t.text.secondary,
400
+ transition: "transform 0.2s"
401
+ },
402
+ traceDetailsWrapper: {
403
+ marginTop: ({
404
+ spacing: t
405
+ }) => t(0.5),
406
+ padding: ({
407
+ spacing: t
408
+ }) => t(1.5),
409
+ border: "1px solid",
410
+ borderColor: "divider",
411
+ borderRadius: ({
412
+ spacing: t
413
+ }) => t(1)
414
+ },
415
+ traceField: {
416
+ display: "flex",
417
+ alignItems: "flex-start",
418
+ gap: ({
419
+ spacing: t
420
+ }) => t(1)
421
+ },
422
+ traceFieldLabel: {
423
+ flexShrink: 0
424
+ },
425
+ traceReference: {
426
+ display: "flex",
427
+ borderRadius: ({
428
+ spacing: t
429
+ }) => t(0.25),
430
+ padding: ({
431
+ spacing: t
432
+ }) => t(0, 0.5),
433
+ gap: ({
434
+ spacing: t
435
+ }) => t(0.5),
436
+ backgroundColor: ({
437
+ palette: t
438
+ }) => t.success.relatedLight,
439
+ color: ({
440
+ palette: t
441
+ }) => t.success.dark
442
+ },
443
+ traceStatusSuccess: {
444
+ color: ({
445
+ palette: t
446
+ }) => t.success.main
447
+ },
448
+ traceStatusError: {
449
+ color: ({
450
+ palette: t
451
+ }) => t.error.main
452
+ },
453
+ // --- Code Area styles ---
454
+ codeArea: {
455
+ position: "relative",
332
456
  width: "100%"
333
457
  },
334
- toolHeader: {
458
+ codeAreaPre: {
459
+ margin: 0,
460
+ padding: ({
461
+ spacing: t
462
+ }) => t(1),
463
+ borderRadius: ({
464
+ spacing: t
465
+ }) => t(0.5),
466
+ backgroundColor: ({
467
+ palette: t
468
+ }) => t.background.default,
469
+ fontSize: "0.75rem",
470
+ fontFamily: "monospace",
471
+ whiteSpace: "pre-wrap",
472
+ wordBreak: "break-word",
473
+ overflowY: "auto"
474
+ },
475
+ codeAreaPreError: {
476
+ borderLeft: ({
477
+ palette: t
478
+ }) => `3px solid ${t.error.main}`,
479
+ backgroundColor: ({
480
+ palette: t
481
+ }) => `${t.error.main}08`
482
+ },
483
+ codeAreaFullViewButton: {
484
+ position: "absolute",
485
+ top: ({
486
+ spacing: t
487
+ }) => t(0.5),
488
+ right: ({
489
+ spacing: t
490
+ }) => t(0.5)
491
+ },
492
+ // --- Full View Dialog styles ---
493
+ fullViewDialog: {
494
+ margin: ({
495
+ spacing: t
496
+ }) => t(5)
497
+ },
498
+ fullViewPaper: {
499
+ borderRadius: 1
500
+ },
501
+ fullViewTitle: {
502
+ display: "flex",
503
+ alignItems: "center",
504
+ justifyContent: "space-between",
505
+ padding: ({
506
+ spacing: t
507
+ }) => t(2),
508
+ borderBottom: "1px solid",
509
+ borderBottomColor: "divider"
510
+ },
511
+ fullViewDialogContent: {
512
+ padding: 0,
513
+ "&:first-of-type": {
514
+ paddingTop: 0
515
+ }
516
+ },
517
+ fullViewPre: {
518
+ margin: 0,
519
+ padding: ({
520
+ spacing: t
521
+ }) => t(1),
522
+ background: ({
523
+ palette: t,
524
+ spacing: e
525
+ }) => `linear-gradient(to right, ${t.action.hover} calc(${e(1)} + 3em), ${t.background.default} calc(${e(1)} + 3em))`,
526
+ fontFamily: "monospace",
527
+ fontSize: "0.8125rem",
528
+ whiteSpace: "pre-wrap",
529
+ wordBreak: "break-word",
530
+ lineHeight: 1.6,
531
+ counterReset: "line"
532
+ },
533
+ fullViewLine: {
534
+ display: "block",
535
+ "&::before": {
536
+ counterIncrement: "line",
537
+ content: "counter(line)",
538
+ display: "inline-block",
539
+ width: "2em",
540
+ marginRight: "2em",
541
+ textAlign: "right",
542
+ color: ({
543
+ palette: t
544
+ }) => t.text.secondary,
545
+ userSelect: "none"
546
+ }
547
+ },
548
+ groupHeader: {
549
+ textAlign: "left",
335
550
  display: "flex",
336
551
  alignItems: "center",
552
+ borderRadius: 0,
337
553
  gap: ({
338
554
  spacing: t
339
- }) => t(1)
555
+ }) => t(0.5)
340
556
  },
341
- toolStatusIcon: {
557
+ errorBadge: {
558
+ color: ({
559
+ palette: t
560
+ }) => t.error.main,
561
+ fontWeight: 600,
342
562
  display: "flex",
343
- alignItems: "center"
563
+ alignItems: "center",
564
+ gap: ({
565
+ spacing: t
566
+ }) => t(0.25)
567
+ },
568
+ // --- Syntax highlighting token styles ---
569
+ syntaxToken_key: {
570
+ color: "#881280"
571
+ },
572
+ syntaxToken_string: {
573
+ color: "#c41a16"
574
+ },
575
+ syntaxToken_number: {
576
+ color: "#1c00cf"
577
+ },
578
+ syntaxToken_boolean: {
579
+ color: "#1c00cf"
580
+ },
581
+ syntaxToken_null: {
582
+ color: "#808080"
583
+ },
584
+ syntaxToken_punctuation: {
585
+ color: ({
586
+ palette: t
587
+ }) => t.text.primary
588
+ },
589
+ groupListItem: {
590
+ borderBottom: "1px solid",
591
+ borderColor: "divider",
592
+ "&:first-of-type .MuiButton-root": {
593
+ borderRadius: ({
594
+ spacing: t
595
+ }) => t(1, 1, 0, 0)
596
+ },
597
+ "&:last-of-type:not([aria-expanded=true]) .MuiButton-root": {
598
+ borderRadius: ({
599
+ spacing: t
600
+ }) => t(0, 0, 1, 1)
601
+ },
602
+ "&:last-of-type": {
603
+ borderBottomWidth: 0
604
+ }
344
605
  }
345
606
  };
346
- function we(t) {
347
- const e = T(6), {
348
- children: n,
349
- duration: o,
350
- sx: i
351
- } = t, r = n === void 0 ? "Thinking..." : n, a = `${(o === void 0 ? 2e3 : o) / 1e3}s`;
352
- let s;
353
- e[0] !== a || e[1] !== i ? (s = {
354
- ...z.thinking,
355
- animationDuration: a,
356
- ...i
357
- }, e[0] = a, e[1] = i, e[2] = s) : s = e[2];
358
- let l;
359
- return e[3] !== r || e[4] !== s ? (l = /* @__PURE__ */ d($, { variant: "body2", sx: s, children: r }), e[3] = r, e[4] = s, e[5] = l) : l = e[5], l;
607
+ function rt(t) {
608
+ const e = z(6), {
609
+ children: o,
610
+ duration: r,
611
+ sx: l
612
+ } = t, n = o === void 0 ? "Thinking..." : o, s = `${(r === void 0 ? 2e3 : r) / 1e3}s`;
613
+ let i;
614
+ e[0] !== s || e[1] !== l ? (i = {
615
+ ...w.thinking,
616
+ animationDuration: s,
617
+ ...l
618
+ }, e[0] = s, e[1] = l, e[2] = i) : i = e[2];
619
+ let c;
620
+ return e[3] !== n || e[4] !== i ? (c = /* @__PURE__ */ a(_, { variant: "body2", sx: i, children: n }), e[3] = n, e[4] = i, e[5] = c) : c = e[5], c;
360
621
  }
361
- function Re(t) {
362
- const e = T(16), {
363
- size: n,
364
- labels: o,
365
- sx: i
366
- } = t, r = n === void 0 ? 24 : n;
367
- let m;
368
- e[0] !== o ? (m = o === void 0 ? {} : o, e[0] = o, e[1] = m) : m = e[1];
369
- const s = m.loading ?? "Loading";
370
- let l;
371
- e[2] !== r || e[3] !== i ? (l = {
372
- ...z.loader,
373
- width: r,
374
- height: r,
375
- ...i
376
- }, e[2] = r, e[3] = i, e[4] = l) : l = e[4];
377
- const c = r * 0.75, p = r * 0.75;
378
- let f;
379
- e[5] !== c || e[6] !== p ? (f = /* @__PURE__ */ d(x, { component: "span", sx: {
380
- ...z.loaderOuterCircle,
381
- width: c,
382
- height: p
383
- } }), e[5] = c, e[6] = p, e[7] = f) : f = e[7];
384
- const u = r * 0.32, g = r * 0.32;
385
- let b;
386
- e[8] !== g || e[9] !== u ? (b = /* @__PURE__ */ d(x, { component: "span", sx: {
387
- ...z.loaderInnerCircle,
388
- width: u,
389
- height: g
390
- } }), e[8] = g, e[9] = u, e[10] = b) : b = e[10];
622
+ function Vt(t) {
623
+ const e = z(16), {
624
+ size: o,
625
+ labels: r,
626
+ sx: l
627
+ } = t, n = o === void 0 ? 24 : o;
628
+ let u;
629
+ e[0] !== r ? (u = r === void 0 ? {} : r, e[0] = r, e[1] = u) : u = e[1];
630
+ const i = u.loading ?? "Loading";
631
+ let c;
632
+ e[2] !== n || e[3] !== l ? (c = {
633
+ ...w.loader,
634
+ width: n,
635
+ height: n,
636
+ ...l
637
+ }, e[2] = n, e[3] = l, e[4] = c) : c = e[4];
638
+ const d = n * 0.75, x = n * 0.75;
639
+ let g;
640
+ e[5] !== d || e[6] !== x ? (g = /* @__PURE__ */ a(y, { component: "span", sx: {
641
+ ...w.loaderOuterCircle,
642
+ width: d,
643
+ height: x
644
+ } }), e[5] = d, e[6] = x, e[7] = g) : g = e[7];
645
+ const f = n * 0.32, m = n * 0.32;
391
646
  let h;
392
- return e[11] !== b || e[12] !== s || e[13] !== l || e[14] !== f ? (h = /* @__PURE__ */ y(x, { role: "status", "aria-busy": !0, "aria-label": s, sx: l, children: [
393
- f,
394
- b
395
- ] }), e[11] = b, e[12] = s, e[13] = l, e[14] = f, e[15] = h) : h = e[15], h;
647
+ e[8] !== m || e[9] !== f ? (h = /* @__PURE__ */ a(y, { component: "span", sx: {
648
+ ...w.loaderInnerCircle,
649
+ width: f,
650
+ height: m
651
+ } }), e[8] = m, e[9] = f, e[10] = h) : h = e[10];
652
+ let p;
653
+ return e[11] !== h || e[12] !== i || e[13] !== c || e[14] !== g ? (p = /* @__PURE__ */ T(y, { role: "status", "aria-busy": !0, "aria-label": i, sx: c, children: [
654
+ g,
655
+ h
656
+ ] }), e[11] = h, e[12] = i, e[13] = c, e[14] = g, e[15] = p) : p = e[15], p;
396
657
  }
397
- const Se = P`
658
+ const lt = N`
398
659
  0% { border-top-color: transparent; border-bottom-color: var(--chat-border-color) }
399
660
  0.1% { border-top-color: var(--chat-border-color); border-bottom-color: var(--chat-border-color) }
400
661
  99.9% { border-top-color: var(--chat-border-color); border-bottom-color: var(--chat-border-color) }
401
662
  100% { border-top-color: var(--chat-border-color); border-bottom-color: transparent }
402
- `, Ie = P`
663
+ `, it = N`
403
664
  0% { opacity: 1; pointer-events: auto }
404
665
  95% { opacity: 1; pointer-events: auto }
405
666
  100% { opacity: 0; pointer-events: none }
406
- `, v = {
667
+ `, W = {
407
668
  header: {
408
669
  display: "flex",
409
670
  alignItems: "center",
@@ -437,12 +698,20 @@ const Se = P`
437
698
  footerCorner: {
438
699
  position: "absolute",
439
700
  bottom: "38px",
440
- right: `max(16px, calc(50% - ${j / 2}px + 6px))`,
701
+ right: `max(16px, calc(50% - ${q / 2}px + 6px))`,
441
702
  margin: "0 auto"
442
703
  },
443
704
  footer: {
444
- maxWidth: j,
445
- margin: "0 auto"
705
+ maxWidth: q,
706
+ margin: "0 auto",
707
+ "& textarea": {
708
+ resize: "none",
709
+ maxHeight: "10em",
710
+ overflowY: "auto !important",
711
+ paddingRight: ({
712
+ spacing: t
713
+ }) => t(5)
714
+ }
446
715
  },
447
716
  footerCaption: {
448
717
  textAlign: "center"
@@ -452,7 +721,7 @@ const Se = P`
452
721
  flex: 1,
453
722
  position: "relative",
454
723
  mx: "auto",
455
- maxWidth: j,
724
+ maxWidth: q,
456
725
  width: "100%",
457
726
  maxHeight: "100%",
458
727
  pt: 1,
@@ -466,7 +735,7 @@ const Se = P`
466
735
  borderTop: "1px solid transparent",
467
736
  borderBottom: "1px solid transparent",
468
737
  "@supports (animation-timeline: scroll())": {
469
- animation: `${Se} linear both`,
738
+ animation: `${lt} linear both`,
470
739
  animationTimeline: "scroll(self)"
471
740
  }
472
741
  },
@@ -484,7 +753,7 @@ const Se = P`
484
753
  opacity: 0,
485
754
  pointerEvents: "none",
486
755
  "@supports (animation-timeline: scroll())": {
487
- animation: `${Ie} linear both`,
756
+ animation: `${it} linear both`,
488
757
  animationTimeline: "scroll(nearest)"
489
758
  },
490
759
  "@supports not (animation-timeline: scroll())": {
@@ -500,7 +769,7 @@ const Se = P`
500
769
  spacing: t
501
770
  }) => t(3),
502
771
  textAlign: "center",
503
- maxWidth: j,
772
+ maxWidth: q,
504
773
  margin: "0 auto"
505
774
  },
506
775
  starterItems: {
@@ -514,119 +783,119 @@ const Se = P`
514
783
  gridTemplateColumns: "repeat(2, 1fr)"
515
784
  }
516
785
  };
517
- function je(t) {
518
- const e = T(12), {
519
- children: n,
520
- labels: o,
521
- sx: i
786
+ function Ut(t) {
787
+ const e = z(12), {
788
+ children: o,
789
+ labels: r,
790
+ sx: l
522
791
  } = t;
523
- let r;
524
- e[0] !== o ? (r = o === void 0 ? {} : o, e[0] = o, e[1] = r) : r = e[1];
525
- const m = r, a = ue(null);
526
- let s;
527
- e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (s = () => {
528
- a.current?.scrollTo({
529
- top: a.current.scrollHeight,
792
+ let n;
793
+ e[0] !== r ? (n = r === void 0 ? {} : r, e[0] = r, e[1] = n) : n = e[1];
794
+ const u = n, s = be(null);
795
+ let i;
796
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = () => {
797
+ s.current?.scrollTo({
798
+ top: s.current.scrollHeight,
530
799
  behavior: "smooth"
531
800
  });
532
- }, e[2] = s) : s = e[2];
533
- const l = s;
534
- let c;
535
- e[3] !== i ? (c = {
536
- ...v.content,
537
- ...i
538
- }, e[3] = i, e[4] = c) : c = e[4];
539
- const p = m.jumpToLatest ?? "Jump to latest";
540
- let f;
541
- e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ d(le, {}), e[5] = f) : f = e[5];
542
- let u;
543
- e[6] !== p ? (u = /* @__PURE__ */ d(x, { sx: v.jumpToLatestWrapper, children: /* @__PURE__ */ d(J, { size: "small", onClick: l, "aria-label": p, sx: v.jumpToLatest, children: f }) }), e[6] = p, e[7] = u) : u = e[7];
801
+ }, e[2] = i) : i = e[2];
802
+ const c = i;
803
+ let d;
804
+ e[3] !== l ? (d = {
805
+ ...W.content,
806
+ ...l
807
+ }, e[3] = l, e[4] = d) : d = e[4];
808
+ const x = u.jumpToLatest ?? "Jump to latest";
544
809
  let g;
545
- return e[8] !== n || e[9] !== c || e[10] !== u ? (g = /* @__PURE__ */ y(x, { ref: a, sx: c, children: [
546
- n,
547
- u
548
- ] }), e[8] = n, e[9] = c, e[10] = u, e[11] = g) : g = e[11], g;
549
- }
550
- function He(t) {
551
- const e = T(14), {
552
- leftSlot: n,
553
- title: o,
554
- rightSlot: i,
555
- onClose: r,
556
- sx: m
810
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ a(Fe, {}), e[5] = g) : g = e[5];
811
+ let f;
812
+ e[6] !== x ? (f = /* @__PURE__ */ a(y, { sx: W.jumpToLatestWrapper, children: /* @__PURE__ */ a(_e, { size: "small", onClick: c, "aria-label": x, sx: W.jumpToLatest, children: g }) }), e[6] = x, e[7] = f) : f = e[7];
813
+ let m;
814
+ return e[8] !== o || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ T(y, { ref: s, sx: d, children: [
815
+ o,
816
+ f
817
+ ] }), e[8] = o, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
818
+ }
819
+ function jt(t) {
820
+ const e = z(14), {
821
+ leftSlot: o,
822
+ title: r,
823
+ rightSlot: l,
824
+ onClose: n,
825
+ sx: u
557
826
  } = t;
558
- let a;
559
- e[0] !== m ? (a = {
560
- ...v.header,
561
- ...m
562
- }, e[0] = m, e[1] = a) : a = e[1];
563
827
  let s;
564
- e[2] !== o ? (s = /* @__PURE__ */ d($, { variant: "subtitle2", sx: v.headerTitle, children: o }), e[2] = o, e[3] = s) : s = e[3];
565
- let l;
566
- e[4] !== r ? (l = r && /* @__PURE__ */ d(O, { size: "medium", onClick: r, "aria-label": "Close", children: /* @__PURE__ */ d(re, {}) }), e[4] = r, e[5] = l) : l = e[5];
828
+ e[0] !== u ? (s = {
829
+ ...W.header,
830
+ ...u
831
+ }, e[0] = u, e[1] = s) : s = e[1];
832
+ let i;
833
+ e[2] !== r ? (i = /* @__PURE__ */ a(_, { variant: "subtitle2", sx: W.headerTitle, children: r }), e[2] = r, e[3] = i) : i = e[3];
567
834
  let c;
568
- e[6] !== i || e[7] !== l ? (c = /* @__PURE__ */ y(x, { sx: v.headerActions, children: [
569
- i,
570
- l
571
- ] }), e[6] = i, e[7] = l, e[8] = c) : c = e[8];
572
- let p;
573
- return e[9] !== n || e[10] !== a || e[11] !== s || e[12] !== c ? (p = /* @__PURE__ */ y(x, { sx: a, children: [
574
- n,
575
- s,
835
+ e[4] !== n ? (c = n && /* @__PURE__ */ a(O, { size: "medium", onClick: n, "aria-label": "Close", children: /* @__PURE__ */ a(he, {}) }), e[4] = n, e[5] = c) : c = e[5];
836
+ let d;
837
+ e[6] !== l || e[7] !== c ? (d = /* @__PURE__ */ T(y, { sx: W.headerActions, children: [
838
+ l,
576
839
  c
577
- ] }), e[9] = n, e[10] = a, e[11] = s, e[12] = c, e[13] = p) : p = e[13], p;
578
- }
579
- const ke = "Responses are AI generated. Please verify key information.";
580
- function Ue(t) {
581
- const e = T(35), {
582
- value: n,
583
- onChange: o,
584
- onSend: i,
585
- onStop: r,
586
- isGenerating: m,
587
- disabled: a,
588
- placeholder: s,
589
- labels: l,
590
- caption: c,
591
- sx: p
592
- } = t, f = m === void 0 ? !1 : m, u = a === void 0 ? !1 : a, g = s === void 0 ? "Type a message..." : s;
593
- let b;
594
- e[0] !== l ? (b = l === void 0 ? {} : l, e[0] = l, e[1] = b) : b = e[1];
595
- const h = b, C = c === void 0 ? ke : c;
596
- let w;
597
- e[2] !== u || e[3] !== f || e[4] !== n ? (w = n.trim() && !u && !f, e[2] = u, e[3] = f, e[4] = n, e[5] = w) : w = e[5];
598
- const S = w;
599
- let L;
600
- e[6] !== S || e[7] !== i ? (L = (F) => {
601
- F.key === "Enter" && !F.shiftKey && (F.preventDefault(), S && i());
602
- }, e[6] = S, e[7] = i, e[8] = L) : L = e[8];
603
- const M = L;
604
- let I;
605
- e[9] !== p ? (I = {
606
- ...v.footerWrapper,
607
- ...p
608
- }, e[9] = p, e[10] = I) : I = e[10];
840
+ ] }), e[6] = l, e[7] = c, e[8] = d) : d = e[8];
841
+ let x;
842
+ return e[9] !== o || e[10] !== s || e[11] !== i || e[12] !== d ? (x = /* @__PURE__ */ T(y, { sx: s, children: [
843
+ o,
844
+ i,
845
+ d
846
+ ] }), e[9] = o, e[10] = s, e[11] = i, e[12] = d, e[13] = x) : x = e[13], x;
847
+ }
848
+ const st = "Responses are AI generated. Please verify key information.";
849
+ function Nt(t) {
850
+ const e = z(35), {
851
+ value: o,
852
+ onChange: r,
853
+ onSend: l,
854
+ onStop: n,
855
+ isGenerating: u,
856
+ disabled: s,
857
+ placeholder: i,
858
+ labels: c,
859
+ caption: d,
860
+ sx: x
861
+ } = t, g = u === void 0 ? !1 : u, f = s === void 0 ? !1 : s, m = i === void 0 ? "Type a message..." : i;
862
+ let h;
863
+ e[0] !== c ? (h = c === void 0 ? {} : c, e[0] = c, e[1] = h) : h = e[1];
864
+ const p = h, b = d === void 0 ? st : d;
865
+ let v;
866
+ e[2] !== f || e[3] !== g || e[4] !== o ? (v = o.trim() && !f && !g, e[2] = f, e[3] = g, e[4] = o, e[5] = v) : v = e[5];
867
+ const C = v;
609
868
  let k;
610
- e[11] !== o ? (k = (F) => o(F.target.value), e[11] = o, e[12] = k) : k = e[12];
611
- const D = u || f;
612
- let _;
613
- e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = {
869
+ e[6] !== C || e[7] !== l ? (k = (M) => {
870
+ M.key === "Enter" && !M.shiftKey && (M.preventDefault(), C && l());
871
+ }, e[6] = C, e[7] = l, e[8] = k) : k = e[8];
872
+ const S = k;
873
+ let A;
874
+ e[9] !== x ? (A = {
875
+ ...W.footerWrapper,
876
+ ...x
877
+ }, e[9] = x, e[10] = A) : A = e[10];
878
+ let I;
879
+ e[11] !== r ? (I = (M) => r(M.target.value), e[11] = r, e[12] = I) : I = e[12];
880
+ const R = f || g;
881
+ let $;
882
+ e[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = {
614
883
  minHeight: 0
615
- }, e[13] = _) : _ = e[13];
616
- let W;
617
- e[14] !== M || e[15] !== g || e[16] !== k || e[17] !== D || e[18] !== n ? (W = /* @__PURE__ */ d(V, { multiline: !0, value: n, onChange: k, onKeyDown: M, placeholder: g, disabled: D, sx: v.footer, style: _, fullWidth: !0, size: "small" }), e[14] = M, e[15] = g, e[16] = k, e[17] = D, e[18] = n, e[19] = W) : W = e[19];
618
- let B;
619
- e[20] !== S || e[21] !== u || e[22] !== f || e[23] !== h.send || e[24] !== h.stop || e[25] !== i || e[26] !== r ? (B = /* @__PURE__ */ d(x, { sx: v.footerCorner, children: f && r ? /* @__PURE__ */ d(O, { size: "small", onClick: r, disabled: u, "aria-label": h.stop ?? "Stop", children: /* @__PURE__ */ d(se, {}) }) : /* @__PURE__ */ d(O, { size: "small", variant: "contained", onClick: i, disabled: !S, "aria-label": h.send ?? "Send", children: /* @__PURE__ */ d(ie, {}) }) }), e[20] = S, e[21] = u, e[22] = f, e[23] = h.send, e[24] = h.stop, e[25] = i, e[26] = r, e[27] = B) : B = e[27];
884
+ }, e[13] = $) : $ = e[13];
620
885
  let E;
621
- e[28] !== C ? (E = C ? /* @__PURE__ */ d(q, { sx: v.footerCaption, children: C }) : null, e[28] = C, e[29] = E) : E = e[29];
622
- let R;
623
- return e[30] !== W || e[31] !== B || e[32] !== E || e[33] !== I ? (R = /* @__PURE__ */ y(Q, { fullWidth: !0, sx: I, children: [
624
- W,
886
+ e[14] !== S || e[15] !== m || e[16] !== I || e[17] !== R || e[18] !== o ? (E = /* @__PURE__ */ a($e, { multiline: !0, value: o, onChange: I, onKeyDown: S, placeholder: m, disabled: R, sx: W.footer, style: $, fullWidth: !0, size: "small" }), e[14] = S, e[15] = m, e[16] = I, e[17] = R, e[18] = o, e[19] = E) : E = e[19];
887
+ let B;
888
+ e[20] !== C || e[21] !== f || e[22] !== g || e[23] !== p.send || e[24] !== p.stop || e[25] !== l || e[26] !== n ? (B = /* @__PURE__ */ a(y, { sx: W.footerCorner, children: g && n ? /* @__PURE__ */ a(O, { size: "small", onClick: n, disabled: f, "aria-label": p.stop ?? "Stop", children: /* @__PURE__ */ a(We, {}) }) : /* @__PURE__ */ a(O, { size: "small", variant: "contained", onClick: l, disabled: !C, "aria-label": p.send ?? "Send", children: /* @__PURE__ */ a(Me, {}) }) }), e[20] = C, e[21] = f, e[22] = g, e[23] = p.send, e[24] = p.stop, e[25] = l, e[26] = n, e[27] = B) : B = e[27];
889
+ let L;
890
+ e[28] !== b ? (L = b ? /* @__PURE__ */ a(Ae, { sx: W.footerCaption, children: b }) : null, e[28] = b, e[29] = L) : L = e[29];
891
+ let D;
892
+ return e[30] !== E || e[31] !== B || e[32] !== L || e[33] !== A ? (D = /* @__PURE__ */ T(Ie, { fullWidth: !0, sx: A, children: [
893
+ E,
625
894
  B,
626
- E
627
- ] }), e[30] = W, e[31] = B, e[32] = E, e[33] = I, e[34] = R) : R = e[34], R;
895
+ L
896
+ ] }), e[30] = E, e[31] = B, e[32] = L, e[33] = A, e[34] = D) : D = e[34], D;
628
897
  }
629
- const U = [
898
+ const de = [
630
899
  "#C9DB7440",
631
900
  // pastel green
632
901
  "#FE88B140",
@@ -636,166 +905,627 @@ const U = [
636
905
  "#F6CF7140"
637
906
  // pastel yellow
638
907
  ];
639
- function Ne(t) {
640
- const e = T(40), {
641
- icon: n,
642
- title: o,
643
- description: i,
644
- items: r,
645
- size: m,
646
- onSelect: a,
647
- sx: s
648
- } = t, l = m === void 0 ? "small" : m;
649
- let c, p, f, u, g, b, h, C;
650
- if (e[0] !== i || e[1] !== n || e[2] !== r || e[3] !== a || e[4] !== l || e[5] !== s || e[6] !== o) {
651
- const L = r.map(Ae);
652
- p = x;
653
- const M = l === "small" ? 1 : 2;
654
- e[15] !== s || e[16] !== M ? (g = {
655
- ...v.starter,
656
- gap: M,
657
- ...s
658
- }, e[15] = s, e[16] = M, e[17] = g) : g = e[17], b = n, e[18] !== l || e[19] !== o ? (h = o && /* @__PURE__ */ d($, { variant: l === "small" ? "h6" : "h5", children: o }), e[18] = l, e[19] = o, e[20] = h) : h = e[20], e[21] !== i || e[22] !== l ? (C = i && /* @__PURE__ */ d($, { variant: l === "small" ? "body2" : "body1", color: "text.secondary", children: i }), e[21] = i, e[22] = l, e[23] = C) : C = e[23], c = x;
659
- const I = l === "small" ? 1 : 2, k = r.length > 2 ? v.starterItemsTwoCol : void 0;
660
- e[24] !== k || e[25] !== I ? (f = {
661
- ...v.starterItems,
662
- gap: I,
663
- ...k
664
- }, e[24] = k, e[25] = I, e[26] = f) : f = e[26];
665
- let D;
666
- e[27] !== a ? (D = (_) => /* @__PURE__ */ d(Ce, { label: _.label, onClick: () => a?.(_.label), color: _.color }, _.label), e[27] = a, e[28] = D) : D = e[28], u = L.map(D), e[0] = i, e[1] = n, e[2] = r, e[3] = a, e[4] = l, e[5] = s, e[6] = o, e[7] = c, e[8] = p, e[9] = f, e[10] = u, e[11] = g, e[12] = b, e[13] = h, e[14] = C;
908
+ function Gt(t) {
909
+ const e = z(40), {
910
+ icon: o,
911
+ title: r,
912
+ description: l,
913
+ items: n,
914
+ size: u,
915
+ onSelect: s,
916
+ sx: i
917
+ } = t, c = u === void 0 ? "small" : u;
918
+ let d, x, g, f, m, h, p, b;
919
+ if (e[0] !== l || e[1] !== o || e[2] !== n || e[3] !== s || e[4] !== c || e[5] !== i || e[6] !== r) {
920
+ const k = n.map(at);
921
+ x = y;
922
+ const S = c === "small" ? 1 : 2;
923
+ e[15] !== i || e[16] !== S ? (m = {
924
+ ...W.starter,
925
+ gap: S,
926
+ ...i
927
+ }, e[15] = i, e[16] = S, e[17] = m) : m = e[17], h = o, e[18] !== c || e[19] !== r ? (p = r && /* @__PURE__ */ a(_, { variant: c === "small" ? "h6" : "h5", children: r }), e[18] = c, e[19] = r, e[20] = p) : p = e[20], e[21] !== l || e[22] !== c ? (b = l && /* @__PURE__ */ a(_, { variant: c === "small" ? "body2" : "body1", color: "text.secondary", children: l }), e[21] = l, e[22] = c, e[23] = b) : b = e[23], d = y;
928
+ const A = c === "small" ? 1 : 2, I = n.length > 2 ? W.starterItemsTwoCol : void 0;
929
+ e[24] !== I || e[25] !== A ? (g = {
930
+ ...W.starterItems,
931
+ gap: A,
932
+ ...I
933
+ }, e[24] = I, e[25] = A, e[26] = g) : g = e[26];
934
+ let R;
935
+ e[27] !== s ? (R = ($) => /* @__PURE__ */ a(et, { label: $.label, onClick: () => s?.($.label), color: $.color }, $.label), e[27] = s, e[28] = R) : R = e[28], f = k.map(R), e[0] = l, e[1] = o, e[2] = n, e[3] = s, e[4] = c, e[5] = i, e[6] = r, e[7] = d, e[8] = x, e[9] = g, e[10] = f, e[11] = m, e[12] = h, e[13] = p, e[14] = b;
667
936
  } else
668
- c = e[7], p = e[8], f = e[9], u = e[10], g = e[11], b = e[12], h = e[13], C = e[14];
669
- let w;
670
- e[29] !== c || e[30] !== f || e[31] !== u ? (w = /* @__PURE__ */ d(c, { sx: f, children: u }), e[29] = c, e[30] = f, e[31] = u, e[32] = w) : w = e[32];
671
- let S;
672
- return e[33] !== p || e[34] !== g || e[35] !== b || e[36] !== h || e[37] !== C || e[38] !== w ? (S = /* @__PURE__ */ y(p, { sx: g, children: [
673
- b,
937
+ d = e[7], x = e[8], g = e[9], f = e[10], m = e[11], h = e[12], p = e[13], b = e[14];
938
+ let v;
939
+ e[29] !== d || e[30] !== g || e[31] !== f ? (v = /* @__PURE__ */ a(d, { sx: g, children: f }), e[29] = d, e[30] = g, e[31] = f, e[32] = v) : v = e[32];
940
+ let C;
941
+ return e[33] !== x || e[34] !== m || e[35] !== h || e[36] !== p || e[37] !== b || e[38] !== v ? (C = /* @__PURE__ */ T(x, { sx: m, children: [
674
942
  h,
675
- C,
676
- w
677
- ] }), e[33] = p, e[34] = g, e[35] = b, e[36] = h, e[37] = C, e[38] = w, e[39] = S) : S = e[39], S;
943
+ p,
944
+ b,
945
+ v
946
+ ] }), e[33] = x, e[34] = m, e[35] = h, e[36] = p, e[37] = b, e[38] = v, e[39] = C) : C = e[39], C;
678
947
  }
679
- function Ae(t, e) {
948
+ function at(t, e) {
680
949
  return typeof t == "string" ? {
681
950
  label: t,
682
- color: U[e]
951
+ color: de[e]
683
952
  } : {
684
953
  label: t.label,
685
- color: t.color ?? U[e]
954
+ color: t.color ?? de[e]
686
955
  };
687
956
  }
688
- const Ge = H(x)(({
957
+ const Xt = se(y)(({
689
958
  theme: t
690
959
  }) => ({
691
960
  display: "flex",
692
961
  alignItems: "center",
693
962
  gap: t.spacing(0.5)
694
963
  }));
695
- function Ke(t) {
696
- const e = T(25), {
697
- rating: n,
698
- onRatingChange: o,
699
- labels: i
964
+ function Yt(t) {
965
+ const e = z(25), {
966
+ rating: o,
967
+ onRatingChange: r,
968
+ labels: l
700
969
  } = t;
701
- let r;
702
- e[0] !== i ? (r = i === void 0 ? {} : i, e[0] = i, e[1] = r) : r = e[1];
703
- const m = r;
704
- let a;
705
- e[2] !== o || e[3] !== n ? (a = () => o?.(n === "up" ? null : "up"), e[2] = o, e[3] = n, e[4] = a) : a = e[4];
706
- const s = m.thumbUp ?? "Thumbs up", l = n === "up" ? "primary" : void 0;
707
- let c;
708
- e[5] !== n ? (c = n === "up" ? /* @__PURE__ */ d(ae, { fontSize: "small" }) : /* @__PURE__ */ d(ce, { fontSize: "small" }), e[5] = n, e[6] = c) : c = e[6];
970
+ let n;
971
+ e[0] !== l ? (n = l === void 0 ? {} : l, e[0] = l, e[1] = n) : n = e[1];
972
+ const u = n;
973
+ let s;
974
+ e[2] !== r || e[3] !== o ? (s = () => r?.(o === "up" ? null : "up"), e[2] = r, e[3] = o, e[4] = s) : s = e[4];
975
+ const i = u.thumbUp ?? "Thumbs up", c = o === "up" ? "primary" : void 0;
976
+ let d;
977
+ e[5] !== o ? (d = o === "up" ? /* @__PURE__ */ a(He, { fontSize: "small" }) : /* @__PURE__ */ a(Oe, { fontSize: "small" }), e[5] = o, e[6] = d) : d = e[6];
978
+ let x;
979
+ e[7] !== s || e[8] !== i || e[9] !== c || e[10] !== d ? (x = /* @__PURE__ */ a(O, { size: "small", onClick: s, "aria-label": i, color: c, children: d }), e[7] = s, e[8] = i, e[9] = c, e[10] = d, e[11] = x) : x = e[11];
980
+ let g;
981
+ e[12] !== r || e[13] !== o ? (g = () => r?.(o === "down" ? null : "down"), e[12] = r, e[13] = o, e[14] = g) : g = e[14];
982
+ const f = u.thumbDown ?? "Thumbs down", m = o === "down" ? "primary" : void 0;
983
+ let h;
984
+ e[15] !== o ? (h = o === "down" ? /* @__PURE__ */ a(Pe, { fontSize: "small" }) : /* @__PURE__ */ a(Ve, { fontSize: "small" }), e[15] = o, e[16] = h) : h = e[16];
709
985
  let p;
710
- e[7] !== a || e[8] !== s || e[9] !== l || e[10] !== c ? (p = /* @__PURE__ */ d(O, { size: "small", onClick: a, "aria-label": s, color: l, children: c }), e[7] = a, e[8] = s, e[9] = l, e[10] = c, e[11] = p) : p = e[11];
711
- let f;
712
- e[12] !== o || e[13] !== n ? (f = () => o?.(n === "down" ? null : "down"), e[12] = o, e[13] = n, e[14] = f) : f = e[14];
713
- const u = m.thumbDown ?? "Thumbs down", g = n === "down" ? "primary" : void 0;
986
+ e[17] !== m || e[18] !== h || e[19] !== g || e[20] !== f ? (p = /* @__PURE__ */ a(O, { size: "small", onClick: g, "aria-label": f, color: m, children: h }), e[17] = m, e[18] = h, e[19] = g, e[20] = f, e[21] = p) : p = e[21];
714
987
  let b;
715
- e[15] !== n ? (b = n === "down" ? /* @__PURE__ */ d(de, { fontSize: "small" }) : /* @__PURE__ */ d(me, { fontSize: "small" }), e[15] = n, e[16] = b) : b = e[16];
716
- let h;
717
- e[17] !== g || e[18] !== b || e[19] !== f || e[20] !== u ? (h = /* @__PURE__ */ d(O, { size: "small", onClick: f, "aria-label": u, color: g, children: b }), e[17] = g, e[18] = b, e[19] = f, e[20] = u, e[21] = h) : h = e[21];
718
- let C;
719
- return e[22] !== h || e[23] !== p ? (C = /* @__PURE__ */ y(K, { children: [
720
- p,
721
- h
722
- ] }), e[22] = h, e[23] = p, e[24] = C) : C = e[24], C;
988
+ return e[22] !== p || e[23] !== x ? (b = /* @__PURE__ */ T(Te, { children: [
989
+ x,
990
+ p
991
+ ] }), e[22] = p, e[23] = x, e[24] = b) : b = e[24], b;
723
992
  }
724
- function $e(t) {
725
- const e = T(4), {
726
- status: n
993
+ const ct = /^-?\d/;
994
+ function dt(t) {
995
+ const e = [];
996
+ let o = 0, r;
997
+ const l = /* @__PURE__ */ new Set(), n = /("(?:[^"\\]|\\.)*")\s*:/g;
998
+ let u;
999
+ for (; (u = n.exec(t)) !== null; )
1000
+ l.add(u.index);
1001
+ const s = (
1002
+ // eslint-disable-next-line no-useless-escape
1003
+ /"(?:[^"\\]|\\.)*"|\b(?:true|false)\b|\bnull\b|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?|[{}\[\]:,]/g
1004
+ );
1005
+ for (; (r = s.exec(t)) !== null; ) {
1006
+ r.index > o && e.push(t.slice(o, r.index));
1007
+ const i = r[0];
1008
+ i.startsWith('"') ? l.has(r.index) ? e.push({
1009
+ type: "key",
1010
+ value: i
1011
+ }) : e.push({
1012
+ type: "string",
1013
+ value: i
1014
+ }) : ct.test(i) ? e.push({
1015
+ type: "number",
1016
+ value: i
1017
+ }) : i === "true" || i === "false" ? e.push({
1018
+ type: "boolean",
1019
+ value: i
1020
+ }) : i === "null" ? e.push({
1021
+ type: "null",
1022
+ value: i
1023
+ }) : e.push({
1024
+ type: "punctuation",
1025
+ value: i
1026
+ }), o = r.index + i.length;
1027
+ }
1028
+ return o < t.length && e.push(t.slice(o)), e;
1029
+ }
1030
+ function ut(t) {
1031
+ const e = z(24), {
1032
+ open: o,
1033
+ onClose: r,
1034
+ title: l,
1035
+ content: n
727
1036
  } = t;
728
- switch (n) {
729
- case "loading": {
730
- let o;
731
- return e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(oe, { size: 16 }), e[0] = o) : o = e[0], o;
1037
+ let u;
1038
+ e[0] !== n ? (u = n.split(`
1039
+ `).map(mt), e[0] = n, e[1] = u) : u = e[1];
1040
+ const s = u;
1041
+ let i;
1042
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (i = {
1043
+ sx: w.fullViewPaper
1044
+ }, e[2] = i) : i = e[2];
1045
+ let c;
1046
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (c = {
1047
+ display: "flex",
1048
+ alignItems: "center",
1049
+ gap: 0.5
1050
+ }, e[3] = c) : c = e[3];
1051
+ let d;
1052
+ e[4] !== n ? (d = /* @__PURE__ */ a(Xe, { copyText: n, "aria-label": "Copy content" }), e[4] = n, e[5] = d) : d = e[5];
1053
+ let x;
1054
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ a(he, {}), e[6] = x) : x = e[6];
1055
+ let g;
1056
+ e[7] !== r ? (g = /* @__PURE__ */ a(O, { onClick: r, "aria-label": "close", children: x }), e[7] = r, e[8] = g) : g = e[8];
1057
+ let f;
1058
+ e[9] !== d || e[10] !== g ? (f = /* @__PURE__ */ T(y, { sx: c, children: [
1059
+ d,
1060
+ g
1061
+ ] }), e[9] = d, e[10] = g, e[11] = f) : f = e[11];
1062
+ let m;
1063
+ e[12] !== f || e[13] !== l ? (m = /* @__PURE__ */ T(Re, { sx: w.fullViewTitle, children: [
1064
+ l,
1065
+ f
1066
+ ] }), e[12] = f, e[13] = l, e[14] = m) : m = e[14];
1067
+ let h;
1068
+ e[15] !== s ? (h = s.map(ft), e[15] = s, e[16] = h) : h = e[16];
1069
+ let p;
1070
+ e[17] !== h ? (p = /* @__PURE__ */ a(Ee, { sx: w.fullViewDialogContent, children: /* @__PURE__ */ a(y, { component: "pre", sx: w.fullViewPre, children: h }) }), e[17] = h, e[18] = p) : p = e[18];
1071
+ let b;
1072
+ return e[19] !== r || e[20] !== o || e[21] !== p || e[22] !== m ? (b = /* @__PURE__ */ T(Le, { open: o, onClose: r, sx: w.fullViewDialog, PaperProps: i, fullScreen: !0, children: [
1073
+ m,
1074
+ p
1075
+ ] }), e[19] = r, e[20] = o, e[21] = p, e[22] = m, e[23] = b) : b = e[23], b;
1076
+ }
1077
+ function ft(t, e) {
1078
+ return /* @__PURE__ */ T(y, { component: "span", sx: w.fullViewLine, children: [
1079
+ t.map(pt),
1080
+ `
1081
+ `
1082
+ ] }, e);
1083
+ }
1084
+ function pt(t, e) {
1085
+ return typeof t == "string" ? t : /* @__PURE__ */ a(y, { component: "span", sx: w[`syntaxToken_${t.type}`], children: t.value }, e);
1086
+ }
1087
+ function mt(t) {
1088
+ return dt(t);
1089
+ }
1090
+ const gt = () => /* @__PURE__ */ a("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ a(
1091
+ "path",
1092
+ {
1093
+ fill: "currentColor",
1094
+ fillRule: "evenodd",
1095
+ d: "M12.01 11.83 15.18 15l1.41-1.41L12.01 9l-4.59 4.59L8.84 15z",
1096
+ clipRule: "evenodd"
1097
+ }
1098
+ ) }), ht = ae(gt(), "ArrowUp");
1099
+ function xt({ width: t, height: e, sx: o, ...r }, l) {
1100
+ return /* @__PURE__ */ a(
1101
+ ht,
1102
+ {
1103
+ ref: l,
1104
+ viewBox: "0 0 24 24",
1105
+ sx: {
1106
+ width: t,
1107
+ height: e || t,
1108
+ ...o
1109
+ },
1110
+ ...r
732
1111
  }
733
- case "thinking": {
734
- let o;
735
- return e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(we, { children: "..." }), e[1] = o) : o = e[1], o;
1112
+ );
1113
+ }
1114
+ const bt = ce(xt);
1115
+ bt.displayName = "ArrowUp";
1116
+ const yt = () => /* @__PURE__ */ a("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ a(
1117
+ "path",
1118
+ {
1119
+ fill: "currentColor",
1120
+ fillRule: "evenodd",
1121
+ d: "m6.121 19.293 2.877-2.877V19H11v-6l-6 .007v1.994l2.584.001-2.877 2.877zM13 11l6-.007V8.999h-2.585l2.878-2.878-1.414-1.414L15 7.585V5H13z",
1122
+ clipRule: "evenodd"
1123
+ }
1124
+ ) }), Ct = ae(yt(), "CloseDiagonallyRight");
1125
+ function vt({ width: t, height: e, sx: o, ...r }, l) {
1126
+ return /* @__PURE__ */ a(
1127
+ Ct,
1128
+ {
1129
+ ref: l,
1130
+ viewBox: "0 0 24 24",
1131
+ sx: {
1132
+ width: t,
1133
+ height: e || t,
1134
+ ...o
1135
+ },
1136
+ ...r
736
1137
  }
1138
+ );
1139
+ }
1140
+ const wt = ce(vt);
1141
+ wt.displayName = "CloseDiagonallyRight";
1142
+ const Tt = () => /* @__PURE__ */ a("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", children: /* @__PURE__ */ a(
1143
+ "path",
1144
+ {
1145
+ fill: "currentColor",
1146
+ fillRule: "evenodd",
1147
+ d: "m14.121 11.293 2.877-2.877V11H19V5l-6 .007v1.994l2.584.001-2.877 2.877zM5 19l6-.007v-1.994H8.415l2.878-2.878-1.414-1.414L7 15.585V13H5z",
1148
+ clipRule: "evenodd"
1149
+ }
1150
+ ) }), kt = ae(Tt(), "OpenDiagonallyRight");
1151
+ function St({ width: t, height: e, sx: o, ...r }, l) {
1152
+ return /* @__PURE__ */ a(
1153
+ kt,
1154
+ {
1155
+ ref: l,
1156
+ viewBox: "0 0 24 24",
1157
+ sx: {
1158
+ width: t,
1159
+ height: e || t,
1160
+ ...o
1161
+ },
1162
+ ...r
1163
+ }
1164
+ );
1165
+ }
1166
+ const Ce = ce(St);
1167
+ Ce.displayName = "OpenDiagonallyRight";
1168
+ function ue(t) {
1169
+ const e = z(28), {
1170
+ content: o,
1171
+ title: r,
1172
+ isError: l,
1173
+ labels: n,
1174
+ sx: u
1175
+ } = t, s = r === void 0 ? "" : r, i = l === void 0 ? !1 : l;
1176
+ let c;
1177
+ e[0] !== n ? (c = n === void 0 ? {} : n, e[0] = n, e[1] = c) : c = e[1];
1178
+ const d = c, x = be(null), [g, f] = ie(!1), [m, h] = ie(!1);
1179
+ let p;
1180
+ e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = () => {
1181
+ const D = x.current;
1182
+ D && f(D.scrollHeight > D.clientHeight);
1183
+ }, e[2] = p) : p = e[2];
1184
+ const b = p;
1185
+ let v;
1186
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (v = () => {
1187
+ b();
1188
+ const D = x.current;
1189
+ if (!D)
1190
+ return;
1191
+ const M = new ResizeObserver(b);
1192
+ return M.observe(D), () => M.disconnect();
1193
+ }, e[3] = v) : v = e[3];
1194
+ let C;
1195
+ e[4] !== o ? (C = [b, o], e[4] = o, e[5] = C) : C = e[5], Ge(v, C);
1196
+ const k = d.fullView ?? "Full view";
1197
+ let S;
1198
+ e[6] !== u ? (S = {
1199
+ ...w.codeArea,
1200
+ ...u
1201
+ }, e[6] = u, e[7] = S) : S = e[7];
1202
+ let A;
1203
+ e[8] !== i ? (A = i ? w.codeAreaPreError : {}, e[8] = i, e[9] = A) : A = e[9];
1204
+ let I;
1205
+ e[10] !== A ? (I = {
1206
+ ...w.codeAreaPre,
1207
+ maxHeight: Ke,
1208
+ ...A
1209
+ }, e[10] = A, e[11] = I) : I = e[11];
1210
+ let R;
1211
+ e[12] !== o || e[13] !== I ? (R = /* @__PURE__ */ a(y, { component: "pre", ref: x, sx: I, children: o }), e[12] = o, e[13] = I, e[14] = R) : R = e[14];
1212
+ let $;
1213
+ e[15] !== k || e[16] !== g ? ($ = g && /* @__PURE__ */ a(De, { title: k, children: /* @__PURE__ */ a(O, { size: "small", onClick: () => h(!0), sx: w.codeAreaFullViewButton, children: /* @__PURE__ */ a(Ce, {}) }) }), e[15] = k, e[16] = g, e[17] = $) : $ = e[17];
1214
+ let E;
1215
+ e[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = () => h(!1), e[18] = E) : E = e[18];
1216
+ let B;
1217
+ e[19] !== o || e[20] !== m || e[21] !== s ? (B = /* @__PURE__ */ a(ut, { open: m, onClose: E, title: s, content: o }), e[19] = o, e[20] = m, e[21] = s, e[22] = B) : B = e[22];
1218
+ let L;
1219
+ return e[23] !== R || e[24] !== $ || e[25] !== B || e[26] !== S ? (L = /* @__PURE__ */ T(y, { sx: S, children: [
1220
+ R,
1221
+ $,
1222
+ B
1223
+ ] }), e[23] = R, e[24] = $, e[25] = B, e[26] = S, e[27] = L) : L = e[27], L;
1224
+ }
1225
+ function fe(t) {
1226
+ const e = t.replace(/_/g, " ");
1227
+ return e.charAt(0).toUpperCase() + e.slice(1);
1228
+ }
1229
+ function ve(t) {
1230
+ return t.status === "running" ? t.runningLabel ?? fe(t.name) : t.label ?? fe(t.name);
1231
+ }
1232
+ function _t(t) {
1233
+ const e = z(9), {
1234
+ status: o,
1235
+ labels: r
1236
+ } = t;
1237
+ switch (o) {
737
1238
  case "complete": {
738
- let o;
739
- return e[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(fe, { fontSize: "small", color: "success" }), e[2] = o) : o = e[2], o;
1239
+ let l;
1240
+ e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = {
1241
+ display: "flex",
1242
+ alignItems: "center",
1243
+ gap: 0.5
1244
+ }, e[0] = l) : l = e[0];
1245
+ let n;
1246
+ e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ a(je, { sx: {
1247
+ fontSize: 12
1248
+ }, color: "success" }), e[1] = n) : n = e[1];
1249
+ const u = r?.success ?? "Success";
1250
+ let s;
1251
+ return e[2] !== u ? (s = /* @__PURE__ */ T(y, { sx: l, children: [
1252
+ n,
1253
+ /* @__PURE__ */ a(_, { variant: "caption", children: u })
1254
+ ] }), e[2] = u, e[3] = s) : s = e[3], s;
740
1255
  }
741
1256
  case "error": {
742
- let o;
743
- return e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ d(N, { fontSize: "small", color: "error" }), e[3] = o) : o = e[3], o;
1257
+ let l;
1258
+ e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = {
1259
+ display: "flex",
1260
+ alignItems: "center",
1261
+ gap: 0.5
1262
+ }, e[4] = l) : l = e[4];
1263
+ let n;
1264
+ e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ a(Ue, { sx: {
1265
+ fontSize: 12
1266
+ }, color: "error" }), e[5] = n) : n = e[5];
1267
+ const u = r?.error ?? "Error";
1268
+ let s;
1269
+ return e[6] !== u ? (s = /* @__PURE__ */ T(y, { sx: l, children: [
1270
+ n,
1271
+ /* @__PURE__ */ a(_, { variant: "code3", children: u })
1272
+ ] }), e[6] = u, e[7] = s) : s = e[7], s;
1273
+ }
1274
+ case "running": {
1275
+ let l;
1276
+ return e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ a(ze, { size: 14 }), e[8] = l) : l = e[8], l;
744
1277
  }
1278
+ default:
1279
+ return null;
745
1280
  }
746
1281
  }
747
- function Ye(t) {
748
- const e = T(12), {
749
- tools: n,
750
- labels: o,
751
- sx: i
1282
+ function we(t) {
1283
+ const e = z(33), {
1284
+ tool: o,
1285
+ labels: r
752
1286
  } = t;
753
- let r;
754
- e[0] !== o ? (r = o === void 0 ? {} : o, e[0] = o, e[1] = r) : r = e[1];
755
- const m = r;
756
- let a;
757
- e[2] !== i ? (a = {
758
- ...z.tools,
759
- ...i
760
- }, e[2] = i, e[3] = a) : a = e[3];
761
- let s;
762
- e[4] !== m.title ? (s = m.title && /* @__PURE__ */ d($, { variant: "caption", color: "text.secondary", sx: {
763
- mb: 1
764
- }, children: m.title }), e[4] = m.title, e[5] = s) : s = e[5];
765
1287
  let l;
766
- e[6] !== n ? (l = n.map(_e), e[6] = n, e[7] = l) : l = e[7];
767
- let c;
768
- return e[8] !== a || e[9] !== s || e[10] !== l ? (c = /* @__PURE__ */ y(x, { sx: a, children: [
769
- s,
770
- l
771
- ] }), e[8] = a, e[9] = s, e[10] = l, e[11] = c) : c = e[11], c;
772
- }
773
- function _e(t) {
774
- return /* @__PURE__ */ y(Z, { disableGutters: !0, elevation: 0, children: [
775
- /* @__PURE__ */ d(ee, { expandIcon: /* @__PURE__ */ d(pe, {}), children: /* @__PURE__ */ y(x, { sx: z.toolHeader, children: [
776
- /* @__PURE__ */ d(x, { sx: z.toolStatusIcon, children: /* @__PURE__ */ d($e, { status: t.status }) }),
777
- /* @__PURE__ */ d($, { variant: "body2", children: t.name })
778
- ] }) }),
779
- t.content && /* @__PURE__ */ d(te, { children: t.content })
780
- ] }, t.id);
1288
+ e[0] !== r ? (l = r === void 0 ? {} : r, e[0] = r, e[1] = l) : l = e[1];
1289
+ const n = l, u = o.status === "error", s = n.toolExecuted ?? "Tool executed", i = n.reference ?? "Reference:", c = n.duration ?? "Duration:", d = n.status ?? "Status:", x = n.inputArguments ?? "Input arguments:", g = n.output ?? "Output:";
1290
+ let f;
1291
+ e[2] !== i || e[3] !== o.reference ? (f = o.reference && /* @__PURE__ */ T(y, { sx: w.traceField, children: [
1292
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceFieldLabel, children: i }),
1293
+ /* @__PURE__ */ T(y, { sx: w.traceReference, children: [
1294
+ /* @__PURE__ */ a(Ye, { color: "success" }),
1295
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, children: o.reference })
1296
+ ] })
1297
+ ] }), e[2] = i, e[3] = o.reference, e[4] = f) : f = e[4];
1298
+ let m;
1299
+ e[5] !== c || e[6] !== o.duration ? (m = o.duration != null && /* @__PURE__ */ T(y, { sx: w.traceField, children: [
1300
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceFieldLabel, children: c }),
1301
+ /* @__PURE__ */ T(_, { variant: "code3", children: [
1302
+ o.duration,
1303
+ "s"
1304
+ ] })
1305
+ ] }), e[5] = c, e[6] = o.duration, e[7] = m) : m = e[7];
1306
+ let h;
1307
+ e[8] !== d ? (h = /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceFieldLabel, children: d }), e[8] = d, e[9] = h) : h = e[9];
1308
+ let p;
1309
+ e[10] !== n || e[11] !== o.status ? (p = /* @__PURE__ */ a(_t, { status: o.status, labels: n }), e[10] = n, e[11] = o.status, e[12] = p) : p = e[12];
1310
+ let b;
1311
+ e[13] !== h || e[14] !== p ? (b = /* @__PURE__ */ T(y, { sx: w.traceField, children: [
1312
+ h,
1313
+ p
1314
+ ] }), e[13] = h, e[14] = p, e[15] = b) : b = e[15];
1315
+ let v;
1316
+ e[16] !== x || e[17] !== u || e[18] !== o.inputArguments || e[19] !== o.output || e[20] !== s ? (v = o.inputArguments && /* @__PURE__ */ T(y, { children: [
1317
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceField, children: x }),
1318
+ /* @__PURE__ */ a(ue, { sx: {
1319
+ mt: 0.5,
1320
+ mb: o.output ? 1.5 : 0
1321
+ }, content: o.inputArguments, title: `${s}: ${x}`, isError: u })
1322
+ ] }), e[16] = x, e[17] = u, e[18] = o.inputArguments, e[19] = o.output, e[20] = s, e[21] = v) : v = e[21];
1323
+ let C;
1324
+ e[22] !== u || e[23] !== g || e[24] !== o.output || e[25] !== s ? (C = o.output && /* @__PURE__ */ T(y, { children: [
1325
+ /* @__PURE__ */ a(_, { variant: "code3", fontWeight: 600, color: "text.secondary", sx: w.traceField, children: g }),
1326
+ /* @__PURE__ */ a(ue, { sx: {
1327
+ mt: 0.5
1328
+ }, content: o.output, title: `${s}: ${g}`, isError: u })
1329
+ ] }), e[22] = u, e[23] = g, e[24] = o.output, e[25] = s, e[26] = C) : C = e[26];
1330
+ let k;
1331
+ return e[27] !== f || e[28] !== m || e[29] !== b || e[30] !== v || e[31] !== C ? (k = /* @__PURE__ */ T(y, { children: [
1332
+ f,
1333
+ m,
1334
+ b,
1335
+ v,
1336
+ C
1337
+ ] }), e[27] = f, e[28] = m, e[29] = b, e[30] = v, e[31] = C, e[32] = k) : k = e[32], k;
1338
+ }
1339
+ function pe(t) {
1340
+ const e = z(29), {
1341
+ tool: o,
1342
+ expanded: r,
1343
+ onExpandedChange: l,
1344
+ labels: n,
1345
+ sx: u
1346
+ } = t;
1347
+ let s;
1348
+ e[0] !== n ? (s = n === void 0 ? {} : n, e[0] = n, e[1] = s) : s = e[1];
1349
+ const i = s, c = o.status === "running", d = i.toolExecuted ?? "Tool executed";
1350
+ if (c) {
1351
+ let k;
1352
+ e[2] !== o ? (k = ve(o), e[2] = o, e[3] = k) : k = e[3];
1353
+ let S;
1354
+ return e[4] !== k ? (S = /* @__PURE__ */ a(rt, { children: k }), e[4] = k, e[5] = S) : S = e[5], S;
1355
+ }
1356
+ const x = `PsChat--tool-trace ${o.name}`;
1357
+ let g;
1358
+ e[6] !== r || e[7] !== l ? (g = () => l?.(!r), e[6] = r, e[7] = l, e[8] = g) : g = e[8];
1359
+ let f;
1360
+ e[9] !== d ? (f = /* @__PURE__ */ a(_, { variant: "caption", fontWeight: 600, color: "text.secondary", children: d }), e[9] = d, e[10] = f) : f = e[10];
1361
+ const m = r ? "rotate(90deg)" : "rotate(0deg)";
1362
+ let h;
1363
+ e[11] !== m ? (h = /* @__PURE__ */ a(xe, { sx: {
1364
+ ...w.traceChevron,
1365
+ transform: m
1366
+ } }), e[11] = m, e[12] = h) : h = e[12];
1367
+ let p;
1368
+ e[13] !== r || e[14] !== g || e[15] !== f || e[16] !== h ? (p = /* @__PURE__ */ T(re, { size: "small", variant: "text", onClick: g, "aria-expanded": r, sx: w.traceHeader, children: [
1369
+ f,
1370
+ h
1371
+ ] }), e[13] = r, e[14] = g, e[15] = f, e[16] = h, e[17] = p) : p = e[17];
1372
+ let b;
1373
+ e[18] !== i || e[19] !== o ? (b = /* @__PURE__ */ a(y, { sx: w.traceDetailsWrapper, children: /* @__PURE__ */ a(we, { tool: o, labels: i }) }), e[18] = i, e[19] = o, e[20] = b) : b = e[20];
1374
+ let v;
1375
+ e[21] !== r || e[22] !== b ? (v = /* @__PURE__ */ a(le, { in: r, unmountOnExit: !0, children: b }), e[21] = r, e[22] = b, e[23] = v) : v = e[23];
1376
+ let C;
1377
+ return e[24] !== u || e[25] !== v || e[26] !== x || e[27] !== p ? (C = /* @__PURE__ */ T(y, { width: "100%", sx: u, className: x, children: [
1378
+ p,
1379
+ v
1380
+ ] }), e[24] = u, e[25] = v, e[26] = x, e[27] = p, e[28] = C) : C = e[28], C;
1381
+ }
1382
+ function me(t, e) {
1383
+ const o = z(5), [r, l] = ie(t);
1384
+ if (e) {
1385
+ let n;
1386
+ return o[0] !== e || o[1] !== t ? (n = [t, e], o[0] = e, o[1] = t, o[2] = n) : n = o[2], n;
1387
+ } else {
1388
+ let n;
1389
+ return o[3] !== r ? (n = [r, l], o[3] = r, o[4] = n) : n = o[4], n;
1390
+ }
1391
+ }
1392
+ function Kt(t) {
1393
+ const e = z(62), {
1394
+ tools: o,
1395
+ expanded: r,
1396
+ onExpandedChange: l,
1397
+ expandedTools: n,
1398
+ onToolExpandedChange: u,
1399
+ labels: s,
1400
+ sx: i
1401
+ } = t, c = r === void 0 ? !1 : r;
1402
+ let d;
1403
+ e[0] !== n ? (d = n === void 0 ? {} : n, e[0] = n, e[1] = d) : d = e[1];
1404
+ const x = d;
1405
+ let g;
1406
+ e[2] !== s ? (g = s === void 0 ? {} : s, e[2] = s, e[3] = g) : g = e[3];
1407
+ const f = g, [m, h] = me(c, l), [p, b] = me(x, u);
1408
+ let v;
1409
+ e[4] !== o ? (v = o.filter(It), e[4] = o, e[5] = v) : v = e[5];
1410
+ const C = v.length;
1411
+ let k, S;
1412
+ if (e[6] !== m || e[7] !== p || e[8] !== f || e[9] !== C || e[10] !== h || e[11] !== b || e[12] !== i || e[13] !== o) {
1413
+ S = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
1414
+ e: {
1415
+ const A = o.filter(At), I = o.filter($t), R = f.toolsUsed ?? "tools used", $ = f.error ?? "Error";
1416
+ if (o.length === 1) {
1417
+ let F;
1418
+ e[16] !== m || e[17] !== f || e[18] !== h || e[19] !== i || e[20] !== o[0] ? (F = /* @__PURE__ */ a(pe, { tool: o[0], expanded: m, onExpandedChange: h, labels: f, sx: i }), e[16] = m, e[17] = f, e[18] = h, e[19] = i, e[20] = o[0], e[21] = F) : F = e[21], S = F;
1419
+ break e;
1420
+ }
1421
+ let E;
1422
+ e[22] !== m || e[23] !== h ? (E = () => h(!m), e[22] = m, e[23] = h, e[24] = E) : E = e[24];
1423
+ const B = C > 0 ? 0.5 : 0;
1424
+ let L;
1425
+ e[25] !== B ? (L = {
1426
+ ...w.traceHeader,
1427
+ pr: B
1428
+ }, e[25] = B, e[26] = L) : L = e[26];
1429
+ let D;
1430
+ e[27] !== o.length || e[28] !== R ? (D = /* @__PURE__ */ T(_, { variant: "caption", fontWeight: 600, color: "text.secondary", children: [
1431
+ o.length,
1432
+ " ",
1433
+ R
1434
+ ] }), e[27] = o.length, e[28] = R, e[29] = D) : D = e[29];
1435
+ const M = m ? "rotate(90deg)" : "rotate(0deg)";
1436
+ let P;
1437
+ e[30] !== M ? (P = /* @__PURE__ */ a(xe, { sx: {
1438
+ ...w.traceChevron,
1439
+ transform: M
1440
+ } }), e[30] = M, e[31] = P) : P = e[31];
1441
+ let V;
1442
+ e[32] !== C ? (V = C > 0 && /* @__PURE__ */ T(_, { variant: "code3", sx: w.errorBadge, children: [
1443
+ C,
1444
+ /* @__PURE__ */ a(ge, { sx: {
1445
+ fontSize: 12
1446
+ }, color: "error" })
1447
+ ] }), e[32] = C, e[33] = V) : V = e[33];
1448
+ let G;
1449
+ e[34] !== m || e[35] !== L || e[36] !== D || e[37] !== P || e[38] !== V || e[39] !== E ? (G = /* @__PURE__ */ T(re, { size: "small", variant: "text", onClick: E, "aria-expanded": m, sx: L, children: [
1450
+ D,
1451
+ P,
1452
+ V
1453
+ ] }), e[34] = m, e[35] = L, e[36] = D, e[37] = P, e[38] = V, e[39] = E, e[40] = G) : G = e[40];
1454
+ const Q = le, Z = m, ee = !0, te = y, oe = "ul";
1455
+ let U;
1456
+ e[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (U = {
1457
+ ...w.traceDetailsWrapper,
1458
+ p: 0,
1459
+ listStyle: "none"
1460
+ }, e[41] = U) : U = e[41];
1461
+ let X;
1462
+ e[42] !== $ || e[43] !== m || e[44] !== p || e[45] !== f || e[46] !== b ? (X = (F) => {
1463
+ const J = p[F.id] ?? !1;
1464
+ return /* @__PURE__ */ T(y, { component: "li", sx: w.groupListItem, "aria-expanded": J, children: [
1465
+ /* @__PURE__ */ T(re, { variant: "text", color: "inherit", fullWidth: !0, onClick: () => b({
1466
+ ...p,
1467
+ [F.id]: !J
1468
+ }), "aria-expanded": J, sx: w.groupHeader, children: [
1469
+ /* @__PURE__ */ a(_, { flexGrow: 1, flexShrink: 0, variant: "caption", color: "text.secondary", children: ve(F) }),
1470
+ F.status === "error" && /* @__PURE__ */ a(_, { variant: "code3", color: "error.main", children: $ }),
1471
+ /* @__PURE__ */ a(Ne, { sx: {
1472
+ ...w.traceChevron,
1473
+ transform: m ? "rotate(90deg)" : "rotate(0deg)"
1474
+ } })
1475
+ ] }),
1476
+ /* @__PURE__ */ a(le, { in: J, unmountOnExit: !0, children: /* @__PURE__ */ a(y, { px: 1.5, py: 1, children: /* @__PURE__ */ a(we, { tool: F, labels: f }) }) })
1477
+ ] }, F.id);
1478
+ }, e[42] = $, e[43] = m, e[44] = p, e[45] = f, e[46] = b, e[47] = X) : X = e[47];
1479
+ const ne = I.map(X);
1480
+ let j;
1481
+ e[48] !== te || e[49] !== oe || e[50] !== U || e[51] !== ne ? (j = /* @__PURE__ */ a(te, { component: oe, sx: U, children: ne }), e[48] = te, e[49] = oe, e[50] = U, e[51] = ne, e[52] = j) : j = e[52];
1482
+ let Y;
1483
+ e[53] !== Q || e[54] !== Z || e[55] !== ee || e[56] !== j ? (Y = /* @__PURE__ */ a(Q, { in: Z, unmountOnExit: ee, children: j }), e[53] = Q, e[54] = Z, e[55] = ee, e[56] = j, e[57] = Y) : Y = e[57];
1484
+ let K;
1485
+ e[58] !== p || e[59] !== f || e[60] !== b ? (K = (F) => /* @__PURE__ */ a(pe, { tool: F, labels: f, expanded: p[F.id], onExpandedChange: () => b({
1486
+ ...p,
1487
+ [F.id]: !p[F.id]
1488
+ }) }, F.id), e[58] = p, e[59] = f, e[60] = b, e[61] = K) : K = e[61], k = /* @__PURE__ */ T(y, { width: "100%", sx: i, className: "PsChat--tool-group", children: [
1489
+ G,
1490
+ Y,
1491
+ A.map(K)
1492
+ ] });
1493
+ }
1494
+ e[6] = m, e[7] = p, e[8] = f, e[9] = C, e[10] = h, e[11] = b, e[12] = i, e[13] = o, e[14] = k, e[15] = S;
1495
+ } else
1496
+ k = e[14], S = e[15];
1497
+ return S !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel") ? S : k;
1498
+ }
1499
+ function $t(t) {
1500
+ return t.status !== "running";
1501
+ }
1502
+ function At(t) {
1503
+ return t.status === "running";
1504
+ }
1505
+ function It(t) {
1506
+ return t.status === "error";
781
1507
  }
782
1508
  export {
783
- Fe as CHAT_DIVIDER_DELAY,
784
- j as CHAT_MAX_WIDTH,
785
- Ee as CHAT_SCROLL_DELAY,
786
- Ge as ChatActionsContainer,
787
- ge as ChatAgentMessage,
788
- je as ChatContent,
789
- Pe as ChatErrorMessage,
790
- Ue as ChatFooter,
791
- He as ChatHeader,
792
- Re as ChatLoader,
793
- G as ChatMessageOverflow,
794
- Ke as ChatRatingAction,
795
- Ne as ChatStarter,
796
- Ce as ChatSuggestionButton,
797
- we as ChatThinking,
798
- Ye as ChatTools,
799
- Oe as ChatUserMessage
1509
+ Ht as CHAT_DIVIDER_DELAY,
1510
+ q as CHAT_MAX_WIDTH,
1511
+ Mt as CHAT_SCROLL_DELAY,
1512
+ Ke as CHAT_TOOL_CODE_AREA_MAX_HEIGHT,
1513
+ Xt as ChatActionsContainer,
1514
+ qe as ChatAgentMessage,
1515
+ Ut as ChatContent,
1516
+ Pt as ChatErrorMessage,
1517
+ Nt as ChatFooter,
1518
+ jt as ChatHeader,
1519
+ Vt as ChatLoader,
1520
+ ye as ChatMessageOverflow,
1521
+ Yt as ChatRatingAction,
1522
+ Gt as ChatStarter,
1523
+ et as ChatSuggestionButton,
1524
+ rt as ChatThinking,
1525
+ ue as ChatToolCodeArea,
1526
+ ut as ChatToolFullViewDialog,
1527
+ Kt as ChatToolGroup,
1528
+ pe as ChatToolTrace,
1529
+ Ot as ChatUserMessage
800
1530
  };
801
1531
  //# sourceMappingURL=chat.js.map