@epam/ai-dial-conversation-input 1.3.0-dev.235 → 1.3.0-dev.244

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,11 +1,11 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, MIME_TYPE_EXT_MAP as r, RESIZABLE_TEXTAREA_CLASS_NAME as i, RequestStatus as a, ResponseFormat as o, SELECT_LIST_MAX_HEIGHT_PX as s, buildCssVars as c, mergeClasses as l, normalizeMimeType as u, useIsMobile as d } from "@epam/ai-dial-chat-shared";
2
- import { BASE_ICON_SIZE as f, BottomSheet as p, Button as m, ButtonVariant as h, CloseButton as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Dropdown as y, ElementSize as b, ErrorText as x, GhostIconButton as S, Highlight as C, MenuItemMark as w, NeutralButton as T, NeutralIconButton as E, Popup as D, PopupSize as ee, PrimaryButton as O, PrimaryIconButton as k, RadioGroup as te, RadioGroupOrientation as A, Search as j, Skeleton as ne, SkeletonVariant as re, Slider as ie, Spinner as ae, Textarea as oe, TextareaResize as M, Tooltip as se } from "@epam/ai-dial-ui-kit";
3
- import { Fragment as N, jsx as P, jsxs as F } from "react/jsx-runtime";
4
- import { AttachmentTray as I, MAX_UPLOADS_PER_MINUTE as ce, generateAttachmentId as le, useClipboardPaste as ue } from "@epam/ai-dial-attachment-input";
5
- import { IconAlertCircleFilled as de, IconAlertTriangleFilled as fe, IconArrowNarrowRight as pe, IconCheck as me, IconChevronDown as he, IconChevronRight as ge, IconFile as _e, IconMicrophone as ve, IconPaperclip as L, IconPlayerStop as ye, IconPlus as be, IconSettings as xe, IconTool as Se, IconX as Ce } from "@tabler/icons-react";
6
- import { createElement as we, forwardRef as Te, memo as Ee, useCallback as R, useEffect as z, useId as De, useImperativeHandle as Oe, useLayoutEffect as ke, useMemo as B, useRef as V, useState as H } from "react";
2
+ import { BASE_ICON_SIZE as f, BottomSheet as p, Button as m, ButtonVariant as h, CloseButton as g, DIAL_ICON_SIZE as _, DIAL_KIT_ICON_STROKE as v, Dropdown as y, ElementSize as b, ErrorText as x, GhostIconButton as S, Highlight as C, MenuItemMark as w, NeutralButton as T, NeutralIconButton as E, Notification as D, NotificationType as O, NotificationVariant as k, Popup as A, PopupSize as j, PrimaryButton as M, PrimaryIconButton as N, RadioGroup as ee, RadioGroupOrientation as te, Search as ne, Skeleton as re, SkeletonVariant as ie, Slider as P, Spinner as ae, Textarea as F, TextareaResize as oe, Tooltip as se } from "@epam/ai-dial-ui-kit";
3
+ import { Fragment as ce, jsx as I, jsxs as L } from "react/jsx-runtime";
4
+ import { AttachmentTray as le, MAX_UPLOADS_PER_MINUTE as ue, generateAttachmentId as de, useClipboardPaste as fe } from "@epam/ai-dial-attachment-input";
5
+ import { IconArrowNarrowRight as pe, IconCheck as me, IconChevronDown as he, IconChevronRight as R, IconFile as ge, IconMicrophone as _e, IconPaperclip as ve, IconPlayerStop as ye, IconPlus as be, IconSettings as xe, IconTool as Se, IconX as Ce } from "@tabler/icons-react";
6
+ import { createElement as we, forwardRef as Te, memo as Ee, useCallback as z, useEffect as B, useId as De, useImperativeHandle as Oe, useLayoutEffect as ke, useMemo as V, useRef as H, useState as U } from "react";
7
7
  //#region src/constants/public-class-names.ts
