@epam/ai-dial-conversation-messages 1.1.0-dev.29 → 1.1.0-dev.293

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,67 +1,66 @@
1
- import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, Highlight as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
2
- import { DIAL_ICON_SIZE as p, DialGhostIconButton as m, DialInput as h, DialLinkButton as g, DialNotification as _, DialPopup as v, DialPrimaryButton as y, DialRadioGroup as b, DialRoundedButton as x, DialSkeleton as S, DialSkeletonVariant as C, DialSlider as w, DialTag as T, DialTooltip as E, ElementSize as D, PopupSize as O, RadioGroupOrientation as k } from "@epam/ai-dial-ui-kit";
3
- import { IconCheck as A, IconChevronDown as j, IconChevronUp as M, IconClipboard as N, IconCopy as P, IconDownload as F, IconExternalLink as I, IconFile as L, IconFileTypeBmp as R, IconFileTypeCss as z, IconFileTypeCsv as B, IconFileTypeDoc as V, IconFileTypeDocx as ee, IconFileTypeHtml as te, IconFileTypeJpg as ne, IconFileTypeJs as re, IconFileTypeJsx as ie, IconFileTypePdf as ae, IconFileTypePhp as oe, IconFileTypePng as se, IconFileTypePpt as ce, IconFileTypeRs as le, IconFileTypeSql as ue, IconFileTypeSvg as de, IconFileTypeTs as fe, IconFileTypeTsx as pe, IconFileTypeTxt as me, IconFileTypeVue as he, IconFileTypeXls as ge, IconFileTypeXml as _e, IconFileTypeZip as ve, IconMarkdown as ye, IconMusic as be, IconPaperclip as xe, IconPencilMinus as Se, IconPhoto as H, IconRefresh as Ce, IconReload as we, IconTerminal2 as Te, IconThumbDown as Ee, IconThumbUp as De, IconTrashX as Oe, IconVideo as ke, IconX as Ae } from "@tabler/icons-react";
1
+ import { AttachmentErrorReason as e, AttachmentType as t, CopyIconButton as n, DeploymentIcon as r, MDMessageViewer as i, MIME_TYPE_EXT_MAP as a, MessageRating as o, MessageRole as s, RequestStatus as c, ResponseFormat as l, buildCssVars as u, mergeClasses as d, useCollapsedText as f } from "@epam/ai-dial-chat-shared";
2
+ import { DIAL_ICON_SIZE as p, ElementSize as m, GhostIconButton as h, Highlight as g, InfoMessageNotification as _, LinkButton as v, NeutralButton as y, Popup as b, PopupSize as x, PrimaryButton as S, RadioGroup as C, RadioGroupOrientation as w, Skeleton as T, SkeletonVariant as E, Slider as D, Spinner as O, StaticIconButton as k, Textarea as A, ToggleIconButton as j, Tooltip as M } from "@epam/ai-dial-ui-kit";
3
+ import { IconChevronDown as N, IconChevronUp as P, IconClipboard as F, IconDownload as I, IconExternalLink as L, IconFile as R, IconFileTypeBmp as z, IconFileTypeCss as B, IconFileTypeCsv as V, IconFileTypeDoc as H, IconFileTypeDocx as ee, IconFileTypeHtml as te, IconFileTypeJpg as ne, IconFileTypeJs as U, IconFileTypeJsx as W, IconFileTypePdf as re, IconFileTypePhp as ie, IconFileTypePng as ae, IconFileTypePpt as oe, 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, IconThumbDownFilled as Te, IconThumbUp as Ee, IconThumbUpFilled as De, IconTrashX as Oe, IconVideo as ke, IconX as Ae } from "@tabler/icons-react";
4
4
  import "react-dom";
5
- import { memo as je, useCallback as U, useEffect as Me, useId as Ne, useMemo as W, useRef as Pe, useState as G } from "react";
6
- import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
5
+ import { memo as je, useCallback as K, useEffect as Me, useId as Ne, useMemo as Pe, useRef as Fe, useState as q } from "react";
6
+ import { Fragment as J, jsx as Y, jsxs as X } from "react/jsx-runtime";
7
7
  //#region ../attachment-input/dist/index.js
