@epam/ai-dial-conversation-messages 1.0.0-dev.471 → 1.0.0-dev.475

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.
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, CodeBlockTheme as n, DeploymentIcon as r, Highlight as i, MDMessageViewer as a, MIME_TYPE_EXT_MAP as o, MessageRating as s, MessageRole as c, RequestStatus as l, ResponseFormat as u, buildCssVars as d, mergeClasses as f, useCollapsedText as p } from "@epam/ai-dial-chat-shared";
2
2
  import { DIAL_ICON_SIZE as m, DialGhostIconButton as h, DialInput as g, DialLinkButton as _, DialNotification as v, DialPopup as y, DialPrimaryButton as b, DialRadioGroup as x, DialRoundedButton as S, DialSkeleton as C, DialSkeletonVariant as w, DialSlider as T, DialSpinner as E, DialTag as D, DialTooltip as O, ElementSize as k, PopupSize as A, RadioGroupOrientation as j } from "@epam/ai-dial-ui-kit";
3
- import { IconCheck as M, IconChevronDown as N, IconChevronUp as P, IconClipboard as F, IconCopy as I, IconDownload as L, IconFile as R, IconFileTypeBmp as ee, IconFileTypeCss as te, IconFileTypeCsv as z, IconFileTypeDoc as ne, IconFileTypeDocx as B, IconFileTypeHtml as V, IconFileTypeJpg as H, IconFileTypeJs as re, IconFileTypeJsx as U, IconFileTypePdf as ie, IconFileTypePhp as ae, IconFileTypePng as oe, IconFileTypePpt as W, IconFileTypeRs as se, IconFileTypeSql as ce, IconFileTypeSvg as le, IconFileTypeTs as ue, IconFileTypeTsx as de, IconFileTypeTxt as fe, IconFileTypeVue as pe, IconFileTypeXls as me, IconFileTypeXml as he, IconFileTypeZip as ge, IconMarkdown as _e, IconMusic as ve, IconPaperclip as ye, IconPencilMinus as be, IconPhoto as G, IconRefresh as xe, IconReload as Se, IconTerminal2 as Ce, IconThumbDown as we, IconThumbUp as Te, IconTrashX as Ee, IconVideo as De, IconX as Oe } from "@tabler/icons-react";
3
+ import { IconCheck as M, IconChevronDown as N, IconChevronUp as P, IconClipboard as F, IconCopy as I, IconDownload as L, IconFile as R, IconFileTypeBmp as z, IconFileTypeCss as B, IconFileTypeCsv as V, IconFileTypeDoc as ee, IconFileTypeDocx as H, IconFileTypeHtml as U, IconFileTypeJpg as te, IconFileTypeJs as ne, IconFileTypeJsx as W, IconFileTypePdf as G, IconFileTypePhp as re, IconFileTypePng as ie, IconFileTypePpt as ae, IconFileTypeRs as oe, IconFileTypeSql as se, IconFileTypeSvg as ce, IconFileTypeTs as le, IconFileTypeTsx as ue, IconFileTypeTxt as de, IconFileTypeVue as fe, IconFileTypeXls as pe, IconFileTypeXml as me, IconFileTypeZip as he, IconMarkdown as ge, IconMusic as _e, IconPaperclip as ve, IconPencilMinus as ye, IconPhoto as be, IconRefresh as xe, IconReload as Se, IconTerminal2 as Ce, IconThumbDown as we, IconThumbUp as Te, IconTrashX as Ee, IconVideo as De, IconX as Oe } from "@tabler/icons-react";
4
4
  import "react-dom";
5
- import { memo as ke, useCallback as Ae, useEffect as je, useMemo as Me, useRef as Ne, useState as K } from "react";
5
+ import { memo as ke, useCallback as Ae, useEffect as je, useId as Me, useMemo as Ne, useRef as Pe, useState as K } from "react";
6
6
  import { Fragment as q, jsx as J, jsxs as Y } from "react/jsx-runtime";
7
7
  //#region ../attachment-input/dist/index.js
