@octaviaflow/core 3.1.0-beta.115 → 3.1.0-beta.117

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 (92) hide show
  1. package/dist/chunk-23K2RF7Z.js +2694 -0
  2. package/dist/chunk-23K2RF7Z.js.map +1 -0
  3. package/dist/chunk-H3FCGN4P.js +6628 -0
  4. package/dist/chunk-H3FCGN4P.js.map +1 -0
  5. package/dist/chunk-ISJSOF3Z.js +3646 -0
  6. package/dist/chunk-ISJSOF3Z.js.map +1 -0
  7. package/dist/chunk-KSIZ7DLS.js +3582 -0
  8. package/dist/chunk-KSIZ7DLS.js.map +1 -0
  9. package/dist/chunk-NAG3EFQ6.js +6789 -0
  10. package/dist/chunk-NAG3EFQ6.js.map +1 -0
  11. package/dist/chunk-NMZWNZV7.js +1547 -0
  12. package/dist/chunk-NMZWNZV7.js.map +1 -0
  13. package/dist/chunk-QWOH2E3F.js +3189 -0
  14. package/dist/chunk-QWOH2E3F.js.map +1 -0
  15. package/dist/chunk-V22HCPVO.js +2856 -0
  16. package/dist/chunk-V22HCPVO.js.map +1 -0
  17. package/dist/chunk-VGAUSBP4.js +3181 -0
  18. package/dist/chunk-VGAUSBP4.js.map +1 -0
  19. package/dist/chunk-WTIM6E4X.js +3677 -0
  20. package/dist/chunk-WTIM6E4X.js.map +1 -0
  21. package/dist/chunk-XUBJHPJT.js +3680 -0
  22. package/dist/chunk-XUBJHPJT.js.map +1 -0
  23. package/dist/components/AgentCard/AgentCard.d.ts.map +1 -1
  24. package/dist/components/AssistantAura/AssistantAura.d.ts +21 -0
  25. package/dist/components/AssistantAura/AssistantAura.d.ts.map +1 -0
  26. package/dist/components/AssistantAura/index.d.ts +2 -0
  27. package/dist/components/AssistantAura/index.d.ts.map +1 -0
  28. package/dist/components/AssistantConversation/AssistantConversation.d.ts +112 -0
  29. package/dist/components/AssistantConversation/AssistantConversation.d.ts.map +1 -0
  30. package/dist/components/AssistantConversation/assistant.fixtures.d.ts +29 -0
  31. package/dist/components/AssistantConversation/assistant.fixtures.d.ts.map +1 -0
  32. package/dist/components/AssistantConversation/assistantGlyphs.d.ts +13 -0
  33. package/dist/components/AssistantConversation/assistantGlyphs.d.ts.map +1 -0
  34. package/dist/components/AssistantConversation/index.d.ts +2 -0
  35. package/dist/components/AssistantConversation/index.d.ts.map +1 -0
  36. package/dist/components/AssistantDock/AssistantDock.d.ts +25 -0
  37. package/dist/components/AssistantDock/AssistantDock.d.ts.map +1 -0
  38. package/dist/components/AssistantDock/index.d.ts +2 -0
  39. package/dist/components/AssistantDock/index.d.ts.map +1 -0
  40. package/dist/components/AssistantOrb/AssistantOrb.d.ts +14 -0
  41. package/dist/components/AssistantOrb/AssistantOrb.d.ts.map +1 -0
  42. package/dist/components/AssistantOrb/explorations/OvaIconConcepts.d.ts +22 -0
  43. package/dist/components/AssistantOrb/explorations/OvaIconConcepts.d.ts.map +1 -0
  44. package/dist/components/AssistantOrb/index.d.ts +2 -0
  45. package/dist/components/AssistantOrb/index.d.ts.map +1 -0
  46. package/dist/components/AssistantTrigger/AssistantTrigger.d.ts +17 -0
  47. package/dist/components/AssistantTrigger/AssistantTrigger.d.ts.map +1 -0
  48. package/dist/components/AssistantTrigger/index.d.ts +2 -0
  49. package/dist/components/AssistantTrigger/index.d.ts.map +1 -0
  50. package/dist/components/ChatComposer/ChatComposer.d.ts +8 -0
  51. package/dist/components/ChatComposer/ChatComposer.d.ts.map +1 -1
  52. package/dist/components/ChatDocPreview/ChatDocPreview.d.ts +20 -0
  53. package/dist/components/ChatDocPreview/ChatDocPreview.d.ts.map +1 -0
  54. package/dist/components/ChatDocPreview/index.d.ts +2 -0
  55. package/dist/components/ChatDocPreview/index.d.ts.map +1 -0
  56. package/dist/components/ChatInputRequest/ChatInputRequest.d.ts +68 -0
  57. package/dist/components/ChatInputRequest/ChatInputRequest.d.ts.map +1 -0
  58. package/dist/components/ChatInputRequest/index.d.ts +2 -0
  59. package/dist/components/ChatInputRequest/index.d.ts.map +1 -0
  60. package/dist/components/ChatLinkPreview/ChatLinkPreview.d.ts +33 -0
  61. package/dist/components/ChatLinkPreview/ChatLinkPreview.d.ts.map +1 -0
  62. package/dist/components/ChatLinkPreview/index.d.ts +2 -0
  63. package/dist/components/ChatLinkPreview/index.d.ts.map +1 -0
  64. package/dist/components/ChatSources/ChatSources.d.ts +10 -1
  65. package/dist/components/ChatSources/ChatSources.d.ts.map +1 -1
  66. package/dist/components/ChatSources/index.d.ts +1 -1
  67. package/dist/components/ChatSources/index.d.ts.map +1 -1
  68. package/dist/components/ChatVideoPreview/ChatVideoPreview.d.ts +37 -0
  69. package/dist/components/ChatVideoPreview/ChatVideoPreview.d.ts.map +1 -0
  70. package/dist/components/ChatVideoPreview/index.d.ts +2 -0
  71. package/dist/components/ChatVideoPreview/index.d.ts.map +1 -0
  72. package/dist/components/TruncatedText/TruncatedText.d.ts +15 -0
  73. package/dist/components/TruncatedText/TruncatedText.d.ts.map +1 -0
  74. package/dist/components/TruncatedText/index.d.ts +2 -0
  75. package/dist/components/TruncatedText/index.d.ts.map +1 -0
  76. package/dist/index.cjs +7716 -6548
  77. package/dist/index.cjs.map +1 -1
  78. package/dist/index.d.ts +10 -1
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +4742 -5654
  81. package/dist/index.js.map +1 -1
  82. package/dist/marketing/components/AssistantWidget/AssistantWidget.d.ts +60 -0
  83. package/dist/marketing/components/AssistantWidget/AssistantWidget.d.ts.map +1 -0
  84. package/dist/marketing/index.d.ts +1 -0
  85. package/dist/marketing/index.d.ts.map +1 -1
  86. package/dist/marketing.cjs +3710 -1196
  87. package/dist/marketing.cjs.map +1 -1
  88. package/dist/marketing.js +738 -482
  89. package/dist/marketing.js.map +1 -1
  90. package/dist/styles.css +1 -1
  91. package/dist/workflow.js +2 -2
  92. package/package.json +1 -1
