@epam/ai-dial-conversation-input 1.1.0-dev.12 → 1.1.0-dev.17

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,46 +1,46 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, Highlight as r, RequestStatus as i, ResponseFormat as a, buildCssVars as o, mergeClasses as s, useIsMobile as c } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as l, ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DialButton as p, DialCloseButton as m, DialDropdown as h, DialDropdownIcon as g, DialErrorText as _, DialGhostIconButton as v, DialInput as y, DialPopup as b, DialPrimaryButton as x, DialRadioGroup as S, DialSearch as C, DialSkeleton as w, DialSkeletonVariant as T, DialSlider as E, DialSpinner as D, DialTag as ee, DialTooltip as O, ElementSize as k, PopupSize as A, RadioGroupOrientation as te } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as ne, IconArrowNarrowRight as j, IconCheck as M, IconChevronDown as N, IconChevronRight as re, IconFile as ie, IconMicrophone as ae, IconPaperclip as oe, IconPlaystationSquare as se, IconPlus as P, IconSettings as ce, IconX as le } from "@tabler/icons-react";
4
- import { createPortal as ue } from "react-dom";
5
- import { createElement as F, memo as de, useCallback as I, useEffect as L, useImperativeHandle as fe, useLayoutEffect as pe, useMemo as R, useRef as z, useState as B } from "react";
6
- import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
7
- import { AttachmentCard as me, AttachmentGroup as he, AttachmentTray as ge, AttachmentTray as _e, FileDndOverlay as ve, MAX_UPLOADS_PER_MINUTE as ye, generateAttachmentId as be, getAttachmentIcon as xe, useClipboardPaste as Se } from "@epam/ai-dial-attachment-input";
2
+ import { BASE_ICON_SIZE as l, ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DialButton as p, DialCloseButton as m, DialDropdown as h, DialDropdownIcon as g, DialErrorText as _, DialGhostIconButton as v, DialInput as y, DialPopup as b, DialPrimaryButton as x, DialRadioGroup as S, DialSearch as C, DialSkeleton as w, DialSkeletonVariant as T, DialSlider as E, DialTag as D, DialTooltip as O, ElementSize as k, PopupSize as A, RadioGroupOrientation as ee } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowLeft as j, IconArrowNarrowRight as te, IconCheck as ne, IconChevronDown as re, IconChevronRight as ie, IconFile as ae, IconMicrophone as oe, IconPaperclip as se, IconPlayerStopFilled as ce, IconPlaystationSquare as le, IconPlus as ue, IconSettings as de, IconX as fe } from "@tabler/icons-react";
4
+ import { createPortal as pe } from "react-dom";
5
+ import { createElement as me, memo as he, useCallback as M, useEffect as N, useImperativeHandle as P, useLayoutEffect as ge, useMemo as F, useRef as I, useState as L } from "react";
6
+ import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
7
+ import { AttachmentCard as _e, AttachmentGroup as ve, AttachmentTray as V, AttachmentTray as ye, FileDndOverlay as be, MAX_UPLOADS_PER_MINUTE as xe, generateAttachmentId as Se, getAttachmentIcon as Ce, useClipboardPaste as we } from "@epam/ai-dial-attachment-input";
8
8
  //#region src/hooks/useBottomSheet.ts
