@carto/ps-react-ui 4.9.1 → 4.11.1

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