@mieweb/ui 0.6.1-dev.148 → 0.6.1-dev.150

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 (82) hide show
  1. package/dist/brands/index.cjs +22 -22
  2. package/dist/brands/index.js +5 -5
  3. package/dist/chunk-2T4JU5RH.cjs +1156 -0
  4. package/dist/chunk-2T4JU5RH.cjs.map +1 -0
  5. package/dist/chunk-3SSXDWD7.js +363 -0
  6. package/dist/chunk-3SSXDWD7.js.map +1 -0
  7. package/dist/{chunk-MARLXJQO.cjs → chunk-6R2ZPDN7.cjs} +7 -7
  8. package/dist/{chunk-MARLXJQO.cjs.map → chunk-6R2ZPDN7.cjs.map} +1 -1
  9. package/dist/{chunk-WHUD3XHR.cjs → chunk-7PA26KBF.cjs} +15 -3
  10. package/dist/chunk-7PA26KBF.cjs.map +1 -0
  11. package/dist/chunk-ASLZUFH4.js +1967 -0
  12. package/dist/chunk-ASLZUFH4.js.map +1 -0
  13. package/dist/chunk-FADQVM4M.cjs +2017 -0
  14. package/dist/chunk-FADQVM4M.cjs.map +1 -0
  15. package/dist/{chunk-DFT7TYKL.cjs → chunk-H4T5T65N.cjs} +6 -3
  16. package/dist/chunk-H4T5T65N.cjs.map +1 -0
  17. package/dist/chunk-I6CY5C6A.js +12 -0
  18. package/dist/chunk-I6CY5C6A.js.map +1 -0
  19. package/dist/chunk-JFLC7SHM.cjs +35 -0
  20. package/dist/chunk-JFLC7SHM.cjs.map +1 -0
  21. package/dist/chunk-LZPPH5BW.cjs +368 -0
  22. package/dist/chunk-LZPPH5BW.cjs.map +1 -0
  23. package/dist/{chunk-3OHVUXDG.js → chunk-M7BLVBL4.js} +6 -3
  24. package/dist/chunk-M7BLVBL4.js.map +1 -0
  25. package/dist/chunk-PM2I3QKM.cjs +1419 -0
  26. package/dist/chunk-PM2I3QKM.cjs.map +1 -0
  27. package/dist/{chunk-TW6DXMSD.js → chunk-R6PBBPU3.js} +2 -2
  28. package/dist/{chunk-TW6DXMSD.js.map → chunk-R6PBBPU3.js.map} +1 -1
  29. package/dist/{chunk-33PO3J4O.js → chunk-RXY5SD3O.js} +15 -3
  30. package/dist/chunk-RXY5SD3O.js.map +1 -0
  31. package/dist/{chunk-AEGYWRSL.js → chunk-TXYTMU3K.js} +3 -3
  32. package/dist/{chunk-AEGYWRSL.js.map → chunk-TXYTMU3K.js.map} +1 -1
  33. package/dist/chunk-UHPQYBXQ.js +1124 -0
  34. package/dist/chunk-UHPQYBXQ.js.map +1 -0
  35. package/dist/chunk-XQE26F3G.js +1383 -0
  36. package/dist/chunk-XQE26F3G.js.map +1 -0
  37. package/dist/{chunk-26YNFCOC.cjs → chunk-Z6NRP4Z5.cjs} +2 -2
  38. package/dist/{chunk-26YNFCOC.cjs.map → chunk-Z6NRP4Z5.cjs.map} +1 -1
  39. package/dist/components/Dropdown/index.cjs +7 -7
  40. package/dist/components/Dropdown/index.d.cts +1 -1
  41. package/dist/components/Dropdown/index.d.ts +1 -1
  42. package/dist/components/Dropdown/index.js +1 -1
  43. package/dist/components/RichTextEditor/index.cjs +5 -5
  44. package/dist/components/RichTextEditor/index.js +2 -2
  45. package/dist/components/SuperChat/index.cjs +1319 -0
  46. package/dist/components/SuperChat/index.cjs.map +1 -0
  47. package/dist/components/SuperChat/index.d.cts +189 -0
  48. package/dist/components/SuperChat/index.d.ts +189 -0
  49. package/dist/components/SuperChat/index.js +1282 -0
  50. package/dist/components/SuperChat/index.js.map +1 -0
  51. package/dist/components/SuperChat/plugins/index.cjs +1221 -0
  52. package/dist/components/SuperChat/plugins/index.cjs.map +1 -0
  53. package/dist/components/SuperChat/plugins/index.d.cts +253 -0
  54. package/dist/components/SuperChat/plugins/index.d.ts +253 -0
  55. package/dist/components/SuperChat/plugins/index.js +1181 -0
  56. package/dist/components/SuperChat/plugins/index.js.map +1 -0
  57. package/dist/datavis.cjs +18 -362
  58. package/dist/datavis.cjs.map +1 -1
  59. package/dist/datavis.js +1 -361
  60. package/dist/datavis.js.map +1 -1
  61. package/dist/index.cjs +1297 -5412
  62. package/dist/index.cjs.map +1 -1
  63. package/dist/index.d.cts +44 -240
  64. package/dist/index.d.ts +44 -240
  65. package/dist/index.js +759 -5037
  66. package/dist/index.js.map +1 -1
  67. package/dist/nitroTableGrid-FWRCDE4N.js +22 -0
  68. package/dist/nitroTableGrid-FWRCDE4N.js.map +1 -0
  69. package/dist/nitroTableGrid-IY75TQJ2.cjs +44 -0
  70. package/dist/nitroTableGrid-IY75TQJ2.cjs.map +1 -0
  71. package/dist/styles.css +1 -1
  72. package/dist/tailwind-preset.cjs +4 -4
  73. package/dist/tailwind-preset.js +1 -1
  74. package/dist/types-BFFgW6qy.d.ts +240 -0
  75. package/dist/types-BzeY_kYO.d.cts +242 -0
  76. package/dist/types-BzeY_kYO.d.ts +242 -0
  77. package/dist/types-CRt5IPNL.d.cts +240 -0
  78. package/package.json +41 -4
  79. package/dist/chunk-33PO3J4O.js.map +0 -1
  80. package/dist/chunk-3OHVUXDG.js.map +0 -1
  81. package/dist/chunk-DFT7TYKL.cjs.map +0 -1
  82. package/dist/chunk-WHUD3XHR.cjs.map +0 -1