9
- var Ce = (e, t) => {
10
- L(() => {
9
+ var Te = (e, t) => {
10
+ N(() => {
11
11
  if (!e) return;
12
12
  let n = (e) => {
13
13
  e.key === "Escape" && t();
14
14
  };
15
15
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
16
- }, [e, t]), L(() => {
16
+ }, [e, t]), N(() => {
17
17
  if (e) return document.body.style.overflow = "hidden", () => {
18
18
  document.body.style.overflow = "";
19
19
  };
20
20
  }, [e]);
21
- }, we = {
21
+ }, Ee = {
22
22
  backdrop: "_backdrop_3xrn0_9",
23
23
  sheet: "_sheet_3xrn0_13",
24
24
  "slide-up": "_slide-up_3xrn0_1",
25
25
  title: "_title_3xrn0_18",
26
26
  divider: "_divider_3xrn0_22"
27
- }, W = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: c, titleClassName: l = "dial-body-semi-text", className: u, children: d }) => (Ce(e, r), !e || typeof document > "u" ? null : ue(/* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
28
- className: s(we.backdrop, "fixed inset-0 z-[55]"),
27
+ }, H = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: c, titleClassName: l = "dial-body-semi-text", className: u, children: d }) => (Te(e, r), !e || typeof document > "u" ? null : pe(/* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("div", {
28
+ className: s(Ee.backdrop, "fixed inset-0 z-[55]"),
29
29
  onPointerDown: r,
30
30
  "aria-hidden": !0
31
- }), /* @__PURE__ */ U("div", {
31
+ }), /* @__PURE__ */ B("div", {
32
32
  role: "dialog",
33
33
  "aria-modal": !0,
34
34
  "aria-label": t ?? o,
35
35
  style: c,
36
- className: s(we.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", u),
37
- children: [t != null && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
36
+ className: s(Ee.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", u),
37
+ children: [t != null && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B("div", {
38
38
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
39
39
  children: [
40
- i && /* @__PURE__ */ H("div", {
40
+ i && /* @__PURE__ */ z("div", {
41
41
  className: "absolute start-4",
42
- children: /* @__PURE__ */ H(v, {
43
- icon: /* @__PURE__ */ H(ne, {
42
+ children: /* @__PURE__ */ z(v, {
43
+ icon: /* @__PURE__ */ z(j, {
44
44
  size: f.LG,
45
45
  stroke: 1.5,
46
46
  className: "rtl:scale-x-[-1]"
@@ -49,55 +49,56 @@ var Ce = (e, t) => {
49
49
  onClick: i
50
50
  })
51
51
  }),
52
- /* @__PURE__ */ H("span", {
53
- className: s(we.title, l),
52
+ /* @__PURE__ */ z("span", {
53
+ className: s(Ee.title, l),
54
54
  children: t
55
55
  }),
56
- /* @__PURE__ */ H("div", {
56
+ /* @__PURE__ */ z("div", {
57
57
  className: "absolute end-4 m-2",
58
- children: /* @__PURE__ */ H(m, {
58
+ children: /* @__PURE__ */ z(m, {
59
59
  ariaLabel: n,
60
60
  size: f.LG,
61
61
  onClose: r
62
62
  })
63
63
  })
64
64
  ]
65
- }), /* @__PURE__ */ H("div", { className: "h-px flex-shrink-0" })] }), /* @__PURE__ */ H("div", {
65
+ }), /* @__PURE__ */ z("div", { className: "h-px flex-shrink-0" })] }), /* @__PURE__ */ z("div", {
66
66
  className: "overflow-y-auto",
67
67
  children: d
68
68
  })]
69
- })] }), document.body)), Te = async (e, t, n) => {
69
+ })] }), document.body)), De = async (e, t, n) => {
70
70
  let r = 6e4 / t, i = [];
71
71
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
72
72
  await Promise.allSettled(i);
73
- }, Ee = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
74
- let [h, g] = B(n), _ = z(h);
75
- L(() => {
73
+ }, Oe = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
74
+ let [h, g] = L(n), _ = I(h);
75
+ N(() => {
76
76
  _.current = h;
77
- }, [h]), L(() => () => {
77
+ }, [h]), N(() => () => {
78
78
  _.current.forEach((e) => {
79
- e.previewUrl && URL.revokeObjectURL(e.previewUrl);
79
+ e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
80
80
  });
81
81
  }, []);
82
- let v = I((e) => e.map((e) => {
83
- let n = e.type.startsWith("image/"), r = n ? URL.createObjectURL(e) : void 0;
82
+ let v = M((e) => e.map((e) => {
83
+ let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
84
84
  return {
85
- id: be(),
85
+ id: Se(),
86
86
  name: e.name,
87
87
  contentType: e.type,
88
88
  file: e,
89
- type: n ? t.Image : t.File,
89
+ type: n ? t.Image : r ? t.Audio : t.File,
90
90
  status: i.Idle,
91
- previewUrl: r
91
+ previewUrl: a,
92
+ playUrl: o
92
93
  };
93
- }), []), y = I((e) => {
94
+ }), []), y = M((e) => {
94
95
  g((t) => {
95
96
  let n = e(t);
96
97
  return n !== t && a?.(n), n;
97
98
  });
98
- }, [a]), b = I((e) => {
99
+ }, [a]), b = M((e) => {
99
100
  g(e), a?.(e);
100
- }, [a]), x = I(async (t) => {
101
+ }, [a]), x = M(async (t) => {
101
102
  if (r) {
102
103
  y((e) => e.map((e) => e.id === t.id ? {
103
104
  ...e,
@@ -119,34 +120,29 @@ var Ce = (e, t) => {
119
120
  } : e));
120
121
  }
121
122
  }
122
- }, [r, y]), S = I((e, t = !0) => {
123
- let n = [], r;
124
- if (y((t) => {
125
- let i = new Set(t.map((e) => e.id));
126
- if (n = e.filter((e) => !i.has(e.id)), f != null && f > 0 && Number.isFinite(f)) {
127
- let e = p + t.length + n.length;
128
- if (e > f) return r = {
129
- count: e,
130
- limit: f
131
- }, t;
123
+ }, [r, y]), S = M((e, t = !0) => {
124
+ let n = new Set(_.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
125
+ if (r.length !== 0) {
126
+ if (f != null && f > 0 && Number.isFinite(f)) {
127
+ let e = p + _.current.length + r.length;
128
+ if (e > f) {
129
+ r.forEach((e) => {
130
+ e.previewUrl && URL.revokeObjectURL(e.previewUrl);
131
+ }), m?.(e, f);
132
+ return;
133
+ }
134
+ }
135
+ if (y((e) => [...e, ...r]), t) {
136
+ let e = [];
137
+ r.forEach((t) => {
138
+ let n = o?.(t);
139
+ n == null ? e.push(t) : y((e) => e.map((e) => e.id === t.id ? {
140
+ ...e,
141
+ status: i.Error,
142
+ errorReason: n
143
+ } : e));
144
+ }), De(e, xe, x);
132
145
  }
133
- return [...t, ...n];
134
- }), r != null) {
135
- n.forEach((e) => {
136
- e.previewUrl && URL.revokeObjectURL(e.previewUrl);
137
- }), m?.(r.count, r.limit);
138
- return;
139
- }
140
- if (t) {
141
- let e = [];
142
- n.forEach((t) => {
143
- let n = o?.(t);
144
- n == null ? e.push(t) : y((e) => e.map((e) => e.id === t.id ? {
145
- ...e,
146
- status: i.Error,
147
- errorReason: n
148
- } : e));
149
- }), Te(e, ye, x);
150
146
  }
151
147
  }, [
152
148
  p,
@@ -156,20 +152,20 @@ var Ce = (e, t) => {
156
152
  x,
157
153
  o
158
154
  ]);
159
- L(() => {
155
+ N(() => {
160
156
  s.length !== 0 && (S(v(s)), c?.());
161
157
  }, [
162
158
  S,
163
159
  v,
164
160
  c,
165
161
  s
166
- ]), L(() => {
162
+ ]), N(() => {
167
163
  l.length !== 0 && (S(l, !1), u?.());
168
164
  }, [
169
165
  S,
170
166
  u,
171
167
  l
172
- ]), L(() => {
168
+ ]), N(() => {
173
169
  if (!o) return;
174
170
  let t = !1, n = [], r = _.current.map((r) => {
175
171
  if (r.status === i.Loading) return r;
@@ -196,10 +192,10 @@ var Ce = (e, t) => {
196
192
  y,
197
193
  x
198
194
  ]);
199
- let C = I((e) => {
195
+ let C = M((e) => {
200
196
  y((t) => {
201
197
  let n = t.find((t) => t.id === e);
202
- return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), t.filter((t) => t.id !== e);
198
+ return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
203
199
  });
204
200
  }, [y]);
205
201
  return {
@@ -208,11 +204,11 @@ var Ce = (e, t) => {
208
204
  addAttachments: S,
209
205
  resetAttachments: b,
210
206
  handleRemove: C,
211
- handleRetry: I((e) => {
207
+ handleRetry: M((e) => {
212
208
  let t = h.find((t) => t.id === e);
213
209
  t && x(t);
214
210
  }, [h, x]),
215
- handleExpand: I(async (e) => {
211
+ handleExpand: M(async (e) => {
216
212
  let n = h.find((t) => t.id === e);
217
213
  if (!n || n.type !== t.Pasted) return;
218
214
  let r = await n.file.text();
@@ -224,9 +220,9 @@ var Ce = (e, t) => {
224
220
  ]),
225
221
  hasBlockedAttachments: h.some((e) => e.status === i.Loading || e.status === i.Error)
226
222
  };
227
- }, De = (e, t) => {
228
- let [n, r] = B(e), [i, a] = B(!1), [o, s] = B(0);
229
- return L(() => {
223
+ }, ke = (e, t) => {
224
+ let [n, r] = L(e), [i, a] = L(!1), [o, s] = L(0);
225
+ return N(() => {
230
226
  if (e) {
231
227
  r(!0), a(!1), s((e) => e + 1);
232
228
  return;
@@ -242,18 +238,18 @@ var Ce = (e, t) => {
242
238
  isExiting: i,
243
239
  instanceKey: o
244
240
  };
245
- }, Oe = (e, t) => !e.slice(0, t).includes("\n"), ke = (e, t) => !e.slice(t).includes("\n"), Ae = (e) => {
246
- let t = z(e);
241
+ }, Ae = (e, t) => !e.slice(0, t).includes("\n"), je = (e, t) => !e.slice(t).includes("\n"), Me = (e) => {
242
+ let t = I(e);
247
243
  t.current = e;
248
- let n = z(-1), r = z(""), i = I((e, i, a) => {
244
+ let n = I(-1), r = I(""), i = M((e, i, a) => {
249
245
  let o = t.current;
250
- return !o || o.length === 0 ? null : e === "up" ? !Oe(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !ke(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
251
- }, []), a = I(() => {
246
+ return !o || o.length === 0 ? null : e === "up" ? !Ae(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !je(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
247
+ }, []), a = M(() => {
252
248
  n.current = -1, r.current = "";
253
- }, []), o = I(() => {
249
+ }, []), o = M(() => {
254
250
  n.current = -1, r.current = "";
255
251
  }, []);
256
- return R(() => ({
252
+ return F(() => ({
257
253
  navigate: i,
258
254
  notifyChange: a,
259
255
  reset: o
@@ -262,13 +258,13 @@ var Ce = (e, t) => {
262
258
  a,
263
259
  o
264
260
  ]);
265
- }, je = ({ messageProp: e, messageRevision: t }) => {
266
- let [n, r] = B(e), i = z(null), a = z(0), [o, s] = B(!1);
267
- return L(() => {
261
+ }, Ne = ({ messageProp: e, messageRevision: t }) => {
262
+ let [n, r] = L(e), i = I(null), a = I(0), [o, s] = L(!1);
263
+ return N(() => {
268
264
  r(e);
269
- }, [e, t]), L(() => {
265
+ }, [e, t]), N(() => {
270
266
  i.current && (a.current = i.current.offsetHeight);
271
- }, []), pe(() => {
267
+ }, []), ge(() => {
272
268
  if (!i.current || a.current === 0) return;
273
269
  let e = i.current.offsetHeight > a.current;
274
270
  s((t) => e ? !0 : n === "" ? !1 : t);
@@ -278,98 +274,71 @@ var Ce = (e, t) => {
278
274
  textareaRef: i,
279
275
  isMultiLine: o
280
276
  };
281
- }, Me = /* @__PURE__ */ function(e) {
282
- return e.Idle = "idle", e.Recording = "recording", e.Stopped = "stopped", e.Uploading = "uploading", e.Error = "error", e;
283
- }({}), Ne = [
277
+ }, Pe = /* @__PURE__ */ function(e) {
278
+ return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
279
+ }({}), Fe = [
284
280
  "audio/webm;codecs=opus",
285
281
  "audio/ogg;codecs=opus",
286
282
  "audio/webm"
287
- ], Pe = () => Ne.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Fe = ({ onUploadAudio: e, onTranscribeAudio: t, onTranscript: n }) => {
288
- let [r, i] = B("idle"), [a, o] = B(null), [s, c] = B(null), l = z(null), u = z(null), d = z(null), f = z(null), p = z([]), m = z(""), h = z(null), g = z(null), _ = z([]), v = z(!1), y = I(() => {
289
- h.current != null && (cancelAnimationFrame(h.current), h.current = null);
290
- }, []), b = I(() => {
291
- y(), l.current &&= (l.current.getTracks().forEach((e) => e.stop()), null), u.current &&= (u.current.close(), null), d.current = null, f.current = null;
292
- }, [y]), x = I(() => {
283
+ ], Ie = () => Fe.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Le = ({ onAttachAudio: e }) => {
284
+ let [t, n] = L("idle"), [r, i] = L(null), [a, o] = L(0), s = I(null), c = I(null), l = I(null), u = I(null), d = I([]), f = I(""), p = I(null), m = I(e);
285
+ m.current = e;
286
+ let h = M(() => {
287
+ p.current != null && (clearInterval(p.current), p.current = null);
288
+ }, []), g = M(() => {
289
+ h(), s.current &&= (s.current.getTracks().forEach((e) => e.stop()), null), c.current &&= (c.current.close(), null), l.current = null, u.current = null;
290
+ }, [h]), _ = M(() => {
293
291
  (async () => {
294
292
  try {
295
293
  let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
296
- l.current = e;
294
+ s.current = e;
297
295
  let t = new AudioContext();
298
- u.current = t;
299
- let n = t.createAnalyser();
300
- n.fftSize = 256, d.current = n, t.createMediaStreamSource(e).connect(n);
301
- let r = Pe();
302
- m.current = r, p.current = [], _.current = [];
303
- let a = new MediaRecorder(e, r ? { mimeType: r } : void 0);
304
- f.current = a, a.ondataavailable = (e) => {
305
- e.data.size > 0 && p.current.push(e.data);
306
- }, a.start(), i("recording");
307
- let s = () => {
308
- let e = d.current;
309
- if (!e) return;
310
- let t = new Uint8Array(e.frequencyBinCount);
311
- e.getByteTimeDomainData(t);
312
- let n = 0;
313
- for (let e = 0; e < t.length; e++) {
314
- let r = (t[e] - 128) / 128;
315
- n += r * r;
316
- }
317
- _.current.push(Math.sqrt(n / t.length)), o(new Float32Array(_.current)), h.current = requestAnimationFrame(s);
318
- };
319
- h.current = requestAnimationFrame(s);
296
+ c.current = t;
297
+ let r = t.createAnalyser();
298
+ r.fftSize = 256, l.current = r, t.createMediaStreamSource(e).connect(r);
299
+ let i = Ie();
300
+ f.current = i, d.current = [];
301
+ let a = new MediaRecorder(e, i ? { mimeType: i } : void 0);
302
+ u.current = a, a.ondataavailable = (e) => {
303
+ e.data.size > 0 && d.current.push(e.data);
304
+ }, a.start(), n("recording"), p.current = setInterval(() => {
305
+ o((e) => e + 1);
306
+ }, 1e3);
320
307
  } catch (e) {
321
- c(e instanceof Error ? e.message : "Microphone access denied"), i("error");
308
+ i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
322
309
  }
323
310
  })();
324
- }, []), S = I(() => {
325
- let e = f.current;
326
- !e || e.state !== "recording" || (y(), e.onstop = () => {
327
- let e = m.current || "audio/webm", t = new Blob(p.current, { type: e }), n = e.split(";")[0].split("/")[1] ?? "webm";
328
- g.current = new File([t], `recording.${n}`, { type: e }), i("stopped");
311
+ }, []), v = M(() => {
312
+ let e = u.current;
313
+ !e || e.state !== "recording" || (h(), e.onstop = () => {
314
+ let e = f.current || "audio/webm", t = new Blob(d.current, { type: e }), r = e.split(";")[0], a = r.split("/")[1] ?? "webm", s = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -1), c = new File([t], `voice-${s}.${a}`, { type: r });
315
+ m.current(c), g(), o(0), i(null), n("idle");
329
316
  }, e.stop());
330
- }, [y]), C = I(() => {
331
- let r = g.current;
332
- !r || !e || !t || (v.current = !1, i("uploading"), (async () => {
333
- try {
334
- let a = await e(r, m.current || "audio/webm");
335
- if (v.current) return;
336
- let s = await t(a);
337
- if (v.current) return;
338
- b(), g.current = null, o(null), c(null), i("idle"), n?.(s);
339
- } catch (e) {
340
- if (v.current) return;
341
- c(e instanceof Error ? e.message : "Transcription failed"), i("error");
342
- }
343
- })());
344
- }, [
345
- e,
346
- t,
347
- n,
348
- b
349
- ]), w = I(() => {
350
- v.current = !0, b(), g.current = null, o(null), c(null), i("idle");
351
- }, [b]);
352
- return L(() => () => {
353
- v.current = !0, b();
354
- }, [b]), {
355
- state: r,
356
- waveformData: a,
357
- errorMessage: s,
358
- startRecording: x,
359
- stopRecording: S,
360
- confirmRecording: C,
361
- discardRecording: w
317
+ }, [h, g]), y = M(() => {
318
+ let e = u.current;
319
+ e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), g(), o(0), i(null), n("idle");
320
+ }, [g]);
321
+ return N(() => () => {
322
+ g();
323
+ }, [g]), {
324
+ state: t,
325
+ analyserNodeRef: l,
326
+ elapsedSeconds: a,
327
+ errorMessage: r,
328
+ startRecording: _,
329
+ stopRecording: v,
330
+ discardRecording: y
362
331
  };
363
- }, Ie = /* @__PURE__ */ function(e) {
332
+ }, Re = /* @__PURE__ */ function(e) {
364
333
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
365
- }({}), Le = {
334
+ }({}), ze = {
366
335
  item: "_item_vou13_1",
367
336
  itemIcon: "_itemIcon_vou13_11"
368
- }, Re = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: c = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "" }) => {
337
+ }, Be = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: c = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "" }) => {
369
338
  let d = (e) => {
370
339
  e(), r();
371
340
  };
372
- return /* @__PURE__ */ H(W, {
341
+ return /* @__PURE__ */ z(H, {
373
342
  isOpen: e,
374
343
  title: t,
375
344
  closeLabel: n,
@@ -377,22 +346,22 @@ var Ce = (e, t) => {
377
346
  style: i,
378
347
  className: o,
379
348
  titleClassName: c,
380
- children: /* @__PURE__ */ H("ul", {
349
+ children: /* @__PURE__ */ z("ul", {
381
350
  role: "list",
382
351
  className: "flex flex-col",
383
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(p, {
352
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ z("li", { children: /* @__PURE__ */ z(p, {
384
353
  type: "button",
385
- className: s(Le.item, "flex w-full items-center gap-3 px-4 py-[10px] text-start"),
386
- iconBefore: /* @__PURE__ */ H("span", {
387
- className: Le.itemIcon,
354
+ className: s(ze.item, "flex w-full items-center gap-3 px-4 py-[10px] text-start"),
355
+ iconBefore: /* @__PURE__ */ z("span", {
356
+ className: ze.itemIcon,
388
357
  children: n
389
358
  }),
390
- iconAfter: r ? /* @__PURE__ */ H("span", {
359
+ iconAfter: r ? /* @__PURE__ */ z("span", {
391
360
  className: "ms-auto",
392
361
  children: r
393
362
  }) : null,
394
363
  textClassName: u,
395
- label: /* @__PURE__ */ H("span", {
364
+ label: /* @__PURE__ */ z("span", {
396
365
  className: l,
397
366
  children: t
398
367
  }),
@@ -400,62 +369,62 @@ var Ce = (e, t) => {
400
369
  }) }, e))
401
370
  })
402
371
  });
403
- }, ze = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ U("svg", {
372
+ }, Ve = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ B("svg", {
404
373
  width: f.SM,
405
374
  height: f.SM,
406
375
  viewBox: "0 0 24 24",
407
376
  fill: "none",
408
377
  "aria-hidden": !0,
409
- children: [/* @__PURE__ */ H("defs", { children: /* @__PURE__ */ U("linearGradient", {
378
+ children: [/* @__PURE__ */ z("defs", { children: /* @__PURE__ */ B("linearGradient", {
410
379
  id: e,
411
380
  x1: "0",
412
381
  y1: "0",
413
382
  x2: "24",
414
383
  y2: "24",
415
384
  gradientUnits: "userSpaceOnUse",
416
- children: [/* @__PURE__ */ H("stop", {
385
+ children: [/* @__PURE__ */ z("stop", {
417
386
  offset: "0%",
418
387
  stopColor: "#4b7be6"
419
- }), /* @__PURE__ */ H("stop", {
388
+ }), /* @__PURE__ */ z("stop", {
420
389
  offset: "100%",
421
390
  stopColor: "#9355f4"
422
391
  })]
423
- }) }), /* @__PURE__ */ H("path", {
392
+ }) }), /* @__PURE__ */ z("path", {
424
393
  d: "M5 12l5 5L20 7",
425
394
  stroke: `url(#${e})`,
426
395
  strokeWidth: "2",
427
396
  strokeLinecap: "round",
428
397
  strokeLinejoin: "round"
429
398
  })]
430
- }), G = {
399
+ }), He = {
431
400
  tabContainer: "_tabContainer_rzv03_1",
432
401
  tabActive: "_tabActive_rzv03_13"
433
402
  };
434
- de(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
403
+ he(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
435
404
  let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
436
- return /* @__PURE__ */ H("div", {
405
+ return /* @__PURE__ */ z("div", {
437
406
  className: "flex flex-nowrap gap-1",
438
407
  children: e.map((e) => {
439
408
  let r = t === e.id;
440
- return /* @__PURE__ */ H(ee, {
409
+ return /* @__PURE__ */ z(D, {
441
410
  label: e.label,
442
411
  selected: r,
443
412
  onClick: () => n(e.id),
444
413
  "aria-selected": r,
445
- className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, G.tabContainer, r && G.tabActive)
414
+ className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, He.tabContainer, r && He.tabActive)
446
415
  }, e.id);
447
416
  })
448
417
  });
449
418
  });
450
419
  //#endregion
451
420
  //#region ../ai-dial-kit/src/components/Button/Buttons.tsx
452
- var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p, {
421
+ var U = (e) => /* @__PURE__ */ z(x, { ...e }), W = (e) => /* @__PURE__ */ z(p, {
453
422
  ...e,
454
423
  variant: d.Neutral,
455
424
  appearance: u.Outlined
456
- }), Ve = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
457
- let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
458
- L(() => {
425
+ }), Ue = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
426
+ let [s, c] = L(t), [l, u] = L(n), [d, f] = L(r), p = I(o);
427
+ N(() => {
459
428
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
460
429
  }, [
461
430
  o,
@@ -472,7 +441,7 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
472
441
  setResponseFormat: c,
473
442
  setSystemPrompt: u,
474
443
  setTemperature: f,
475
- handleSubmit: I(() => {
444
+ handleSubmit: M(() => {
476
445
  if (!m) return;
477
446
  let t = {};
478
447
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -486,18 +455,18 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
486
455
  a
487
456
  ])
488
457
  };
489
- }, q = "!dial-small-semi-text !text-primary gap-1", He = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "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: h = [
458
+ }, We = "!dial-small-semi-text !text-primary gap-1", G = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "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: h = [
490
459
  "Precise",
491
460
  "Neutral",
492
461
  "Creative"
493
- ], temperatureHint: g }) => /* @__PURE__ */ U("div", {
462
+ ], temperatureHint: g }) => /* @__PURE__ */ B("div", {
494
463
  className: "flex flex-col gap-4 px-6 py-3",
495
464
  children: [
496
- e.responseFormat && /* @__PURE__ */ H(S, {
465
+ e.responseFormat && /* @__PURE__ */ z(S, {
497
466
  fieldTitle: c,
498
- labelClassName: q,
467
+ labelClassName: We,
499
468
  elementId: "response-format",
500
- orientation: te.Column,
469
+ orientation: ee.Column,
501
470
  activeRadioButton: t ?? a.Markdown,
502
471
  labelDescription: l,
503
472
  radioButtons: [{
@@ -509,19 +478,19 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
509
478
  }],
510
479
  onChange: (e) => i(e)
511
480
  }),
512
- e.systemPrompt && /* @__PURE__ */ H(y, {
481
+ e.systemPrompt && /* @__PURE__ */ z(y, {
513
482
  value: n,
514
483
  placeholder: p,
515
484
  labelProps: {
516
- className: q,
485
+ className: We,
517
486
  label: f
518
487
  },
519
488
  onChange: (e) => o(e ?? "")
520
489
  }),
521
- e.temperature && /* @__PURE__ */ H(E, {
490
+ e.temperature && /* @__PURE__ */ z(E, {
522
491
  labelProps: {
523
492
  label: m,
524
- className: q,
493
+ className: We,
525
494
  caption: g
526
495
  },
527
496
  value: r,
@@ -532,8 +501,8 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
532
501
  onChange: s
533
502
  })
534
503
  ]
535
- }), Ue = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
536
- let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: k, setTemperature: A, handleSubmit: te } = Ve({
504
+ }), Ge = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
505
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: k, setSystemPrompt: A, setTemperature: ee, handleSubmit: j } = Ue({
537
506
  isOpen: e,
538
507
  features: o,
539
508
  initialResponseFormat: c,
@@ -542,7 +511,7 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
542
511
  onSave: d,
543
512
  onClose: r
544
513
  });
545
- return /* @__PURE__ */ U(W, {
514
+ return /* @__PURE__ */ B(H, {
546
515
  isOpen: e,
547
516
  title: f,
548
517
  closeLabel: i,
@@ -550,14 +519,14 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
550
519
  onBack: t,
551
520
  backLabel: n,
552
521
  style: a,
553
- children: [/* @__PURE__ */ H(He, {
522
+ children: [/* @__PURE__ */ z(G, {
554
523
  features: o,
555
524
  responseFormat: w,
556
525
  systemPrompt: T,
557
526
  temperature: E,
558
- onResponseFormatChange: ee,
559
- onSystemPromptChange: k,
560
- onTemperatureChange: A,
527
+ onResponseFormatChange: k,
528
+ onSystemPromptChange: A,
529
+ onTemperatureChange: ee,
561
530
  responseFormatLabel: p,
562
531
  responseFormatHint: m,
563
532
  responseFormatMarkdownLabel: h,
@@ -567,23 +536,23 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
567
536
  temperatureLabel: y,
568
537
  temperatureLabels: b,
569
538
  temperatureHint: x
570
- }), /* @__PURE__ */ H("div", {
539
+ }), /* @__PURE__ */ z("div", {
571
540
  className: s("px-6 py-4 mobile:pb-8"),
572
- children: /* @__PURE__ */ H(O, {
541
+ children: /* @__PURE__ */ z(O, {
573
542
  tooltip: C,
574
543
  hideTooltip: D || !C,
575
544
  triggerClassName: "w-full",
576
- children: /* @__PURE__ */ H(K, {
545
+ children: /* @__PURE__ */ z(U, {
577
546
  label: S,
578
- onClick: te,
547
+ onClick: j,
579
548
  disabled: !D,
580
549
  className: "w-full"
581
550
  })
582
551
  })
583
552
  })]
584
553
  });
585
- }, We = ({ 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: _ }) => {
586
- let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = Ve({
554
+ }, K = ({ 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: _ }) => {
555
+ let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = Ue({
587
556
  features: e,
588
557
  initialResponseFormat: t,
589
558
  initialSystemPrompt: n,
@@ -591,25 +560,25 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
591
560
  onSave: i,
592
561
  onClose: a
593
562
  });
594
- return /* @__PURE__ */ H(b, {
563
+ return /* @__PURE__ */ z(b, {
595
564
  open: !0,
596
565
  header: o,
597
566
  size: A.Sm,
598
567
  onClose: a,
599
568
  className: "!bg-layer-2",
600
- footer: /* @__PURE__ */ H("div", {
569
+ footer: /* @__PURE__ */ z("div", {
601
570
  className: "flex justify-end px-6 py-4",
602
- children: /* @__PURE__ */ H(O, {
571
+ children: /* @__PURE__ */ z(O, {
603
572
  tooltip: _,
604
573
  hideTooltip: S || !_,
605
- children: /* @__PURE__ */ H(K, {
574
+ children: /* @__PURE__ */ z(U, {
606
575
  label: g,
607
576
  onClick: E,
608
577
  disabled: !S
609
578
  })
610
579
  })
611
580
  }),
612
- children: /* @__PURE__ */ H(He, {
581
+ children: /* @__PURE__ */ z(G, {
613
582
  features: e,
614
583
  responseFormat: v,
615
584
  systemPrompt: y,
@@ -629,15 +598,15 @@ var K = (e) => /* @__PURE__ */ H(x, { ...e }), Be = (e) => /* @__PURE__ */ H(p,
629
598
  })
630
599
  });
631
600
  };
632
- de(We);
601
+ he(K);
633
602
  //#endregion
634
603
  //#region src/components/AddAttachmentButton/AddAttachmentButton.tsx
635
- var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: i, style: o, listClassName: u = "cp-dropdown-overlay !w-[240px]", isDisabled: d = !1, chatSettings: p, extraMenuItems: m }) => {
636
- let g = c(), [_, y] = B(!1), [b, x] = B(!1), S = R(() => [
604
+ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: i, style: o, listClassName: u = "cp-dropdown-overlay !w-[240px]", isDisabled: d = !1, chatSettings: p, extraMenuItems: m }) => {
605
+ let g = c(), [_, y] = L(!1), [b, x] = L(!1), S = F(() => [
637
606
  ...e == null ? [] : [{
638
607
  key: "attach",
639
608
  label: t,
640
- icon: /* @__PURE__ */ H(oe, {
609
+ icon: /* @__PURE__ */ z(se, {
641
610
  size: l,
642
611
  "aria-hidden": !0
643
612
  }),
@@ -647,11 +616,11 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
647
616
  ...p == null ? [] : [{
648
617
  key: "chat-settings",
649
618
  label: p.menuItemLabel ?? "Chat settings",
650
- icon: /* @__PURE__ */ H(ce, {
619
+ icon: /* @__PURE__ */ z(de, {
651
620
  size: l,
652
621
  "aria-hidden": !0
653
622
  }),
654
- iconAfter: g ? /* @__PURE__ */ H(re, {
623
+ iconAfter: g ? /* @__PURE__ */ z(ie, {
655
624
  size: l,
656
625
  stroke: 1.5,
657
626
  className: "text-secondary rtl:scale-x-[-1]",
@@ -666,9 +635,9 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
666
635
  m,
667
636
  g
668
637
  ]);
669
- return S.length === 0 ? null : /* @__PURE__ */ H(V, { children: g ? /* @__PURE__ */ U(V, { children: [
670
- /* @__PURE__ */ H(v, {
671
- icon: /* @__PURE__ */ H(P, {
638
+ return S.length === 0 ? null : /* @__PURE__ */ z(R, { children: g ? /* @__PURE__ */ B(R, { children: [
639
+ /* @__PURE__ */ z(v, {
640
+ icon: /* @__PURE__ */ z(ue, {
672
641
  size: f.LG,
673
642
  "aria-hidden": !0
674
643
  }),
@@ -677,7 +646,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
677
646
  className: s("size-10 flex-shrink-0", d && "pointer-events-none opacity-50"),
678
647
  onClick: () => y(!0)
679
648
  }),
680
- /* @__PURE__ */ H(Re, {
649
+ /* @__PURE__ */ z(Be, {
681
650
  isOpen: _,
682
651
  title: r,
683
652
  closeLabel: i,
@@ -687,7 +656,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
687
656
  className: "pb-4",
688
657
  btnTextClassName: "flex-1"
689
658
  }),
690
- p != null && /* @__PURE__ */ H(Ue, {
659
+ p != null && /* @__PURE__ */ z(Ge, {
691
660
  isOpen: b,
692
661
  onBack: () => {
693
662
  x(!1), y(!0);
@@ -714,13 +683,13 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
714
683
  saveLabel: p.saveLabel,
715
684
  saveDisabledTooltip: p.saveDisabledTooltip
716
685
  })
717
- ] }) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(h, {
686
+ ] }) : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(h, {
718
687
  matchReferenceWidth: !1,
719
688
  placement: "bottom-start",
720
689
  listClassName: u,
721
690
  items: S,
722
- children: /* @__PURE__ */ H(v, {
723
- icon: /* @__PURE__ */ H(P, {
691
+ children: /* @__PURE__ */ z(v, {
692
+ icon: /* @__PURE__ */ z(ue, {
724
693
  size: f.LG,
725
694
  "aria-hidden": !0
726
695
  }),
@@ -729,7 +698,7 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
729
698
  className: "size-10 flex-shrink-0",
730
699
  disabled: d
731
700
  })
732
- }), p != null && b && /* @__PURE__ */ H(We, {
701
+ }), p != null && b && /* @__PURE__ */ z(K, {
733
702
  features: p.features,
734
703
  initialResponseFormat: p.responseFormat ?? a.Markdown,
735
704
  initialSystemPrompt: p.systemPrompt,
@@ -749,114 +718,109 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
749
718
  saveLabel: p.saveLabel,
750
719
  saveDisabledTooltip: p.saveDisabledTooltip
751
720
  })] }) });
752
- }, J = {
753
- container: "_container_9pzud_1",
754
- containerError: "_containerError_9pzud_14",
755
- waveformCanvas: "_waveformCanvas_9pzud_18",
756
- recordingDot: "_recordingDot_9pzud_22",
757
- micRecordingIcon: "_micRecordingIcon_9pzud_26"
758
- }, Ke = 3, qe = 6, Je = .12, Ye = ({ state: e, waveformData: t, errorMessage: n, onStop: r, onConfirm: i, onDiscard: a, stopLabel: o = "Stop recording", confirmLabel: c = "Send voice message", discardLabel: l = "Discard recording", uploadingLabel: u = "Uploading…", style: d, className: p }) => {
759
- let m = z(null), h = z(null), g = z(!1), y = e === Me.Recording, b = e === Me.Uploading, x = e === Me.Error;
760
- g.current = y;
761
- let S = I((e, t) => {
762
- let n = e.getContext("2d");
763
- if (!n) return;
764
- e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
765
- let { width: r, height: i } = e;
766
- n.clearRect(0, 0, r, i), n.fillStyle = getComputedStyle(e).color;
767
- let a = Math.min(1, t * 6), o = Math.max(1, Math.floor(r / 4));
768
- for (let e = 0; e < o; e++) {
769
- let t = e / o * qe * Math.PI, r = Math.max(Je, Math.abs(Math.sin(t)) * a), s = Math.max(3, r * i);
770
- n.fillRect(e * 4, (i - s) / 2, Ke, s);
771
- }
772
- }, []), C = I((e, t) => {
773
- let n = e.getContext("2d");
774
- if (!n) return;
721
+ }, q = {
722
+ container: "_container_8j81i_1",
723
+ containerError: "_containerError_8j81i_14",
724
+ waveformCanvas: "_waveformCanvas_8j81i_18",
725
+ timer: "_timer_8j81i_22",
726
+ stopRecordingIcon: "_stopRecordingIcon_8j81i_28",
727
+ recordingDot: "_recordingDot_8j81i_42",
728
+ "recording-pulse": "_recording-pulse_8j81i_1"
729
+ }, qe = 3, Je = 4, J = 200, Ye = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`, Xe = ({ state: e, analyserNodeRef: t, elapsedSeconds: n, errorMessage: r, onStop: i, onDiscard: a, stopLabel: o = "Stop recording", discardLabel: c = "Discard recording", timerLabel: l = "Recording time", style: u, className: d }) => {
730
+ let p = I(null), m = I(new Float32Array(J)), h = I(0), g = I(0), y = e === Pe.Recording, b = e === Pe.Error, x = M((e) => {
731
+ let t = e.getContext("2d");
732
+ if (!t) return;
775
733
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
776
- let { width: r, height: i } = e;
777
- if (n.clearRect(0, 0, r, i), !t || t.length === 0) return;
778
- n.fillStyle = getComputedStyle(e).color;
779
- let a = Math.max(1, Math.floor(r / 4));
780
- for (let e = 0; e < a; e++) {
781
- let r = t[Math.floor(e / a * t.length)] ?? 0, o = Math.min(1, r * 6), s = Math.max(3, o * i);
782
- n.fillRect(e * 4, (i - s) / 2, Ke, s);
734
+ let { width: n, height: r } = e;
735
+ t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
736
+ let i = Math.min(Math.max(1, Math.floor(n / Je)), J - 1), a = h.current, o = g.current;
737
+ t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
738
+ for (let e = 0; e <= i; e++) {
739
+ let n = ((a - i + e) % J + J) % J, o = m.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
740
+ t.fillRect(e * Je, (r - c) / 2, qe, c);
783
741
  }
742
+ t.restore();
784
743
  }, []);
785
- L(() => {
786
- h.current = t;
787
- let e = m.current;
788
- e && (g.current ? S(e, t?.[t.length - 1] ?? 0) : C(e, t));
744
+ N(() => {
745
+ if (!y) return;
746
+ let e = p.current;
747
+ if (!e) return;
748
+ m.current.fill(0), h.current = 0, g.current = 0;
749
+ let n, r = () => {
750
+ if (g.current += 1, g.current >= Je) {
751
+ g.current -= Je;
752
+ let e = t.current;
753
+ if (e) {
754
+ let t = new Uint8Array(e.frequencyBinCount);
755
+ e.getByteTimeDomainData(t);
756
+ let n = 0;
757
+ for (let e = 0; e < t.length; e++) {
758
+ let r = (t[e] - 128) / 128;
759
+ n += r * r;
760
+ }
761
+ m.current[h.current % J] = Math.sqrt(n / t.length), h.current++;
762
+ }
763
+ }
764
+ x(e), n = requestAnimationFrame(r);
765
+ };
766
+ return n = requestAnimationFrame(r), () => {
767
+ cancelAnimationFrame(n);
768
+ };
789
769
  }, [
770
+ y,
790
771
  t,
791
- S,
792
- C
793
- ]), L(() => {
794
- let e = m.current;
772
+ x
773
+ ]), N(() => {
774
+ let e = p.current;
795
775
  if (!e) return;
796
776
  let t = new ResizeObserver(() => {
797
- if (g.current) {
798
- let t = h.current;
799
- S(e, t?.[t.length - 1] ?? 0);
800
- } else C(e, h.current);
777
+ x(e);
801
778
  });
802
779
  return t.observe(e), () => t.disconnect();
803
- }, [S, C]);
804
- let w = /* @__PURE__ */ H("div", {
780
+ }, [x]);
781
+ let S = /* @__PURE__ */ B("div", {
805
782
  className: "flex flex-shrink-0 items-center justify-end gap-1",
806
- children: y ? /* @__PURE__ */ H(v, {
807
- icon: /* @__PURE__ */ H(se, {
783
+ children: [/* @__PURE__ */ z(v, {
784
+ icon: /* @__PURE__ */ z(fe, {
808
785
  size: f.LG,
809
- className: J.micRecordingIcon,
810
786
  "aria-hidden": !0
811
787
  }),
812
- "aria-label": o,
788
+ "aria-label": c,
813
789
  className: "size-10 flex-shrink-0",
814
- onClick: r
815
- }) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(v, {
816
- icon: /* @__PURE__ */ H(le, {
790
+ onClick: a
791
+ }), y && /* @__PURE__ */ z(v, {
792
+ icon: /* @__PURE__ */ z(ce, {
817
793
  size: f.LG,
794
+ className: q.stopRecordingIcon,
818
795
  "aria-hidden": !0
819
796
  }),
820
- "aria-label": l,
821
- className: "size-10 flex-shrink-0",
822
- onClick: a
823
- }), b ? /* @__PURE__ */ H(D, {
824
- fullWidth: !1,
825
- size: f.LG,
826
- ariaLabel: u,
827
- className: "flex size-10 flex-shrink-0 items-center justify-center"
828
- }) : /* @__PURE__ */ H(v, {
829
- icon: /* @__PURE__ */ H("div", {
830
- className: "flex size-8 items-center justify-center rounded-full bg-controls-accent-primary",
831
- children: /* @__PURE__ */ H(M, {
832
- size: 24,
833
- "aria-hidden": !0,
834
- className: "rounded-full bg-controls-accent-primary text-control-permanent"
835
- })
836
- }),
837
- "aria-label": c,
797
+ "aria-label": o,
838
798
  className: "size-10 flex-shrink-0",
839
799
  onClick: i
840
- })] })
800
+ })]
841
801
  });
842
- return /* @__PURE__ */ U("div", {
843
- className: p,
844
- children: [/* @__PURE__ */ U("div", {
845
- style: d,
846
- className: s(J.container, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", x && J.containerError),
847
- children: [/* @__PURE__ */ U("div", {
802
+ return /* @__PURE__ */ B("div", {
803
+ className: d,
804
+ children: [/* @__PURE__ */ B("div", {
805
+ style: u,
806
+ className: s(q.container, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", b && q.containerError),
807
+ children: [/* @__PURE__ */ B("div", {
848
808
  className: "flex min-w-0 flex-1 items-center gap-2",
849
- children: [y && /* @__PURE__ */ H("span", {
850
- className: s(J.recordingDot, "size-2 flex-shrink-0 rounded-full"),
809
+ children: [y && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("span", {
810
+ className: q.recordingDot,
851
811
  "aria-hidden": !0
852
- }), /* @__PURE__ */ H("canvas", {
853
- ref: m,
812
+ }), /* @__PURE__ */ z("span", {
813
+ className: s(q.timer, "flex-shrink-0"),
814
+ "aria-label": l,
815
+ children: Ye(n)
816
+ })] }), /* @__PURE__ */ z("canvas", {
817
+ ref: p,
854
818
  height: 32,
855
- className: s(J.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
819
+ className: s(q.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
856
820
  })]
857
- }), w]
858
- }), x && n && /* @__PURE__ */ H(_, {
859
- text: n,
821
+ }), S]
822
+ }), b && r && /* @__PURE__ */ z(_, {
823
+ text: r,
860
824
  className: "mt-1 px-1"
861
825
  })]
862
826
  });
@@ -872,73 +836,73 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
872
836
  sendButtonEnter: "_sendButtonEnter_1q2nu_1",
873
837
  sendButtonExiting: "_sendButtonExiting_1q2nu_55",
874
838
  sendButtonExit: "_sendButtonExit_1q2nu_55"
875
- }, Xe = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ H(O, {
839
+ }, Ze = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ z(O, {
876
840
  tooltip: r,
877
841
  hideTooltip: !r,
878
- children: /* @__PURE__ */ H("button", {
842
+ children: /* @__PURE__ */ z("button", {
879
843
  className: s("flex size-[32px] cursor-pointer items-center justify-center rounded-full disabled:cursor-not-allowed", Y.sendButton, i && Y.sendButtonExiting),
880
844
  "aria-label": n,
881
845
  onClick: () => e?.(),
882
846
  type: "button",
883
847
  disabled: t,
884
848
  "aria-hidden": i,
885
- children: /* @__PURE__ */ H(j, {
849
+ children: /* @__PURE__ */ z(te, {
886
850
  size: f.LG,
887
851
  className: "rtl:scale-x-[-1]"
888
852
  })
889
853
  })
890
- }), Ze = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H("button", {
854
+ }), Qe = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ z("button", {
891
855
  className: s("flex cursor-pointer items-center justify-center disabled:cursor-not-allowed"),
892
856
  "aria-label": t,
893
857
  onClick: () => e?.(),
894
858
  type: "button",
895
- children: /* @__PURE__ */ H(se, {
859
+ children: /* @__PURE__ */ z(le, {
896
860
  size: f.LG,
897
861
  className: Y.stopIcon
898
862
  })
899
- }), Qe = ({ size: e = 20 }) => /* @__PURE__ */ H(w, {
863
+ }), $e = ({ size: e = 20 }) => /* @__PURE__ */ z(w, {
900
864
  variant: T.Circular,
901
865
  width: e,
902
866
  height: e,
903
867
  active: !0
904
- }), $e = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
868
+ }), et = ({ loadingLabel: e }) => /* @__PURE__ */ B("span", {
905
869
  className: "flex min-w-0 flex-1 items-center",
906
- children: [/* @__PURE__ */ H(w, {
870
+ children: [/* @__PURE__ */ z(w, {
907
871
  variant: T.Text,
908
872
  width: "100%",
909
873
  height: 16,
910
874
  active: !0
911
- }), e && /* @__PURE__ */ H("span", {
875
+ }), e && /* @__PURE__ */ z("span", {
912
876
  className: "sr-only",
913
877
  children: e
914
878
  })]
915
- }), et = ({ loadingLabel: e }) => /* @__PURE__ */ H("div", {
879
+ }), tt = ({ loadingLabel: e }) => /* @__PURE__ */ z("div", {
916
880
  role: "status",
917
881
  "aria-label": e,
918
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
882
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ B("div", {
919
883
  className: "flex h-11 items-center gap-3 px-4",
920
884
  "aria-hidden": "true",
921
- children: [/* @__PURE__ */ H(Qe, {}), /* @__PURE__ */ H($e, {})]
885
+ children: [/* @__PURE__ */ z($e, {}), /* @__PURE__ */ z(et, {})]
922
886
  }, t))
923
- }), tt = (e) => e.displayName ?? e.id, nt = (e, t) => {
887
+ }), nt = (e) => e.displayName ?? e.id, rt = (e, t) => {
924
888
  let n = t.trim().toLowerCase();
925
- return n ? e.filter((e) => tt(e).toLowerCase().includes(n)) : e;
926
- }, rt = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
889
+ return n ? e.filter((e) => nt(e).toLowerCase().includes(n)) : e;
890
+ }, it = (e, t, r, i = 18, a) => /* @__PURE__ */ z(n, {
927
891
  src: e,
928
892
  size: i,
929
893
  labels: { tooltip: a },
930
894
  initialsName: r
931
- }), it = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: i, searchHeaderClassName: a = "bg-layer-0" }) => {
932
- let [o, c] = B(""), l = R(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = R(() => u ? /* @__PURE__ */ H(Qe, { size: f.LG }) : rt(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", f.LG), [u, l]), p = l?.displayName ?? l?.id;
895
+ }), at = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: i, searchHeaderClassName: a = "bg-layer-0" }) => {
896
+ let [o, c] = L(""), l = F(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = F(() => u ? /* @__PURE__ */ z($e, { size: f.LG }) : it(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", f.LG), [u, l]), p = l?.displayName ?? l?.id;
933
897
  return {
934
898
  selectorIcon: d,
935
899
  selectorAriaLabel: p ? `${i?.ariaLabel ?? "Select model"}: ${p}` : i?.ariaLabel ?? "Select model",
936
900
  selectedLabel: p,
937
- menuItems: R(() => {
901
+ menuItems: F(() => {
938
902
  if (u) return Array.from({ length: 7 }, (e, t) => ({
939
903
  key: `__loading-${t}`,
940
- icon: /* @__PURE__ */ H(Qe, {}),
941
- label: /* @__PURE__ */ H($e, { loadingLabel: t === 0 ? i?.loading : void 0 }),
904
+ icon: /* @__PURE__ */ z($e, {}),
905
+ label: /* @__PURE__ */ z(et, { loadingLabel: t === 0 ? i?.loading : void 0 }),
942
906
  disabled: !0
943
907
  }));
944
908
  if (!e || e.length === 0) {
@@ -949,19 +913,19 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
949
913
  disabled: !0
950
914
  }] : [];
951
915
  }
952
- return nt(e, o).map((e) => {
916
+ return rt(e, o).map((e) => {
953
917
  let i = e.id === t;
954
918
  return {
955
919
  key: e.id,
956
- label: /* @__PURE__ */ U("span", {
920
+ label: /* @__PURE__ */ B("span", {
957
921
  className: "flex w-full items-center justify-between gap-2",
958
- children: [/* @__PURE__ */ H(r, {
959
- text: tt(e),
922
+ children: [/* @__PURE__ */ z(r, {
923
+ text: nt(e),
960
924
  query: o,
961
925
  maxLines: 1
962
- }), i && /* @__PURE__ */ H(ze, { gradientId: "ms-check-grad" })]
926
+ }), i && /* @__PURE__ */ z(Ve, { gradientId: "ms-check-grad" })]
963
927
  }),
964
- icon: rt(e.iconUrl, e.type, e.displayName ?? e.id),
928
+ icon: it(e.iconUrl, e.type, e.displayName ?? e.id),
965
929
  onClick: () => n?.(e.id),
966
930
  className: i ? "bg-accent-primary-alpha" : void 0
967
931
  };
@@ -974,9 +938,9 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
974
938
  i,
975
939
  n
976
940
  ]),
977
- menuHeader: R(() => !u && e && e.length > 0 ? /* @__PURE__ */ H("div", {
941
+ menuHeader: F(() => !u && e && e.length > 0 ? /* @__PURE__ */ z("div", {
978
942
  className: s("sticky top-0 z-10 pb-1 pe-2 pt-2", a),
979
- children: /* @__PURE__ */ H(C, {
943
+ children: /* @__PURE__ */ z(C, {
980
944
  value: o,
981
945
  placeholder: i?.searchPlaceholder ?? "Search",
982
946
  size: k.Small,
@@ -994,8 +958,8 @@ var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
994
958
  e || c("");
995
959
  }
996
960
  };
997
- }, X = typeof window < "u" ? pe : L;
998
- function at(e) {
961
+ }, X = typeof window < "u" ? ge : N;
962
+ function ot(e) {
999
963
  if (e !== void 0) switch (typeof e) {
1000
964
  case "number": return e;
1001
965
  case "string":
@@ -1003,11 +967,11 @@ function at(e) {
1003
967
  break;
1004
968
  }
1005
969
  }
1006
- function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1007
- let { styleHeight: s, styleWidth: c } = R(() => ({
1008
- styleHeight: at(o?.height),
1009
- styleWidth: at(o?.width)
1010
- }), [o?.height, o?.width]), [l, u] = B({
970
+ function st({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
971
+ let { styleHeight: s, styleWidth: c } = F(() => ({
972
+ styleHeight: ot(o?.height),
973
+ styleWidth: ot(o?.width)
974
+ }), [o?.height, o?.width]), [l, u] = L({
1011
975
  height: t,
1012
976
  width: n
1013
977
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
@@ -1031,7 +995,7 @@ function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1031
995
  i,
1032
996
  s,
1033
997
  c
1034
- ]), R(() => ({
998
+ ]), F(() => ({
1035
999
  height: s ?? l.height,
1036
1000
  width: c ?? l.width
1037
1001
  }), [
@@ -1040,16 +1004,16 @@ function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1040
1004
  c
1041
1005
  ]);
1042
1006
  }
1043
- function st(e) {
1044
- let t = z(() => {
1007
+ function ct(e) {
1008
+ let t = I(() => {
1045
1009
  throw Error("Cannot call during render.");
1046
1010
  });
1047
1011
  return X(() => {
1048
1012
  t.current = e;
1049
- }, [e]), I((e) => t.current?.(e), [t]);
1013
+ }, [e]), M((e) => t.current?.(e), [t]);
1050
1014
  }
1051
1015
  var Z = null;
1052
- function ct(e = !1) {
1016
+ function lt(e = !1) {
1053
1017
  if (Z === null || e) {
1054
1018
  let e = document.createElement("div"), t = e.style;
1055
1019
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
@@ -1058,8 +1022,8 @@ function ct(e = !1) {
1058
1022
  }
1059
1023
  return Z;
1060
1024
  }
1061
- function lt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1062
- if (t === "horizontal" && n) switch (ct()) {
1025
+ function ut({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1026
+ if (t === "horizontal" && n) switch (lt()) {
1063
1027
  case "negative": return -r;
1064
1028
  case "positive-descending":
1065
1029
  if (e) {
@@ -1079,7 +1043,7 @@ function $(e, t) {
1079
1043
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1080
1044
  return !0;
1081
1045
  }
1082
- function ut({ cachedBounds: e, itemCount: t, itemSize: n }) {
1046
+ function dt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1083
1047
  if (t === 0) return 0;
1084
1048
  if (typeof n == "number") return t * n;
1085
1049
  {
@@ -1087,9 +1051,9 @@ function ut({ cachedBounds: e, itemCount: t, itemSize: n }) {
1087
1051
  return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1088
1052
  }
1089
1053
  }
1090
- function dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1054
+ function ft({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1091
1055
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1092
- let s = ut({
1056
+ let s = dt({
1093
1057
  cachedBounds: t,
1094
1058
  itemCount: r,
1095
1059
  itemSize: i
@@ -1101,7 +1065,7 @@ function dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1101
1065
  default: return a >= u && a <= l ? a : a < u ? u : l;
1102
1066
  }
1103
1067
  }
1104
- function ft({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1068
+ function pt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1105
1069
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1106
1070
  for (; u < a;) {
1107
1071
  let n = e.get(u);
@@ -1120,7 +1084,7 @@ function ft({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
1120
1084
  stopIndexOverscan: l
1121
1085
  };
1122
1086
  }
1123
- function pt({ itemCount: e, itemProps: t, itemSize: n }) {
1087
+ function mt({ itemCount: e, itemProps: t, itemSize: n }) {
1124
1088
  let r = /* @__PURE__ */ new Map();
1125
1089
  return {
1126
1090
  get(i) {
@@ -1157,8 +1121,8 @@ function pt({ itemCount: e, itemProps: t, itemSize: n }) {
1157
1121
  }
1158
1122
  };
1159
1123
  }
1160
- function mt({ itemCount: e, itemProps: t, itemSize: n }) {
1161
- return R(() => pt({
1124
+ function ht({ itemCount: e, itemProps: t, itemSize: n }) {
1125
+ return F(() => mt({
1162
1126
  itemCount: e,
1163
1127
  itemProps: t,
1164
1128
  itemSize: n
@@ -1168,7 +1132,7 @@ function mt({ itemCount: e, itemProps: t, itemSize: n }) {
1168
1132
  n
1169
1133
  ]);
1170
1134
  }
1171
- function ht({ containerSize: e, itemSize: t }) {
1135
+ function gt({ containerSize: e, itemSize: t }) {
1172
1136
  let n;
1173
1137
  switch (typeof t) {
1174
1138
  case "string":
@@ -1180,21 +1144,21 @@ function ht({ containerSize: e, itemSize: t }) {
1180
1144
  }
1181
1145
  return n;
1182
1146
  }
1183
- function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1184
- let { height: u = n, width: d = n } = ot({
1147
+ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1148
+ let { height: u = n, width: d = n } = st({
1185
1149
  defaultHeight: r === "vertical" ? n : void 0,
1186
1150
  defaultWidth: r === "horizontal" ? n : void 0,
1187
1151
  element: e,
1188
1152
  mode: r === "vertical" ? "only-height" : "only-width",
1189
1153
  style: t
1190
- }), f = z({
1154
+ }), f = I({
1191
1155
  height: 0,
1192
1156
  width: 0
1193
- }), p = r === "vertical" ? u : d, m = ht({
1157
+ }), p = r === "vertical" ? u : d, m = gt({
1194
1158
  containerSize: p,
1195
1159
  itemSize: s
1196
1160
  });
1197
- pe(() => {
1161
+ ge(() => {
1198
1162
  if (typeof c == "function") {
1199
1163
  let e = f.current;
1200
1164
  (e.height !== u || e.width !== d) && (c({
@@ -1207,11 +1171,11 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1207
1171
  c,
1208
1172
  d
1209
1173
  ]);
1210
- let h = mt({
1174
+ let h = ht({
1211
1175
  itemCount: a,
1212
1176
  itemProps: o,
1213
1177
  itemSize: m
1214
- }), g = I((e) => h.get(e), [h]), [_, v] = B(() => ft({
1178
+ }), g = M((e) => h.get(e), [h]), [_, v] = L(() => pt({
1215
1179
  cachedBounds: h,
1216
1180
  containerScrollOffset: 0,
1217
1181
  containerSize: p,
@@ -1222,7 +1186,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1222
1186
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1223
1187
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1224
1188
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1225
- }, C = I(() => ut({
1189
+ }, C = M(() => dt({
1226
1190
  cachedBounds: h,
1227
1191
  itemCount: a,
1228
1192
  itemSize: m
@@ -1230,9 +1194,9 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1230
1194
  h,
1231
1195
  a,
1232
1196
  m
1233
- ]), w = I((t) => ft({
1197
+ ]), w = M((t) => pt({
1234
1198
  cachedBounds: h,
1235
- containerScrollOffset: lt({
1199
+ containerScrollOffset: ut({
1236
1200
  containerElement: e,
1237
1201
  direction: r,
1238
1202
  isRtl: i,
@@ -1260,9 +1224,9 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1260
1224
  if (!e) return;
1261
1225
  let t = () => {
1262
1226
  v((t) => {
1263
- let { scrollLeft: n, scrollTop: o } = e, s = ft({
1227
+ let { scrollLeft: n, scrollTop: o } = e, s = pt({
1264
1228
  cachedBounds: h,
1265
- containerScrollOffset: lt({
1229
+ containerScrollOffset: ut({
1266
1230
  containerElement: e,
1267
1231
  direction: r,
1268
1232
  isRtl: i,
@@ -1288,8 +1252,8 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1288
1252
  ]), {
1289
1253
  getCellBounds: g,
1290
1254
  getEstimatedSize: C,
1291
- scrollToIndex: st(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1292
- let s = dt({
1255
+ scrollToIndex: ct(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1256
+ let s = ft({
1293
1257
  align: t,
1294
1258
  cachedBounds: h,
1295
1259
  containerScrollOffset: n,
@@ -1299,7 +1263,7 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1299
1263
  itemSize: m
1300
1264
  });
1301
1265
  if (e) {
1302
- if (s = lt({
1266
+ if (s = ut({
1303
1267
  containerElement: e,
1304
1268
  direction: r,
1305
1269
  isRtl: i,
@@ -1317,30 +1281,30 @@ function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1317
1281
  stopIndexVisible: x
1318
1282
  };
1319
1283
  }
1320
- function _t(e) {
1321
- return R(() => e, Object.values(e));
1284
+ function vt(e) {
1285
+ return F(() => e, Object.values(e));
1322
1286
  }
1323
- function vt(e, t) {
1287
+ function yt(e, t) {
1324
1288
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1325
1289
  return $(n, a) && $(r, o) && $(i, s);
1326
1290
  }
1327
- function yt(e) {
1291
+ function bt(e) {
1328
1292
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1329
1293
  }
1330
- var bt = "data-react-window-index";
1331
- function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1332
- let m = _t(u), h = R(() => de(s, vt), [s]), [g, _] = B(null), v = yt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = gt({
1294
+ var xt = "data-react-window-index";
1295
+ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1296
+ let m = vt(u), h = F(() => he(s, yt), [s]), [g, _] = L(null), v = bt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = _t({
1333
1297
  containerElement: g,
1334
1298
  containerStyle: f,
1335
1299
  defaultContainerSize: n,
1336
1300
  direction: "vertical",
1337
1301
  itemCount: c,
1338
1302
  itemProps: m,
1339
- itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1303
+ itemSize: F(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1340
1304
  onResize: i,
1341
1305
  overscanCount: o
1342
1306
  });
1343
- fe(r, () => ({
1307
+ P(r, () => ({
1344
1308
  get element() {
1345
1309
  return g;
1346
1310
  },
@@ -1360,7 +1324,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1360
1324
  let e = Array.from(g.children).filter((e, t) => {
1361
1325
  if (e.hasAttribute("aria-hidden")) return !1;
1362
1326
  let n = `${S + t}`;
1363
- return e.setAttribute(bt, n), !0;
1327
+ return e.setAttribute(xt, n), !0;
1364
1328
  });
1365
1329
  if (v) return l.observeRowElements(e);
1366
1330
  }, [
@@ -1369,7 +1333,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1369
1333
  l,
1370
1334
  S,
1371
1335
  w
1372
- ]), L(() => {
1336
+ ]), N(() => {
1373
1337
  S >= 0 && w >= 0 && a && a({
1374
1338
  startIndex: C,
1375
1339
  stopIndex: T
@@ -1384,11 +1348,11 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1384
1348
  w,
1385
1349
  T
1386
1350
  ]);
1387
- let E = R(() => {
1351
+ let E = F(() => {
1388
1352
  let e = [];
1389
1353
  if (c > 0) for (let t = S; t <= w; t++) {
1390
1354
  let n = y(t);
1391
- e.push(/* @__PURE__ */ F(h, {
1355
+ e.push(/* @__PURE__ */ me(h, {
1392
1356
  ...m,
1393
1357
  ariaAttributes: {
1394
1358
  "aria-posinset": t + 1,
@@ -1415,7 +1379,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1415
1379
  m,
1416
1380
  S,
1417
1381
  w
1418
- ]), D = /* @__PURE__ */ H("div", {
1382
+ ]), D = /* @__PURE__ */ z("div", {
1419
1383
  "aria-hidden": !0,
1420
1384
  style: {
1421
1385
  height: b(),
@@ -1423,7 +1387,7 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1423
1387
  zIndex: -1
1424
1388
  }
1425
1389
  });
1426
- return F(d, {
1390
+ return me(d, {
1427
1391
  role: "list",
1428
1392
  ...p,
1429
1393
  className: t,
@@ -1437,47 +1401,47 @@ function xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1437
1401
  }
1438
1402
  }, E, e, D);
1439
1403
  }
1440
- var St = {
1404
+ var Ct = {
1441
1405
  divider: "_divider_3wv6u_1",
1442
1406
  item: "_item_3wv6u_5",
1443
1407
  itemIcon: "_itemIcon_3wv6u_15",
1444
1408
  checkIcon: "_checkIcon_3wv6u_19",
1445
1409
  stateLabel: "_stateLabel_3wv6u_23"
1446
- }, Ct = 44, wt = 8, Tt = ({ index: e, style: t, ariaAttributes: n, items: i, selectedDeploymentId: a, labelClassName: o, query: c, onSelect: l }) => {
1447
- let u = i[e], d = rt(u.iconUrl, u.type, u.displayName ?? u.id, f.SM), m = u.id === a;
1448
- return /* @__PURE__ */ H("div", {
1410
+ }, wt = 44, Tt = 8, Et = ({ index: e, style: t, ariaAttributes: n, items: i, selectedDeploymentId: a, labelClassName: o, query: c, onSelect: l }) => {
1411
+ let u = i[e], d = it(u.iconUrl, u.type, u.displayName ?? u.id, f.SM), m = u.id === a;
1412
+ return /* @__PURE__ */ z("div", {
1449
1413
  style: t,
1450
1414
  ...n,
1451
- children: /* @__PURE__ */ H(p, {
1415
+ children: /* @__PURE__ */ z(p, {
1452
1416
  type: "button",
1453
- className: s(St.item, "flex h-full w-full items-center gap-3 px-4"),
1454
- iconBefore: /* @__PURE__ */ H("span", {
1455
- className: St.itemIcon,
1417
+ className: s(Ct.item, "flex h-full w-full items-center gap-3 px-4"),
1418
+ iconBefore: /* @__PURE__ */ z("span", {
1419
+ className: Ct.itemIcon,
1456
1420
  children: d
1457
1421
  }),
1458
- label: /* @__PURE__ */ U("span", {
1422
+ label: /* @__PURE__ */ B("span", {
1459
1423
  className: "flex flex-1 items-center justify-between gap-2",
1460
- children: [/* @__PURE__ */ H(r, {
1424
+ children: [/* @__PURE__ */ z(r, {
1461
1425
  text: u.displayName ?? u.id,
1462
1426
  query: c,
1463
1427
  maxLines: 1,
1464
1428
  className: s(o, "min-w-0 flex-1 text-start")
1465
- }), m && /* @__PURE__ */ H(M, {
1429
+ }), m && /* @__PURE__ */ z(ne, {
1466
1430
  size: f.SM,
1467
- className: St.checkIcon,
1431
+ className: Ct.checkIcon,
1468
1432
  "aria-hidden": !0
1469
1433
  })]
1470
1434
  }),
1471
1435
  onClick: () => l(u.id)
1472
1436
  })
1473
1437
  });
1474
- }, Et = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: c, loadingLabel: l, errorLabel: u, emptyLabel: d, style: f, titleClassName: p = "dial-body-semi-text", labelClassName: m = "dial-small-text" }) => {
1475
- let [h, g] = B("");
1476
- L(() => {
1438
+ }, Dt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: c, loadingLabel: l, errorLabel: u, emptyLabel: d, style: f, titleClassName: p = "dial-body-semi-text", labelClassName: m = "dial-small-text" }) => {
1439
+ let [h, g] = L("");
1440
+ N(() => {
1477
1441
  e || g("");
1478
1442
  }, [e]);
1479
- let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ? nt(a, h) : [];
1480
- return /* @__PURE__ */ U(W, {
1443
+ let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ? rt(a, h) : [];
1444
+ return /* @__PURE__ */ B(H, {
1481
1445
  isOpen: e,
1482
1446
  title: t,
1483
1447
  closeLabel: n,
@@ -1485,25 +1449,25 @@ var St = {
1485
1449
  style: f,
1486
1450
  titleClassName: p,
1487
1451
  className: "max-h-[80dvh]",
1488
- children: [_ && !v && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
1452
+ children: [_ && !v && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("div", {
1489
1453
  className: "flex-shrink-0 px-4 py-[10px]",
1490
- children: /* @__PURE__ */ H(C, {
1454
+ children: /* @__PURE__ */ z(C, {
1491
1455
  value: h,
1492
1456
  placeholder: r,
1493
1457
  size: k.Standard,
1494
1458
  onChange: g
1495
1459
  })
1496
- }), /* @__PURE__ */ H("div", { className: s(St.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ H(et, { loadingLabel: l }) : y ? /* @__PURE__ */ H("div", {
1460
+ }), /* @__PURE__ */ z("div", { className: s(Ct.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ z(tt, { loadingLabel: l }) : y ? /* @__PURE__ */ z("div", {
1497
1461
  role: "list",
1498
- className: s(St.stateLabel, m, "px-4 py-4"),
1462
+ className: s(Ct.stateLabel, m, "px-4 py-4"),
1499
1463
  children: y
1500
- }) : /* @__PURE__ */ H(xt, {
1464
+ }) : /* @__PURE__ */ z(St, {
1501
1465
  role: "list",
1502
1466
  className: "overflow-y-auto",
1503
- style: { height: Math.min(b.length, wt) * Ct },
1504
- rowComponent: Tt,
1467
+ style: { height: Math.min(b.length, Tt) * wt },
1468
+ rowComponent: Et,
1505
1469
  rowCount: b.length,
1506
- rowHeight: Ct,
1470
+ rowHeight: wt,
1507
1471
  rowProps: {
1508
1472
  items: b,
1509
1473
  selectedDeploymentId: o,
@@ -1515,23 +1479,23 @@ var St = {
1515
1479
  }
1516
1480
  })]
1517
1481
  });
1518
- }, Dt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: o = !1, isDisabled: c = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: p, onPickerOpenChange: m }) => {
1519
- let [_, y] = B(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = it({
1482
+ }, Ot = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: o = !1, isDisabled: c = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: p, onPickerOpenChange: m }) => {
1483
+ let [_, y] = L(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = at({
1520
1484
  deployments: e,
1521
1485
  selectedDeploymentId: t,
1522
1486
  onDeploymentChange: n,
1523
1487
  modelSelectorLabels: r
1524
1488
  });
1525
1489
  if (!e) return null;
1526
- let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ H(N, {
1490
+ let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ z(re, {
1527
1491
  size: f.SM,
1528
1492
  className: Y.modelSelectorCaret,
1529
1493
  "aria-hidden": !0
1530
1494
  });
1531
- return a ? /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(O, {
1495
+ return a ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(O, {
1532
1496
  tooltip: S,
1533
- children: /* @__PURE__ */ H(v, {
1534
- icon: /* @__PURE__ */ U("div", {
1497
+ children: /* @__PURE__ */ z(v, {
1498
+ icon: /* @__PURE__ */ B("div", {
1535
1499
  className: "flex items-center gap-1",
1536
1500
  children: [b, D]
1537
1501
  }),
@@ -1541,14 +1505,14 @@ var St = {
1541
1505
  },
1542
1506
  className: s(Y.modelSelectorButton, E)
1543
1507
  })
1544
- }), u ? /* @__PURE__ */ H(W, {
1508
+ }), u ? /* @__PURE__ */ z(H, {
1545
1509
  isOpen: _,
1546
1510
  title: r?.ariaLabel ?? "Select model",
1547
1511
  closeLabel: r?.closeLabel ?? "Close",
1548
1512
  onClose: () => y(!1),
1549
1513
  style: l,
1550
1514
  children: u(() => y(!1))
1551
- }) : /* @__PURE__ */ H(Et, {
1515
+ }) : /* @__PURE__ */ z(Dt, {
1552
1516
  isOpen: _,
1553
1517
  title: r?.ariaLabel ?? "Select model",
1554
1518
  closeLabel: r?.closeLabel ?? "Close",
@@ -1561,7 +1525,7 @@ var St = {
1561
1525
  errorLabel: r?.error,
1562
1526
  emptyLabel: r?.empty,
1563
1527
  style: l
1564
- })] }) : u ? /* @__PURE__ */ H(h, {
1528
+ })] }) : u ? /* @__PURE__ */ z(h, {
1565
1529
  placement: "top-end",
1566
1530
  matchReferenceWidth: !1,
1567
1531
  open: d,
@@ -1570,9 +1534,9 @@ var St = {
1570
1534
  outsideClosable: !0,
1571
1535
  renderOverlay: () => u(() => m?.(!1)),
1572
1536
  listClassName: "cp-dropdown-overlay !w-[320px]",
1573
- children: /* @__PURE__ */ H(O, {
1537
+ children: /* @__PURE__ */ z(O, {
1574
1538
  tooltip: S,
1575
- children: /* @__PURE__ */ U("button", {
1539
+ children: /* @__PURE__ */ B("button", {
1576
1540
  type: "button",
1577
1541
  "aria-label": x,
1578
1542
  className: s("flex items-center justify-center gap-1 rounded-md p-2", Y.modelSelectorButton, o || i || c ? E : void 0, (o || c) && Y.modelSelectorButtonDisabled),
@@ -1582,12 +1546,12 @@ var St = {
1582
1546
  children: [b, D]
1583
1547
  })
1584
1548
  })
1585
- }) : /* @__PURE__ */ H("div", {
1549
+ }) : /* @__PURE__ */ z("div", {
1586
1550
  className: s(c && E),
1587
1551
  "aria-disabled": c || void 0,
1588
- children: /* @__PURE__ */ H(O, {
1552
+ children: /* @__PURE__ */ z(O, {
1589
1553
  tooltip: S,
1590
- children: /* @__PURE__ */ H(g, {
1554
+ children: /* @__PURE__ */ z(g, {
1591
1555
  icon: b,
1592
1556
  ariaLabel: x,
1593
1557
  items: C,
@@ -1603,126 +1567,125 @@ var St = {
1603
1567
  })
1604
1568
  })
1605
1569
  });
1606
- }, Ot = 160, kt = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: a = !1, onChange: u, onAttachmentsChange: d, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: y = "Menu", menuCloseLabel: b = "Close", removeLabel: x, retryLabel: S, sendLabel: C, stopLabel: w, micLabel: T = "Record voice message", colors: E, typography: D, className: ee, pendingDropFiles: O = [], onDropFilesConsumed: k, pendingAttachments: A = [], onPendingAttachmentsConsumed: te, pasteTextThreshold: ne = 4e3, deployments: j, selectedDeploymentId: M, onDeploymentChange: N, modelSelectorLabels: re, initialAttachments: oe = [], isStacked: se = !1, hideAddButton: P = !1, hideAttachFile: ce = !1, hideActionBar: le = !1, renderFooterActions: ue, isInputDisabled: F = !1, isModelSelectorDisabled: de = !1, isTranscriptionSupported: L = !1, onUploadAudio: fe, onTranscribeAudio: pe, sendOnEnter: me = Ie.Enter, prefixAttachments: he = [], onRemovePrefixAttachment: ge, chatSettings: ve, autoFocus: ye = !1, messageHistory: be, onDialFileSystemClick: xe, dialFileSystemLabel: Ce, validateAttachment: we, onAttachmentClick: W, modelPickerOverlay: Te, maximumAttachmentsAmount: Oe, onAttachmentsLimitExceeded: ke }) => {
1607
- let Me = c(), [Ne, Pe] = B(!1), Le = Ae(be), Re = R(() => o({
1608
- "--ci-bg": E?.background,
1609
- "--ci-text": E?.text,
1610
- "--ci-border": E?.border,
1611
- "--ci-border-hover": E?.borderHover,
1612
- "--ci-border-focus": E?.borderFocus,
1613
- "--ci-placeholder": E?.placeholder,
1614
- "--ci-shadow": E?.shadow,
1615
- "--ci-shadow-focus": E?.shadowFocus,
1616
- "--ci-send-bg": E?.sendBackground,
1617
- "--ci-send-text": E?.sendText,
1618
- "--ci-stop-color": E?.stopColor
1619
- }), [E]), ze = R(() => xe ? [{
1570
+ }, kt = 160, At = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: a = !1, onChange: u, onAttachmentsChange: d, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: y = "Menu", menuCloseLabel: b = "Close", removeLabel: x, retryLabel: S, sendLabel: C, stopLabel: w, micLabel: T = "Record voice message", stopRecordingLabel: E, discardRecordingLabel: D, timerAriaLabel: O, colors: k, typography: A, className: ee, pendingDropFiles: j = [], onDropFilesConsumed: te, pendingAttachments: ne = [], onPendingAttachmentsConsumed: re, pasteTextThreshold: ie = 4e3, deployments: se, selectedDeploymentId: ce, onDeploymentChange: le, modelSelectorLabels: ue, initialAttachments: de = [], isStacked: fe = !1, hideAddButton: pe = !1, hideAttachFile: me = !1, hideActionBar: he = !1, renderFooterActions: N, isInputDisabled: P = !1, isModelSelectorDisabled: ge = !1, isAudioMessageSupported: _e = !1, sendOnEnter: ve = Re.Enter, prefixAttachments: V = [], onRemovePrefixAttachment: be, chatSettings: xe, autoFocus: Se = !1, messageHistory: Ce, onDialFileSystemClick: Te, dialFileSystemLabel: Ee, validateAttachment: H, onAttachmentClick: De, modelPickerOverlay: Ae, maximumAttachmentsAmount: je, onAttachmentsLimitExceeded: Pe }) => {
1571
+ let Fe = c(), [Ie, ze] = L(!1), Be = Me(Ce), Ve = F(() => o({
1572
+ "--ci-bg": k?.background,
1573
+ "--ci-text": k?.text,
1574
+ "--ci-border": k?.border,
1575
+ "--ci-border-hover": k?.borderHover,
1576
+ "--ci-border-focus": k?.borderFocus,
1577
+ "--ci-placeholder": k?.placeholder,
1578
+ "--ci-shadow": k?.shadow,
1579
+ "--ci-shadow-focus": k?.shadowFocus,
1580
+ "--ci-send-bg": k?.sendBackground,
1581
+ "--ci-send-text": k?.sendText,
1582
+ "--ci-stop-color": k?.stopColor
1583
+ }), [k]), He = F(() => Te ? [{
1620
1584
  key: "dial-fs",
1621
- label: Ce ?? "DIAL file system",
1622
- icon: /* @__PURE__ */ H(ie, {
1585
+ label: Ee ?? "DIAL file system",
1586
+ icon: /* @__PURE__ */ z(ae, {
1623
1587
  size: l,
1624
1588
  "aria-hidden": !0
1625
1589
  }),
1626
- onClick: xe
1627
- }] : [], [xe, Ce]), { message: G, setMessage: K, textareaRef: Be, isMultiLine: Ve } = je({
1590
+ onClick: Te
1591
+ }] : [], [Te, Ee]), { message: U, setMessage: W, textareaRef: Ue, isMultiLine: We } = Ne({
1628
1592
  messageProp: e,
1629
1593
  messageRevision: t
1630
- }), { attachments: q, buildAttachments: He, addAttachments: Ue, resetAttachments: We, handleRemove: J, handleRetry: Ke, handleExpand: qe, hasBlockedAttachments: Je } = Ee({
1631
- initialAttachments: oe,
1594
+ }), { attachments: G, buildAttachments: Ge, addAttachments: K, resetAttachments: q, handleRemove: qe, handleRetry: Je, handleExpand: J, hasBlockedAttachments: Ye } = Oe({
1595
+ initialAttachments: de,
1632
1596
  onUploadAttachment: r,
1633
1597
  onAttachmentsChange: d,
1634
- validateAttachment: we,
1635
- pendingDropFiles: O,
1636
- onDropFilesConsumed: k,
1637
- pendingAttachments: A,
1638
- onPendingAttachmentsConsumed: te,
1639
- onExpandPastedText: I((e) => {
1640
- K((t) => t ? `${t}\n${e}` : e);
1641
- }, [K]),
1642
- maximumAttachmentsAmount: Oe,
1643
- baseAttachmentsAmount: he.length,
1644
- onAttachmentsLimitExceeded: ke
1645
- }), { state: Qe, waveformData: $e, errorMessage: et, startRecording: tt, stopRecording: nt, confirmRecording: rt, discardRecording: it } = Fe({
1646
- onUploadAudio: fe,
1647
- onTranscribeAudio: pe,
1648
- onTranscript: I((e) => {
1649
- K(e), u?.(e);
1650
- }, [u, K])
1651
- }), X = z(null), at = z(null), { handlePaste: ot } = Se(Ue, ne), st = G.trim().length > 0 || q.length > 0, Z = st && !Je, { shouldRender: ct, isExiting: lt, instanceKey: Q } = De(!a && st, Ot), $ = se || q.length > 0 || G.includes("\n") || Ve, ut = j === void 0 || M != null, dt = async () => {
1652
- let e = G, t = q;
1653
- K(""), Le.reset();
1598
+ validateAttachment: H,
1599
+ pendingDropFiles: j,
1600
+ onDropFilesConsumed: te,
1601
+ pendingAttachments: ne,
1602
+ onPendingAttachmentsConsumed: re,
1603
+ onExpandPastedText: M((e) => {
1604
+ W((t) => t ? `${t}\n${e}` : e);
1605
+ }, [W]),
1606
+ maximumAttachmentsAmount: je,
1607
+ baseAttachmentsAmount: V.length,
1608
+ onAttachmentsLimitExceeded: Pe
1609
+ }), { state: $e, analyserNodeRef: et, elapsedSeconds: tt, errorMessage: nt, startRecording: rt, stopRecording: it, discardRecording: at } = Le({ onAttachAudio: M((e) => {
1610
+ K(Ge([e]));
1611
+ }, [K, Ge]) }), X = I(null), ot = I(null), { handlePaste: st } = we(K, ie), ct = U.trim().length > 0 || G.length > 0, Z = ct && !Ye, { shouldRender: lt, isExiting: ut, instanceKey: Q } = ke(!a && ct, kt), $ = fe || G.length > 0 || U.includes("\n") || We, dt = se === void 0 || ce != null, ft = async () => {
1612
+ let e = U, t = G;
1613
+ W(""), Be.reset();
1654
1614
  try {
1655
1615
  await n?.(e, t), t.forEach((e) => {
1656
1616
  e.previewUrl && URL.revokeObjectURL(e.previewUrl);
1657
- }), We([]);
1617
+ }), q([]);
1658
1618
  } catch {
1659
- K(e), We(t);
1619
+ W(e), q(t);
1660
1620
  }
1661
- }, ft = (e) => {
1662
- if (!e.nativeEvent.isComposing && !F && !a && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1663
- let t = e.currentTarget.selectionStart ?? 0, n = Le.navigate(e.key === "ArrowUp" ? "up" : "down", G, t);
1621
+ }, pt = (e) => {
1622
+ if (!e.nativeEvent.isComposing && !P && !a && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1623
+ let t = e.currentTarget.selectionStart ?? 0, n = Be.navigate(e.key === "ArrowUp" ? "up" : "down", U, t);
1664
1624
  if (n !== null) {
1665
- e.preventDefault(), K(n);
1625
+ e.preventDefault(), W(n);
1666
1626
  return;
1667
1627
  }
1668
1628
  }
1669
- e.key === "Enter" && (me === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !a && Z && ut && !F && dt());
1670
- }, pt = (e) => {
1629
+ e.key === "Enter" && (ve === Re.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !a && Z && dt && !P && ft());
1630
+ }, mt = (e) => {
1671
1631
  let t = Array.from(e.target.files ?? []);
1672
1632
  if (t.length === 0) return;
1673
- let n = He(t);
1674
- e.target.value = "", Ue(n);
1633
+ let n = Ge(t);
1634
+ e.target.value = "", K(n);
1675
1635
  };
1676
- if (Qe !== "idle") return /* @__PURE__ */ H(Ye, {
1677
- state: Qe,
1678
- waveformData: $e,
1679
- errorMessage: et,
1680
- onStop: nt,
1681
- onConfirm: rt,
1682
- onDiscard: it,
1683
- style: Re,
1636
+ if ($e !== "idle") return /* @__PURE__ */ z(Xe, {
1637
+ state: $e,
1638
+ analyserNodeRef: et,
1639
+ elapsedSeconds: tt,
1640
+ errorMessage: nt,
1641
+ onStop: it,
1642
+ onDiscard: at,
1643
+ stopLabel: E,
1644
+ discardLabel: D,
1645
+ timerLabel: O,
1646
+ style: Ve,
1684
1647
  className: ee
1685
1648
  });
1686
- let mt = /* @__PURE__ */ H("textarea", {
1687
- className: s(Y.textarea, D?.fontClassName, "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
1688
- ref: Be,
1689
- autoFocus: ye,
1690
- value: G,
1649
+ let ht = /* @__PURE__ */ z("textarea", {
1650
+ className: s(Y.textarea, A?.fontClassName, "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
1651
+ ref: Ue,
1652
+ autoFocus: Se,
1653
+ value: U,
1691
1654
  onChange: (e) => {
1692
- K(e.target.value), Le.notifyChange(), u?.(e.target.value);
1655
+ W(e.target.value), Be.notifyChange(), u?.(e.target.value);
1693
1656
  },
1694
- onKeyDown: ft,
1695
- onPaste: ot,
1657
+ onKeyDown: pt,
1658
+ onPaste: st,
1696
1659
  placeholder: p,
1697
1660
  "aria-label": m,
1698
- disabled: F,
1661
+ disabled: P,
1699
1662
  rows: 1
1700
1663
  });
1701
- return /* @__PURE__ */ U("div", {
1702
- ref: at,
1703
- style: Re,
1704
- className: s(Y.wrapper, F && Y.wrapperDisabled, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", q.length > 6 ? "py-3 ps-3" : "p-3", ee),
1705
- children: [(he.length > 0 || q.length > 0) && /* @__PURE__ */ H(_e, {
1706
- attachments: [...he, ...q],
1664
+ return /* @__PURE__ */ B("div", {
1665
+ ref: ot,
1666
+ style: Ve,
1667
+ className: s(Y.wrapper, P && Y.wrapperDisabled, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", G.length > 6 ? "py-3 ps-3" : "p-3", ee),
1668
+ children: [(V.length > 0 || G.length > 0) && /* @__PURE__ */ z(ye, {
1669
+ attachments: [...V, ...G],
1707
1670
  onRemove: (e) => {
1708
- he.some((t) => t.id === e) ? ge?.(e) : J(e);
1671
+ V.some((t) => t.id === e) ? be?.(e) : qe(e);
1709
1672
  },
1710
- onRetry: Ke,
1711
- onExpand: qe,
1673
+ onRetry: Je,
1674
+ onExpand: J,
1712
1675
  labels: {
1713
1676
  removeLabel: x,
1714
1677
  retryLabel: S
1715
1678
  },
1716
- onAttachmentClick: W == null ? void 0 : (e) => {
1717
- let t = q.find((t) => t.id === e);
1718
- t != null && W(t);
1679
+ onAttachmentClick: De == null ? void 0 : (e) => {
1680
+ let t = [...V, ...G].find((t) => t.id === e);
1681
+ t != null && De(t);
1719
1682
  }
1720
- }), le ? $ && mt : /* @__PURE__ */ U("div", {
1683
+ }), he ? $ && ht : /* @__PURE__ */ B("div", {
1721
1684
  className: s("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
1722
1685
  children: [
1723
- !P && /* @__PURE__ */ U("div", {
1686
+ !pe && /* @__PURE__ */ B("div", {
1724
1687
  className: s("order-2 flex", !$ && "desktop:order-1"),
1725
- children: [/* @__PURE__ */ H("input", {
1688
+ children: [/* @__PURE__ */ z("input", {
1726
1689
  ref: X,
1727
1690
  type: "file",
1728
1691
  multiple: !0,
@@ -1730,78 +1693,78 @@ var St = {
1730
1693
  className: "sr-only",
1731
1694
  "aria-hidden": !0,
1732
1695
  tabIndex: -1,
1733
- onChange: pt
1734
- }), /* @__PURE__ */ H(Ge, {
1735
- onAttachClick: ce ? void 0 : () => X.current?.click(),
1696
+ onChange: mt
1697
+ }), /* @__PURE__ */ z(Ke, {
1698
+ onAttachClick: me ? void 0 : () => X.current?.click(),
1736
1699
  attachLabel: h,
1737
1700
  addMenuTitle: _,
1738
1701
  menuTitle: y,
1739
1702
  menuCloseLabel: b,
1740
- style: Re,
1741
- isDisabled: F,
1742
- chatSettings: ve,
1743
- extraMenuItems: ze
1703
+ style: Ve,
1704
+ isDisabled: P,
1705
+ chatSettings: xe,
1706
+ extraMenuItems: He
1744
1707
  })]
1745
1708
  }),
1746
- /* @__PURE__ */ H("div", {
1709
+ /* @__PURE__ */ z("div", {
1747
1710
  className: s("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
1748
- children: mt
1711
+ children: ht
1749
1712
  }),
1750
- /* @__PURE__ */ U("div", {
1713
+ /* @__PURE__ */ B("div", {
1751
1714
  className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto", !$ && "desktop:ms-0"),
1752
- children: [ue ? ue({
1715
+ children: [N ? N({
1753
1716
  canSend: Z,
1754
- onSend: dt
1755
- }) : /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(Dt, {
1756
- deployments: j,
1757
- selectedDeploymentId: M,
1758
- onDeploymentChange: N,
1759
- modelSelectorLabels: re,
1717
+ onSend: ft
1718
+ }) : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Ot, {
1719
+ deployments: se,
1720
+ selectedDeploymentId: ce,
1721
+ onDeploymentChange: le,
1722
+ modelSelectorLabels: ue,
1760
1723
  isStreaming: a,
1761
- isMobile: Me,
1762
- isInputDisabled: F,
1763
- isDisabled: de,
1764
- style: Re,
1765
- modelPickerOverlay: Te,
1766
- isPickerOpen: Ne,
1767
- onPickerToggle: () => Pe((e) => !e),
1768
- onPickerOpenChange: Pe
1769
- }), a && i ? /* @__PURE__ */ H(Ze, {
1724
+ isMobile: Fe,
1725
+ isInputDisabled: P,
1726
+ isDisabled: ge,
1727
+ style: Ve,
1728
+ modelPickerOverlay: Ae,
1729
+ isPickerOpen: Ie,
1730
+ onPickerToggle: () => ze((e) => !e),
1731
+ onPickerOpenChange: ze
1732
+ }), a && i ? /* @__PURE__ */ z(Qe, {
1770
1733
  onStop: i,
1771
1734
  ariaLabel: w
1772
- }) : !a && ct && /* @__PURE__ */ H(Xe, {
1773
- onSend: dt,
1774
- isDisabled: !ut || Je,
1735
+ }) : !a && lt && /* @__PURE__ */ z(Ze, {
1736
+ onSend: ft,
1737
+ isDisabled: !dt || Ye,
1775
1738
  ariaLabel: C,
1776
- isExiting: lt
1777
- }, Q)] }), L && !G.trim() && !lt && /* @__PURE__ */ H(v, {
1778
- icon: /* @__PURE__ */ H(ae, {
1739
+ isExiting: ut
1740
+ }, Q)] }), _e && !ut && /* @__PURE__ */ z(v, {
1741
+ icon: /* @__PURE__ */ z(oe, {
1779
1742
  size: f.LG,
1780
1743
  "aria-hidden": !0
1781
1744
  }),
1782
1745
  "aria-label": T,
1783
1746
  className: "size-8 flex-shrink-0",
1784
- onClick: tt,
1785
- disabled: F || a
1747
+ onClick: rt,
1748
+ disabled: P || a
1786
1749
  })]
1787
1750
  })
1788
1751
  ]
1789
1752
  })]
1790
1753
  });
1791
- }, At = { welcome: "_welcome_n2ph8_1" }, jt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, isInputDisabled: a = !1, ...c }) => {
1754
+ }, jt = { welcome: "_welcome_n2ph8_1" }, Mt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, isInputDisabled: a = !1, ...c }) => {
1792
1755
  let { colors: l, typography: u } = r ?? {};
1793
- return /* @__PURE__ */ U("div", {
1756
+ return /* @__PURE__ */ B("div", {
1794
1757
  style: o({
1795
1758
  "--ci-root-bg": l?.background,
1796
1759
  "--ci-welcome-color": l?.welcomeText
1797
1760
  }),
1798
1761
  className: s("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
1799
- children: [n && /* @__PURE__ */ H("h1", {
1800
- className: s(At.welcome, "m-0 text-center", u?.welcomeClassName),
1762
+ children: [n && /* @__PURE__ */ z("h1", {
1763
+ className: s(jt.welcome, "m-0 text-center", u?.welcomeClassName),
1801
1764
  children: n
1802
- }), /* @__PURE__ */ H("div", {
1765
+ }), /* @__PURE__ */ z("div", {
1803
1766
  className: "relative w-full max-w-[748px]",
1804
- children: /* @__PURE__ */ H(kt, {
1767
+ children: /* @__PURE__ */ z(At, {
1805
1768
  placeholder: t,
1806
1769
  isStreaming: e,
1807
1770
  isInputDisabled: a,
@@ -1811,86 +1774,87 @@ var St = {
1811
1774
  })
1812
1775
  })]
1813
1776
  });
1814
- }, Mt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, hideAttachFile: x = !1, fileAccept: S, maximumAttachmentsAmount: C, onAttachmentsLimitExceeded: w, onDialFileSystemClick: T, dialFileSystemLabel: E, pendingAttachments: D, onPendingAttachmentsConsumed: ee }) => {
1815
- let O = z(null), [k, A] = B([]);
1816
- L(() => {
1817
- v?.length && (A(v), y?.());
1777
+ }, Nt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, hideAttachFile: x = !1, fileAccept: S, maximumAttachmentsAmount: C, onAttachmentsLimitExceeded: w, onDialFileSystemClick: T, dialFileSystemLabel: E, pendingAttachments: D, onPendingAttachmentsConsumed: O, onAttachmentClick: k }) => {
1778
+ let A = I(null), [ee, j] = L([]);
1779
+ N(() => {
1780
+ v?.length && (j(v), y?.());
1818
1781
  }, [v, y]);
1819
- let [te, ne] = B(e ?? ""), [j, M] = B([]), [N, re] = B(t), ae = j.some((e) => e.status === i.Loading || e.status === i.Error), oe = (te.trim().length > 0 || j.length > 0 || N.length > 0) && !ae, se = (e) => {
1820
- re((t) => t.filter((t) => t.id !== e));
1821
- }, P = I((e, t) => {
1822
- r(e, N, t);
1823
- }, [N, r]), ce = () => {
1824
- oe && P(te, j);
1825
- }, le = I(() => A([]), []), ue = I((e) => {
1782
+ let [te, ne] = L(e ?? ""), [re, ie] = L([]), [oe, se] = L(t), ce = re.some((e) => e.status === i.Loading || e.status === i.Error), le = (te.trim().length > 0 || re.length > 0 || oe.length > 0) && !ce, ue = (e) => {
1783
+ se((t) => t.filter((t) => t.id !== e));
1784
+ }, de = M((e, t) => {
1785
+ r(e, oe, t);
1786
+ }, [oe, r]), fe = () => {
1787
+ le && de(te, re);
1788
+ }, pe = M(() => j([]), []), me = M((e) => {
1826
1789
  let t = Array.from(e.target.files ?? []);
1827
- t.length !== 0 && (e.target.value = "", A(t));
1828
- }, []), F = R(() => T ? [{
1790
+ t.length !== 0 && (e.target.value = "", j(t));
1791
+ }, []), he = F(() => T ? [{
1829
1792
  key: "dial-fs",
1830
1793
  label: E ?? "DIAL file system",
1831
- icon: /* @__PURE__ */ H(ie, {
1794
+ icon: /* @__PURE__ */ z(ae, {
1832
1795
  size: l,
1833
1796
  "aria-hidden": !0
1834
1797
  }),
1835
1798
  onClick: T
1836
1799
  }] : [], [T, E]);
1837
- return /* @__PURE__ */ U("div", {
1800
+ return /* @__PURE__ */ B("div", {
1838
1801
  className: s("flex w-full flex-col gap-2", _),
1839
- children: [/* @__PURE__ */ H(kt, {
1802
+ children: [/* @__PURE__ */ z(At, {
1840
1803
  message: e,
1841
1804
  ariaLabel: u,
1842
1805
  isStacked: !0,
1843
1806
  hideActionBar: !0,
1844
- pendingDropFiles: k,
1845
- onDropFilesConsumed: le,
1846
- onSend: P,
1807
+ pendingDropFiles: ee,
1808
+ onDropFilesConsumed: pe,
1809
+ onSend: de,
1847
1810
  onUploadAttachment: a,
1848
1811
  onChange: ne,
1849
- onAttachmentsChange: M,
1812
+ onAttachmentsChange: ie,
1850
1813
  removeLabel: d,
1851
1814
  retryLabel: f,
1852
1815
  className: "max-w-full",
1853
- prefixAttachments: N,
1854
- onRemovePrefixAttachment: se,
1816
+ prefixAttachments: oe,
1817
+ onRemovePrefixAttachment: ue,
1855
1818
  validateAttachment: b,
1856
1819
  maximumAttachmentsAmount: C,
1857
1820
  onAttachmentsLimitExceeded: w,
1858
1821
  pendingAttachments: D,
1859
- onPendingAttachmentsConsumed: ee
1860
- }), /* @__PURE__ */ U("div", {
1822
+ onPendingAttachmentsConsumed: O,
1823
+ onAttachmentClick: k
1824
+ }), /* @__PURE__ */ B("div", {
1861
1825
  className: "flex items-center justify-between",
1862
- children: [/* @__PURE__ */ H("div", {
1826
+ children: [/* @__PURE__ */ z("div", {
1863
1827
  className: "flex",
1864
- children: !x && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("input", {
1865
- ref: O,
1828
+ children: !x && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("input", {
1829
+ ref: A,
1866
1830
  type: "file",
1867
1831
  multiple: !0,
1868
1832
  accept: S,
1869
1833
  className: "sr-only",
1870
1834
  "aria-hidden": !0,
1871
1835
  tabIndex: -1,
1872
- onChange: ue
1873
- }), /* @__PURE__ */ H(Ge, {
1874
- onAttachClick: () => O.current?.click(),
1836
+ onChange: me
1837
+ }), /* @__PURE__ */ z(Ke, {
1838
+ onAttachClick: () => A.current?.click(),
1875
1839
  attachLabel: m,
1876
1840
  addMenuTitle: p,
1877
1841
  menuTitle: h,
1878
1842
  menuCloseLabel: g,
1879
- extraMenuItems: F
1843
+ extraMenuItems: he
1880
1844
  })] })
1881
- }), /* @__PURE__ */ U("div", {
1845
+ }), /* @__PURE__ */ B("div", {
1882
1846
  className: "flex gap-2",
1883
- children: [/* @__PURE__ */ H(Be, {
1847
+ children: [/* @__PURE__ */ z(W, {
1884
1848
  label: o,
1885
1849
  onClick: n
1886
- }), /* @__PURE__ */ H(K, {
1850
+ }), /* @__PURE__ */ z(U, {
1887
1851
  label: c,
1888
- onClick: ce,
1889
- disabled: !oe
1852
+ onClick: fe,
1853
+ disabled: !le
1890
1854
  })]
1891
1855
  })]
1892
1856
  })]
1893
1857
  });
1894
1858
  };
1895
1859
  //#endregion
1896
- export { me as AttachmentCard, he as AttachmentGroup, ge as AttachmentTray, W as BottomSheetShell, We as ChatSettingsModal, jt as ConversationInput, Mt as EditMessageInput, ve as FileDndOverlay, kt as Input, Ie as SendOnEnter, xe as getAttachmentIcon };
1860
+ export { _e as AttachmentCard, ve as AttachmentGroup, V as AttachmentTray, H as BottomSheetShell, K as ChatSettingsModal, Mt as ConversationInput, Nt as EditMessageInput, be as FileDndOverlay, At as Input, Re as SendOnEnter, Ce as getAttachmentIcon };