@@ -0,0 +1,3181 @@
1
+ import {
2
+ $384704861d32dbed$export$bca9d026f8e704eb,
3
+ Button,
4
+ Checkbox,
5
+ Input,
6
+ Slot,
7
+ Spinner,
8
+ Tooltip,
9
+ resolveAccessibleName
10
+ } from "./chunk-V22HCPVO.js";
11
+ import {
12
+ cn
13
+ } from "./chunk-ZAUUGK2Y.js";
14
+
15
+ // src/components/Card/Card.tsx
16
+ import { motion, useReducedMotion } from "framer-motion";
17
+ import {
18
+ forwardRef
19
+ } from "react";
20
+ import { jsx } from "react/jsx-runtime";
21
+ var Card = forwardRef(function Card2({
22
+ variant = "default",
23
+ padding = "md",
24
+ radius = "md",
25
+ hoverable = false,
26
+ disabled = false,
27
+ loading = false,
28
+ asChild = false,
29
+ onClick,
30
+ onKeyDown,
31
+ className,
32
+ children,
33
+ ...rest
34
+ }, ref) {
35
+ const reducedMotion = useReducedMotion();
36
+ const isInteractive = Boolean(onClick) && !disabled && !loading;
37
+ const handleKeyDown = (e) => {
38
+ onKeyDown?.(e);
39
+ if (e.defaultPrevented) return;
40
+ if (!isInteractive) return;
41
+ if ((e.key === "Enter" || e.key === " ") && !e.repeat) {
42
+ e.preventDefault();
43
+ onClick?.(e);
44
+ }
45
+ };
46
+ const rootClassName = cn(
47
+ "ods-card",
48
+ `ods-card--${variant}`,
49
+ `ods-card--pad-${padding}`,
50
+ `ods-card--radius-${radius}`,
51
+ (hoverable || isInteractive) && !loading && !disabled && "ods-card--hoverable",
52
+ isInteractive && "ods-card--clickable",
53
+ disabled && "ods-card--disabled",
54
+ loading && "ods-card--loading",
55
+ className
56
+ );
57
+ if (asChild) {
58
+ return /* @__PURE__ */ jsx(
59
+ Slot,
60
+ {
61
+ ...rest,
62
+ ref,
63
+ className: rootClassName,
64
+ onClick: isInteractive ? onClick : void 0,
65
+ onKeyDown: isInteractive ? handleKeyDown : onKeyDown,
66
+ "aria-disabled": disabled || void 0,
67
+ children
68
+ }
69
+ );
70
+ }
71
+ if (loading) {
72
+ return /* @__PURE__ */ jsx("div", { ...rest, ref, className: rootClassName, "aria-busy": "true", "aria-label": "Loading", children: /* @__PURE__ */ jsx("div", { className: "ods-card__skeleton", "data-ods-animate": "shimmer" }) });
73
+ }
74
+ return /* @__PURE__ */ jsx(
75
+ motion.div,
76
+ {
77
+ ...rest,
78
+ ref,
79
+ onClick: isInteractive ? onClick : void 0,
80
+ onKeyDown: isInteractive ? handleKeyDown : onKeyDown,
81
+ className: rootClassName,
82
+ whileHover: (hoverable || isInteractive) && !reducedMotion ? { y: -2, transition: { duration: 0.15 } } : void 0,
83
+ whileTap: isInteractive && !reducedMotion ? { scale: 0.99 } : void 0,
84
+ role: isInteractive ? "button" : rest.role,
85
+ tabIndex: isInteractive ? rest.tabIndex ?? 0 : rest.tabIndex,
86
+ "aria-disabled": disabled || void 0,
87
+ children
88
+ }
89
+ );
90
+ });
91
+ Card.displayName = "Card";
92
+ var CardHeader = forwardRef(function CardHeader2({ className, children, ...rest }, ref) {
93
+ return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cn("ods-card__header", className), children });
94
+ });
95
+ CardHeader.displayName = "Card.Header";
96
+ var CardBody = forwardRef(function CardBody2({ className, children, ...rest }, ref) {
97
+ return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cn("ods-card__body", className), children });
98
+ });
99
+ CardBody.displayName = "Card.Body";
100
+ var CardFooter = forwardRef(function CardFooter2({ className, children, ...rest }, ref) {
101
+ return /* @__PURE__ */ jsx("div", { ...rest, ref, className: cn("ods-card__footer", className), children });
102
+ });
103
+ CardFooter.displayName = "Card.Footer";
104
+ var CardTitle = forwardRef(function CardTitle2({ as: Comp = "h3", className, children, ...rest }, ref) {
105
+ return /* @__PURE__ */ jsx(
106
+ Comp,
107
+ {
108
+ ...rest,
109
+ ref,
110
+ className: cn("ods-card__title", className),
111
+ children
112
+ }
113
+ );
114
+ });
115
+ CardTitle.displayName = "Card.Title";
116
+ var CardDescription = forwardRef(
117
+ function CardDescription2({ className, children, ...rest }, ref) {
118
+ return /* @__PURE__ */ jsx("p", { ...rest, ref, className: cn("ods-card__description", className), children });
119
+ }
120
+ );
121
+ CardDescription.displayName = "Card.Description";
122
+ Card.Header = CardHeader;
123
+ Card.Body = CardBody;
124
+ Card.Footer = CardFooter;
125
+ Card.Title = CardTitle;
126
+ Card.Description = CardDescription;
127
+
128
+ // src/components/Avatar/Avatar.tsx
129
+ import {
130
+ forwardRef as forwardRef2,
131
+ useCallback,
132
+ useMemo,
133
+ useState
134
+ } from "react";
135
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
136
+ var PALETTE_SIZE = 12;
137
+ function djb2(str) {
138
+ let h = 5381;
139
+ for (let i = 0; i < str.length; i++) h = (h << 5) + h + str.charCodeAt(i);
140
+ return h >>> 0;
141
+ }
142
+ function paletteIndexFor(seed) {
143
+ return djb2(seed) % PALETTE_SIZE;
144
+ }
145
+ var AVATAR_PALETTE_SIZE = PALETTE_SIZE;
146
+ function avatarPaletteIndex(seed) {
147
+ return paletteIndexFor(seed);
148
+ }
149
+ function normalizeInitials(raw) {
150
+ const trimmed = raw.trim();
151
+ if (!trimmed) return "";
152
+ const tokens = trimmed.split(/\s+/).filter(Boolean);
153
+ if (tokens.length >= 2) {
154
+ return (tokens[0].charAt(0) + tokens[1].charAt(0)).toUpperCase();
155
+ }
156
+ return trimmed.slice(0, 2).toUpperCase();
157
+ }
158
+ var STATUS_DEFAULT_LABEL = {
159
+ online: "Online",
160
+ offline: "Offline",
161
+ busy: "Busy",
162
+ away: "Away"
163
+ };
164
+ var Avatar = forwardRef2(function Avatar2({
165
+ src,
166
+ alt,
167
+ initials,
168
+ icon,
169
+ fallback,
170
+ seed,
171
+ palette,
172
+ size = "md",
173
+ shape = "circle",
174
+ status,
175
+ statusLabel,
176
+ onClick,
177
+ imgLoading = "lazy",
178
+ referrerPolicy,
179
+ className,
180
+ ...rest
181
+ }, ref) {
182
+ const [imgFailed, setImgFailed] = useState(false);
183
+ const handleImgError = useCallback(() => setImgFailed(true), []);
184
+ const showImage = Boolean(src) && !imgFailed;
185
+ const normalizedInitials = useMemo(
186
+ () => initials ? normalizeInitials(initials) : "",
187
+ [initials]
188
+ );
189
+ const paletteIdx = useMemo(() => {
190
+ if (palette !== void 0) {
191
+ return (Math.trunc(palette) % PALETTE_SIZE + PALETTE_SIZE) % PALETTE_SIZE;
192
+ }
193
+ const resolved = seed ?? alt ?? initials ?? "?";
194
+ return paletteIndexFor(resolved);
195
+ }, [palette, seed, alt, initials]);
196
+ const baseName = alt || normalizedInitials || "Avatar";
197
+ const announcedStatus = status ? statusLabel ?? STATUS_DEFAULT_LABEL[status] : "";
198
+ const accessibleName = announcedStatus ? `${baseName}, ${announcedStatus}` : baseName;
199
+ const isClickable = Boolean(onClick);
200
+ const handleKeyDown = (e) => {
201
+ if (!isClickable) return;
202
+ if ((e.key === "Enter" || e.key === " ") && !e.repeat) {
203
+ e.preventDefault();
204
+ onClick?.();
205
+ }
206
+ };
207
+ const rootClassName = cn(
208
+ "ods-avatar",
209
+ `ods-avatar--${size}`,
210
+ `ods-avatar--${shape}`,
211
+ isClickable && "ods-avatar--clickable",
212
+ className
213
+ );
214
+ return /* @__PURE__ */ jsxs(
215
+ "div",
216
+ {
217
+ ...rest,
218
+ ref,
219
+ className: rootClassName,
220
+ role: isClickable ? "button" : "img",
221
+ "aria-label": accessibleName,
222
+ tabIndex: isClickable ? 0 : void 0,
223
+ onClick,
224
+ onKeyDown: isClickable ? handleKeyDown : void 0,
225
+ "data-status": status,
226
+ children: [
227
+ /* @__PURE__ */ jsx2("span", { className: "ods-avatar__inner", "data-palette": paletteIdx, children: showImage ? /* @__PURE__ */ jsx2(
228
+ "img",
229
+ {
230
+ src,
231
+ alt: "",
232
+ className: "ods-avatar__image",
233
+ loading: imgLoading,
234
+ decoding: "async",
235
+ referrerPolicy,
236
+ onError: handleImgError,
237
+ draggable: false
238
+ }
239
+ ) : icon ? /* @__PURE__ */ jsx2("span", { className: "ods-avatar__icon", "aria-hidden": "true", children: icon }) : normalizedInitials ? /* @__PURE__ */ jsx2("span", { className: "ods-avatar__initials", "aria-hidden": "true", children: normalizedInitials }) : /* @__PURE__ */ jsx2("span", { className: "ods-avatar__initials", "aria-hidden": "true", children: fallback ?? "?" }) }),
240
+ status && // Decorative — the textual status is folded into the wrapper's
241
+ // aria-label above. `aria-hidden` keeps AT from double-announcing.
242
+ /* @__PURE__ */ jsx2(
243
+ "span",
244
+ {
245
+ className: cn("ods-avatar__status", `ods-avatar__status--${status}`),
246
+ "aria-hidden": "true"
247
+ }
248
+ )
249
+ ]
250
+ }
251
+ );
252
+ });
253
+ Avatar.displayName = "Avatar";
254
+ var AvatarStack = forwardRef2(function AvatarStack2({ children, max, size = "md", renderOverflow, direction = "ltr", className, ...rest }, ref) {
255
+ const arr = Array.isArray(children) ? children : [children];
256
+ const visible = max && arr.length > max ? arr.slice(0, max) : arr;
257
+ const overflow = max && arr.length > max ? arr.length - max : 0;
258
+ return /* @__PURE__ */ jsxs(
259
+ "div",
260
+ {
261
+ ...rest,
262
+ ref,
263
+ className: cn("ods-avatar-stack", `ods-avatar-stack--${direction}`, className),
264
+ children: [
265
+ visible,
266
+ overflow > 0 && (renderOverflow ? renderOverflow(overflow) : /* @__PURE__ */ jsx2(
267
+ "div",
268
+ {
269
+ className: cn(
270
+ "ods-avatar",
271
+ `ods-avatar--${size}`,
272
+ "ods-avatar--circle",
273
+ "ods-avatar-stack__overflow"
274
+ ),
275
+ role: "img",
276
+ "aria-label": `${overflow} more`,
277
+ children: /* @__PURE__ */ jsx2("span", { className: "ods-avatar__inner", children: /* @__PURE__ */ jsxs("span", { className: "ods-avatar__initials", "aria-hidden": "true", children: [
278
+ "+",
279
+ overflow
280
+ ] }) })
281
+ }
282
+ ))
283
+ ]
284
+ }
285
+ );
286
+ });
287
+ AvatarStack.displayName = "AvatarStack";
288
+
289
+ // src/components/BlogCard/BlogCard.tsx
290
+ import { forwardRef as forwardRef3, useId } from "react";
291
+ import { Fragment, jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
292
+ var BlogCard = forwardRef3(function BlogCard2({
293
+ cover,
294
+ coverAspect = "16/9",
295
+ category,
296
+ tags,
297
+ meta,
298
+ readingTime,
299
+ title,
300
+ titleAs = "h3",
301
+ description,
302
+ author,
303
+ footer,
304
+ radius = "md",
305
+ orientation = "vertical",
306
+ href,
307
+ onClick,
308
+ id: providedId,
309
+ className,
310
+ ...rest
311
+ }, ref) {
312
+ const reactId = useId();
313
+ const baseId = providedId ?? `ods-blog-card-${reactId}`;
314
+ const titleId = `${baseId}-title`;
315
+ const descId = description ? `${baseId}-desc` : void 0;
316
+ const tagList = tags ?? (category ? [category] : []);
317
+ const body = /* @__PURE__ */ jsxs2(Fragment, { children: [
318
+ cover && /* @__PURE__ */ jsx3(
319
+ "div",
320
+ {
321
+ className: cn(
322
+ "ods-blog-card__cover",
323
+ `ods-blog-card__cover--aspect-${coverAspect.replace("/", "-")}`
324
+ ),
325
+ "aria-hidden": "true",
326
+ children: cover
327
+ }
328
+ ),
329
+ /* @__PURE__ */ jsxs2("div", { className: "ods-blog-card__body", children: [
330
+ (tagList.length > 0 || meta || readingTime) && /* @__PURE__ */ jsxs2("div", { className: "ods-blog-card__meta", children: [
331
+ tagList.length > 0 && /* @__PURE__ */ jsx3("span", { className: "ods-blog-card__tags", children: tagList.map((t, i) => /* @__PURE__ */ jsx3("span", { className: "ods-blog-card__tag", children: t }, i)) }),
332
+ meta && /* @__PURE__ */ jsx3("span", { className: "ods-blog-card__date", children: meta }),
333
+ readingTime && /* @__PURE__ */ jsx3("span", { className: "ods-blog-card__reading", children: readingTime })
334
+ ] }),
335
+ /* @__PURE__ */ jsx3(Card.Title, { as: titleAs, id: titleId, className: "ods-blog-card__title", children: title }),
336
+ description && /* @__PURE__ */ jsx3(Card.Description, { id: descId, className: "ods-blog-card__desc", children: description }),
337
+ (author || footer) && /* @__PURE__ */ jsxs2("div", { className: "ods-blog-card__footer", children: [
338
+ author && /* @__PURE__ */ jsxs2("div", { className: "ods-blog-card__author", children: [
339
+ author.avatar && /* @__PURE__ */ jsx3(
340
+ Avatar,
341
+ {
342
+ size: "sm",
343
+ src: author.avatar.src,
344
+ initials: author.avatar.initials,
345
+ seed: author.avatar.seed,
346
+ palette: author.avatar.palette,
347
+ alt: author.avatar.alt ?? (typeof author.name === "string" ? author.name : void 0)
348
+ }
349
+ ),
350
+ /* @__PURE__ */ jsxs2("div", { className: "ods-blog-card__author-text", children: [
351
+ /* @__PURE__ */ jsx3("span", { className: "ods-blog-card__author-name", children: author.name }),
352
+ author.byline && /* @__PURE__ */ jsx3("span", { className: "ods-blog-card__author-byline", children: author.byline })
353
+ ] })
354
+ ] }),
355
+ footer && /* @__PURE__ */ jsx3("div", { className: "ods-blog-card__action", children: footer })
356
+ ] })
357
+ ] })
358
+ ] });
359
+ if (href) {
360
+ return /* @__PURE__ */ jsx3(
361
+ Card,
362
+ {
363
+ asChild: true,
364
+ radius,
365
+ padding: "none",
366
+ className: cn(
367
+ "ods-blog-card",
368
+ `ods-blog-card--${orientation}`,
369
+ "ods-blog-card--interactive",
370
+ className
371
+ ),
372
+ "aria-labelledby": titleId,
373
+ "aria-describedby": descId,
374
+ children: /* @__PURE__ */ jsx3(
375
+ "a",
376
+ {
377
+ ...rest,
378
+ ref,
379
+ href,
380
+ id: baseId,
381
+ onClick,
382
+ children: body
383
+ }
384
+ )
385
+ }
386
+ );
387
+ }
388
+ return /* @__PURE__ */ jsx3(
389
+ Card,
390
+ {
391
+ ...rest,
392
+ ref,
393
+ id: baseId,
394
+ radius,
395
+ padding: "none",
396
+ onClick,
397
+ className: cn(
398
+ "ods-blog-card",
399
+ `ods-blog-card--${orientation}`,
400
+ onClick && "ods-blog-card--interactive",
401
+ className
402
+ ),
403
+ "aria-labelledby": titleId,
404
+ "aria-describedby": descId,
405
+ children: body
406
+ }
407
+ );
408
+ });
409
+ BlogCard.displayName = "BlogCard";
410
+
411
+ // src/components/ChatBubble/ChatBubble.tsx
412
+ import {
413
+ forwardRef as forwardRef4
414
+ } from "react";
415
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
416
+ var STATUS_LABEL = {
417
+ sent: "Sent",
418
+ delivered: "Delivered",
419
+ read: "Read",
420
+ failed: "Failed to send"
421
+ };
422
+ function StatusGlyph({ status }) {
423
+ switch (status) {
424
+ case "sent":
425
+ return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 10 10", width: "10", height: "10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx4(
426
+ "path",
427
+ {
428
+ d: "M2 5l2 2 4-4",
429
+ stroke: "currentColor",
430
+ strokeWidth: "1.4",
431
+ strokeLinecap: "round",
432
+ strokeLinejoin: "round"
433
+ }
434
+ ) });
435
+ case "delivered":
436
+ return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 12 10", width: "12", height: "10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx4(
437
+ "path",
438
+ {
439
+ d: "M1 5l2 2 3.5-3.5 M5 5l2 2 4-4",
440
+ stroke: "currentColor",
441
+ strokeWidth: "1.4",
442
+ strokeLinecap: "round",
443
+ strokeLinejoin: "round"
444
+ }
445
+ ) });
446
+ case "read":
447
+ return /* @__PURE__ */ jsx4("svg", { viewBox: "0 0 12 10", width: "12", height: "10", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx4(
448
+ "path",
449
+ {
450
+ d: "M1 5l2 2 3.5-3.5 M5 5l2 2 4-4",
451
+ stroke: "currentColor",
452
+ strokeWidth: "1.4",
453
+ strokeLinecap: "round",
454
+ strokeLinejoin: "round"
455
+ }
456
+ ) });
457
+ case "failed":
458
+ return /* @__PURE__ */ jsxs3("svg", { viewBox: "0 0 10 10", width: "10", height: "10", fill: "none", "aria-hidden": "true", children: [
459
+ /* @__PURE__ */ jsx4("circle", { cx: "5", cy: "5", r: "4", stroke: "currentColor", strokeWidth: "1.4" }),
460
+ /* @__PURE__ */ jsx4("path", { d: "M5 3v3M5 6.8v.2", stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round" })
461
+ ] });
462
+ }
463
+ }
464
+ var ChatBubble = forwardRef4(function ChatBubble2({
465
+ variant = "bot",
466
+ size = "md",
467
+ author,
468
+ timestamp,
469
+ avatar,
470
+ initial,
471
+ hideAvatar = false,
472
+ continuation = false,
473
+ metaPlacement = "bottom",
474
+ isTyping = false,
475
+ status,
476
+ actions,
477
+ attachments,
478
+ asChild = false,
479
+ className,
480
+ children,
481
+ ...rest
482
+ }, ref) {
483
+ const isUser = variant === "user";
484
+ const reserveAvatar = hideAvatar || continuation;
485
+ const rootClassName = cn(
486
+ "ods-chat",
487
+ `ods-chat--${variant}`,
488
+ `ods-chat--${size}`,
489
+ isTyping && "ods-chat--typing",
490
+ continuation && "ods-chat--continuation",
491
+ status === "failed" && "ods-chat--failed",
492
+ className
493
+ );
494
+ if (asChild) {
495
+ return /* @__PURE__ */ jsx4(
496
+ Slot,
497
+ {
498
+ ...rest,
499
+ ref,
500
+ className: rootClassName,
501
+ children
502
+ }
503
+ );
504
+ }
505
+ let resolvedAvatar;
506
+ if (avatar !== void 0) {
507
+ resolvedAvatar = avatar;
508
+ } else {
509
+ const resolvedInitial = initial ?? (typeof author === "string" ? author : isUser ? "You" : variant === "system" ? "System" : "AI");
510
+ resolvedAvatar = /* @__PURE__ */ jsx4(
511
+ Avatar,
512
+ {
513
+ initials: resolvedInitial,
514
+ alt: typeof author === "string" ? author : variant,
515
+ seed: typeof author === "string" ? author : variant,
516
+ size: size === "sm" ? "sm" : size === "lg" ? "lg" : "md"
517
+ }
518
+ );
519
+ }
520
+ const metaEl = author || timestamp || status ? /* @__PURE__ */ jsxs3("div", { className: "ods-chat__meta", children: [
521
+ author && /* @__PURE__ */ jsx4("span", { className: "ods-chat__author", children: author }),
522
+ timestamp && /* @__PURE__ */ jsx4("span", { className: "ods-chat__time", children: timestamp }),
523
+ status && /* @__PURE__ */ jsx4(
524
+ "span",
525
+ {
526
+ className: cn("ods-chat__status", `ods-chat__status--${status}`),
527
+ role: "img",
528
+ "aria-label": STATUS_LABEL[status],
529
+ children: /* @__PURE__ */ jsx4(StatusGlyph, { status })
530
+ }
531
+ )
532
+ ] }) : null;
533
+ return /* @__PURE__ */ jsxs3("div", { ...rest, ref, className: rootClassName, children: [
534
+ /* @__PURE__ */ jsx4(
535
+ "div",
536
+ {
537
+ className: cn("ods-chat__avatar-slot", reserveAvatar && "ods-chat__avatar-slot--hidden"),
538
+ "aria-hidden": reserveAvatar || void 0,
539
+ children: resolvedAvatar
540
+ }
541
+ ),
542
+ /* @__PURE__ */ jsxs3("div", { className: "ods-chat__column", children: [
543
+ metaPlacement === "top" && metaEl,
544
+ /* @__PURE__ */ jsxs3(
545
+ "div",
546
+ {
547
+ className: "ods-chat__bubble",
548
+ role: isTyping ? "status" : void 0,
549
+ "aria-live": isTyping ? "polite" : void 0,
550
+ children: [
551
+ isTyping ? (
552
+ // role="img" gives the dots cluster an accessible name without
553
+ // tripping axe's "aria-label on a non-roleful span" rule. The
554
+ // outer bubble already carries role="status" + aria-live, so
555
+ // AT users hear "Typing" the moment the indicator appears.
556
+ /* @__PURE__ */ jsxs3("span", { className: "ods-chat__typing", role: "img", "aria-label": "Typing", children: [
557
+ /* @__PURE__ */ jsx4("span", { className: "ods-chat__typing-dot" }),
558
+ /* @__PURE__ */ jsx4("span", { className: "ods-chat__typing-dot" }),
559
+ /* @__PURE__ */ jsx4("span", { className: "ods-chat__typing-dot" })
560
+ ] })
561
+ ) : /* @__PURE__ */ jsx4("div", { className: "ods-chat__body", children }),
562
+ !isTyping && attachments && /* @__PURE__ */ jsx4("div", { className: "ods-chat__attachments", children: attachments })
563
+ ]
564
+ }
565
+ ),
566
+ metaPlacement === "bottom" && metaEl,
567
+ actions && /* @__PURE__ */ jsx4("div", { className: "ods-chat__actions", children: actions })
568
+ ] })
569
+ ] });
570
+ });
571
+ ChatBubble.displayName = "ChatBubble";
572
+
573
+ // src/components/ChatComposer/ChatComposer.tsx
574
+ import {
575
+ forwardRef as forwardRef5,
576
+ useEffect,
577
+ useId as useId2,
578
+ useRef,
579
+ useState as useState2
580
+ } from "react";
581
+ import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
582
+ function SendGlyph() {
583
+ return /* @__PURE__ */ jsx5("svg", { viewBox: "0 0 16 16", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx5(
584
+ "path",
585
+ {
586
+ d: "M14.5 1.5 7 9M14.5 1.5l-4.6 13-2.9-5.5L1.5 6.1l13-4.6Z",
587
+ stroke: "currentColor",
588
+ strokeWidth: "1.3",
589
+ strokeLinecap: "round",
590
+ strokeLinejoin: "round"
591
+ }
592
+ ) });
593
+ }
594
+ function SpinnerGlyph() {
595
+ return /* @__PURE__ */ jsxs4("svg", { viewBox: "0 0 16 16", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: [
596
+ /* @__PURE__ */ jsx5("circle", { cx: "8", cy: "8", r: "6", stroke: "currentColor", strokeOpacity: "0.3", strokeWidth: "2" }),
597
+ /* @__PURE__ */ jsx5("path", { d: "M8 2a6 6 0 0 1 6 6", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
598
+ ] });
599
+ }
600
+ var ChatComposer = forwardRef5(
601
+ function ChatComposer2({
602
+ value,
603
+ defaultValue,
604
+ onChange,
605
+ onSend,
606
+ placeholder = "Write a message\u2026",
607
+ disabled = false,
608
+ sending = false,
609
+ allowEmpty = false,
610
+ size = "md",
611
+ minRows = 1,
612
+ maxRows = 6,
613
+ grow = "up",
614
+ leading,
615
+ trailing,
616
+ sendIcon,
617
+ sendLabel = "Send message",
618
+ fieldLabel = "Message",
619
+ hint,
620
+ className,
621
+ onKeyDown,
622
+ ...rest
623
+ }, forwardedRef) {
624
+ const innerRef = useRef(null);
625
+ const setRef = (node) => {
626
+ innerRef.current = node;
627
+ if (typeof forwardedRef === "function") forwardedRef(node);
628
+ else if (forwardedRef)
629
+ forwardedRef.current = node;
630
+ };
631
+ const isControlled = value !== void 0;
632
+ const [internal, setInternal] = useState2(defaultValue ?? "");
633
+ const text = isControlled ? value : internal;
634
+ const baseId = useId2();
635
+ const setText = (next) => {
636
+ if (!isControlled) setInternal(next);
637
+ onChange?.(next);
638
+ };
639
+ useEffect(() => {
640
+ const el = innerRef.current;
641
+ if (!el) return;
642
+ el.style.height = "auto";
643
+ const cs = window.getComputedStyle(el);
644
+ const fontSize = parseFloat(cs.fontSize) || 14;
645
+ const lh = cs.lineHeight === "normal" ? fontSize * 1.4 : cs.lineHeight.endsWith("px") ? parseFloat(cs.lineHeight) : parseFloat(cs.lineHeight) * fontSize;
646
+ const padV = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom);
647
+ const max = lh * maxRows + padV;
648
+ const next = Math.min(el.scrollHeight, max);
649
+ el.style.height = `${next}px`;
650
+ const overflowing = el.scrollHeight > max;
651
+ el.style.overflowY = overflowing ? "auto" : "hidden";
652
+ if (overflowing) el.scrollTop = el.scrollHeight;
653
+ }, [text, maxRows]);
654
+ const canSend = !disabled && !sending && (allowEmpty || text.trim().length > 0);
655
+ const submit = () => {
656
+ if (!canSend) return;
657
+ onSend?.(text);
658
+ if (!isControlled) setInternal("");
659
+ };
660
+ const handleKeyDown = (e) => {
661
+ onKeyDown?.(e);
662
+ if (e.defaultPrevented) return;
663
+ if (e.key === "Enter" && !e.shiftKey && !e.nativeEvent.isComposing) {
664
+ e.preventDefault();
665
+ submit();
666
+ }
667
+ };
668
+ return /* @__PURE__ */ jsxs4(
669
+ "div",
670
+ {
671
+ className: cn(
672
+ "ods-composer",
673
+ `ods-composer--${size}`,
674
+ `ods-composer--grow-${grow}`,
675
+ disabled && "ods-composer--disabled",
676
+ sending && "ods-composer--sending",
677
+ className
678
+ ),
679
+ children: [
680
+ /* @__PURE__ */ jsxs4("div", { className: "ods-composer__row", children: [
681
+ leading && /* @__PURE__ */ jsx5("div", { className: "ods-composer__leading", children: leading }),
682
+ /* @__PURE__ */ jsx5(
683
+ "textarea",
684
+ {
685
+ ...rest,
686
+ ref: setRef,
687
+ id: `ods-composer-${baseId}`,
688
+ className: "ods-composer__field",
689
+ rows: minRows,
690
+ value: text,
691
+ placeholder,
692
+ disabled,
693
+ "aria-label": fieldLabel,
694
+ onChange: (e) => setText(e.target.value),
695
+ onKeyDown: handleKeyDown
696
+ }
697
+ ),
698
+ /* @__PURE__ */ jsxs4("div", { className: "ods-composer__trailing", children: [
699
+ trailing,
700
+ /* @__PURE__ */ jsxs4(
701
+ "button",
702
+ {
703
+ type: "button",
704
+ className: "ods-composer__send",
705
+ "aria-label": sending ? "Sending\u2026" : sendLabel,
706
+ "aria-busy": sending || void 0,
707
+ onClick: submit,
708
+ disabled: !canSend,
709
+ children: [
710
+ /* @__PURE__ */ jsx5("span", { className: "ods-composer__send-icon", children: sendIcon ?? /* @__PURE__ */ jsx5(SendGlyph, {}) }),
711
+ /* @__PURE__ */ jsx5("span", { className: "ods-composer__send-spinner", "aria-hidden": "true", children: /* @__PURE__ */ jsx5(SpinnerGlyph, {}) })
712
+ ]
713
+ }
714
+ )
715
+ ] })
716
+ ] }),
717
+ hint && /* @__PURE__ */ jsx5("div", { className: "ods-composer__hint", children: hint })
718
+ ]
719
+ }
720
+ );
721
+ }
722
+ );
723
+ ChatComposer.displayName = "ChatComposer";
724
+
725
+ // src/components/ChatLinkPreview/ChatLinkPreview.tsx
726
+ import { forwardRef as forwardRef6 } from "react";
727
+
728
+ // src/components/TruncatedText/TruncatedText.tsx
729
+ import { useLayoutEffect, useRef as useRef2, useState as useState3 } from "react";
730
+ import { jsx as jsx6 } from "react/jsx-runtime";
731
+ function TruncatedText({ children, className }) {
732
+ const ref = useRef2(null);
733
+ const [cut, setCut] = useState3(false);
734
+ useLayoutEffect(() => {
735
+ const el = ref.current;
736
+ if (!el) return;
737
+ const measure = () => setCut(el.scrollWidth > el.clientWidth);
738
+ measure();
739
+ if (typeof ResizeObserver === "undefined") return;
740
+ const observer = new ResizeObserver(measure);
741
+ observer.observe(el);
742
+ return () => observer.disconnect();
743
+ }, [children]);
744
+ return /* @__PURE__ */ jsx6(Tooltip, { content: children, disabled: !cut, position: "top", children: /* @__PURE__ */ jsx6("span", { ref, className: cn("ods-truncated-text", className), children }) });
745
+ }
746
+
747
+ // src/components/ChatLinkPreview/ChatLinkPreview.tsx
748
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
749
+ function hostOf(url) {
750
+ try {
751
+ return new URL(url).hostname.replace(/^www\./, "");
752
+ } catch {
753
+ return url;
754
+ }
755
+ }
756
+ function linkTargetProps(target) {
757
+ return { target, rel: target === "_blank" ? "noopener noreferrer" : void 0 };
758
+ }
759
+ var ChatLinkPreview = forwardRef6(
760
+ function ChatLinkPreview2({
761
+ url,
762
+ title,
763
+ description,
764
+ siteName,
765
+ image,
766
+ favicon,
767
+ linkTarget = "_blank",
768
+ compact = false,
769
+ className,
770
+ ...rest
771
+ }, ref) {
772
+ const host = hostOf(url);
773
+ return /* @__PURE__ */ jsxs5(
774
+ "a",
775
+ {
776
+ ...rest,
777
+ ref,
778
+ href: url,
779
+ ...linkTargetProps(linkTarget),
780
+ className: cn(
781
+ "ods-chat-link-preview",
782
+ compact && "ods-chat-link-preview--compact",
783
+ className
784
+ ),
785
+ children: [
786
+ /* @__PURE__ */ jsxs5("span", { className: "ods-chat-link-preview__body", children: [
787
+ /* @__PURE__ */ jsxs5("span", { className: "ods-chat-link-preview__site", children: [
788
+ favicon && /* @__PURE__ */ jsx7(
789
+ "img",
790
+ {
791
+ className: "ods-chat-link-preview__favicon",
792
+ src: favicon,
793
+ alt: "",
794
+ width: 14,
795
+ height: 14
796
+ }
797
+ ),
798
+ /* @__PURE__ */ jsx7("span", { className: "ods-chat-link-preview__site-name", children: siteName ?? host })
799
+ ] }),
800
+ /* @__PURE__ */ jsx7(TruncatedText, { className: "ods-chat-link-preview__title", children: title ?? host }),
801
+ description && !compact && /* @__PURE__ */ jsx7("span", { className: "ods-chat-link-preview__description", children: description })
802
+ ] }),
803
+ image && /* @__PURE__ */ jsx7(
804
+ "span",
805
+ {
806
+ className: "ods-chat-link-preview__image",
807
+ style: { backgroundImage: `url(${JSON.stringify(image)})` },
808
+ "aria-hidden": "true"
809
+ }
810
+ )
811
+ ]
812
+ }
813
+ );
814
+ }
815
+ );
816
+ ChatLinkPreview.displayName = "ChatLinkPreview";
817
+
818
+ // src/components/ChatDocPreview/ChatDocPreview.tsx
819
+ import { forwardRef as forwardRef7 } from "react";
820
+ import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
821
+ function PageGlyph() {
822
+ return /* @__PURE__ */ jsxs6("svg", { viewBox: "0 0 16 16", width: "16", height: "16", fill: "none", "aria-hidden": "true", children: [
823
+ /* @__PURE__ */ jsx8(
824
+ "path",
825
+ {
826
+ d: "M4 2.5h5L13 6.5V13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1Z",
827
+ stroke: "currentColor",
828
+ strokeWidth: "1.1",
829
+ strokeLinejoin: "round"
830
+ }
831
+ ),
832
+ /* @__PURE__ */ jsx8(
833
+ "path",
834
+ {
835
+ d: "M9 2.5V6h3.5M5.5 9h5M5.5 11h3.5",
836
+ stroke: "currentColor",
837
+ strokeWidth: "1.1",
838
+ strokeLinecap: "round"
839
+ }
840
+ )
841
+ ] });
842
+ }
843
+ var ChatDocPreview = forwardRef7(
844
+ function ChatDocPreview2({ url, title, path, excerpt, linkTarget = "_blank", className, ...rest }, ref) {
845
+ return /* @__PURE__ */ jsxs6(
846
+ "a",
847
+ {
848
+ ...rest,
849
+ ref,
850
+ href: url,
851
+ ...linkTargetProps(linkTarget),
852
+ className: cn("ods-chat-doc-preview", className),
853
+ children: [
854
+ /* @__PURE__ */ jsxs6("span", { className: "ods-chat-doc-preview__head", children: [
855
+ /* @__PURE__ */ jsx8("span", { className: "ods-chat-doc-preview__icon", children: /* @__PURE__ */ jsx8(PageGlyph, {}) }),
856
+ /* @__PURE__ */ jsx8(TruncatedText, { className: "ods-chat-doc-preview__title", children: title })
857
+ ] }),
858
+ excerpt && /* @__PURE__ */ jsx8("span", { className: "ods-chat-doc-preview__excerpt", children: excerpt }),
859
+ path && path.length > 0 && /* @__PURE__ */ jsx8("span", { className: "ods-chat-doc-preview__path", children: path.map((segment, i) => (
860
+ // Keyed by the path up to here: unique even when a name repeats.
861
+ /* @__PURE__ */ jsx8("span", { className: "ods-chat-doc-preview__segment", children: segment }, path.slice(0, i + 1).join("/"))
862
+ )) })
863
+ ]
864
+ }
865
+ );
866
+ }
867
+ );
868
+ ChatDocPreview.displayName = "ChatDocPreview";
869
+
870
+ // src/components/Radio/RadioGroup.tsx
871
+ import {
872
+ createContext,
873
+ forwardRef as forwardRef8,
874
+ useContext,
875
+ useId as useId3,
876
+ useRef as useRef3
877
+ } from "react";
878
+ import { useRadioGroup } from "react-aria";
879
+ import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
880
+ var RadioGroupContext = createContext(null);
881
+ function useRadioGroupContext() {
882
+ const context = useContext(RadioGroupContext);
883
+ if (!context) {
884
+ throw new Error("Radio must be used within a RadioGroup");
885
+ }
886
+ return context;
887
+ }
888
+ var RadioGroup = forwardRef8(function RadioGroup2({
889
+ value,
890
+ defaultValue,
891
+ onChange,
892
+ label,
893
+ orientation = "vertical",
894
+ disabled = false,
895
+ children,
896
+ className,
897
+ name,
898
+ required,
899
+ id: providedId,
900
+ helperText,
901
+ error,
902
+ "aria-label": ariaLabel,
903
+ "aria-labelledby": ariaLabelledBy,
904
+ "aria-describedby": consumerDescribedBy,
905
+ ...rest
906
+ }, ref) {
907
+ const reactId = useId3();
908
+ const baseId = providedId ?? `ods-radio-group-${reactId}`;
909
+ const hintId = error || helperText ? `${baseId}-hint` : void 0;
910
+ const innerRef = useRef3(null);
911
+ const describedBy = [consumerDescribedBy, hintId].filter(Boolean).join(" ") || void 0;
912
+ const ariaProps = {
913
+ // react-aria wants a string label for its `<label>` association,
914
+ // even if our public API also takes ReactNode. Fall back to the
915
+ // explicit aria-label when label isn't a string.
916
+ label: typeof label === "string" ? label : ariaLabel || "radio group",
917
+ value,
918
+ defaultValue,
919
+ onChange,
920
+ isDisabled: disabled,
921
+ isInvalid: !!error,
922
+ isRequired: required,
923
+ orientation,
924
+ name,
925
+ "aria-label": ariaLabel,
926
+ "aria-labelledby": ariaLabelledBy,
927
+ "aria-describedby": describedBy
928
+ };
929
+ const state = $384704861d32dbed$export$bca9d026f8e704eb(ariaProps);
930
+ const { radioGroupProps, labelProps } = useRadioGroup(ariaProps, state);
931
+ const setRef = (node) => {
932
+ innerRef.current = node;
933
+ if (typeof ref === "function") ref(node);
934
+ else if (ref) ref.current = node;
935
+ };
936
+ return /* @__PURE__ */ jsxs7(
937
+ "div",
938
+ {
939
+ ...rest,
940
+ ...radioGroupProps,
941
+ ref: setRef,
942
+ id: baseId,
943
+ className: cn(
944
+ "ods-radio-group",
945
+ `ods-radio-group--${orientation}`,
946
+ disabled && "ods-radio-group--disabled",
947
+ error && "ods-radio-group--error",
948
+ className
949
+ ),
950
+ children: [
951
+ label && /* @__PURE__ */ jsx9("span", { ...labelProps, className: "ods-radio-group__label", children: label }),
952
+ /* @__PURE__ */ jsx9(RadioGroupContext.Provider, { value: state, children: /* @__PURE__ */ jsx9("div", { className: "ods-radio-group__items", children }) }),
953
+ error ? /* @__PURE__ */ jsx9(
954
+ "div",
955
+ {
956
+ id: hintId,
957
+ className: "ods-radio-group__hint ods-radio-group__hint--error",
958
+ role: "alert",
959
+ children: error
960
+ }
961
+ ) : helperText ? /* @__PURE__ */ jsx9("div", { id: hintId, className: "ods-radio-group__hint", children: helperText }) : null
962
+ ]
963
+ }
964
+ );
965
+ });
966
+ RadioGroup.displayName = "RadioGroup";
967
+
968
+ // src/components/Radio/Radio.tsx
969
+ import { forwardRef as forwardRef9, useRef as useRef4 } from "react";
970
+ import { useRadio } from "react-aria";
971
+ import { jsx as jsx10, jsxs as jsxs8 } from "react/jsx-runtime";
972
+ var Radio = forwardRef9(function Radio2({ value, label, description, size = "md", disabled = false, className, ...props }, forwardedRef) {
973
+ const state = useRadioGroupContext();
974
+ const innerRef = useRef4(null);
975
+ const setRef = (node) => {
976
+ innerRef.current = node;
977
+ if (typeof forwardedRef === "function") forwardedRef(node);
978
+ else if (forwardedRef) forwardedRef.current = node;
979
+ };
980
+ const ariaNameProps = resolveAccessibleName({
981
+ label: typeof label === "string" ? label : void 0,
982
+ ariaLabel: props["aria-label"],
983
+ ariaLabelledby: props["aria-labelledby"],
984
+ componentName: "Radio",
985
+ fallbacks: [value]
986
+ });
987
+ const { inputProps } = useRadio(
988
+ {
989
+ value,
990
+ isDisabled: disabled,
991
+ ...ariaNameProps
992
+ },
993
+ state,
994
+ innerRef
995
+ );
996
+ const isSelected = state.selectedValue === value;
997
+ const {
998
+ onClick: _onClick,
999
+ onKeyDown: _onKeyDown,
1000
+ onKeyUp: _onKeyUp,
1001
+ onFocus: _onFocus,
1002
+ onBlur: _onBlur,
1003
+ ...passthroughProps
1004
+ } = props;
1005
+ return /* @__PURE__ */ jsxs8(
1006
+ "label",
1007
+ {
1008
+ className: cn(
1009
+ "ods-radio",
1010
+ `ods-radio--${size}`,
1011
+ isSelected && "ods-radio--selected",
1012
+ disabled && "ods-radio--disabled",
1013
+ description && "ods-radio--with-description",
1014
+ className
1015
+ ),
1016
+ children: [
1017
+ /* @__PURE__ */ jsx10(
1018
+ "input",
1019
+ {
1020
+ ...passthroughProps,
1021
+ ...inputProps,
1022
+ ref: setRef,
1023
+ className: "ods-radio__input"
1024
+ }
1025
+ ),
1026
+ /* @__PURE__ */ jsx10("div", { className: "ods-radio__circle", "aria-hidden": "true", children: /* @__PURE__ */ jsx10("div", { className: cn("ods-radio__dot", isSelected && "ods-radio__dot--visible") }) }),
1027
+ (label || description) && /* @__PURE__ */ jsxs8("div", { className: "ods-radio__text", children: [
1028
+ label && /* @__PURE__ */ jsx10("span", { className: "ods-radio__label", children: label }),
1029
+ description && /* @__PURE__ */ jsx10("span", { className: "ods-radio__description", children: description })
1030
+ ] })
1031
+ ]
1032
+ }
1033
+ );
1034
+ });
1035
+ Radio.displayName = "Radio";
1036
+
1037
+ // src/components/ChatInputRequest/ChatInputRequest.tsx
1038
+ import {
1039
+ forwardRef as forwardRef10,
1040
+ useId as useId4,
1041
+ useState as useState4
1042
+ } from "react";
1043
+ import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs9 } from "react/jsx-runtime";
1044
+ var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1045
+ function optionsOf(field) {
1046
+ return (field.options ?? []).map((o) => typeof o === "string" ? { value: o, label: o } : o);
1047
+ }
1048
+ function emptyValue(field) {
1049
+ if (field.type === "multichoice") return [];
1050
+ return null;
1051
+ }
1052
+ function isEmpty(value) {
1053
+ if (Array.isArray(value)) return value.length === 0;
1054
+ return value === null || value === "";
1055
+ }
1056
+ function fieldProblem(field, value) {
1057
+ if (isEmpty(value)) return field.required ? "Required." : null;
1058
+ if (field.type === "email" && typeof value === "string" && !EMAIL.test(value.trim())) {
1059
+ return "Enter an email address, like name@company.com.";
1060
+ }
1061
+ if (field.type === "number" && typeof value === "string" && Number.isNaN(Number(value)))
1062
+ return "Enter a number.";
1063
+ return null;
1064
+ }
1065
+ function problemsOf(fields, values, typed) {
1066
+ return Object.fromEntries(
1067
+ fields.map((f) => {
1068
+ const value = values[f.name] ?? null;
1069
+ return [f.name, typed && isEmpty(value) ? null : fieldProblem(f, value)];
1070
+ })
1071
+ );
1072
+ }
1073
+ function displayValue(field, value) {
1074
+ if (value === null || isEmpty(value)) return "";
1075
+ if (typeof value === "boolean") return value ? "Yes" : "No";
1076
+ const labels = new Map(optionsOf(field).map((o) => [o.value, o.label]));
1077
+ if (Array.isArray(value)) return value.map((v) => labels.get(v) ?? v).join(", ");
1078
+ return labels.get(value) ?? value;
1079
+ }
1080
+ function ChoiceField({ field, value, error, disabled, onChange }) {
1081
+ const options = field.type === "boolean" ? [
1082
+ { value: "yes", label: "Yes" },
1083
+ { value: "no", label: "No" }
1084
+ ] : optionsOf(field);
1085
+ let selected = "";
1086
+ if (field.type === "boolean" && typeof value === "boolean") selected = value ? "yes" : "no";
1087
+ else if (typeof value === "string") selected = value;
1088
+ return /* @__PURE__ */ jsx11(
1089
+ RadioGroup,
1090
+ {
1091
+ label: field.label,
1092
+ value: selected,
1093
+ onChange: (v) => onChange(field.type === "boolean" ? v === "yes" : v),
1094
+ orientation: options.length > 3 ? "vertical" : "horizontal",
1095
+ required: field.required,
1096
+ disabled,
1097
+ helperText: field.helperText,
1098
+ error: error ?? void 0,
1099
+ children: options.map((o) => /* @__PURE__ */ jsx11(Radio, { value: o.value, label: o.label, size: "sm" }, o.value))
1100
+ }
1101
+ );
1102
+ }
1103
+ function MultiChoiceField({ field, value, error, disabled, onChange }) {
1104
+ const selected = Array.isArray(value) ? value : [];
1105
+ const toggle = (v, on) => onChange(on ? [...selected, v] : selected.filter((s) => s !== v));
1106
+ return /* @__PURE__ */ jsxs9("fieldset", { className: "ods-chat-input-request__group", disabled, children: [
1107
+ /* @__PURE__ */ jsx11("legend", { className: "ods-chat-input-request__legend", children: field.label }),
1108
+ optionsOf(field).map((o) => /* @__PURE__ */ jsx11(
1109
+ Checkbox,
1110
+ {
1111
+ size: "sm",
1112
+ label: o.label,
1113
+ checked: selected.includes(o.value),
1114
+ onChange: (on) => toggle(o.value, on)
1115
+ },
1116
+ o.value
1117
+ )),
1118
+ error && /* @__PURE__ */ jsx11("span", { className: "ods-chat-input-request__error", role: "alert", children: error })
1119
+ ] });
1120
+ }
1121
+ function TextField({ field, value, error, disabled, onChange }) {
1122
+ return /* @__PURE__ */ jsx11(
1123
+ Input,
1124
+ {
1125
+ size: "sm",
1126
+ type: field.type === "choice" || field.type === "multichoice" || field.type === "boolean" ? "text" : field.type,
1127
+ label: field.label,
1128
+ value: typeof value === "string" ? value : "",
1129
+ onChange: (e) => onChange(e.target.value),
1130
+ placeholder: field.placeholder,
1131
+ helperText: field.helperText,
1132
+ required: field.required,
1133
+ disabled,
1134
+ error: Boolean(error),
1135
+ errorMessage: error ?? void 0
1136
+ }
1137
+ );
1138
+ }
1139
+ function Field(props) {
1140
+ const { type } = props.field;
1141
+ if (type === "choice" || type === "boolean") return /* @__PURE__ */ jsx11(ChoiceField, { ...props });
1142
+ if (type === "multichoice") return /* @__PURE__ */ jsx11(MultiChoiceField, { ...props });
1143
+ return /* @__PURE__ */ jsx11(TextField, { ...props });
1144
+ }
1145
+ function AnswerSummary({
1146
+ fields,
1147
+ answer
1148
+ }) {
1149
+ if (answer === "skipped") return /* @__PURE__ */ jsx11("p", { className: "ods-chat-input-request__answer", children: "Skipped" });
1150
+ const parts = fields.map((f) => displayValue(f, answer.values[f.name] ?? null)).filter(Boolean);
1151
+ if (answer.text) parts.push(answer.text);
1152
+ return /* @__PURE__ */ jsxs9("p", { className: "ods-chat-input-request__answer", children: [
1153
+ /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx11(
1154
+ "path",
1155
+ {
1156
+ d: "M3.5 8.5l3 3 6-7",
1157
+ stroke: "currentColor",
1158
+ strokeWidth: "1.6",
1159
+ strokeLinecap: "round",
1160
+ strokeLinejoin: "round"
1161
+ }
1162
+ ) }),
1163
+ /* @__PURE__ */ jsx11("span", { children: parts.length > 0 ? parts.join(" \xB7 ") : "Sent" })
1164
+ ] });
1165
+ }
1166
+ var ChatInputRequest = forwardRef10(
1167
+ function ChatInputRequest2({
1168
+ prompt,
1169
+ description,
1170
+ fields,
1171
+ onSubmit,
1172
+ onSkip,
1173
+ answer = null,
1174
+ submitting = false,
1175
+ submitLabel = "Send",
1176
+ skipLabel = "Skip",
1177
+ textPlaceholder = "Or type your answer\u2026",
1178
+ className,
1179
+ ...rest
1180
+ }, ref) {
1181
+ const promptId = useId4();
1182
+ const [values, setValues] = useState4(
1183
+ () => Object.fromEntries(fields.map((f) => [f.name, emptyValue(f)]))
1184
+ );
1185
+ const [errors, setErrors] = useState4({});
1186
+ const [text, setText] = useState4("");
1187
+ const [textError, setTextError] = useState4(null);
1188
+ const answered = answer !== null;
1189
+ const locked = answered || submitting;
1190
+ const submit = (e) => {
1191
+ e.preventDefault();
1192
+ if (locked) return;
1193
+ const typed = text.trim();
1194
+ if (fields.length === 0 && !typed) {
1195
+ setTextError("Type an answer.");
1196
+ return;
1197
+ }
1198
+ const found = problemsOf(fields, values, typed);
1199
+ setErrors(found);
1200
+ if (Object.values(found).some(Boolean)) return;
1201
+ onSubmit(values, typed || void 0);
1202
+ };
1203
+ return /* @__PURE__ */ jsxs9(
1204
+ "form",
1205
+ {
1206
+ ...rest,
1207
+ ref,
1208
+ noValidate: true,
1209
+ "aria-labelledby": promptId,
1210
+ onSubmit: submit,
1211
+ className: cn(
1212
+ "ods-chat-input-request",
1213
+ answered && "ods-chat-input-request--answered",
1214
+ className
1215
+ ),
1216
+ children: [
1217
+ /* @__PURE__ */ jsxs9("div", { className: "ods-chat-input-request__head", children: [
1218
+ /* @__PURE__ */ jsx11("p", { id: promptId, className: "ods-chat-input-request__prompt", children: prompt }),
1219
+ description && !answered && /* @__PURE__ */ jsx11("p", { className: "ods-chat-input-request__description", children: description })
1220
+ ] }),
1221
+ answered ? /* @__PURE__ */ jsx11(AnswerSummary, { fields, answer }) : /* @__PURE__ */ jsxs9(Fragment2, { children: [
1222
+ fields.length > 0 && /* @__PURE__ */ jsx11("div", { className: "ods-chat-input-request__fields", children: fields.map((f) => /* @__PURE__ */ jsx11(
1223
+ Field,
1224
+ {
1225
+ field: f,
1226
+ value: values[f.name] ?? null,
1227
+ error: errors[f.name] ?? null,
1228
+ disabled: locked,
1229
+ onChange: (v) => {
1230
+ setValues((prev) => ({ ...prev, [f.name]: v }));
1231
+ if (errors[f.name]) setErrors((prev) => ({ ...prev, [f.name]: null }));
1232
+ }
1233
+ },
1234
+ f.name
1235
+ )) }),
1236
+ /* @__PURE__ */ jsx11("div", { className: "ods-chat-input-request__reply", children: /* @__PURE__ */ jsx11(
1237
+ Input,
1238
+ {
1239
+ size: "sm",
1240
+ "aria-label": "Type your answer",
1241
+ className: "ods-chat-input-request__text",
1242
+ value: text,
1243
+ onChange: (e) => {
1244
+ setText(e.target.value);
1245
+ if (textError) setTextError(null);
1246
+ },
1247
+ placeholder: textPlaceholder,
1248
+ disabled: locked,
1249
+ error: Boolean(textError),
1250
+ errorMessage: textError ?? void 0
1251
+ }
1252
+ ) }),
1253
+ /* @__PURE__ */ jsxs9("div", { className: "ods-chat-input-request__actions", children: [
1254
+ onSkip && /* @__PURE__ */ jsx11(
1255
+ Button,
1256
+ {
1257
+ type: "button",
1258
+ variant: "ghost",
1259
+ size: "sm",
1260
+ onClick: onSkip,
1261
+ disabled: submitting,
1262
+ children: skipLabel
1263
+ }
1264
+ ),
1265
+ /* @__PURE__ */ jsx11(Button, { type: "submit", variant: "primary", size: "sm", loading: submitting, children: submitLabel })
1266
+ ] })
1267
+ ] })
1268
+ ]
1269
+ }
1270
+ );
1271
+ }
1272
+ );
1273
+ ChatInputRequest.displayName = "ChatInputRequest";
1274
+
1275
+ // src/components/ChatFeedback/ChatFeedback.tsx
1276
+ import { forwardRef as forwardRef11, useState as useState5 } from "react";
1277
+ import { jsx as jsx12, jsxs as jsxs10 } from "react/jsx-runtime";
1278
+ function ThumbUp() {
1279
+ return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 16 16", width: "15", height: "15", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12(
1280
+ "path",
1281
+ {
1282
+ d: "M5 7v6H3a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h2Zm0 0 3-4.5A1.5 1.5 0 0 1 10.4 4l-.6 3h3.1a1.5 1.5 0 0 1 1.47 1.8l-.8 4A1.5 1.5 0 0 1 12.1 14H5",
1283
+ stroke: "currentColor",
1284
+ strokeWidth: "1.2",
1285
+ strokeLinejoin: "round"
1286
+ }
1287
+ ) });
1288
+ }
1289
+ function ThumbDown() {
1290
+ return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 16 16", width: "15", height: "15", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12(
1291
+ "path",
1292
+ {
1293
+ d: "M11 9V3h2a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-2Zm0 0-3 4.5A1.5 1.5 0 0 1 5.6 12l.6-3H3.1A1.5 1.5 0 0 1 1.63 7.2l.8-4A1.5 1.5 0 0 1 3.9 2H11",
1294
+ stroke: "currentColor",
1295
+ strokeWidth: "1.2",
1296
+ strokeLinejoin: "round"
1297
+ }
1298
+ ) });
1299
+ }
1300
+ function CopyGlyph() {
1301
+ return /* @__PURE__ */ jsxs10("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", "aria-hidden": "true", children: [
1302
+ /* @__PURE__ */ jsx12("rect", { x: "5.5", y: "5.5", width: "8", height: "8", rx: "1.5", stroke: "currentColor", strokeWidth: "1.2" }),
1303
+ /* @__PURE__ */ jsx12(
1304
+ "path",
1305
+ {
1306
+ d: "M10.5 5.5V4A1.5 1.5 0 0 0 9 2.5H4A1.5 1.5 0 0 0 2.5 4v5A1.5 1.5 0 0 0 4 10.5h1.5",
1307
+ stroke: "currentColor",
1308
+ strokeWidth: "1.2"
1309
+ }
1310
+ )
1311
+ ] });
1312
+ }
1313
+ function CheckGlyph() {
1314
+ return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12(
1315
+ "path",
1316
+ {
1317
+ d: "M3 8.5l3 3 7-7",
1318
+ stroke: "currentColor",
1319
+ strokeWidth: "1.4",
1320
+ strokeLinecap: "round",
1321
+ strokeLinejoin: "round"
1322
+ }
1323
+ ) });
1324
+ }
1325
+ function RegenGlyph() {
1326
+ return /* @__PURE__ */ jsx12("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx12(
1327
+ "path",
1328
+ {
1329
+ d: "M13 8a5 5 0 1 1-1.5-3.5M13 2v3h-3",
1330
+ stroke: "currentColor",
1331
+ strokeWidth: "1.2",
1332
+ strokeLinecap: "round",
1333
+ strokeLinejoin: "round"
1334
+ }
1335
+ ) });
1336
+ }
1337
+ var ChatFeedback = forwardRef11(function ChatFeedback2({
1338
+ rating,
1339
+ defaultRating = null,
1340
+ onRate,
1341
+ onCopy,
1342
+ onRegenerate,
1343
+ children,
1344
+ size = "sm",
1345
+ className,
1346
+ ...rest
1347
+ }, ref) {
1348
+ const isControlled = rating !== void 0;
1349
+ const [internal, setInternal] = useState5(defaultRating);
1350
+ const current = isControlled ? rating : internal;
1351
+ const [copied, setCopied] = useState5(false);
1352
+ const rate = (next) => {
1353
+ const resolved = current === next ? null : next;
1354
+ if (!isControlled) setInternal(resolved);
1355
+ onRate?.(resolved);
1356
+ };
1357
+ const copy = () => {
1358
+ onCopy?.();
1359
+ setCopied(true);
1360
+ window.setTimeout(() => setCopied(false), 1600);
1361
+ };
1362
+ const btnSize = size === "md" ? "md" : "sm";
1363
+ return /* @__PURE__ */ jsxs10(
1364
+ "div",
1365
+ {
1366
+ ...rest,
1367
+ ref,
1368
+ className: cn("ods-chat-feedback", `ods-chat-feedback--${size}`, className),
1369
+ role: "group",
1370
+ "aria-label": "Message feedback",
1371
+ children: [
1372
+ /* @__PURE__ */ jsx12(
1373
+ Button,
1374
+ {
1375
+ variant: "icon",
1376
+ size: btnSize,
1377
+ "aria-label": "Good response",
1378
+ pressed: current === "up",
1379
+ onClick: () => rate("up"),
1380
+ children: /* @__PURE__ */ jsx12(ThumbUp, {})
1381
+ }
1382
+ ),
1383
+ /* @__PURE__ */ jsx12(
1384
+ Button,
1385
+ {
1386
+ variant: "icon",
1387
+ size: btnSize,
1388
+ "aria-label": "Bad response",
1389
+ pressed: current === "down",
1390
+ onClick: () => rate("down"),
1391
+ children: /* @__PURE__ */ jsx12(ThumbDown, {})
1392
+ }
1393
+ ),
1394
+ onCopy && /* @__PURE__ */ jsx12(
1395
+ Button,
1396
+ {
1397
+ variant: "icon",
1398
+ size: btnSize,
1399
+ "aria-label": copied ? "Copied" : "Copy",
1400
+ onClick: copy,
1401
+ children: copied ? /* @__PURE__ */ jsx12(CheckGlyph, {}) : /* @__PURE__ */ jsx12(CopyGlyph, {})
1402
+ }
1403
+ ),
1404
+ onRegenerate && /* @__PURE__ */ jsx12(
1405
+ Button,
1406
+ {
1407
+ variant: "icon",
1408
+ size: btnSize,
1409
+ "aria-label": "Regenerate response",
1410
+ onClick: onRegenerate,
1411
+ children: /* @__PURE__ */ jsx12(RegenGlyph, {})
1412
+ }
1413
+ ),
1414
+ children
1415
+ ]
1416
+ }
1417
+ );
1418
+ });
1419
+ ChatFeedback.displayName = "ChatFeedback";
1420
+
1421
+ // src/components/ChatScrollToBottom/ChatScrollToBottom.tsx
1422
+ import { forwardRef as forwardRef12 } from "react";
1423
+ import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
1424
+ var ChatScrollToBottom = forwardRef12(
1425
+ function ChatScrollToBottom2({ count, label = "Jump to latest", showLabel, className, ...rest }, ref) {
1426
+ const hasCount = typeof count === "number" && count > 0;
1427
+ const withLabel = showLabel ?? hasCount;
1428
+ const text = hasCount ? `${count} new` : withLabel ? label : null;
1429
+ return /* @__PURE__ */ jsxs11(
1430
+ "button",
1431
+ {
1432
+ ...rest,
1433
+ ref,
1434
+ type: "button",
1435
+ className: cn(
1436
+ "ods-chat-scroll-bottom",
1437
+ !withLabel && "ods-chat-scroll-bottom--icon",
1438
+ className
1439
+ ),
1440
+ "aria-label": label,
1441
+ children: [
1442
+ /* @__PURE__ */ jsx13("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ jsx13(
1443
+ "path",
1444
+ {
1445
+ d: "M8 3v8.5M4.5 8L8 11.5 11.5 8",
1446
+ stroke: "currentColor",
1447
+ strokeWidth: "1.5",
1448
+ strokeLinecap: "round",
1449
+ strokeLinejoin: "round"
1450
+ }
1451
+ ) }),
1452
+ text && /* @__PURE__ */ jsx13("span", { className: "ods-chat-scroll-bottom__text", children: text })
1453
+ ]
1454
+ }
1455
+ );
1456
+ }
1457
+ );
1458
+ ChatScrollToBottom.displayName = "ChatScrollToBottom";
1459
+
1460
+ // src/components/ChatThread/ChatThread.tsx
1461
+ import {
1462
+ Children,
1463
+ forwardRef as forwardRef13,
1464
+ useEffect as useEffect2,
1465
+ useRef as useRef5
1466
+ } from "react";
1467
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
1468
+ var STICK_THRESHOLD = 120;
1469
+ var ChatThread = forwardRef13(function ChatThread2({
1470
+ children,
1471
+ emptyState,
1472
+ loading = false,
1473
+ header,
1474
+ footer,
1475
+ stickToBottom = true,
1476
+ gap = "md",
1477
+ className,
1478
+ onScroll,
1479
+ ...rest
1480
+ }, forwardedRef) {
1481
+ const innerRef = useRef5(null);
1482
+ const setRef = (node) => {
1483
+ innerRef.current = node;
1484
+ if (typeof forwardedRef === "function") forwardedRef(node);
1485
+ else if (forwardedRef) forwardedRef.current = node;
1486
+ };
1487
+ const following = useRef5(true);
1488
+ const handleScroll = (e) => {
1489
+ const el = e.currentTarget;
1490
+ following.current = el.scrollHeight - el.scrollTop - el.clientHeight < STICK_THRESHOLD;
1491
+ onScroll?.(e);
1492
+ };
1493
+ useEffect2(() => {
1494
+ if (!stickToBottom || loading) return;
1495
+ const el = innerRef.current;
1496
+ if (el && following.current) el.scrollTop = el.scrollHeight;
1497
+ });
1498
+ const isEmpty2 = Children.count(children) === 0;
1499
+ const showEmpty = !loading && isEmpty2 && !footer && emptyState != null;
1500
+ return /* @__PURE__ */ jsx14(
1501
+ "div",
1502
+ {
1503
+ ...rest,
1504
+ ref: setRef,
1505
+ className: cn("ods-chat-thread", `ods-chat-thread--gap-${gap}`, className),
1506
+ role: "log",
1507
+ "aria-live": "polite",
1508
+ "aria-relevant": "additions",
1509
+ onScroll: handleScroll,
1510
+ children: loading ? /* @__PURE__ */ jsx14("div", { className: "ods-chat-thread__loading", children: /* @__PURE__ */ jsx14(Spinner, { label: "Loading messages" }) }) : showEmpty ? /* @__PURE__ */ jsx14("div", { className: "ods-chat-thread__empty", children: emptyState }) : /* @__PURE__ */ jsxs12("div", { className: "ods-chat-thread__list", children: [
1511
+ header && /* @__PURE__ */ jsx14("div", { className: "ods-chat-thread__header", children: header }),
1512
+ children,
1513
+ footer && /* @__PURE__ */ jsx14("div", { className: "ods-chat-thread__footer", children: footer })
1514
+ ] })
1515
+ }
1516
+ );
1517
+ });
1518
+ ChatThread.displayName = "ChatThread";
1519
+
1520
+ // src/components/ChatPanel/ChatPanel.tsx
1521
+ import {
1522
+ forwardRef as forwardRef14,
1523
+ useCallback as useCallback2,
1524
+ useRef as useRef6,
1525
+ useState as useState6
1526
+ } from "react";
1527
+ import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
1528
+ var JUMP_THRESHOLD = 200;
1529
+ var ChatPanel = forwardRef14(function ChatPanel2({
1530
+ header,
1531
+ children,
1532
+ emptyState,
1533
+ loading = false,
1534
+ thinking,
1535
+ threadHeader,
1536
+ suggestions,
1537
+ composer,
1538
+ onSend,
1539
+ composerProps,
1540
+ threadProps,
1541
+ showScrollToBottom = true,
1542
+ className,
1543
+ ...rest
1544
+ }, ref) {
1545
+ const threadRef = useRef6(null);
1546
+ const [showJump, setShowJump] = useState6(false);
1547
+ const handleScroll = useCallback2(() => {
1548
+ const el = threadRef.current;
1549
+ if (!el) return;
1550
+ setShowJump(el.scrollHeight - el.scrollTop - el.clientHeight > JUMP_THRESHOLD);
1551
+ }, []);
1552
+ const jumpToBottom = useCallback2(() => {
1553
+ const el = threadRef.current;
1554
+ if (el) el.scrollTo({ top: el.scrollHeight, behavior: "smooth" });
1555
+ }, []);
1556
+ return /* @__PURE__ */ jsxs13("div", { ...rest, ref, className: cn("ods-chat-panel", className), children: [
1557
+ header && /* @__PURE__ */ jsx15("div", { className: "ods-chat-panel__header", children: header }),
1558
+ /* @__PURE__ */ jsxs13("div", { className: "ods-chat-panel__body", children: [
1559
+ /* @__PURE__ */ jsx15(
1560
+ ChatThread,
1561
+ {
1562
+ ...threadProps,
1563
+ ref: threadRef,
1564
+ loading,
1565
+ emptyState,
1566
+ header: threadHeader,
1567
+ footer: thinking,
1568
+ onScroll: handleScroll,
1569
+ children
1570
+ }
1571
+ ),
1572
+ showScrollToBottom && showJump && /* @__PURE__ */ jsx15("div", { className: "ods-chat-panel__jump", children: /* @__PURE__ */ jsx15(ChatScrollToBottom, { showLabel: true, onClick: jumpToBottom }) })
1573
+ ] }),
1574
+ suggestions && /* @__PURE__ */ jsx15("div", { className: "ods-chat-panel__suggestions", children: suggestions }),
1575
+ (composer || onSend) && /* @__PURE__ */ jsx15("div", { className: "ods-chat-panel__composer", children: composer ?? /* @__PURE__ */ jsx15(ChatComposer, { onSend, ...composerProps }) })
1576
+ ] });
1577
+ });
1578
+ ChatPanel.displayName = "ChatPanel";
1579
+
1580
+ // src/components/ChatVideoPreview/ChatVideoPreview.tsx
1581
+ import { forwardRef as forwardRef15, useState as useState7 } from "react";
1582
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
1583
+ var PROVIDER_LABEL = {
1584
+ youtube: "YouTube",
1585
+ vimeo: "Vimeo",
1586
+ loom: "Loom",
1587
+ file: "Video"
1588
+ };
1589
+ var ID = /^[\w-]+$/;
1590
+ function youtubeId(u) {
1591
+ const host = u.hostname.replace(/^www\.|^m\./, "");
1592
+ if (host === "youtu.be") return u.pathname.slice(1).split("/")[0] || null;
1593
+ if (host !== "youtube.com" && host !== "youtube-nocookie.com") return null;
1594
+ if (u.pathname === "/watch") return u.searchParams.get("v");
1595
+ const [, kind, id] = u.pathname.split("/");
1596
+ return kind === "embed" || kind === "shorts" || kind === "live" ? id ?? null : null;
1597
+ }
1598
+ function lastSegment(u, prefixes) {
1599
+ const parts = u.pathname.split("/").filter(Boolean);
1600
+ if (parts.length === 0) return null;
1601
+ if (prefixes.length > 0 && !prefixes.includes(parts[0] ?? "")) return null;
1602
+ return parts[parts.length - 1] ?? null;
1603
+ }
1604
+ function videoEmbedOf(url) {
1605
+ let u;
1606
+ try {
1607
+ u = new URL(url);
1608
+ } catch {
1609
+ return null;
1610
+ }
1611
+ if (u.protocol !== "https:" && u.protocol !== "http:") return null;
1612
+ const host = u.hostname.replace(/^www\./, "");
1613
+ const yt = youtubeId(u);
1614
+ if (yt && ID.test(yt))
1615
+ return { provider: "youtube", src: `https://www.youtube-nocookie.com/embed/${yt}?autoplay=1` };
1616
+ if (host === "vimeo.com" || host === "player.vimeo.com") {
1617
+ const id = lastSegment(u, []);
1618
+ if (id && /^\d+$/.test(id))
1619
+ return { provider: "vimeo", src: `https://player.vimeo.com/video/${id}?autoplay=1` };
1620
+ }
1621
+ if (host === "loom.com") {
1622
+ const id = lastSegment(u, ["share", "embed"]);
1623
+ if (id && ID.test(id))
1624
+ return { provider: "loom", src: `https://www.loom.com/embed/${id}?autoplay=1` };
1625
+ }
1626
+ if (/\.(mp4|webm|mov)$/i.test(u.pathname)) return { provider: "file", src: u.toString() };
1627
+ return null;
1628
+ }
1629
+ function PlayGlyph() {
1630
+ return /* @__PURE__ */ jsx16("svg", { viewBox: "0 0 24 24", width: "22", height: "22", "aria-hidden": "true", children: /* @__PURE__ */ jsx16("path", { d: "M8 5.5v13l10.5-6.5z", fill: "currentColor" }) });
1631
+ }
1632
+ function seedOf(text) {
1633
+ let h = 2166136261;
1634
+ for (let i = 0; i < text.length; i++) {
1635
+ h ^= text.charCodeAt(i);
1636
+ h = Math.imul(h, 16777619);
1637
+ }
1638
+ return h >>> 0;
1639
+ }
1640
+ function pick(seed, n, min, max) {
1641
+ const v = (seed >>> n * 3) % 1e3;
1642
+ return min + Math.round(v / 999 * (max - min));
1643
+ }
1644
+ function PosterArt({ url, source }) {
1645
+ const seed = seedOf(url);
1646
+ const holes = Array.from({ length: 16 }, (_, i) => i * 20 + 6);
1647
+ const frames = [0, 1, 2].map((i) => ({ x: 24 + i * 94, h: pick(seed, i, 44, 62) }));
1648
+ return /* @__PURE__ */ jsxs14("span", { className: "ods-chat-video-preview__art", "aria-hidden": "true", children: [
1649
+ /* @__PURE__ */ jsxs14(
1650
+ "svg",
1651
+ {
1652
+ viewBox: "0 0 320 180",
1653
+ preserveAspectRatio: "xMidYMid slice",
1654
+ width: "100%",
1655
+ height: "100%",
1656
+ "aria-hidden": "true",
1657
+ children: [
1658
+ /* @__PURE__ */ jsx16("rect", { className: "ods-chat-video-preview__art-strip", x: "0", y: "0", width: "320", height: "16" }),
1659
+ /* @__PURE__ */ jsx16("rect", { className: "ods-chat-video-preview__art-strip", x: "0", y: "164", width: "320", height: "16" }),
1660
+ holes.map((x) => /* @__PURE__ */ jsxs14("g", { children: [
1661
+ /* @__PURE__ */ jsx16("rect", { className: "ods-chat-video-preview__art-hole", x, y: "5", width: "8", height: "6" }),
1662
+ /* @__PURE__ */ jsx16("rect", { className: "ods-chat-video-preview__art-hole", x, y: "169", width: "8", height: "6" })
1663
+ ] }, x)),
1664
+ frames.map((f, i) => /* @__PURE__ */ jsx16(
1665
+ "rect",
1666
+ {
1667
+ className: `ods-chat-video-preview__art-frame ods-chat-video-preview__art-frame--${i}`,
1668
+ x: f.x,
1669
+ y: 90 - f.h / 2 - 8,
1670
+ width: "84",
1671
+ height: f.h
1672
+ },
1673
+ f.x
1674
+ )),
1675
+ /* @__PURE__ */ jsx16(
1676
+ "rect",
1677
+ {
1678
+ className: "ods-chat-video-preview__art-line",
1679
+ x: "24",
1680
+ y: "134",
1681
+ width: pick(seed, 3, 120, 220),
1682
+ height: "5"
1683
+ }
1684
+ ),
1685
+ /* @__PURE__ */ jsx16(
1686
+ "rect",
1687
+ {
1688
+ className: "ods-chat-video-preview__art-line",
1689
+ x: "24",
1690
+ y: "145",
1691
+ width: pick(seed, 4, 60, 150),
1692
+ height: "5"
1693
+ }
1694
+ )
1695
+ ]
1696
+ }
1697
+ ),
1698
+ /* @__PURE__ */ jsx16("span", { className: "ods-chat-video-preview__art-label", children: source })
1699
+ ] });
1700
+ }
1701
+ function Player({ embed, title }) {
1702
+ if (embed.provider === "file") {
1703
+ return (
1704
+ // biome-ignore lint/a11y/useMediaCaption: captions come with the source file, which the card does not own.
1705
+ /* @__PURE__ */ jsx16(
1706
+ "video",
1707
+ {
1708
+ className: "ods-chat-video-preview__player",
1709
+ src: embed.src,
1710
+ controls: true,
1711
+ autoPlay: true,
1712
+ playsInline: true
1713
+ }
1714
+ )
1715
+ );
1716
+ }
1717
+ return /* @__PURE__ */ jsx16(
1718
+ "iframe",
1719
+ {
1720
+ className: "ods-chat-video-preview__player",
1721
+ src: embed.src,
1722
+ title,
1723
+ allow: "autoplay; encrypted-media; picture-in-picture; fullscreen",
1724
+ allowFullScreen: true,
1725
+ referrerPolicy: "strict-origin-when-cross-origin"
1726
+ }
1727
+ );
1728
+ }
1729
+ var ChatVideoPreview = forwardRef15(
1730
+ function ChatVideoPreview2({ url, title, thumbnail, duration, linkTarget = "_blank", className, ...rest }, ref) {
1731
+ const [playing, setPlaying] = useState7(false);
1732
+ const [failedPoster, setFailedPoster] = useState7(null);
1733
+ const embed = videoEmbedOf(url);
1734
+ const label = typeof title === "string" ? title : "video";
1735
+ const source = embed ? PROVIDER_LABEL[embed.provider] : hostOf(url);
1736
+ const showImage = Boolean(thumbnail) && failedPoster !== thumbnail;
1737
+ const poster = /* @__PURE__ */ jsxs14("span", { className: "ods-chat-video-preview__poster", children: [
1738
+ /* @__PURE__ */ jsx16(PosterArt, { url, source }),
1739
+ showImage && /* @__PURE__ */ jsx16(
1740
+ "img",
1741
+ {
1742
+ className: "ods-chat-video-preview__poster-img",
1743
+ src: thumbnail,
1744
+ alt: "",
1745
+ onError: () => setFailedPoster(thumbnail ?? null)
1746
+ }
1747
+ ),
1748
+ /* @__PURE__ */ jsx16("span", { className: "ods-chat-video-preview__play", children: /* @__PURE__ */ jsx16(PlayGlyph, {}) }),
1749
+ duration && /* @__PURE__ */ jsx16("span", { className: "ods-chat-video-preview__duration", children: duration })
1750
+ ] });
1751
+ let stage;
1752
+ if (embed && playing) {
1753
+ stage = /* @__PURE__ */ jsx16(Player, { embed, title: label });
1754
+ } else if (embed) {
1755
+ stage = /* @__PURE__ */ jsx16(
1756
+ "button",
1757
+ {
1758
+ type: "button",
1759
+ className: "ods-chat-video-preview__stage",
1760
+ onClick: () => setPlaying(true),
1761
+ "aria-label": `Play ${label}`,
1762
+ children: poster
1763
+ }
1764
+ );
1765
+ } else {
1766
+ stage = /* @__PURE__ */ jsx16(
1767
+ "a",
1768
+ {
1769
+ className: "ods-chat-video-preview__stage",
1770
+ href: url,
1771
+ ...linkTargetProps(linkTarget),
1772
+ "aria-label": `Open ${label}`,
1773
+ children: poster
1774
+ }
1775
+ );
1776
+ }
1777
+ return /* @__PURE__ */ jsxs14(
1778
+ "div",
1779
+ {
1780
+ ...rest,
1781
+ ref,
1782
+ className: cn(
1783
+ "ods-chat-video-preview",
1784
+ playing && "ods-chat-video-preview--playing",
1785
+ className
1786
+ ),
1787
+ children: [
1788
+ /* @__PURE__ */ jsx16("div", { className: "ods-chat-video-preview__frame", children: stage }),
1789
+ /* @__PURE__ */ jsxs14("div", { className: "ods-chat-video-preview__meta", children: [
1790
+ /* @__PURE__ */ jsx16(TruncatedText, { className: "ods-chat-video-preview__title", children: title }),
1791
+ /* @__PURE__ */ jsxs14("span", { className: "ods-chat-video-preview__source", children: [
1792
+ source,
1793
+ /* @__PURE__ */ jsx16("a", { className: "ods-chat-video-preview__open", href: url, ...linkTargetProps(linkTarget), children: "Open" })
1794
+ ] })
1795
+ ] })
1796
+ ]
1797
+ }
1798
+ );
1799
+ }
1800
+ );
1801
+ ChatVideoPreview.displayName = "ChatVideoPreview";
1802
+
1803
+ // src/components/ChatSources/ChatSources.tsx
1804
+ import { forwardRef as forwardRef16, useState as useState8 } from "react";
1805
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
1806
+ function hostOf2(url) {
1807
+ try {
1808
+ return new URL(url).hostname.replace(/^www\./, "");
1809
+ } catch {
1810
+ return url;
1811
+ }
1812
+ }
1813
+ var ChatSources = forwardRef16(function ChatSources2({
1814
+ sources,
1815
+ label = "Sources",
1816
+ display = "links",
1817
+ numbered = true,
1818
+ defaultOpen = false,
1819
+ linkTarget = "_blank",
1820
+ className,
1821
+ ...rest
1822
+ }, ref) {
1823
+ const [open, setOpen] = useState8(defaultOpen);
1824
+ if (!sources || sources.length === 0) return null;
1825
+ const count = sources.length;
1826
+ const isChips = display === "chips" || display === "plain-chips";
1827
+ return /* @__PURE__ */ jsxs15(
1828
+ "details",
1829
+ {
1830
+ ...rest,
1831
+ ref,
1832
+ open,
1833
+ onToggle: (e) => setOpen(e.currentTarget.open),
1834
+ className: cn("ods-chat-sources", `ods-chat-sources--${display}`, className),
1835
+ children: [
1836
+ /* @__PURE__ */ jsxs15("summary", { className: "ods-chat-sources__trigger", children: [
1837
+ /* @__PURE__ */ jsx17("span", { className: "ods-chat-sources__caret", "aria-hidden": "true", children: /* @__PURE__ */ jsx17("svg", { viewBox: "0 0 12 12", width: "11", height: "11", fill: "none", children: /* @__PURE__ */ jsx17(
1838
+ "path",
1839
+ {
1840
+ d: "M4 2.5L8 6l-4 3.5",
1841
+ stroke: "currentColor",
1842
+ strokeWidth: "1.4",
1843
+ strokeLinecap: "round",
1844
+ strokeLinejoin: "round"
1845
+ }
1846
+ ) }) }),
1847
+ /* @__PURE__ */ jsx17("span", { className: "ods-chat-sources__trigger-label", children: label }),
1848
+ /* @__PURE__ */ jsx17("span", { className: "ods-chat-sources__count", children: count })
1849
+ ] }),
1850
+ /* @__PURE__ */ jsx17("div", { className: cn("ods-chat-sources__panel", isChips && "ods-chat-sources__panel--chips"), children: sources.map((s, i) => {
1851
+ const key = s.id ?? `${i}`;
1852
+ const idx = numbered ? /* @__PURE__ */ jsxs15("span", { className: "ods-chat-sources__index", children: [
1853
+ "[",
1854
+ i + 1,
1855
+ "]"
1856
+ ] }) : null;
1857
+ const linkProps = s.url ? {
1858
+ href: s.url,
1859
+ target: linkTarget,
1860
+ rel: linkTarget === "_blank" ? "noopener noreferrer" : void 0
1861
+ } : null;
1862
+ if (isChips) {
1863
+ const chipClass = cn(
1864
+ "ods-chat-sources__chip",
1865
+ s.url && display === "chips" && "ods-chat-sources__chip--link"
1866
+ );
1867
+ return display === "chips" && linkProps ? /* @__PURE__ */ jsx17("a", { className: chipClass, ...linkProps, children: s.title }, key) : /* @__PURE__ */ jsx17("span", { className: chipClass, children: s.title }, key);
1868
+ }
1869
+ if (display === "urls") {
1870
+ const shown = s.url ?? "";
1871
+ return /* @__PURE__ */ jsxs15("a", { className: "ods-chat-sources__url", ...linkProps ?? {}, children: [
1872
+ idx,
1873
+ /* @__PURE__ */ jsx17("span", { className: "ods-chat-sources__url-text", children: shown || s.title })
1874
+ ] }, key);
1875
+ }
1876
+ const Row = linkProps ? "a" : "div";
1877
+ return /* @__PURE__ */ jsxs15(
1878
+ Row,
1879
+ {
1880
+ className: cn("ods-chat-sources__row", s.url && "ods-chat-sources__row--link"),
1881
+ ...linkProps ?? {},
1882
+ children: [
1883
+ idx,
1884
+ /* @__PURE__ */ jsxs15("span", { className: "ods-chat-sources__body", children: [
1885
+ /* @__PURE__ */ jsx17("span", { className: "ods-chat-sources__title", children: s.title }),
1886
+ s.snippet && /* @__PURE__ */ jsx17("span", { className: "ods-chat-sources__snippet", children: s.snippet })
1887
+ ] }),
1888
+ (s.meta ?? (s.url ? hostOf2(s.url) : null)) && /* @__PURE__ */ jsx17("span", { className: "ods-chat-sources__meta", children: s.meta ?? hostOf2(s.url) })
1889
+ ]
1890
+ },
1891
+ key
1892
+ );
1893
+ }) })
1894
+ ]
1895
+ }
1896
+ );
1897
+ });
1898
+ ChatSources.displayName = "ChatSources";
1899
+
1900
+ // src/components/ChatSuggestions/ChatSuggestions.tsx
1901
+ import { forwardRef as forwardRef17 } from "react";
1902
+ import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
1903
+ function normalize(item) {
1904
+ return typeof item === "string" ? { label: item, value: item } : item;
1905
+ }
1906
+ function resolveValue(s) {
1907
+ if (s.value != null) return s.value;
1908
+ return typeof s.label === "string" ? s.label : "";
1909
+ }
1910
+ var ChatSuggestions = forwardRef17(
1911
+ function ChatSuggestions2({ items, onSelect, label, size = "md", layout = "wrap", disabled = false, className, ...rest }, ref) {
1912
+ return /* @__PURE__ */ jsxs16(
1913
+ "div",
1914
+ {
1915
+ ...rest,
1916
+ ref,
1917
+ className: cn(
1918
+ "ods-chat-suggestions",
1919
+ `ods-chat-suggestions--${size}`,
1920
+ `ods-chat-suggestions--${layout}`,
1921
+ className
1922
+ ),
1923
+ role: "group",
1924
+ "aria-label": typeof label === "string" ? label : "Suggested replies",
1925
+ children: [
1926
+ label && /* @__PURE__ */ jsx18("span", { className: "ods-chat-suggestions__label", children: label }),
1927
+ /* @__PURE__ */ jsx18("div", { className: "ods-chat-suggestions__track", children: items.map((raw, i) => {
1928
+ const s = normalize(raw);
1929
+ const isDisabled = disabled || s.disabled;
1930
+ return /* @__PURE__ */ jsxs16(
1931
+ "button",
1932
+ {
1933
+ type: "button",
1934
+ className: "ods-chat-suggestions__chip",
1935
+ disabled: isDisabled,
1936
+ onClick: () => onSelect?.(resolveValue(s), s),
1937
+ children: [
1938
+ s.icon && /* @__PURE__ */ jsx18("span", { className: "ods-chat-suggestions__chip-icon", children: s.icon }),
1939
+ /* @__PURE__ */ jsx18("span", { className: "ods-chat-suggestions__chip-label", children: s.label })
1940
+ ]
1941
+ },
1942
+ s.id ?? `${i}`
1943
+ );
1944
+ }) })
1945
+ ]
1946
+ }
1947
+ );
1948
+ }
1949
+ );
1950
+ ChatSuggestions.displayName = "ChatSuggestions";
1951
+
1952
+ // src/components/ChatThinking/ChatThinking.tsx
1953
+ import {
1954
+ forwardRef as forwardRef18,
1955
+ useEffect as useEffect3,
1956
+ useState as useState9
1957
+ } from "react";
1958
+ import { Fragment as Fragment3, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
1959
+ var ChatThinking = forwardRef18(function ChatThinking2({
1960
+ variant = "dots",
1961
+ label,
1962
+ labels,
1963
+ cycleMs = 2200,
1964
+ size = "md",
1965
+ srLabel = "Assistant is thinking",
1966
+ className,
1967
+ ...rest
1968
+ }, ref) {
1969
+ const cycling = Array.isArray(labels) && labels.length > 0;
1970
+ const [idx, setIdx] = useState9(0);
1971
+ useEffect3(() => {
1972
+ if (!cycling || labels.length < 2) return;
1973
+ const id = window.setInterval(() => setIdx((i) => (i + 1) % labels.length), cycleMs);
1974
+ return () => window.clearInterval(id);
1975
+ }, [cycling, labels, cycleMs]);
1976
+ const activeLabel = cycling ? labels[idx % labels.length] : label;
1977
+ const fadeKey = cycling ? idx : void 0;
1978
+ let indicator;
1979
+ switch (variant) {
1980
+ case "wave":
1981
+ indicator = /* @__PURE__ */ jsx19("span", { className: "ods-thinking__wave", children: [0, 1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx19("span", { className: "ods-thinking__wave-dot" }, i)) });
1982
+ break;
1983
+ case "pulse":
1984
+ indicator = /* @__PURE__ */ jsx19("span", { className: "ods-thinking__pulse" });
1985
+ break;
1986
+ case "bars":
1987
+ indicator = /* @__PURE__ */ jsx19("span", { className: "ods-thinking__bars", children: [0, 1, 2, 3].map((i) => /* @__PURE__ */ jsx19("span", { className: "ods-thinking__bar" }, i)) });
1988
+ break;
1989
+ case "shimmer":
1990
+ indicator = /* @__PURE__ */ jsx19("span", { className: "ods-thinking__shimmer", children: activeLabel ?? "Thinking\u2026" }, fadeKey);
1991
+ break;
1992
+ case "cursor":
1993
+ indicator = /* @__PURE__ */ jsxs17(Fragment3, { children: [
1994
+ /* @__PURE__ */ jsx19("span", { className: "ods-thinking__cursor-label ods-thinking__fade", children: activeLabel ?? "Thinking" }, fadeKey),
1995
+ /* @__PURE__ */ jsx19("span", { className: "ods-thinking__cursor" })
1996
+ ] });
1997
+ break;
1998
+ case "dots":
1999
+ default:
2000
+ indicator = /* @__PURE__ */ jsx19("span", { className: "ods-thinking__dots", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx19("span", { className: "ods-thinking__dot" }, i)) });
2001
+ }
2002
+ const labelInline = variant !== "shimmer" && variant !== "cursor";
2003
+ const inlineLabel = cycling ? activeLabel : label;
2004
+ return /* @__PURE__ */ jsxs17(
2005
+ "div",
2006
+ {
2007
+ ...rest,
2008
+ ref,
2009
+ role: "status",
2010
+ "aria-live": "polite",
2011
+ className: cn("ods-thinking", `ods-thinking--${variant}`, `ods-thinking--${size}`, className),
2012
+ children: [
2013
+ /* @__PURE__ */ jsx19("span", { className: "ods-thinking__sr", children: srLabel }),
2014
+ /* @__PURE__ */ jsx19("span", { className: "ods-thinking__indicator", "aria-hidden": "true", children: indicator }),
2015
+ labelInline && inlineLabel && /* @__PURE__ */ jsx19("span", { className: "ods-thinking__label ods-thinking__fade", "aria-hidden": "true", children: inlineLabel }, fadeKey)
2016
+ ]
2017
+ }
2018
+ );
2019
+ });
2020
+ ChatThinking.displayName = "ChatThinking";
2021
+
2022
+ // src/components/CountUp/CountUp.tsx
2023
+ import {
2024
+ forwardRef as forwardRef19,
2025
+ useEffect as useEffect4,
2026
+ useRef as useRef7,
2027
+ useState as useState10
2028
+ } from "react";
2029
+ import { jsxs as jsxs18 } from "react/jsx-runtime";
2030
+ var easeLinear = (t) => t;
2031
+ var easeOutCubic = (t) => 1 - (1 - t) ** 3;
2032
+ var easeOutQuart = (t) => 1 - (1 - t) ** 4;
2033
+ var easeOutExpo = (t) => t === 1 ? 1 : 1 - 2 ** (-10 * t);
2034
+ var CountUp = forwardRef19(function CountUp2({
2035
+ value,
2036
+ from = 0,
2037
+ duration = 800,
2038
+ easing = easeOutCubic,
2039
+ decimals = 0,
2040
+ formatValue,
2041
+ prefix,
2042
+ suffix,
2043
+ delay = 0,
2044
+ disableAnimation = false,
2045
+ onComplete,
2046
+ className,
2047
+ ...rest
2048
+ }, ref) {
2049
+ const [n, setN] = useState10(disableAnimation ? value : from);
2050
+ const lastRendered = useRef7(disableAnimation ? value : from);
2051
+ useEffect4(() => {
2052
+ const reduced = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
2053
+ if (disableAnimation || reduced) {
2054
+ setN(value);
2055
+ lastRendered.current = value;
2056
+ onComplete?.();
2057
+ return;
2058
+ }
2059
+ const startValue = lastRendered.current;
2060
+ const delta = value - startValue;
2061
+ if (delta === 0) return;
2062
+ let raf = null;
2063
+ let timeoutId = null;
2064
+ let startTime = null;
2065
+ let cancelled = false;
2066
+ const tick = (ts) => {
2067
+ if (cancelled) return;
2068
+ if (startTime === null) startTime = ts;
2069
+ const t = Math.min(1, (ts - startTime) / Math.max(1, duration));
2070
+ const eased = easing(t);
2071
+ const current = startValue + delta * eased;
2072
+ setN(current);
2073
+ lastRendered.current = current;
2074
+ if (t < 1) {
2075
+ raf = requestAnimationFrame(tick);
2076
+ } else {
2077
+ lastRendered.current = value;
2078
+ setN(value);
2079
+ onComplete?.();
2080
+ }
2081
+ };
2082
+ const start = () => {
2083
+ raf = requestAnimationFrame(tick);
2084
+ };
2085
+ if (delay > 0) {
2086
+ timeoutId = window.setTimeout(start, delay);
2087
+ } else {
2088
+ start();
2089
+ }
2090
+ return () => {
2091
+ cancelled = true;
2092
+ if (raf !== null) cancelAnimationFrame(raf);
2093
+ if (timeoutId !== null) window.clearTimeout(timeoutId);
2094
+ };
2095
+ }, [value, duration, delay, disableAnimation]);
2096
+ const display = formatValue ? formatValue(n) : n.toFixed(decimals);
2097
+ return /* @__PURE__ */ jsxs18(
2098
+ "span",
2099
+ {
2100
+ ...rest,
2101
+ ref,
2102
+ className: cn("ods-count-up", className),
2103
+ "aria-live": "polite",
2104
+ "aria-atomic": "true",
2105
+ children: [
2106
+ prefix,
2107
+ display,
2108
+ suffix
2109
+ ]
2110
+ }
2111
+ );
2112
+ });
2113
+ CountUp.displayName = "CountUp";
2114
+
2115
+ // src/hooks/useTextareaCommands.ts
2116
+ import {
2117
+ useCallback as useCallback3,
2118
+ useEffect as useEffect5,
2119
+ useMemo as useMemo2,
2120
+ useRef as useRef8,
2121
+ useState as useState11
2122
+ } from "react";
2123
+ function findOpenTrigger(value, caret, trigger) {
2124
+ let i = caret - 1;
2125
+ while (i >= 0) {
2126
+ const ch = value[i];
2127
+ if (ch === "\n" || ch === " " || ch === " ") return null;
2128
+ if (value.startsWith(trigger, i)) {
2129
+ const before = i === 0 ? "" : value[i - 1];
2130
+ if (i === 0 || before === " " || before === "\n" || before === " ") {
2131
+ return {
2132
+ triggerIndex: i,
2133
+ query: value.slice(i + trigger.length, caret)
2134
+ };
2135
+ }
2136
+ return null;
2137
+ }
2138
+ i--;
2139
+ }
2140
+ return null;
2141
+ }
2142
+ function getCaretRect(textarea, caret) {
2143
+ if (typeof document === "undefined") return null;
2144
+ const mirror = document.createElement("div");
2145
+ const styles = window.getComputedStyle(textarea);
2146
+ for (const prop of [
2147
+ "boxSizing",
2148
+ "width",
2149
+ "fontFamily",
2150
+ "fontSize",
2151
+ "fontWeight",
2152
+ "fontStyle",
2153
+ "letterSpacing",
2154
+ "lineHeight",
2155
+ "paddingTop",
2156
+ "paddingRight",
2157
+ "paddingBottom",
2158
+ "paddingLeft",
2159
+ "borderTopWidth",
2160
+ "borderRightWidth",
2161
+ "borderBottomWidth",
2162
+ "borderLeftWidth",
2163
+ "textTransform",
2164
+ "wordSpacing",
2165
+ "tabSize",
2166
+ "whiteSpace"
2167
+ ]) {
2168
+ mirror.style[prop] = styles[prop];
2169
+ }
2170
+ mirror.style.position = "absolute";
2171
+ mirror.style.visibility = "hidden";
2172
+ mirror.style.overflow = "hidden";
2173
+ mirror.style.top = "0";
2174
+ mirror.style.left = "0";
2175
+ mirror.style.whiteSpace = "pre-wrap";
2176
+ mirror.style.wordWrap = "break-word";
2177
+ mirror.textContent = textarea.value.slice(0, caret);
2178
+ const marker = document.createElement("span");
2179
+ marker.textContent = "\u200B";
2180
+ mirror.appendChild(marker);
2181
+ document.body.appendChild(mirror);
2182
+ const taRect = textarea.getBoundingClientRect();
2183
+ const markerRect = marker.getBoundingClientRect();
2184
+ const mirrorRect = mirror.getBoundingClientRect();
2185
+ const x = taRect.left + (markerRect.left - mirrorRect.left) - textarea.scrollLeft;
2186
+ const y = taRect.top + (markerRect.top - mirrorRect.top) - textarea.scrollTop;
2187
+ const out = new DOMRect(x, y, 0, markerRect.height || 16);
2188
+ document.body.removeChild(mirror);
2189
+ return out;
2190
+ }
2191
+ function useTextareaCommands({
2192
+ textareaRef,
2193
+ value,
2194
+ onChange,
2195
+ commands,
2196
+ trigger = "/",
2197
+ openOnEmptyTrigger = true,
2198
+ maxItems = 8
2199
+ }) {
2200
+ const [isOpen, setIsOpen] = useState11(false);
2201
+ const [query, setQuery] = useState11("");
2202
+ const [activeIndex, setActiveIndex] = useState11(0);
2203
+ const [triggerIndex, setTriggerIndex] = useState11(null);
2204
+ const [caretRect, setCaretRect] = useState11(null);
2205
+ const dismissedAtRef = useRef8(null);
2206
+ const items = useMemo2(() => {
2207
+ const q = query.trim().toLowerCase();
2208
+ if (!q) return commands.slice(0, maxItems);
2209
+ return commands.filter((c) => {
2210
+ const hay = [
2211
+ typeof c.label === "string" ? c.label : "",
2212
+ typeof c.description === "string" ? c.description : "",
2213
+ c.id,
2214
+ ...c.keywords ?? []
2215
+ ].join(" ").toLowerCase();
2216
+ return hay.includes(q);
2217
+ }).slice(0, maxItems);
2218
+ }, [commands, query, maxItems]);
2219
+ useEffect5(() => {
2220
+ const ta = textareaRef.current;
2221
+ if (!ta) return;
2222
+ const caret = ta.selectionStart ?? 0;
2223
+ const dismissedAt = dismissedAtRef.current;
2224
+ if (dismissedAt && dismissedAt.value === value && dismissedAt.caret === caret) {
2225
+ return;
2226
+ }
2227
+ const found = findOpenTrigger(value, caret, trigger);
2228
+ if (!found) {
2229
+ if (isOpen) setIsOpen(false);
2230
+ setTriggerIndex(null);
2231
+ return;
2232
+ }
2233
+ if (dismissedAt) dismissedAtRef.current = null;
2234
+ if (found.query.length > 0 || openOnEmptyTrigger) {
2235
+ setQuery(found.query);
2236
+ setTriggerIndex(found.triggerIndex);
2237
+ setIsOpen(true);
2238
+ setActiveIndex(0);
2239
+ setCaretRect(getCaretRect(ta, caret));
2240
+ }
2241
+ }, [value, trigger, openOnEmptyTrigger, isOpen, textareaRef]);
2242
+ const commit = useCallback3(
2243
+ (cmd) => {
2244
+ const ta = textareaRef.current;
2245
+ if (!ta || triggerIndex == null) return;
2246
+ const insertText = typeof cmd.insert === "function" ? cmd.insert(query) : cmd.insert;
2247
+ const caret = ta.selectionStart ?? value.length;
2248
+ const before = value.slice(0, triggerIndex);
2249
+ const after = value.slice(caret);
2250
+ const next = `${before}${insertText}${after}`;
2251
+ dismissedAtRef.current = {
2252
+ value,
2253
+ caret
2254
+ };
2255
+ onChange(next);
2256
+ setIsOpen(false);
2257
+ setTriggerIndex(null);
2258
+ requestAnimationFrame(() => {
2259
+ const pos = before.length + insertText.length;
2260
+ ta.focus();
2261
+ ta.setSelectionRange(pos, pos);
2262
+ });
2263
+ },
2264
+ [textareaRef, triggerIndex, query, value, onChange]
2265
+ );
2266
+ const dismiss = useCallback3(() => {
2267
+ const ta = textareaRef.current;
2268
+ dismissedAtRef.current = {
2269
+ value,
2270
+ caret: ta?.selectionStart ?? value.length
2271
+ };
2272
+ setIsOpen(false);
2273
+ setTriggerIndex(null);
2274
+ }, [textareaRef, value]);
2275
+ const onKeyDown = useCallback3(
2276
+ (e) => {
2277
+ if (!isOpen) return false;
2278
+ if (e.key === "ArrowDown") {
2279
+ e.preventDefault();
2280
+ setActiveIndex((i) => Math.min(items.length - 1, i + 1));
2281
+ return true;
2282
+ }
2283
+ if (e.key === "ArrowUp") {
2284
+ e.preventDefault();
2285
+ setActiveIndex((i) => Math.max(0, i - 1));
2286
+ return true;
2287
+ }
2288
+ if (e.key === "Enter" || e.key === "Tab") {
2289
+ const pick2 = items[activeIndex];
2290
+ if (pick2) {
2291
+ e.preventDefault();
2292
+ commit(pick2);
2293
+ return true;
2294
+ }
2295
+ }
2296
+ if (e.key === "Escape") {
2297
+ e.preventDefault();
2298
+ dismiss();
2299
+ return true;
2300
+ }
2301
+ return false;
2302
+ },
2303
+ [isOpen, items, activeIndex, commit, dismiss]
2304
+ );
2305
+ return {
2306
+ isOpen,
2307
+ query,
2308
+ activeIndex,
2309
+ items,
2310
+ onKeyDown,
2311
+ dismiss,
2312
+ commit,
2313
+ caretRect
2314
+ };
2315
+ }
2316
+
2317
+ // src/hooks/useTextareaSelection.ts
2318
+ import { useCallback as useCallback4, useEffect as useEffect6, useState as useState12 } from "react";
2319
+ function getSelectionRect(textarea, start, end) {
2320
+ if (typeof document === "undefined") return null;
2321
+ if (start === end) return null;
2322
+ const mirror = document.createElement("div");
2323
+ const styles = window.getComputedStyle(textarea);
2324
+ for (const prop of [
2325
+ "boxSizing",
2326
+ "width",
2327
+ "fontFamily",
2328
+ "fontSize",
2329
+ "fontWeight",
2330
+ "fontStyle",
2331
+ "letterSpacing",
2332
+ "lineHeight",
2333
+ "paddingTop",
2334
+ "paddingRight",
2335
+ "paddingBottom",
2336
+ "paddingLeft",
2337
+ "borderTopWidth",
2338
+ "borderRightWidth",
2339
+ "borderBottomWidth",
2340
+ "borderLeftWidth",
2341
+ "textTransform",
2342
+ "wordSpacing",
2343
+ "tabSize",
2344
+ "whiteSpace"
2345
+ ]) {
2346
+ mirror.style[prop] = styles[prop];
2347
+ }
2348
+ mirror.style.position = "absolute";
2349
+ mirror.style.visibility = "hidden";
2350
+ mirror.style.overflow = "hidden";
2351
+ mirror.style.top = "0";
2352
+ mirror.style.left = "0";
2353
+ mirror.style.whiteSpace = "pre-wrap";
2354
+ mirror.style.wordWrap = "break-word";
2355
+ const pre = document.createTextNode(textarea.value.slice(0, start));
2356
+ const range = document.createElement("span");
2357
+ range.textContent = textarea.value.slice(start, end) || "\u200B";
2358
+ const post = document.createTextNode(textarea.value.slice(end));
2359
+ mirror.appendChild(pre);
2360
+ mirror.appendChild(range);
2361
+ mirror.appendChild(post);
2362
+ document.body.appendChild(mirror);
2363
+ const taRect = textarea.getBoundingClientRect();
2364
+ const rangeRect = range.getBoundingClientRect();
2365
+ const mirrorRect = mirror.getBoundingClientRect();
2366
+ const out = new DOMRect(
2367
+ taRect.left + (rangeRect.left - mirrorRect.left) - textarea.scrollLeft,
2368
+ taRect.top + (rangeRect.top - mirrorRect.top) - textarea.scrollTop,
2369
+ rangeRect.width,
2370
+ rangeRect.height
2371
+ );
2372
+ document.body.removeChild(mirror);
2373
+ return out;
2374
+ }
2375
+ function useTextareaSelection({
2376
+ textareaRef,
2377
+ value,
2378
+ onChange
2379
+ }) {
2380
+ const [start, setStart] = useState12(0);
2381
+ const [end, setEnd] = useState12(0);
2382
+ const [rect, setRect] = useState12(null);
2383
+ useEffect6(() => {
2384
+ if (typeof document === "undefined") return;
2385
+ const handler = () => {
2386
+ const ta = textareaRef.current;
2387
+ if (!ta || document.activeElement !== ta) {
2388
+ setStart(0);
2389
+ setEnd(0);
2390
+ setRect(null);
2391
+ return;
2392
+ }
2393
+ const s = ta.selectionStart ?? 0;
2394
+ const e = ta.selectionEnd ?? 0;
2395
+ setStart(s);
2396
+ setEnd(e);
2397
+ setRect(s !== e ? getSelectionRect(ta, s, e) : null);
2398
+ };
2399
+ document.addEventListener("selectionchange", handler);
2400
+ return () => document.removeEventListener("selectionchange", handler);
2401
+ }, [textareaRef]);
2402
+ const active = start !== end;
2403
+ const text = active ? value.slice(start, end) : "";
2404
+ const writeToClipboard = useCallback4(async (str) => {
2405
+ try {
2406
+ if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
2407
+ await navigator.clipboard.writeText(str);
2408
+ return true;
2409
+ }
2410
+ } catch {
2411
+ }
2412
+ try {
2413
+ const tmp = document.createElement("textarea");
2414
+ tmp.value = str;
2415
+ tmp.style.position = "fixed";
2416
+ tmp.style.left = "-9999px";
2417
+ document.body.appendChild(tmp);
2418
+ tmp.select();
2419
+ const ok = document.execCommand("copy");
2420
+ document.body.removeChild(tmp);
2421
+ return ok;
2422
+ } catch {
2423
+ return false;
2424
+ }
2425
+ }, []);
2426
+ const copy = useCallback4(async () => {
2427
+ if (!active) return false;
2428
+ return writeToClipboard(text);
2429
+ }, [active, text, writeToClipboard]);
2430
+ const replace = useCallback4(
2431
+ (str) => {
2432
+ const ta = textareaRef.current;
2433
+ if (!ta) return;
2434
+ const next = value.slice(0, start) + str + value.slice(end);
2435
+ onChange(next);
2436
+ requestAnimationFrame(() => {
2437
+ ta.focus();
2438
+ const caret = start + str.length;
2439
+ ta.setSelectionRange(caret, caret);
2440
+ });
2441
+ },
2442
+ [textareaRef, value, start, end, onChange]
2443
+ );
2444
+ const cut = useCallback4(async () => {
2445
+ if (!active) return false;
2446
+ const ok = await writeToClipboard(text);
2447
+ if (ok) replace("");
2448
+ return ok;
2449
+ }, [active, text, writeToClipboard, replace]);
2450
+ const wrap = useCallback4(
2451
+ (open, close) => {
2452
+ const ta = textareaRef.current;
2453
+ if (!ta) return;
2454
+ const closing = close ?? open;
2455
+ const before = value.slice(0, start);
2456
+ const sel = value.slice(start, end);
2457
+ const after = value.slice(end);
2458
+ const next = `${before}${open}${sel}${closing}${after}`;
2459
+ onChange(next);
2460
+ requestAnimationFrame(() => {
2461
+ ta.focus();
2462
+ const newStart = start;
2463
+ const newEnd = end + open.length + closing.length;
2464
+ ta.setSelectionRange(newStart, newEnd);
2465
+ });
2466
+ },
2467
+ [textareaRef, value, start, end, onChange]
2468
+ );
2469
+ return {
2470
+ active,
2471
+ text,
2472
+ start,
2473
+ end,
2474
+ rect,
2475
+ copy,
2476
+ cut,
2477
+ wrap,
2478
+ replace
2479
+ };
2480
+ }
2481
+
2482
+ // src/hooks/useTextareaTools.tsx
2483
+ import {
2484
+ CodeIcon,
2485
+ HeadingIcon,
2486
+ ListBulletedIcon,
2487
+ ListNumberedIcon,
2488
+ QuotesIcon,
2489
+ RedoIcon,
2490
+ TextBoldIcon,
2491
+ TextItalicIcon,
2492
+ TextLinkIcon,
2493
+ TextStrikethroughIcon,
2494
+ UndoIcon
2495
+ } from "@octaviaflow/icons";
2496
+ import { useCallback as useCallback5, useMemo as useMemo3, useRef as useRef9 } from "react";
2497
+ import { jsx as jsx20 } from "react/jsx-runtime";
2498
+ function useTextareaTools({
2499
+ textareaRef,
2500
+ value,
2501
+ onChange,
2502
+ tools
2503
+ }) {
2504
+ const valueRef = useRef9(value);
2505
+ valueRef.current = value;
2506
+ const helpers = useMemo3(() => {
2507
+ const getTa = () => textareaRef.current;
2508
+ const getSelection = () => {
2509
+ const ta = getTa();
2510
+ const s = ta?.selectionStart ?? 0;
2511
+ const e = ta?.selectionEnd ?? 0;
2512
+ return {
2513
+ text: valueRef.current.slice(s, e),
2514
+ start: s,
2515
+ end: e,
2516
+ active: s !== e
2517
+ };
2518
+ };
2519
+ const setValue = (next) => onChange(next);
2520
+ const replace = (text) => {
2521
+ const ta = getTa();
2522
+ if (!ta) return;
2523
+ const { start, end } = getSelection();
2524
+ const next = valueRef.current.slice(0, start) + text + valueRef.current.slice(end);
2525
+ onChange(next);
2526
+ requestAnimationFrame(() => {
2527
+ ta.focus();
2528
+ const caret = start + text.length;
2529
+ ta.setSelectionRange(caret, caret);
2530
+ });
2531
+ };
2532
+ const insert = (text) => replace(text);
2533
+ const wrap = (open, close) => {
2534
+ const ta = getTa();
2535
+ if (!ta) return;
2536
+ const closing = close ?? open;
2537
+ const { start, end } = getSelection();
2538
+ const sel = valueRef.current.slice(start, end);
2539
+ const next = valueRef.current.slice(0, start) + open + sel + closing + valueRef.current.slice(end);
2540
+ onChange(next);
2541
+ requestAnimationFrame(() => {
2542
+ ta.focus();
2543
+ if (start === end) {
2544
+ const caret = start + open.length;
2545
+ ta.setSelectionRange(caret, caret);
2546
+ } else {
2547
+ ta.setSelectionRange(start, end + open.length + closing.length);
2548
+ }
2549
+ });
2550
+ };
2551
+ const prependLines = (prefix) => {
2552
+ const ta = getTa();
2553
+ if (!ta) return;
2554
+ const { start, end } = getSelection();
2555
+ const v = valueRef.current;
2556
+ const lineStart = v.lastIndexOf("\n", start - 1) + 1;
2557
+ const lineEnd = (() => {
2558
+ const idx = v.indexOf("\n", end);
2559
+ return idx === -1 ? v.length : idx;
2560
+ })();
2561
+ const block = v.slice(lineStart, lineEnd);
2562
+ const updated = block.split("\n").map((line) => `${prefix}${line}`).join("\n");
2563
+ const next = v.slice(0, lineStart) + updated + v.slice(lineEnd);
2564
+ onChange(next);
2565
+ requestAnimationFrame(() => {
2566
+ ta.focus();
2567
+ ta.setSelectionRange(lineStart, lineStart + updated.length);
2568
+ });
2569
+ };
2570
+ const undo = () => {
2571
+ try {
2572
+ getTa()?.focus();
2573
+ document.execCommand("undo");
2574
+ } catch {
2575
+ }
2576
+ };
2577
+ const redo = () => {
2578
+ try {
2579
+ getTa()?.focus();
2580
+ document.execCommand("redo");
2581
+ } catch {
2582
+ }
2583
+ };
2584
+ return {
2585
+ get value() {
2586
+ return valueRef.current;
2587
+ },
2588
+ get selection() {
2589
+ return getSelection();
2590
+ },
2591
+ setValue,
2592
+ replace,
2593
+ insert,
2594
+ wrap,
2595
+ prependLines,
2596
+ undo,
2597
+ redo,
2598
+ getTextarea: getTa
2599
+ };
2600
+ }, [textareaRef, onChange]);
2601
+ const visibleTools = useMemo3(
2602
+ () => tools.filter((t) => t.isVisible ? t.isVisible(helpers) : true),
2603
+ [tools, helpers]
2604
+ );
2605
+ const runTool = useCallback5(
2606
+ async (id) => {
2607
+ const tool = tools.find((t) => t.id === id);
2608
+ if (!tool || tool.kind === "divider") return;
2609
+ await tool.onAction?.(helpers);
2610
+ },
2611
+ [tools, helpers]
2612
+ );
2613
+ return { tools: visibleTools, runTool, helpers };
2614
+ }
2615
+ var wrapTool = (id, open, close, label, icon, title) => ({
2616
+ id,
2617
+ label,
2618
+ icon,
2619
+ title,
2620
+ onAction: (h) => h.wrap(open, close)
2621
+ });
2622
+ var prependLineTool = (id, prefix, label, icon, title) => ({
2623
+ id,
2624
+ label,
2625
+ icon,
2626
+ title,
2627
+ onAction: (h) => h.prependLines(prefix)
2628
+ });
2629
+ var textareaTools = {
2630
+ bold: () => wrapTool("bold", "**", "**", "Bold", /* @__PURE__ */ jsx20(TextBoldIcon, {}), "Bold (\u2318B)"),
2631
+ italic: () => wrapTool("italic", "*", "*", "Italic", /* @__PURE__ */ jsx20(TextItalicIcon, {}), "Italic (\u2318I)"),
2632
+ strikethrough: () => wrapTool("strike", "~~", "~~", "Strikethrough", /* @__PURE__ */ jsx20(TextStrikethroughIcon, {}), "Strikethrough"),
2633
+ code: () => wrapTool("code", "`", "`", "Code", /* @__PURE__ */ jsx20(CodeIcon, {}), "Inline code"),
2634
+ codeBlock: () => ({
2635
+ id: "code-block",
2636
+ label: "Code block",
2637
+ icon: /* @__PURE__ */ jsx20(CodeIcon, {}),
2638
+ title: "Code block",
2639
+ onAction: (h) => h.wrap("```\n", "\n```")
2640
+ }),
2641
+ link: () => ({
2642
+ id: "link",
2643
+ label: "Link",
2644
+ icon: /* @__PURE__ */ jsx20(TextLinkIcon, {}),
2645
+ title: "Insert link",
2646
+ onAction: (h) => {
2647
+ const sel = h.selection;
2648
+ const text = sel.active ? sel.text : "link text";
2649
+ h.replace(`[${text}](https://)`);
2650
+ }
2651
+ }),
2652
+ /** Heading. Defaults to H2. Pass a `level` (1–6) to override. */
2653
+ heading: (level = 2) => prependLineTool(
2654
+ `heading-${level}`,
2655
+ `${"#".repeat(level)} `,
2656
+ `H${level}`,
2657
+ /* @__PURE__ */ jsx20(HeadingIcon, {}),
2658
+ `Heading ${level}`
2659
+ ),
2660
+ bulletList: () => prependLineTool("ul", "- ", "Bullet list", /* @__PURE__ */ jsx20(ListBulletedIcon, {}), "Bullet list"),
2661
+ numberedList: () => prependLineTool("ol", "1. ", "Numbered list", /* @__PURE__ */ jsx20(ListNumberedIcon, {}), "Numbered list"),
2662
+ quote: () => prependLineTool("quote", "> ", "Quote", /* @__PURE__ */ jsx20(QuotesIcon, {}), "Quote"),
2663
+ undo: () => ({
2664
+ id: "undo",
2665
+ label: "Undo",
2666
+ icon: /* @__PURE__ */ jsx20(UndoIcon, {}),
2667
+ title: "Undo (\u2318Z)",
2668
+ onAction: (h) => h.undo()
2669
+ }),
2670
+ redo: () => ({
2671
+ id: "redo",
2672
+ label: "Redo",
2673
+ icon: /* @__PURE__ */ jsx20(RedoIcon, {}),
2674
+ title: "Redo (\u2318\u21E7Z)",
2675
+ onAction: (h) => h.redo()
2676
+ }),
2677
+ divider: (id = "divider") => ({
2678
+ id: `${id}-${Math.random().toString(36).slice(2, 8)}`,
2679
+ label: "",
2680
+ kind: "divider"
2681
+ })
2682
+ };
2683
+
2684
+ // src/components/Textarea/Textarea.tsx
2685
+ import { CopyIcon, CutIcon } from "@octaviaflow/icons";
2686
+ import {
2687
+ forwardRef as forwardRef20,
2688
+ useEffect as useEffect7,
2689
+ useId as useId5,
2690
+ useRef as useRef10,
2691
+ useState as useState13
2692
+ } from "react";
2693
+ import { useTextField } from "react-aria";
2694
+ import { createPortal } from "react-dom";
2695
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
2696
+ var Textarea = forwardRef20(function Textarea2({
2697
+ label,
2698
+ error = false,
2699
+ errorMessage,
2700
+ helperText,
2701
+ resize = "vertical",
2702
+ autoResize = false,
2703
+ minRows,
2704
+ maxRows,
2705
+ maxHeight,
2706
+ maxWidth,
2707
+ minHeight,
2708
+ minWidth,
2709
+ maxLength,
2710
+ size = "md",
2711
+ rows = 3,
2712
+ disabled = false,
2713
+ className,
2714
+ style: consumerStyle,
2715
+ defaultValue,
2716
+ value,
2717
+ onChange,
2718
+ id: providedId,
2719
+ commands,
2720
+ commandTrigger = "/",
2721
+ selectionToolbar = false,
2722
+ selectionActions,
2723
+ tools,
2724
+ toolbarPosition = "top",
2725
+ ...props
2726
+ }, forwardedRef) {
2727
+ const innerRef = useRef10(null);
2728
+ const setRef = (node) => {
2729
+ innerRef.current = node;
2730
+ if (typeof forwardedRef === "function") forwardedRef(node);
2731
+ else if (forwardedRef) forwardedRef.current = node;
2732
+ };
2733
+ const reactId = useId5();
2734
+ const baseId = providedId ?? `ods-textarea-${reactId}`;
2735
+ const hintId = error && errorMessage || helperText ? `${baseId}-hint` : void 0;
2736
+ const [charCount, setCharCount] = useState13(() => String(value ?? defaultValue ?? "").length);
2737
+ const ariaNameProps = resolveAccessibleName({
2738
+ label: typeof label === "string" ? label : void 0,
2739
+ ariaLabel: props["aria-label"],
2740
+ ariaLabelledby: props["aria-labelledby"],
2741
+ componentName: "Textarea"
2742
+ });
2743
+ const { labelProps, inputProps } = useTextField(
2744
+ {
2745
+ label: typeof label === "string" ? label : void 0,
2746
+ ...ariaNameProps,
2747
+ isDisabled: disabled,
2748
+ errorMessage: typeof errorMessage === "string" ? errorMessage : void 0,
2749
+ validationState: error ? "invalid" : void 0,
2750
+ inputElementType: "textarea",
2751
+ value,
2752
+ defaultValue
2753
+ },
2754
+ innerRef
2755
+ );
2756
+ const describedBy = [props["aria-describedby"], hintId].filter(Boolean).join(" ") || void 0;
2757
+ const handleChange = (e) => {
2758
+ setCharCount(e.target.value.length);
2759
+ onChange?.(e);
2760
+ };
2761
+ const [liveValue, setLiveValue] = useState13(String(value ?? defaultValue ?? ""));
2762
+ useEffect7(() => {
2763
+ if (value != null) setLiveValue(String(value));
2764
+ }, [value]);
2765
+ const handleChangeWithMirror = (e) => {
2766
+ setLiveValue(e.target.value);
2767
+ handleChange(e);
2768
+ };
2769
+ const setLiveAndCommit = (next) => {
2770
+ setLiveValue(next);
2771
+ if (innerRef.current) innerRef.current.value = next;
2772
+ onChange?.({
2773
+ target: innerRef.current,
2774
+ currentTarget: innerRef.current
2775
+ });
2776
+ setCharCount(next.length);
2777
+ };
2778
+ const cmdPalette = useTextareaCommands({
2779
+ textareaRef: innerRef,
2780
+ value: liveValue,
2781
+ onChange: setLiveAndCommit,
2782
+ commands: commands ?? [],
2783
+ trigger: commandTrigger
2784
+ });
2785
+ const cmdEnabled = (commands?.length ?? 0) > 0;
2786
+ const sel = useTextareaSelection({
2787
+ textareaRef: innerRef,
2788
+ value: liveValue,
2789
+ onChange: setLiveAndCommit
2790
+ });
2791
+ const toolbar = useTextareaTools({
2792
+ textareaRef: innerRef,
2793
+ value: liveValue,
2794
+ onChange: setLiveAndCommit,
2795
+ tools: tools ?? []
2796
+ });
2797
+ const toolbarEnabled = (tools?.length ?? 0) > 0;
2798
+ const handleKeyDownWithCommands = (e) => {
2799
+ if (cmdEnabled) {
2800
+ const consumed = cmdPalette.onKeyDown(e);
2801
+ if (consumed) return;
2802
+ }
2803
+ props.onKeyDown?.(e);
2804
+ };
2805
+ useEffect7(() => {
2806
+ if (!autoResize) return;
2807
+ const el = innerRef.current;
2808
+ if (!el) return;
2809
+ const computed = window.getComputedStyle(el);
2810
+ const fontSize = parseFloat(computed.fontSize) || 16;
2811
+ const lhRaw = computed.lineHeight;
2812
+ const lh = lhRaw === "normal" ? fontSize * 1.2 : lhRaw.endsWith("px") ? parseFloat(lhRaw) : parseFloat(lhRaw) * fontSize;
2813
+ const padding = parseFloat(computed.paddingTop) + parseFloat(computed.paddingBottom);
2814
+ const rowCap = maxRows != null && Number.isFinite(maxRows) ? lh * maxRows + padding : Number.POSITIVE_INFINITY;
2815
+ const pixelCap = typeof maxHeight === "number" ? maxHeight : Number.POSITIVE_INFINITY;
2816
+ const effectiveMax = Math.min(rowCap, pixelCap);
2817
+ const rowFloor = lh * (minRows ?? rows) + padding;
2818
+ el.style.height = "auto";
2819
+ const target = Math.max(rowFloor, Math.min(effectiveMax, el.scrollHeight));
2820
+ el.style.height = `${target}px`;
2821
+ el.style.overflowY = el.scrollHeight > effectiveMax ? "auto" : "hidden";
2822
+ }, [autoResize, value, defaultValue, minRows, maxRows, maxHeight, rows]);
2823
+ const resolvedResize = typeof resize === "boolean" ? resize ? "vertical" : "none" : resize;
2824
+ const toCss = (v) => v == null ? void 0 : typeof v === "number" ? `${v}px` : v;
2825
+ const fieldStyle = {
2826
+ maxHeight: toCss(maxHeight),
2827
+ maxWidth: toCss(maxWidth),
2828
+ minHeight: toCss(minHeight),
2829
+ minWidth: toCss(minWidth),
2830
+ resize: resolvedResize
2831
+ };
2832
+ return /* @__PURE__ */ jsxs19(
2833
+ "div",
2834
+ {
2835
+ className: cn(
2836
+ "ods-textarea",
2837
+ `ods-textarea--${size}`,
2838
+ `ods-textarea--resize-${resolvedResize}`,
2839
+ autoResize && "ods-textarea--auto-resize",
2840
+ error && "ods-textarea--error",
2841
+ disabled && "ods-textarea--disabled",
2842
+ className
2843
+ ),
2844
+ style: consumerStyle,
2845
+ children: [
2846
+ label && /* @__PURE__ */ jsx21("label", { ...labelProps, htmlFor: baseId, className: "ods-textarea__label", children: label }),
2847
+ toolbarEnabled && toolbarPosition === "top" && /* @__PURE__ */ jsx21(TextareaToolbar, { tools: toolbar.tools, onRun: toolbar.runTool }),
2848
+ /* @__PURE__ */ jsxs19("div", { className: "ods-textarea__wrapper", children: [
2849
+ /* @__PURE__ */ jsx21(
2850
+ "textarea",
2851
+ {
2852
+ ...props,
2853
+ ...inputProps,
2854
+ ref: setRef,
2855
+ id: baseId,
2856
+ rows: autoResize ? minRows ?? rows : rows,
2857
+ disabled,
2858
+ maxLength,
2859
+ defaultValue,
2860
+ value,
2861
+ onChange: handleChangeWithMirror,
2862
+ onKeyDown: handleKeyDownWithCommands,
2863
+ className: "ods-textarea__field",
2864
+ style: fieldStyle,
2865
+ "aria-invalid": error || void 0,
2866
+ "aria-describedby": describedBy,
2867
+ "aria-autocomplete": cmdEnabled ? "list" : void 0,
2868
+ "aria-expanded": cmdEnabled ? cmdPalette.isOpen : void 0,
2869
+ "aria-controls": cmdEnabled && cmdPalette.isOpen ? `${baseId}-cmd-list` : void 0,
2870
+ "aria-activedescendant": cmdEnabled && cmdPalette.isOpen && cmdPalette.items[cmdPalette.activeIndex] ? `${baseId}-cmd-${cmdPalette.items[cmdPalette.activeIndex].id}` : void 0
2871
+ }
2872
+ ),
2873
+ cmdEnabled && cmdPalette.isOpen && cmdPalette.items.length > 0 && typeof document !== "undefined" && createPortal(
2874
+ /* @__PURE__ */ jsx21(
2875
+ "ul",
2876
+ {
2877
+ id: `${baseId}-cmd-list`,
2878
+ role: "listbox",
2879
+ "aria-label": "Inline commands",
2880
+ className: "ods-textarea__cmd-popover",
2881
+ style: {
2882
+ position: "fixed",
2883
+ top: (cmdPalette.caretRect?.bottom ?? 0) + 6,
2884
+ left: cmdPalette.caretRect?.left ?? 0
2885
+ },
2886
+ children: cmdPalette.items.map((c, i) => /* @__PURE__ */ jsxs19(
2887
+ "li",
2888
+ {
2889
+ id: `${baseId}-cmd-${c.id}`,
2890
+ role: "option",
2891
+ "aria-selected": i === cmdPalette.activeIndex,
2892
+ className: cn(
2893
+ "ods-textarea__cmd-item",
2894
+ i === cmdPalette.activeIndex && "ods-textarea__cmd-item--active"
2895
+ ),
2896
+ onMouseDown: (e) => {
2897
+ e.preventDefault();
2898
+ cmdPalette.commit(c);
2899
+ },
2900
+ onMouseEnter: () => {
2901
+ },
2902
+ children: [
2903
+ c.icon && /* @__PURE__ */ jsx21("span", { className: "ods-textarea__cmd-icon", children: c.icon }),
2904
+ /* @__PURE__ */ jsxs19("span", { className: "ods-textarea__cmd-text", children: [
2905
+ /* @__PURE__ */ jsx21("span", { className: "ods-textarea__cmd-label", children: c.label }),
2906
+ c.description && /* @__PURE__ */ jsx21("span", { className: "ods-textarea__cmd-desc", children: c.description })
2907
+ ] })
2908
+ ]
2909
+ },
2910
+ c.id
2911
+ ))
2912
+ }
2913
+ ),
2914
+ document.body
2915
+ ),
2916
+ selectionToolbar && sel.active && sel.rect && typeof document !== "undefined" && createPortal(
2917
+ /* @__PURE__ */ jsxs19(
2918
+ "div",
2919
+ {
2920
+ role: "toolbar",
2921
+ "aria-label": "Selection actions",
2922
+ className: "ods-textarea__sel-toolbar",
2923
+ style: {
2924
+ position: "fixed",
2925
+ top: sel.rect.top - 36,
2926
+ left: sel.rect.left
2927
+ },
2928
+ onMouseDown: (e) => e.preventDefault(),
2929
+ children: [
2930
+ /* @__PURE__ */ jsx21(
2931
+ "button",
2932
+ {
2933
+ type: "button",
2934
+ className: "ods-textarea__sel-btn",
2935
+ onClick: () => sel.copy(),
2936
+ "aria-label": "Copy selection",
2937
+ title: "Copy",
2938
+ children: /* @__PURE__ */ jsx21(CopyIcon, { size: "xs" })
2939
+ }
2940
+ ),
2941
+ /* @__PURE__ */ jsx21(
2942
+ "button",
2943
+ {
2944
+ type: "button",
2945
+ className: "ods-textarea__sel-btn",
2946
+ onClick: () => sel.cut(),
2947
+ "aria-label": "Cut selection",
2948
+ title: "Cut",
2949
+ children: /* @__PURE__ */ jsx21(CutIcon, { size: "xs" })
2950
+ }
2951
+ ),
2952
+ selectionActions?.map((a) => /* @__PURE__ */ jsxs19(
2953
+ "button",
2954
+ {
2955
+ type: "button",
2956
+ className: "ods-textarea__sel-btn",
2957
+ onClick: () => a.onAction(sel.text, {
2958
+ replace: sel.replace,
2959
+ wrap: sel.wrap,
2960
+ copy: sel.copy,
2961
+ cut: sel.cut
2962
+ }),
2963
+ title: typeof a.label === "string" ? a.label : void 0,
2964
+ children: [
2965
+ a.icon,
2966
+ a.label && /* @__PURE__ */ jsx21("span", { className: "ods-textarea__sel-btn-label", children: a.label })
2967
+ ]
2968
+ },
2969
+ a.id
2970
+ ))
2971
+ ]
2972
+ }
2973
+ ),
2974
+ document.body
2975
+ ),
2976
+ maxLength != null && /* @__PURE__ */ jsxs19(
2977
+ "span",
2978
+ {
2979
+ className: "ods-textarea__count",
2980
+ "aria-live": charCount > maxLength ? "polite" : "off",
2981
+ children: [
2982
+ charCount,
2983
+ "/",
2984
+ maxLength
2985
+ ]
2986
+ }
2987
+ )
2988
+ ] }),
2989
+ toolbarEnabled && toolbarPosition === "bottom" && /* @__PURE__ */ jsx21(TextareaToolbar, { tools: toolbar.tools, onRun: toolbar.runTool }),
2990
+ error && errorMessage ? /* @__PURE__ */ jsx21("div", { id: hintId, className: "ods-textarea__error-message", role: "alert", children: errorMessage }) : helperText ? /* @__PURE__ */ jsx21("div", { id: hintId, className: "ods-textarea__hint", children: helperText }) : null
2991
+ ]
2992
+ }
2993
+ );
2994
+ });
2995
+ Textarea.displayName = "Textarea";
2996
+ function TextareaToolbar({
2997
+ tools,
2998
+ onRun
2999
+ }) {
3000
+ return /* @__PURE__ */ jsx21(
3001
+ "div",
3002
+ {
3003
+ role: "toolbar",
3004
+ "aria-label": "Formatting",
3005
+ className: "ods-textarea__toolbar",
3006
+ onMouseDown: (e) => {
3007
+ if (e.target.closest(".ods-textarea__toolbar-btn")) {
3008
+ e.preventDefault();
3009
+ }
3010
+ },
3011
+ children: tools.map((t) => {
3012
+ if (t.kind === "divider") {
3013
+ return /* @__PURE__ */ jsx21("span", { className: "ods-textarea__toolbar-divider", "aria-hidden": "true" }, t.id);
3014
+ }
3015
+ return /* @__PURE__ */ jsx21(
3016
+ "button",
3017
+ {
3018
+ type: "button",
3019
+ className: "ods-textarea__toolbar-btn",
3020
+ title: t.title ?? (typeof t.label === "string" ? t.label : void 0),
3021
+ "aria-label": typeof t.label === "string" ? t.label : t.id,
3022
+ onClick: () => onRun(t.id),
3023
+ children: t.icon ? /* @__PURE__ */ jsx21("span", { className: "ods-textarea__toolbar-icon", children: t.icon }) : /* @__PURE__ */ jsx21("span", { className: "ods-textarea__toolbar-text", children: t.label })
3024
+ },
3025
+ t.id
3026
+ );
3027
+ })
3028
+ }
3029
+ );
3030
+ }
3031
+
3032
+ // src/components/TestimonialCard/TestimonialCard.tsx
3033
+ import { QuotesIcon as QuotesIcon2, StarFilledIcon, StarIcon } from "@octaviaflow/icons";
3034
+ import { forwardRef as forwardRef21, useId as useId6 } from "react";
3035
+ import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
3036
+ function isAuthorObject(v) {
3037
+ return typeof v === "object" && v !== null && !("type" in v) && // exclude React elements
3038
+ "name" in v;
3039
+ }
3040
+ var TestimonialCard = forwardRef21(
3041
+ function TestimonialCard2({
3042
+ quote,
3043
+ author,
3044
+ role: legacyRole,
3045
+ avatar: legacyAvatar,
3046
+ initial: legacyInitial,
3047
+ rating,
3048
+ logo,
3049
+ size = "md",
3050
+ radius = "md",
3051
+ id: providedId,
3052
+ className,
3053
+ ...rest
3054
+ }, ref) {
3055
+ const reactId = useId6();
3056
+ const baseId = providedId ?? `ods-testimonial-${reactId}`;
3057
+ const quoteId = `${baseId}-quote`;
3058
+ const authorId = `${baseId}-author`;
3059
+ const resolved = isAuthorObject(author) ? author : {
3060
+ name: author,
3061
+ role: legacyRole,
3062
+ avatar: legacyAvatar ? void 0 : {
3063
+ initials: typeof legacyInitial === "string" ? legacyInitial : typeof author === "string" ? author.charAt(0).toUpperCase() : void 0
3064
+ }
3065
+ };
3066
+ const renderAvatar = () => {
3067
+ if (!isAuthorObject(author) && legacyAvatar) {
3068
+ return /* @__PURE__ */ jsx22(
3069
+ "span",
3070
+ {
3071
+ className: "ods-testimonial__avatar ods-testimonial__avatar--legacy",
3072
+ "aria-hidden": "true",
3073
+ children: legacyAvatar
3074
+ }
3075
+ );
3076
+ }
3077
+ return /* @__PURE__ */ jsx22(
3078
+ Avatar,
3079
+ {
3080
+ size: size === "sm" ? "xs" : size === "lg" ? "md" : "sm",
3081
+ src: resolved.avatar?.src,
3082
+ initials: resolved.avatar?.initials,
3083
+ seed: resolved.avatar?.seed,
3084
+ palette: resolved.avatar?.palette,
3085
+ alt: resolved.avatar?.alt ?? (typeof resolved.name === "string" ? resolved.name : void 0),
3086
+ className: "ods-testimonial__avatar"
3087
+ }
3088
+ );
3089
+ };
3090
+ return /* @__PURE__ */ jsxs20(
3091
+ Card,
3092
+ {
3093
+ ...rest,
3094
+ ref,
3095
+ id: baseId,
3096
+ radius,
3097
+ padding: "none",
3098
+ variant: "subtle",
3099
+ className: cn("ods-testimonial", `ods-testimonial--${size}`, className),
3100
+ "aria-labelledby": authorId,
3101
+ "aria-describedby": quoteId,
3102
+ children: [
3103
+ /* @__PURE__ */ jsxs20("div", { className: "ods-testimonial__head", children: [
3104
+ /* @__PURE__ */ jsx22("span", { className: "ods-testimonial__quote", "aria-hidden": "true", children: /* @__PURE__ */ jsx22(QuotesIcon2, { size: "md" }) }),
3105
+ logo && /* @__PURE__ */ jsx22("span", { className: "ods-testimonial__logo", "aria-hidden": "true", children: logo })
3106
+ ] }),
3107
+ /* @__PURE__ */ jsx22("blockquote", { id: quoteId, className: "ods-testimonial__text", children: quote }),
3108
+ typeof rating === "number" && /* @__PURE__ */ jsx22(
3109
+ "div",
3110
+ {
3111
+ className: "ods-testimonial__rating",
3112
+ role: "img",
3113
+ "aria-label": `${rating} out of 5 stars`,
3114
+ children: Array.from({ length: 5 }).map(
3115
+ (_, i) => i < Math.round(rating) ? /* @__PURE__ */ jsx22(
3116
+ StarFilledIcon,
3117
+ {
3118
+ size: "xs",
3119
+ className: "ods-testimonial__star ods-testimonial__star--on"
3120
+ },
3121
+ i
3122
+ ) : /* @__PURE__ */ jsx22(StarIcon, { size: "xs", className: "ods-testimonial__star" }, i)
3123
+ )
3124
+ }
3125
+ ),
3126
+ /* @__PURE__ */ jsxs20("figcaption", { className: "ods-testimonial__author", id: authorId, children: [
3127
+ renderAvatar(),
3128
+ /* @__PURE__ */ jsxs20("span", { className: "ods-testimonial__author-info", children: [
3129
+ /* @__PURE__ */ jsx22("span", { className: "ods-testimonial__author-name", children: resolved.name }),
3130
+ resolved.role && /* @__PURE__ */ jsx22("span", { className: "ods-testimonial__author-role", children: resolved.role })
3131
+ ] })
3132
+ ] })
3133
+ ]
3134
+ }
3135
+ );
3136
+ }
3137
+ );
3138
+ TestimonialCard.displayName = "TestimonialCard";
3139
+
3140
+ export {
3141
+ TruncatedText,
3142
+ Card,
3143
+ CardHeader,
3144
+ CardBody,
3145
+ CardFooter,
3146
+ CardTitle,
3147
+ CardDescription,
3148
+ AVATAR_PALETTE_SIZE,
3149
+ avatarPaletteIndex,
3150
+ Avatar,
3151
+ AvatarStack,
3152
+ BlogCard,
3153
+ ChatBubble,
3154
+ ChatComposer,
3155
+ ChatLinkPreview,
3156
+ ChatDocPreview,
3157
+ RadioGroup,
3158
+ Radio,
3159
+ ChatInputRequest,
3160
+ ChatFeedback,
3161
+ ChatScrollToBottom,
3162
+ ChatThread,
3163
+ ChatPanel,
3164
+ videoEmbedOf,
3165
+ ChatVideoPreview,
3166
+ ChatSources,
3167
+ ChatSuggestions,
3168
+ ChatThinking,
3169
+ easeLinear,
3170
+ easeOutCubic,
3171
+ easeOutQuart,
3172
+ easeOutExpo,
3173
+ CountUp,
3174
+ useTextareaCommands,
3175
+ useTextareaSelection,
3176
+ useTextareaTools,
3177
+ textareaTools,
3178
+ Textarea,
3179
+ TestimonialCard
3180
+ };
3181
+ //# sourceMappingURL=chunk-VGAUSBP4.js.map