8
- var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /* @__PURE__ */ function(e) {
9
- return e.None = "none", e.AllVisible = "all-visible", e.Collapsed = "collapsed", e;
10
- }({}), Ie = (e) => {
8
+ var Ie = (e) => {
9
+ if (e == null) return "";
11
10
  let t = e.lastIndexOf(".");
12
11
  return t > 0 ? e.slice(0, t) : e;
13
12
  }, Le = (e) => {
14
- if (!e) return L;
13
+ if (!e) return R;
15
14
  if (e.startsWith("image/")) switch (e) {
16
15
  case "image/jpeg":
17
16
  case "image/jpg": return ne;
18
- case "image/png": return se;
19
- case "image/svg+xml": return de;
20
- case "image/bmp": return R;
21
- default: return H;
17
+ case "image/png": return ae;
18
+ case "image/svg+xml": return le;
19
+ case "image/bmp": return z;
20
+ default: return G;
22
21
  }
23
22
  if (e.startsWith("video/")) return ke;
24
- if (e.startsWith("audio/")) return be;
23
+ if (e.startsWith("audio/")) return ve;
25
24
  switch (e) {
26
- case "application/pdf": return ae;
25
+ case "application/pdf": return re;
27
26
  case "application/msword":
28
- case "application/vnd.ms-word": return V;
27
+ case "application/vnd.ms-word": return H;
29
28
  case "application/vnd.openxmlformats-officedocument.wordprocessingml.document": return ee;
30
- case "application/vnd.ms-powerpoint": return ce;
31
- case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return ce;
32
- case "application/vnd.ms-excel": return ge;
33
- case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return ge;
29
+ case "application/vnd.ms-powerpoint": return oe;
30
+ case "application/vnd.openxmlformats-officedocument.presentationml.presentation": return oe;
31
+ case "application/vnd.ms-excel": return me;
32
+ case "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": return me;
34
33
  case "application/zip":
35
34
  case "application/x-zip-compressed":
36
35
  case "application/x-rar-compressed":
37
36
  case "application/x-7z-compressed":
38
37
  case "application/gzip":
39
- case "application/x-tar": return ve;
40
- case "text/csv": return B;
41
- case "text/plain": return me;
38
+ case "application/x-tar": return ge;
39
+ case "text/csv": return V;
40
+ case "text/plain": return fe;
42
41
  case "text/html":
43
42
  case "application/xhtml+xml": return te;
44
43
  case "text/xml":
45
- case "application/xml": return _e;
44
+ case "application/xml": return he;
46
45
  case "application/sql":
47
- case "text/x-sql": return ue;
46
+ case "text/x-sql": return ce;
48
47
  case "text/javascript":
49
- case "application/javascript": return re;
50
- case "text/jsx": return ie;
48
+ case "application/javascript": return U;
49
+ case "text/jsx": return W;
51
50
  case "application/typescript":
52
- case "text/typescript": return fe;
53
- case "text/tsx": return pe;
54
- case "text/css": return z;
51
+ case "text/typescript": return ue;
52
+ case "text/tsx": return de;
53
+ case "text/css": return B;
55
54
  case "text/x-php":
56
- case "application/x-php": return oe;
55
+ case "application/x-php": return ie;
57
56
  case "text/x-rustsrc":
58
- case "application/x-rust": return le;
59
- case "text/x-vue": return he;
60
- default: return L;
57
+ case "application/x-rust": return se;
58
+ case "text/x-vue": return pe;
59
+ default: return R;
61
60
  }
62
61
  }, Re = (e) => {
63
62
  let { type: n, contentType: r } = e;
64
- return n === t.Prompt ? Te : n === t.Pasted ? N : n === t.Image ? H : Le(r ?? "");
63
+ return n === t.Prompt ? Ce : n === t.Pasted ? F : n === t.Image ? G : Le(r ?? "");
65
64
  }, ze = (e) => {
66
65
  let t = e.toLowerCase().split(";")[0].trim(), n = a[t];
67
66
  if (n) return n;
@@ -76,208 +75,158 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
76
75
  let e = ze(a);
77
76
  if (e) return `.${e}`;
78
77
  }
78
+ if (i == null) return "";
79
79
  let o = i.lastIndexOf(".");
80
80
  return o > 0 && o < i.length - 1 ? `.${i.slice(o + 1).toLowerCase()}` : i;
81
81
  }, Ve = (e, n = {}) => {
82
- let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Audio && !l, f = r === t.Link && !l;
82
+ let { type: r, status: i, previewUrl: a, url: o } = e, s = i === c.Loading, l = i === c.Error, u = r === t.Image && !!(a ?? o) && !l, d = r === t.Link && !l;
83
83
  return {
84
84
  isLoading: s,
85
85
  isError: l,
86
86
  isImage: u,
87
- isAudio: d,
88
- isLink: f,
89
- BottomIcon: f ? null : Re(e),
90
- typeLabel: f ? null : Be(e, n)
87
+ isLink: d,
88
+ BottomIcon: d ? null : Re(e),
89
+ typeLabel: d ? null : Be(e, n)
91
90
  };
92
- }, He = (e, t) => e <= 0 ? {
93
- layout: Y.None,
94
- visibleCount: 0,
95
- hiddenCount: 0
96
- } : e < 5 || t ? {
97
- layout: Y.AllVisible,
98
- visibleCount: e,
99
- hiddenCount: 0
100
- } : {
101
- layout: Y.Collapsed,
102
- visibleCount: 4,
103
- hiddenCount: e - 4
104
- }, X = {
105
- tile: "_tile_3x6ks_1",
106
- tileLight: "_tileLight_3x6ks_12",
107
- tileError: "_tileError_3x6ks_16",
108
- nameText: "_nameText_3x6ks_23",
109
- typeText: "_typeText_3x6ks_24",
110
- retryIcon: "_retryIcon_3x6ks_36",
111
- hoverIcon: "_hoverIcon_3x6ks_40",
112
- track: "_track_3x6ks_48",
113
- indeterminateFill: "_indeterminateFill_3x6ks_52",
114
- "attachment-tile-indeterminate": "_attachment-tile-indeterminate_3x6ks_1"
115
- }, Z = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ q(m, {
91
+ }, He = "flex size-[84px] items-center justify-center rounded-xl border", Z = {
92
+ tile: "_tile_1whwz_1",
93
+ hovered: "_hovered_1whwz_5",
94
+ selected: "_selected_1whwz_15",
95
+ tileError: "_tileError_1whwz_20",
96
+ nameText: "_nameText_1whwz_25",
97
+ typeText: "_typeText_1whwz_29",
98
+ retryIcon: "_retryIcon_1whwz_33",
99
+ track: "_track_1whwz_37",
100
+ actionButton: "_actionButton_1whwz_43",
101
+ imageActionButton: "_imageActionButton_1whwz_47"
102
+ }, Q = ({ ariaLabel: e, errorTitle: t, errorDescId: n, onClick: r, id: i, icon: a, className: o }) => /* @__PURE__ */ Y(k, {
116
103
  icon: a,
117
- size: D.Small,
118
- className: d("absolute end-1 top-1 h-6 w-6 rounded-lg", o ?? X.hoverIcon),
104
+ size: m.Small,
105
+ className: d("absolute end-1 top-1 opacity-0 focus-visible:opacity-100 group-focus-within/attachment-tile:opacity-100 group-hover/attachment-tile:opacity-100", Z.actionButton, o),
119
106
  "aria-label": e,
120
107
  "aria-describedby": t ? n : void 0,
121
108
  onClick: (e) => {
122
109
  e.stopPropagation(), r(i);
123
110
  }
124
- }), Ue = ({ ...e }) => /* @__PURE__ */ q(Z, {
125
- icon: /* @__PURE__ */ q(we, {
111
+ }), Ue = ({ ...e }) => /* @__PURE__ */ Y(Q, {
112
+ icon: /* @__PURE__ */ Y(Se, {
126
113
  size: p.SM,
127
114
  "aria-hidden": !0
128
115
  }),
129
- className: X.retryIcon,
116
+ className: Z.retryIcon,
130
117
  ...e
131
- }), We = ({ ...e }) => /* @__PURE__ */ q(Z, {
132
- icon: /* @__PURE__ */ q(F, {
118
+ }), We = ({ ...e }) => /* @__PURE__ */ Y(Q, {
119
+ icon: /* @__PURE__ */ Y(I, {
133
120
  size: p.SM,
134
121
  "aria-hidden": !0
135
122
  }),
136
123
  ...e
137
- }), Ge = ({ ...e }) => /* @__PURE__ */ q(Z, {
138
- icon: /* @__PURE__ */ q(I, {
124
+ }), Ge = ({ ...e }) => /* @__PURE__ */ Y(Q, {
125
+ icon: /* @__PURE__ */ Y(L, {
139
126
  size: p.SM,
140
127
  "aria-hidden": !0
141
128
  }),
142
129
  ...e
143
- }), Ke = ({ ...e }) => /* @__PURE__ */ q(Z, {
144
- icon: /* @__PURE__ */ q(Ae, {
130
+ }), Ke = ({ ...e }) => /* @__PURE__ */ Y(Q, {
131
+ icon: /* @__PURE__ */ Y(Ae, {
145
132
  size: p.SM,
146
133
  "aria-hidden": !0
147
134
  }),
148
- className: X.hoverIcon,
149
135
  ...e
150
- }), qe = ({ attachment: e, searchQuery: t = "", onClick: n, onDownload: i, onRemove: a, labels: o, styles: s, cssVars: c }) => {
151
- let { clickLabel: l = "Open attachment", downloadLabel: u = "Download attachment", removeLabel: f = "Remove attachment" } = o ?? {}, { typography: p, className: m } = s ?? {}, h = () => {
152
- n?.(e.id);
153
- };
154
- return /* @__PURE__ */ J("div", {
155
- style: c,
156
- ...n == null ? {} : {
157
- role: "button",
158
- tabIndex: 0,
159
- "aria-label": l,
160
- onClick: h,
161
- onKeyDown: (e) => {
162
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), h());
163
- }
164
- },
165
- className: d("group relative flex w-full min-w-[280px] max-w-[300px] flex-col gap-2 rounded-xl border p-3", n && "cursor-pointer", (i || a) && "pe-8", m),
166
- children: [
167
- /* @__PURE__ */ q("span", {
168
- title: e.name,
169
- className: d(p?.fontClassName ?? "dial-tiny-text", "min-w-0 truncate", X.nameText),
170
- children: t ? /* @__PURE__ */ q(r, {
171
- text: e.name,
172
- query: t,
173
- maxLines: 1
174
- }) : e.name
175
- }),
176
- e.playUrl && /* @__PURE__ */ q("audio", {
177
- controls: !0,
178
- src: e.playUrl,
179
- "aria-label": e.name,
180
- className: "w-full",
181
- preload: "metadata",
182
- onClick: (e) => e.stopPropagation()
183
- }),
184
- i && /* @__PURE__ */ q(We, {
185
- ariaLabel: u,
186
- onClick: i,
187
- id: e.id
188
- }),
189
- a && /* @__PURE__ */ q(Ke, {
190
- ariaLabel: f,
191
- onClick: a,
192
- id: e.id
193
- })
194
- ]
195
- });
196
- }, Je = {
136
+ }), qe = {
197
137
  [e.Network]: "Upload failed · network error",
198
138
  [e.UnsupportedType]: "Upload failed · unsupported file type"
199
- }, Ye = ({ attachment: t, onClick: n, onRetry: r, labels: i, styles: a, onDownload: o, isPasted: s, isLink: l, cssVars: u, onExpand: f, isExpandable: p, onRemove: m }) => {
200
- let { clickLabel: h = "Download attachment", retryLabel: g = "Retry upload", sizeLabel: _, uploadingLabel: v = "Uploading", errorReasonLabels: y, genericErrorLabel: b = "Upload failed" } = i ?? {}, { typography: { nameClassName: x = "dial-caption-text", metaClassName: S = "dial-caption-text" } = {}, className: C } = a ?? {}, { id: w, name: T, status: E, errorReason: D } = t, O = E === c.Loading, k = E === c.Error, A = Ne(), j = k ? D && (y?.[D] ?? Je[D]) || b : "", { BottomIcon: M, typeLabel: N } = Ve(t), P = !k && !O && o && !l, F = k && !!r && D !== e.UnsupportedType, I = P || F ? "pe-5" : void 0, L = (e) => {
201
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), n?.(t.id));
202
- }, R = W(() => s ? T : Ie(T), [s, T]), z = U(() => {
139
+ }, Je = ({ attachment: t, searchQuery: n = "", onClick: r, onRetry: i, labels: a, styles: o, onDownload: s, isPasted: l, isLink: u, cssVars: f, onExpand: p, isExpandable: m, onRemove: h, isSelected: _ }) => {
140
+ let { clickLabel: v = "Download attachment", retryLabel: y = "Retry upload", sizeLabel: b, uploadingLabel: x = "Uploading", errorReasonLabels: S, genericErrorLabel: C = "Upload failed" } = a ?? {}, { typography: w, className: T } = o ?? {}, { id: E, name: D, status: k, errorReason: A } = t, j = k === c.Loading, M = k === c.Error, N = Ne(), P = M ? A && (S?.[A] ?? qe[A]) || C : "", { BottomIcon: F, typeLabel: I } = Ve(t), L = !M && !j && s && !u, R = M && !!i && A !== e.UnsupportedType, z = L || R ? "pe-5" : void 0, B = (e) => {
141
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), r?.(t.id));
142
+ }, V = Pe(() => l ? D : Ie(D), [l, D]), H = K(() => {
203
143
  window.open(t.referenceUrl, "_blank", "noopener,noreferrer");
204
- }, [t]), B = d(Fe, "group relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", X.tile, !k && X.tileLight, k && X.tileError), V = /* @__PURE__ */ q("div", {
205
- title: R,
206
- className: d(x, "line-clamp-2 min-w-0 break-all", X.nameText, !k && I),
207
- children: R
208
- }), ee = M && /* @__PURE__ */ J("div", {
209
- className: d("flex w-full items-center gap-1", k && I),
210
- children: [/* @__PURE__ */ q(M, {
144
+ }, [t]), ee = d(He, "group/attachment-tile relative flex-col justify-between items-start gap-1 overflow-hidden p-1.5", Z.tile, !M && Z.hovered, _ && Z.selected, M && Z.tileError), te = /* @__PURE__ */ Y("div", {
145
+ title: V,
146
+ className: d(w?.nameClassName ?? "dial-caption-text", "line-clamp-2 min-w-0 break-all", Z.nameText, !M && z),
147
+ children: n ? /* @__PURE__ */ Y(g, {
148
+ text: V,
149
+ query: n,
150
+ maxLines: 2
151
+ }) : V
152
+ }), ne = F && /* @__PURE__ */ X("div", {
153
+ className: d("flex w-full items-center gap-1", M && z),
154
+ children: [/* @__PURE__ */ Y(F, {
211
155
  size: 16,
212
- className: X.typeText,
156
+ className: Z.typeText,
213
157
  "aria-hidden": !0
214
- }), /* @__PURE__ */ q("span", {
215
- className: d(S, "min-w-0 flex-1 truncate", X.typeText),
216
- children: _ ? `${N} · ${_}` : N
158
+ }), /* @__PURE__ */ Y("span", {
159
+ className: d(w?.metaClassName ?? "dial-caption-text", "min-w-0 flex-1 truncate", Z.typeText),
160
+ children: b ? `${I} · ${b}` : I
217
161
  })]
218
- }), te = () => {
219
- p && f ? f(w) : n && n(w);
220
- }, ne = /* @__PURE__ */ J(K, { children: [
221
- k ? /* @__PURE__ */ J(K, { children: [ee, V] }) : /* @__PURE__ */ J(K, { children: [V, ee] }),
222
- O && /* @__PURE__ */ q("div", {
223
- role: "progressbar",
224
- "aria-label": v,
225
- className: d("absolute inset-x-2 bottom-2 h-[3px] overflow-hidden rounded-full", X.track),
226
- children: /* @__PURE__ */ q("div", { className: d("h-full w-1/3 rounded-full", X.indeterminateFill) })
227
- }),
228
- P && /* @__PURE__ */ q(We, {
229
- ariaLabel: h,
230
- errorTitle: j,
231
- errorDescId: A,
232
- onClick: o,
233
- id: w
234
- }),
235
- F && /* @__PURE__ */ q(Ue, {
236
- ariaLabel: g,
237
- errorTitle: j,
238
- errorDescId: A,
239
- onClick: r,
240
- id: w
162
+ }), U = () => {
163
+ m && p ? p(E) : r && r(E);
164
+ }, W = /* @__PURE__ */ X(J, { children: [
165
+ te,
166
+ ne,
167
+ j && /* @__PURE__ */ Y("div", {
168
+ "aria-label": x,
169
+ className: d("absolute left-[-1px] top-[-1px] flex size-full items-center justify-center rounded", Z.track),
170
+ children: /* @__PURE__ */ Y(O, { size: 32 })
241
171
  }),
242
- l && /* @__PURE__ */ q(Ge, {
243
- ariaLabel: g,
244
- errorTitle: j,
245
- errorDescId: A,
246
- onClick: z
247
- }),
248
- m && /* @__PURE__ */ q(Ke, {
249
- ariaLabel: g,
250
- errorTitle: j,
251
- errorDescId: A,
252
- onClick: m,
253
- id: w
172
+ /* @__PURE__ */ X("div", {
173
+ className: d("absolute right-0 top-0 flex gap-1"),
174
+ children: [
175
+ L && /* @__PURE__ */ Y(We, {
176
+ ariaLabel: v,
177
+ errorTitle: P,
178
+ errorDescId: N,
179
+ onClick: s,
180
+ id: E
181
+ }),
182
+ R && /* @__PURE__ */ Y(Ue, {
183
+ ariaLabel: y,
184
+ errorTitle: P,
185
+ errorDescId: N,
186
+ onClick: i,
187
+ id: E
188
+ }),
189
+ u && /* @__PURE__ */ Y(Ge, {
190
+ ariaLabel: y,
191
+ errorTitle: P,
192
+ errorDescId: N,
193
+ onClick: H
194
+ }),
195
+ h && /* @__PURE__ */ Y(Ke, {
196
+ ariaLabel: y,
197
+ errorTitle: P,
198
+ errorDescId: N,
199
+ onClick: h,
200
+ id: E
201
+ })
202
+ ]
254
203
  }),
255
- k && /* @__PURE__ */ q("span", {
256
- id: A,
204
+ M && /* @__PURE__ */ Y("span", {
205
+ id: N,
257
206
  role: "status",
258
207
  "aria-live": "polite",
259
208
  className: "sr-only",
260
- children: j
209
+ children: P
261
210
  })
262
211
  ] });
263
- return /* @__PURE__ */ q("div", {
264
- style: u,
265
- className: d("inline-flex", C),
266
- children: /* @__PURE__ */ q("div", {
212
+ return /* @__PURE__ */ Y("div", {
213
+ style: f,
214
+ className: d("inline-flex", T),
215
+ children: /* @__PURE__ */ Y("div", {
267
216
  role: "button",
268
217
  tabIndex: 0,
269
- "aria-label": h,
270
- onClick: te,
271
- onKeyDown: L,
272
- style: u,
273
- className: d(B, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
274
- children: ne
218
+ "aria-label": v,
219
+ onClick: U,
220
+ onKeyDown: B,
221
+ style: f,
222
+ className: d(ee, "cursor-pointer focus-within:outline focus-within:outline-1 focus-within:outline-offset-1"),
223
+ children: W
275
224
  })
276
225
  });
277
- }, Xe = /* @__PURE__ */ function(e) {
226
+ }, Ye = /* @__PURE__ */ function(e) {
278
227
  return e.Idle = "idle", e.Loading = "loading", e.Loaded = "loaded", e.Error = "error", e;
279
- }({}), Ze = ({ enabled: e, src: t }) => {
280
- let n = Pe(null), [r, i] = G("idle");
228
+ }({}), Xe = ({ enabled: e, src: t }) => {
229
+ let n = Fe(null), [r, i] = q("idle");
281
230
  return Me(() => {
282
231
  i(e && t ? "loading" : "idle");
283
232
  }, [e, t]), Me(() => {
@@ -291,15 +240,15 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
291
240
  imageRef: n,
292
241
  imageLoadStatus: r
293
242
  };
294
- }, Qe = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c }) => {
295
- let { clickLabel: l = "Open attachment", expandLabel: u = "Expand pasted text" } = i ?? {}, { typography: f, className: m } = c ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = W(() => Ve(e), [e]), w = r !== void 0 && !v && !y && !b, { imageRef: T, imageLoadStatus: E } = Ze({
243
+ }, Ze = ({ attachment: e, onExpand: n, onClick: r, labels: i, onRemove: a, cssVars: o, onDownload: s, styles: c, isSelected: l }) => {
244
+ let { clickLabel: u = "Open attachment", expandLabel: f = "Expand pasted text" } = i ?? {}, { className: m } = c ?? {}, { id: h, name: g } = e, _ = e.previewUrl ?? e.url, v = e.type === t.Pasted && n !== void 0, { isLoading: y, isError: b, isImage: x } = Pe(() => Ve(e), [e]), S = r !== void 0 && !v && !y && !b, { imageRef: C, imageLoadStatus: w } = Xe({
296
245
  enabled: x,
297
246
  src: _
298
247
  }), D = () => {
299
- v && n ? n(h) : w && r && r(h);
248
+ v && n ? n(h) : S && r && r(h);
300
249
  };
301
- return /* @__PURE__ */ q("div", {
302
- className: d(Fe, w && "cursor-pointer", X.tile, m),
250
+ return /* @__PURE__ */ Y("div", {
251
+ className: d(He, "group/attachment-tile", S && "cursor-pointer", Z.tile, l && Z.selected, m),
303
252
  onClick: D,
304
253
  onKeyDown: (e) => {
305
254
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), D());
@@ -307,223 +256,152 @@ var Fe = "flex size-[84px] items-center justify-center rounded-xl border", Y = /
307
256
  tabIndex: 0,
308
257
  role: "button",
309
258
  style: o,
310
- "aria-label": w ? l : v ? u : void 0,
311
- children: /* @__PURE__ */ J("div", {
259
+ "aria-label": S ? u : v ? f : void 0,
260
+ children: /* @__PURE__ */ X("div", {
312
261
  className: "relative h-full w-full overflow-hidden",
313
262
  children: [
314
- a && /* @__PURE__ */ q(Ke, {
263
+ a && /* @__PURE__ */ Y(Ke, {
315
264
  onClick: a,
316
- id: h
265
+ id: h,
266
+ className: Z.imageActionButton
317
267
  }),
318
- s && /* @__PURE__ */ q(We, {
268
+ s && /* @__PURE__ */ Y(We, {
319
269
  onClick: s,
320
- id: h
270
+ id: h,
271
+ className: Z.imageActionButton
321
272
  }),
322
- E !== Xe.Loaded && /* @__PURE__ */ q(S, {
323
- variant: C.Rectangular,
273
+ w !== Ye.Loaded && /* @__PURE__ */ Y(T, {
274
+ variant: E.Rectangular,
324
275
  width: "100%",
325
276
  height: "100%",
326
- active: E === Xe.Loading,
327
- overlay: /* @__PURE__ */ q(H, {
277
+ active: w === Ye.Loading,
278
+ overlay: /* @__PURE__ */ Y(G, {
328
279
  size: p.LG,
329
- className: f?.placeholderIconClassName ?? "text-secondary",
280
+ className: Z.typeText,
330
281
  "aria-hidden": !0
331
282
  }),
332
283
  className: "absolute inset-0 rounded-xl"
333
284
  }),
334
- /* @__PURE__ */ q("img", {
335
- ref: T,
285
+ /* @__PURE__ */ Y("img", {
286
+ ref: C,
336
287
  src: _,
337
288
  alt: g,
338
289
  loading: "lazy",
339
290
  decoding: "async",
340
- className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", E === Xe.Loaded ? "opacity-100" : "opacity-0")
291
+ className: d("h-full w-full rounded-xl object-cover transition-opacity duration-200", w === Ye.Loaded ? "opacity-100" : "opacity-0")
341
292
  })
342
293
  ]
343
294
  })
344
295
  });
345
- }, $e = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l }) => {
346
- let { colors: d } = l ?? {}, f = e.type === t.Pasted, p = f && a !== void 0, m = u({
347
- "--ci-tile-bg": d?.background,
348
- "--ci-tile-border": d?.border,
349
- "--ci-tile-border-hover": d?.borderHover,
350
- "--ci-tile-focus-outline": d?.focusOutline,
351
- "--ci-tile-bg-error": d?.backgroundError,
352
- "--ci-tile-border-error": d?.borderError,
353
- "--ci-tile-error-text": d?.errorText,
354
- "--ci-tile-name-text": d?.nameText,
355
- "--ci-tile-type-text": d?.typeText,
356
- "--ci-tile-hover-icon-bg": d?.hoverIconBackground,
357
- "--ci-tile-hover-icon-color": d?.hoverIconColor,
358
- "--ci-tile-track-bg": d?.trackBackground,
359
- "--ci-tile-fill-bg": d?.fillBackground
360
- }), { isImage: h, isAudio: g, isLink: _ } = W(() => Ve(e), [e]);
361
- return g ? /* @__PURE__ */ q(qe, {
362
- attachment: e,
363
- labels: c,
364
- onClick: o,
365
- onDownload: s,
366
- onRemove: r,
367
- searchQuery: n,
368
- styles: l,
369
- cssVars: m
370
- }) : h ? /* @__PURE__ */ q(Qe, {
296
+ }, Qe = ({ attachment: e, searchQuery: n = "", onRemove: r, onRetry: i, onExpand: a, onClick: o, onDownload: s, labels: c, styles: l, isSelected: d }) => {
297
+ let { colors: f } = l ?? {}, p = e.type === t.Pasted, m = p && a !== void 0, h = u({
298
+ "--ai-tile-bg": f?.background,
299
+ "--ai-tile-border": f?.border,
300
+ "--ai-tile-bg-hover": f?.backgroundHover,
301
+ "--ai-tile-border-hover": f?.borderHover,
302
+ "--ai-tile-bg-selected": f?.backgroundSelected,
303
+ "--ai-tile-border-selected": f?.borderSelected,
304
+ "--ai-tile-focus-outline": f?.focusOutline,
305
+ "--ai-tile-bg-error": f?.backgroundError,
306
+ "--ai-tile-border-error": f?.borderError,
307
+ "--ai-tile-error-text": f?.errorText,
308
+ "--ai-tile-name-text": f?.nameText,
309
+ "--ai-tile-type-text": f?.typeText,
310
+ "--ai-tile-hover-icon-bg": f?.hoverIconBackground,
311
+ "--ai-tile-hover-icon-color": f?.hoverIconColor,
312
+ "--ai-tile-progress-track": f?.trackBackground
313
+ }), { isImage: g, isLink: _ } = Pe(() => Ve(e), [e]);
314
+ return g ? /* @__PURE__ */ Y(Ze, {
371
315
  attachment: e,
372
316
  labels: c,
373
317
  onClick: o,
374
318
  onExpand: a,
375
319
  styles: l,
376
320
  onRemove: r,
377
- cssVars: m,
378
- onDownload: s
379
- }) : /* @__PURE__ */ q(Ye, {
321
+ cssVars: h,
322
+ onDownload: s,
323
+ isSelected: d
324
+ }) : /* @__PURE__ */ Y(Je, {
380
325
  attachment: e,
326
+ searchQuery: n,
381
327
  onClick: o,
382
328
  onRetry: i,
383
329
  onRemove: r,
384
330
  onDownload: s,
385
331
  isLink: _,
386
- isPasted: f,
332
+ isPasted: p,
387
333
  styles: l,
388
334
  labels: c,
389
335
  onExpand: a,
390
- cssVars: m,
391
- isExpandable: p
336
+ cssVars: h,
337
+ isExpandable: m,
338
+ isSelected: d
392
339
  });
393
- }, et = { tile: "_tile_nzsrz_1" }, tt = ({ count: e, onClick: t, labels: n, children: r, styles: i }) => {
394
- let { ariaLabel: a } = n ?? {}, { typography: { fontClassName: o = "dial-small-semi-text" } = {}, className: s, colors: c } = i ?? {}, l = u({
395
- "--ci-more-tile-bg": c?.background,
396
- "--ci-more-tile-border": c?.border,
397
- "--ci-more-tile-color": c?.color,
398
- "--ci-more-tile-bg-hover": c?.backgroundHover,
399
- "--ci-more-tile-color-hover": c?.colorHover,
400
- "--ci-more-tile-border-hover": c?.borderHover,
401
- "--ci-more-tile-focus-outline": c?.focusOutline
402
- });
403
- return /* @__PURE__ */ q("button", {
404
- type: "button",
405
- onClick: t,
406
- "aria-label": a ?? `Show ${e} more attachments`,
407
- style: l,
408
- className: d(Fe, o, et.tile, s),
409
- children: r ?? /* @__PURE__ */ q("bdi", {
410
- dir: "ltr",
411
- children: `+${e}`
412
- })
413
- });
414
- }, Q = {
415
- container: "_container_7fktb_1",
416
- headerIcon: "_headerIcon_7fktb_6",
417
- headerLabel: "_headerLabel_7fktb_7",
418
- downloadAllButton: "_downloadAllButton_7fktb_8",
419
- imageTile: "_imageTile_7fktb_12"
420
- }, nt = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, rt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o }) => {
421
- let { ariaLabel: s = "Attachments", clickLabel: l = "Download attachment", retryLabel: f = "Retry upload", showLessLabel: h = "Show less", downloadAllLabel: g = "Download all", openInNewTabLabel: _, getHeaderLabel: v = (e) => nt(e, "attachment"), promptLabel: y, pastedLabel: b, imageLabel: x } = a ?? {}, { typography: { headerLabelClassName: S = "dial-tiny-semi-text" } = {}, colors: C, className: w } = o ?? {}, T = u({
422
- "--ci-group-bg": C?.background,
423
- "--ci-group-border": C?.border,
424
- "--ci-group-text": C?.text
425
- }), [E, D] = G(!1), O = W(() => He(e.length, E), [e.length, E]);
340
+ }, $e = {
341
+ headerIcon: "_headerIcon_1dmgi_1",
342
+ headerLabel: "_headerLabel_1dmgi_2"
343
+ }, et = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, tt = ({ attachments: e, onAttachmentClick: n, onDownloadAll: r, onRetry: i, labels: a, styles: o, selectedAttachmentId: s }) => {
344
+ let { ariaLabel: l = "Attachments", clickLabel: f = "Download attachment", retryLabel: g = "Retry upload", downloadAllLabel: _ = "Download all", openInNewTabLabel: v, getHeaderLabel: y = (e) => et(e, "attachment"), promptLabel: b, pastedLabel: x, imageLabel: S } = a ?? {}, { typography: C, colors: w, className: T } = o ?? {}, E = u({ "--ai-group-text": w?.text });
426
345
  if (e.length === 0) return null;
427
- let k = e.some((e) => e.type === t.Image), A = e.some((e) => e.type !== t.Image), j = k && A, N = e.length >= 5, P = j ? xe : k ? H : L, I = v(e.length), R = e.slice(0, O.visibleCount), z = () => {
346
+ let D = e.some((e) => e.type === t.Image), O = e.some((e) => e.type !== t.Image), k = D && O, A = e.length >= 5, j = k ? ye : D ? G : R, M = y(e.length), N = () => {
428
347
  let t = e.filter((e) => e.status === c.Idle);
429
348
  r ? r(t) : t.forEach((e) => n?.(e.id));
430
- }, B = (t) => {
349
+ }, P = (t) => {
431
350
  let n = e.find((e) => e.id === t);
432
351
  n && r?.([n]);
433
352
  };
434
- return /* @__PURE__ */ J("div", {
353
+ return /* @__PURE__ */ X("div", {
435
354
  role: "group",
436
- "aria-label": s,
437
- style: T,
438
- className: d("rounded-2xl border p-3", N ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", Q.container, w),
439
- children: [/* @__PURE__ */ J("div", {
440
- className: "mb-3 flex min-h-6 items-center gap-2",
441
- children: [
442
- /* @__PURE__ */ q(P, {
355
+ "aria-label": l,
356
+ style: E,
357
+ className: d("flex flex-col gap-1", A ? "w-full min-w-0 max-w-[492px]" : "max-w-[420px]", $e.container, T),
358
+ children: [/* @__PURE__ */ X("div", {
359
+ className: "flex items-center justify-between",
360
+ children: [/* @__PURE__ */ X("div", {
361
+ className: "flex items-center gap-1",
362
+ children: [/* @__PURE__ */ Y(j, {
363
+ size: p.SM,
364
+ className: d("shrink-0", $e.headerIcon),
365
+ "aria-hidden": !0
366
+ }), /* @__PURE__ */ Y("span", {
367
+ className: d(C?.headerLabelClassName ?? "dial-tiny-semi-text", $e.headerLabel),
368
+ children: M
369
+ })]
370
+ }), e.length >= 2 && (r || n) && /* @__PURE__ */ Y(h, {
371
+ icon: /* @__PURE__ */ Y(I, {
443
372
  size: p.SM,
444
- className: d("shrink-0", Q.headerIcon),
445
373
  "aria-hidden": !0
446
374
  }),
447
- /* @__PURE__ */ q("span", {
448
- className: d(S, Q.headerLabel),
449
- children: I
450
- }),
451
- e.length >= 2 && (r || n) && /* @__PURE__ */ q(m, {
452
- icon: /* @__PURE__ */ q(F, {
453
- size: p.SM,
454
- "aria-hidden": !0
455
- }),
456
- className: d("ms-auto h-6 w-6 rounded-lg", Q.downloadAllButton),
457
- "aria-label": g,
458
- onClick: z
459
- })
460
- ]
461
- }), /* @__PURE__ */ J("div", {
375
+ size: m.Small,
376
+ "aria-label": _,
377
+ onClick: N
378
+ })]
379
+ }), /* @__PURE__ */ Y("div", {
462
380
  role: "list",
463
- "aria-label": I,
464
- className: d("gap-3", N ? "grid grid-cols-[repeat(5,83px)] overflow-x-auto" : "flex flex-wrap"),
465
- children: [
466
- R.map((e) => /* @__PURE__ */ q("div", {
467
- role: "listitem",
468
- children: /* @__PURE__ */ q($e, {
469
- attachment: e,
470
- onClick: n,
471
- onDownload: B,
472
- onRetry: i,
473
- labels: {
474
- clickLabel: l,
475
- retryLabel: f,
476
- promptLabel: y,
477
- pastedLabel: b,
478
- imageLabel: x,
479
- openInNewTabLabel: _
480
- }
481
- })
482
- }, e.id)),
483
- O.layout === Y.Collapsed && /* @__PURE__ */ q("div", {
484
- role: "listitem",
485
- children: /* @__PURE__ */ q(tt, {
486
- count: O.hiddenCount,
487
- onClick: () => D(!0)
488
- })
489
- }),
490
- N && E && /* @__PURE__ */ q("div", {
491
- role: "listitem",
492
- children: /* @__PURE__ */ q(tt, {
493
- count: 0,
494
- onClick: () => D(!1),
495
- labels: { ariaLabel: h },
496
- children: /* @__PURE__ */ q(M, {
497
- size: p.MD,
498
- "aria-hidden": !0
499
- })
500
- })
381
+ "aria-label": M,
382
+ className: d("gap-3", A ? "grid grid-cols-[repeat(5,83px)]" : "flex flex-wrap"),
383
+ children: e.map((e, t) => /* @__PURE__ */ Y("div", {
384
+ role: "listitem",
385
+ children: /* @__PURE__ */ Y(Qe, {
386
+ attachment: e,
387
+ onClick: n,
388
+ onDownload: P,
389
+ onRetry: i,
390
+ labels: {
391
+ clickLabel: f,
392
+ retryLabel: g,
393
+ promptLabel: b,
394
+ pastedLabel: x,
395
+ imageLabel: S,
396
+ openInNewTabLabel: v
397
+ },
398
+ isSelected: e.id === s
501
399
  })
502
- ]
400
+ }, `${e.id}-${t}`))
503
401
  })]
504
402
  });
505
- }, it = {
506
- tabContainer: "_tabContainer_rzv03_1",
507
- tabActive: "_tabActive_rzv03_13"
508
- };
509
- je(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
510
- let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
511
- return /* @__PURE__ */ q("div", {
512
- className: "flex flex-nowrap gap-1",
513
- children: e.map((e) => {
514
- let r = t === e.id;
515
- return /* @__PURE__ */ q(T, {
516
- label: e.label,
517
- selected: r,
518
- onClick: () => n(e.id),
519
- "aria-selected": r,
520
- className: d("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, it.tabContainer, r && it.tabActive)
521
- }, e.id);
522
- })
523
- });
524
- });
525
- var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
526
- let [s, c] = G(t), [l, u] = G(n), [d, f] = G(r), p = Pe(o);
403
+ }, nt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
404
+ let [s, c] = q(t), [l, u] = q(n), [d, f] = q(r), p = Fe(o);
527
405
  Me(() => {
528
406
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
529
407
  }, [
@@ -541,7 +419,7 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
541
419
  setResponseFormat: c,
542
420
  setSystemPrompt: u,
543
421
  setTemperature: f,
544
- handleSubmit: U(() => {
422
+ handleSubmit: K(() => {
545
423
  if (!m) return;
546
424
  let t = {};
547
425
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -555,55 +433,64 @@ var at = (e) => /* @__PURE__ */ q(y, { ...e }), ot = ({ features: e, initialResp
555
433
  a
556
434
  ])
557
435
  };
558
- }, st = "!dial-small-semi-text !text-primary gap-1", ct = ({ 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: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: g = [
436
+ }, rt = { label: "_label_14i7c_1" }, it = ({ 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: f = "Markdown", responseFormatPlainTextLabel: p = "Plain text", systemPromptLabel: m = "System prompt", systemPromptTooltip: h = "Enter a prompt", temperatureLabel: g = "Temperature", temperatureLabels: _ = [
559
437
  "Precise",
560
438
  "Neutral",
561
439
  "Creative"
562
- ], temperatureHint: _ }) => /* @__PURE__ */ J("div", {
563
- className: "flex flex-col gap-4 px-6 py-3",
564
- children: [
565
- e.responseFormat && /* @__PURE__ */ q(b, {
566
- fieldTitle: s,
567
- labelClassName: st,
568
- elementId: "response-format",
569
- orientation: k.Column,
570
- activeRadioButton: t ?? l.Markdown,
571
- labelDescription: c,
572
- radioButtons: [{
573
- id: l.Markdown,
574
- name: u
575
- }, {
576
- id: l.PlainText,
577
- name: d
578
- }],
579
- onChange: (e) => i(e)
580
- }),
581
- e.systemPrompt && /* @__PURE__ */ q(h, {
582
- value: n,
583
- placeholder: p,
584
- labelProps: {
585
- className: st,
586
- label: f
587
- },
588
- onChange: (e) => a(e ?? "")
589
- }),
590
- e.temperature && /* @__PURE__ */ q(w, {
591
- labelProps: {
592
- label: m,
593
- className: st,
594
- caption: _
595
- },
596
- value: r,
597
- min: 0,
598
- max: 1,
599
- step: .1,
600
- labels: g,
601
- onChange: o
602
- })
603
- ]
604
- });
605
- je(({ 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: _ }) => {
606
- let { responseFormat: y, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: D } = ot({
440
+ ], temperatureHint: v, labelClassName: y = "!dial-small-semi-text", colors: b }) => {
441
+ let x = u({ "--csf-label-text": b?.labelText }), S = d(y, rt.label, "gap-1");
442
+ return /* @__PURE__ */ X("div", {
443
+ className: "flex flex-col gap-4 px-6 pb-3",
444
+ style: x,
445
+ children: [
446
+ e.responseFormat && /* @__PURE__ */ Y(C, {
447
+ id: "response-format",
448
+ labelProps: {
449
+ label: s,
450
+ className: S,
451
+ caption: c
452
+ },
453
+ optionsClassName: "mb-2",
454
+ orientation: w.Column,
455
+ value: t ?? l.Markdown,
456
+ items: [{
457
+ value: l.Markdown,
458
+ label: f
459
+ }, {
460
+ value: l.PlainText,
461
+ label: p
462
+ }],
463
+ onChange: (e) => i(e)
464
+ }),
465
+ e.systemPrompt && /* @__PURE__ */ Y(A, {
466
+ value: n,
467
+ placeholder: h,
468
+ resize: !0,
469
+ labelProps: {
470
+ className: S,
471
+ label: m
472
+ },
473
+ onChange: (e) => a(e ?? "")
474
+ }),
475
+ e.temperature && /* @__PURE__ */ Y(D, {
476
+ labelProps: {
477
+ label: g,
478
+ className: S,
479
+ caption: v
480
+ },
481
+ value: r,
482
+ min: 0,
483
+ max: 1,
484
+ step: .1,
485
+ labels: _,
486
+ showValue: !0,
487
+ onChange: o
488
+ })
489
+ ]
490
+ });
491
+ }, at = { modal: "_modal_kl0h0_1" };
492
+ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = at.modal }) => {
493
+ let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = nt({
607
494
  features: e,
608
495
  initialResponseFormat: t,
609
496
  initialSystemPrompt: n,
@@ -611,205 +498,223 @@ je(({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemp
611
498
  onSave: i,
612
499
  onClose: a
613
500
  });
614
- return /* @__PURE__ */ q(v, {
501
+ return /* @__PURE__ */ Y(b, {
615
502
  open: !0,
616
503
  header: o,
617
- size: O.Sm,
504
+ titleClassName: s,
505
+ size: x.Sm,
618
506
  onClose: a,
619
- className: "!bg-layer-2",
620
- footer: /* @__PURE__ */ q("div", {
507
+ className: y,
508
+ footer: /* @__PURE__ */ Y("div", {
621
509
  className: "flex justify-end px-6 py-4",
622
- children: /* @__PURE__ */ q(E, {
623
- tooltip: _,
624
- hideTooltip: S || !_,
625
- children: /* @__PURE__ */ q(at, {
626
- label: g,
627
- onClick: D,
628
- disabled: !S
510
+ children: /* @__PURE__ */ Y(M, {
511
+ tooltip: v,
512
+ hideTooltip: E || !v,
513
+ children: /* @__PURE__ */ Y(S, {
514
+ label: _,
515
+ onClick: A,
516
+ disabled: !E
629
517
  })
630
518
  })
631
519
  }),
632
- children: /* @__PURE__ */ q(ct, {
520
+ children: /* @__PURE__ */ Y(it, {
633
521
  features: e,
634
- responseFormat: y,
635
- systemPrompt: b,
636
- temperature: x,
637
- onResponseFormatChange: C,
638
- onSystemPromptChange: w,
639
- onTemperatureChange: T,
640
- responseFormatLabel: s,
641
- responseFormatHint: c,
642
- responseFormatMarkdownLabel: l,
643
- responseFormatPlainTextLabel: u,
644
- systemPromptLabel: d,
645
- systemPromptTooltip: f,
646
- temperatureLabel: p,
647
- temperatureLabels: m,
648
- temperatureHint: h
522
+ responseFormat: C,
523
+ systemPrompt: w,
524
+ temperature: T,
525
+ onResponseFormatChange: D,
526
+ onSystemPromptChange: O,
527
+ onTemperatureChange: k,
528
+ responseFormatLabel: c,
529
+ responseFormatHint: l,
530
+ responseFormatMarkdownLabel: u,
531
+ responseFormatPlainTextLabel: d,
532
+ systemPromptLabel: f,
533
+ systemPromptTooltip: p,
534
+ temperatureLabel: m,
535
+ temperatureLabels: h,
536
+ temperatureHint: g
649
537
  })
650
538
  });
651
539
  });
652
- //#endregion
653
- //#region src/components/MessageActions/MessageActions.tsx
654
- var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r, onRegenerate: i, onCopy: a, onCopyMarkdown: c, onLike: l, onDislike: u, activeRating: f, isAlwaysVisible: h, className: g, labels: _ }) => {
655
- let { tooltips: v, ariaLabels: y } = _ ?? {}, [b, x] = G(null), [S, C] = G(""), w = U(() => {
656
- a?.(), x("copy"), C(y?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => x(null), lt);
657
- }, [a, y?.copiedStatus]), T = U(() => {
658
- c?.(), x("markdown"), C(y?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => x(null), lt);
659
- }, [c, y?.copiedMarkdownStatus]);
660
- return /* @__PURE__ */ J("div", {
540
+ var ot = { activeRating: "_activeRating_ygoee_1" }, st = 2e3, ct = ({ role: e = s.User, onEdit: t, onEditHover: r, onDelete: i, onRegenerate: a, onCopy: c, onCopyMarkdown: l, onLike: f, onDislike: h, activeRating: g, isAlwaysVisible: _, className: v, labels: y, colors: b }) => {
541
+ let { tooltips: x, ariaLabels: S } = y ?? {}, [C, w] = q(null), [T, E] = q(""), D = u({ "--ma-active-rating-text": b?.activeRatingText }), O = K(() => {
542
+ c?.(), w("copy"), E(S?.copiedStatus ?? "Copied to clipboard"), setTimeout(() => w(null), st);
543
+ }, [c, S?.copiedStatus]), k = K(() => {
544
+ l?.(), w("markdown"), E(S?.copiedMarkdownStatus ?? "Copied as Markdown to clipboard"), setTimeout(() => w(null), st);
545
+ }, [l, S?.copiedMarkdownStatus]);
546
+ return /* @__PURE__ */ X("div", {
661
547
  role: "toolbar",
662
- "aria-label": y?.actionsGroup ?? "Message actions",
663
- className: d("flex gap-1", !h && "opacity-0 group-hover:opacity-100", g),
664
- children: [/* @__PURE__ */ q("span", {
548
+ "aria-label": S?.actionsGroup ?? "Message actions",
549
+ style: D,
550
+ className: d("flex gap-1", !_ && "opacity-0 group-hover:opacity-100", v),
551
+ children: [/* @__PURE__ */ Y("span", {
665
552
  role: "status",
666
553
  "aria-live": "polite",
667
554
  className: "sr-only",
668
- children: S
669
- }), e === s.User ? /* @__PURE__ */ J(K, { children: [t && /* @__PURE__ */ q(m, {
670
- icon: /* @__PURE__ */ q(Se, {
555
+ children: T
556
+ }), e === s.User ? /* @__PURE__ */ X(J, { children: [t && /* @__PURE__ */ Y(j, {
557
+ icon: /* @__PURE__ */ Y(be, {
671
558
  size: p.SM,
672
- "aria-hidden": !0
559
+ "aria-hidden": !0,
560
+ stroke: 1.5
673
561
  }),
674
- size: D.Small,
675
- "aria-label": y?.editMessage ?? "Edit message",
676
- tooltipProps: { tooltip: v?.edit ?? "Edit" },
562
+ size: m.Small,
563
+ "aria-label": S?.editMessage ?? "Edit message",
564
+ tooltipProps: { tooltip: x?.edit ?? "Edit" },
677
565
  onClick: t,
678
- onMouseEnter: n,
679
- onFocus: n
680
- }), r && /* @__PURE__ */ q(m, {
681
- icon: /* @__PURE__ */ q(Oe, {
566
+ onMouseEnter: r,
567
+ onFocus: r
568
+ }), i && /* @__PURE__ */ Y(j, {
569
+ icon: /* @__PURE__ */ Y(Oe, {
682
570
  size: p.SM,
683
- "aria-hidden": !0
571
+ "aria-hidden": !0,
572
+ stroke: 1.5
684
573
  }),
685
- size: D.Small,
686
- "aria-label": y?.deleteMessage ?? "Delete message",
687
- tooltipProps: { tooltip: v?.delete ?? "Delete" },
688
- onClick: r
689
- })] }) : /* @__PURE__ */ J(K, { children: [
690
- i && /* @__PURE__ */ q(m, {
691
- icon: /* @__PURE__ */ q(Ce, {
574
+ size: m.Small,
575
+ "aria-label": S?.deleteMessage ?? "Delete message",
576
+ tooltipProps: { tooltip: x?.delete ?? "Delete" },
577
+ onClick: i
578
+ })] }) : /* @__PURE__ */ X(J, { children: [
579
+ a && /* @__PURE__ */ Y(j, {
580
+ icon: /* @__PURE__ */ Y(xe, {
692
581
  size: p.SM,
693
- "aria-hidden": !0
582
+ "aria-hidden": !0,
583
+ stroke: 1.5
694
584
  }),
695
- size: D.Small,
696
- "aria-label": y?.regenerateResponse ?? "Regenerate response",
697
- tooltipProps: { tooltip: v?.regenerate ?? "Regenerate" },
698
- onClick: i
585
+ size: m.Small,
586
+ "aria-label": S?.regenerateResponse ?? "Regenerate response",
587
+ tooltipProps: { tooltip: x?.regenerate ?? "Regenerate" },
588
+ onClick: a
699
589
  }),
700
- a && /* @__PURE__ */ q(m, {
701
- icon: q(b === "copy" ? A : P, {
702
- size: p.SM,
703
- "aria-hidden": !0
704
- }),
705
- size: D.Small,
706
- "aria-label": y?.copyResponse ?? "Copy response",
707
- tooltipProps: { tooltip: b === "copy" ? v?.copied ?? "Copied!" : v?.copy ?? "Copy" },
708
- onClick: w
590
+ c && /* @__PURE__ */ Y(n, {
591
+ iconSize: p.SM,
592
+ onClick: O,
593
+ size: m.Small,
594
+ isCopied: C === "copy",
595
+ copyLabel: x?.copy ?? "Copy",
596
+ copiedLabel: x?.copied ?? "Copied!",
597
+ ariaLabel: S?.copyResponse ?? "Copy response"
709
598
  }),
710
- c && /* @__PURE__ */ q(m, {
711
- icon: q(b === "markdown" ? A : ye, {
599
+ l && /* @__PURE__ */ Y(n, {
600
+ iconSize: p.SM,
601
+ onClick: k,
602
+ size: m.Small,
603
+ isCopied: C === "markdown",
604
+ iconCopy: /* @__PURE__ */ Y(_e, {
712
605
  size: p.SM,
713
- "aria-hidden": !0
606
+ "aria-hidden": !0,
607
+ stroke: 1.5
714
608
  }),
715
- size: D.Small,
716
- "aria-label": y?.copyAsMarkdown ?? "Copy as markdown",
717
- tooltipProps: { tooltip: b === "markdown" ? v?.copiedMarkdown ?? "Copied!" : v?.copyMarkdown ?? "Copy as Markdown" },
718
- onClick: T
609
+ copyLabel: x?.copyMarkdown ?? "Copy as Markdown",
610
+ copiedLabel: x?.copiedMarkdown ?? "Copied!",
611
+ ariaLabel: S?.copyAsMarkdown ?? "Copy as markdown"
719
612
  }),
720
- l && /* @__PURE__ */ q(m, {
721
- icon: /* @__PURE__ */ q(De, {
613
+ f && /* @__PURE__ */ Y(j, {
614
+ icon: g === o.Like ? /* @__PURE__ */ Y(De, {
615
+ className: ot.activeRating,
722
616
  size: p.SM,
617
+ stroke: 1.5,
723
618
  "aria-hidden": !0
619
+ }) : /* @__PURE__ */ Y(Ee, {
620
+ size: p.SM,
621
+ "aria-hidden": !0,
622
+ stroke: 1.5
724
623
  }),
725
- size: D.Small,
726
- "aria-label": y?.likeResponse ?? "Like response",
727
- "aria-pressed": f === o.Like,
728
- className: f === o.Like ? "!text-accent-primary" : void 0,
729
- tooltipProps: { tooltip: v?.like ?? "Like" },
730
- onClick: l
624
+ size: m.Small,
625
+ "aria-label": S?.likeResponse ?? "Like response",
626
+ "aria-pressed": g === o.Like,
627
+ tooltipProps: { tooltip: x?.like ?? "Like" },
628
+ onClick: f
731
629
  }),
732
- u && /* @__PURE__ */ q(m, {
733
- icon: /* @__PURE__ */ q(Ee, {
630
+ h && /* @__PURE__ */ Y(j, {
631
+ icon: g === o.Dislike ? /* @__PURE__ */ Y(Te, {
632
+ className: ot.activeRating,
734
633
  size: p.SM,
735
- "aria-hidden": !0
634
+ "aria-hidden": !0,
635
+ stroke: 1.5
636
+ }) : /* @__PURE__ */ Y(we, {
637
+ size: p.SM,
638
+ "aria-hidden": !0,
639
+ stroke: 1.5
736
640
  }),
737
- size: D.Small,
738
- "aria-label": y?.dislikeResponse ?? "Dislike response",
739
- "aria-pressed": f === o.Dislike,
740
- className: f === o.Dislike ? "!text-accent-primary" : void 0,
741
- tooltipProps: { tooltip: v?.dislike ?? "Dislike" },
742
- onClick: u
641
+ size: m.Small,
642
+ "aria-label": S?.dislikeResponse ?? "Dislike response",
643
+ "aria-pressed": g === o.Dislike,
644
+ tooltipProps: { tooltip: x?.dislike ?? "Dislike" },
645
+ onClick: h
743
646
  })
744
647
  ] })]
745
648
  });
746
649
  }, $ = {
747
- userBubble: "_userBubble_1exhl_1",
748
- collapsibleText: "_collapsibleText_1exhl_6",
749
- expandedText: "_expandedText_1exhl_11",
750
- collapsedText: "_collapsedText_1exhl_15",
751
- startersDivider: "_startersDivider_1exhl_26",
752
- text: "_text_1exhl_30"
753
- }, dt = ({ text: e, styles: r, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, onAttachmentClick: v, onDownloadAll: y, onAttachmentRetry: b, codeBlockTheme: S, labels: C }) => {
754
- let { colors: w, typography: T, className: E, bubbleClassName: D } = r ?? {}, { attachmentClickLabel: O, attachmentRetryLabel: k, attachmentOpenInNewTabLabel: A, startersAriaLabel: j = "Quick reply buttons", thinkingLabel: M, codeBlockCopyLabel: N, codeBlockCopiedLabel: P, assistantMessageAriaLabel: F = "Assistant message", deploymentIconFallbackLabel: I = "AI" } = C ?? {}, L = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], R = u({
755
- "--cm-bubble-text": w?.text,
756
- "--cm-starters-divider": w?.startersDivider
757
- }), z = d($.text, T?.fontClassName), B = !!(h || g);
758
- return /* @__PURE__ */ J("div", {
650
+ userBubble: "_userBubble_qoxdz_1",
651
+ collapsibleText: "_collapsibleText_qoxdz_6",
652
+ expandedText: "_expandedText_qoxdz_11",
653
+ collapsedText: "_collapsedText_qoxdz_15",
654
+ startersDivider: "_startersDivider_qoxdz_26",
655
+ text: "_text_qoxdz_30"
656
+ }, lt = ({ text: e, styles: n, actions: a, hasAlwaysVisibleActions: o, isStreaming: c, attachments: l, afterContent: f, starters: p, onSelectStarter: m, deploymentIconUrl: h, deploymentDisplayName: g, markdownComponents: _, markdownClassNames: v, onAttachmentClick: b, onDownloadAll: x, onAttachmentRetry: S, codeBlockTheme: C, labels: w, selectedAttachmentId: T }) => {
657
+ let { colors: E, typography: D, className: O, bubbleClassName: k } = n ?? {}, { attachmentClickLabel: A, attachmentRetryLabel: j, attachmentOpenInNewTabLabel: M, startersAriaLabel: N = "Quick reply buttons", thinkingLabel: P, codeBlockCopyLabel: F, codeBlockCopiedLabel: I, assistantMessageAriaLabel: L = "Assistant message", deploymentIconFallbackLabel: R = "AI" } = w ?? {}, z = c ? (l ?? []).filter((e) => e.type !== t.Audio) : l ?? [], B = u({
658
+ "--cm-bubble-text": E?.text,
659
+ "--cm-starters-divider": E?.startersDivider
660
+ }), V = d($.text, D?.fontClassName), H = !!(h || g);
661
+ return /* @__PURE__ */ X("div", {
759
662
  role: "group",
760
- "aria-label": F,
761
- style: R,
762
- className: d("flex w-full items-start gap-3", E),
763
- children: [B && /* @__PURE__ */ q(n, {
663
+ "aria-label": L,
664
+ style: B,
665
+ className: d("flex w-full items-start gap-3", O),
666
+ children: [H && /* @__PURE__ */ Y(r, {
764
667
  src: h,
765
668
  size: 28,
766
- initialsName: g || I,
767
- labels: { tooltip: g ?? I }
768
- }), /* @__PURE__ */ J("div", {
669
+ initialsName: g || R,
670
+ labels: { tooltip: g ?? R }
671
+ }), /* @__PURE__ */ X("div", {
769
672
  className: "flex w-full min-w-0 max-w-full flex-col items-start gap-5",
770
- children: [/* @__PURE__ */ J("div", {
771
- className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", D),
673
+ children: [/* @__PURE__ */ X("div", {
674
+ className: d("flex w-full min-w-0 max-w-full flex-col items-start gap-4", k),
772
675
  children: [
773
- (e || c) && /* @__PURE__ */ q("div", {
676
+ (e || c) && /* @__PURE__ */ Y("div", {
774
677
  "aria-live": "polite",
775
678
  "aria-atomic": "false",
776
- className: d(z, "min-w-0 max-w-full text-start"),
777
- children: /* @__PURE__ */ q(i, {
679
+ className: d(V, "min-w-0 max-w-full text-start"),
680
+ children: /* @__PURE__ */ Y(i, {
778
681
  content: e,
779
682
  isStreaming: c,
780
- thinkingLabel: M,
683
+ thinkingLabel: P,
781
684
  components: _,
782
- codeBlockCopyLabel: N,
783
- codeBlockCopiedLabel: P,
784
- codeBlockTheme: S
685
+ classNames: v,
686
+ codeBlockCopyLabel: F,
687
+ codeBlockCopiedLabel: I,
688
+ codeBlockTheme: C
785
689
  })
786
690
  }),
787
- /* @__PURE__ */ q(rt, {
788
- attachments: L,
789
- onAttachmentClick: (e) => v?.(l?.find((t) => t.id === e)),
790
- onDownloadAll: y,
791
- onRetry: b,
691
+ /* @__PURE__ */ Y(tt, {
692
+ attachments: z,
693
+ onAttachmentClick: (e) => b?.(l?.find((t) => t.id === e)),
694
+ onDownloadAll: x,
695
+ onRetry: S,
792
696
  labels: {
793
- clickLabel: O,
794
- retryLabel: k,
795
- openInNewTabLabel: A
796
- }
697
+ clickLabel: A,
698
+ retryLabel: j,
699
+ openInNewTabLabel: M
700
+ },
701
+ selectedAttachmentId: T
797
702
  }),
798
703
  f,
799
- /* @__PURE__ */ q(ut, {
704
+ /* @__PURE__ */ Y(ct, {
800
705
  ...a,
801
706
  isAlwaysVisible: o,
802
707
  role: s.Assistant
803
708
  })
804
709
  ]
805
- }), p && p.length > 0 && m && /* @__PURE__ */ q("div", {
710
+ }), p && p.length > 0 && m && /* @__PURE__ */ Y("div", {
806
711
  role: "list",
807
- "aria-label": j,
712
+ "aria-label": N,
808
713
  className: d("flex w-full flex-wrap gap-2 border-t pt-5", $.startersDivider),
809
- children: p.map((e, t) => /* @__PURE__ */ q("div", {
714
+ children: p.map((e, t) => /* @__PURE__ */ Y("div", {
810
715
  role: "listitem",
811
716
  className: "min-w-[40px]",
812
- children: /* @__PURE__ */ q(x, {
717
+ children: /* @__PURE__ */ Y(y, {
813
718
  label: e.title,
814
719
  className: "min-w-[40px]",
815
720
  onClick: () => m(e)
@@ -818,77 +723,77 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
818
723
  })]
819
724
  })]
820
725
  });
821
- }, ft = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ q("div", {
726
+ }, ut = ({ labels: { titleText: e = "Model switched.", bodyText: t } }) => /* @__PURE__ */ Y("div", {
822
727
  role: "status",
823
728
  "aria-live": "polite",
824
- className: "dial-info-notification dial-notification",
825
- children: /* @__PURE__ */ q(_, {
729
+ children: /* @__PURE__ */ Y(_, {
826
730
  title: e,
827
731
  message: t,
828
732
  textClassName: "flex-row flex-wrap gap-1"
829
733
  })
830
- }), pt = /* @__PURE__ */ function(e) {
734
+ }), dt = /* @__PURE__ */ function(e) {
831
735
  return e.Bottom = "Bottom", e.Top = "Top", e;
832
- }({}), mt = 10, ht = ({ text: e, position: t = pt.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = mt, labels: c, onAttachmentClick: l, onDownloadAll: m, onAttachmentRetry: h }) => {
833
- let { colors: _, typography: v, className: y, bubbleClassName: b } = n ?? {}, { showMoreLabel: x = "Show more", showLessLabel: S = "Show less", showMoreAriaLabel: C, showLessAriaLabel: w, attachmentClickLabel: T, attachmentRetryLabel: E, attachmentOpenInNewTabLabel: O, userMessageAriaLabel: k = "User message" } = c ?? {}, { textRef: A, isTextCollapsed: N, isOverflowing: P, collapsedMaxHeight: F, expandedMaxHeight: I, isCollapsed: L, toggleCollapsed: R } = f({
736
+ }({}), ft = 10, pt = ({ text: e, position: t = dt.Bottom, styles: n, actions: r, hasAlwaysVisibleActions: i, attachments: a, collapsedLineCount: o = ft, labels: c, onAttachmentClick: l, onDownloadAll: h, onAttachmentRetry: g, selectedAttachmentId: _ }) => {
737
+ 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, attachmentOpenInNewTabLabel: k, userMessageAriaLabel: A = "User message" } = c ?? {}, { textRef: j, isTextCollapsed: M, isOverflowing: F, collapsedMaxHeight: I, expandedMaxHeight: L, isCollapsed: R, toggleCollapsed: z } = f({
834
738
  text: e,
835
739
  collapsedLineCount: o
836
- }), z = u({
837
- "--cm-bubble-user-bg": _?.userBackground,
838
- "--cm-bubble-user-border": _?.userBorder,
839
- "--cm-bubble-fade-start": _?.fadeStart,
840
- "--cm-bubble-text": _?.text,
841
- "--cm-bubble-collapsed-height": P ? `${F}px` : void 0,
842
- "--cm-bubble-expanded-height": P ? `${I}px` : void 0
843
- }), B = t === pt.Top ? "rounded-ee-[6px] rounded-se-[16px]" : "rounded-se-[6px] rounded-ee-[16px]", V = d($.text, v?.fontClassName), ee = C ?? x, te = w ?? S, ne = L ? x : S, re = L ? ee : te, ie = L ? j : M, ae = Ne();
844
- return /* @__PURE__ */ q("div", {
740
+ }), B = u({
741
+ "--cm-bubble-user-bg": y?.userBackground,
742
+ "--cm-bubble-user-border": y?.userBorder,
743
+ "--cm-bubble-fade-start": y?.fadeStart,
744
+ "--cm-bubble-text": y?.text,
745
+ "--cm-bubble-collapsed-height": F ? `${I}px` : void 0,
746
+ "--cm-bubble-expanded-height": F ? `${L}px` : void 0
747
+ }), V = t === dt.Top ? "rounded-ee-md rounded-se-2xl" : "rounded-se-md rounded-ee-2xl", H = d($.text, b?.fontClassName), ee = T ?? C, te = E ?? w, ne = R ? C : w, U = R ? ee : te, W = R ? N : P, re = Ne();
748
+ return /* @__PURE__ */ Y("div", {
845
749
  role: "group",
846
- "aria-label": k,
847
- style: z,
848
- className: d("flex w-full", y),
849
- children: /* @__PURE__ */ J("div", {
750
+ "aria-label": A,
751
+ style: B,
752
+ className: d("flex w-full", x),
753
+ children: /* @__PURE__ */ X("div", {
850
754
  className: "ms-auto flex w-fit min-w-0 max-w-full flex-col items-end gap-4",
851
755
  children: [
852
- /* @__PURE__ */ q(rt, {
756
+ /* @__PURE__ */ Y(tt, {
853
757
  attachments: a ?? [],
854
758
  onAttachmentClick: (e) => l?.(a?.find((t) => t.id === e)),
855
- onDownloadAll: m,
856
- onRetry: h,
759
+ onDownloadAll: h,
760
+ onRetry: g,
857
761
  labels: {
858
- clickLabel: T,
859
- retryLabel: E,
860
- openInNewTabLabel: O
762
+ clickLabel: D,
763
+ retryLabel: O,
764
+ openInNewTabLabel: k
861
765
  },
862
- styles: { className: "max-w-[640px]" }
766
+ styles: { className: "max-w-[640px]" },
767
+ selectedAttachmentId: _
863
768
  }),
864
- e && /* @__PURE__ */ q("div", {
865
- className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", B, b),
866
- children: /* @__PURE__ */ J("div", {
769
+ e && /* @__PURE__ */ Y("div", {
770
+ className: d($.userBubble, "flex w-fit items-center justify-end rounded-es-2xl rounded-ss-2xl border px-6 py-4", V, S),
771
+ children: /* @__PURE__ */ X("div", {
867
772
  className: "flex min-w-0 flex-col items-start",
868
- children: [/* @__PURE__ */ q("div", {
869
- id: ae,
870
- className: d("relative overflow-hidden", P && $.collapsibleText, P && !L && $.expandedText, N && $.collapsedText),
871
- children: /* @__PURE__ */ q("p", {
872
- ref: A,
873
- className: d(V, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
773
+ children: [/* @__PURE__ */ Y("div", {
774
+ id: re,
775
+ className: d("relative overflow-hidden", F && $.collapsibleText, F && !R && $.expandedText, M && $.collapsedText),
776
+ children: /* @__PURE__ */ Y("p", {
777
+ ref: j,
778
+ className: d(H, "whitespace-pre-wrap text-start [overflow-wrap:anywhere]"),
874
779
  children: e
875
780
  })
876
- }), P && /* @__PURE__ */ q(g, {
877
- label: /* @__PURE__ */ q(K, { children: ne }),
878
- iconBefore: /* @__PURE__ */ q(ie, {
781
+ }), F && /* @__PURE__ */ Y(v, {
782
+ label: /* @__PURE__ */ Y(J, { children: ne }),
783
+ iconBefore: /* @__PURE__ */ Y(W, {
879
784
  size: p.SM,
880
785
  "aria-hidden": "true"
881
786
  }),
882
- "aria-label": re,
883
- "aria-expanded": !L,
884
- "aria-controls": ae,
787
+ "aria-label": U,
788
+ "aria-expanded": !R,
789
+ "aria-controls": re,
885
790
  className: "mt-3",
886
- onClick: R,
887
- size: D.Small
791
+ onClick: z,
792
+ size: m.Small
888
793
  })]
889
794
  })
890
795
  }),
891
- /* @__PURE__ */ q(ut, {
796
+ /* @__PURE__ */ Y(ct, {
892
797
  ...r,
893
798
  isAlwaysVisible: i,
894
799
  role: s.User
@@ -896,31 +801,16 @@ var lt = 2e3, ut = ({ role: e = s.User, onEdit: t, onEditHover: n, onDelete: r,
896
801
  ]
897
802
  })
898
803
  });
899
- }, gt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ q(ft, { labels: {
804
+ }, mt = ({ role: e, onAttachmentClick: t, markdownComponents: n, ...r }) => e === s.Status ? /* @__PURE__ */ Y(ut, { labels: {
900
805
  titleText: r.labels?.statusTitleText,
901
806
  bodyText: r.labels?.statusBodyText ?? ""
902
- } }) : e === s.User ? /* @__PURE__ */ q(ht, {
807
+ } }) : e === s.User ? /* @__PURE__ */ Y(pt, {
903
808
  ...r,
904
809
  onAttachmentClick: t
905
- }) : /* @__PURE__ */ q(dt, {
810
+ }) : /* @__PURE__ */ Y(lt, {
906
811
  ...r,
907
812
  markdownComponents: n,
908
813
  onAttachmentClick: t
909
- }), _t = { button: "_button_15boc_1" }, vt = ({ labels: { label: e }, onClick: t, styles: n }) => {
910
- let { colors: r, typography: i, className: a } = n ?? {};
911
- return /* @__PURE__ */ q("button", {
912
- type: "button",
913
- onClick: t,
914
- style: u({
915
- "--cm-source-bg": r?.background,
916
- "--cm-source-border": r?.border,
917
- "--cm-source-text": r?.text,
918
- "--cm-source-bg-hover": r?.backgroundHover,
919
- "--cm-source-border-hover": r?.borderHover
920
- }),
921
- className: d(_t.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),
922
- children: e
923
- });
924
- };
814
+ });
925
815
  //#endregion
926
- export { dt as AssistantMessageBubble, pt as BubblePosition, ut as MessageActions, gt as MessageBubble, vt as MessageSource, ft as StatusMessageBubble, ht as UserMessageBubble };
816
+ export { lt as AssistantMessageBubble, dt as BubblePosition, ct as MessageActions, mt as MessageBubble, ut as StatusMessageBubble, pt as UserMessageBubble };