8
- var Pe = /* @__PURE__ */ function(e) {
8
+ var Fe = /* @__PURE__ */ function(e) {
9
9
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
10
- }({}), Fe = ({ enabled: e, src: t }) => {
11
- let n = Ne(null), [r, i] = K("idle");
10
+ }({}), Ie = ({ enabled: e, src: t }) => {
11
+ let n = Pe(null), [r, i] = K("idle");
12
12
  return je(() => {
13
13
  i(e && t ? "loading" : "idle");
14
14
  }, [e, t]), je(() => {
@@ -34,75 +34,75 @@ var Pe = /* @__PURE__ */ function(e) {
34
34
  actionBtn: "_actionBtn_1wsze_32",
35
35
  removeBtnImage: "_removeBtnImage_1wsze_43",
36
36
  hoverDownloadIcon: "_hoverDownloadIcon_1wsze_51"
37
- }, Ie = (e) => {
37
+ }, Le = (e) => {
38
38
  if (!e) return R;
39
39
  if (e.startsWith("image/")) switch (e) {
40
40
  case "image/jpeg":
41
- case "image/jpg": return H;
42
- case "image/png": return oe;
43
- case "image/svg+xml": return le;
44
- case "image/bmp": return ee;
45
- default: return G;
41
+ case "image/jpg": return te;
42
+ case "image/png": return ie;
43
+ case "image/svg+xml": return ce;
44
+ case "image/bmp": return z;
45
+ default: return be;
46
46
  }
47
47
  if (e.startsWith("video/")) return De;
48
- if (e.startsWith("audio/")) return ve;
48
+ if (e.startsWith("audio/")) return _e;
49
49
  switch (e) {
50
- case "application/pdf": return ie;
50
+ case "application/pdf": return G;
51
51
  case "application/msword":
52
- case "application/vnd.ms-word": return ne;
53
- case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return B;
54
- case "application/vnd.ms-powerpoint": return W;
55
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return W;
56
- case "application/vnd.ms-excel": return me;
57
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return me;
52
+ case "application/vnd.ms-word": return ee;
53
+ case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return H;
54
+ case "application/vnd.ms-powerpoint": return ae;
55
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ae;
56
+ case "application/vnd.ms-excel": return pe;
57
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return pe;
58
58
  case "application/zip":
59
59
  case "application/x-zip-compressed":
60
60
  case "application/x-rar-compressed":
61
61
  case "application/x-7z-compressed":
62
62
  case "application/gzip":
63
- case "application/x-tar": return ge;
64
- case "text/csv": return z;
65
- case "text/plain": return fe;
63
+ case "application/x-tar": return he;
64
+ case "text/csv": return V;
65
+ case "text/plain": return de;
66
66
  case "text/html":
67
- case "application/xhtml+xml": return V;
67
+ case "application/xhtml+xml": return U;
68
68
  case "text/xml":
69
- case "application/xml": return he;
69
+ case "application/xml": return me;
70
70
  case "application/sql":
71
- case "text/x-sql": return ce;
71
+ case "text/x-sql": return se;
72
72
  case "text/javascript":
73
- case "application/javascript": return re;
74
- case "text/jsx": return U;
73
+ case "application/javascript": return ne;
74
+ case "text/jsx": return W;
75
75
  case "application/typescript":
76
- case "text/typescript": return ue;
77
- case "text/tsx": return de;
78
- case "text/css": return te;
76
+ case "text/typescript": return le;
77
+ case "text/tsx": return ue;
78
+ case "text/css": return B;
79
79
  case "text/x-php":
80
- case "application/x-php": return ae;
80
+ case "application/x-php": return re;
81
81
  case "text/x-rustsrc":
82
- case "application/x-rust": return se;
83
- case "text/x-vue": return pe;
82
+ case "application/x-rust": return oe;
83
+ case "text/x-vue": return fe;
84
84
  default: return R;
85
85
  }
86
- }, Le = (e) => {
87
- let { type: n, contentType: r } = e;
88
- return n === t.Prompt ? Ce : n === t.Pasted ? F : n === t.Image ? G : Ie(r ?? "");
89
86
  }, Re = (e) => {
87
+ let { type: n, contentType: r } = e;
88
+ return n === t.Prompt ? Ce : n === t.Pasted ? F : n === t.Image ? be : Le(r ?? "");
89
+ }, ze = (e) => {
90
90
  let t = e.toLowerCase().split(";")[0].trim(), n = o[t];
91
91
  if (n) return n;
92
92
  let r = t.split("/")[1];
93
93
  if (r && !r.startsWith("vnd.") && !r.includes("+")) return r;
94
- }, ze = (e) => {
94
+ }, Be = (e) => {
95
95
  let { type: n, name: r, contentType: i } = e;
96
96
  if (n === t.Prompt) return "Prompt";
97
97
  if (n === t.Pasted) return "Pasted";
98
98
  if (n === t.Image) return "Image";
99
99
  if (i) {
100
- let e = Re(i);
100
+ let e = ze(i);
101
101
  if (e) return `.${e}`;
102
102
  }
103
103
  let a = r.lastIndexOf(".");
104
104
  return a > 0 && a < r.length - 1 ? `.${r.slice(a + 1).toLowerCase()}` : r;
105
- }, Be = (e, n, r) => {
105
+ }, Ve = (e, n, r) => {
106
106
  let { type: i, status: a, previewUrl: o, url: s } = e, c = a === l.Loading, u = a === l.Error, d = i === t.Image && !!(o ?? s) && !u, p = i === t.Audio && !u, m = f(X.card, u && X.cardError, n && X.cardSelected, !u && !n && i === t.Prompt && X.cardPrompt, !u && !n && i === t.Pasted && X.cardPasted);
107
107
  return {
108
108
  isLoading: c,
@@ -110,35 +110,35 @@ var Pe = /* @__PURE__ */ function(e) {
110
110
  isImage: d,
111
111
  isAudio: p,
112
112
  areActionsVisible: u || r,
113
- BottomIcon: Le(e),
114
- typeLabel: ze(e),
113
+ BottomIcon: Re(e),
114
+ typeLabel: Be(e),
115
115
  cardColorClass: m,
116
116
  removeBtnClass: d ? X.removeBtnImage : X.actionBtn
117
117
  };
118
- }, Ve = (e) => {
118
+ }, He = (e) => {
119
119
  let t = e.lastIndexOf(".");
120
120
  return t > 0 ? e.slice(0, t) : e;
121
- }, He = ({ attachment: n, searchQuery: r = "", onRemove: a, onRetry: o, onExpand: s, onClick: c, isSelected: l, shouldAlwaysShowActions: u, removeLabel: p = "Remove attachment", retryLabel: g = "Retry upload", clickLabel: _ = "Open attachment", colors: v, typography: y, roundedClassName: b = "rounded-xl", showHoverDownloadIcon: x = !1, className: S }) => {
122
- let { id: T, name: D } = n, O = n.previewUrl ?? n.url, A = n.type === t.Pasted, j = A && s !== void 0, M = Me(() => A ? D : Ve(D), [A, D]), N = d({
121
+ }, Ue = ({ attachment: n, searchQuery: r = "", onRemove: a, onRetry: o, onExpand: s, onClick: c, isSelected: l, shouldAlwaysShowActions: u, removeLabel: p = "Remove attachment", retryLabel: g = "Retry upload", clickLabel: _ = "Open attachment", colors: v, typography: y, roundedClassName: b = "rounded-xl", showHoverDownloadIcon: x = !1, className: S }) => {
122
+ let { id: T, name: D } = n, O = n.previewUrl ?? n.url, A = n.type === t.Pasted, j = A && s !== void 0, M = Ne(() => A ? D : He(D), [A, D]), N = d({
123
123
  "--ci-card-border": v?.border,
124
124
  "--ci-card-bg": v?.background,
125
125
  "--ci-card-name": v?.nameText,
126
126
  "--ci-card-meta": v?.metaText
127
- }), { isLoading: P, isError: F, isImage: I, isAudio: R, areActionsVisible: ee, BottomIcon: te, typeLabel: z, cardColorClass: ne, removeBtnClass: B } = Me(() => Be(n, l ?? !1, u ?? !1), [
127
+ }), { isLoading: P, isError: F, isImage: I, isAudio: R, areActionsVisible: z, BottomIcon: B, typeLabel: V, cardColorClass: ee, removeBtnClass: H } = Ne(() => Ve(n, l ?? !1, u ?? !1), [
128
128
  n,
129
129
  l,
130
130
  u
131
- ]), V = c !== void 0 && !j && !P && !F, H = j || V, { imageRef: re, imageLoadStatus: U } = Fe({
131
+ ]), U = c !== void 0 && !j && !P && !F, te = j || U, { imageRef: ne, imageLoadStatus: W } = Ie({
132
132
  enabled: I,
133
133
  src: O
134
- }), ie = () => {
135
- j && s ? s(T) : V && c && c(T);
136
- }, ae = (e) => {
137
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), ie());
134
+ }), G = () => {
135
+ j && s ? s(T) : U && c && c(T);
136
+ }, re = (e) => {
137
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), G());
138
138
  };
139
139
  if (R) return /* @__PURE__ */ Y("div", {
140
140
  style: N,
141
- className: f("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", b, ne, S),
141
+ className: f("group flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 border p-3", b, ee, S),
142
142
  children: [/* @__PURE__ */ Y("div", {
143
143
  className: "flex items-center justify-between gap-2",
144
144
  children: [/* @__PURE__ */ J("span", {
@@ -155,7 +155,7 @@ var Pe = /* @__PURE__ */ function(e) {
155
155
  "aria-hidden": !0
156
156
  }),
157
157
  size: k.Small,
158
- className: f("h-6 w-6 shrink-0 rounded", B),
158
+ className: f("h-6 w-6 shrink-0 rounded", H),
159
159
  "aria-label": _,
160
160
  onClick: (e) => {
161
161
  e.stopPropagation(), c(T);
@@ -168,38 +168,38 @@ var Pe = /* @__PURE__ */ function(e) {
168
168
  preload: "metadata"
169
169
  })]
170
170
  });
171
- let oe = f("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", b, ne, !I && "flex-col gap-3 p-3", H && "cursor-pointer", S), W = /* @__PURE__ */ Y(q, { children: [
171
+ let ie = f("group relative flex h-[100px] w-[100px] flex-shrink-0 border focus-within:outline focus-within:outline-1 focus-within:outline-offset-1", b, ee, !I && "flex-col gap-3 p-3", te && "cursor-pointer", S), ae = /* @__PURE__ */ Y(q, { children: [
172
172
  I ? /* @__PURE__ */ Y("div", {
173
173
  className: "relative h-full w-full overflow-hidden",
174
- children: [U !== Pe.Loaded && /* @__PURE__ */ J(C, {
174
+ children: [W !== Fe.Loaded && /* @__PURE__ */ J(C, {
175
175
  variant: w.Rectangular,
176
176
  width: "100%",
177
177
  height: "100%",
178
- active: U === Pe.Loading,
179
- overlay: /* @__PURE__ */ J(G, {
178
+ active: W === Fe.Loading,
179
+ overlay: /* @__PURE__ */ J(be, {
180
180
  size: m.LG,
181
181
  className: y?.placeholderIconClassName ?? "text-secondary",
182
182
  "aria-hidden": !0
183
183
  }),
184
184
  className: f("absolute inset-0", b)
185
185
  }), /* @__PURE__ */ J("img", {
186
- ref: re,
186
+ ref: ne,
187
187
  src: O,
188
188
  alt: D,
189
189
  loading: "lazy",
190
190
  decoding: "async",
191
- className: f("h-full w-full object-cover transition-opacity duration-200", U === Pe.Loaded ? "opacity-100" : "opacity-0", b)
191
+ className: f("h-full w-full object-cover transition-opacity duration-200", W === Fe.Loaded ? "opacity-100" : "opacity-0", b)
192
192
  })]
193
193
  }) : F ? /* @__PURE__ */ Y(q, { children: [/* @__PURE__ */ Y("div", {
194
194
  className: "flex flex-row items-center gap-1 overflow-hidden",
195
- children: [/* @__PURE__ */ J(te, {
195
+ children: [/* @__PURE__ */ J(B, {
196
196
  size: m.SM,
197
197
  className: f("shrink-0", X.meta),
198
198
  "aria-hidden": !0
199
199
  }), /* @__PURE__ */ J("span", {
200
- title: z,
200
+ title: V,
201
201
  className: f(y?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
202
- children: z
202
+ children: V
203
203
  })]
204
204
  }), /* @__PURE__ */ J("div", {
205
205
  className: "min-w-0 flex-1",
@@ -225,14 +225,14 @@ var Pe = /* @__PURE__ */ function(e) {
225
225
  })
226
226
  }), /* @__PURE__ */ Y("div", {
227
227
  className: "flex flex-row items-center gap-1 overflow-hidden",
228
- children: [/* @__PURE__ */ J(te, {
228
+ children: [/* @__PURE__ */ J(B, {
229
229
  size: m.SM,
230
230
  className: f("shrink-0", X.meta),
231
231
  "aria-hidden": !0
232
232
  }), /* @__PURE__ */ J("span", {
233
- title: z,
233
+ title: V,
234
234
  className: f(y?.metaClassName ?? "dial-tiny-text", "min-w-0 truncate", X.meta),
235
- children: z
235
+ children: V
236
236
  })]
237
237
  })] }),
238
238
  P && /* @__PURE__ */ J("span", {
@@ -244,7 +244,7 @@ var Pe = /* @__PURE__ */ function(e) {
244
244
  })
245
245
  }),
246
246
  !P && /* @__PURE__ */ Y("div", {
247
- className: f("absolute end-1 top-1 flex gap-1 transition-opacity", ee ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
247
+ className: f("absolute end-1 top-1 flex gap-1 transition-opacity", z ? "opacity-100" : "opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 mobile:opacity-100"),
248
248
  children: [
249
249
  F && o && n.errorReason !== e.UnsupportedType && /* @__PURE__ */ J(h, {
250
250
  icon: /* @__PURE__ */ J(Se, {
@@ -252,7 +252,7 @@ var Pe = /* @__PURE__ */ function(e) {
252
252
  "aria-hidden": !0
253
253
  }),
254
254
  size: k.Small,
255
- className: f("h-6 w-6 rounded", B),
255
+ className: f("h-6 w-6 rounded", H),
256
256
  "aria-label": g,
257
257
  onClick: (e) => {
258
258
  e.stopPropagation(), o(T);
@@ -264,7 +264,7 @@ var Pe = /* @__PURE__ */ function(e) {
264
264
  "aria-hidden": !0
265
265
  }),
266
266
  size: k.Small,
267
- className: f("h-6 w-6 rounded", B),
267
+ className: f("h-6 w-6 rounded", H),
268
268
  "aria-label": p,
269
269
  onClick: (e) => {
270
270
  e.stopPropagation(), a?.(T);
@@ -278,23 +278,23 @@ var Pe = /* @__PURE__ */ function(e) {
278
278
  ]
279
279
  })
280
280
  ] });
281
- return H ? /* @__PURE__ */ J("div", {
281
+ return te ? /* @__PURE__ */ J("div", {
282
282
  style: N,
283
- className: oe,
284
- onClick: ie,
285
- onKeyDown: ae,
283
+ className: ie,
284
+ onClick: G,
285
+ onKeyDown: re,
286
286
  tabIndex: 0,
287
287
  role: "button",
288
- "aria-label": V ? _ : void 0,
289
- children: W
288
+ "aria-label": U ? _ : void 0,
289
+ children: ae
290
290
  }) : /* @__PURE__ */ J("div", {
291
291
  style: N,
292
- className: oe,
293
- children: W
292
+ className: ie,
293
+ children: ae
294
294
  });
295
- }, Ue = /* @__PURE__ */ function(e) {
295
+ }, We = /* @__PURE__ */ function(e) {
296
296
  return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
297
- }({}), We = (e, t) => e <= 0 ? {
297
+ }({}), Ge = (e, t) => e <= 0 ? {
298
298
  layout: "none",
299
299
  visibleCount: 0,
300
300
  hiddenCount: 0
@@ -317,11 +317,11 @@ var Pe = /* @__PURE__ */ function(e) {
317
317
  track: "_track_1x7ag_60",
318
318
  indeterminateFill: "_indeterminateFill_1x7ag_64",
319
319
  "attachment-tile-indeterminate": "_attachment-tile-indeterminate_1x7ag_1"
320
- }, Ge = {
320
+ }, Ke = {
321
321
  [e.Network]: "Upload failed · network error",
322
322
  [e.UnsupportedType]: "Upload failed · unsupported file type"
323
- }, Ke = ({ attachment: t, onClick: r, onRetry: i, clickLabel: a = "Download attachment", retryLabel: o = "Retry upload", theme: s = n.Dark, className: c }) => {
324
- let { id: u, name: d, status: p, errorReason: g } = t, _ = p === l.Loading, v = p === l.Error, y = v && (g && Ge[g] || "Upload failed"), { BottomIcon: b, typeLabel: x } = Be(t, !1, !1), S = !v && !_ && r !== void 0, C = v && !!i && g !== e.UnsupportedType, w = S || C ? "pe-5" : void 0, T = () => {
323
+ }, qe = ({ attachment: t, onClick: r, onRetry: i, clickLabel: a = "Download attachment", retryLabel: o = "Retry upload", theme: s = n.Dark, className: c }) => {
324
+ let { id: u, name: d, status: p, errorReason: g } = t, _ = p === l.Loading, v = p === l.Error, y = v && (g && Ke[g] || "Upload failed"), { BottomIcon: b, typeLabel: x } = Ve(t, !1, !1), S = !v && !_ && r !== void 0, C = v && !!i && g !== e.UnsupportedType, w = S || C ? "pe-5" : void 0, T = () => {
325
325
  S && r?.(t);
326
326
  }, E = (e) => {
327
327
  (e.key === "Enter" || e.key === " ") && S && (e.preventDefault(), T());
@@ -381,11 +381,11 @@ var Pe = /* @__PURE__ */ function(e) {
381
381
  children: j
382
382
  })
383
383
  });
384
- }, qe = { tile: "_tile_kvom5_1" }, Je = ({ count: e, onClick: t, ariaLabel: n, children: r, className: i }) => /* @__PURE__ */ J("button", {
384
+ }, Je = { tile: "_tile_kvom5_1" }, Ye = ({ count: e, onClick: t, ariaLabel: n, children: r, className: i }) => /* @__PURE__ */ J("button", {
385
385
  type: "button",
386
386
  onClick: t,
387
387
  "aria-label": n ?? `Show ${e} more attachments`,
388
- className: f("dial-small-semi-text flex size-[84px] items-center justify-center rounded-xl border", qe.tile, i),
388
+ className: f("dial-small-semi-text flex size-[84px] items-center justify-center rounded-xl border", Je.tile, i),
389
389
  children: r ?? /* @__PURE__ */ J("bdi", {
390
390
  dir: "ltr",
391
391
  children: `+${e}`
@@ -396,10 +396,10 @@ var Pe = /* @__PURE__ */ function(e) {
396
396
  headerLabel: "_headerLabel_4zxg9_7",
397
397
  downloadAllButton: "_downloadAllButton_4zxg9_8",
398
398
  imageTile: "_imageTile_4zxg9_12"
399
- }, Ye = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Xe = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: a, ariaLabel: o = "Attachments", clickLabel: s = "Download attachment", retryLabel: c = "Retry upload", showLessLabel: u = "Show less", downloadAllLabel: d = "Download all", theme: p, className: g }) => {
400
- let [_, v] = K(!1), y = Me(() => We(e.length, _), [e.length, _]);
399
+ }, Xe = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Ze = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, getSizeLabel: a, ariaLabel: o = "Attachments", clickLabel: s = "Download attachment", retryLabel: c = "Retry upload", showLessLabel: u = "Show less", downloadAllLabel: d = "Download all", theme: p, className: g }) => {
400
+ let [_, v] = K(!1), y = Ne(() => Ge(e.length, _), [e.length, _]);
401
401
  if (e.length === 0) return null;
402
- let b = e.some((e) => e.type === t.Image), x = e.some((e) => e.type !== t.Image), S = b && x, C = e.length >= 5, w = S ? ye : b ? G : R, T = Ye(e.length, "attachment"), E = e.slice(0, y.visibleCount);
402
+ let b = e.some((e) => e.type === t.Image), x = e.some((e) => e.type !== t.Image), S = b && x, C = e.length >= 5, w = S ? ve : b ? be : R, T = Xe(e.length, "attachment"), E = e.slice(0, y.visibleCount);
403
403
  return /* @__PURE__ */ Y("div", {
404
404
  role: "group",
405
405
  "aria-label": o,
@@ -436,7 +436,7 @@ var Pe = /* @__PURE__ */ function(e) {
436
436
  children: [
437
437
  E.map((e) => /* @__PURE__ */ J("div", {
438
438
  role: "listitem",
439
- children: e.type === t.Image ? /* @__PURE__ */ J(He, {
439
+ children: e.type === t.Image ? /* @__PURE__ */ J(Ue, {
440
440
  attachment: e,
441
441
  onClick: n ? () => n(e) : void 0,
442
442
  onRetry: i,
@@ -445,7 +445,7 @@ var Pe = /* @__PURE__ */ function(e) {
445
445
  roundedClassName: "rounded-xl",
446
446
  showHoverDownloadIcon: !0,
447
447
  className: f("size-[84px]", Q.imageTile)
448
- }) : /* @__PURE__ */ J(Ke, {
448
+ }) : /* @__PURE__ */ J(qe, {
449
449
  attachment: e,
450
450
  sizeLabel: a?.(e),
451
451
  onClick: n,
@@ -455,16 +455,16 @@ var Pe = /* @__PURE__ */ function(e) {
455
455
  theme: p
456
456
  })
457
457
  }, e.id)),
458
- y.layout === Ue.Collapsed && /* @__PURE__ */ J("div", {
458
+ y.layout === We.Collapsed && /* @__PURE__ */ J("div", {
459
459
  role: "listitem",
460
- children: /* @__PURE__ */ J(Je, {
460
+ children: /* @__PURE__ */ J(Ye, {
461
461
  count: y.hiddenCount,
462
462
  onClick: () => v(!0)
463
463
  })
464
464
  }),
465
465
  C && _ && /* @__PURE__ */ J("div", {
466
466
  role: "listitem",
467
- children: /* @__PURE__ */ J(Je, {
467
+ children: /* @__PURE__ */ J(Ye, {
468
468
  count: 0,
469
469
  onClick: () => v(!1),
470
470
  ariaLabel: u,
@@ -477,7 +477,7 @@ var Pe = /* @__PURE__ */ function(e) {
477
477
  ]
478
478
  })]
479
479
  });
480
- }, Ze = {
480
+ }, Qe = {
481
481
  tab: "_tab_1mi6x_1",
482
482
  tabActive: "_tabActive_1mi6x_13"
483
483
  };
@@ -489,12 +489,12 @@ ke(({ tabs: e, activeTabId: t, onTabChange: n, tabClassName: r = "dial-tiny-semi
489
489
  label: e.label,
490
490
  selected: i,
491
491
  onClick: () => n(e.id),
492
- className: f("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", r, Ze.tab, i && Ze.tabActive)
492
+ className: f("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", r, Qe.tab, i && Qe.tabActive)
493
493
  }, e.id);
494
494
  })
495
495
  }));
496
- var Qe = (e) => /* @__PURE__ */ J(b, { ...e }), $e = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
497
- let [s, c] = K(t), [l, u] = K(n), [d, f] = K(r), p = Ne(o);
496
+ var $e = (e) => /* @__PURE__ */ J(b, { ...e }), et = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
497
+ let [s, c] = K(t), [l, u] = K(n), [d, f] = K(r), p = Pe(o);
498
498
  je(() => {
499
499
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
500
500
  }, [
@@ -526,7 +526,7 @@ var Qe = (e) => /* @__PURE__ */ J(b, { ...e }), $e = ({ features: e, initialResp
526
526
  a
527
527
  ])
528
528
  };
529
- }, et = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: l = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
529
+ }, tt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: a, onTemperatureChange: o, responseFormatLabel: s = "Response format", responseFormatHint: c = "Applies to new and existing messages", responseFormatMarkdownLabel: l = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
530
530
  "Precise",
531
531
  "Neutral",
532
532
  "Creative"
@@ -569,7 +569,7 @@ var Qe = (e) => /* @__PURE__ */ J(b, { ...e }), $e = ({ features: e, initialResp
569
569
  ]
570
570
  });
571
571
  ke(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: g = "Apply changes", saveDisabledTooltip: _ }) => {
572
- let { responseFormat: v, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = $e({
572
+ let { responseFormat: v, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = et({
573
573
  features: e,
574
574
  initialResponseFormat: t,
575
575
  initialSystemPrompt: n,
@@ -588,14 +588,14 @@ ke(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
588
588
  children: /* @__PURE__ */ J(O, {
589
589
  tooltip: _,
590
590
  hideTooltip: S || !_,
591
- children: /* @__PURE__ */ J(Qe, {
591
+ children: /* @__PURE__ */ J($e, {
592
592
  label: g,
593
593
  onClick: E,
594
594
  disabled: !S
595
595
  })
596
596
  })
597
597
  }),
598
- children: /* @__PURE__ */ J(et, {
598
+ children: /* @__PURE__ */ J(tt, {
599
599
  features: e,
600
600
  responseFormat: v,
601
601
  systemPrompt: b,
@@ -616,230 +616,274 @@ ke(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
616
616
  });
617
617
  });
618
618
  //#endregion
619
- //#region src/components/Message/MessageActions.tsx
620
- var tt = 2e3, nt = ({ role: e = c.User, onEdit: t, onEditHover: n, onDelete: r, onRegenerate: i, onCopy: a, onCopyMarkdown: o, onLike: l, onDislike: u, activeRating: d, isAlwaysVisible: p, className: g, tooltips: _, ariaLabels: v }) => {
621
- let [y, b] = K(null), x = Ae(() => {
622
- a?.(), b("copy"), setTimeout(() => b(null), tt);
623
- }, [a]), S = Ae(() => {
624
- o?.(), b("markdown"), setTimeout(() => b(null), tt);
625
- }, [o]);
626
- return /* @__PURE__ */ J("div", {
619
+ //#region src/components/MessageActions/MessageActions.tsx
620
+ var nt = 2e3, rt = ({ role: e = c.User, onEdit: t, onEditHover: n, onDelete: r, onRegenerate: i, onCopy: a, onCopyMarkdown: o, onLike: l, onDislike: u, activeRating: d, isAlwaysVisible: p, className: g, labels: _ }) => {
621
+ let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] = K(null), [S, C] = K(""), w = Ae(() => {
622
+ a?.(), x("copy"), C(y?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => x(null), nt);
623
+ }, [a, y?.copiedStatus]), T = Ae(() => {
624
+ o?.(), x("markdown"), C(y?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => x(null), nt);
625
+ }, [o, y?.copiedMarkdownStatus]);
626
+ return /* @__PURE__ */ Y("div", {
627
+ role: "toolbar",
628
+ "aria-label": y?.actionsGroup ?? "Message actions",
627
629
  className: f("flex gap-1", !p && "opacity-0 group-hover:opacity-100", g),
628
- children: e === c.User ? /* @__PURE__ */ Y(q, { children: [t && /* @__PURE__ */ J(h, {
629
- icon: /* @__PURE__ */ J(be, { size: m.SM }),
630
+ children: [/* @__PURE__ */ J("span", {
631
+ role: "status",
632
+ "aria-live": "polite",
633
+ className: "sr-only",
634
+ children: S
635
+ }), e === c.User ? /* @__PURE__ */ Y(q, { children: [t && /* @__PURE__ */ J(h, {
636
+ icon: /* @__PURE__ */ J(ye, {
637
+ size: m.SM,
638
+ "aria-hidden": !0
639
+ }),
630
640
  size: k.Small,
631
- "aria-label": v?.editMessage ?? "Edit message",
632
- tooltipProps: { tooltip: _?.edit ?? "Edit" },
641
+ "aria-label": y?.editMessage ?? "Edit message",
642
+ tooltipProps: { tooltip: v?.edit ?? "Edit" },
633
643
  onClick: t,
634
- onMouseEnter: n
644
+ onMouseEnter: n,
645
+ onFocus: n
635
646
  }), r && /* @__PURE__ */ J(h, {
636
- icon: /* @__PURE__ */ J(Ee, { size: m.SM }),
647
+ icon: /* @__PURE__ */ J(Ee, {
648
+ size: m.SM,
649
+ "aria-hidden": !0
650
+ }),
637
651
  size: k.Small,
638
- "aria-label": v?.deleteMessage ?? "Delete message",
639
- tooltipProps: { tooltip: _?.delete ?? "Delete" },
652
+ "aria-label": y?.deleteMessage ?? "Delete message",
653
+ tooltipProps: { tooltip: v?.delete ?? "Delete" },
640
654
  onClick: r
641
655
  })] }) : /* @__PURE__ */ Y(q, { children: [
642
656
  i && /* @__PURE__ */ J(h, {
643
- icon: /* @__PURE__ */ J(xe, { size: m.SM }),
657
+ icon: /* @__PURE__ */ J(xe, {
658
+ size: m.SM,
659
+ "aria-hidden": !0
660
+ }),
644
661
  size: k.Small,
645
- "aria-label": v?.regenerateResponse ?? "Regenerate response",
646
- tooltipProps: { tooltip: _?.regenerate ?? "Regenerate" },
662
+ "aria-label": y?.regenerateResponse ?? "Regenerate response",
663
+ tooltipProps: { tooltip: v?.regenerate ?? "Regenerate" },
647
664
  onClick: i
648
665
  }),
649
666
  a && /* @__PURE__ */ J(h, {
650
- icon: J(y === "copy" ? M : I, { size: m.SM }),
667
+ icon: J(b === "copy" ? M : I, {
668
+ size: m.SM,
669
+ "aria-hidden": !0
670
+ }),
651
671
  size: k.Small,
652
- "aria-label": v?.copyResponse ?? "Copy response",
653
- tooltipProps: { tooltip: y === "copy" ? _?.copied ?? "Copied!" : _?.copy ?? "Copy" },
654
- onClick: x
672
+ "aria-label": y?.copyResponse ?? "Copy response",
673
+ tooltipProps: { tooltip: b === "copy" ? v?.copied ?? "Copied!" : v?.copy ?? "Copy" },
674
+ onClick: w
655
675
  }),
656
676
  o && /* @__PURE__ */ J(h, {
657
- icon: J(y === "markdown" ? M : _e, { size: m.SM }),
677
+ icon: J(b === "markdown" ? M : ge, {
678
+ size: m.SM,
679
+ "aria-hidden": !0
680
+ }),
658
681
  size: k.Small,
659
- "aria-label": v?.copyAsMarkdown ?? "Copy as markdown",
660
- tooltipProps: { tooltip: y === "markdown" ? _?.copiedMarkdown ?? "Copied!" : _?.copyMarkdown ?? "Copy as Markdown" },
661
- onClick: S
682
+ "aria-label": y?.copyAsMarkdown ?? "Copy as markdown",
683
+ tooltipProps: { tooltip: b === "markdown" ? v?.copiedMarkdown ?? "Copied!" : v?.copyMarkdown ?? "Copy as Markdown" },
684
+ onClick: T
662
685
  }),
663
686
  l && /* @__PURE__ */ J(h, {
664
- icon: /* @__PURE__ */ J(Te, { size: m.SM }),
687
+ icon: /* @__PURE__ */ J(Te, {
688
+ size: m.SM,
689
+ "aria-hidden": !0
690
+ }),
665
691
  size: k.Small,
666
- "aria-label": v?.likeResponse ?? "Like response",
692
+ "aria-label": y?.likeResponse ?? "Like response",
693
+ "aria-pressed": d === s.Like,
667
694
  className: d === s.Like ? "!text-accent-primary" : void 0,
668
- tooltipProps: { tooltip: _?.like ?? "Like" },
695
+ tooltipProps: { tooltip: v?.like ?? "Like" },
669
696
  onClick: l
670
697
  }),
671
698
  u && /* @__PURE__ */ J(h, {
672
- icon: /* @__PURE__ */ J(we, { size: m.SM }),
699
+ icon: /* @__PURE__ */ J(we, {
700
+ size: m.SM,
701
+ "aria-hidden": !0
702
+ }),
673
703
  size: k.Small,
674
- "aria-label": v?.dislikeResponse ?? "Dislike response",
704
+ "aria-label": y?.dislikeResponse ?? "Dislike response",
705
+ "aria-pressed": d === s.Dislike,
675
706
  className: d === s.Dislike ? "!text-accent-primary" : void 0,
676
- tooltipProps: { tooltip: _?.dislike ?? "Dislike" },
707
+ tooltipProps: { tooltip: v?.dislike ?? "Dislike" },
677
708
  onClick: u
678
709
  })
679
- ] })
710
+ ] })]
680
711
  });
681
712
  }, $ = {
682
- userBubble: "_userBubble_9evlr_1",
683
- collapsibleText: "_collapsibleText_9evlr_6",
684
- expandedText: "_expandedText_9evlr_11",
685
- collapsedText: "_collapsedText_9evlr_15",
686
- startersDivider: "_startersDivider_9evlr_30",
687
- text: "_text_9evlr_34"
688
- }, rt = ({ text: e, className: n, bubbleClassName: i, styles: o, actions: s, hasAlwaysVisibleActions: l, isStreaming: u, attachments: p, afterContent: m, starters: h, onSelectStarter: g, startersAriaLabel: _ = "Quick reply buttons", deploymentIconUrl: v, deploymentDisplayName: y, thinkingLabel: b, markdownComponents: x, onAttachmentClick: C, onDownloadAll: w, attachmentClickLabel: T, onAttachmentRetry: E, attachmentRetryLabel: D, getAttachmentSizeLabel: O, attachmentTheme: k, codeBlockCopyLabel: A, codeBlockCopiedLabel: j, codeBlockTheme: M }) => {
689
- let { colors: N, typography: P } = o ?? {}, F = u ? (p ?? []).filter((e) => e.type !== t.Audio) : p ?? [], I = d({
690
- "--cm-bubble-text": N?.text,
691
- "--cm-starters-divider": N?.startersDivider
692
- }), L = f($.text, P?.fontClassName), R = !!(v || y);
713
+ userBubble: "_userBubble_1pywn_1",
714
+ collapsibleText: "_collapsibleText_1pywn_6",
715
+ expandedText: "_expandedText_1pywn_11",
716
+ collapsedText: "_collapsedText_1pywn_15",
717
+ startersDivider: "_startersDivider_1pywn_26",
718
+ text: "_text_1pywn_30"
719
+ }, it = ({ text: e, styles: n, actions: i, hasAlwaysVisibleActions: o, isStreaming: s, attachments: l, afterContent: u, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, getAttachmentSizeLabel: x, attachmentTheme: C, codeBlockTheme: w, labels: T }) => {
720
+ let { colors: E, typography: D, className: O, bubbleClassName: k } = n ?? {}, { attachmentClickLabel: A, attachmentRetryLabel: j, startersAriaLabel: M = "Quick reply buttons", thinkingLabel: N, codeBlockCopyLabel: P, codeBlockCopiedLabel: F, assistantMessageAriaLabel: I = "Assistant message", deploymentIconFallbackLabel: L = "AI" } = T ?? {}, R = s ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], z = d({
721
+ "--cm-bubble-text": E?.text,
722
+ "--cm-starters-divider": E?.startersDivider
723
+ }), B = f($.text, D?.fontClassName), V = !!(h || g);
693
724
  return /* @__PURE__ */ Y("div", {
694
- style: I,
695
- className: f("flex w-full items-start gap-3", n),
696
- children: [R && /* @__PURE__ */ J(r, {
697
- src: v,
725
+ role: "group",
726
+ "aria-label": I,
727
+ style: z,
728
+ className: f("flex w-full items-start gap-3", O),
729
+ children: [V && /* @__PURE__ */ J(r, {
730
+ src: h,
698
731
  size: 28,
699
- initialsName: y ?? "",
700
- tooltip: y
732
+ initialsName: g || L,
733
+ tooltip: g ?? L
701
734
  }), /* @__PURE__ */ Y("div", {
702
735
  className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
703
736
  children: [/* @__PURE__ */ Y("div", {
704
- className: f("flex w-full min-w-0 max-w-full flex-col items-start gap-4", i),
737
+ className: f("flex w-full min-w-0 max-w-full flex-col items-start gap-4", k),
705
738
  children: [
706
- (e || u) && /* @__PURE__ */ J("div", {
707
- className: f(L, "min-w-0 max-w-full text-start"),
739
+ (e || s) && /* @__PURE__ */ J("div", {
740
+ "aria-live": "polite",
741
+ "aria-atomic": "false",
742
+ className: f(B, "min-w-0 max-w-full text-start"),
708
743
  children: /* @__PURE__ */ J(a, {
709
744
  content: e,
710
- isStreaming: u,
711
- thinkingLabel: b,
712
- components: x,
713
- codeBlockCopyLabel: A,
714
- codeBlockCopiedLabel: j,
715
- codeBlockTheme: M
745
+ isStreaming: s,
746
+ thinkingLabel: N,
747
+ components: _,
748
+ codeBlockCopyLabel: P,
749
+ codeBlockCopiedLabel: F,
750
+ codeBlockTheme: w
716
751
  })
717
752
  }),
718
- /* @__PURE__ */ J(Xe, {
719
- attachments: F,
720
- onAttachmentClick: C,
721
- onDownloadAll: w,
722
- onRetry: E,
723
- clickLabel: T,
724
- retryLabel: D,
725
- getSizeLabel: O,
726
- theme: k
753
+ /* @__PURE__ */ J(Ze, {
754
+ attachments: R,
755
+ onAttachmentClick: v,
756
+ onDownloadAll: y,
757
+ onRetry: b,
758
+ clickLabel: A,
759
+ retryLabel: j,
760
+ getSizeLabel: x,
761
+ theme: C
727
762
  }),
728
- m,
729
- /* @__PURE__ */ J(nt, {
730
- ...s,
731
- isAlwaysVisible: l,
763
+ u,
764
+ /* @__PURE__ */ J(rt, {
765
+ ...i,
766
+ isAlwaysVisible: o,
732
767
  role: c.Assistant
733
768
  })
734
769
  ]
735
- }), h && h.length > 0 && g && /* @__PURE__ */ J("div", {
770
+ }), p && p.length > 0 && m && /* @__PURE__ */ J("div", {
736
771
  role: "list",
737
- "aria-label": _,
772
+ "aria-label": M,
738
773
  className: f("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
739
- children: h.map((e, t) => /* @__PURE__ */ J("div", {
774
+ children: p.map((e, t) => /* @__PURE__ */ J("div", {
740
775
  role: "listitem",
741
776
  className: "min-w-[40px]",
742
777
  children: /* @__PURE__ */ J(S, {
743
778
  label: e.title,
744
779
  className: "min-w-[40px]",
745
- onClick: () => g(e)
780
+ onClick: () => m(e)
746
781
  })
747
782
  }, t))
748
783
  })]
749
784
  })]
750
785
  });
751
- }, it = ({ titleText: e = "Model switched.", bodyText: t }) => /* @__PURE__ */ J(v, {
752
- title: e,
753
- message: t,
754
- textClassName: "flex-row flex-wrap gap-1"
755
- }), at = /* @__PURE__ */ function(e) {
786
+ }, at = ({ titleText: e = "Model switched.", bodyText: t }) => /* @__PURE__ */ J("div", {
787
+ role: "status",
788
+ "aria-live": "polite",
789
+ children: /* @__PURE__ */ J(v, {
790
+ title: e,
791
+ message: t,
792
+ textClassName: "flex-row flex-wrap gap-1"
793
+ })
794
+ }), ot = /* @__PURE__ */ function(e) {
756
795
  return e.Bottom = "Bottom", e.Top = "Top", e;
757
- }({}), ot = 10, st = ({ text: e, position: t = at.Bottom, className: n, bubbleClassName: r, styles: i, actions: a, hasAlwaysVisibleActions: o, attachments: s, collapsedLineCount: l = ot, showMoreLabel: u = "Show more", showLessLabel: h = "Show less", showMoreAriaLabel: g, showLessAriaLabel: v, onAttachmentClick: y, onDownloadAll: b, attachmentClickLabel: x, onAttachmentRetry: S, attachmentRetryLabel: C, getAttachmentSizeLabel: w, attachmentTheme: T }) => {
758
- let { colors: E, typography: D } = i ?? {}, { textRef: O, isTextCollapsed: A, isOverflowing: j, collapsedMaxHeight: M, expandedMaxHeight: F, isCollapsed: I, toggleCollapsed: L } = p({
796
+ }({}), st = 10, ct = ({ text: e, position: t = ot.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = st, labels: s, onAttachmentClick: l, onDownloadAll: u, onAttachmentRetry: h, getAttachmentSizeLabel: g, attachmentTheme: v }) => {
797
+ let { colors: y, typography: b, className: x, bubbleClassName: S } = n ?? {}, { showMoreLabel: C = "Show more", showLessLabel: w = "Show less", showMoreAriaLabel: T, showLessAriaLabel: E, attachmentClickLabel: D, attachmentRetryLabel: O, userMessageAriaLabel: A = "User message" } = s ?? {}, { textRef: j, isTextCollapsed: M, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = p({
759
798
  text: e,
760
- collapsedLineCount: l
761
- }), R = d({
762
- "--cm-bubble-user-bg": E?.userBackground,
763
- "--cm-bubble-text": E?.text,
764
- "--cm-bubble-collapsed-height": j ? `${M}px` : void 0,
765
- "--cm-bubble-expanded-height": j ? `${F}px` : void 0
766
- }), ee = t === at.Top ? "rounded-ee-[6px] rounded-se-[16px]" : "rounded-se-[6px] rounded-ee-[16px]", te = f($.text, D?.fontClassName), z = g ?? u, ne = v ?? h, B = I ? u : h, V = I ? z : ne, H = I ? N : P;
799
+ collapsedLineCount: o
800
+ }), B = d({
801
+ "--cm-bubble-user-bg": y?.userBackground,
802
+ "--cm-bubble-user-border": y?.userBorder,
803
+ "--cm-bubble-fade-start": y?.fadeStart,
804
+ "--cm-bubble-text": y?.text,
805
+ "--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
806
+ "--cm-bubble-expanded-height": F ? `${L}px` : void 0
807
+ }), V = t === ot.Top ? "rounded-ee-[6px] rounded-se-[16px]" : "rounded-se-[6px] rounded-ee-[16px]", ee = f($.text, b?.fontClassName), H = T ?? C, U = E ?? w, te = R ? C : w, ne = R ? H : U, W = R ? N : P, G = Me();
767
808
  return /* @__PURE__ */ J("div", {
768
- style: R,
769
- className: f("flex w-full", n),
809
+ role: "group",
810
+ "aria-label": A,
811
+ style: B,
812
+ className: f("flex w-full", x),
770
813
  children: /* @__PURE__ */ Y("div", {
771
814
  className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
772
815
  children: [
773
- /* @__PURE__ */ J(Xe, {
774
- attachments: s ?? [],
775
- onAttachmentClick: y,
776
- onDownloadAll: b,
777
- onRetry: S,
778
- clickLabel: x,
779
- retryLabel: C,
780
- getSizeLabel: w,
781
- theme: T,
816
+ /* @__PURE__ */ J(Ze, {
817
+ attachments: a ?? [],
818
+ onAttachmentClick: l,
819
+ onDownloadAll: u,
820
+ onRetry: h,
821
+ clickLabel: D,
822
+ retryLabel: O,
823
+ getSizeLabel: g,
824
+ theme: v,
782
825
  className: "max-w-[640px]"
783
826
  }),
784
827
  e && /* @__PURE__ */ J("div", {
785
- className: f($.userBubble, "flex w-fit items-center justify-end rounded-es-[16px] rounded-ss-[16px] border px-6 py-4", ee, r),
828
+ className: f($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, S),
786
829
  children: /* @__PURE__ */ Y("div", {
787
830
  className: "flex min-w-0 flex-col items-start",
788
831
  children: [/* @__PURE__ */ J("div", {
789
- className: f("relative overflow-hidden", j && $.collapsibleText, j && !I && $.expandedText, A && $.collapsedText),
832
+ id: G,
833
+ className: f("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, M && $.collapsedText),
790
834
  children: /* @__PURE__ */ J("p", {
791
- ref: O,
792
- className: f(te, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
835
+ ref: j,
836
+ className: f(ee, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
793
837
  children: e
794
838
  })
795
- }), j && /* @__PURE__ */ J(_, {
796
- label: /* @__PURE__ */ J(q, { children: B }),
797
- iconBefore: /* @__PURE__ */ J(H, {
839
+ }), F && /* @__PURE__ */ J(_, {
840
+ label: /* @__PURE__ */ J(q, { children: te }),
841
+ iconBefore: /* @__PURE__ */ J(W, {
798
842
  size: m.SM,
799
843
  "aria-hidden": "true"
800
844
  }),
801
- "aria-label": V,
845
+ "aria-label": ne,
846
+ "aria-expanded": !R,
847
+ "aria-controls": G,
802
848
  className: "mt-3",
803
- onClick: L,
849
+ onClick: z,
804
850
  size: k.Small
805
851
  })]
806
852
  })
807
853
  }),
808
- /* @__PURE__ */ J(nt, {
809
- ...a,
810
- isAlwaysVisible: o,
854
+ /* @__PURE__ */ J(rt, {
855
+ ...r,
856
+ isAlwaysVisible: i,
811
857
  role: c.User
812
858
  })
813
859
  ]
814
860
  })
815
861
  });
816
- }, ct = ({ role: e, onAttachmentClick: t, attachmentClickLabel: n, markdownComponents: r, ...i }) => e === c.Status ? /* @__PURE__ */ J(it, {
817
- titleText: i.statusTitleText,
818
- bodyText: i.statusBodyText ?? ""
819
- }) : e === c.User ? /* @__PURE__ */ J(st, {
820
- ...i,
821
- onAttachmentClick: t,
822
- attachmentClickLabel: n
823
- }) : /* @__PURE__ */ J(rt, {
824
- ...i,
825
- markdownComponents: r,
826
- onAttachmentClick: t,
827
- attachmentClickLabel: n
828
- }), lt = { button: "_button_dcr6u_1" }, ut = ({ label: e, className: t, onClick: n, styles: r }) => {
829
- let { colors: i, typography: a } = r ?? {};
862
+ }, lt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === c.Status ? /* @__PURE__ */ J(at, {
863
+ titleText: r.labels?.statusTitleText,
864
+ bodyText: r.labels?.statusBodyText ?? ""
865
+ }) : e === c.User ? /* @__PURE__ */ J(ct, {
866
+ ...r,
867
+ onAttachmentClick: t
868
+ }) : /* @__PURE__ */ J(it, {
869
+ ...r,
870
+ markdownComponents: n,
871
+ onAttachmentClick: t
872
+ }), ut = { button: "_button_15boc_1" }, dt = ({ label: e, onClick: t, styles: n }) => {
873
+ let { colors: r, typography: i, className: a } = n ?? {};
830
874
  return /* @__PURE__ */ J("button", {
831
875
  type: "button",
832
- onClick: n,
876
+ onClick: t,
833
877
  style: d({
834
- "--cm-source-bg": i?.background,
835
- "--cm-source-border": i?.border,
836
- "--cm-source-text": i?.text,
837
- "--cm-source-bg-hover": i?.backgroundHover,
838
- "--cm-source-border-hover": i?.borderHover
878
+ "--cm-source-bg": r?.background,
879
+ "--cm-source-border": r?.border,
880
+ "--cm-source-text": r?.text,
881
+ "--cm-source-bg-hover": r?.backgroundHover,
882
+ "--cm-source-border-hover": r?.borderHover
839
883
  }),
840
- className: f(lt.button, "relative flex h-6 items-center justify-center px-2", "border border-solid", "outline-none focus-visible:outline focus-visible:outline-1", "focus-visible:outline-offset-[3px]", "cursor-pointer whitespace-nowrap", a?.fontClassName, t),
884
+ className: f(ut.button, "relative flex h-6 items-center justify-center px-2", "border border-solid", "outline-none focus-visible:outline focus-visible:outline-1", "focus-visible:outline-offset-[3px]", "cursor-pointer whitespace-nowrap", i?.fontClassName, a),
841
885
  children: e
842
886
  });
843
887
  };
844
888
  //#endregion
845
- export { rt as AssistantMessageBubble, at as BubblePosition, nt as MessageActions, ct as MessageBubble, ut as MessageSource, it as StatusMessageBubble, st as UserMessageBubble };
889
+ export { it as AssistantMessageBubble, ot as BubblePosition, rt as MessageActions, lt as MessageBubble, dt as MessageSource, at as StatusMessageBubble, ct as UserMessageBubble };