8
- var U = {
8
+ var W = {
9
9
  wrapper: "dial-ci-wrapper",
10
10
  actionRow: "dial-ci-action-row",
11
11
  textareaWrap: "dial-ci-textarea-wrap",
@@ -25,14 +25,14 @@ var U = {
25
25
  sheet: "_sheet_1ym62_12",
26
26
  title: "_title_1ym62_16",
27
27
  divider: "_divider_1ym62_20"
28
- }, W = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId: m, overlayClassName: h, overlayStyle: g, children: _ }) => {
28
+ }, G = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: u = "dial-body-semi-text", className: d, colors: f, portalId: m, overlayClassName: h, overlayStyle: g, children: _ }) => {
29
29
  let v = c({
30
30
  "--ci-backdrop": f?.backdrop,
31
31
  "--ci-sheet-bg": f?.sheetBg,
32
32
  "--ci-sheet-text": f?.sheetText,
33
33
  "--ci-sheet-divider": f?.divider
34
34
  });
35
- return /* @__PURE__ */ P(p, {
35
+ return /* @__PURE__ */ I(p, {
36
36
  open: e,
37
37
  onClose: r,
38
38
  title: t,
@@ -55,23 +55,23 @@ var U = {
55
55
  titleClassName: l(Ae.title, u),
56
56
  children: _
57
57
  });
58
- }, G = async (e, t, n) => {
58
+ }, je = async (e, t, n) => {
59
59
  let r = 6e4 / t, i = [];
60
60
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
61
61
  await Promise.allSettled(i);
62
- }, je = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, isDropDisabled: l = !1, pendingAttachments: u, onPendingAttachmentsConsumed: d, onExpandPastedText: f, maximumAttachmentsAmount: p, baseAttachmentsAmount: m = 0, onAttachmentsLimitExceeded: h }) => {
63
- let [g, _] = H(n), v = V(g);
64
- z(() => {
62
+ }, Me = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, isDropDisabled: l = !1, pendingAttachments: u, onPendingAttachmentsConsumed: d, onExpandPastedText: f, maximumAttachmentsAmount: p, baseAttachmentsAmount: m = 0, onAttachmentsLimitExceeded: h }) => {
63
+ let [g, _] = U(n), v = H(g);
64
+ B(() => {
65
65
  v.current = g;
66
- }, [g]), z(() => () => {
66
+ }, [g]), B(() => () => {
67
67
  v.current.forEach((e) => {
68
68
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
69
69
  });
70
70
  }, []);
71
- let y = R((e) => e.map((e) => {
71
+ let y = z((e) => e.map((e) => {
72
72
  let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), i = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
73
73
  return {
74
- id: le(),
74
+ id: de(),
75
75
  name: e.name,
76
76
  contentType: e.type,
77
77
  file: e,
@@ -80,22 +80,22 @@ var U = {
80
80
  previewUrl: i,
81
81
  playUrl: o
82
82
  };
83
- }), []), b = V(i);
84
- z(() => {
83
+ }), []), b = H(i);
84
+ B(() => {
85
85
  b.current = i;
86
86
  }, [i]);
87
- let x = V(!0), S = R((e) => {
87
+ let x = H(!0), S = z((e) => {
88
88
  _((t) => {
89
89
  let n = e(t);
90
90
  return n === t ? t : n;
91
91
  });
92
92
  }, []);
93
- z(() => {
93
+ B(() => {
94
94
  x.current ? x.current = !1 : b.current?.(g);
95
95
  }, [g]);
96
- let C = R((e) => {
96
+ let C = z((e) => {
97
97
  _(e);
98
- }, []), w = R(async (t) => {
98
+ }, []), w = z(async (t) => {
99
99
  if (r) {
100
100
  S((e) => e.map((e) => e.id === t.id ? {
101
101
  ...e,
@@ -118,7 +118,7 @@ var U = {
118
118
  } : e));
119
119
  }
120
120
  }
121
- }, [r, S]), T = R((e, t = !0) => {
121
+ }, [r, S]), T = z((e, t = !0) => {
122
122
  let n = new Set(v.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
123
123
  if (r.length !== 0) {
124
124
  if (p != null && p > 0 && Number.isFinite(p)) {
@@ -139,7 +139,7 @@ var U = {
139
139
  status: a.Error,
140
140
  errorReason: n
141
141
  } : e));
142
- }), G(e, ce, w);
142
+ }), je(e, ue, w);
143
143
  }
144
144
  }
145
145
  }, [
@@ -149,8 +149,8 @@ var U = {
149
149
  S,
150
150
  w,
151
151
  o
152
- ]), E = V(/* @__PURE__ */ new WeakSet());
153
- z(() => {
152
+ ]), E = H(/* @__PURE__ */ new WeakSet());
153
+ B(() => {
154
154
  if (s.length === 0) {
155
155
  E.current = /* @__PURE__ */ new WeakSet();
156
156
  return;
@@ -163,13 +163,13 @@ var U = {
163
163
  l,
164
164
  c,
165
165
  s
166
- ]), z(() => {
166
+ ]), B(() => {
167
167
  u.length !== 0 && (T(u, !1), d?.());
168
168
  }, [
169
169
  T,
170
170
  d,
171
171
  u
172
- ]), z(() => {
172
+ ]), B(() => {
173
173
  if (!o) return;
174
174
  let t = !1, n = [], r = v.current.map((r) => {
175
175
  if (r.status === a.Loading) return r;
@@ -196,7 +196,7 @@ var U = {
196
196
  S,
197
197
  w
198
198
  ]);
199
- let D = R((e) => {
199
+ let D = z((e) => {
200
200
  S((t) => {
201
201
  let n = t.find((t) => t.id === e);
202
202
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -208,11 +208,11 @@ var U = {
208
208
  addAttachments: T,
209
209
  resetAttachments: C,
210
210
  handleRemove: D,
211
- handleRetry: R((e) => {
211
+ handleRetry: z((e) => {
212
212
  let t = g.find((t) => t.id === e);
213
213
  t && w(t);
214
214
  }, [g, w]),
215
- handleExpand: R(async (e) => {
215
+ handleExpand: z(async (e) => {
216
216
  let n = g.find((t) => t.id === e);
217
217
  if (!n || n.type !== t.Pasted) return;
218
218
  let r = await n.file.text();
@@ -224,31 +224,31 @@ var U = {
224
224
  ]),
225
225
  hasBlockedAttachments: g.some((e) => e.status === a.Loading || e.status === a.Error)
226
226
  };
227
- }, Me = (e, t) => {
227
+ }, Ne = (e, t) => {
228
228
  let n = t;
229
229
  for (; n < e.length && !/\s/.test(e[n]);) n++;
230
230
  return n;
231
- }, Ne = (e, t) => {
231
+ }, Pe = (e, t) => {
232
232
  let n = t;
233
233
  for (; n > 0 && !/\s/.test(e[n - 1]);) n--;
234
234
  return {
235
235
  start: n,
236
- end: Me(e, n)
236
+ end: Ne(e, n)
237
237
  };
238
- }, Pe = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Fe = "[role=\"option\"]:not([aria-disabled=\"true\"])", Ie = /* @__PURE__ */ function(e) {
238
+ }, Fe = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Ie = "[role=\"option\"]:not([aria-disabled=\"true\"])", Le = /* @__PURE__ */ function(e) {
239
239
  return e.Next = "next", e.Previous = "previous", e;
240
- }({}), Le = ({ config: e, message: t }) => {
241
- let [n, r] = H(!1), [i, a] = H(null), [o, s] = H(null), c = V(null);
240
+ }({}), Re = ({ config: e, message: t }) => {
241
+ let [n, r] = U(!1), [i, a] = U(null), [o, s] = U(null), c = H(null);
242
242
  c.current = i;
243
243
  let l = e != null && i != null && i <= t.length ? (() => {
244
- let n = t.slice(i, Me(t, i));
245
- return Pe(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
246
- })() : "", u = R((t, n, i) => {
244
+ let n = t.slice(i, Ne(t, i));
245
+ return Fe(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
246
+ })() : "", u = z((t, n, i) => {
247
247
  if (e == null || i) return;
248
- let { start: c, end: l } = Ne(t, n), u = t.slice(c, l);
249
- Pe(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
248
+ let { start: c, end: l } = Pe(t, n), u = t.slice(c, l);
249
+ Fe(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
250
250
  }, [e, o]);
251
- z(() => {
251
+ B(() => {
252
252
  if (e == null) {
253
253
  r(!1), s(null), a(null);
254
254
  return;
@@ -256,25 +256,25 @@ var U = {
256
256
  let n = c.current;
257
257
  if (n == null) return;
258
258
  let i = Math.min(n, t.length);
259
- Pe(t.slice(i, Me(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
259
+ Fe(t.slice(i, Ne(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
260
260
  }, [e, t]);
261
- let d = R(() => {
261
+ let d = z(() => {
262
262
  r(!1), s(i);
263
- }, [i]), f = R(() => {
263
+ }, [i]), f = z(() => {
264
264
  r(!1);
265
- }, []), p = R((n) => {
265
+ }, []), p = z((n) => {
266
266
  if (e == null) return;
267
- let { start: i, end: s } = Ne(t, n);
268
- Pe(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
267
+ let { start: i, end: s } = Pe(t, n);
268
+ Fe(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
269
269
  }, [
270
270
  e,
271
271
  t,
272
272
  o
273
- ]), m = De(), h = V(null), [g, _] = H(null);
274
- z(() => {
273
+ ]), m = De(), h = H(null), [g, _] = U(null);
274
+ B(() => {
275
275
  _(null);
276
276
  }, [n, l]);
277
- let v = R(() => Array.from(h.current?.querySelectorAll(Fe) ?? []), []), y = R((e) => {
277
+ let v = z(() => Array.from(h.current?.querySelectorAll(Ie) ?? []), []), y = z((e) => {
278
278
  let t = v();
279
279
  if (t.length === 0) {
280
280
  _(null);
@@ -282,7 +282,7 @@ var U = {
282
282
  }
283
283
  let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
284
284
  _(r.id), r.scrollIntoView?.({ block: "nearest" });
285
- }, [v, g]), b = R(() => v().find((e) => e.id === g) ?? null, [v, g]);
285
+ }, [v, g]), b = z(() => v().find((e) => e.id === g) ?? null, [v, g]);
286
286
  return {
287
287
  isMenuOpen: n,
288
288
  query: l,
@@ -297,18 +297,18 @@ var U = {
297
297
  moveActiveOption: y,
298
298
  getActiveOption: b
299
299
  };
300
- }, Re = (e, t) => !e.slice(0, t).includes("\n"), ze = (e, t) => !e.slice(t).includes("\n"), Be = (e) => {
301
- let t = V(e);
300
+ }, ze = (e, t) => !e.slice(0, t).includes("\n"), Be = (e, t) => !e.slice(t).includes("\n"), Ve = (e) => {
301
+ let t = H(e);
302
302
  t.current = e;
303
- let n = V(-1), r = V(""), i = R((e, i, a) => {
303
+ let n = H(-1), r = H(""), i = z((e, i, a) => {
304
304
  let o = t.current;
305
- return !o || o.length === 0 ? null : e === "up" ? !Re(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 || !ze(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
306
- }, []), a = R(() => {
305
+ return !o || o.length === 0 ? null : e === "up" ? !ze(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 || !Be(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
306
+ }, []), a = z(() => {
307
307
  n.current = -1, r.current = "";
308
- }, []), o = R(() => {
308
+ }, []), o = z(() => {
309
309
  n.current = -1, r.current = "";
310
310
  }, []);
311
- return B(() => ({
311
+ return V(() => ({
312
312
  navigate: i,
313
313
  notifyChange: a,
314
314
  reset: o
@@ -317,16 +317,16 @@ var U = {
317
317
  a,
318
318
  o
319
319
  ]);
320
- }, Ve = (e, t, n, r, i) => {
320
+ }, He = (e, t, n, r, i) => {
321
321
  let a = [...t].sort((e, t) => e.start - t.start), o = [...n].sort((e, t) => e.offset - t.offset), s = [], c = 0, l = 0, u = (t, n) => {
322
322
  if (n <= t) return;
323
323
  let r = t;
324
324
  o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
325
- t.offset > r && s.push(/* @__PURE__ */ P("span", {
325
+ t.offset > r && s.push(/* @__PURE__ */ I("span", {
326
326
  "aria-hidden": !0,
327
327
  children: e.slice(r, t.offset)
328
328
  }, `text-${l++}`)), s.push(t.node), r = t.offset;
329
- }), r < n && s.push(/* @__PURE__ */ P("span", {
329
+ }), r < n && s.push(/* @__PURE__ */ I("span", {
330
330
  "aria-hidden": !0,
331
331
  children: e.slice(r, n)
332
332
  }, `text-${l++}`));
@@ -334,16 +334,16 @@ var U = {
334
334
  return a.forEach((t, n) => {
335
335
  if (u(c, t.start), t.start + t.length <= c) return;
336
336
  let a = e.slice(t.start, t.start + t.length);
337
- s.push(t.render ? /* @__PURE__ */ P("span", {
337
+ s.push(t.render ? /* @__PURE__ */ I("span", {
338
338
  className: "pointer-events-auto",
339
339
  children: t.render()
340
- }, `range-${n}`) : /* @__PURE__ */ P("span", {
340
+ }, `range-${n}`) : /* @__PURE__ */ I("span", {
341
341
  "aria-hidden": !0,
342
342
  className: t.isUnsupported ? i : r,
343
343
  children: a
344
344
  }, `range-${n}`)), c = Math.max(c, t.start + t.length);
345
345
  }), u(c, e.length), s;
346
- }, He = (e, t) => {
346
+ }, Ue = (e, t) => {
347
347
  let n = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode: (e) => e.parentElement?.closest("[data-mirror-synthetic]") == null ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT }), r = 0;
348
348
  for (let e = n.nextNode(); e != null; e = n.nextNode()) {
349
349
  let n = e.textContent?.length ?? 0;
@@ -354,24 +354,24 @@ var U = {
354
354
  r += n;
355
355
  }
356
356
  return null;
357
- }, Ue = (e, t, n) => {
358
- let r = He(e, t), i = He(e, n);
357
+ }, We = (e, t, n) => {
358
+ let r = Ue(e, t), i = Ue(e, n);
359
359
  if (r == null || i == null) return null;
360
360
  let a = document.createRange();
361
361
  return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
362
- }, We = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
363
- let r = V(null), [i, a] = H([]), o = R(() => {
362
+ }, Ge = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
363
+ let r = H(null), [i, a] = U([]), o = z(() => {
364
364
  let t = e.current, n = r.current;
365
365
  if (t == null || n == null) return;
366
366
  let i = t.offsetWidth > t.clientWidth;
367
367
  n.style.scrollbarGutter = i ? "stable" : "", n.scrollTop = t.scrollTop;
368
- }, [e]), s = R(() => {
368
+ }, [e]), s = z(() => {
369
369
  let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
370
370
  if (!n || t == null || i == null || o == null || s == null || o === s) {
371
371
  a((e) => e.length === 0 ? e : []);
372
372
  return;
373
373
  }
374
- let c = Ue(i, o, s);
374
+ let c = We(i, o, s);
375
375
  if (c == null) {
376
376
  a((e) => e.length === 0 ? e : []);
377
377
  return;
@@ -386,7 +386,7 @@ var U = {
386
386
  o,
387
387
  s,
388
388
  t
389
- ]), z(() => {
389
+ ]), B(() => {
390
390
  if (!n) return;
391
391
  let t = e.current;
392
392
  if (t == null || typeof ResizeObserver > "u") return;
@@ -405,29 +405,29 @@ var U = {
405
405
  updateSelectionRects: s,
406
406
  syncMirrorToTextarea: o
407
407
  };
408
- }, Ge = ({ messageProp: e, messageRevision: t }) => {
409
- let [n, r] = H(e), i = V(null);
410
- return z(() => {
408
+ }, Ke = ({ messageProp: e, messageRevision: t }) => {
409
+ let [n, r] = U(e), i = H(null);
410
+ return B(() => {
411
411
  r(e);
412
412
  }, [e, t]), {
413
413
  message: n,
414
414
  setMessage: r,
415
415
  textareaRef: i
416
416
  };
417
- }, Ke = (e, t, n, r = n) => {
417
+ }, qe = (e, t, n, r = n) => {
418
418
  let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
419
419
  i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
420
- }, qe = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Je = ({ insertion: e, textareaRef: t }) => {
421
- let n = e?.revision, r = V(e?.text);
420
+ }, Je = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ye = ({ insertion: e, textareaRef: t }) => {
421
+ let n = e?.revision, r = H(e?.text);
422
422
  r.current = e?.text;
423
- let i = V(n), a = V(null), o = V(!1);
424
- return z(() => {
423
+ let i = H(n), a = H(null), o = H(!1);
424
+ return B(() => {
425
425
  document.activeElement === t.current && (o.current = !0);
426
426
  let e = (e) => {
427
427
  e.target === t.current && (o.current = !0);
428
428
  };
429
429
  return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
430
- }, [t]), z(() => {
430
+ }, [t]), B(() => {
431
431
  if (n === i.current) return;
432
432
  i.current = n;
433
433
  let e = r.current;
@@ -437,7 +437,7 @@ var U = {
437
437
  let { value: r, selectionStart: i, selectionEnd: s } = n, c = !o.current && r.length > 0 && i === 0 && s === 0, l = c ? r.length : i ?? r.length, u = c ? l : s ?? l;
438
438
  if (n.focus(), c && n.setSelectionRange(l, u), a.current = null, typeof document.execCommand == "function" && document.execCommand("insertText", !1, e)) return;
439
439
  let d = `${r.slice(0, l)}${e}${r.slice(u)}`;
440
- Ke(n, d, l + e.length), a.current = {
440
+ qe(n, d, l + e.length), a.current = {
441
441
  insertedValue: d,
442
442
  previousValue: r,
443
443
  previousSelectionStart: l,
@@ -447,22 +447,22 @@ var U = {
447
447
  }, [n, t]), {
448
448
  handleUndoKeyDown: (e) => {
449
449
  let n = a.current, r = t.current;
450
- return n == null || r == null || !qe(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), Ke(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
450
+ return n == null || r == null || !Je(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), qe(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
451
451
  },
452
452
  markCaretPlaced: () => {
453
453
  o.current = !0;
454
454
  }
455
455
  };
456
- }, Ye = /* @__PURE__ */ function(e) {
456
+ }, Xe = /* @__PURE__ */ function(e) {
457
457
  return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
458
- }({}), Xe = /* @__PURE__ */ function(e) {
458
+ }({}), Ze = /* @__PURE__ */ function(e) {
459
459
  return e.Dictation = "dictation", e.Attachment = "attachment", e;
460
- }({}), Ze = [
460
+ }({}), Qe = [
461
461
  "audio/webm;codecs=opus",
462
462
  "audio/ogg;codecs=opus",
463
463
  "audio/webm"
464
- ], Qe = 100, $e = 100, et = .01, tt = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
465
- let [a, o] = H("idle"), [s, c] = H(null), l = V(null), d = V(null), f = V({
464
+ ], $e = 100, et = 100, tt = .01, nt = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
465
+ let [a, o] = U("idle"), [s, c] = U(null), l = H(null), d = H(null), f = H({
466
466
  onAttachAudio: e,
467
467
  onTranscribeAudio: t,
468
468
  onTranscript: n,
@@ -474,7 +474,7 @@ var U = {
474
474
  onTranscript: n,
475
475
  errorLabel: i
476
476
  };
477
- let p = R((e = "dictation") => {
477
+ let p = z((e = "dictation") => {
478
478
  if (d.current) return;
479
479
  let t = { controller: new AbortController() };
480
480
  d.current = t, c(null), o("recording");
@@ -492,7 +492,7 @@ var U = {
492
492
  n.aborted || (t.controller.abort(), d.current = null, c(e instanceof Error ? e.message : f.current.errorLabel), o("error"));
493
493
  }, S = () => {
494
494
  if (!a || n.aborted) return;
495
- let e = Ze.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
495
+ let e = Qe.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
496
496
  p = t;
497
497
  let s = Date.now(), c = !1, d = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
498
498
  if (!(g || n.aborted)) {
@@ -500,7 +500,7 @@ var U = {
500
500
  try {
501
501
  let a = t.mimeType || e || "audio/webm", l = new Blob(_, { type: a });
502
502
  _.length = 0, y();
503
- let p = Date.now() - s >= $e;
503
+ let p = Date.now() - s >= et;
504
504
  if (l.size && (!i || p && (!c || d))) {
505
505
  let e = u(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
506
506
  if (i) {
@@ -526,8 +526,8 @@ var U = {
526
526
  e.getByteTimeDomainData(S), c = !0;
527
527
  let t = 0;
528
528
  for (let e of S) t += ((e - 128) / 128) ** 2;
529
- Math.sqrt(t / S.length) >= et && (d = !0, v());
530
- }, Qe));
529
+ Math.sqrt(t / S.length) >= tt && (d = !0, v());
530
+ }, $e));
531
531
  };
532
532
  t.stop = () => {
533
533
  h || n.aborted || (h = !0, v(), o("processing"), p?.state === "recording" && p.stop());
@@ -545,10 +545,10 @@ var U = {
545
545
  x(e);
546
546
  }
547
547
  })();
548
- }, []), m = R(() => d.current?.stop?.(), []), h = R(() => {
548
+ }, []), m = z(() => d.current?.stop?.(), []), h = z(() => {
549
549
  d.current?.controller.abort(), d.current = null, c(null), o("idle");
550
550
  }, []);
551
- return z(() => () => {
551
+ return B(() => () => {
552
552
  d.current?.controller.abort(), d.current = null;
553
553
  }, []), {
554
554
  state: a,
@@ -558,14 +558,14 @@ var U = {
558
558
  stopRecording: m,
559
559
  discardRecording: h
560
560
  };
561
- }, nt = /* @__PURE__ */ function(e) {
561
+ }, rt = /* @__PURE__ */ function(e) {
562
562
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
563
- }({}), rt = /* @__PURE__ */ function(e) {
563
+ }({}), it = /* @__PURE__ */ function(e) {
564
564
  return e.Stacked = "stacked", e.Inline = "inline", e;
565
- }({}), it = {
565
+ }({}), at = {
566
566
  item: "_item_1sr2n_1",
567
567
  itemIcon: "_itemIcon_1sr2n_11"
568
- }, at = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
568
+ }, ot = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "", colors: f }) => {
569
569
  let p = (e) => {
570
570
  e(), r();
571
571
  }, h = c({
@@ -574,7 +574,7 @@ var U = {
574
574
  "--ci-sheet-item-active": f?.itemActiveBg,
575
575
  "--ci-sheet-icon": f?.itemIcon
576
576
  });
577
- return /* @__PURE__ */ P(W, {
577
+ return /* @__PURE__ */ I(G, {
578
578
  isOpen: e,
579
579
  title: t,
580
580
  closeLabel: n,
@@ -583,23 +583,23 @@ var U = {
583
583
  className: o,
584
584
  titleClassName: s,
585
585
  colors: f?.shell,
586
- children: /* @__PURE__ */ P("ul", {
586
+ children: /* @__PURE__ */ I("ul", {
587
587
  role: "list",
588
588
  className: "flex flex-col",
589
589
  style: h,
590
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ P("li", { children: /* @__PURE__ */ P(m, {
590
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ I("li", { children: /* @__PURE__ */ I(m, {
591
591
  type: "button",
592
- className: l(it.item, "w-full gap-3 px-4 py-[10px] text-start"),
593
- iconBefore: /* @__PURE__ */ P("span", {
594
- className: it.itemIcon,
592
+ className: l(at.item, "w-full gap-3 px-4 py-[10px] text-start"),
593
+ iconBefore: /* @__PURE__ */ I("span", {
594
+ className: at.itemIcon,
595
595
  children: n
596
596
  }),
597
- iconAfter: r ? /* @__PURE__ */ P("span", {
597
+ iconAfter: r ? /* @__PURE__ */ I("span", {
598
598
  className: "ms-auto",
599
599
  children: r
600
600
  }) : null,
601
601
  textClassName: d,
602
- label: /* @__PURE__ */ P("span", {
602
+ label: /* @__PURE__ */ I("span", {
603
603
  className: u,
604
604
  children: t
605
605
  }),
@@ -607,9 +607,9 @@ var U = {
607
607
  }) }, e))
608
608
  })
609
609
  });
610
- }, ot = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
611
- let [s, c] = H(t), [l, u] = H(n), [d, f] = H(r), p = V(o);
612
- z(() => {
610
+ }, st = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
611
+ let [s, c] = U(t), [l, u] = U(n), [d, f] = U(r), p = H(o);
612
+ B(() => {
613
613
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
614
614
  }, [
615
615
  o,
@@ -626,7 +626,7 @@ var U = {
626
626
  setResponseFormat: c,
627
627
  setSystemPrompt: u,
628
628
  setTemperature: f,
629
- handleSubmit: R(() => {
629
+ handleSubmit: z(() => {
630
630
  if (!m) return;
631
631
  let t = {};
632
632
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -640,17 +640,17 @@ var U = {
640
640
  a
641
641
  ])
642
642
  };
643
- }, st = { label: "_label_14i7c_1" }, ct = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
643
+ }, ct = { label: "_label_14i7c_1" }, lt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
644
644
  "Precise",
645
645
  "Neutral",
646
646
  "Creative"
647
647
  ], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
648
- let S = c({ "--csf-label-text": x?.labelText }), C = l(b, st.label, "gap-1");
649
- return /* @__PURE__ */ F("div", {
648
+ let S = c({ "--csf-label-text": x?.labelText }), C = l(b, ct.label, "gap-1");
649
+ return /* @__PURE__ */ L("div", {
650
650
  className: "flex flex-col gap-4 px-6 pb-3",
651
651
  style: S,
652
652
  children: [
653
- e.responseFormat && /* @__PURE__ */ P(te, {
653
+ e.responseFormat && /* @__PURE__ */ I(ee, {
654
654
  id: "response-format",
655
655
  labelProps: {
656
656
  label: d,
@@ -658,7 +658,7 @@ var U = {
658
658
  caption: f
659
659
  },
660
660
  optionsClassName: "mb-2",
661
- orientation: A.Column,
661
+ orientation: te.Column,
662
662
  value: t ?? o.Markdown,
663
663
  items: [{
664
664
  value: o.Markdown,
@@ -669,18 +669,18 @@ var U = {
669
669
  }],
670
670
  onChange: (e) => a(e)
671
671
  }),
672
- e.systemPrompt && /* @__PURE__ */ P(oe, {
672
+ e.systemPrompt && /* @__PURE__ */ I(F, {
673
673
  value: n,
674
674
  placeholder: g,
675
675
  className: i,
676
- resize: M.Vertical,
676
+ resize: oe.Vertical,
677
677
  labelProps: {
678
678
  className: C,
679
679
  label: h
680
680
  },
681
681
  onChange: (e) => s(e ?? "")
682
682
  }),
683
- e.temperature && /* @__PURE__ */ P(ie, {
683
+ e.temperature && /* @__PURE__ */ I(P, {
684
684
  labelProps: {
685
685
  label: _,
686
686
  className: C,
@@ -697,8 +697,8 @@ var U = {
697
697
  })
698
698
  ]
699
699
  });
700
- }, lt = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, 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 }) => {
701
- let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: k, setTemperature: te, handleSubmit: A } = ot({
700
+ }, ut = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, 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 }) => {
701
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = st({
702
702
  isOpen: e,
703
703
  features: o,
704
704
  initialResponseFormat: s,
@@ -707,7 +707,7 @@ var U = {
707
707
  onSave: d,
708
708
  onClose: r
709
709
  });
710
- return /* @__PURE__ */ F(W, {
710
+ return /* @__PURE__ */ L(G, {
711
711
  isOpen: e,
712
712
  title: f,
713
713
  closeLabel: i,
@@ -715,14 +715,14 @@ var U = {
715
715
  onBack: t,
716
716
  backLabel: n,
717
717
  style: a,
718
- children: [/* @__PURE__ */ P(ct, {
718
+ children: [/* @__PURE__ */ I(lt, {
719
719
  features: o,
720
720
  responseFormat: w,
721
721
  systemPrompt: T,
722
722
  temperature: E,
723
- onResponseFormatChange: ee,
723
+ onResponseFormatChange: O,
724
724
  onSystemPromptChange: k,
725
- onTemperatureChange: te,
725
+ onTemperatureChange: A,
726
726
  responseFormatLabel: p,
727
727
  responseFormatHint: m,
728
728
  responseFormatMarkdownLabel: h,
@@ -732,23 +732,23 @@ var U = {
732
732
  temperatureLabel: y,
733
733
  temperatureLabels: b,
734
734
  temperatureHint: x
735
- }), /* @__PURE__ */ P("div", {
735
+ }), /* @__PURE__ */ I("div", {
736
736
  className: l("px-6 py-4 mobile:pb-8"),
737
- children: /* @__PURE__ */ P(se, {
737
+ children: /* @__PURE__ */ I(se, {
738
738
  tooltip: C,
739
739
  hideTooltip: D || !C,
740
740
  triggerClassName: "w-full",
741
- children: /* @__PURE__ */ P(O, {
741
+ children: /* @__PURE__ */ I(M, {
742
742
  label: S,
743
- onClick: A,
743
+ onClick: j,
744
744
  disabled: !D,
745
745
  className: "w-full"
746
746
  })
747
747
  })
748
748
  })]
749
749
  });
750
- }, ut = { modal: "_modal_kl0h0_1" }, dt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: g, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = ut.modal }) => {
751
- let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: O, handleSubmit: k } = ot({
750
+ }, dt = { modal: "_modal_kl0h0_1" }, K = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: g, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = dt.modal }) => {
751
+ let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: D, handleSubmit: O } = st({
752
752
  features: e,
753
753
  initialResponseFormat: t,
754
754
  initialSystemPrompt: n,
@@ -756,31 +756,31 @@ var U = {
756
756
  onSave: i,
757
757
  onClose: a
758
758
  });
759
- return /* @__PURE__ */ P(D, {
759
+ return /* @__PURE__ */ I(A, {
760
760
  open: !0,
761
761
  header: o,
762
762
  titleClassName: s,
763
- size: ee.Sm,
763
+ size: j.Sm,
764
764
  onClose: a,
765
765
  className: b,
766
766
  mainButtons: [{
767
767
  label: v,
768
768
  variant: h.Primary,
769
- onClick: k,
769
+ onClick: O,
770
770
  disabled: !w,
771
771
  tooltipProps: y ? {
772
772
  tooltip: y,
773
773
  hideTooltip: w
774
774
  } : void 0
775
775
  }],
776
- children: /* @__PURE__ */ P(ct, {
776
+ children: /* @__PURE__ */ I(lt, {
777
777
  features: e,
778
778
  responseFormat: x,
779
779
  systemPrompt: S,
780
780
  temperature: C,
781
781
  onResponseFormatChange: T,
782
782
  onSystemPromptChange: E,
783
- onTemperatureChange: O,
783
+ onTemperatureChange: D,
784
784
  responseFormatLabel: c,
785
785
  responseFormatHint: l,
786
786
  responseFormatMarkdownLabel: u,
@@ -792,15 +792,15 @@ var U = {
792
792
  temperatureHint: _
793
793
  })
794
794
  });
795
- }, K = {
795
+ }, ft = {
796
796
  icon: "_icon_1fv6z_1",
797
797
  selectedIcon: "_selectedIcon_1fv6z_5"
798
- }, ft = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: p }) => {
798
+ }, pt = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u, itemLabelClassName: d = "dial-small-text", colors: p }) => {
799
799
  let h = c({
800
800
  "--tbs-icon-text": p?.iconText,
801
801
  "--tbs-selected-icon-text": p?.selectedIconText
802
802
  });
803
- return /* @__PURE__ */ P(W, {
803
+ return /* @__PURE__ */ I(G, {
804
804
  isOpen: e,
805
805
  title: o,
806
806
  closeLabel: i,
@@ -808,30 +808,30 @@ var U = {
808
808
  onBack: t,
809
809
  backLabel: n,
810
810
  style: a,
811
- children: /* @__PURE__ */ P("ul", {
811
+ children: /* @__PURE__ */ I("ul", {
812
812
  role: "menu",
813
813
  className: "flex flex-col pb-4",
814
814
  style: h,
815
- children: s.map((e) => /* @__PURE__ */ P("li", {
815
+ children: s.map((e) => /* @__PURE__ */ I("li", {
816
816
  role: "none",
817
- children: /* @__PURE__ */ P(m, {
817
+ children: /* @__PURE__ */ I(m, {
818
818
  type: "button",
819
819
  role: "menuitemcheckbox",
820
820
  "aria-checked": e.isSelected,
821
821
  className: "w-full gap-3 px-4 py-[10px] text-start",
822
- iconBefore: /* @__PURE__ */ P("span", {
823
- className: l("flex items-center", K.icon),
822
+ iconBefore: /* @__PURE__ */ I("span", {
823
+ className: l("flex items-center", ft.icon),
824
824
  children: e.icon
825
825
  }),
826
- iconAfter: e.isSelected ? /* @__PURE__ */ P("span", {
827
- className: l("ms-auto", K.selectedIcon),
828
- children: /* @__PURE__ */ P(me, {
826
+ iconAfter: e.isSelected ? /* @__PURE__ */ I("span", {
827
+ className: l("ms-auto", ft.selectedIcon),
828
+ children: /* @__PURE__ */ I(me, {
829
829
  size: f,
830
830
  "aria-hidden": !0,
831
831
  stroke: v
832
832
  })
833
833
  }) : null,
834
- label: /* @__PURE__ */ P("span", {
834
+ label: /* @__PURE__ */ I("span", {
835
835
  className: d,
836
836
  children: e.label
837
837
  }),
@@ -840,19 +840,19 @@ var U = {
840
840
  }, e.id))
841
841
  })
842
842
  });
843
- }, pt = {
843
+ }, mt = {
844
844
  toolIcon: "_toolIcon_ma5s5_1",
845
845
  chevronIcon: "_chevronIcon_ma5s5_5"
846
- }, mt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: x = [], onToolToggle: C, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: ee, colors: O }) => {
847
- let k = d(), [te, A] = H(!1), [j, ne] = H(!1), [re, ie] = H(!1), [ae, oe] = H(null), [M, se] = H(!1), I = B(() => c({
848
- "--aab-tool-icon": O?.toolIcon,
849
- "--aab-chevron-icon": O?.chevronIcon
850
- }), [O?.toolIcon, O?.chevronIcon]), ce = x.length > 0 && C != null, le = D != null && D.length > 0, ue = B(() => x.map((e) => ({
846
+ }, ht = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: u, listClassName: p = "w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: x = [], onToolToggle: C, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: O, colors: k }) => {
847
+ let A = d(), [j, M] = U(!1), [N, ee] = U(!1), [te, ne] = U(!1), [re, ie] = U(null), [P, ae] = U(!1), F = V(() => c({
848
+ "--aab-tool-icon": k?.toolIcon,
849
+ "--aab-chevron-icon": k?.chevronIcon
850
+ }), [k?.toolIcon, k?.chevronIcon]), oe = x.length > 0 && C != null, se = D != null && D.length > 0, le = V(() => x.map((e) => ({
851
851
  key: e.id,
852
852
  label: e.label,
853
- icon: /* @__PURE__ */ P("span", {
854
- style: I,
855
- className: l("flex items-center", pt.toolIcon),
853
+ icon: /* @__PURE__ */ I("span", {
854
+ style: F,
855
+ className: l("flex items-center", mt.toolIcon),
856
856
  children: e.icon
857
857
  }),
858
858
  selectable: !0,
@@ -862,12 +862,12 @@ var U = {
862
862
  })), [
863
863
  x,
864
864
  C,
865
- I
866
- ]), de = B(() => [
865
+ F
866
+ ]), ue = V(() => [
867
867
  ...e == null ? [] : [{
868
868
  key: "attach",
869
869
  label: r,
870
- icon: /* @__PURE__ */ P(L, {
870
+ icon: /* @__PURE__ */ I(ve, {
871
871
  size: f,
872
872
  "aria-hidden": !0,
873
873
  stroke: v
@@ -875,74 +875,74 @@ var U = {
875
875
  onClick: e
876
876
  }],
877
877
  ...g ?? [],
878
- ...ce ? [{
878
+ ...oe ? [{
879
879
  key: "tools",
880
880
  label: T,
881
- icon: /* @__PURE__ */ P(Se, {
881
+ icon: /* @__PURE__ */ I(Se, {
882
882
  size: f,
883
883
  "aria-hidden": !0,
884
884
  stroke: v
885
885
  }),
886
- onClick: k ? () => {
887
- ie(!0), A(!1);
886
+ onClick: A ? () => {
887
+ ne(!0), M(!1);
888
888
  } : () => void 0,
889
- ...k ? { iconAfter: /* @__PURE__ */ P(ge, {
889
+ ...A ? { iconAfter: /* @__PURE__ */ I(R, {
890
890
  size: f,
891
891
  stroke: v,
892
- style: I,
893
- className: l("rtl:scale-x-[-1]", pt.chevronIcon),
892
+ style: F,
893
+ className: l("rtl:scale-x-[-1]", mt.chevronIcon),
894
894
  "aria-hidden": !0
895
- }) } : { children: ue }
895
+ }) } : { children: le }
896
896
  }] : [],
897
897
  ...(D ?? []).map((e) => ({
898
898
  key: e.key,
899
899
  label: e.title,
900
900
  icon: e.icon,
901
- onClick: k ? () => {
902
- oe(e.key), A(!1);
901
+ onClick: A ? () => {
902
+ ie(e.key), M(!1);
903
903
  } : () => void 0,
904
- ...k ? { iconAfter: /* @__PURE__ */ P(ge, {
904
+ ...A ? { iconAfter: /* @__PURE__ */ I(R, {
905
905
  size: f,
906
906
  stroke: v,
907
- style: I,
908
- className: l("rtl:scale-x-[-1]", pt.chevronIcon),
907
+ style: F,
908
+ className: l("rtl:scale-x-[-1]", mt.chevronIcon),
909
909
  "aria-hidden": !0
910
910
  }) } : {
911
911
  children: [{
912
912
  key: `${e.key}-panel`,
913
913
  label: ""
914
914
  }],
915
- renderSubMenu: () => e.renderOverlay(() => se(!1), ee?.() ?? 0)
915
+ renderSubMenu: () => e.renderOverlay(() => ae(!1), O?.() ?? 0)
916
916
  }
917
917
  })),
918
918
  ...t == null ? [] : [{
919
919
  key: "record-voice",
920
920
  label: n,
921
- icon: /* @__PURE__ */ P(ve, {
921
+ icon: /* @__PURE__ */ I(_e, {
922
922
  size: f,
923
923
  "aria-hidden": !0,
924
924
  stroke: v
925
925
  }),
926
926
  onClick: () => {
927
- A(!1), se(!1), t();
927
+ M(!1), ae(!1), t();
928
928
  }
929
929
  }],
930
930
  ...h == null ? [] : [{
931
931
  key: "chat-settings",
932
932
  label: h.menuItemLabel ?? "Chat settings",
933
- icon: /* @__PURE__ */ P(xe, {
933
+ icon: /* @__PURE__ */ I(xe, {
934
934
  size: f,
935
935
  "aria-hidden": !0,
936
936
  stroke: v
937
937
  }),
938
- iconAfter: k ? /* @__PURE__ */ P(ge, {
938
+ iconAfter: A ? /* @__PURE__ */ I(R, {
939
939
  size: f,
940
940
  stroke: v,
941
- style: I,
942
- className: l("rtl:scale-x-[-1]", pt.chevronIcon),
941
+ style: F,
942
+ className: l("rtl:scale-x-[-1]", mt.chevronIcon),
943
943
  "aria-hidden": !0
944
944
  }) : null,
945
- onClick: () => ne(!0)
945
+ onClick: () => ee(!0)
946
946
  }]
947
947
  ], [
948
948
  r,
@@ -951,26 +951,26 @@ var U = {
951
951
  n,
952
952
  h,
953
953
  g,
954
- k,
955
- ce,
954
+ A,
955
+ oe,
956
956
  T,
957
- ue,
957
+ le,
958
958
  D,
959
- ee,
960
- I
959
+ O,
960
+ F
961
961
  ]);
962
- if (de.length === 0) return null;
963
- let fe = /* @__PURE__ */ P(y, {
962
+ if (ue.length === 0) return null;
963
+ let de = /* @__PURE__ */ I(y, {
964
964
  matchReferenceWidth: !1,
965
965
  placement: "bottom-start",
966
966
  listClassName: p,
967
967
  overlayContentClassName: "flex flex-col gap-1",
968
- items: de,
968
+ items: ue,
969
969
  disabled: m,
970
- open: le ? M : void 0,
971
- onOpenChange: le ? se : void 0,
972
- children: /* @__PURE__ */ P(S, {
973
- icon: /* @__PURE__ */ P(be, {
970
+ open: se ? P : void 0,
971
+ onOpenChange: se ? ae : void 0,
972
+ children: /* @__PURE__ */ I(S, {
973
+ icon: /* @__PURE__ */ I(be, {
974
974
  size: _.LG,
975
975
  "aria-hidden": !0,
976
976
  stroke: v
@@ -980,9 +980,9 @@ var U = {
980
980
  disabled: m
981
981
  })
982
982
  });
983
- return /* @__PURE__ */ P(N, { children: k ? /* @__PURE__ */ F(N, { children: [
984
- /* @__PURE__ */ P(S, {
985
- icon: /* @__PURE__ */ P(be, {
983
+ return /* @__PURE__ */ I(ce, { children: A ? /* @__PURE__ */ L(ce, { children: [
984
+ /* @__PURE__ */ I(S, {
985
+ icon: /* @__PURE__ */ I(be, {
986
986
  size: _.LG,
987
987
  "aria-hidden": !0,
988
988
  stroke: v
@@ -991,54 +991,54 @@ var U = {
991
991
  size: b.Large,
992
992
  tooltipProps: { tooltip: i },
993
993
  disabled: m,
994
- onClick: () => A(!0)
994
+ onClick: () => M(!0)
995
995
  }),
996
- /* @__PURE__ */ P(at, {
997
- isOpen: te,
996
+ /* @__PURE__ */ I(ot, {
997
+ isOpen: j,
998
998
  title: a,
999
999
  closeLabel: s,
1000
- onClose: () => A(!1),
1000
+ onClose: () => M(!1),
1001
1001
  style: u,
1002
- items: de,
1002
+ items: ue,
1003
1003
  className: "pb-4",
1004
1004
  btnTextClassName: "flex-1"
1005
1005
  }),
1006
- ce && /* @__PURE__ */ P(ft, {
1007
- isOpen: re,
1006
+ oe && /* @__PURE__ */ I(pt, {
1007
+ isOpen: te,
1008
1008
  onBack: () => {
1009
- ie(!1), A(!0);
1009
+ ne(!1), M(!0);
1010
1010
  },
1011
1011
  backLabel: E,
1012
- onClose: () => ie(!1),
1012
+ onClose: () => ne(!1),
1013
1013
  closeLabel: s,
1014
1014
  style: u,
1015
1015
  title: T,
1016
1016
  items: x,
1017
1017
  onToolToggle: C
1018
1018
  }),
1019
- D?.map((e) => /* @__PURE__ */ P(W, {
1020
- isOpen: ae === e.key,
1019
+ D?.map((e) => /* @__PURE__ */ I(G, {
1020
+ isOpen: re === e.key,
1021
1021
  title: e.title,
1022
1022
  closeLabel: s,
1023
1023
  onBack: () => {
1024
- oe(null), A(!0);
1024
+ ie(null), M(!0);
1025
1025
  },
1026
1026
  backLabel: e.backLabel ?? "Back",
1027
- onClose: () => oe(null),
1027
+ onClose: () => ie(null),
1028
1028
  style: u,
1029
- children: /* @__PURE__ */ P("div", {
1029
+ children: /* @__PURE__ */ I("div", {
1030
1030
  role: "menu",
1031
1031
  "aria-label": e.title,
1032
- children: e.renderOverlay(() => oe(null), ee?.() ?? 0)
1032
+ children: e.renderOverlay(() => ie(null), O?.() ?? 0)
1033
1033
  })
1034
1034
  }, e.key)),
1035
- h != null && /* @__PURE__ */ P(lt, {
1036
- isOpen: j,
1035
+ h != null && /* @__PURE__ */ I(ut, {
1036
+ isOpen: N,
1037
1037
  onBack: () => {
1038
- ne(!1), A(!0);
1038
+ ee(!1), M(!0);
1039
1039
  },
1040
1040
  backLabel: h.backLabel ?? "Back",
1041
- onClose: () => ne(!1),
1041
+ onClose: () => ee(!1),
1042
1042
  closeLabel: s,
1043
1043
  style: u,
1044
1044
  features: h.features,
@@ -1059,13 +1059,13 @@ var U = {
1059
1059
  saveLabel: h.saveLabel,
1060
1060
  saveDisabledTooltip: h.saveDisabledTooltip
1061
1061
  })
1062
- ] }) : /* @__PURE__ */ F(N, { children: [fe, h != null && j && /* @__PURE__ */ P(dt, {
1062
+ ] }) : /* @__PURE__ */ L(ce, { children: [de, h != null && N && /* @__PURE__ */ I(K, {
1063
1063
  features: h.features,
1064
1064
  initialResponseFormat: h.responseFormat ?? o.Markdown,
1065
1065
  initialSystemPrompt: h.systemPrompt,
1066
1066
  initialTemperature: h.temperature,
1067
1067
  onSave: h.onSave,
1068
- onClose: () => ne(!1),
1068
+ onClose: () => ee(!1),
1069
1069
  title: h.title,
1070
1070
  responseFormatLabel: h.responseFormatLabel,
1071
1071
  responseFormatHint: h.responseFormatHint,
@@ -1079,14 +1079,14 @@ var U = {
1079
1079
  saveLabel: h.saveLabel,
1080
1080
  saveDisabledTooltip: h.saveDisabledTooltip
1081
1081
  })] }) });
1082
- }, q = {
1082
+ }, gt = {
1083
1083
  chip: "_chip_1lvv5_1",
1084
1084
  chipSelected: "_chipSelected_1lvv5_9",
1085
1085
  chipIcon: "_chipIcon_1lvv5_16",
1086
1086
  chipText: "_chipText_1lvv5_19",
1087
1087
  chipState: "_chipState_1lvv5_22",
1088
1088
  chipClose: "_chipClose_1lvv5_25"
1089
- }, ht = (e) => `Remove ${e}`, gt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = ht, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
1089
+ }, _t = (e) => `Remove ${e}`, vt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = _t, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
1090
1090
  if (e.length === 0) return null;
1091
1091
  let d = !!(a && o), f = c({
1092
1092
  "--ci-chip-bg": u?.chipBg,
@@ -1102,41 +1102,41 @@ var U = {
1102
1102
  "--ci-chip-close": u?.chipClose,
1103
1103
  "--ci-chip-close-hover": u?.chipCloseHover
1104
1104
  });
1105
- return /* @__PURE__ */ P("div", {
1105
+ return /* @__PURE__ */ I("div", {
1106
1106
  className: "flex flex-wrap items-center gap-2",
1107
1107
  style: f,
1108
- children: e.map((e) => /* @__PURE__ */ F("div", {
1109
- className: l(q.chip, e.isSelected && q.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "ps-2 pe-1" : "px-2"),
1110
- children: [/* @__PURE__ */ F("button", {
1108
+ children: e.map((e) => /* @__PURE__ */ L("div", {
1109
+ className: l(gt.chip, e.isSelected && gt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "ps-2 pe-1" : "px-2"),
1110
+ children: [/* @__PURE__ */ L("button", {
1111
1111
  type: "button",
1112
1112
  onClick: () => t(e.id),
1113
1113
  "aria-pressed": e.isSelected,
1114
1114
  className: "flex min-w-0 items-center gap-1.5",
1115
1115
  children: [
1116
- /* @__PURE__ */ P("span", {
1117
- className: l(q.chipIcon, "shrink-0"),
1116
+ /* @__PURE__ */ I("span", {
1117
+ className: l(gt.chipIcon, "shrink-0"),
1118
1118
  "aria-hidden": !0,
1119
1119
  children: e.icon
1120
1120
  }),
1121
- /* @__PURE__ */ F("span", {
1122
- className: l(q.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
1123
- children: [e.label, d && /* @__PURE__ */ P("span", {
1121
+ /* @__PURE__ */ L("span", {
1122
+ className: l(gt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
1123
+ children: [e.label, d && /* @__PURE__ */ I("span", {
1124
1124
  "aria-hidden": !0,
1125
1125
  children: ":"
1126
1126
  })]
1127
1127
  }),
1128
- d && /* @__PURE__ */ P("span", {
1129
- className: l(q.chipState, s?.fontClassName || "dial-small-paragraph-text", "ms-1 shrink-0 tracking-wider uppercase"),
1128
+ d && /* @__PURE__ */ I("span", {
1129
+ className: l(gt.chipState, s?.fontClassName || "dial-small-paragraph-text", "ms-1 shrink-0 tracking-wider uppercase"),
1130
1130
  "aria-hidden": !0,
1131
1131
  children: e.isSelected ? a : o
1132
1132
  })
1133
1133
  ]
1134
- }), r && /* @__PURE__ */ P("button", {
1134
+ }), r && /* @__PURE__ */ I("button", {
1135
1135
  type: "button",
1136
1136
  onClick: () => n(e.id),
1137
1137
  "aria-label": i(e.label),
1138
- className: l(q.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1139
- children: /* @__PURE__ */ P(Ce, {
1138
+ className: l(gt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1139
+ children: /* @__PURE__ */ I(Ce, {
1140
1140
  size: 12,
1141
1141
  "aria-hidden": !0,
1142
1142
  stroke: v
@@ -1144,7 +1144,7 @@ var U = {
1144
1144
  })]
1145
1145
  }, e.id))
1146
1146
  });
1147
- }, J = {
1147
+ }, q = {
1148
1148
  wrapper: "_wrapper_19a9k_2",
1149
1149
  wrapperDisabled: "_wrapperDisabled_19a9k_9",
1150
1150
  textarea: "_textarea_19a9k_13",
@@ -1157,33 +1157,33 @@ var U = {
1157
1157
  modelSelectorName: "_modelSelectorName_19a9k_72",
1158
1158
  modelSelectorVersion: "_modelSelectorVersion_19a9k_75",
1159
1159
  modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_19a9k_84"
1160
- }, _t = {
1160
+ }, yt = {
1161
1161
  waveformCanvas: "_waveformCanvas_18zb5_1",
1162
1162
  recordingDot: "_recordingDot_18zb5_15",
1163
1163
  "recording-pulse": "_recording-pulse_18zb5_1"
1164
- }, vt = 3, yt = 4, bt = 200, xt = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
1165
- let f = V(null), p = V(new Float32Array(bt)), m = V(0), h = V(0), g = e === Ye.Recording, y = e === Ye.Processing, b = R((e) => {
1164
+ }, bt = 3, xt = 4, St = 200, Ct = ({ state: e, analyserNodeRef: t, onStop: n, onDiscard: r, attachButton: i, stopLabel: a = "Stop recording", discardLabel: o = "Discard recording", processingLabel: s = "Transcribing audio…", style: c, className: u, embedded: d = !1 }) => {
1165
+ let f = H(null), p = H(new Float32Array(St)), m = H(0), h = H(0), g = e === Xe.Recording, y = e === Xe.Processing, b = z((e) => {
1166
1166
  let t = e.getContext("2d");
1167
1167
  if (!t) return;
1168
1168
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
1169
1169
  let { width: n, height: r } = e;
1170
1170
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
1171
- let i = Math.min(Math.max(1, Math.floor(n / yt)), 199), a = m.current, o = h.current;
1171
+ let i = Math.min(Math.max(1, Math.floor(n / xt)), 199), a = m.current, o = h.current;
1172
1172
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
1173
1173
  for (let e = 0; e <= i; e++) {
1174
- let n = ((a - i + e) % bt + bt) % bt, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1175
- t.fillRect(e * yt, (r - c) / 2, vt, c);
1174
+ let n = ((a - i + e) % St + St) % St, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
1175
+ t.fillRect(e * xt, (r - c) / 2, bt, c);
1176
1176
  }
1177
1177
  t.restore();
1178
1178
  }, []);
1179
- z(() => {
1179
+ B(() => {
1180
1180
  if (!g) return;
1181
1181
  let e = f.current;
1182
1182
  if (!e) return;
1183
1183
  p.current.fill(0), m.current = 0, h.current = 0;
1184
1184
  let n, r = () => {
1185
- if (h.current += 1, h.current >= yt) {
1186
- h.current -= yt;
1185
+ if (h.current += 1, h.current >= xt) {
1186
+ h.current -= xt;
1187
1187
  let e = t.current;
1188
1188
  if (e) {
1189
1189
  let t = new Uint8Array(e.frequencyBinCount);
@@ -1193,7 +1193,7 @@ var U = {
1193
1193
  let r = (t[e] - 128) / 128;
1194
1194
  n += r * r;
1195
1195
  }
1196
- p.current[m.current % bt] = Math.sqrt(n / t.length), m.current++;
1196
+ p.current[m.current % St] = Math.sqrt(n / t.length), m.current++;
1197
1197
  }
1198
1198
  }
1199
1199
  b(e), n = requestAnimationFrame(r);
@@ -1205,7 +1205,7 @@ var U = {
1205
1205
  g,
1206
1206
  t,
1207
1207
  b
1208
- ]), z(() => {
1208
+ ]), B(() => {
1209
1209
  let e = f.current;
1210
1210
  if (!e) return;
1211
1211
  let t = new ResizeObserver(() => {
@@ -1213,11 +1213,11 @@ var U = {
1213
1213
  });
1214
1214
  return t.observe(e), () => t.disconnect();
1215
1215
  }, [b]);
1216
- let x = /* @__PURE__ */ F("div", {
1216
+ let x = /* @__PURE__ */ L("div", {
1217
1217
  className: "flex shrink-0 items-center justify-end gap-1",
1218
1218
  children: [
1219
- /* @__PURE__ */ P(E, {
1220
- icon: /* @__PURE__ */ P(Ce, {
1219
+ /* @__PURE__ */ I(E, {
1220
+ icon: /* @__PURE__ */ I(Ce, {
1221
1221
  size: _.LG,
1222
1222
  "aria-hidden": !0,
1223
1223
  stroke: v
@@ -1226,8 +1226,8 @@ var U = {
1226
1226
  className: "mobile:min-h-11 mobile:min-w-11",
1227
1227
  onClick: r
1228
1228
  }),
1229
- g && /* @__PURE__ */ P(k, {
1230
- icon: /* @__PURE__ */ P(me, {
1229
+ g && /* @__PURE__ */ I(N, {
1230
+ icon: /* @__PURE__ */ I(me, {
1231
1231
  size: _.LG,
1232
1232
  "aria-hidden": !0,
1233
1233
  stroke: v
@@ -1237,104 +1237,104 @@ var U = {
1237
1237
  "aria-label": a,
1238
1238
  className: "mobile:min-h-11 mobile:min-w-11"
1239
1239
  }),
1240
- y && /* @__PURE__ */ P("span", {
1240
+ y && /* @__PURE__ */ I("span", {
1241
1241
  className: "flex size-[40px] shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
1242
- children: /* @__PURE__ */ P(ae, {
1242
+ children: /* @__PURE__ */ I(ae, {
1243
1243
  size: 20,
1244
1244
  ariaLabel: s
1245
1245
  })
1246
1246
  })
1247
1247
  ]
1248
1248
  });
1249
- return /* @__PURE__ */ P("div", {
1249
+ return /* @__PURE__ */ I("div", {
1250
1250
  className: u,
1251
- children: /* @__PURE__ */ F("div", {
1251
+ children: /* @__PURE__ */ L("div", {
1252
1252
  style: c,
1253
- className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d && J.wrapper, !d && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
1254
- children: [/* @__PURE__ */ F("div", {
1253
+ className: l("flex w-full min-w-0 flex-col justify-center gap-2", !d && q.wrapper, !d && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
1254
+ children: [/* @__PURE__ */ L("div", {
1255
1255
  className: "flex min-w-0 flex-1 items-center gap-3",
1256
- children: [g && /* @__PURE__ */ P("span", {
1257
- className: l(_t.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1256
+ children: [g && /* @__PURE__ */ I("span", {
1257
+ className: l(yt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1258
1258
  "aria-hidden": !0
1259
- }), /* @__PURE__ */ P("canvas", {
1259
+ }), /* @__PURE__ */ I("canvas", {
1260
1260
  ref: f,
1261
1261
  height: 26,
1262
1262
  "aria-hidden": !0,
1263
- className: l(_t.waveformCanvas, "h-[26px] min-w-0 flex-1")
1263
+ className: l(yt.waveformCanvas, "h-[26px] min-w-0 flex-1")
1264
1264
  })]
1265
- }), /* @__PURE__ */ F("div", {
1265
+ }), /* @__PURE__ */ L("div", {
1266
1266
  className: "flex items-center justify-between gap-2",
1267
- children: [i ?? /* @__PURE__ */ P("span", { "aria-hidden": !0 }), x]
1267
+ children: [i ?? /* @__PURE__ */ I("span", { "aria-hidden": !0 }), x]
1268
1268
  })]
1269
1269
  })
1270
1270
  });
1271
- }, St = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ P(k, {
1271
+ }, wt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ I(N, {
1272
1272
  "aria-label": n,
1273
1273
  onClick: () => e?.(),
1274
1274
  disabled: t,
1275
1275
  tooltipProps: r ? { tooltip: r } : void 0,
1276
- icon: /* @__PURE__ */ P(pe, {
1276
+ icon: /* @__PURE__ */ I(pe, {
1277
1277
  size: _.LG,
1278
1278
  className: "rtl:scale-x-[-1]",
1279
1279
  stroke: v
1280
1280
  })
1281
- }), Ct = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ P(E, {
1282
- icon: /* @__PURE__ */ P(ye, {
1281
+ }), Tt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ I(E, {
1282
+ icon: /* @__PURE__ */ I(ye, {
1283
1283
  size: _.LG,
1284
1284
  stroke: v
1285
1285
  }),
1286
1286
  onClick: () => e?.(),
1287
1287
  "aria-label": t
1288
- }), wt = ({ size: e = 20 }) => /* @__PURE__ */ P(ne, {
1289
- variant: re.Circular,
1288
+ }), Et = ({ size: e = 20 }) => /* @__PURE__ */ I(re, {
1289
+ variant: ie.Circular,
1290
1290
  width: e,
1291
1291
  height: e,
1292
1292
  active: !0
1293
- }), Tt = ({ loadingLabel: e }) => /* @__PURE__ */ F("span", {
1293
+ }), Dt = ({ loadingLabel: e }) => /* @__PURE__ */ L("span", {
1294
1294
  className: "flex min-w-0 flex-1 items-center",
1295
- children: [/* @__PURE__ */ P(ne, {
1296
- variant: re.Text,
1295
+ children: [/* @__PURE__ */ I(re, {
1296
+ variant: ie.Text,
1297
1297
  width: "100%",
1298
1298
  height: 16,
1299
1299
  active: !0
1300
- }), e && /* @__PURE__ */ P("span", {
1300
+ }), e && /* @__PURE__ */ I("span", {
1301
1301
  className: "sr-only",
1302
1302
  children: e
1303
1303
  })]
1304
- }), Et = ({ loadingLabel: e }) => /* @__PURE__ */ P("div", {
1304
+ }), Ot = ({ loadingLabel: e }) => /* @__PURE__ */ I("div", {
1305
1305
  role: "status",
1306
1306
  "aria-label": e,
1307
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ F("div", {
1307
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ L("div", {
1308
1308
  className: "flex h-11 items-center gap-3 px-4",
1309
1309
  "aria-hidden": "true",
1310
- children: [/* @__PURE__ */ P(wt, {}), /* @__PURE__ */ P(Tt, {})]
1310
+ children: [/* @__PURE__ */ I(Et, {}), /* @__PURE__ */ I(Dt, {})]
1311
1311
  }, t))
1312
- }), Dt = (e) => e.displayName ?? e.id, Ot = (e, t) => {
1312
+ }), kt = (e) => e.displayName ?? e.id, At = (e, t) => {
1313
1313
  let n = t.trim().toLowerCase();
1314
- return n ? e.filter((e) => Dt(e).toLowerCase().includes(n)) : e;
1315
- }, kt = (e, t, r, i = 18, a) => /* @__PURE__ */ P(n, {
1314
+ return n ? e.filter((e) => kt(e).toLowerCase().includes(n)) : e;
1315
+ }, jt = (e, t, r, i = 18, a) => /* @__PURE__ */ I(n, {
1316
1316
  src: e,
1317
1317
  size: i,
1318
1318
  labels: { tooltip: a },
1319
1319
  initialsName: r
1320
- }), At = {
1320
+ }), Mt = {
1321
1321
  searchHeader: "_searchHeader_1u7db_1",
1322
1322
  itemText: "_itemText_1u7db_13",
1323
1323
  itemHover: "_itemHover_1u7db_17",
1324
1324
  selectedItemBackground: "_selectedItemBackground_1u7db_22",
1325
1325
  selectedItemText: "_selectedItemText_1u7db_26",
1326
1326
  checkIcon: "_checkIcon_1u7db_30"
1327
- }, jt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1328
- let [a, o] = H(""), s = B(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = B(() => u ? /* @__PURE__ */ P(wt, { size: _.LG }) : kt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", _.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1327
+ }, Nt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1328
+ let [a, o] = U(""), s = V(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = V(() => u ? /* @__PURE__ */ I(Et, { size: _.LG }) : jt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", _.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1329
1329
  u,
1330
1330
  s,
1331
1331
  d,
1332
1332
  r?.unavailableTooltip
1333
- ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = B(() => {
1333
+ ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = V(() => {
1334
1334
  if (u) return Array.from({ length: 7 }, (e, t) => ({
1335
1335
  key: `__loading-${t}`,
1336
- icon: /* @__PURE__ */ P(wt, {}),
1337
- label: /* @__PURE__ */ P(Tt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1336
+ icon: /* @__PURE__ */ I(Et, {}),
1337
+ label: /* @__PURE__ */ I(Dt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1338
1338
  disabled: !0
1339
1339
  }));
1340
1340
  if (!e || e.length === 0) {
@@ -1346,19 +1346,19 @@ var U = {
1346
1346
  }] : [];
1347
1347
  }
1348
1348
  let o = i?.colors;
1349
- return Ot(e, a).map((e) => {
1349
+ return At(e, a).map((e) => {
1350
1350
  let r = e.id === t;
1351
1351
  return {
1352
1352
  key: e.id,
1353
- label: /* @__PURE__ */ P(C, {
1354
- text: Dt(e),
1353
+ label: /* @__PURE__ */ I(C, {
1354
+ text: kt(e),
1355
1355
  query: a,
1356
1356
  maxLines: 1
1357
1357
  }),
1358
- icon: kt(e.iconUrl, e.type, e.displayName ?? e.id),
1358
+ icon: jt(e.iconUrl, e.type, e.displayName ?? e.id),
1359
1359
  mark: w.Check,
1360
1360
  checked: r,
1361
- className: l(o?.itemText && At.itemText, o?.itemHoverBackground && At.itemHover, r && o?.selectedItemBackground && At.selectedItemBackground, r && o?.selectedItemText && At.selectedItemText, r && o?.checkIcon && At.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, U.modelMenuItem, r && U.modelMenuItemSelected),
1361
+ className: l(o?.itemText && Mt.itemText, o?.itemHoverBackground && Mt.itemHover, r && o?.selectedItemBackground && Mt.selectedItemBackground, r && o?.selectedItemText && Mt.selectedItemText, r && o?.checkIcon && Mt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, W.modelMenuItem, r && W.modelMenuItemSelected),
1362
1362
  onClick: () => n?.(e.id)
1363
1363
  };
1364
1364
  });
@@ -1372,7 +1372,7 @@ var U = {
1372
1372
  i?.itemClassName,
1373
1373
  i?.selectedItemClassName,
1374
1374
  i?.colors
1375
- ]), v = B(() => c({
1375
+ ]), v = V(() => c({
1376
1376
  "--ms-item-text": i?.colors?.itemText,
1377
1377
  "--ms-item-hover-bg": i?.colors?.itemHoverBackground,
1378
1378
  "--ms-selected-item-bg": i?.colors?.selectedItemBackground,
@@ -1385,10 +1385,10 @@ var U = {
1385
1385
  selectedLabel: p,
1386
1386
  selectedVersion: m,
1387
1387
  menuItems: g,
1388
- menuHeader: B(() => !u && e && e.length > 0 ? /* @__PURE__ */ P("div", {
1388
+ menuHeader: V(() => !u && e && e.length > 0 ? /* @__PURE__ */ I("div", {
1389
1389
  style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
1390
- className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", At.searchHeader, i?.searchHeaderClassName, U.modelMenuSearch),
1391
- children: /* @__PURE__ */ P(j, {
1390
+ className: l("sticky top-0 z-10 pe-2 pt-2 pb-1", Mt.searchHeader, i?.searchHeaderClassName, W.modelMenuSearch),
1391
+ children: /* @__PURE__ */ I(ne, {
1392
1392
  value: a,
1393
1393
  placeholder: r?.searchPlaceholder ?? "Search",
1394
1394
  size: b.Small,
@@ -1408,22 +1408,22 @@ var U = {
1408
1408
  e || o("");
1409
1409
  }
1410
1410
  };
1411
- }, Mt = typeof window < "u" ? ke : z;
1412
- function Nt(e) {
1411
+ }, J = typeof window < "u" ? ke : B;
1412
+ function Pt(e) {
1413
1413
  if (e !== void 0) switch (typeof e) {
1414
1414
  case "number": return e;
1415
1415
  case "string": if (e.endsWith("px")) return parseFloat(e);
1416
1416
  }
1417
1417
  }
1418
- function Pt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1419
- let { styleHeight: s, styleWidth: c } = B(() => ({
1420
- styleHeight: Nt(o?.height),
1421
- styleWidth: Nt(o?.width)
1422
- }), [o?.height, o?.width]), [l, u] = H({
1418
+ function Ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1419
+ let { styleHeight: s, styleWidth: c } = V(() => ({
1420
+ styleHeight: Pt(o?.height),
1421
+ styleWidth: Pt(o?.width)
1422
+ }), [o?.height, o?.width]), [l, u] = U({
1423
1423
  height: t,
1424
1424
  width: n
1425
1425
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1426
- return Mt(() => {
1426
+ return J(() => {
1427
1427
  if (i === null || d) return;
1428
1428
  let t = new ResizeObserver((e) => {
1429
1429
  for (let t of e) {
@@ -1443,7 +1443,7 @@ function Pt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1443
1443
  i,
1444
1444
  s,
1445
1445
  c
1446
- ]), B(() => ({
1446
+ ]), V(() => ({
1447
1447
  height: s ?? l.height,
1448
1448
  width: c ?? l.width
1449
1449
  }), [
@@ -1452,26 +1452,26 @@ function Pt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1452
1452
  c
1453
1453
  ]);
1454
1454
  }
1455
- function Ft(e) {
1456
- let t = V(() => {
1455
+ function It(e) {
1456
+ let t = H(() => {
1457
1457
  throw Error("Cannot call during render.");
1458
1458
  });
1459
- return Mt(() => {
1459
+ return J(() => {
1460
1460
  t.current = e;
1461
- }, [e]), R((e) => t.current?.(e), [t]);
1461
+ }, [e]), z((e) => t.current?.(e), [t]);
1462
1462
  }
1463
- var It = null;
1464
- function Lt(e = !1) {
1465
- if (It === null || e) {
1463
+ var Lt = null;
1464
+ function Y(e = !1) {
1465
+ if (Lt === null || e) {
1466
1466
  let e = document.createElement("div"), t = e.style;
1467
1467
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1468
1468
  let n = document.createElement("div"), r = n.style;
1469
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? It = "positive-descending" : (e.scrollLeft = 1, It = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), It;
1469
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Lt = "positive-descending" : (e.scrollLeft = 1, Lt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Lt;
1470
1470
  }
1471
- return It;
1471
+ return Lt;
1472
1472
  }
1473
- function Y({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1474
- if (t === "horizontal" && n) switch (Lt()) {
1473
+ function X({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1474
+ if (t === "horizontal" && n) switch (Y()) {
1475
1475
  case "negative": return -r;
1476
1476
  case "positive-descending": if (e) {
1477
1477
  let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
@@ -1480,26 +1480,26 @@ function Y({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1480
1480
  }
1481
1481
  return r;
1482
1482
  }
1483
- function X(e, t = "Assertion error") {
1483
+ function Z(e, t = "Assertion error") {
1484
1484
  if (!e) throw console.error(t), Error(t);
1485
1485
  }
1486
- function Z(e, t) {
1486
+ function Rt(e, t) {
1487
1487
  if (e === t) return !0;
1488
- if (!!e != !!t || (X(e !== void 0), X(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1488
+ if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1489
1489
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1490
1490
  return !0;
1491
1491
  }
1492
- function Rt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1492
+ function zt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1493
1493
  if (t === 0) return 0;
1494
1494
  if (typeof n == "number") return t * n;
1495
1495
  {
1496
1496
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
1497
- return X(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1497
+ return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1498
1498
  }
1499
1499
  }
1500
- function zt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1500
+ function Bt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1501
1501
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1502
- let s = Rt({
1502
+ let s = zt({
1503
1503
  cachedBounds: t,
1504
1504
  itemCount: r,
1505
1505
  itemSize: i
@@ -1511,7 +1511,7 @@ function zt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1511
1511
  default: return a >= u && a <= l ? a : a < u ? u : l;
1512
1512
  }
1513
1513
  }
1514
- function Bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1514
+ function Vt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1515
1515
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1516
1516
  for (; u < a;) {
1517
1517
  let n = e.get(u);
@@ -1530,11 +1530,11 @@ function Bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
1530
1530
  stopIndexOverscan: l
1531
1531
  };
1532
1532
  }
1533
- function Vt({ itemCount: e, itemProps: t, itemSize: n }) {
1533
+ function Q({ itemCount: e, itemProps: t, itemSize: n }) {
1534
1534
  let r = /* @__PURE__ */ new Map();
1535
1535
  return {
1536
1536
  get(i) {
1537
- for (X(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1537
+ for (Z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1538
1538
  let e = r.size, a;
1539
1539
  switch (typeof n) {
1540
1540
  case "function":
@@ -1548,14 +1548,14 @@ function Vt({ itemCount: e, itemProps: t, itemSize: n }) {
1548
1548
  });
1549
1549
  else {
1550
1550
  let t = r.get(e - 1);
1551
- X(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1551
+ Z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1552
1552
  scrollOffset: t.scrollOffset + t.size,
1553
1553
  size: a
1554
1554
  });
1555
1555
  }
1556
1556
  }
1557
1557
  let a = r.get(i);
1558
- return X(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1558
+ return Z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1559
1559
  },
1560
1560
  set(e, t) {
1561
1561
  r.set(e, t);
@@ -1565,8 +1565,8 @@ function Vt({ itemCount: e, itemProps: t, itemSize: n }) {
1565
1565
  }
1566
1566
  };
1567
1567
  }
1568
- function Q({ itemCount: e, itemProps: t, itemSize: n }) {
1569
- return B(() => Vt({
1568
+ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
1569
+ return V(() => Q({
1570
1570
  itemCount: e,
1571
1571
  itemProps: t,
1572
1572
  itemSize: n
@@ -1576,27 +1576,27 @@ function Q({ itemCount: e, itemProps: t, itemSize: n }) {
1576
1576
  n
1577
1577
  ]);
1578
1578
  }
1579
- function Ht({ containerSize: e, itemSize: t }) {
1579
+ function Ut({ containerSize: e, itemSize: t }) {
1580
1580
  let n;
1581
1581
  switch (typeof t) {
1582
1582
  case "string":
1583
- X(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), X(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1583
+ Z(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Z(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
1584
1584
  break;
1585
1585
  default: n = t;
1586
1586
  }
1587
1587
  return n;
1588
1588
  }
1589
- function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1590
- let { height: u = n, width: d = n } = Pt({
1589
+ function Wt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1590
+ let { height: u = n, width: d = n } = Ft({
1591
1591
  defaultHeight: r === "vertical" ? n : void 0,
1592
1592
  defaultWidth: r === "horizontal" ? n : void 0,
1593
1593
  element: e,
1594
1594
  mode: r === "vertical" ? "only-height" : "only-width",
1595
1595
  style: t
1596
- }), f = V({
1596
+ }), f = H({
1597
1597
  height: 0,
1598
1598
  width: 0
1599
- }), p = r === "vertical" ? u : d, m = Ht({
1599
+ }), p = r === "vertical" ? u : d, m = Ut({
1600
1600
  containerSize: p,
1601
1601
  itemSize: s
1602
1602
  });
@@ -1613,11 +1613,11 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1613
1613
  c,
1614
1614
  d
1615
1615
  ]);
1616
- let h = Q({
1616
+ let h = Ht({
1617
1617
  itemCount: a,
1618
1618
  itemProps: o,
1619
1619
  itemSize: m
1620
- }), g = R((e) => h.get(e), [h]), [_, v] = H(() => Bt({
1620
+ }), g = z((e) => h.get(e), [h]), [_, v] = U(() => Vt({
1621
1621
  cachedBounds: h,
1622
1622
  containerScrollOffset: 0,
1623
1623
  containerSize: p,
@@ -1628,7 +1628,7 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1628
1628
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1629
1629
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1630
1630
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1631
- }, C = R(() => Rt({
1631
+ }, C = z(() => zt({
1632
1632
  cachedBounds: h,
1633
1633
  itemCount: a,
1634
1634
  itemSize: m
@@ -1636,14 +1636,14 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1636
1636
  h,
1637
1637
  a,
1638
1638
  m
1639
- ]), w = R((t) => {
1640
- let n = Y({
1639
+ ]), w = z((t) => {
1640
+ let n = X({
1641
1641
  containerElement: e,
1642
1642
  direction: r,
1643
1643
  isRtl: i,
1644
1644
  scrollOffset: t
1645
1645
  });
1646
- return Bt({
1646
+ return Vt({
1647
1647
  cachedBounds: h,
1648
1648
  containerScrollOffset: n,
1649
1649
  containerSize: p,
@@ -1659,30 +1659,30 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1659
1659
  a,
1660
1660
  l
1661
1661
  ]);
1662
- return Mt(() => {
1662
+ return J(() => {
1663
1663
  let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
1664
1664
  v(w(t));
1665
1665
  }, [
1666
1666
  e,
1667
1667
  r,
1668
1668
  w
1669
- ]), Mt(() => {
1669
+ ]), J(() => {
1670
1670
  if (!e) return;
1671
1671
  let t = () => {
1672
1672
  v((t) => {
1673
- let { scrollLeft: n, scrollTop: o } = e, s = Y({
1673
+ let { scrollLeft: n, scrollTop: o } = e, s = X({
1674
1674
  containerElement: e,
1675
1675
  direction: r,
1676
1676
  isRtl: i,
1677
1677
  scrollOffset: r === "vertical" ? o : n
1678
- }), c = Bt({
1678
+ }), c = Vt({
1679
1679
  cachedBounds: h,
1680
1680
  containerScrollOffset: s,
1681
1681
  containerSize: p,
1682
1682
  itemCount: a,
1683
1683
  overscanCount: l
1684
1684
  });
1685
- return Z(c, t) ? t : c;
1685
+ return Rt(c, t) ? t : c;
1686
1686
  });
1687
1687
  };
1688
1688
  return e.addEventListener("scroll", t), () => {
@@ -1698,8 +1698,8 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1698
1698
  ]), {
1699
1699
  getCellBounds: g,
1700
1700
  getEstimatedSize: C,
1701
- scrollToIndex: Ft(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1702
- let s = zt({
1701
+ scrollToIndex: It(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1702
+ let s = Bt({
1703
1703
  align: t,
1704
1704
  cachedBounds: h,
1705
1705
  containerScrollOffset: n,
@@ -1709,14 +1709,14 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1709
1709
  itemSize: m
1710
1710
  });
1711
1711
  if (e) {
1712
- if (s = Y({
1712
+ if (s = X({
1713
1713
  containerElement: e,
1714
1714
  direction: r,
1715
1715
  isRtl: i,
1716
1716
  scrollOffset: s
1717
1717
  }), typeof e.scrollTo != "function") {
1718
1718
  let e = w(s);
1719
- Z(_, e) || v(e);
1719
+ Rt(_, e) || v(e);
1720
1720
  }
1721
1721
  return s;
1722
1722
  }
@@ -1727,26 +1727,26 @@ function Ut({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1727
1727
  stopIndexVisible: x
1728
1728
  };
1729
1729
  }
1730
- function Wt(e) {
1731
- return B(() => e, Object.values(e));
1730
+ function Gt(e) {
1731
+ return V(() => e, Object.values(e));
1732
1732
  }
1733
- function Gt(e, t) {
1733
+ function Kt(e, t) {
1734
1734
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1735
- return Z(n, a) && Z(r, o) && Z(i, s);
1735
+ return Rt(n, a) && Rt(r, o) && Rt(i, s);
1736
1736
  }
1737
- function Kt(e) {
1737
+ function qt(e) {
1738
1738
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1739
1739
  }
1740
- var qt = "data-react-window-index";
1741
- function Jt({ 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 }) {
1742
- let m = Wt(u), h = B(() => Ee(s, Gt), [s]), [g, _] = H(null), v = Kt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Ut({
1740
+ var Jt = "data-react-window-index";
1741
+ function Yt({ 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 }) {
1742
+ let m = Gt(u), h = V(() => Ee(s, Kt), [s]), [g, _] = U(null), v = qt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Wt({
1743
1743
  containerElement: g,
1744
1744
  containerStyle: f,
1745
1745
  defaultContainerSize: n,
1746
1746
  direction: "vertical",
1747
1747
  itemCount: c,
1748
1748
  itemProps: m,
1749
- itemSize: B(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1749
+ itemSize: V(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1750
1750
  onResize: i,
1751
1751
  overscanCount: o
1752
1752
  });
@@ -1765,12 +1765,12 @@ function Jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1765
1765
  top: r
1766
1766
  });
1767
1767
  }
1768
- }), [g, x]), Mt(() => {
1768
+ }), [g, x]), J(() => {
1769
1769
  if (!g) return;
1770
1770
  let e = Array.from(g.children).filter((e, t) => {
1771
1771
  if (e.hasAttribute("aria-hidden")) return !1;
1772
1772
  let n = `${S + t}`;
1773
- return e.setAttribute(qt, n), !0;
1773
+ return e.setAttribute(Jt, n), !0;
1774
1774
  });
1775
1775
  if (v) return l.observeRowElements(e);
1776
1776
  }, [
@@ -1779,7 +1779,7 @@ function Jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1779
1779
  l,
1780
1780
  S,
1781
1781
  w
1782
- ]), z(() => {
1782
+ ]), B(() => {
1783
1783
  S >= 0 && w >= 0 && a && a({
1784
1784
  startIndex: C,
1785
1785
  stopIndex: T
@@ -1794,7 +1794,7 @@ function Jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1794
1794
  w,
1795
1795
  T
1796
1796
  ]);
1797
- let E = B(() => {
1797
+ let E = V(() => {
1798
1798
  let e = [];
1799
1799
  if (c > 0) for (let t = S; t <= w; t++) {
1800
1800
  let n = y(t);
@@ -1825,7 +1825,7 @@ function Jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1825
1825
  m,
1826
1826
  S,
1827
1827
  w
1828
- ]), D = /* @__PURE__ */ P("div", {
1828
+ ]), D = /* @__PURE__ */ I("div", {
1829
1829
  "aria-hidden": !0,
1830
1830
  style: {
1831
1831
  height: b(),
@@ -1847,7 +1847,7 @@ function Jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1847
1847
  }
1848
1848
  }, E, e, D);
1849
1849
  }
1850
- var Yt = {
1850
+ var Xt = {
1851
1851
  search: "_search_5skzl_1",
1852
1852
  divider: "_divider_5skzl_5",
1853
1853
  item: "_item_5skzl_9",
@@ -1856,29 +1856,29 @@ var Yt = {
1856
1856
  stateLabel: "_stateLabel_5skzl_27",
1857
1857
  itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
1858
1858
  itemSelectedText: "_itemSelectedText_5skzl_41"
1859
- }, Xt = 44, Zt = 8, Qt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
1860
- let p = r[e], h = kt(p.iconUrl, p.type, p.displayName ?? p.id, _.SM), g = p.id === i;
1861
- return /* @__PURE__ */ P("div", {
1859
+ }, Zt = 44, Qt = 8, $t = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
1860
+ let p = r[e], h = jt(p.iconUrl, p.type, p.displayName ?? p.id, _.SM), g = p.id === i;
1861
+ return /* @__PURE__ */ I("div", {
1862
1862
  style: t,
1863
1863
  ...n,
1864
- children: /* @__PURE__ */ P(m, {
1864
+ children: /* @__PURE__ */ I(m, {
1865
1865
  type: "button",
1866
1866
  "aria-current": g ? "true" : void 0,
1867
- className: l(Yt.item, "h-full w-full gap-3 px-4", g && u && Yt.itemSelectedBackground, g && d && Yt.itemSelectedText, s, g && c, U.modelMenuItem, g && U.modelMenuItemSelected),
1868
- iconBefore: /* @__PURE__ */ P("span", {
1869
- className: Yt.itemIcon,
1867
+ className: l(Xt.item, "h-full w-full gap-3 px-4", g && u && Xt.itemSelectedBackground, g && d && Xt.itemSelectedText, s, g && c, W.modelMenuItem, g && W.modelMenuItemSelected),
1868
+ iconBefore: /* @__PURE__ */ I("span", {
1869
+ className: Xt.itemIcon,
1870
1870
  children: h
1871
1871
  }),
1872
- label: /* @__PURE__ */ F("span", {
1872
+ label: /* @__PURE__ */ L("span", {
1873
1873
  className: "flex flex-1 items-center justify-between gap-2",
1874
- children: [/* @__PURE__ */ P(C, {
1874
+ children: [/* @__PURE__ */ I(C, {
1875
1875
  text: p.displayName ?? p.id,
1876
1876
  query: o,
1877
1877
  maxLines: 1,
1878
1878
  className: l(a, "min-w-0 flex-1 text-start")
1879
- }), g && /* @__PURE__ */ P(me, {
1879
+ }), g && /* @__PURE__ */ I(me, {
1880
1880
  size: _.SM,
1881
- className: Yt.checkIcon,
1881
+ className: Xt.checkIcon,
1882
1882
  "aria-hidden": !0,
1883
1883
  stroke: v
1884
1884
  })]
@@ -1886,12 +1886,12 @@ var Yt = {
1886
1886
  onClick: () => f(p.id)
1887
1887
  })
1888
1888
  });
1889
- }, $t = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _ }) => {
1890
- let [v, y] = H("");
1891
- z(() => {
1889
+ }, en = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _ }) => {
1890
+ let [v, y] = U("");
1891
+ B(() => {
1892
1892
  e || y("");
1893
1893
  }, [e]);
1894
- let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? Ot(a, v) : [], T = (e) => {
1894
+ let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? At(a, v) : [], T = (e) => {
1895
1895
  s(e), i();
1896
1896
  }, E = _?.colors, D = c({
1897
1897
  "--ci-sheet-divider": g?.divider,
@@ -1903,38 +1903,38 @@ var Yt = {
1903
1903
  "--ci-sheet-selected-bg": E?.selectedItemBackground,
1904
1904
  "--ci-sheet-selected-text": E?.selectedItemText
1905
1905
  });
1906
- return /* @__PURE__ */ P(W, {
1906
+ return /* @__PURE__ */ I(G, {
1907
1907
  isOpen: e,
1908
1908
  title: t,
1909
1909
  closeLabel: n,
1910
1910
  onClose: i,
1911
1911
  style: p,
1912
1912
  titleClassName: m,
1913
- className: l("max-h-[80dvh]", _?.className, U.modelMenu),
1913
+ className: l("max-h-[80dvh]", _?.className, W.modelMenu),
1914
1914
  colors: g?.shell,
1915
- children: /* @__PURE__ */ F("div", {
1915
+ children: /* @__PURE__ */ L("div", {
1916
1916
  className: "contents",
1917
1917
  style: D,
1918
- children: [x && !S && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("div", {
1918
+ children: [x && !S && /* @__PURE__ */ L(ce, { children: [/* @__PURE__ */ I("div", {
1919
1919
  style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
1920
- className: l("flex-shrink-0 px-4 py-[10px]", Yt.search, _?.searchHeaderClassName, U.modelMenuSearch),
1921
- children: /* @__PURE__ */ P(j, {
1920
+ className: l("flex-shrink-0 px-4 py-[10px]", Xt.search, _?.searchHeaderClassName, W.modelMenuSearch),
1921
+ children: /* @__PURE__ */ I(ne, {
1922
1922
  value: v,
1923
1923
  placeholder: r,
1924
1924
  size: b.Standard,
1925
1925
  onChange: (e) => y(e ?? "")
1926
1926
  })
1927
- }), /* @__PURE__ */ P("div", { className: l(Yt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ P(Et, { loadingLabel: u }) : C ? /* @__PURE__ */ P("div", {
1927
+ }), /* @__PURE__ */ I("div", { className: l(Xt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ I(Ot, { loadingLabel: u }) : C ? /* @__PURE__ */ I("div", {
1928
1928
  role: "list",
1929
- className: l(Yt.stateLabel, h, "px-4 py-4"),
1929
+ className: l(Xt.stateLabel, h, "px-4 py-4"),
1930
1930
  children: C
1931
- }) : /* @__PURE__ */ P(Jt, {
1931
+ }) : /* @__PURE__ */ I(Yt, {
1932
1932
  role: "list",
1933
1933
  className: "overflow-y-auto",
1934
- style: { height: Math.min(w.length, Zt) * Xt },
1935
- rowComponent: Qt,
1934
+ style: { height: Math.min(w.length, Qt) * Zt },
1935
+ rowComponent: $t,
1936
1936
  rowCount: w.length,
1937
- rowHeight: Xt,
1937
+ rowHeight: Zt,
1938
1938
  rowProps: {
1939
1939
  items: w,
1940
1940
  selectedDeploymentId: o,
@@ -1949,8 +1949,8 @@ var Yt = {
1949
1949
  })]
1950
1950
  })
1951
1951
  });
1952
- }, en = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: p, onPickerOpenChange: h }) => {
1953
- let [g, b] = H(!1), { selectorIcon: x, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: ee, onOpenChange: O } = jt({
1952
+ }, tn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: p, onPickerOpenChange: h }) => {
1953
+ let [g, b] = U(!1), { selectorIcon: x, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: O, onOpenChange: k } = Nt({
1954
1954
  deployments: e,
1955
1955
  selectedDeploymentId: t,
1956
1956
  onDeploymentChange: n,
@@ -1958,36 +1958,36 @@ var Yt = {
1958
1958
  styles: i
1959
1959
  });
1960
1960
  if (!e) return null;
1961
- let k = a || c, te = k ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, A = /* @__PURE__ */ P(he, {
1961
+ let A = a || c, j = A ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, M = /* @__PURE__ */ I(he, {
1962
1962
  size: _.SM,
1963
- className: l(J.modelSelectorCaret, U.modelSelectorCaret),
1963
+ className: l(q.modelSelectorCaret, W.modelSelectorCaret),
1964
1964
  "aria-hidden": !0,
1965
1965
  stroke: v
1966
- }), j = /* @__PURE__ */ P("span", {
1967
- className: l("flex shrink-0 items-center", U.modelSelectorIcon),
1966
+ }), N = /* @__PURE__ */ I("span", {
1967
+ className: l("flex shrink-0 items-center", W.modelSelectorIcon),
1968
1968
  children: x
1969
1969
  });
1970
- if (o) return /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P(S, {
1970
+ if (o) return /* @__PURE__ */ L(ce, { children: [/* @__PURE__ */ I(S, {
1971
1971
  tooltipProps: { tooltip: w },
1972
- icon: /* @__PURE__ */ F("div", {
1972
+ icon: /* @__PURE__ */ L("div", {
1973
1973
  className: "flex items-center gap-1",
1974
- children: [j, A]
1974
+ children: [N, M]
1975
1975
  }),
1976
1976
  "aria-label": C,
1977
- "aria-disabled": k || void 0,
1977
+ "aria-disabled": A || void 0,
1978
1978
  onClick: () => {
1979
- k || b(!0);
1979
+ A || b(!0);
1980
1980
  },
1981
- className: l("w-[50px]", J.modelSelectorButton, te, U.modelSelectorButton)
1982
- }), d ? /* @__PURE__ */ P(W, {
1981
+ className: l("w-[50px]", q.modelSelectorButton, j, W.modelSelectorButton)
1982
+ }), d ? /* @__PURE__ */ I(G, {
1983
1983
  isOpen: g,
1984
1984
  title: r?.ariaLabel ?? "Select model",
1985
1985
  closeLabel: r?.closeLabel ?? "Close",
1986
1986
  onClose: () => b(!1),
1987
1987
  style: u,
1988
- className: l(i?.className, U.modelMenu),
1988
+ className: l(i?.className, W.modelMenu),
1989
1989
  children: d(() => b(!1))
1990
- }) : /* @__PURE__ */ P($t, {
1990
+ }) : /* @__PURE__ */ I(en, {
1991
1991
  isOpen: g,
1992
1992
  title: r?.ariaLabel ?? "Select model",
1993
1993
  closeLabel: r?.closeLabel ?? "Close",
@@ -2004,7 +2004,7 @@ var Yt = {
2004
2004
  })] });
2005
2005
  if (d) {
2006
2006
  let e = T ? `${w} · ${T}` : w;
2007
- return /* @__PURE__ */ P(y, {
2007
+ return /* @__PURE__ */ I(y, {
2008
2008
  placement: "top-end",
2009
2009
  matchReferenceWidth: !1,
2010
2010
  open: f,
@@ -2012,110 +2012,110 @@ var Yt = {
2012
2012
  trigger: [],
2013
2013
  outsideClosable: !0,
2014
2014
  renderOverlay: () => d(() => h?.(!1)),
2015
- listClassName: l("!w-[368px] !bg-layer-raised", i?.className, U.modelMenu),
2016
- children: /* @__PURE__ */ P(m, {
2015
+ listClassName: l("!w-[368px] !bg-layer-raised", i?.className, W.modelMenu),
2016
+ children: /* @__PURE__ */ I(m, {
2017
2017
  "aria-label": C,
2018
- "aria-disabled": k || void 0,
2018
+ "aria-disabled": A || void 0,
2019
2019
  tooltipProps: { tooltip: e },
2020
- className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 ps-1.5 pe-2", J.modelSelectorButton, te, k && J.modelSelectorButtonDisabled, U.modelSelectorButton),
2020
+ className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 ps-1.5 pe-2", q.modelSelectorButton, j, A && q.modelSelectorButtonDisabled, W.modelSelectorButton),
2021
2021
  onClick: () => {
2022
- k || p?.();
2022
+ A || p?.();
2023
2023
  },
2024
- iconBefore: j,
2025
- iconAfter: A,
2024
+ iconBefore: N,
2025
+ iconAfter: M,
2026
2026
  textClassName: "min-w-0",
2027
- label: /* @__PURE__ */ F("span", {
2027
+ label: /* @__PURE__ */ L("span", {
2028
2028
  className: "flex max-w-[180px] min-w-0 items-baseline gap-1",
2029
- children: [/* @__PURE__ */ P("span", {
2030
- className: l("dial-small-text max-w-[180px] shrink-0 truncate", J.modelSelectorName),
2029
+ children: [/* @__PURE__ */ I("span", {
2030
+ className: l("dial-small-text max-w-[180px] shrink-0 truncate", q.modelSelectorName),
2031
2031
  children: w
2032
- }), T && /* @__PURE__ */ P("span", {
2033
- className: l("dial-tiny-text min-w-0 truncate", J.modelSelectorVersion),
2032
+ }), T && /* @__PURE__ */ I("span", {
2033
+ className: l("dial-tiny-text min-w-0 truncate", q.modelSelectorVersion),
2034
2034
  children: T
2035
2035
  })]
2036
2036
  })
2037
2037
  })
2038
2038
  });
2039
2039
  }
2040
- return /* @__PURE__ */ P("div", {
2041
- className: l(te),
2042
- "aria-disabled": k || void 0,
2043
- children: /* @__PURE__ */ P(y, {
2040
+ return /* @__PURE__ */ I("div", {
2041
+ className: l(j),
2042
+ "aria-disabled": A || void 0,
2043
+ children: /* @__PURE__ */ I(y, {
2044
2044
  items: E,
2045
2045
  menuHeader: D,
2046
2046
  placement: "bottom-end",
2047
2047
  matchReferenceWidth: !1,
2048
2048
  maxDropdownHeight: s,
2049
- listClassName: l("!w-[240px]", i?.className, U.modelMenu),
2050
- listStyle: ee,
2051
- disabled: k,
2052
- onOpenChange: k ? void 0 : O,
2053
- children: /* @__PURE__ */ P(m, {
2049
+ listClassName: l("!w-[240px]", i?.className, W.modelMenu),
2050
+ listStyle: O,
2051
+ disabled: A,
2052
+ onOpenChange: A ? void 0 : k,
2053
+ children: /* @__PURE__ */ I(m, {
2054
2054
  "aria-label": C,
2055
- "aria-disabled": k || void 0,
2055
+ "aria-disabled": A || void 0,
2056
2056
  tooltipProps: { tooltip: w },
2057
- iconBefore: j,
2058
- iconAfter: A,
2059
- className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", J.modelSelectorButton, k && J.modelSelectorButtonDisabled, U.modelSelectorButton)
2057
+ iconBefore: N,
2058
+ iconAfter: M,
2059
+ className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", q.modelSelectorButton, A && q.modelSelectorButtonDisabled, W.modelSelectorButton)
2060
2060
  })
2061
2061
  })
2062
2062
  });
2063
- }, tn = Te(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: h, attachLabel: g = "Attach file", fileAccept: b, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: ee, expandLabel: O, clickLabel: k, sendLabel: te, sendTooltip: A, emptyMessageTooltip: j, stopLabel: ne, micLabel: re = "Dictate", recordVoiceLabel: ie = "Record voice", stopRecordingLabel: ae, discardRecordingLabel: oe, colors: M, typography: se, attachmentTray: ce, modelMenu: le, className: de, pendingDropFiles: fe = [], onDropFilesConsumed: pe, pendingAttachments: me = [], onPendingAttachmentsConsumed: he, pasteTextThreshold: ge = 4e3, maxMessageLength: L = 5e4, deployments: ye, selectedDeploymentId: be, onDeploymentChange: xe, modelSelectorLabels: Se, initialAttachments: Ce = [], hideAddButton: we = !1, hideAttachFile: Te = !1, hideActionBar: Ee = !1, actionRowLayout: De = rt.Stacked, isInlineActionRowAllowedBelowDesktop: Ae = !1, renderFooterActions: W, isInputDisabled: G = !1, isModelSelectorDisabled: Me = !1, isSendDisabled: Ne = !1, isAudioMessageSupported: Pe = !1, isVoiceRecordingSupported: Fe = Pe, onTranscribeAudio: Re, transcribingLabel: ze, voiceErrorLabel: He, sendOnEnter: Ue = nt.Enter, prefixAttachments: qe = [], onRemovePrefixAttachment: Ze, chatSettings: Qe, toolsMenuItems: $e, onToolToggle: et, canRemoveTools: it = !0, toolsMenuTitle: at, toolsBackLabel: ot, toolsChipLabels: st, menuOverlays: ct, activeMentions: lt, onBackspaceAtCaret: ut, caretPositionOverride: dt, commandMenu: K, autoFocus: ft = !1, messageHistory: pt, onDialFileSystemClick: q, dialFileSystemLabel: ht, validateAttachment: _t, onAttachmentClick: vt, modelPickerOverlay: yt, maximumAttachmentsAmount: bt, onAttachmentsLimitExceeded: wt, isAttachmentsEnabled: Tt = !0, isTextAttachmentsAllowed: Et = !0, usageLimitsSlot: Dt, onMessageTooLong: Ot }, kt) => {
2064
- let At = d(), [jt, Mt] = H(!1), Nt = Be(pt), Pt = lt ?? [], Ft = Pt.length > 0, It = B(() => c({
2065
- "--ci-bg": M?.background,
2066
- "--ci-text": M?.text,
2067
- "--ci-border": M?.border,
2068
- "--ci-border-focus": M?.borderFocus,
2069
- "--ci-placeholder": M?.placeholder,
2070
- "--ci-text-disabled": M?.textDisabled,
2071
- "--ci-model-selector-caret-color": M?.modelSelectorCaret,
2072
- "--ci-model-selector-hover-bg": M?.modelSelectorHoverBg,
2073
- "--ci-model-selector-disabled-color": M?.modelSelectorDisabled,
2074
- "--ci-model-selector-name-color": M?.modelSelectorName,
2075
- "--ci-model-selector-version-color": M?.modelSelectorVersion,
2076
- "--ci-voice-waveform": M?.voiceWaveform,
2077
- "--ci-voice-accent": M?.voiceAccent,
2078
- "--ci-mention-highlight-bg": M?.mentionHighlightBg,
2079
- "--ci-mention-highlight-text": M?.mentionHighlightText,
2080
- "--ci-mention-highlight-unsupported-bg": M?.mentionHighlightUnsupportedBg,
2081
- "--ci-mention-highlight-unsupported-text": M?.mentionHighlightUnsupportedText
2082
- }), [M]), Lt = B(() => q ? [{
2063
+ }, nn = Te(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: u, onAttachmentsChange: p, placeholder: m = "Type a message...", ariaLabel: h, attachLabel: g = "Attach file", fileAccept: b, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: O, expandLabel: k, clickLabel: A, sendLabel: j, sendTooltip: M, emptyMessageTooltip: N, stopLabel: ee, micLabel: te = "Dictate", recordVoiceLabel: ne = "Record voice", stopRecordingLabel: re, discardRecordingLabel: ie, colors: P, typography: ae, attachmentTray: F, modelMenu: oe, className: se, pendingDropFiles: ue = [], onDropFilesConsumed: de, pendingAttachments: pe = [], onPendingAttachmentsConsumed: me, pasteTextThreshold: he = 4e3, maxMessageLength: R = 5e4, deployments: ve, selectedDeploymentId: ye, onDeploymentChange: be, modelSelectorLabels: xe, initialAttachments: Se = [], hideAddButton: Ce = !1, hideAttachFile: we = !1, hideActionBar: Te = !1, actionRowLayout: Ee = it.Stacked, isInlineActionRowAllowedBelowDesktop: De = !1, renderFooterActions: Ae, isInputDisabled: G = !1, isModelSelectorDisabled: je = !1, isSendDisabled: Ne = !1, isAudioMessageSupported: Pe = !1, isVoiceRecordingSupported: Fe = Pe, onTranscribeAudio: Ie, transcribingLabel: ze, voiceErrorLabel: Be, sendOnEnter: Ue = rt.Enter, prefixAttachments: We = [], onRemovePrefixAttachment: Je, chatSettings: Qe, toolsMenuItems: $e, onToolToggle: et, canRemoveTools: tt = !0, toolsMenuTitle: at, toolsBackLabel: ot, toolsChipLabels: st, menuOverlays: ct, activeMentions: lt, onBackspaceAtCaret: ut, caretPositionOverride: dt, commandMenu: K, autoFocus: ft = !1, messageHistory: pt, onDialFileSystemClick: mt, dialFileSystemLabel: gt, validateAttachment: _t, onAttachmentClick: yt, modelPickerOverlay: bt, maximumAttachmentsAmount: xt, onAttachmentsLimitExceeded: St, isAttachmentsEnabled: Et = !0, isTextAttachmentsAllowed: Dt = !0, usageLimitsSlot: Ot, onMessageTooLong: kt }, At) => {
2064
+ let jt = d(), [Mt, Nt] = U(!1), J = Ve(pt), Pt = lt ?? [], Ft = Pt.length > 0, It = V(() => c({
2065
+ "--ci-bg": P?.background,
2066
+ "--ci-text": P?.text,
2067
+ "--ci-border": P?.border,
2068
+ "--ci-border-focus": P?.borderFocus,
2069
+ "--ci-placeholder": P?.placeholder,
2070
+ "--ci-text-disabled": P?.textDisabled,
2071
+ "--ci-model-selector-caret-color": P?.modelSelectorCaret,
2072
+ "--ci-model-selector-hover-bg": P?.modelSelectorHoverBg,
2073
+ "--ci-model-selector-disabled-color": P?.modelSelectorDisabled,
2074
+ "--ci-model-selector-name-color": P?.modelSelectorName,
2075
+ "--ci-model-selector-version-color": P?.modelSelectorVersion,
2076
+ "--ci-voice-waveform": P?.voiceWaveform,
2077
+ "--ci-voice-accent": P?.voiceAccent,
2078
+ "--ci-mention-highlight-bg": P?.mentionHighlightBg,
2079
+ "--ci-mention-highlight-text": P?.mentionHighlightText,
2080
+ "--ci-mention-highlight-unsupported-bg": P?.mentionHighlightUnsupportedBg,
2081
+ "--ci-mention-highlight-unsupported-text": P?.mentionHighlightUnsupportedText
2082
+ }), [P]), Lt = V(() => mt ? [{
2083
2083
  key: "dial-fs",
2084
- label: ht ?? "DIAL file system",
2085
- icon: /* @__PURE__ */ P(_e, {
2084
+ label: gt ?? "DIAL file system",
2085
+ icon: /* @__PURE__ */ I(ge, {
2086
2086
  size: f,
2087
2087
  "aria-hidden": !0,
2088
2088
  stroke: v
2089
2089
  }),
2090
- onClick: q
2091
- }] : [], [q, ht]), { message: Y, setMessage: X, textareaRef: Z } = Ge({
2090
+ onClick: mt
2091
+ }] : [], [mt, gt]), { message: Y, setMessage: X, textareaRef: Z } = Ke({
2092
2092
  messageProp: e,
2093
2093
  messageRevision: t
2094
2094
  });
2095
- z(() => {
2095
+ B(() => {
2096
2096
  let e = Z.current;
2097
2097
  e != null && e.value.length !== 0 && document.activeElement === e && e.setSelectionRange(e.value.length, e.value.length);
2098
- }, [Z]), z(() => {
2098
+ }, [Z]), B(() => {
2099
2099
  n !== void 0 && Z.current?.focus();
2100
- }, [n, Z]), Oe(kt, () => ({ getCaretPosition: () => Z.current?.selectionStart ?? Y.length }), [Y, Z]);
2101
- let { handleUndoKeyDown: Rt, markCaretPlaced: zt } = Je({
2100
+ }, [n, Z]), Oe(At, () => ({ getCaretPosition: () => Z.current?.selectionStart ?? Y.length }), [Y, Z]);
2101
+ let { handleUndoKeyDown: Rt, markCaretPlaced: zt } = Ye({
2102
2102
  insertion: r,
2103
2103
  textareaRef: Z
2104
- }), { isMenuOpen: Bt, query: Vt, activeWordStart: Q, dismiss: Ht, closeOnOutsidePress: Ut, handleCaretMove: Wt, handleValueChange: Gt, listboxId: Kt, overlayRef: qt, activeOptionId: Jt, moveActiveOption: Yt, getActiveOption: Xt } = Le({
2104
+ }), { isMenuOpen: Bt, query: Vt, activeWordStart: Q, dismiss: Ht, closeOnOutsidePress: Ut, handleCaretMove: Wt, handleValueChange: Gt, listboxId: Kt, overlayRef: qt, activeOptionId: Jt, moveActiveOption: Yt, getActiveOption: Xt } = Re({
2105
2105
  config: K,
2106
2106
  message: Y
2107
- }), Zt = V(Wt);
2107
+ }), Zt = H(Wt);
2108
2108
  Zt.current = Wt;
2109
2109
  let Qt = () => {
2110
2110
  Wt(Z.current?.selectionStart ?? Y.length);
2111
- }, $t = V(!1), tn = () => {
2111
+ }, $t = H(!1), en = () => {
2112
2112
  $t.current ? $t.current = !1 : requestAnimationFrame(() => {
2113
2113
  let e = Z.current;
2114
2114
  Zt.current(e?.selectionStart ?? e?.value.length ?? 0);
2115
2115
  });
2116
2116
  }, nn = (e) => {
2117
2117
  (e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && Wt(e.currentTarget.selectionStart ?? Y.length);
2118
- }, rn = K?.emptyQueryHint != null, an = K != null && Q != null ? Q + K.triggerPrefix.length : null, on = an != null && Y.slice(an).split("\n", 1)[0] !== "", sn = rn && Bt && Vt === "" && an != null && !on, cn = K != null && Bt ? Q ?? 0 : null, ln = V(null), un = V(null), [dn, fn] = H(null), pn = R(() => {
2118
+ }, rn = K?.emptyQueryHint != null, an = K != null && Q != null ? Q + K.triggerPrefix.length : null, on = an != null && Y.slice(an).split("\n", 1)[0] !== "", sn = rn && Bt && Vt === "" && an != null && !on, cn = K != null && Bt ? Q ?? 0 : null, ln = H(null), un = H(null), [dn, fn] = U(null), pn = z(() => {
2119
2119
  let e = ln.current, t = un.current;
2120
2120
  if (e == null || t == null) {
2121
2121
  fn(null);
@@ -2127,7 +2127,7 @@ var Yt = {
2127
2127
  top: n.top - r.top
2128
2128
  });
2129
2129
  }, []);
2130
- z(() => {
2130
+ B(() => {
2131
2131
  if (cn == null) return;
2132
2132
  let e = Z.current;
2133
2133
  if (e == null || typeof ResizeObserver > "u") return;
@@ -2138,12 +2138,12 @@ var Yt = {
2138
2138
  Z,
2139
2139
  pn
2140
2140
  ]);
2141
- let mn = R((e) => {
2141
+ let mn = z((e) => {
2142
2142
  if (K == null || (Ht(), !e?.consumeQuery) || (e.returnFocus !== !1 && Z.current?.focus(), Q == null)) return;
2143
2143
  let t = `${K.triggerPrefix}${Vt}`, n = Q + t.length;
2144
2144
  if (Y.slice(Q, n) !== t) return;
2145
2145
  let r = Y.slice(0, Q) + Y.slice(n);
2146
- X(r), Nt.notifyChange(), u?.(r);
2146
+ X(r), J.notifyChange(), u?.(r);
2147
2147
  }, [
2148
2148
  K,
2149
2149
  Ht,
@@ -2151,59 +2151,59 @@ var Yt = {
2151
2151
  Y,
2152
2152
  Q,
2153
2153
  X,
2154
- Nt,
2154
+ J,
2155
2155
  u,
2156
2156
  Z
2157
- ]), hn = V(void 0);
2158
- z(() => {
2157
+ ]), hn = H(void 0);
2158
+ B(() => {
2159
2159
  dt != null && hn.current !== t && (hn.current = t, Z.current?.setSelectionRange(dt, dt), zt(), Wt(dt));
2160
2160
  }, [Y]);
2161
- let gn = V(Y);
2161
+ let gn = H(Y);
2162
2162
  gn.current = Y;
2163
- let { attachments: _n, buildAttachments: vn, addAttachments: yn, resetAttachments: bn, handleRemove: xn, handleRetry: Sn, handleExpand: Cn, hasBlockedAttachments: wn } = je({
2164
- initialAttachments: Ce,
2163
+ let { attachments: _n, buildAttachments: vn, addAttachments: yn, resetAttachments: bn, handleRemove: xn, handleRetry: Sn, handleExpand: Cn, hasBlockedAttachments: wn } = Me({
2164
+ initialAttachments: Se,
2165
2165
  onUploadAttachment: a,
2166
2166
  onAttachmentsChange: p,
2167
2167
  validateAttachment: _t,
2168
- pendingDropFiles: fe,
2169
- onDropFilesConsumed: pe,
2168
+ pendingDropFiles: ue,
2169
+ onDropFilesConsumed: de,
2170
2170
  isDropDisabled: G,
2171
- pendingAttachments: me,
2172
- onPendingAttachmentsConsumed: he,
2173
- onExpandPastedText: R((e) => {
2171
+ pendingAttachments: pe,
2172
+ onPendingAttachmentsConsumed: me,
2173
+ onExpandPastedText: z((e) => {
2174
2174
  let t = gn.current, n = t ? `${t}\n${e}` : e;
2175
2175
  gn.current = n, X(n), u?.(n);
2176
2176
  }, [X, u]),
2177
- maximumAttachmentsAmount: bt,
2178
- baseAttachmentsAmount: qe.length,
2179
- onAttachmentsLimitExceeded: wt
2180
- }), Tn = R((e) => {
2177
+ maximumAttachmentsAmount: xt,
2178
+ baseAttachmentsAmount: We.length,
2179
+ onAttachmentsLimitExceeded: St
2180
+ }), Tn = z((e) => {
2181
2181
  yn(vn([e]));
2182
- }, [yn, vn]), En = V(!1), [Dn, On] = H({
2182
+ }, [yn, vn]), En = H(!1), [Dn, On] = U({
2183
2183
  text: "",
2184
2184
  revision: 0
2185
- }), { state: kn, analyserNodeRef: An, errorMessage: jn, startRecording: Mn, stopRecording: Nn, discardRecording: Pn } = tt({
2185
+ }), { state: kn, analyserNodeRef: An, errorMessage: jn, startRecording: Mn, stopRecording: Nn, discardRecording: Pn } = nt({
2186
2186
  onAttachAudio: Tn,
2187
- onTranscribeAudio: Re,
2188
- onTranscript: R((e) => {
2187
+ onTranscribeAudio: Ie,
2188
+ onTranscript: z((e) => {
2189
2189
  let t = e.trim();
2190
2190
  if (t) {
2191
2191
  let e = gn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2192
2192
  gn.current = n, X(n), On((e) => ({
2193
2193
  text: t,
2194
2194
  revision: e.revision + 1
2195
- })), Nt.notifyChange(), u?.(n);
2195
+ })), J.notifyChange(), u?.(n);
2196
2196
  }
2197
2197
  En.current = !0;
2198
2198
  }, [
2199
2199
  X,
2200
- Nt,
2200
+ J,
2201
2201
  u
2202
2202
  ]),
2203
- errorLabel: He
2204
- }), $ = kn === Ye.Recording || kn === Ye.Processing;
2205
- z(() => {
2206
- if (kn === Ye.Error || kn === Ye.Idle && En.current) {
2203
+ errorLabel: Be
2204
+ }), $ = kn === Xe.Recording || kn === Xe.Processing;
2205
+ B(() => {
2206
+ if (kn === Xe.Error || kn === Xe.Idle && En.current) {
2207
2207
  En.current = !1;
2208
2208
  let e = Z.current;
2209
2209
  if (e != null) {
@@ -2213,41 +2213,41 @@ var Yt = {
2213
2213
  }
2214
2214
  }
2215
2215
  }, [kn, Z]);
2216
- let Fn = V(null), In = V(null), Ln = Tt && Et, { handlePaste: Rn } = ue(yn, Ln ? ge : Infinity), zn = R((e) => {
2216
+ let Fn = H(null), In = H(null), Ln = Et && Dt, { handlePaste: Rn } = fe(yn, Ln ? he : Infinity), zn = z((e) => {
2217
2217
  if (!Ln) {
2218
2218
  let t = e.clipboardData.getData("text/plain");
2219
- t.length >= L && Ot?.(t.length, L);
2219
+ t.length >= R && kt?.(t.length, R);
2220
2220
  }
2221
2221
  if (Rn(e), e.defaultPrevented) return;
2222
2222
  let t = e.clipboardData.getData("text/plain").replace(/\r\n?/g, "\n");
2223
2223
  t !== "" && K?.onTextPaste?.(t);
2224
2224
  }, [
2225
2225
  Ln,
2226
- L,
2227
- Ot,
2226
+ R,
2227
+ kt,
2228
2228
  Rn,
2229
2229
  K
2230
- ]), Bn = Y.trim().length > 0 || _n.length > 0, Vn = Bn && !wn && !Ne && !$, [Hn, Un] = H([]), Wn = ($e ?? []).map((e) => e.id).join("|");
2231
- z(() => {
2230
+ ]), Bn = Y.trim().length > 0 || _n.length > 0, Vn = Bn && !wn && !Ne && !$, [Hn, Un] = U([]), Wn = ($e ?? []).map((e) => e.id).join("|");
2231
+ B(() => {
2232
2232
  Un([]);
2233
2233
  }, [Wn]);
2234
- let Gn = B(() => {
2234
+ let Gn = V(() => {
2235
2235
  let e = $e ?? [];
2236
- return it ? e.filter((e) => e.isSelected || !Hn.includes(e.id)) : e;
2236
+ return tt ? e.filter((e) => e.isSelected || !Hn.includes(e.id)) : e;
2237
2237
  }, [
2238
2238
  $e,
2239
2239
  Hn,
2240
- it
2241
- ]), Kn = R((e) => {
2240
+ tt
2241
+ ]), Kn = z((e) => {
2242
2242
  Un((t) => t.includes(e) ? t : [...t, e]), $e?.find((t) => t.id === e)?.isSelected && et?.(e);
2243
- }, [$e, et]), qn = ye === void 0 || be != null, Jn = Pe && !s, Yn = async () => {
2243
+ }, [$e, et]), qn = ve === void 0 || ye != null, Jn = Pe && !s, Yn = async () => {
2244
2244
  if (Ne || $) return;
2245
- if (Y.length >= L) {
2246
- Ot?.(Y.length, L);
2245
+ if (Y.length >= R) {
2246
+ kt?.(Y.length, R);
2247
2247
  return;
2248
2248
  }
2249
2249
  let e = Y, t = _n;
2250
- X(""), Nt.reset();
2250
+ X(""), J.reset();
2251
2251
  try {
2252
2252
  await i?.(e, t), t.forEach((e) => {
2253
2253
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
@@ -2255,10 +2255,10 @@ var Yt = {
2255
2255
  } catch {
2256
2256
  X(e), bn(t);
2257
2257
  }
2258
- }, Xn = (e) => Ue === nt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Zn = (e) => {
2258
+ }, Xn = (e) => Ue === rt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Zn = (e) => {
2259
2259
  if (!Bt || e.nativeEvent.isComposing) return !1;
2260
2260
  if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Ht(), !0;
2261
- if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Yt(e.key === "ArrowDown" ? Ie.Next : Ie.Previous), !0;
2261
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Yt(e.key === "ArrowDown" ? Le.Next : Le.Previous), !0;
2262
2262
  if (e.key !== "Enter" || e.shiftKey) return !1;
2263
2263
  let t = Xt();
2264
2264
  return t == null ? Xn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
@@ -2266,7 +2266,7 @@ var Yt = {
2266
2266
  if (!$ && !Rt(e) && !Zn(e)) {
2267
2267
  if (!e.nativeEvent.isComposing && !G && !s) {
2268
2268
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2269
- let t = e.currentTarget.selectionStart ?? 0, n = Nt.navigate(e.key === "ArrowUp" ? "up" : "down", Y, t);
2269
+ let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", Y, t);
2270
2270
  if (n !== null) {
2271
2271
  e.preventDefault(), X(n);
2272
2272
  return;
@@ -2277,7 +2277,7 @@ var Yt = {
2277
2277
  if (t != null) {
2278
2278
  e.preventDefault();
2279
2279
  let n = e.currentTarget;
2280
- n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ke(n, Y.slice(0, t.start) + Y.slice(t.start + t.length), t.start);
2280
+ n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || qe(n, Y.slice(0, t.start) + Y.slice(t.start + t.length), t.start);
2281
2281
  return;
2282
2282
  }
2283
2283
  }
@@ -2289,19 +2289,19 @@ var Yt = {
2289
2289
  if (t.length === 0) return;
2290
2290
  let n = vn(t);
2291
2291
  e.target.value = "", yn(n);
2292
- }, er = B(() => {
2292
+ }, er = V(() => {
2293
2293
  let e = [];
2294
2294
  return cn != null && e.push({
2295
2295
  offset: cn,
2296
- node: /* @__PURE__ */ P("span", {
2296
+ node: /* @__PURE__ */ I("span", {
2297
2297
  ref: ln,
2298
2298
  "aria-hidden": !0,
2299
2299
  className: "inline-block h-lh w-0 align-text-top"
2300
2300
  }, "caret-marker")
2301
2301
  }), sn && K != null && an != null && e.push({
2302
2302
  offset: an,
2303
- node: /* @__PURE__ */ P("span", {
2304
- className: J.commandHint,
2303
+ node: /* @__PURE__ */ I("span", {
2304
+ className: q.commandHint,
2305
2305
  "aria-hidden": !0,
2306
2306
  "data-mirror-synthetic": !0,
2307
2307
  children: K.emptyQueryHint
@@ -2312,7 +2312,7 @@ var Yt = {
2312
2312
  sn,
2313
2313
  K,
2314
2314
  an
2315
- ]), tr = Ft || er.length > 0, { mirrorRef: nr, selectionRects: rr, updateSelectionRects: ir, syncMirrorToTextarea: ar } = We({
2315
+ ]), tr = Ft || er.length > 0, { mirrorRef: nr, selectionRects: rr, updateSelectionRects: ir, syncMirrorToTextarea: ar } = Ge({
2316
2316
  textareaRef: Z,
2317
2317
  message: Y,
2318
2318
  isMirrorActive: tr
@@ -2324,13 +2324,13 @@ var Yt = {
2324
2324
  cn,
2325
2325
  Y
2326
2326
  ]);
2327
- let or = /* @__PURE__ */ P("textarea", {
2328
- className: l(J.textarea, tr && J.textareaMentionMode, se?.fontClassName || "dial-body-paragraph-text", "relative z-0 [field-sizing:content] max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
2327
+ let or = /* @__PURE__ */ I("textarea", {
2328
+ className: l(q.textarea, tr && q.textareaMentionMode, ae?.fontClassName || "dial-body-paragraph-text", "relative z-0 [field-sizing:content] max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent ps-1 pe-1 outline-hidden", "disabled:cursor-not-allowed"),
2329
2329
  ref: Z,
2330
2330
  autoFocus: ft,
2331
2331
  value: Y,
2332
2332
  onChange: (e) => {
2333
- X(e.target.value), Nt.notifyChange();
2333
+ X(e.target.value), J.notifyChange();
2334
2334
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2335
2335
  Gt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2336
2336
  },
@@ -2338,7 +2338,7 @@ var Yt = {
2338
2338
  onScroll: () => {
2339
2339
  ar(), cn != null && pn();
2340
2340
  },
2341
- onFocus: tn,
2341
+ onFocus: en,
2342
2342
  onClick: Qt,
2343
2343
  onKeyDown: Qn,
2344
2344
  onKeyUp: nn,
@@ -2352,14 +2352,14 @@ var Yt = {
2352
2352
  disabled: G,
2353
2353
  readOnly: $,
2354
2354
  rows: 1
2355
- }), sr = /* @__PURE__ */ F(N, { children: [or, K != null && /* @__PURE__ */ P("div", {
2355
+ }), sr = /* @__PURE__ */ L(ce, { children: [or, K != null && /* @__PURE__ */ I("div", {
2356
2356
  "aria-hidden": !0,
2357
- className: l("pointer-events-none absolute", se?.fontClassName || "dial-body-paragraph-text"),
2357
+ className: l("pointer-events-none absolute", ae?.fontClassName || "dial-body-paragraph-text"),
2358
2358
  style: {
2359
2359
  left: dn?.left ?? 0,
2360
2360
  top: dn?.top ?? 0
2361
2361
  },
2362
- children: /* @__PURE__ */ P(y, {
2362
+ children: /* @__PURE__ */ I(y, {
2363
2363
  open: Bt,
2364
2364
  onOpenChange: (e) => {
2365
2365
  e || Ut();
@@ -2371,7 +2371,7 @@ var Yt = {
2371
2371
  outsidePressIgnoreRef: Z,
2372
2372
  renderOverlay: () => {
2373
2373
  let e = K.menuLabel != null;
2374
- return /* @__PURE__ */ P("div", {
2374
+ return /* @__PURE__ */ I("div", {
2375
2375
  ref: qt,
2376
2376
  role: e ? "group" : void 0,
2377
2377
  "aria-label": K.menuLabel,
@@ -2384,18 +2384,18 @@ var Yt = {
2384
2384
  })
2385
2385
  });
2386
2386
  },
2387
- children: /* @__PURE__ */ P("span", {
2387
+ children: /* @__PURE__ */ I("span", {
2388
2388
  "aria-hidden": !0,
2389
2389
  className: "inline-block h-lh w-0"
2390
2390
  })
2391
2391
  })
2392
- })] }), cr = /* @__PURE__ */ F("div", {
2392
+ })] }), cr = /* @__PURE__ */ L("div", {
2393
2393
  ref: un,
2394
2394
  className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
2395
- children: [tr && /* @__PURE__ */ F("div", {
2395
+ children: [tr && /* @__PURE__ */ L("div", {
2396
2396
  ref: nr,
2397
- className: l(J.textarea, se?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 [overflow-wrap:anywhere] whitespace-pre-wrap"),
2398
- children: [Ve(Y, Pt, er, J.mentionHighlight, J.mentionHighlightUnsupported), rr.map((e, t) => /* @__PURE__ */ P("div", {
2397
+ className: l(q.textarea, ae?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 [overflow-wrap:anywhere] whitespace-pre-wrap"),
2398
+ children: [He(Y, Pt, er, q.mentionHighlight, q.mentionHighlightUnsupported), rr.map((e, t) => /* @__PURE__ */ I("div", {
2399
2399
  "aria-hidden": !0,
2400
2400
  className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
2401
2401
  style: {
@@ -2406,8 +2406,8 @@ var Yt = {
2406
2406
  }
2407
2407
  }, `selection-${t}`))]
2408
2408
  }), sr]
2409
- }), lr = we ? void 0 : /* @__PURE__ */ P(mt, {
2410
- onAttachClick: Te ? void 0 : () => Fn.current?.click(),
2409
+ }), lr = Ce ? void 0 : /* @__PURE__ */ I(ht, {
2410
+ onAttachClick: we ? void 0 : () => Fn.current?.click(),
2411
2411
  attachLabel: g,
2412
2412
  addMenuTitle: C,
2413
2413
  menuTitle: w,
@@ -2416,58 +2416,58 @@ var Yt = {
2416
2416
  isDisabled: G || $,
2417
2417
  chatSettings: Qe,
2418
2418
  extraMenuItems: Lt,
2419
- onRecordVoice: Fe && Tt && !s && !$ ? () => Mn(Xe.Attachment) : void 0,
2420
- recordVoiceLabel: ie,
2421
- toolsMenuItems: it ? $e : void 0,
2419
+ onRecordVoice: Fe && Et && !s && !$ ? () => Mn(Ze.Attachment) : void 0,
2420
+ recordVoiceLabel: ne,
2421
+ toolsMenuItems: tt ? $e : void 0,
2422
2422
  onToolToggle: et,
2423
2423
  toolsMenuTitle: at,
2424
2424
  toolsBackLabel: ot,
2425
2425
  menuOverlays: ct,
2426
2426
  getCaretPosition: () => Z.current?.selectionStart ?? Y.length
2427
- }), ur = De === rt.Inline && (!At || Ae), dr = lr && /* @__PURE__ */ P("div", {
2428
- className: l("flex", U.addCluster),
2427
+ }), ur = Ee === it.Inline && (!jt || De), dr = lr && /* @__PURE__ */ I("div", {
2428
+ className: l("flex", W.addCluster),
2429
2429
  children: lr
2430
- }), fr = Gn.length > 0 && et != null && /* @__PURE__ */ P("div", {
2431
- className: l("min-w-0 flex-1", U.toolsChips),
2432
- children: /* @__PURE__ */ P(gt, {
2430
+ }), fr = Gn.length > 0 && et != null && /* @__PURE__ */ I("div", {
2431
+ className: l("min-w-0 flex-1", W.toolsChips),
2432
+ children: /* @__PURE__ */ I(vt, {
2433
2433
  items: Gn,
2434
2434
  onToolToggle: et,
2435
2435
  onToolDismiss: Kn,
2436
- canRemove: it,
2436
+ canRemove: tt,
2437
2437
  removeLabel: st?.removeLabel,
2438
2438
  stateOnLabel: st?.stateOnLabel,
2439
2439
  stateOffLabel: st?.stateOffLabel
2440
2440
  })
2441
2441
  });
2442
- return /* @__PURE__ */ F("div", {
2442
+ return /* @__PURE__ */ L("div", {
2443
2443
  ref: In,
2444
2444
  style: It,
2445
- className: l(J.wrapper, G && J.wrapperDisabled, G && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", de, U.wrapper),
2445
+ className: l(q.wrapper, G && q.wrapperDisabled, G && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "p-4 focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", se, W.wrapper),
2446
2446
  children: [
2447
- (qe.length > 0 || _n.length > 0) && /* @__PURE__ */ P(I, {
2448
- attachments: [...qe, ..._n],
2447
+ (We.length > 0 || _n.length > 0) && /* @__PURE__ */ I(le, {
2448
+ attachments: [...We, ..._n],
2449
2449
  onRemove: (e) => {
2450
- qe.some((t) => t.id === e) ? Ze?.(e) : xn(e);
2450
+ We.some((t) => t.id === e) ? Je?.(e) : xn(e);
2451
2451
  },
2452
2452
  onRetry: Sn,
2453
2453
  onExpand: Cn,
2454
2454
  labels: {
2455
2455
  removeLabel: E,
2456
2456
  retryLabel: D,
2457
- uploadingLabel: ee,
2458
- expandLabel: O,
2459
- clickLabel: k
2457
+ uploadingLabel: O,
2458
+ expandLabel: k,
2459
+ clickLabel: A
2460
2460
  },
2461
2461
  styles: {
2462
- ...ce,
2463
- className: l(_n.length > 6 && "-me-4", ce?.className)
2462
+ ...F,
2463
+ className: l(_n.length > 6 && "-me-4", F?.className)
2464
2464
  },
2465
- onAttachmentClick: vt == null ? void 0 : (e) => {
2466
- let t = [...qe, ..._n].find((t) => t.id === e);
2467
- t != null && vt(t);
2465
+ onAttachmentClick: yt == null ? void 0 : (e) => {
2466
+ let t = [...We, ..._n].find((t) => t.id === e);
2467
+ t != null && yt(t);
2468
2468
  }
2469
2469
  }),
2470
- !we && /* @__PURE__ */ P("input", {
2470
+ !Ce && /* @__PURE__ */ I("input", {
2471
2471
  ref: Fn,
2472
2472
  type: "file",
2473
2473
  multiple: !0,
@@ -2477,127 +2477,127 @@ var Yt = {
2477
2477
  tabIndex: -1,
2478
2478
  onChange: $n
2479
2479
  }),
2480
- jn && /* @__PURE__ */ P("div", {
2480
+ jn && /* @__PURE__ */ I("div", {
2481
2481
  role: "alert",
2482
2482
  className: "min-w-0 px-1 wrap-break-word",
2483
- children: /* @__PURE__ */ P(x, { text: jn })
2483
+ children: /* @__PURE__ */ I(x, { text: jn })
2484
2484
  }),
2485
- $ && /* @__PURE__ */ P(xt, {
2485
+ $ && /* @__PURE__ */ I(Ct, {
2486
2486
  embedded: !0,
2487
2487
  state: kn,
2488
2488
  analyserNodeRef: An,
2489
2489
  onStop: Nn,
2490
2490
  onDiscard: Pn,
2491
2491
  attachButton: lr,
2492
- stopLabel: ae,
2493
- discardLabel: oe,
2492
+ stopLabel: re,
2493
+ discardLabel: ie,
2494
2494
  processingLabel: ze
2495
2495
  }),
2496
- !$ && Ee && cr,
2497
- !$ && !Ee && ur && fr && /* @__PURE__ */ P("div", {
2496
+ !$ && Te && cr,
2497
+ !$ && !Te && ur && fr && /* @__PURE__ */ I("div", {
2498
2498
  className: "flex",
2499
2499
  children: fr
2500
2500
  }),
2501
- !$ && !Ee && /* @__PURE__ */ F("div", {
2502
- className: l("flex items-center gap-2", ur ? "flex-nowrap" : "flex-wrap", U.actionRow),
2501
+ !$ && !Te && /* @__PURE__ */ L("div", {
2502
+ className: l("flex items-center gap-2", ur ? "flex-nowrap" : "flex-wrap", W.actionRow),
2503
2503
  children: [
2504
2504
  ur && dr,
2505
- /* @__PURE__ */ P("div", {
2506
- className: l("flex min-w-0 items-center self-stretch", ur ? "flex-1" : "w-full", U.textareaWrap),
2505
+ /* @__PURE__ */ I("div", {
2506
+ className: l("flex min-w-0 items-center self-stretch", ur ? "flex-1" : "w-full", W.textareaWrap),
2507
2507
  children: cr
2508
2508
  }),
2509
2509
  !ur && dr,
2510
2510
  !ur && fr,
2511
- /* @__PURE__ */ P("div", {
2512
- className: l("ms-auto flex flex-shrink-0 items-center gap-2", U.footerActions),
2513
- children: W ? W({
2511
+ /* @__PURE__ */ I("div", {
2512
+ className: l("ms-auto flex flex-shrink-0 items-center gap-2", W.footerActions),
2513
+ children: Ae ? Ae({
2514
2514
  canSend: Vn,
2515
2515
  onSend: Yn
2516
- }) : /* @__PURE__ */ F(N, { children: [
2517
- Dt,
2518
- /* @__PURE__ */ P(en, {
2519
- deployments: ye,
2520
- selectedDeploymentId: be,
2521
- onDeploymentChange: xe,
2522
- modelSelectorLabels: Se,
2523
- menuStyles: le,
2516
+ }) : /* @__PURE__ */ L(ce, { children: [
2517
+ Ot,
2518
+ /* @__PURE__ */ I(tn, {
2519
+ deployments: ve,
2520
+ selectedDeploymentId: ye,
2521
+ onDeploymentChange: be,
2522
+ modelSelectorLabels: xe,
2523
+ menuStyles: oe,
2524
2524
  isStreaming: s,
2525
- isMobile: At,
2526
- isDisabled: Me,
2525
+ isMobile: jt,
2526
+ isDisabled: je,
2527
2527
  style: It,
2528
- modelPickerOverlay: yt,
2529
- isPickerOpen: jt,
2530
- onPickerToggle: () => Mt((e) => !e),
2531
- onPickerOpenChange: Mt
2528
+ modelPickerOverlay: bt,
2529
+ isPickerOpen: Mt,
2530
+ onPickerToggle: () => Nt((e) => !e),
2531
+ onPickerOpenChange: Nt
2532
2532
  }),
2533
- Jn && /* @__PURE__ */ P(S, {
2534
- icon: /* @__PURE__ */ P(ve, {
2533
+ Jn && /* @__PURE__ */ I(S, {
2534
+ icon: /* @__PURE__ */ I(_e, {
2535
2535
  size: _.LG,
2536
2536
  stroke: v,
2537
2537
  "aria-hidden": !0
2538
2538
  }),
2539
- "aria-label": re,
2540
- tooltipProps: { tooltip: re },
2539
+ "aria-label": te,
2540
+ tooltipProps: { tooltip: te },
2541
2541
  className: "size-[40px] shrink-0 mobile:min-h-11 mobile:min-w-11",
2542
- onClick: () => Mn(Xe.Dictation),
2542
+ onClick: () => Mn(Ze.Dictation),
2543
2543
  disabled: G || s
2544
2544
  }),
2545
- s && o ? /* @__PURE__ */ P(Ct, {
2545
+ s && o ? /* @__PURE__ */ I(Tt, {
2546
2546
  onStop: o,
2547
- ariaLabel: ne
2548
- }) : !s && /* @__PURE__ */ P(St, {
2547
+ ariaLabel: ee
2548
+ }) : !s && /* @__PURE__ */ I(wt, {
2549
2549
  onSend: Yn,
2550
2550
  isDisabled: !qn || !Vn,
2551
- ariaLabel: te,
2552
- sendTooltip: Bn ? A : j ?? A
2551
+ ariaLabel: j,
2552
+ sendTooltip: Bn ? M : N ?? M
2553
2553
  })
2554
2554
  ] })
2555
2555
  })
2556
2556
  ]
2557
2557
  }),
2558
- /* @__PURE__ */ P("span", {
2558
+ /* @__PURE__ */ I("span", {
2559
2559
  className: "sr-only",
2560
2560
  role: "status",
2561
2561
  "aria-live": "polite",
2562
2562
  "aria-atomic": "true",
2563
- children: /* @__PURE__ */ P("span", { children: Dn.text }, Dn.revision)
2563
+ children: /* @__PURE__ */ I("span", { children: Dn.text }, Dn.revision)
2564
2564
  })
2565
2565
  ]
2566
2566
  });
2567
2567
  });
2568
- tn.displayName = "Input";
2569
- var nn = {
2568
+ nn.displayName = "Input";
2569
+ var rn = {
2570
2570
  welcome: "_welcome_1icyo_1",
2571
2571
  description: "_description_1icyo_5"
2572
- }, rn = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
2572
+ }, an = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, aboveInputSlot: a, styles: o, className: s, inputClassName: u, isInputDisabled: d = !1, ...f }) => {
2573
2573
  let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
2574
2574
  "--ci-welcome-color": p?.welcomeText,
2575
2575
  "--ci-description-color": p?.descriptionText
2576
2576
  });
2577
- return /* @__PURE__ */ F("div", {
2577
+ return /* @__PURE__ */ L("div", {
2578
2578
  style: _,
2579
2579
  className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
2580
2580
  children: [
2581
- n && /* @__PURE__ */ F("div", {
2581
+ n && /* @__PURE__ */ L("div", {
2582
2582
  className: "flex flex-col items-center gap-4 text-center",
2583
- children: [/* @__PURE__ */ P("h1", {
2584
- className: l(nn.welcome, "m-0", m?.welcomeClassName || "dial-display2-text"),
2583
+ children: [/* @__PURE__ */ I("h1", {
2584
+ className: l(rn.welcome, "m-0", m?.welcomeClassName || "dial-display2-text"),
2585
2585
  children: n
2586
- }), r && /* @__PURE__ */ P("p", {
2587
- className: l(nn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
2586
+ }), r && /* @__PURE__ */ I("p", {
2587
+ className: l(rn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
2588
2588
  children: r
2589
2589
  })]
2590
2590
  }),
2591
- i != null && /* @__PURE__ */ P("div", {
2591
+ i != null && /* @__PURE__ */ I("div", {
2592
2592
  className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
2593
2593
  children: i
2594
2594
  }),
2595
- /* @__PURE__ */ F("div", {
2595
+ /* @__PURE__ */ L("div", {
2596
2596
  className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
2597
- children: [a != null && /* @__PURE__ */ P("div", {
2597
+ children: [a != null && /* @__PURE__ */ I("div", {
2598
2598
  className: "mb-2",
2599
2599
  children: a
2600
- }), /* @__PURE__ */ P(tn, {
2600
+ }), /* @__PURE__ */ I(nn, {
2601
2601
  placeholder: t,
2602
2602
  isStreaming: e,
2603
2603
  isInputDisabled: d,
@@ -2611,36 +2611,36 @@ var nn = {
2611
2611
  })
2612
2612
  ]
2613
2613
  });
2614
- }, an = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: p, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: y, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: E = "Add", attachLabel: D = "Attach file", menuTitle: ee = "Menu", menuCloseLabel: k = "Close", className: te, pendingDropFiles: A, onDropFilesConsumed: j, validateAttachment: ne, isAttachmentsEnabled: re, isTextAttachmentsAllowed: ie, hideAttachFile: ae = !1, fileAccept: oe, maximumAttachmentsAmount: M, onAttachmentsLimitExceeded: se, onDialFileSystemClick: N, dialFileSystemLabel: I, pendingAttachments: ce, onPendingAttachmentsConsumed: le, onAttachmentClick: ue, pasteTextThreshold: de, maxMessageLength: fe = 5e4, onMessageTooLong: pe }) => {
2615
- let me = V(null), he = V(null), [ge, ve] = H([]);
2616
- z(() => {
2617
- A?.length && (ve(A), j?.());
2618
- }, [A, j]);
2619
- let [L, ye] = H(e ?? ""), [be, xe] = H([]), [Se, Ce] = H(d), we = be.some((e) => e.status === a.Loading || e.status === a.Error), Te = (L.trim().length > 0 || be.length > 0 || Se.length > 0) && !we, Ee = (e) => {
2620
- Ce((t) => t.filter((t) => t.id !== e));
2621
- }, De = R((e, t) => {
2622
- m(e, Se, t);
2623
- }, [Se, m]), Oe = () => {
2624
- Te && (L.length >= fe ? pe?.(L.length, fe) : De(L, be));
2625
- }, ke = R(() => ve([]), []), U = R((e) => {
2626
- ye(e), n?.(e);
2627
- }, [n]), Ae = R((e) => {
2614
+ }, on = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: u, initialAttachments: d = [], onCancel: p, onSave: m, onUploadAttachment: h, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: y, removeLabel: b, retryLabel: x, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: E = "Add", attachLabel: D = "Attach file", menuTitle: O = "Menu", menuCloseLabel: k = "Close", className: A, pendingDropFiles: j, onDropFilesConsumed: N, validateAttachment: ee, isAttachmentsEnabled: te, isTextAttachmentsAllowed: ne, hideAttachFile: re = !1, fileAccept: ie, maximumAttachmentsAmount: P, onAttachmentsLimitExceeded: ae, onDialFileSystemClick: F, dialFileSystemLabel: oe, pendingAttachments: se, onPendingAttachmentsConsumed: ce, onAttachmentClick: le, pasteTextThreshold: ue, maxMessageLength: de = 5e4, onMessageTooLong: fe }) => {
2615
+ let pe = H(null), me = H(null), [he, R] = U([]);
2616
+ B(() => {
2617
+ j?.length && (R(j), N?.());
2618
+ }, [j, N]);
2619
+ let [_e, ve] = U(e ?? ""), [ye, be] = U([]), [xe, Se] = U(d), Ce = ye.some((e) => e.status === a.Loading || e.status === a.Error), we = (_e.trim().length > 0 || ye.length > 0 || xe.length > 0) && !Ce, Te = (e) => {
2620
+ Se((t) => t.filter((t) => t.id !== e));
2621
+ }, Ee = z((e, t) => {
2622
+ m(e, xe, t);
2623
+ }, [xe, m]), De = () => {
2624
+ we && (_e.length >= de ? fe?.(_e.length, de) : Ee(_e, ye));
2625
+ }, Oe = z(() => R([]), []), ke = z((e) => {
2626
+ ve(e), n?.(e);
2627
+ }, [n]), W = z((e) => {
2628
2628
  let t = Array.from(e.target.files ?? []);
2629
- t.length !== 0 && (e.target.value = "", ve(t));
2630
- }, []), W = B(() => N ? [{
2629
+ t.length !== 0 && (e.target.value = "", R(t));
2630
+ }, []), Ae = V(() => F ? [{
2631
2631
  key: "dial-fs",
2632
- label: I ?? "DIAL file system",
2633
- icon: /* @__PURE__ */ P(_e, {
2632
+ label: oe ?? "DIAL file system",
2633
+ icon: /* @__PURE__ */ I(ge, {
2634
2634
  size: f,
2635
2635
  "aria-hidden": !0,
2636
2636
  stroke: v
2637
2637
  }),
2638
- onClick: N
2639
- }] : [], [N, I]);
2640
- return /* @__PURE__ */ F("div", {
2641
- className: l("flex w-full flex-col gap-2", te),
2642
- children: [/* @__PURE__ */ P(tn, {
2643
- ref: he,
2638
+ onClick: F
2639
+ }] : [], [F, oe]);
2640
+ return /* @__PURE__ */ L("div", {
2641
+ className: l("flex w-full flex-col gap-2", A),
2642
+ children: [/* @__PURE__ */ I(nn, {
2643
+ ref: me,
2644
2644
  message: e,
2645
2645
  messageRevision: t,
2646
2646
  activeMentions: r,
@@ -2650,119 +2650,107 @@ var nn = {
2650
2650
  ariaLabel: y,
2651
2651
  hideActionBar: !0,
2652
2652
  sendOnEnter: u,
2653
- pendingDropFiles: ge,
2654
- onDropFilesConsumed: ke,
2655
- onSend: De,
2653
+ pendingDropFiles: he,
2654
+ onDropFilesConsumed: Oe,
2655
+ onSend: Ee,
2656
2656
  onUploadAttachment: h,
2657
- onChange: U,
2658
- onAttachmentsChange: xe,
2657
+ onChange: ke,
2658
+ onAttachmentsChange: be,
2659
2659
  removeLabel: b,
2660
2660
  retryLabel: x,
2661
2661
  uploadingLabel: S,
2662
2662
  expandLabel: C,
2663
2663
  clickLabel: w,
2664
2664
  className: "max-w-full",
2665
- prefixAttachments: Se,
2666
- onRemovePrefixAttachment: Ee,
2667
- validateAttachment: ne,
2668
- isAttachmentsEnabled: re,
2669
- isTextAttachmentsAllowed: ie,
2670
- maximumAttachmentsAmount: M,
2671
- onAttachmentsLimitExceeded: se,
2672
- pendingAttachments: ce,
2673
- onPendingAttachmentsConsumed: le,
2674
- onAttachmentClick: ue,
2675
- pasteTextThreshold: de,
2676
- maxMessageLength: fe,
2677
- onMessageTooLong: pe
2678
- }), /* @__PURE__ */ F("div", {
2665
+ prefixAttachments: xe,
2666
+ onRemovePrefixAttachment: Te,
2667
+ validateAttachment: ee,
2668
+ isAttachmentsEnabled: te,
2669
+ isTextAttachmentsAllowed: ne,
2670
+ maximumAttachmentsAmount: P,
2671
+ onAttachmentsLimitExceeded: ae,
2672
+ pendingAttachments: se,
2673
+ onPendingAttachmentsConsumed: ce,
2674
+ onAttachmentClick: le,
2675
+ pasteTextThreshold: ue,
2676
+ maxMessageLength: de,
2677
+ onMessageTooLong: fe
2678
+ }), /* @__PURE__ */ L("div", {
2679
2679
  className: "flex items-center justify-between",
2680
- children: [/* @__PURE__ */ F("div", {
2680
+ children: [/* @__PURE__ */ L("div", {
2681
2681
  className: "flex",
2682
- children: [!ae && /* @__PURE__ */ P("input", {
2683
- ref: me,
2682
+ children: [!re && /* @__PURE__ */ I("input", {
2683
+ ref: pe,
2684
2684
  type: "file",
2685
2685
  multiple: !0,
2686
- accept: oe,
2686
+ accept: ie,
2687
2687
  className: "sr-only",
2688
2688
  "aria-hidden": !0,
2689
2689
  tabIndex: -1,
2690
- onChange: Ae
2691
- }), (!ae || (c?.length ?? 0) > 0) && /* @__PURE__ */ P(mt, {
2692
- onAttachClick: ae ? void 0 : () => me.current?.click(),
2690
+ onChange: W
2691
+ }), (!re || (c?.length ?? 0) > 0) && /* @__PURE__ */ I(ht, {
2692
+ onAttachClick: re ? void 0 : () => pe.current?.click(),
2693
2693
  attachLabel: D,
2694
2694
  addMenuTitle: E,
2695
- menuTitle: ee,
2695
+ menuTitle: O,
2696
2696
  menuCloseLabel: k,
2697
- extraMenuItems: W,
2697
+ extraMenuItems: Ae,
2698
2698
  menuOverlays: c,
2699
- getCaretPosition: () => he.current?.getCaretPosition() ?? 0
2699
+ getCaretPosition: () => me.current?.getCaretPosition() ?? 0
2700
2700
  })]
2701
- }), /* @__PURE__ */ F("div", {
2701
+ }), /* @__PURE__ */ L("div", {
2702
2702
  className: "flex gap-2",
2703
- children: [/* @__PURE__ */ P(T, {
2703
+ children: [/* @__PURE__ */ I(T, {
2704
2704
  label: g,
2705
2705
  onClick: p
2706
- }), /* @__PURE__ */ P(O, {
2706
+ }), /* @__PURE__ */ I(M, {
2707
2707
  label: _,
2708
- onClick: Oe,
2709
- disabled: !Te
2708
+ onClick: De,
2709
+ disabled: !we
2710
2710
  })]
2711
2711
  })]
2712
2712
  })]
2713
2713
  });
2714
- }, on = /* @__PURE__ */ function(e) {
2714
+ }, sn = /* @__PURE__ */ function(e) {
2715
2715
  return e.Warning = "warning", e.Reached = "reached", e;
2716
- }({}), sn = {
2717
- [on.Warning]: {
2718
- Icon: fe,
2719
- className: "text-warning"
2720
- },
2721
- [on.Reached]: {
2722
- Icon: de,
2723
- className: "text-error"
2724
- }
2725
- }, cn = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", className: s }) => {
2726
- let { Icon: c, className: u } = sn[e];
2727
- return /* @__PURE__ */ F("div", {
2716
+ }({}), cn = {
2717
+ [sn.Warning]: k.Warning,
2718
+ [sn.Reached]: k.Error
2719
+ }, ln = ({ severity: e, limitText: t, reset: n, onClose: r, closeAriaLabel: i = "Close notification", limitTextClassName: a = "dial-small-paragraph-semi-text", resetTextClassName: o = "dial-small-paragraph-text", className: s }) => {
2720
+ let c = /* @__PURE__ */ I("span", {
2721
+ className: a,
2722
+ children: t
2723
+ }), u = n != null && /* @__PURE__ */ L(ce, { children: [
2724
+ " ",
2725
+ /* @__PURE__ */ I("time", {
2726
+ dateTime: n.isoValue,
2727
+ "aria-hidden": n.ariaLabel != null || void 0,
2728
+ className: o,
2729
+ children: n.label
2730
+ }),
2731
+ n.ariaLabel != null && /* @__PURE__ */ I("span", {
2732
+ className: "sr-only",
2733
+ children: n.ariaLabel
2734
+ })
2735
+ ] });
2736
+ return /* @__PURE__ */ I(D, {
2728
2737
  role: "status",
2729
- className: l("relative flex items-center justify-between gap-3 rounded-xl border border-transparent bg-layer-sunken p-3 text-primary", U.usageBanner, s),
2730
- children: [/* @__PURE__ */ F("div", {
2731
- className: "flex min-w-0 flex-1 items-start gap-3",
2732
- children: [/* @__PURE__ */ P("span", {
2733
- "aria-hidden": "true",
2734
- className: l("flex shrink-0", u),
2735
- children: /* @__PURE__ */ P(c, { size: 24 })
2736
- }), /* @__PURE__ */ F("div", {
2737
- className: "flex min-w-0 flex-row flex-wrap items-baseline gap-x-1 wrap-break-word text-primary",
2738
- children: [/* @__PURE__ */ P("span", {
2739
- className: a,
2740
- children: t
2741
- }), n != null && /* @__PURE__ */ F(N, { children: [
2742
- " ",
2743
- /* @__PURE__ */ P("time", {
2744
- dateTime: n.isoValue,
2745
- "aria-hidden": n.ariaLabel != null || void 0,
2746
- className: o,
2747
- children: n.label
2748
- }),
2749
- n.ariaLabel != null && /* @__PURE__ */ P("span", {
2750
- className: "sr-only",
2751
- children: n.ariaLabel
2752
- })
2753
- ] })]
2754
- })]
2755
- }), r != null && /* @__PURE__ */ P(g, {
2738
+ variant: cn[e],
2739
+ type: O.SectionMessage,
2740
+ title: u ? c : void 0,
2741
+ message: u || c,
2742
+ className: l("bg-layer-sunken", W.usageBanner, s),
2743
+ children: r != null && /* @__PURE__ */ I(g, {
2756
2744
  className: "shrink-0 self-start",
2757
2745
  ariaLabel: i,
2758
2746
  onClose: () => r()
2759
- })]
2747
+ })
2760
2748
  });
2761
- }, ln = (e) => {
2762
- let [t, n] = H({
2749
+ }, un = (e) => {
2750
+ let [t, n] = U({
2763
2751
  text: e?.text,
2764
2752
  revision: e?.revision ?? 0
2765
- }), r = R((e) => {
2753
+ }), r = z((e) => {
2766
2754
  n((t) => ({
2767
2755
  text: e,
2768
2756
  revision: t.revision + 1
@@ -2773,11 +2761,11 @@ var nn = {
2773
2761
  messageRevision: t.revision,
2774
2762
  seedMessage: r
2775
2763
  };
2776
- }, un = (e, t) => {
2777
- let n = V(e), r = V(t);
2778
- r.current = t, z(() => {
2764
+ }, dn = (e, t) => {
2765
+ let n = H(e), r = H(t);
2766
+ r.current = t, B(() => {
2779
2767
  e !== n.current && (n.current = e, r.current());
2780
2768
  }, [e]);
2781
2769
  };
2782
2770
  //#endregion
2783
- export { rt as ActionRowLayout, W as BottomSheetShell, U as CONVERSATION_INPUT_CLASS, dt as ChatSettingsModal, rn as ConversationInput, an as EditMessageInput, tn as Input, nt as SendOnEnter, on as UsageLimitBannerSeverity, cn as UsageLimitBannerView, ln as useComposerSeed, un as useComposerSeedSource };
2771
+ export { it as ActionRowLayout, G as BottomSheetShell, W as CONVERSATION_INPUT_CLASS, K as ChatSettingsModal, an as ConversationInput, on as EditMessageInput, nn as Input, rt as SendOnEnter, sn as UsageLimitBannerSeverity, ln as UsageLimitBannerView, un as useComposerSeed, dn as useComposerSeedSource };