@@ -0,0 +1,1419 @@
1
+ 'use strict';
2
+
3
+ var chunkOR5DRJCW_cjs = require('./chunk-OR5DRJCW.cjs');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+ var React = require('react');
6
+ var classVarianceAuthority = require('class-variance-authority');
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () { return e[k]; }
18
+ });
19
+ }
20
+ });
21
+ }
22
+ n.default = e;
23
+ return Object.freeze(n);
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
27
+
28
+ var sizeClasses = {
29
+ sm: "h-4 w-4",
30
+ md: "h-5 w-5",
31
+ lg: "h-7 w-7"
32
+ };
33
+ function SparklesIcon({ className, size = "md" }) {
34
+ return /* @__PURE__ */ jsxRuntime.jsxs(
35
+ "svg",
36
+ {
37
+ "aria-hidden": "true",
38
+ className: chunkOR5DRJCW_cjs.cn(sizeClasses[size], className),
39
+ viewBox: "0 0 24 24",
40
+ fill: "currentColor",
41
+ children: [
42
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z" }),
43
+ /* @__PURE__ */ jsxRuntime.jsx(
44
+ "path",
45
+ {
46
+ d: "M20 3v4",
47
+ stroke: "currentColor",
48
+ strokeWidth: "2",
49
+ strokeLinecap: "round"
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsxRuntime.jsx(
53
+ "path",
54
+ {
55
+ d: "M22 5h-4",
56
+ stroke: "currentColor",
57
+ strokeWidth: "2",
58
+ strokeLinecap: "round"
59
+ }
60
+ )
61
+ ]
62
+ }
63
+ );
64
+ }
65
+ function AILogoIcon({ className, size = "md" }) {
66
+ return /* @__PURE__ */ jsxRuntime.jsxs(
67
+ "svg",
68
+ {
69
+ "aria-hidden": "true",
70
+ className: chunkOR5DRJCW_cjs.cn(sizeClasses[size], className),
71
+ viewBox: "0 0 24 24",
72
+ fill: "none",
73
+ children: [
74
+ /* @__PURE__ */ jsxRuntime.jsx(
75
+ "path",
76
+ {
77
+ d: "M12 2L2 7L12 12L22 7L12 2Z",
78
+ stroke: "currentColor",
79
+ strokeWidth: "1.5",
80
+ strokeLinecap: "round",
81
+ strokeLinejoin: "round",
82
+ fill: "currentColor",
83
+ fillOpacity: "0.2"
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsxRuntime.jsx(
87
+ "path",
88
+ {
89
+ d: "M2 17L12 22L22 17",
90
+ stroke: "currentColor",
91
+ strokeWidth: "1.5",
92
+ strokeLinecap: "round",
93
+ strokeLinejoin: "round"
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsxRuntime.jsx(
97
+ "path",
98
+ {
99
+ d: "M2 12L12 17L22 12",
100
+ stroke: "currentColor",
101
+ strokeWidth: "1.5",
102
+ strokeLinecap: "round",
103
+ strokeLinejoin: "round"
104
+ }
105
+ )
106
+ ]
107
+ }
108
+ );
109
+ }
110
+ function CloseIcon({ className }) {
111
+ return /* @__PURE__ */ jsxRuntime.jsx(
112
+ "svg",
113
+ {
114
+ "aria-hidden": "true",
115
+ className: chunkOR5DRJCW_cjs.cn("h-5 w-5", className),
116
+ fill: "none",
117
+ viewBox: "0 0 24 24",
118
+ stroke: "currentColor",
119
+ strokeWidth: "2",
120
+ children: /* @__PURE__ */ jsxRuntime.jsx(
121
+ "path",
122
+ {
123
+ strokeLinecap: "round",
124
+ strokeLinejoin: "round",
125
+ d: "M6 18L18 6M6 6l12 12"
126
+ }
127
+ )
128
+ }
129
+ );
130
+ }
131
+ function RefreshIcon({ className }) {
132
+ return /* @__PURE__ */ jsxRuntime.jsx(
133
+ "svg",
134
+ {
135
+ "aria-hidden": "true",
136
+ className: chunkOR5DRJCW_cjs.cn("h-5 w-5", className),
137
+ fill: "none",
138
+ viewBox: "0 0 24 24",
139
+ stroke: "currentColor",
140
+ strokeWidth: "1.5",
141
+ children: /* @__PURE__ */ jsxRuntime.jsx(
142
+ "path",
143
+ {
144
+ strokeLinecap: "round",
145
+ strokeLinejoin: "round",
146
+ d: "M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"
147
+ }
148
+ )
149
+ }
150
+ );
151
+ }
152
+ var chevronRotation = {
153
+ up: "-rotate-180",
154
+ down: "",
155
+ left: "rotate-90",
156
+ right: "-rotate-90"
157
+ };
158
+ function ChevronIcon({
159
+ className,
160
+ direction = "down"
161
+ }) {
162
+ return /* @__PURE__ */ jsxRuntime.jsx(
163
+ "svg",
164
+ {
165
+ "aria-hidden": "true",
166
+ className: chunkOR5DRJCW_cjs.cn("h-4 w-4", chevronRotation[direction], className),
167
+ fill: "none",
168
+ viewBox: "0 0 24 24",
169
+ stroke: "currentColor",
170
+ strokeWidth: "2",
171
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" })
172
+ }
173
+ );
174
+ }
175
+ function SendIcon({ className }) {
176
+ return /* @__PURE__ */ jsxRuntime.jsx(
177
+ "svg",
178
+ {
179
+ "aria-hidden": "true",
180
+ className: chunkOR5DRJCW_cjs.cn("h-5 w-5", className),
181
+ fill: "none",
182
+ viewBox: "0 0 24 24",
183
+ stroke: "currentColor",
184
+ children: /* @__PURE__ */ jsxRuntime.jsx(
185
+ "path",
186
+ {
187
+ strokeLinecap: "round",
188
+ strokeLinejoin: "round",
189
+ strokeWidth: 2,
190
+ d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8"
191
+ }
192
+ )
193
+ }
194
+ );
195
+ }
196
+ function SpinnerIcon({ className }) {
197
+ return /* @__PURE__ */ jsxRuntime.jsxs(
198
+ "svg",
199
+ {
200
+ "aria-hidden": "true",
201
+ className: chunkOR5DRJCW_cjs.cn("h-5 w-5 animate-spin", className),
202
+ fill: "none",
203
+ viewBox: "0 0 24 24",
204
+ children: [
205
+ /* @__PURE__ */ jsxRuntime.jsx(
206
+ "circle",
207
+ {
208
+ className: "opacity-25",
209
+ cx: "12",
210
+ cy: "12",
211
+ r: "10",
212
+ stroke: "currentColor",
213
+ strokeWidth: "4"
214
+ }
215
+ ),
216
+ /* @__PURE__ */ jsxRuntime.jsx(
217
+ "path",
218
+ {
219
+ className: "opacity-75",
220
+ fill: "currentColor",
221
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
222
+ }
223
+ )
224
+ ]
225
+ }
226
+ );
227
+ }
228
+ var statusIconVariants = classVarianceAuthority.cva(
229
+ "flex h-5 w-5 items-center justify-center rounded-full",
230
+ {
231
+ variants: {
232
+ status: {
233
+ pending: "bg-neutral-200 dark:bg-neutral-700",
234
+ running: "bg-primary-100 dark:bg-primary-900/50",
235
+ success: "bg-green-100 dark:bg-green-900/50",
236
+ error: "bg-red-100 dark:bg-red-900/50",
237
+ cancelled: "bg-neutral-200 dark:bg-neutral-700"
238
+ }
239
+ },
240
+ defaultVariants: {
241
+ status: "pending"
242
+ }
243
+ }
244
+ );
245
+ function ToolStatusIcon({ status, className }) {
246
+ return /* @__PURE__ */ jsxRuntime.jsxs(
247
+ "span",
248
+ {
249
+ "data-slot": "ai-tool-status-icon",
250
+ className: chunkOR5DRJCW_cjs.cn(statusIconVariants({ status }), className),
251
+ children: [
252
+ status === "pending" && /* @__PURE__ */ jsxRuntime.jsx(
253
+ "svg",
254
+ {
255
+ "aria-hidden": "true",
256
+ className: "h-3 w-3 text-neutral-500",
257
+ fill: "currentColor",
258
+ viewBox: "0 0 20 20",
259
+ children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "10", cy: "10", r: "3" })
260
+ }
261
+ ),
262
+ status === "running" && /* @__PURE__ */ jsxRuntime.jsxs(
263
+ "svg",
264
+ {
265
+ "aria-hidden": "true",
266
+ className: "text-primary-800 dark:text-primary-400 h-3 w-3 animate-spin",
267
+ fill: "none",
268
+ viewBox: "0 0 24 24",
269
+ children: [
270
+ /* @__PURE__ */ jsxRuntime.jsx(
271
+ "circle",
272
+ {
273
+ className: "opacity-25",
274
+ cx: "12",
275
+ cy: "12",
276
+ r: "10",
277
+ stroke: "currentColor",
278
+ strokeWidth: "4"
279
+ }
280
+ ),
281
+ /* @__PURE__ */ jsxRuntime.jsx(
282
+ "path",
283
+ {
284
+ className: "opacity-75",
285
+ fill: "currentColor",
286
+ d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"
287
+ }
288
+ )
289
+ ]
290
+ }
291
+ ),
292
+ status === "success" && /* @__PURE__ */ jsxRuntime.jsx(
293
+ "svg",
294
+ {
295
+ "aria-hidden": "true",
296
+ className: "h-3 w-3 text-green-600 dark:text-green-400",
297
+ fill: "none",
298
+ viewBox: "0 0 24 24",
299
+ stroke: "currentColor",
300
+ strokeWidth: "3",
301
+ children: /* @__PURE__ */ jsxRuntime.jsx(
302
+ "path",
303
+ {
304
+ strokeLinecap: "round",
305
+ strokeLinejoin: "round",
306
+ d: "M5 13l4 4L19 7"
307
+ }
308
+ )
309
+ }
310
+ ),
311
+ status === "error" && /* @__PURE__ */ jsxRuntime.jsx(
312
+ "svg",
313
+ {
314
+ "aria-hidden": "true",
315
+ className: "h-3 w-3 text-red-600 dark:text-red-400",
316
+ fill: "none",
317
+ viewBox: "0 0 24 24",
318
+ stroke: "currentColor",
319
+ strokeWidth: "3",
320
+ children: /* @__PURE__ */ jsxRuntime.jsx(
321
+ "path",
322
+ {
323
+ strokeLinecap: "round",
324
+ strokeLinejoin: "round",
325
+ d: "M6 18L18 6M6 6l12 12"
326
+ }
327
+ )
328
+ }
329
+ ),
330
+ status === "cancelled" && /* @__PURE__ */ jsxRuntime.jsx(
331
+ "svg",
332
+ {
333
+ "aria-hidden": "true",
334
+ className: "h-3 w-3 text-neutral-500",
335
+ fill: "none",
336
+ viewBox: "0 0 24 24",
337
+ stroke: "currentColor",
338
+ strokeWidth: "3",
339
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M18 12H6" })
340
+ }
341
+ )
342
+ ]
343
+ }
344
+ );
345
+ }
346
+ var TOOL_ICONS = {
347
+ // Patient tools
348
+ create_patient: /* @__PURE__ */ jsxRuntime.jsx(
349
+ "svg",
350
+ {
351
+ "aria-hidden": "true",
352
+ className: "h-4 w-4",
353
+ fill: "none",
354
+ viewBox: "0 0 24 24",
355
+ stroke: "currentColor",
356
+ strokeWidth: "1.5",
357
+ children: /* @__PURE__ */ jsxRuntime.jsx(
358
+ "path",
359
+ {
360
+ strokeLinecap: "round",
361
+ strokeLinejoin: "round",
362
+ d: "M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zM3 19.235v-.11a6.375 6.375 0 0112.75 0v.109A12.318 12.318 0 019.374 21c-2.331 0-4.512-.645-6.374-1.766z"
363
+ }
364
+ )
365
+ }
366
+ ),
367
+ get_patient: /* @__PURE__ */ jsxRuntime.jsx(
368
+ "svg",
369
+ {
370
+ "aria-hidden": "true",
371
+ className: "h-4 w-4",
372
+ fill: "none",
373
+ viewBox: "0 0 24 24",
374
+ stroke: "currentColor",
375
+ strokeWidth: "1.5",
376
+ children: /* @__PURE__ */ jsxRuntime.jsx(
377
+ "path",
378
+ {
379
+ strokeLinecap: "round",
380
+ strokeLinejoin: "round",
381
+ d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"
382
+ }
383
+ )
384
+ }
385
+ ),
386
+ search_patients: /* @__PURE__ */ jsxRuntime.jsx(
387
+ "svg",
388
+ {
389
+ "aria-hidden": "true",
390
+ className: "h-4 w-4",
391
+ fill: "none",
392
+ viewBox: "0 0 24 24",
393
+ stroke: "currentColor",
394
+ strokeWidth: "1.5",
395
+ children: /* @__PURE__ */ jsxRuntime.jsx(
396
+ "path",
397
+ {
398
+ strokeLinecap: "round",
399
+ strokeLinejoin: "round",
400
+ d: "M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z"
401
+ }
402
+ )
403
+ }
404
+ ),
405
+ // Appointment tools
406
+ schedule_appointment: /* @__PURE__ */ jsxRuntime.jsx(
407
+ "svg",
408
+ {
409
+ "aria-hidden": "true",
410
+ className: "h-4 w-4",
411
+ fill: "none",
412
+ viewBox: "0 0 24 24",
413
+ stroke: "currentColor",
414
+ strokeWidth: "1.5",
415
+ children: /* @__PURE__ */ jsxRuntime.jsx(
416
+ "path",
417
+ {
418
+ strokeLinecap: "round",
419
+ strokeLinejoin: "round",
420
+ d: "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5m-9-6h.008v.008H12v-.008zM12 15h.008v.008H12V15zm0 2.25h.008v.008H12v-.008zM9.75 15h.008v.008H9.75V15zm0 2.25h.008v.008H9.75v-.008zM7.5 15h.008v.008H7.5V15zm0 2.25h.008v.008H7.5v-.008zm6.75-4.5h.008v.008h-.008v-.008zm0 2.25h.008v.008h-.008V15zm0 2.25h.008v.008h-.008v-.008zm2.25-4.5h.008v.008H16.5v-.008zm0 2.25h.008v.008H16.5V15z"
421
+ }
422
+ )
423
+ }
424
+ ),
425
+ // Document tools
426
+ create_document: /* @__PURE__ */ jsxRuntime.jsx(
427
+ "svg",
428
+ {
429
+ "aria-hidden": "true",
430
+ className: "h-4 w-4",
431
+ fill: "none",
432
+ viewBox: "0 0 24 24",
433
+ stroke: "currentColor",
434
+ strokeWidth: "1.5",
435
+ children: /* @__PURE__ */ jsxRuntime.jsx(
436
+ "path",
437
+ {
438
+ strokeLinecap: "round",
439
+ strokeLinejoin: "round",
440
+ d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
441
+ }
442
+ )
443
+ }
444
+ ),
445
+ // Provider tools
446
+ search_providers: /* @__PURE__ */ jsxRuntime.jsxs(
447
+ "svg",
448
+ {
449
+ "aria-hidden": "true",
450
+ className: "h-4 w-4",
451
+ fill: "none",
452
+ viewBox: "0 0 24 24",
453
+ stroke: "currentColor",
454
+ strokeWidth: "1.5",
455
+ children: [
456
+ /* @__PURE__ */ jsxRuntime.jsx(
457
+ "path",
458
+ {
459
+ strokeLinecap: "round",
460
+ strokeLinejoin: "round",
461
+ d: "M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"
462
+ }
463
+ ),
464
+ /* @__PURE__ */ jsxRuntime.jsx(
465
+ "path",
466
+ {
467
+ strokeLinecap: "round",
468
+ strokeLinejoin: "round",
469
+ d: "M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"
470
+ }
471
+ )
472
+ ]
473
+ }
474
+ ),
475
+ // Default tool icon
476
+ default: /* @__PURE__ */ jsxRuntime.jsx(
477
+ "svg",
478
+ {
479
+ "aria-hidden": "true",
480
+ className: "h-4 w-4",
481
+ fill: "none",
482
+ viewBox: "0 0 24 24",
483
+ stroke: "currentColor",
484
+ strokeWidth: "1.5",
485
+ children: /* @__PURE__ */ jsxRuntime.jsx(
486
+ "path",
487
+ {
488
+ strokeLinecap: "round",
489
+ strokeLinejoin: "round",
490
+ d: "M11.42 15.17L17.25 21A2.652 2.652 0 0021 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 11-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 004.486-6.336l-3.276 3.277a3.004 3.004 0 01-2.25-2.25l3.276-3.276a4.5 4.5 0 00-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437l1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008z"
491
+ }
492
+ )
493
+ }
494
+ )
495
+ };
496
+ function getToolIcon(toolName) {
497
+ return TOOL_ICONS[toolName] || TOOL_ICONS.default;
498
+ }
499
+ function ResourceLink({ link, onClick, className }) {
500
+ const handleClick = (e) => {
501
+ if (onClick) {
502
+ e.preventDefault();
503
+ onClick(link);
504
+ }
505
+ };
506
+ const linkTypeIcons = {
507
+ patient: /* @__PURE__ */ jsxRuntime.jsx(
508
+ "svg",
509
+ {
510
+ "aria-hidden": "true",
511
+ className: "h-4 w-4",
512
+ fill: "none",
513
+ viewBox: "0 0 24 24",
514
+ stroke: "currentColor",
515
+ strokeWidth: "1.5",
516
+ children: /* @__PURE__ */ jsxRuntime.jsx(
517
+ "path",
518
+ {
519
+ strokeLinecap: "round",
520
+ strokeLinejoin: "round",
521
+ d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z"
522
+ }
523
+ )
524
+ }
525
+ ),
526
+ document: /* @__PURE__ */ jsxRuntime.jsx(
527
+ "svg",
528
+ {
529
+ "aria-hidden": "true",
530
+ className: "h-4 w-4",
531
+ fill: "none",
532
+ viewBox: "0 0 24 24",
533
+ stroke: "currentColor",
534
+ strokeWidth: "1.5",
535
+ children: /* @__PURE__ */ jsxRuntime.jsx(
536
+ "path",
537
+ {
538
+ strokeLinecap: "round",
539
+ strokeLinejoin: "round",
540
+ d: "M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"
541
+ }
542
+ )
543
+ }
544
+ ),
545
+ appointment: /* @__PURE__ */ jsxRuntime.jsx(
546
+ "svg",
547
+ {
548
+ "aria-hidden": "true",
549
+ className: "h-4 w-4",
550
+ fill: "none",
551
+ viewBox: "0 0 24 24",
552
+ stroke: "currentColor",
553
+ strokeWidth: "1.5",
554
+ children: /* @__PURE__ */ jsxRuntime.jsx(
555
+ "path",
556
+ {
557
+ strokeLinecap: "round",
558
+ strokeLinejoin: "round",
559
+ d: "M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5"
560
+ }
561
+ )
562
+ }
563
+ ),
564
+ order: /* @__PURE__ */ jsxRuntime.jsx(
565
+ "svg",
566
+ {
567
+ "aria-hidden": "true",
568
+ className: "h-4 w-4",
569
+ fill: "none",
570
+ viewBox: "0 0 24 24",
571
+ stroke: "currentColor",
572
+ strokeWidth: "1.5",
573
+ children: /* @__PURE__ */ jsxRuntime.jsx(
574
+ "path",
575
+ {
576
+ strokeLinecap: "round",
577
+ strokeLinejoin: "round",
578
+ d: "M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25z"
579
+ }
580
+ )
581
+ }
582
+ ),
583
+ provider: /* @__PURE__ */ jsxRuntime.jsxs(
584
+ "svg",
585
+ {
586
+ "aria-hidden": "true",
587
+ className: "h-4 w-4",
588
+ fill: "none",
589
+ viewBox: "0 0 24 24",
590
+ stroke: "currentColor",
591
+ strokeWidth: "1.5",
592
+ children: [
593
+ /* @__PURE__ */ jsxRuntime.jsx(
594
+ "path",
595
+ {
596
+ strokeLinecap: "round",
597
+ strokeLinejoin: "round",
598
+ d: "M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"
599
+ }
600
+ ),
601
+ /* @__PURE__ */ jsxRuntime.jsx(
602
+ "path",
603
+ {
604
+ strokeLinecap: "round",
605
+ strokeLinejoin: "round",
606
+ d: "M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"
607
+ }
608
+ )
609
+ ]
610
+ }
611
+ ),
612
+ external: /* @__PURE__ */ jsxRuntime.jsx(
613
+ "svg",
614
+ {
615
+ "aria-hidden": "true",
616
+ className: "h-4 w-4",
617
+ fill: "none",
618
+ viewBox: "0 0 24 24",
619
+ stroke: "currentColor",
620
+ strokeWidth: "1.5",
621
+ children: /* @__PURE__ */ jsxRuntime.jsx(
622
+ "path",
623
+ {
624
+ strokeLinecap: "round",
625
+ strokeLinejoin: "round",
626
+ d: "M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"
627
+ }
628
+ )
629
+ }
630
+ ),
631
+ internal: /* @__PURE__ */ jsxRuntime.jsx(
632
+ "svg",
633
+ {
634
+ "aria-hidden": "true",
635
+ className: "h-4 w-4",
636
+ fill: "none",
637
+ viewBox: "0 0 24 24",
638
+ stroke: "currentColor",
639
+ strokeWidth: "1.5",
640
+ children: /* @__PURE__ */ jsxRuntime.jsx(
641
+ "path",
642
+ {
643
+ strokeLinecap: "round",
644
+ strokeLinejoin: "round",
645
+ d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"
646
+ }
647
+ )
648
+ }
649
+ )
650
+ };
651
+ const icon = link.type ? linkTypeIcons[link.type] : linkTypeIcons.internal;
652
+ return /* @__PURE__ */ jsxRuntime.jsxs(
653
+ "a",
654
+ {
655
+ href: link.href,
656
+ onClick: handleClick,
657
+ className: chunkOR5DRJCW_cjs.cn(
658
+ "inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5",
659
+ "bg-primary-50 text-primary-900 hover:bg-primary-100",
660
+ "dark:bg-primary-900/30 dark:text-primary-300 dark:hover:bg-primary-900/50",
661
+ "text-sm font-medium transition-colors",
662
+ "focus:ring-primary-500 focus:ring-2 focus:ring-offset-2 focus:outline-none",
663
+ "dark:focus:ring-offset-neutral-900",
664
+ className
665
+ ),
666
+ children: [
667
+ icon,
668
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: link.label }),
669
+ link.type === "external" && /* @__PURE__ */ jsxRuntime.jsx(
670
+ "svg",
671
+ {
672
+ "aria-hidden": "true",
673
+ className: "h-3 w-3 opacity-60",
674
+ fill: "none",
675
+ viewBox: "0 0 24 24",
676
+ stroke: "currentColor",
677
+ strokeWidth: "2",
678
+ children: /* @__PURE__ */ jsxRuntime.jsx(
679
+ "path",
680
+ {
681
+ strokeLinecap: "round",
682
+ strokeLinejoin: "round",
683
+ d: "M4.5 19.5l15-15m0 0H8.25m11.25 0v11.25"
684
+ }
685
+ )
686
+ }
687
+ )
688
+ ]
689
+ }
690
+ );
691
+ }
692
+ function ToolResultDisplay({
693
+ result,
694
+ onLinkClick,
695
+ showRawData = false,
696
+ className
697
+ }) {
698
+ const [showJson, setShowJson] = React__namespace.useState(false);
699
+ if (result.type === "error") {
700
+ return /* @__PURE__ */ jsxRuntime.jsx(
701
+ "div",
702
+ {
703
+ className: chunkOR5DRJCW_cjs.cn(
704
+ "mt-2 rounded-md bg-red-50 p-3 dark:bg-red-900/20",
705
+ className
706
+ ),
707
+ children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-700 dark:text-red-300", children: typeof result.data === "string" ? String(result.data) : "An error occurred" })
708
+ }
709
+ );
710
+ }
711
+ const hasRawData = result.type === "json" && result.data !== void 0 && result.data !== null;
712
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkOR5DRJCW_cjs.cn("space-y-2", className), children: [
713
+ result.summary && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-neutral-700 dark:text-neutral-300", children: result.summary }),
714
+ result.link && /* @__PURE__ */ jsxRuntime.jsx(ResourceLink, { link: result.link, onClick: onLinkClick }),
715
+ result.resources && result.resources.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap gap-2", children: result.resources.map((resource) => /* @__PURE__ */ jsxRuntime.jsx(
716
+ ResourceLink,
717
+ {
718
+ link: {
719
+ href: resource.uri || "#",
720
+ label: resource.name,
721
+ type: resource.type
722
+ },
723
+ onClick: onLinkClick
724
+ },
725
+ resource.id
726
+ )) }),
727
+ hasRawData && showRawData && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2", children: [
728
+ /* @__PURE__ */ jsxRuntime.jsxs(
729
+ "button",
730
+ {
731
+ onClick: () => setShowJson(!showJson),
732
+ className: "flex items-center gap-1 text-xs text-neutral-600 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300",
733
+ children: [
734
+ /* @__PURE__ */ jsxRuntime.jsx(
735
+ "svg",
736
+ {
737
+ "aria-hidden": "true",
738
+ className: chunkOR5DRJCW_cjs.cn(
739
+ "h-3 w-3 transition-transform",
740
+ showJson && "rotate-90"
741
+ ),
742
+ fill: "none",
743
+ viewBox: "0 0 24 24",
744
+ stroke: "currentColor",
745
+ strokeWidth: "2",
746
+ children: /* @__PURE__ */ jsxRuntime.jsx(
747
+ "path",
748
+ {
749
+ strokeLinecap: "round",
750
+ strokeLinejoin: "round",
751
+ d: "M9 5l7 7-7 7"
752
+ }
753
+ )
754
+ }
755
+ ),
756
+ showJson ? "Hide" : "Show",
757
+ " raw data"
758
+ ]
759
+ }
760
+ ),
761
+ showJson && /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "mt-2 max-h-40 overflow-auto rounded-md bg-neutral-100 p-2 text-xs dark:bg-neutral-800", children: JSON.stringify(result.data, null, 2) })
762
+ ] })
763
+ ] });
764
+ }
765
+ var toolCallVariants = classVarianceAuthority.cva(
766
+ ["rounded-lg border", "overflow-hidden", "transition-all duration-200"],
767
+ {
768
+ variants: {
769
+ status: {
770
+ pending: "border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-800/50",
771
+ running: "border-primary-200 bg-primary-50/50 dark:border-primary-800 dark:bg-primary-900/20",
772
+ success: "border-green-200 bg-green-50/50 dark:border-green-800 dark:bg-green-900/20",
773
+ error: "border-red-200 bg-red-50/50 dark:border-red-800 dark:bg-red-900/20",
774
+ cancelled: "border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-800/50 opacity-60"
775
+ },
776
+ compact: {
777
+ true: "p-2",
778
+ false: "p-3"
779
+ }
780
+ },
781
+ defaultVariants: {
782
+ status: "pending",
783
+ compact: false
784
+ }
785
+ }
786
+ );
787
+ var TOOL_FRIENDLY_NAMES = {
788
+ create_patient: "Creating patient",
789
+ get_patient: "Looking up patient",
790
+ search_patients: "Searching patients",
791
+ update_patient: "Updating patient",
792
+ delete_patient: "Removing patient",
793
+ schedule_appointment: "Scheduling appointment",
794
+ cancel_appointment: "Canceling appointment",
795
+ update_appointment: "Updating appointment",
796
+ create_document: "Creating document",
797
+ upload_document: "Uploading document",
798
+ get_document: "Retrieving document",
799
+ search_documents: "Searching documents",
800
+ create_order: "Creating order",
801
+ send_message: "Sending message",
802
+ search: "Searching",
803
+ search_providers: "Searching for providers"
804
+ };
805
+ function getToolFriendlyName(toolName, status) {
806
+ const baseName = TOOL_FRIENDLY_NAMES[toolName] || toolName.replace(/_/g, " ");
807
+ if (status === "success") {
808
+ if (baseName.startsWith("Creating"))
809
+ return baseName.replace("Creating", "Created");
810
+ if (baseName.startsWith("Scheduling"))
811
+ return baseName.replace("Scheduling", "Scheduled");
812
+ if (baseName.startsWith("Searching for"))
813
+ return baseName.replace("Searching for", "Found");
814
+ if (baseName.startsWith("Searching"))
815
+ return baseName.replace("Searching", "Found");
816
+ if (baseName.startsWith("Looking"))
817
+ return baseName.replace("Looking", "Found");
818
+ if (baseName.startsWith("Updating"))
819
+ return baseName.replace("Updating", "Updated");
820
+ if (baseName.startsWith("Removing"))
821
+ return baseName.replace("Removing", "Removed");
822
+ if (baseName.startsWith("Canceling"))
823
+ return baseName.replace("Canceling", "Canceled");
824
+ if (baseName.startsWith("Retrieving"))
825
+ return baseName.replace("Retrieving", "Retrieved");
826
+ if (baseName.startsWith("Uploading"))
827
+ return baseName.replace("Uploading", "Uploaded");
828
+ if (baseName.startsWith("Sending"))
829
+ return baseName.replace("Sending", "Sent");
830
+ }
831
+ return baseName;
832
+ }
833
+ function getParameterSummary(toolName, params) {
834
+ const paramMap = Object.fromEntries(params.map((p) => [p.name, p.value]));
835
+ if (toolName === "create_patient" && paramMap.firstName && paramMap.lastName) {
836
+ return `${paramMap.firstName} ${paramMap.lastName}`;
837
+ }
838
+ if (toolName.includes("search") && paramMap.query) {
839
+ return `"${paramMap.query}"`;
840
+ }
841
+ if (toolName.includes("appointment") && paramMap.patientName) {
842
+ const date = paramMap.preferredDate || paramMap.date;
843
+ return date ? `${paramMap.patientName} on ${date}` : String(paramMap.patientName);
844
+ }
845
+ if (toolName === "search_providers" && paramMap.zipcode) {
846
+ const service = paramMap.service;
847
+ return service ? `${service} near ${paramMap.zipcode}` : `near ${paramMap.zipcode}`;
848
+ }
849
+ return null;
850
+ }
851
+ function MCPToolCallDisplay({
852
+ toolCall,
853
+ showParameters = true,
854
+ collapsible = true,
855
+ defaultCollapsed = true,
856
+ compact,
857
+ onLinkClick,
858
+ className
859
+ }) {
860
+ const [showDetails, setShowDetails] = React__namespace.useState(!defaultCollapsed);
861
+ const formatDuration = (ms) => {
862
+ if (!ms) return null;
863
+ if (ms < 1e3) return `${ms}ms`;
864
+ return `${(ms / 1e3).toFixed(1)}s`;
865
+ };
866
+ const friendlyName = getToolFriendlyName(toolCall.toolName, toolCall.status);
867
+ const paramSummary = getParameterSummary(
868
+ toolCall.toolName,
869
+ toolCall.parameters
870
+ );
871
+ return /* @__PURE__ */ jsxRuntime.jsx(
872
+ "div",
873
+ {
874
+ "data-slot": "ai-tool-call",
875
+ className: chunkOR5DRJCW_cjs.cn(
876
+ toolCallVariants({ status: toolCall.status, compact }),
877
+ className
878
+ ),
879
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
880
+ /* @__PURE__ */ jsxRuntime.jsx(
881
+ "div",
882
+ {
883
+ "data-slot": "ai-tool-icon",
884
+ className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-white/50 text-neutral-600 dark:bg-neutral-700/50 dark:text-neutral-400",
885
+ children: getToolIcon(toolCall.toolName)
886
+ }
887
+ ),
888
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-slot": "ai-tool-content", className: "min-w-0 flex-1", children: [
889
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
890
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium text-neutral-900 dark:text-white", children: friendlyName }),
891
+ /* @__PURE__ */ jsxRuntime.jsx(ToolStatusIcon, { status: toolCall.status }),
892
+ toolCall.duration && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-neutral-600 dark:text-neutral-400", children: formatDuration(toolCall.duration) })
893
+ ] }),
894
+ paramSummary && toolCall.status !== "success" && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground mt-0.5 text-sm", children: paramSummary }),
895
+ toolCall.result && /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "ai-tool-result", className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
896
+ ToolResultDisplay,
897
+ {
898
+ result: toolCall.result,
899
+ onLinkClick,
900
+ showRawData: showDetails
901
+ }
902
+ ) }),
903
+ toolCall.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 rounded-md bg-red-100 p-2 dark:bg-red-900/30", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-red-700 dark:text-red-300", children: toolCall.error }) }),
904
+ collapsible && showParameters && toolCall.parameters.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
905
+ "button",
906
+ {
907
+ onClick: () => setShowDetails(!showDetails),
908
+ className: "mt-2 flex items-center gap-1 text-xs text-neutral-600 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300",
909
+ children: [
910
+ /* @__PURE__ */ jsxRuntime.jsx(
911
+ "svg",
912
+ {
913
+ "aria-hidden": "true",
914
+ className: chunkOR5DRJCW_cjs.cn(
915
+ "h-3 w-3 transition-transform",
916
+ showDetails && "rotate-90"
917
+ ),
918
+ fill: "none",
919
+ viewBox: "0 0 24 24",
920
+ stroke: "currentColor",
921
+ strokeWidth: "2",
922
+ children: /* @__PURE__ */ jsxRuntime.jsx(
923
+ "path",
924
+ {
925
+ strokeLinecap: "round",
926
+ strokeLinejoin: "round",
927
+ d: "M9 5l7 7-7 7"
928
+ }
929
+ )
930
+ }
931
+ ),
932
+ showDetails ? "Hide" : "Show",
933
+ " details"
934
+ ]
935
+ }
936
+ ),
937
+ showDetails && showParameters && toolCall.parameters.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
938
+ "div",
939
+ {
940
+ "data-slot": "ai-tool-parameters",
941
+ className: "mt-3 rounded-md bg-neutral-100 p-2 dark:bg-neutral-800",
942
+ children: [
943
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "mb-1.5 text-xs font-medium tracking-wide text-neutral-600 uppercase dark:text-neutral-400", children: "Parameters" }),
944
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: toolCall.parameters.map((param) => /* @__PURE__ */ jsxRuntime.jsxs(
945
+ "div",
946
+ {
947
+ className: "flex items-start gap-2 text-xs",
948
+ children: [
949
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "font-mono text-neutral-600 dark:text-neutral-400", children: [
950
+ param.name,
951
+ ":"
952
+ ] }),
953
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-mono text-neutral-700 dark:text-neutral-300", children: typeof param.value === "string" ? param.value : JSON.stringify(param.value) })
954
+ ]
955
+ },
956
+ param.name
957
+ )) })
958
+ ]
959
+ }
960
+ )
961
+ ] })
962
+ ] })
963
+ }
964
+ );
965
+ }
966
+ var avatarVariants = classVarianceAuthority.cva(
967
+ "flex shrink-0 items-center justify-center rounded-full",
968
+ {
969
+ variants: {
970
+ role: {
971
+ user: "bg-primary-100 text-primary-900 dark:bg-primary-900/50 dark:text-primary-300",
972
+ assistant: "bg-primary-800 text-white dark:bg-primary-800",
973
+ system: "bg-neutral-200 text-neutral-600 dark:bg-neutral-700 dark:text-neutral-400",
974
+ tool: "bg-amber-100 text-amber-700 dark:bg-amber-900/50 dark:text-amber-300"
975
+ },
976
+ size: {
977
+ sm: "h-6 w-6 text-xs",
978
+ md: "h-8 w-8 text-sm",
979
+ lg: "h-10 w-10 text-base"
980
+ }
981
+ },
982
+ defaultVariants: {
983
+ role: "user",
984
+ size: "md"
985
+ }
986
+ }
987
+ );
988
+ function MessageAvatar({
989
+ role,
990
+ size,
991
+ userName,
992
+ className
993
+ }) {
994
+ const getInitials = (name) => {
995
+ if (!name) return "?";
996
+ return name.split(" ").map((n) => n[0]).join("").substring(0, 2).toUpperCase();
997
+ };
998
+ return /* @__PURE__ */ jsxRuntime.jsx(
999
+ "div",
1000
+ {
1001
+ "data-slot": "ai-message-avatar",
1002
+ className: chunkOR5DRJCW_cjs.cn(avatarVariants({ role, size }), className),
1003
+ children: role === "assistant" ? /* @__PURE__ */ jsxRuntime.jsx(SparklesIcon, { size: "md" }) : role === "user" ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-medium", children: getInitials(userName) }) : role === "system" ? /* @__PURE__ */ jsxRuntime.jsx(
1004
+ "svg",
1005
+ {
1006
+ "aria-hidden": "true",
1007
+ className: "h-4 w-4",
1008
+ fill: "none",
1009
+ viewBox: "0 0 24 24",
1010
+ stroke: "currentColor",
1011
+ strokeWidth: "1.5",
1012
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1013
+ "path",
1014
+ {
1015
+ strokeLinecap: "round",
1016
+ strokeLinejoin: "round",
1017
+ d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"
1018
+ }
1019
+ )
1020
+ }
1021
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
1022
+ "svg",
1023
+ {
1024
+ "aria-hidden": "true",
1025
+ className: "h-4 w-4",
1026
+ fill: "none",
1027
+ viewBox: "0 0 24 24",
1028
+ stroke: "currentColor",
1029
+ strokeWidth: "1.5",
1030
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1031
+ "path",
1032
+ {
1033
+ strokeLinecap: "round",
1034
+ strokeLinejoin: "round",
1035
+ d: "M11.42 15.17L17.25 21A2.652 2.652 0 0021 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 11-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 004.486-6.336l-3.276 3.277a3.004 3.004 0 01-2.25-2.25l3.276-3.276a4.5 4.5 0 00-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437l1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008z"
1036
+ }
1037
+ )
1038
+ }
1039
+ )
1040
+ }
1041
+ );
1042
+ }
1043
+ function AITypingIndicator({ className }) {
1044
+ const dotStyle = {
1045
+ width: "6px",
1046
+ height: "6px",
1047
+ minWidth: "6px",
1048
+ minHeight: "6px",
1049
+ flexShrink: 0
1050
+ };
1051
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1052
+ "div",
1053
+ {
1054
+ "data-slot": "ai-typing-indicator",
1055
+ className: chunkOR5DRJCW_cjs.cn("inline-flex items-center justify-center gap-2", className),
1056
+ children: [
1057
+ /* @__PURE__ */ jsxRuntime.jsx(
1058
+ "span",
1059
+ {
1060
+ className: "rounded-full bg-neutral-500 dark:bg-neutral-400",
1061
+ style: {
1062
+ ...dotStyle,
1063
+ animation: "typing-dot 1.4s infinite ease-in-out both",
1064
+ animationDelay: "-0.32s"
1065
+ }
1066
+ }
1067
+ ),
1068
+ /* @__PURE__ */ jsxRuntime.jsx(
1069
+ "span",
1070
+ {
1071
+ className: "rounded-full bg-neutral-500 dark:bg-neutral-400",
1072
+ style: {
1073
+ ...dotStyle,
1074
+ animation: "typing-dot 1.4s infinite ease-in-out both",
1075
+ animationDelay: "-0.16s"
1076
+ }
1077
+ }
1078
+ ),
1079
+ /* @__PURE__ */ jsxRuntime.jsx(
1080
+ "span",
1081
+ {
1082
+ className: "rounded-full bg-neutral-500 dark:bg-neutral-400",
1083
+ style: {
1084
+ ...dotStyle,
1085
+ animation: "typing-dot 1.4s infinite ease-in-out both"
1086
+ }
1087
+ }
1088
+ ),
1089
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
1090
+ @keyframes typing-dot {
1091
+ 0%, 80%, 100% { opacity: 0.4; }
1092
+ 40% { opacity: 1; }
1093
+ }
1094
+ ` })
1095
+ ]
1096
+ }
1097
+ );
1098
+ }
1099
+ function ContentBlock({
1100
+ content,
1101
+ onLinkClick,
1102
+ messageId,
1103
+ streaming,
1104
+ role,
1105
+ renderTextContent
1106
+ }) {
1107
+ const [isCollapsed, setIsCollapsed] = React__namespace.useState(
1108
+ content.collapsed ?? false
1109
+ );
1110
+ if (content.type === "text" && content.text) {
1111
+ if (renderTextContent) {
1112
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none", children: renderTextContent(content.text, { messageId, streaming, role }) });
1113
+ }
1114
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm dark:prose-invert max-w-none", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-wrap", children: content.text }) });
1115
+ }
1116
+ if (content.type === "tool_use" && content.toolCall) {
1117
+ return /* @__PURE__ */ jsxRuntime.jsx(
1118
+ MCPToolCallDisplay,
1119
+ {
1120
+ toolCall: content.toolCall,
1121
+ onLinkClick,
1122
+ defaultCollapsed: content.collapsed
1123
+ }
1124
+ );
1125
+ }
1126
+ if (content.type === "thinking" && content.text) {
1127
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1128
+ "div",
1129
+ {
1130
+ "data-slot": "ai-message-thinking",
1131
+ className: "rounded-lg border border-neutral-200 bg-neutral-50 dark:border-neutral-700 dark:bg-neutral-800/50",
1132
+ children: [
1133
+ /* @__PURE__ */ jsxRuntime.jsxs(
1134
+ "button",
1135
+ {
1136
+ onClick: () => setIsCollapsed(!isCollapsed),
1137
+ className: "flex w-full items-center justify-between px-3 py-2 text-left",
1138
+ children: [
1139
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-muted-foreground flex items-center gap-2 text-sm", children: [
1140
+ /* @__PURE__ */ jsxRuntime.jsx(
1141
+ "svg",
1142
+ {
1143
+ "aria-hidden": "true",
1144
+ className: "h-4 w-4",
1145
+ fill: "none",
1146
+ viewBox: "0 0 24 24",
1147
+ stroke: "currentColor",
1148
+ strokeWidth: "1.5",
1149
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1150
+ "path",
1151
+ {
1152
+ strokeLinecap: "round",
1153
+ strokeLinejoin: "round",
1154
+ d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456zM16.894 20.567L16.5 21.75l-.394-1.183a2.25 2.25 0 00-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 001.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 001.423 1.423l1.183.394-1.183.394a2.25 2.25 0 00-1.423 1.423z"
1155
+ }
1156
+ )
1157
+ }
1158
+ ),
1159
+ "Thinking..."
1160
+ ] }),
1161
+ /* @__PURE__ */ jsxRuntime.jsx(
1162
+ ChevronIcon,
1163
+ {
1164
+ direction: isCollapsed ? "right" : "down",
1165
+ className: "text-neutral-400"
1166
+ }
1167
+ )
1168
+ ]
1169
+ }
1170
+ ),
1171
+ !isCollapsed && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-neutral-200 px-3 py-2 dark:border-neutral-700", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-neutral-600 italic dark:text-neutral-400", children: content.text }) })
1172
+ ]
1173
+ }
1174
+ );
1175
+ }
1176
+ if (content.type === "code" && content.text) {
1177
+ return /* @__PURE__ */ jsxRuntime.jsx(
1178
+ "pre",
1179
+ {
1180
+ "data-slot": "ai-message-code",
1181
+ className: "rounded-lg bg-neutral-900 p-3 text-sm dark:bg-neutral-950",
1182
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1183
+ "code",
1184
+ {
1185
+ className: content.language ? `language-${content.language}` : "",
1186
+ children: content.text
1187
+ }
1188
+ )
1189
+ }
1190
+ );
1191
+ }
1192
+ if (content.type === "image" && content.imageUrl) {
1193
+ const safeHref = /^\s*javascript:/i.test(content.imageUrl) ? void 0 : content.imageUrl;
1194
+ return /* @__PURE__ */ jsxRuntime.jsx(
1195
+ "a",
1196
+ {
1197
+ href: safeHref,
1198
+ target: "_blank",
1199
+ rel: "noopener noreferrer",
1200
+ className: "block w-fit transition-transform hover:scale-[1.02]",
1201
+ "aria-label": `View ${content.name || "Uploaded image"}`,
1202
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1203
+ "img",
1204
+ {
1205
+ src: content.imageUrl,
1206
+ alt: content.name || "Uploaded image",
1207
+ loading: "lazy",
1208
+ className: "my-1 max-h-64 w-auto rounded-lg object-cover"
1209
+ }
1210
+ )
1211
+ }
1212
+ );
1213
+ }
1214
+ if (content.type === "file") {
1215
+ const sizeLabel = typeof content.fileSize === "number" ? formatFileSize(content.fileSize) : void 0;
1216
+ const card = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-1 flex items-center gap-3 rounded-lg bg-neutral-100 p-3 transition-colors dark:bg-neutral-800", children: [
1217
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg bg-neutral-200 p-2 dark:bg-neutral-700", children: /* @__PURE__ */ jsxRuntime.jsx(
1218
+ "svg",
1219
+ {
1220
+ "aria-hidden": "true",
1221
+ className: "h-6 w-6",
1222
+ fill: "none",
1223
+ viewBox: "0 0 24 24",
1224
+ stroke: "currentColor",
1225
+ strokeWidth: 2,
1226
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1227
+ "path",
1228
+ {
1229
+ strokeLinecap: "round",
1230
+ strokeLinejoin: "round",
1231
+ d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
1232
+ }
1233
+ )
1234
+ }
1235
+ ) }),
1236
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
1237
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "truncate text-sm font-medium", children: content.name || "Document" }),
1238
+ sizeLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs opacity-70", children: sizeLabel })
1239
+ ] })
1240
+ ] });
1241
+ if (content.fileUrl) {
1242
+ const safeFileHref = /^\s*javascript:/i.test(content.fileUrl) ? void 0 : content.fileUrl;
1243
+ return /* @__PURE__ */ jsxRuntime.jsx(
1244
+ "a",
1245
+ {
1246
+ href: safeFileHref,
1247
+ target: "_blank",
1248
+ rel: "noopener noreferrer",
1249
+ className: "block w-fit no-underline",
1250
+ children: card
1251
+ }
1252
+ );
1253
+ }
1254
+ return card;
1255
+ }
1256
+ return null;
1257
+ }
1258
+ function formatFileSize(bytes) {
1259
+ if (bytes < 1024) return `${bytes} B`;
1260
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
1261
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
1262
+ }
1263
+ var messageVariants = classVarianceAuthority.cva("flex gap-3", {
1264
+ variants: {
1265
+ role: {
1266
+ user: "flex-row-reverse",
1267
+ assistant: "flex-row",
1268
+ system: "flex-row justify-center",
1269
+ tool: "flex-row"
1270
+ }
1271
+ },
1272
+ defaultVariants: {
1273
+ role: "assistant"
1274
+ }
1275
+ });
1276
+ var bubbleVariants = classVarianceAuthority.cva("rounded-2xl px-4 py-2.5 w-fit max-w-[85%]", {
1277
+ variants: {
1278
+ variant: {
1279
+ user: "bg-primary-800 text-white dark:bg-primary-800",
1280
+ assistant: "bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-white",
1281
+ system: "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400 text-center text-sm max-w-[95%]",
1282
+ tool: "bg-transparent p-0 max-w-full w-full"
1283
+ }
1284
+ },
1285
+ defaultVariants: {
1286
+ variant: "assistant"
1287
+ }
1288
+ });
1289
+ var ChatBubble = React__namespace.forwardRef(
1290
+ ({ className, variant, hasError, accent, style, children, ...props }, ref) => {
1291
+ return /* @__PURE__ */ jsxRuntime.jsx(
1292
+ "div",
1293
+ {
1294
+ ref,
1295
+ "data-slot": "chat-bubble",
1296
+ className: chunkOR5DRJCW_cjs.cn(
1297
+ bubbleVariants({ variant }),
1298
+ hasError && "border border-red-300 dark:border-red-700",
1299
+ className
1300
+ ),
1301
+ style: accent ? { borderLeft: `3px solid ${accent}`, ...style } : style,
1302
+ ...props,
1303
+ children
1304
+ }
1305
+ );
1306
+ }
1307
+ );
1308
+ ChatBubble.displayName = "ChatBubble";
1309
+ function AIMessageDisplay({
1310
+ message,
1311
+ userName,
1312
+ showAvatar = true,
1313
+ showTimestamp = false,
1314
+ onLinkClick,
1315
+ renderTextContent,
1316
+ className
1317
+ }) {
1318
+ const isStreaming = message.status === "streaming";
1319
+ const hasContent = message.content.length > 0;
1320
+ const formatTime = (timestamp) => {
1321
+ const date = new Date(timestamp);
1322
+ return date.toLocaleTimeString(void 0, {
1323
+ hour: "numeric",
1324
+ minute: "2-digit"
1325
+ });
1326
+ };
1327
+ if (message.role === "tool") {
1328
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1329
+ "div",
1330
+ {
1331
+ "data-slot": "ai-message",
1332
+ className: chunkOR5DRJCW_cjs.cn(messageVariants({ role: message.role }), className),
1333
+ children: [
1334
+ showAvatar && /* @__PURE__ */ jsxRuntime.jsx(MessageAvatar, { role: message.role }),
1335
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 space-y-2", children: message.content.map((content, index) => /* @__PURE__ */ jsxRuntime.jsx(
1336
+ ContentBlock,
1337
+ {
1338
+ content,
1339
+ onLinkClick,
1340
+ messageId: message.id,
1341
+ streaming: isStreaming,
1342
+ role: message.role,
1343
+ renderTextContent
1344
+ },
1345
+ index
1346
+ )) })
1347
+ ]
1348
+ }
1349
+ );
1350
+ }
1351
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1352
+ "div",
1353
+ {
1354
+ "data-slot": "ai-message",
1355
+ className: chunkOR5DRJCW_cjs.cn(messageVariants({ role: message.role }), className),
1356
+ children: [
1357
+ showAvatar && message.role !== "system" && /* @__PURE__ */ jsxRuntime.jsx(MessageAvatar, { role: message.role, userName }),
1358
+ /* @__PURE__ */ jsxRuntime.jsxs(
1359
+ "div",
1360
+ {
1361
+ className: chunkOR5DRJCW_cjs.cn(
1362
+ "flex min-w-0 flex-1 flex-col gap-1",
1363
+ message.role === "user" && "items-end"
1364
+ ),
1365
+ children: [
1366
+ /* @__PURE__ */ jsxRuntime.jsx(
1367
+ ChatBubble,
1368
+ {
1369
+ "data-slot": "ai-message-bubble",
1370
+ variant: message.role,
1371
+ hasError: message.status === "error",
1372
+ children: hasContent ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-3", children: message.content.map((content, index) => /* @__PURE__ */ jsxRuntime.jsx(
1373
+ ContentBlock,
1374
+ {
1375
+ content,
1376
+ onLinkClick,
1377
+ messageId: message.id,
1378
+ streaming: isStreaming,
1379
+ role: message.role,
1380
+ renderTextContent
1381
+ },
1382
+ index
1383
+ )) }) : isStreaming ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(AITypingIndicator, {}) }) : null
1384
+ }
1385
+ ),
1386
+ showTimestamp && /* @__PURE__ */ jsxRuntime.jsx(
1387
+ "span",
1388
+ {
1389
+ "data-slot": "ai-message-timestamp",
1390
+ className: "px-2 text-xs text-neutral-500",
1391
+ children: formatTime(message.timestamp)
1392
+ }
1393
+ ),
1394
+ message.status === "error" && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-2 text-xs text-red-500", children: message.role === "user" ? "Failed to send" : "An error occurred" })
1395
+ ]
1396
+ }
1397
+ )
1398
+ ]
1399
+ }
1400
+ );
1401
+ }
1402
+
1403
+ exports.AILogoIcon = AILogoIcon;
1404
+ exports.AIMessageDisplay = AIMessageDisplay;
1405
+ exports.AITypingIndicator = AITypingIndicator;
1406
+ exports.ChatBubble = ChatBubble;
1407
+ exports.ChevronIcon = ChevronIcon;
1408
+ exports.CloseIcon = CloseIcon;
1409
+ exports.MCPToolCallDisplay = MCPToolCallDisplay;
1410
+ exports.MessageAvatar = MessageAvatar;
1411
+ exports.RefreshIcon = RefreshIcon;
1412
+ exports.ResourceLink = ResourceLink;
1413
+ exports.SendIcon = SendIcon;
1414
+ exports.SparklesIcon = SparklesIcon;
1415
+ exports.SpinnerIcon = SpinnerIcon;
1416
+ exports.ToolStatusIcon = ToolStatusIcon;
1417
+ exports.getToolIcon = getToolIcon;
1418
+ //# sourceMappingURL=chunk-PM2I3QKM.cjs.map
1419
+ //# sourceMappingURL=chunk-PM2I3QKM.cjs.map