@epam/ai-dial-conversation-input 1.2.0-dev.233 → 1.2.0-dev.239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +674 -674
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,12 +1,12 @@
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, Button as p, ButtonVariant as m, CloseButton as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as y, ErrorText as b, GhostIconButton as x, Highlight as S, MenuItemMark as C, NeutralButton as w, Popup as T, PopupSize as E, PrimaryButton as D, PrimaryIconButton as O, RadioGroup as k, RadioGroupOrientation as A, Search as j, Skeleton as M, SkeletonVariant as ee, Slider as N, Spinner as te, StaticIconButton as ne, Textarea as P, TextareaResize as F, Tooltip as re } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as ie, IconArrowNarrowRight as ae, IconCheck as oe, IconChevronDown as se, IconChevronRight as ce, IconFile as le, IconMicrophone as ue, IconPaperclip as de, IconPlayerStopFilled as fe, IconPlaystationSquare as pe, IconPlus as me, IconSettings as he, IconTool as ge, IconX as _e } from "@tabler/icons-react";
4
- import { createElement as ve, forwardRef as ye, memo as be, useCallback as I, useEffect as L, useId as xe, useImperativeHandle as Se, useLayoutEffect as Ce, useMemo as R, useRef as z, useState as B } from "react";
5
- import { createPortal as we } from "react-dom";
6
- import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
7
- import { AttachmentTray as Te, MAX_UPLOADS_PER_MINUTE as Ee, generateAttachmentId as De, useClipboardPaste as Oe } from "@epam/ai-dial-attachment-input";
2
+ import { BASE_ICON_SIZE as f, Button as p, ButtonVariant as m, CloseButton as h, DIAL_ICON_SIZE as g, DIAL_KIT_ICON_STROKE as _, Dropdown as v, ElementSize as y, ErrorText as b, GhostIconButton as x, Highlight as S, MenuItemMark as C, NeutralButton as w, NeutralIconButton as T, Popup as E, PopupSize as D, PrimaryButton as ee, PrimaryIconButton as O, RadioGroup as k, RadioGroupOrientation as te, Search as A, Skeleton as ne, SkeletonVariant as j, Slider as re, Spinner as ie, Textarea as M, TextareaResize as N, Tooltip as ae } from "@epam/ai-dial-ui-kit";
3
+ import { IconArrowLeft as oe, IconArrowNarrowRight as se, IconCheck as ce, IconChevronDown as le, IconChevronRight as ue, IconFile as de, IconMicrophone as fe, IconPaperclip as pe, IconPlayerStop as me, IconPlus as he, IconSettings as ge, IconTool as _e, IconX as ve } from "@tabler/icons-react";
4
+ import { createElement as ye, forwardRef as be, memo as xe, useCallback as P, useEffect as F, useId as Se, useImperativeHandle as Ce, useLayoutEffect as we, useMemo as I, useRef as L, useState as R } from "react";
5
+ import { createPortal as Te } from "react-dom";
6
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
7
+ import { AttachmentTray as Ee, MAX_UPLOADS_PER_MINUTE as De, generateAttachmentId as Oe, useClipboardPaste as ke } from "@epam/ai-dial-attachment-input";
8
8
  //#region src/constants/public-class-names.ts
9
- var W = {
9
+ var H = {
10
10
  wrapper: "dial-ci-wrapper",
11
11
  actionRow: "dial-ci-action-row",
12
12
  textareaWrap: "dial-ci-textarea-wrap",
@@ -20,24 +20,24 @@ var W = {
20
20
  modelMenuSearch: "dial-ci-model-menu-search",
21
21
  modelMenuItem: "dial-ci-model-menu-item",
22
22
  modelMenuItemSelected: "dial-ci-model-menu-item-selected"
23
- }, ke = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Ae = (e, t, n) => {
24
- L(() => {
23
+ }, Ae = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", je = (e, t, n) => {
24
+ F(() => {
25
25
  if (!e) return;
26
26
  let n = (e) => {
27
27
  e.key === "Escape" && t();
28
28
  };
29
29
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
30
- }, [e, t]), L(() => {
30
+ }, [e, t]), F(() => {
31
31
  if (e) return document.body.style.overflow = "hidden", () => {
32
32
  document.body.style.overflow = "";
33
33
  };
34
- }, [e]), L(() => {
34
+ }, [e]), F(() => {
35
35
  if (!e || n?.current == null) return;
36
36
  let t = n.current, r = document.activeElement instanceof HTMLElement ? document.activeElement : null;
37
- (t.querySelector(ke) ?? t).focus();
37
+ (t.querySelector(Ae) ?? t).focus();
38
38
  let i = (e) => {
39
39
  if (e.key !== "Tab") return;
40
- let n = Array.from(t.querySelectorAll(ke));
40
+ let n = Array.from(t.querySelectorAll(Ae));
41
41
  if (n.length === 0) {
42
42
  e.preventDefault(), t.focus();
43
43
  return;
@@ -49,27 +49,27 @@ var W = {
49
49
  document.removeEventListener("keydown", i), r?.focus();
50
50
  };
51
51
  }, [e, n]);
52
- }, je = {
52
+ }, Me = {
53
53
  backdrop: "_backdrop_1d50f_9",
54
54
  sheet: "_sheet_1d50f_13",
55
55
  "slide-up": "_slide-up_1d50f_1",
56
56
  title: "_title_1d50f_18",
57
57
  divider: "_divider_1d50f_22"
58
- }, Me = ({ 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, children: p }) => {
59
- let m = z(null);
60
- if (Ae(e, r, m), !e || typeof document > "u") return null;
58
+ }, U = ({ 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, children: p }) => {
59
+ let m = L(null);
60
+ if (je(e, r, m), !e || typeof document > "u") return null;
61
61
  let v = c({
62
62
  "--ci-backdrop": f?.backdrop,
63
63
  "--ci-sheet-bg": f?.sheetBg,
64
64
  "--ci-sheet-text": f?.sheetText,
65
65
  "--ci-sheet-divider": f?.divider
66
66
  });
67
- return we(/* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
68
- className: l(je.backdrop, "fixed inset-0 z-[55]"),
67
+ return Te(/* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
68
+ className: l(Me.backdrop, "fixed inset-0 z-[55]"),
69
69
  style: v,
70
70
  onPointerDown: r,
71
71
  "aria-hidden": !0
72
- }), /* @__PURE__ */ U("div", {
72
+ }), /* @__PURE__ */ V("div", {
73
73
  ref: m,
74
74
  role: "dialog",
75
75
  "aria-modal": !0,
@@ -79,14 +79,14 @@ var W = {
79
79
  ...v,
80
80
  ...s
81
81
  },
82
- className: l(je.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
83
- children: [t != null && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ U("div", {
82
+ className: l(Me.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
83
+ children: [t != null && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V("div", {
84
84
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
85
85
  children: [
86
- i && /* @__PURE__ */ H("div", {
86
+ i && /* @__PURE__ */ B("div", {
87
87
  className: "absolute start-4",
88
- children: /* @__PURE__ */ H(x, {
89
- icon: /* @__PURE__ */ H(ie, {
88
+ children: /* @__PURE__ */ B(x, {
89
+ icon: /* @__PURE__ */ B(oe, {
90
90
  size: g.LG,
91
91
  stroke: _,
92
92
  className: "rtl:scale-x-[-1]"
@@ -95,20 +95,20 @@ var W = {
95
95
  onClick: i
96
96
  })
97
97
  }),
98
- /* @__PURE__ */ H("span", {
99
- className: l(je.title, u),
98
+ /* @__PURE__ */ B("span", {
99
+ className: l(Me.title, u),
100
100
  children: t
101
101
  }),
102
- /* @__PURE__ */ H("div", {
102
+ /* @__PURE__ */ B("div", {
103
103
  className: "absolute end-4 m-2",
104
- children: /* @__PURE__ */ H(h, {
104
+ children: /* @__PURE__ */ B(h, {
105
105
  ariaLabel: n,
106
106
  onClose: r,
107
107
  size: y.Standard
108
108
  })
109
109
  })
110
110
  ]
111
- }), /* @__PURE__ */ H("div", { className: l(je.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ H("div", {
111
+ }), /* @__PURE__ */ B("div", { className: l(Me.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ B("div", {
112
112
  className: "overflow-y-auto",
113
113
  children: p
114
114
  })]
@@ -118,18 +118,18 @@ var W = {
118
118
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
119
119
  await Promise.allSettled(i);
120
120
  }, Pe = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: i, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
121
- let [h, g] = B(n), _ = z(h);
122
- L(() => {
121
+ let [h, g] = R(n), _ = L(h);
122
+ F(() => {
123
123
  _.current = h;
124
- }, [h]), L(() => () => {
124
+ }, [h]), F(() => () => {
125
125
  _.current.forEach((e) => {
126
126
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
127
127
  });
128
128
  }, []);
129
- let v = I((e) => e.map((e) => {
129
+ let v = P((e) => e.map((e) => {
130
130
  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;
131
131
  return {
132
- id: De(),
132
+ id: Oe(),
133
133
  name: e.name,
134
134
  contentType: e.type,
135
135
  file: e,
@@ -138,26 +138,26 @@ var W = {
138
138
  previewUrl: i,
139
139
  playUrl: o
140
140
  };
141
- }), []), y = z(i);
142
- L(() => {
141
+ }), []), y = L(i);
142
+ F(() => {
143
143
  y.current = i;
144
144
  }, [i]);
145
- let b = z(!0), x = I((e) => {
145
+ let b = L(!0), x = P((e) => {
146
146
  g((t) => {
147
147
  let n = e(t);
148
148
  return n === t ? t : n;
149
149
  });
150
150
  }, []);
151
- L(() => {
151
+ F(() => {
152
152
  if (b.current) {
153
153
  b.current = !1;
154
154
  return;
155
155
  }
156
156
  y.current?.(h);
157
157
  }, [h]);
158
- let S = I((e) => {
158
+ let S = P((e) => {
159
159
  g(e);
160
- }, []), C = I(async (t) => {
160
+ }, []), C = P(async (t) => {
161
161
  if (r) {
162
162
  x((e) => e.map((e) => e.id === t.id ? {
163
163
  ...e,
@@ -180,7 +180,7 @@ var W = {
180
180
  } : e));
181
181
  }
182
182
  }
183
- }, [r, x]), w = I((e, t = !0) => {
183
+ }, [r, x]), w = P((e, t = !0) => {
184
184
  let n = new Set(_.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
185
185
  if (r.length !== 0) {
186
186
  if (f != null && f > 0 && Number.isFinite(f)) {
@@ -201,7 +201,7 @@ var W = {
201
201
  status: a.Error,
202
202
  errorReason: n
203
203
  } : e));
204
- }), Ne(e, Ee, C);
204
+ }), Ne(e, De, C);
205
205
  }
206
206
  }
207
207
  }, [
@@ -211,8 +211,8 @@ var W = {
211
211
  x,
212
212
  C,
213
213
  o
214
- ]), T = z(/* @__PURE__ */ new WeakSet());
215
- L(() => {
214
+ ]), T = L(/* @__PURE__ */ new WeakSet());
215
+ F(() => {
216
216
  if (s.length === 0) {
217
217
  T.current = /* @__PURE__ */ new WeakSet();
218
218
  return;
@@ -224,13 +224,13 @@ var W = {
224
224
  v,
225
225
  c,
226
226
  s
227
- ]), L(() => {
227
+ ]), F(() => {
228
228
  l.length !== 0 && (w(l, !1), u?.());
229
229
  }, [
230
230
  w,
231
231
  u,
232
232
  l
233
- ]), L(() => {
233
+ ]), F(() => {
234
234
  if (!o) return;
235
235
  let t = !1, n = [], r = _.current.map((r) => {
236
236
  if (r.status === a.Loading) return r;
@@ -257,7 +257,7 @@ var W = {
257
257
  x,
258
258
  C
259
259
  ]);
260
- let E = I((e) => {
260
+ let E = P((e) => {
261
261
  x((t) => {
262
262
  let n = t.find((t) => t.id === e);
263
263
  return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
@@ -269,11 +269,11 @@ var W = {
269
269
  addAttachments: w,
270
270
  resetAttachments: S,
271
271
  handleRemove: E,
272
- handleRetry: I((e) => {
272
+ handleRetry: P((e) => {
273
273
  let t = h.find((t) => t.id === e);
274
274
  t && C(t);
275
275
  }, [h, C]),
276
- handleExpand: I(async (e) => {
276
+ handleExpand: P(async (e) => {
277
277
  let n = h.find((t) => t.id === e);
278
278
  if (!n || n.type !== t.Pasted) return;
279
279
  let r = await n.file.text();
@@ -299,12 +299,12 @@ var W = {
299
299
  }, Le = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Re = "[role=\"option\"]:not([aria-disabled=\"true\"])", ze = /* @__PURE__ */ function(e) {
300
300
  return e.Next = "next", e.Previous = "previous", e;
301
301
  }({}), Be = ({ config: e, message: t }) => {
302
- let [n, r] = B(!1), [i, a] = B(null), [o, s] = B(null), c = z(null);
302
+ let [n, r] = R(!1), [i, a] = R(null), [o, s] = R(null), c = L(null);
303
303
  c.current = i;
304
304
  let l = e != null && i != null && i <= t.length ? (() => {
305
305
  let n = t.slice(i, Fe(t, i));
306
306
  return Le(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
307
- })() : "", u = I((t, n, i) => {
307
+ })() : "", u = P((t, n, i) => {
308
308
  if (e == null || i) return;
309
309
  let { start: c, end: l } = Ie(t, n), u = t.slice(c, l);
310
310
  if (!Le(u, e.triggerPrefix)) {
@@ -317,7 +317,7 @@ var W = {
317
317
  }
318
318
  r(!1);
319
319
  }, [e, o]);
320
- L(() => {
320
+ F(() => {
321
321
  if (e == null) {
322
322
  r(!1), s(null), a(null);
323
323
  return;
@@ -327,11 +327,11 @@ var W = {
327
327
  let i = Math.min(n, t.length);
328
328
  Le(t.slice(i, Fe(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
329
329
  }, [e, t]);
330
- let d = I(() => {
330
+ let d = P(() => {
331
331
  r(!1), s(i);
332
- }, [i]), f = I(() => {
332
+ }, [i]), f = P(() => {
333
333
  r(!1);
334
- }, []), p = I((n) => {
334
+ }, []), p = P((n) => {
335
335
  if (e == null) return;
336
336
  let { start: i, end: s } = Ie(t, n);
337
337
  if (!Le(t.slice(i, s), e.triggerPrefix)) {
@@ -343,11 +343,11 @@ var W = {
343
343
  e,
344
344
  t,
345
345
  o
346
- ]), m = xe(), h = z(null), [g, _] = B(null);
347
- L(() => {
346
+ ]), m = Se(), h = L(null), [g, _] = R(null);
347
+ F(() => {
348
348
  _(null);
349
349
  }, [n, l]);
350
- let v = I(() => Array.from(h.current?.querySelectorAll(Re) ?? []), []), y = I((e) => {
350
+ let v = P(() => Array.from(h.current?.querySelectorAll(Re) ?? []), []), y = P((e) => {
351
351
  let t = v();
352
352
  if (t.length === 0) {
353
353
  _(null);
@@ -355,7 +355,7 @@ var W = {
355
355
  }
356
356
  let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
357
357
  _(r.id), r.scrollIntoView?.({ block: "nearest" });
358
- }, [v, g]), b = I(() => v().find((e) => e.id === g) ?? null, [v, g]);
358
+ }, [v, g]), b = P(() => v().find((e) => e.id === g) ?? null, [v, g]);
359
359
  return {
360
360
  isMenuOpen: n,
361
361
  query: l,
@@ -371,17 +371,17 @@ var W = {
371
371
  getActiveOption: b
372
372
  };
373
373
  }, Ve = (e, t) => !e.slice(0, t).includes("\n"), He = (e, t) => !e.slice(t).includes("\n"), Ue = (e) => {
374
- let t = z(e);
374
+ let t = L(e);
375
375
  t.current = e;
376
- let n = z(-1), r = z(""), i = I((e, i, a) => {
376
+ let n = L(-1), r = L(""), i = P((e, i, a) => {
377
377
  let o = t.current;
378
378
  return !o || o.length === 0 ? null : e === "up" ? !Ve(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 || !He(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
379
- }, []), a = I(() => {
379
+ }, []), a = P(() => {
380
380
  n.current = -1, r.current = "";
381
- }, []), o = I(() => {
381
+ }, []), o = P(() => {
382
382
  n.current = -1, r.current = "";
383
383
  }, []);
384
- return R(() => ({
384
+ return I(() => ({
385
385
  navigate: i,
386
386
  notifyChange: a,
387
387
  reset: o
@@ -395,11 +395,11 @@ var W = {
395
395
  if (n <= t) return;
396
396
  let r = t;
397
397
  o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
398
- t.offset > r && s.push(/* @__PURE__ */ H("span", {
398
+ t.offset > r && s.push(/* @__PURE__ */ B("span", {
399
399
  "aria-hidden": !0,
400
400
  children: e.slice(r, t.offset)
401
401
  }, `text-${l++}`)), s.push(t.node), r = t.offset;
402
- }), r < n && s.push(/* @__PURE__ */ H("span", {
402
+ }), r < n && s.push(/* @__PURE__ */ B("span", {
403
403
  "aria-hidden": !0,
404
404
  children: e.slice(r, n)
405
405
  }, `text-${l++}`));
@@ -407,10 +407,10 @@ var W = {
407
407
  return a.forEach((t, n) => {
408
408
  if (u(c, t.start), t.start + t.length <= c) return;
409
409
  let a = e.slice(t.start, t.start + t.length);
410
- s.push(t.render ? /* @__PURE__ */ H("span", {
410
+ s.push(t.render ? /* @__PURE__ */ B("span", {
411
411
  className: "pointer-events-auto",
412
412
  children: t.render()
413
- }, `range-${n}`) : /* @__PURE__ */ H("span", {
413
+ }, `range-${n}`) : /* @__PURE__ */ B("span", {
414
414
  "aria-hidden": !0,
415
415
  className: t.isUnsupported ? i : r,
416
416
  children: a
@@ -433,7 +433,7 @@ var W = {
433
433
  let a = document.createRange();
434
434
  return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
435
435
  }, qe = ({ textareaRef: e, message: t, hasActiveMentions: n }) => {
436
- let r = z(null), [i, a] = B([]), o = I(() => {
436
+ let r = L(null), [i, a] = R([]), o = P(() => {
437
437
  let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
438
438
  if (!n || t == null || i == null || o == null || s == null || o === s) {
439
439
  a((e) => e.length === 0 ? e : []);
@@ -447,9 +447,9 @@ var W = {
447
447
  let l = i.getBoundingClientRect();
448
448
  a(Array.from(c.getClientRects()).map((e) => new DOMRect(e.left - l.left, e.top - l.top, e.width, e.height)));
449
449
  }, [n, e]);
450
- return Ce(() => {
450
+ return we(() => {
451
451
  o();
452
- }, [o, t]), L(() => {
452
+ }, [o, t]), F(() => {
453
453
  if (!n) return;
454
454
  let t = e.current;
455
455
  if (t == null || typeof ResizeObserver > "u") return;
@@ -465,8 +465,8 @@ var W = {
465
465
  updateSelectionRects: o
466
466
  };
467
467
  }, Je = ({ messageProp: e, messageRevision: t }) => {
468
- let [n, r] = B(e), i = z(null);
469
- return L(() => {
468
+ let [n, r] = R(e), i = L(null);
469
+ return F(() => {
470
470
  r(e);
471
471
  }, [e, t]), {
472
472
  message: n,
@@ -477,10 +477,10 @@ var W = {
477
477
  let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
478
478
  i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
479
479
  }, Xe = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ze = ({ insertion: e, textareaRef: t }) => {
480
- let n = e?.revision, r = z(e?.text);
480
+ let n = e?.revision, r = L(e?.text);
481
481
  r.current = e?.text;
482
- let i = z(n), a = z(null);
483
- return L(() => {
482
+ let i = L(n), a = L(null);
483
+ return F(() => {
484
484
  if (n === i.current) return;
485
485
  i.current = n;
486
486
  let e = r.current;
@@ -510,7 +510,7 @@ var W = {
510
510
  "audio/ogg;codecs=opus",
511
511
  "audio/webm"
512
512
  ], tt = 100, nt = 100, rt = .01, it = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
513
- let [a, o] = B("idle"), [s, c] = B(null), l = z(null), d = z(null), f = z({
513
+ let [a, o] = R("idle"), [s, c] = R(null), l = L(null), d = L(null), f = L({
514
514
  onAttachAudio: e,
515
515
  onTranscribeAudio: t,
516
516
  onTranscript: n,
@@ -522,7 +522,7 @@ var W = {
522
522
  onTranscript: n,
523
523
  errorLabel: i
524
524
  };
525
- let p = I((e = "dictation") => {
525
+ let p = P((e = "dictation") => {
526
526
  if (d.current) return;
527
527
  let t = { controller: new AbortController() };
528
528
  d.current = t, c(null), o("recording");
@@ -593,10 +593,10 @@ var W = {
593
593
  x(e);
594
594
  }
595
595
  })();
596
- }, []), m = I(() => d.current?.stop?.(), []), h = I(() => {
596
+ }, []), m = P(() => d.current?.stop?.(), []), h = P(() => {
597
597
  d.current?.controller.abort(), d.current = null, c(null), o("idle");
598
598
  }, []);
599
- return L(() => () => {
599
+ return F(() => () => {
600
600
  d.current?.controller.abort(), d.current = null;
601
601
  }, []), {
602
602
  state: a,
@@ -622,7 +622,7 @@ var W = {
622
622
  "--ci-sheet-item-active": f?.itemActiveBg,
623
623
  "--ci-sheet-icon": f?.itemIcon
624
624
  });
625
- return /* @__PURE__ */ H(Me, {
625
+ return /* @__PURE__ */ B(U, {
626
626
  isOpen: e,
627
627
  title: t,
628
628
  closeLabel: n,
@@ -631,23 +631,23 @@ var W = {
631
631
  className: o,
632
632
  titleClassName: s,
633
633
  colors: f?.shell,
634
- children: /* @__PURE__ */ H("ul", {
634
+ children: /* @__PURE__ */ B("ul", {
635
635
  role: "list",
636
636
  className: "flex flex-col",
637
637
  style: h,
638
- children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(p, {
638
+ children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(p, {
639
639
  type: "button",
640
640
  className: l(st.item, "w-full gap-3 px-4 py-[10px] text-start"),
641
- iconBefore: /* @__PURE__ */ H("span", {
641
+ iconBefore: /* @__PURE__ */ B("span", {
642
642
  className: st.itemIcon,
643
643
  children: n
644
644
  }),
645
- iconAfter: r ? /* @__PURE__ */ H("span", {
645
+ iconAfter: r ? /* @__PURE__ */ B("span", {
646
646
  className: "ms-auto",
647
647
  children: r
648
648
  }) : null,
649
649
  textClassName: d,
650
- label: /* @__PURE__ */ H("span", {
650
+ label: /* @__PURE__ */ B("span", {
651
651
  className: u,
652
652
  children: t
653
653
  }),
@@ -656,8 +656,8 @@ var W = {
656
656
  })
657
657
  });
658
658
  }, lt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
659
- let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
660
- L(() => {
659
+ let [s, c] = R(t), [l, u] = R(n), [d, f] = R(r), p = L(o);
660
+ F(() => {
661
661
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
662
662
  }, [
663
663
  o,
@@ -674,7 +674,7 @@ var W = {
674
674
  setResponseFormat: c,
675
675
  setSystemPrompt: u,
676
676
  setTemperature: f,
677
- handleSubmit: I(() => {
677
+ handleSubmit: P(() => {
678
678
  if (!m) return;
679
679
  let t = {};
680
680
  e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
@@ -688,17 +688,17 @@ var W = {
688
688
  a
689
689
  ])
690
690
  };
691
- }, ut = { label: "_label_14i7c_1" }, G = ({ 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 = [
691
+ }, ut = { label: "_label_14i7c_1" }, dt = ({ 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 = [
692
692
  "Precise",
693
693
  "Neutral",
694
694
  "Creative"
695
695
  ], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
696
696
  let S = c({ "--csf-label-text": x?.labelText }), C = l(b, ut.label, "gap-1");
697
- return /* @__PURE__ */ U("div", {
697
+ return /* @__PURE__ */ V("div", {
698
698
  className: "flex flex-col gap-4 px-6 pb-3",
699
699
  style: S,
700
700
  children: [
701
- e.responseFormat && /* @__PURE__ */ H(k, {
701
+ e.responseFormat && /* @__PURE__ */ B(k, {
702
702
  id: "response-format",
703
703
  labelProps: {
704
704
  label: d,
@@ -706,7 +706,7 @@ var W = {
706
706
  caption: f
707
707
  },
708
708
  optionsClassName: "mb-2",
709
- orientation: A.Column,
709
+ orientation: te.Column,
710
710
  value: t ?? o.Markdown,
711
711
  items: [{
712
712
  value: o.Markdown,
@@ -717,18 +717,18 @@ var W = {
717
717
  }],
718
718
  onChange: (e) => a(e)
719
719
  }),
720
- e.systemPrompt && /* @__PURE__ */ H(P, {
720
+ e.systemPrompt && /* @__PURE__ */ B(M, {
721
721
  value: n,
722
722
  placeholder: g,
723
723
  className: i,
724
- resize: F.Vertical,
724
+ resize: N.Vertical,
725
725
  labelProps: {
726
726
  className: C,
727
727
  label: h
728
728
  },
729
729
  onChange: (e) => s(e ?? "")
730
730
  }),
731
- e.temperature && /* @__PURE__ */ H(N, {
731
+ e.temperature && /* @__PURE__ */ B(re, {
732
732
  labelProps: {
733
733
  label: _,
734
734
  className: C,
@@ -744,8 +744,8 @@ var W = {
744
744
  })
745
745
  ]
746
746
  });
747
- }, dt = ({ 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 }) => {
748
- let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: O, setResponseFormat: k, setSystemPrompt: A, setTemperature: j, handleSubmit: M } = lt({
747
+ }, W = ({ 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 }) => {
748
+ let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: te, handleSubmit: A } = lt({
749
749
  isOpen: e,
750
750
  features: o,
751
751
  initialResponseFormat: s,
@@ -754,7 +754,7 @@ var W = {
754
754
  onSave: d,
755
755
  onClose: r
756
756
  });
757
- return /* @__PURE__ */ U(Me, {
757
+ return /* @__PURE__ */ V(U, {
758
758
  isOpen: e,
759
759
  title: f,
760
760
  closeLabel: i,
@@ -762,14 +762,14 @@ var W = {
762
762
  onBack: t,
763
763
  backLabel: n,
764
764
  style: a,
765
- children: [/* @__PURE__ */ H(G, {
765
+ children: [/* @__PURE__ */ B(dt, {
766
766
  features: o,
767
767
  responseFormat: w,
768
768
  systemPrompt: T,
769
769
  temperature: E,
770
- onResponseFormatChange: k,
771
- onSystemPromptChange: A,
772
- onTemperatureChange: j,
770
+ onResponseFormatChange: O,
771
+ onSystemPromptChange: k,
772
+ onTemperatureChange: te,
773
773
  responseFormatLabel: p,
774
774
  responseFormatHint: m,
775
775
  responseFormatMarkdownLabel: h,
@@ -779,23 +779,23 @@ var W = {
779
779
  temperatureLabel: y,
780
780
  temperatureLabels: b,
781
781
  temperatureHint: x
782
- }), /* @__PURE__ */ H("div", {
782
+ }), /* @__PURE__ */ B("div", {
783
783
  className: l("px-6 py-4 mobile:pb-8"),
784
- children: /* @__PURE__ */ H(re, {
784
+ children: /* @__PURE__ */ B(ae, {
785
785
  tooltip: C,
786
- hideTooltip: O || !C,
786
+ hideTooltip: D || !C,
787
787
  triggerClassName: "w-full",
788
- children: /* @__PURE__ */ H(D, {
788
+ children: /* @__PURE__ */ B(ee, {
789
789
  label: S,
790
- onClick: M,
791
- disabled: !O,
790
+ onClick: A,
791
+ disabled: !D,
792
792
  className: "w-full"
793
793
  })
794
794
  })
795
795
  })]
796
796
  });
797
797
  }, ft = { modal: "_modal_kl0h0_1" }, pt = ({ 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: h, temperatureLabels: g, temperatureHint: _, saveLabel: v = "Apply changes", saveDisabledTooltip: y, backgroundClassName: b = ft.modal }) => {
798
- let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = lt({
798
+ let { responseFormat: x, systemPrompt: S, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: ee, setTemperature: O, handleSubmit: k } = lt({
799
799
  features: e,
800
800
  initialResponseFormat: t,
801
801
  initialSystemPrompt: n,
@@ -803,31 +803,31 @@ var W = {
803
803
  onSave: i,
804
804
  onClose: a
805
805
  });
806
- return /* @__PURE__ */ H(T, {
806
+ return /* @__PURE__ */ B(E, {
807
807
  open: !0,
808
808
  header: o,
809
809
  titleClassName: s,
810
- size: E.Sm,
810
+ size: D.Sm,
811
811
  onClose: a,
812
812
  className: b,
813
813
  mainButtons: [{
814
814
  label: v,
815
815
  variant: m.Primary,
816
- onClick: A,
816
+ onClick: k,
817
817
  disabled: !w,
818
818
  tooltipProps: y ? {
819
819
  tooltip: y,
820
820
  hideTooltip: w
821
821
  } : void 0
822
822
  }],
823
- children: /* @__PURE__ */ H(G, {
823
+ children: /* @__PURE__ */ B(dt, {
824
824
  features: e,
825
825
  responseFormat: x,
826
826
  systemPrompt: S,
827
827
  temperature: C,
828
- onResponseFormatChange: D,
829
- onSystemPromptChange: O,
830
- onTemperatureChange: k,
828
+ onResponseFormatChange: T,
829
+ onSystemPromptChange: ee,
830
+ onTemperatureChange: O,
831
831
  responseFormatLabel: c,
832
832
  responseFormatHint: l,
833
833
  responseFormatMarkdownLabel: u,
@@ -842,7 +842,7 @@ var W = {
842
842
  }, mt = {
843
843
  icon: "_icon_1fv6z_1",
844
844
  selectedIcon: "_selectedIcon_1fv6z_5"
845
- }, ht = ({ 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: m }) => /* @__PURE__ */ H(Me, {
845
+ }, ht = ({ 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: m }) => /* @__PURE__ */ B(U, {
846
846
  isOpen: e,
847
847
  title: o,
848
848
  closeLabel: i,
@@ -850,33 +850,33 @@ var W = {
850
850
  onBack: t,
851
851
  backLabel: n,
852
852
  style: a,
853
- children: /* @__PURE__ */ H("ul", {
853
+ children: /* @__PURE__ */ B("ul", {
854
854
  role: "menu",
855
855
  className: "flex flex-col pb-4",
856
856
  style: c({
857
857
  "--tbs-icon-text": m?.iconText,
858
858
  "--tbs-selected-icon-text": m?.selectedIconText
859
859
  }),
860
- children: s.map((e) => /* @__PURE__ */ H("li", {
860
+ children: s.map((e) => /* @__PURE__ */ B("li", {
861
861
  role: "none",
862
- children: /* @__PURE__ */ H(p, {
862
+ children: /* @__PURE__ */ B(p, {
863
863
  type: "button",
864
864
  role: "menuitemcheckbox",
865
865
  "aria-checked": e.isSelected,
866
866
  className: "w-full gap-3 px-4 py-[10px] text-start",
867
- iconBefore: /* @__PURE__ */ H("span", {
867
+ iconBefore: /* @__PURE__ */ B("span", {
868
868
  className: l("flex items-center", mt.icon),
869
869
  children: e.icon
870
870
  }),
871
- iconAfter: e.isSelected ? /* @__PURE__ */ H("span", {
871
+ iconAfter: e.isSelected ? /* @__PURE__ */ B("span", {
872
872
  className: l("ms-auto", mt.selectedIcon),
873
- children: /* @__PURE__ */ H(oe, {
873
+ children: /* @__PURE__ */ B(ce, {
874
874
  size: f,
875
875
  "aria-hidden": !0,
876
876
  stroke: _
877
877
  })
878
878
  }) : null,
879
- label: /* @__PURE__ */ H("span", {
879
+ label: /* @__PURE__ */ B("span", {
880
880
  className: d,
881
881
  children: e.label
882
882
  }),
@@ -887,15 +887,15 @@ var W = {
887
887
  }), gt = {
888
888
  toolIcon: "_toolIcon_ma5s5_1",
889
889
  chevronIcon: "_chevronIcon_ma5s5_5"
890
- }, _t = ({ 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: b, toolsMenuItems: S = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: O, colors: k }) => {
891
- let A = d(), [j, M] = B(!1), [ee, N] = B(!1), [te, ne] = B(!1), [P, F] = B(null), [re, ie] = B(!1), ae = R(() => c({
892
- "--aab-tool-icon": k?.toolIcon,
893
- "--aab-chevron-icon": k?.chevronIcon
894
- }), [k?.toolIcon, k?.chevronIcon]), oe = S.length > 0 && w != null, se = D != null && D.length > 0, le = R(() => S.map((e) => ({
890
+ }, _t = ({ 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: b, toolsMenuItems: S = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, getCaretPosition: ee, colors: O }) => {
891
+ let k = d(), [te, A] = R(!1), [ne, j] = R(!1), [re, ie] = R(!1), [M, N] = R(null), [ae, oe] = R(!1), se = I(() => c({
892
+ "--aab-tool-icon": O?.toolIcon,
893
+ "--aab-chevron-icon": O?.chevronIcon
894
+ }), [O?.toolIcon, O?.chevronIcon]), ce = S.length > 0 && w != null, le = D != null && D.length > 0, de = I(() => S.map((e) => ({
895
895
  key: e.id,
896
896
  label: e.label,
897
- icon: /* @__PURE__ */ H("span", {
898
- style: ae,
897
+ icon: /* @__PURE__ */ B("span", {
898
+ style: se,
899
899
  className: l("flex items-center", gt.toolIcon),
900
900
  children: e.icon
901
901
  }),
@@ -906,12 +906,12 @@ var W = {
906
906
  })), [
907
907
  S,
908
908
  w,
909
- ae
910
- ]), fe = R(() => [
909
+ se
910
+ ]), me = I(() => [
911
911
  ...e == null ? [] : [{
912
912
  key: "attach",
913
913
  label: r,
914
- icon: /* @__PURE__ */ H(de, {
914
+ icon: /* @__PURE__ */ B(pe, {
915
915
  size: f,
916
916
  "aria-hidden": !0,
917
917
  stroke: _
@@ -919,36 +919,36 @@ var W = {
919
919
  onClick: e
920
920
  }],
921
921
  ...b ?? [],
922
- ...oe ? [{
922
+ ...ce ? [{
923
923
  key: "tools",
924
924
  label: T,
925
- icon: /* @__PURE__ */ H(ge, {
925
+ icon: /* @__PURE__ */ B(_e, {
926
926
  size: f,
927
927
  "aria-hidden": !0,
928
928
  stroke: _
929
929
  }),
930
- onClick: A ? () => {
931
- ne(!0), M(!1);
930
+ onClick: k ? () => {
931
+ ie(!0), A(!1);
932
932
  } : () => void 0,
933
- ...A ? { iconAfter: /* @__PURE__ */ H(ce, {
933
+ ...k ? { iconAfter: /* @__PURE__ */ B(ue, {
934
934
  size: f,
935
935
  stroke: _,
936
- style: ae,
936
+ style: se,
937
937
  className: l("rtl:scale-x-[-1]", gt.chevronIcon),
938
938
  "aria-hidden": !0
939
- }) } : { children: le }
939
+ }) } : { children: de }
940
940
  }] : [],
941
941
  ...(D ?? []).map((e) => ({
942
942
  key: e.key,
943
943
  label: e.title,
944
944
  icon: e.icon,
945
- onClick: A ? () => {
946
- F(e.key), M(!1);
945
+ onClick: k ? () => {
946
+ N(e.key), A(!1);
947
947
  } : () => void 0,
948
- ...A ? { iconAfter: /* @__PURE__ */ H(ce, {
948
+ ...k ? { iconAfter: /* @__PURE__ */ B(ue, {
949
949
  size: f,
950
950
  stroke: _,
951
- style: ae,
951
+ style: se,
952
952
  className: l("rtl:scale-x-[-1]", gt.chevronIcon),
953
953
  "aria-hidden": !0
954
954
  }) } : {
@@ -956,37 +956,37 @@ var W = {
956
956
  key: `${e.key}-panel`,
957
957
  label: ""
958
958
  }],
959
- renderSubMenu: () => e.renderOverlay(() => ie(!1), O?.() ?? 0)
959
+ renderSubMenu: () => e.renderOverlay(() => oe(!1), ee?.() ?? 0)
960
960
  }
961
961
  })),
962
962
  ...t == null ? [] : [{
963
963
  key: "record-voice",
964
964
  label: n,
965
- icon: /* @__PURE__ */ H(ue, {
965
+ icon: /* @__PURE__ */ B(fe, {
966
966
  size: f,
967
967
  "aria-hidden": !0,
968
968
  stroke: _
969
969
  }),
970
970
  onClick: () => {
971
- M(!1), ie(!1), t();
971
+ A(!1), oe(!1), t();
972
972
  }
973
973
  }],
974
974
  ...h == null ? [] : [{
975
975
  key: "chat-settings",
976
976
  label: h.menuItemLabel ?? "Chat settings",
977
- icon: /* @__PURE__ */ H(he, {
977
+ icon: /* @__PURE__ */ B(ge, {
978
978
  size: f,
979
979
  "aria-hidden": !0,
980
980
  stroke: _
981
981
  }),
982
- iconAfter: A ? /* @__PURE__ */ H(ce, {
982
+ iconAfter: k ? /* @__PURE__ */ B(ue, {
983
983
  size: f,
984
984
  stroke: _,
985
- style: ae,
985
+ style: se,
986
986
  className: l("rtl:scale-x-[-1]", gt.chevronIcon),
987
987
  "aria-hidden": !0
988
988
  }) : null,
989
- onClick: () => N(!0)
989
+ onClick: () => j(!0)
990
990
  }]
991
991
  ], [
992
992
  r,
@@ -995,25 +995,25 @@ var W = {
995
995
  n,
996
996
  h,
997
997
  b,
998
- A,
999
- oe,
998
+ k,
999
+ ce,
1000
1000
  T,
1001
- le,
1001
+ de,
1002
1002
  D,
1003
- O,
1004
- ae
1003
+ ee,
1004
+ se
1005
1005
  ]);
1006
- if (fe.length === 0) return null;
1007
- let pe = /* @__PURE__ */ H(v, {
1006
+ if (me.length === 0) return null;
1007
+ let ve = /* @__PURE__ */ B(v, {
1008
1008
  matchReferenceWidth: !1,
1009
1009
  placement: "bottom-start",
1010
1010
  listClassName: p,
1011
1011
  overlayContentClassName: "flex flex-col gap-1",
1012
- items: fe,
1013
- open: se ? re : void 0,
1014
- onOpenChange: se ? ie : void 0,
1015
- children: /* @__PURE__ */ H(x, {
1016
- icon: /* @__PURE__ */ H(me, {
1012
+ items: me,
1013
+ open: le ? ae : void 0,
1014
+ onOpenChange: le ? oe : void 0,
1015
+ children: /* @__PURE__ */ B(x, {
1016
+ icon: /* @__PURE__ */ B(he, {
1017
1017
  size: g.LG,
1018
1018
  "aria-hidden": !0,
1019
1019
  stroke: _
@@ -1023,9 +1023,9 @@ var W = {
1023
1023
  disabled: m
1024
1024
  })
1025
1025
  });
1026
- return /* @__PURE__ */ H(V, { children: A ? /* @__PURE__ */ U(V, { children: [
1027
- /* @__PURE__ */ H(x, {
1028
- icon: /* @__PURE__ */ H(me, {
1026
+ return /* @__PURE__ */ B(z, { children: k ? /* @__PURE__ */ V(z, { children: [
1027
+ /* @__PURE__ */ B(x, {
1028
+ icon: /* @__PURE__ */ B(he, {
1029
1029
  size: g.LG,
1030
1030
  "aria-hidden": !0,
1031
1031
  stroke: _
@@ -1034,54 +1034,54 @@ var W = {
1034
1034
  size: y.Large,
1035
1035
  tooltipProps: { tooltip: i },
1036
1036
  disabled: m,
1037
- onClick: () => M(!0)
1037
+ onClick: () => A(!0)
1038
1038
  }),
1039
- /* @__PURE__ */ H(ct, {
1040
- isOpen: j,
1039
+ /* @__PURE__ */ B(ct, {
1040
+ isOpen: te,
1041
1041
  title: a,
1042
1042
  closeLabel: s,
1043
- onClose: () => M(!1),
1043
+ onClose: () => A(!1),
1044
1044
  style: u,
1045
- items: fe,
1045
+ items: me,
1046
1046
  className: "pb-4",
1047
1047
  btnTextClassName: "flex-1"
1048
1048
  }),
1049
- oe && /* @__PURE__ */ H(ht, {
1050
- isOpen: te,
1049
+ ce && /* @__PURE__ */ B(ht, {
1050
+ isOpen: re,
1051
1051
  onBack: () => {
1052
- ne(!1), M(!0);
1052
+ ie(!1), A(!0);
1053
1053
  },
1054
1054
  backLabel: E,
1055
- onClose: () => ne(!1),
1055
+ onClose: () => ie(!1),
1056
1056
  closeLabel: s,
1057
1057
  style: u,
1058
1058
  title: T,
1059
1059
  items: S,
1060
1060
  onToolToggle: w
1061
1061
  }),
1062
- D?.map((e) => /* @__PURE__ */ H(Me, {
1063
- isOpen: P === e.key,
1062
+ D?.map((e) => /* @__PURE__ */ B(U, {
1063
+ isOpen: M === e.key,
1064
1064
  title: e.title,
1065
1065
  closeLabel: s,
1066
1066
  onBack: () => {
1067
- F(null), M(!0);
1067
+ N(null), A(!0);
1068
1068
  },
1069
1069
  backLabel: e.backLabel ?? "Back",
1070
- onClose: () => F(null),
1070
+ onClose: () => N(null),
1071
1071
  style: u,
1072
- children: /* @__PURE__ */ H("div", {
1072
+ children: /* @__PURE__ */ B("div", {
1073
1073
  role: "menu",
1074
1074
  "aria-label": e.title,
1075
- children: e.renderOverlay(() => F(null), O?.() ?? 0)
1075
+ children: e.renderOverlay(() => N(null), ee?.() ?? 0)
1076
1076
  })
1077
1077
  }, e.key)),
1078
- h != null && /* @__PURE__ */ H(dt, {
1079
- isOpen: ee,
1078
+ h != null && /* @__PURE__ */ B(W, {
1079
+ isOpen: ne,
1080
1080
  onBack: () => {
1081
- N(!1), M(!0);
1081
+ j(!1), A(!0);
1082
1082
  },
1083
1083
  backLabel: h.backLabel ?? "Back",
1084
- onClose: () => N(!1),
1084
+ onClose: () => j(!1),
1085
1085
  closeLabel: s,
1086
1086
  style: u,
1087
1087
  features: h.features,
@@ -1102,13 +1102,13 @@ var W = {
1102
1102
  saveLabel: h.saveLabel,
1103
1103
  saveDisabledTooltip: h.saveDisabledTooltip
1104
1104
  })
1105
- ] }) : /* @__PURE__ */ U(V, { children: [pe, h != null && ee && /* @__PURE__ */ H(pt, {
1105
+ ] }) : /* @__PURE__ */ V(z, { children: [ve, h != null && ne && /* @__PURE__ */ B(pt, {
1106
1106
  features: h.features,
1107
1107
  initialResponseFormat: h.responseFormat ?? o.Markdown,
1108
1108
  initialSystemPrompt: h.systemPrompt,
1109
1109
  initialTemperature: h.temperature,
1110
1110
  onSave: h.onSave,
1111
- onClose: () => N(!1),
1111
+ onClose: () => j(!1),
1112
1112
  title: h.title,
1113
1113
  responseFormatLabel: h.responseFormatLabel,
1114
1114
  responseFormatHint: h.responseFormatHint,
@@ -1132,7 +1132,7 @@ var W = {
1132
1132
  }, yt = (e) => `Remove ${e}`, bt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = yt, stateOnLabel: a, stateOffLabel: o, typography: s, colors: u }) => {
1133
1133
  if (e.length === 0) return null;
1134
1134
  let d = !!(a && o);
1135
- return /* @__PURE__ */ H("div", {
1135
+ return /* @__PURE__ */ B("div", {
1136
1136
  className: "flex flex-wrap items-center gap-2",
1137
1137
  style: c({
1138
1138
  "--ci-chip-bg": u?.chipBg,
@@ -1148,38 +1148,38 @@ var W = {
1148
1148
  "--ci-chip-close": u?.chipClose,
1149
1149
  "--ci-chip-close-hover": u?.chipCloseHover
1150
1150
  }),
1151
- children: e.map((e) => /* @__PURE__ */ U("div", {
1151
+ children: e.map((e) => /* @__PURE__ */ V("div", {
1152
1152
  className: l(vt.chip, e.isSelected && vt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
1153
- children: [/* @__PURE__ */ U("button", {
1153
+ children: [/* @__PURE__ */ V("button", {
1154
1154
  type: "button",
1155
1155
  onClick: () => t(e.id),
1156
1156
  "aria-pressed": e.isSelected,
1157
1157
  className: "flex min-w-0 items-center gap-1.5",
1158
1158
  children: [
1159
- /* @__PURE__ */ H("span", {
1159
+ /* @__PURE__ */ B("span", {
1160
1160
  className: l(vt.chipIcon, "shrink-0"),
1161
1161
  "aria-hidden": !0,
1162
1162
  children: e.icon
1163
1163
  }),
1164
- /* @__PURE__ */ U("span", {
1164
+ /* @__PURE__ */ V("span", {
1165
1165
  className: l(vt.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
1166
- children: [e.label, d && /* @__PURE__ */ H("span", {
1166
+ children: [e.label, d && /* @__PURE__ */ B("span", {
1167
1167
  "aria-hidden": !0,
1168
1168
  children: ":"
1169
1169
  })]
1170
1170
  }),
1171
- d && /* @__PURE__ */ H("span", {
1171
+ d && /* @__PURE__ */ B("span", {
1172
1172
  className: l(vt.chipState, s?.fontClassName || "dial-small-paragraph-text", "ms-1 shrink-0 uppercase tracking-wider"),
1173
1173
  "aria-hidden": !0,
1174
1174
  children: e.isSelected ? a : o
1175
1175
  })
1176
1176
  ]
1177
- }), r && /* @__PURE__ */ H("button", {
1177
+ }), r && /* @__PURE__ */ B("button", {
1178
1178
  type: "button",
1179
1179
  onClick: () => n(e.id),
1180
1180
  "aria-label": i(e.label),
1181
1181
  className: l(vt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
1182
- children: /* @__PURE__ */ H(_e, {
1182
+ children: /* @__PURE__ */ B(ve, {
1183
1183
  size: 12,
1184
1184
  "aria-hidden": !0,
1185
1185
  stroke: _
@@ -1187,7 +1187,7 @@ var W = {
1187
1187
  })]
1188
1188
  }, e.id))
1189
1189
  });
1190
- }, K = {
1190
+ }, G = {
1191
1191
  wrapper: "_wrapper_19a9k_2",
1192
1192
  wrapperDisabled: "_wrapperDisabled_19a9k_9",
1193
1193
  textarea: "_textarea_19a9k_13",
@@ -1206,7 +1206,7 @@ var W = {
1206
1206
  recordingDot: "_recordingDot_129ri_19",
1207
1207
  "recording-pulse": "_recording-pulse_129ri_1"
1208
1208
  }, St = 3, Ct = 4, wt = 200, Tt = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: c = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
1209
- let p = z(null), m = z(new Float32Array(wt)), h = z(0), v = z(0), y = e === Qe.Recording, S = e === Qe.Error, C = e === Qe.Processing, w = I((e) => {
1209
+ let p = L(null), m = L(new Float32Array(wt)), h = L(0), v = L(0), y = e === Qe.Recording, x = e === Qe.Error, S = e === Qe.Processing, C = P((e) => {
1210
1210
  let t = e.getContext("2d");
1211
1211
  if (!t) return;
1212
1212
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
@@ -1220,7 +1220,7 @@ var W = {
1220
1220
  }
1221
1221
  t.restore();
1222
1222
  }, []);
1223
- L(() => {
1223
+ F(() => {
1224
1224
  if (!y) return;
1225
1225
  let e = p.current;
1226
1226
  if (!e) return;
@@ -1240,7 +1240,7 @@ var W = {
1240
1240
  m.current[h.current % wt] = Math.sqrt(n / t.length), h.current++;
1241
1241
  }
1242
1242
  }
1243
- w(e), n = requestAnimationFrame(r);
1243
+ C(e), n = requestAnimationFrame(r);
1244
1244
  };
1245
1245
  return n = requestAnimationFrame(r), () => {
1246
1246
  cancelAnimationFrame(n);
@@ -1248,20 +1248,20 @@ var W = {
1248
1248
  }, [
1249
1249
  y,
1250
1250
  t,
1251
- w
1252
- ]), L(() => {
1251
+ C
1252
+ ]), F(() => {
1253
1253
  let e = p.current;
1254
1254
  if (!e) return;
1255
1255
  let t = new ResizeObserver(() => {
1256
- w(e);
1256
+ C(e);
1257
1257
  });
1258
1258
  return t.observe(e), () => t.disconnect();
1259
- }, [w]);
1260
- let T = /* @__PURE__ */ U("div", {
1259
+ }, [C]);
1260
+ let w = /* @__PURE__ */ V("div", {
1261
1261
  className: "flex flex-shrink-0 items-center justify-end gap-1",
1262
1262
  children: [
1263
- /* @__PURE__ */ H(x, {
1264
- icon: /* @__PURE__ */ H(_e, {
1263
+ /* @__PURE__ */ B(T, {
1264
+ icon: /* @__PURE__ */ B(ve, {
1265
1265
  size: g.LG,
1266
1266
  "aria-hidden": !0,
1267
1267
  stroke: _
@@ -1270,8 +1270,8 @@ var W = {
1270
1270
  className: "mobile:min-h-11 mobile:min-w-11",
1271
1271
  onClick: i
1272
1272
  }),
1273
- y && /* @__PURE__ */ H(O, {
1274
- icon: /* @__PURE__ */ H(fe, {
1273
+ y && /* @__PURE__ */ B(O, {
1274
+ icon: /* @__PURE__ */ B(ce, {
1275
1275
  size: g.LG,
1276
1276
  "aria-hidden": !0
1277
1277
  }),
@@ -1280,93 +1280,93 @@ var W = {
1280
1280
  "aria-label": o,
1281
1281
  className: "mobile:min-h-11 mobile:min-w-11"
1282
1282
  }),
1283
- C && /* @__PURE__ */ H("span", {
1283
+ S && /* @__PURE__ */ B("span", {
1284
1284
  className: "flex size-[40px] flex-shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
1285
- children: /* @__PURE__ */ H(te, {
1285
+ children: /* @__PURE__ */ B(ie, {
1286
1286
  size: 20,
1287
1287
  ariaLabel: c
1288
1288
  })
1289
1289
  })
1290
1290
  ]
1291
1291
  });
1292
- return /* @__PURE__ */ U("div", {
1292
+ return /* @__PURE__ */ V("div", {
1293
1293
  className: d,
1294
- children: [/* @__PURE__ */ U("div", {
1294
+ children: [/* @__PURE__ */ V("div", {
1295
1295
  style: u,
1296
- className: l("flex w-full min-w-0 flex-col justify-center gap-2", !f && K.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && xt.wrapperError),
1297
- children: [/* @__PURE__ */ U("div", {
1296
+ className: l("flex w-full min-w-0 flex-col justify-center gap-2", !f && G.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", x && xt.wrapperError),
1297
+ children: [/* @__PURE__ */ V("div", {
1298
1298
  className: "flex min-w-0 flex-1 items-center gap-3",
1299
- children: [y && /* @__PURE__ */ H("span", {
1299
+ children: [y && /* @__PURE__ */ B("span", {
1300
1300
  className: l(xt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1301
1301
  "aria-hidden": !0
1302
- }), /* @__PURE__ */ H("canvas", {
1302
+ }), /* @__PURE__ */ B("canvas", {
1303
1303
  ref: p,
1304
1304
  height: 26,
1305
1305
  "aria-hidden": !0,
1306
1306
  className: l(xt.waveformCanvas, "h-[26px] min-w-0 flex-1")
1307
1307
  })]
1308
- }), /* @__PURE__ */ U("div", {
1308
+ }), /* @__PURE__ */ V("div", {
1309
1309
  className: "flex items-center justify-between gap-2",
1310
- children: [a ?? /* @__PURE__ */ H("span", { "aria-hidden": !0 }), T]
1310
+ children: [a ?? /* @__PURE__ */ B("span", { "aria-hidden": !0 }), w]
1311
1311
  })]
1312
- }), S && n && /* @__PURE__ */ H("div", {
1312
+ }), x && n && /* @__PURE__ */ B("div", {
1313
1313
  role: "alert",
1314
- children: /* @__PURE__ */ H(b, {
1314
+ children: /* @__PURE__ */ B(b, {
1315
1315
  text: n,
1316
1316
  className: "mt-1 px-1"
1317
1317
  })
1318
1318
  })]
1319
1319
  });
1320
- }, Et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ H(O, {
1320
+ }, Et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ B(O, {
1321
1321
  "aria-label": n,
1322
1322
  onClick: () => e?.(),
1323
1323
  disabled: t,
1324
1324
  tooltipProps: r ? { tooltip: r } : void 0,
1325
- icon: /* @__PURE__ */ H(ae, {
1325
+ icon: /* @__PURE__ */ B(se, {
1326
1326
  size: g.LG,
1327
1327
  className: "rtl:scale-x-[-1]",
1328
1328
  stroke: _
1329
1329
  })
1330
- }), Dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H(ne, {
1331
- icon: /* @__PURE__ */ H(pe, {
1330
+ }), Dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B(T, {
1331
+ icon: /* @__PURE__ */ B(me, {
1332
1332
  size: g.LG,
1333
1333
  stroke: _
1334
1334
  }),
1335
1335
  onClick: () => e?.(),
1336
1336
  "aria-label": t
1337
- }), Ot = ({ size: e = 20 }) => /* @__PURE__ */ H(M, {
1338
- variant: ee.Circular,
1337
+ }), Ot = ({ size: e = 20 }) => /* @__PURE__ */ B(ne, {
1338
+ variant: j.Circular,
1339
1339
  width: e,
1340
1340
  height: e,
1341
1341
  active: !0
1342
- }), kt = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
1342
+ }), kt = ({ loadingLabel: e }) => /* @__PURE__ */ V("span", {
1343
1343
  className: "flex min-w-0 flex-1 items-center",
1344
- children: [/* @__PURE__ */ H(M, {
1345
- variant: ee.Text,
1344
+ children: [/* @__PURE__ */ B(ne, {
1345
+ variant: j.Text,
1346
1346
  width: "100%",
1347
1347
  height: 16,
1348
1348
  active: !0
1349
- }), e && /* @__PURE__ */ H("span", {
1349
+ }), e && /* @__PURE__ */ B("span", {
1350
1350
  className: "sr-only",
1351
1351
  children: e
1352
1352
  })]
1353
- }), At = ({ loadingLabel: e }) => /* @__PURE__ */ H("div", {
1353
+ }), At = ({ loadingLabel: e }) => /* @__PURE__ */ B("div", {
1354
1354
  role: "status",
1355
1355
  "aria-label": e,
1356
- children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
1356
+ children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ V("div", {
1357
1357
  className: "flex h-11 items-center gap-3 px-4",
1358
1358
  "aria-hidden": "true",
1359
- children: [/* @__PURE__ */ H(Ot, {}), /* @__PURE__ */ H(kt, {})]
1359
+ children: [/* @__PURE__ */ B(Ot, {}), /* @__PURE__ */ B(kt, {})]
1360
1360
  }, t))
1361
1361
  }), jt = (e) => e.displayName ?? e.id, Mt = (e, t) => {
1362
1362
  let n = t.trim().toLowerCase();
1363
1363
  return n ? e.filter((e) => jt(e).toLowerCase().includes(n)) : e;
1364
- }, q = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
1364
+ }, Nt = (e, t, r, i = 18, a) => /* @__PURE__ */ B(n, {
1365
1365
  src: e,
1366
1366
  size: i,
1367
1367
  labels: { tooltip: a },
1368
1368
  initialsName: r
1369
- }), Nt = {
1369
+ }), K = {
1370
1370
  searchHeader: "_searchHeader_1u7db_1",
1371
1371
  itemText: "_itemText_1u7db_13",
1372
1372
  itemHover: "_itemHover_1u7db_17",
@@ -1374,16 +1374,16 @@ var W = {
1374
1374
  selectedItemText: "_selectedItemText_1u7db_26",
1375
1375
  checkIcon: "_checkIcon_1u7db_30"
1376
1376
  }, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
1377
- let [a, o] = B(""), s = R(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = R(() => u ? /* @__PURE__ */ H(Ot, { size: g.LG }) : q(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", g.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1377
+ let [a, o] = R(""), s = I(() => e?.find((e) => e.id === t), [e, t]), u = r?.loading !== void 0, d = !u && !s && !!t, f = I(() => u ? /* @__PURE__ */ B(Ot, { size: g.LG }) : Nt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", g.LG, d ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
1378
1378
  u,
1379
1379
  s,
1380
1380
  d,
1381
1381
  r?.unavailableTooltip
1382
- ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", _ = R(() => {
1382
+ ]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", _ = I(() => {
1383
1383
  if (u) return Array.from({ length: 7 }, (e, t) => ({
1384
1384
  key: `__loading-${t}`,
1385
- icon: /* @__PURE__ */ H(Ot, {}),
1386
- label: /* @__PURE__ */ H(kt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1385
+ icon: /* @__PURE__ */ B(Ot, {}),
1386
+ label: /* @__PURE__ */ B(kt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1387
1387
  disabled: !0
1388
1388
  }));
1389
1389
  if (!e || e.length === 0) {
@@ -1399,15 +1399,15 @@ var W = {
1399
1399
  let r = e.id === t;
1400
1400
  return {
1401
1401
  key: e.id,
1402
- label: /* @__PURE__ */ H(S, {
1402
+ label: /* @__PURE__ */ B(S, {
1403
1403
  text: jt(e),
1404
1404
  query: a,
1405
1405
  maxLines: 1
1406
1406
  }),
1407
- icon: q(e.iconUrl, e.type, e.displayName ?? e.id),
1407
+ icon: Nt(e.iconUrl, e.type, e.displayName ?? e.id),
1408
1408
  mark: C.Check,
1409
1409
  checked: r,
1410
- className: l(o?.itemText && Nt.itemText, o?.itemHoverBackground && Nt.itemHover, r && o?.selectedItemBackground && Nt.selectedItemBackground, r && o?.selectedItemText && Nt.selectedItemText, r && o?.checkIcon && Nt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, W.modelMenuItem, r && W.modelMenuItemSelected),
1410
+ className: l(o?.itemText && K.itemText, o?.itemHoverBackground && K.itemHover, r && o?.selectedItemBackground && K.selectedItemBackground, r && o?.selectedItemText && K.selectedItemText, r && o?.checkIcon && K.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, H.modelMenuItem, r && H.modelMenuItemSelected),
1411
1411
  onClick: () => n?.(e.id)
1412
1412
  };
1413
1413
  });
@@ -1421,7 +1421,7 @@ var W = {
1421
1421
  i?.itemClassName,
1422
1422
  i?.selectedItemClassName,
1423
1423
  i?.colors
1424
- ]), v = R(() => c({
1424
+ ]), v = I(() => c({
1425
1425
  "--ms-item-text": i?.colors?.itemText,
1426
1426
  "--ms-item-hover-bg": i?.colors?.itemHoverBackground,
1427
1427
  "--ms-selected-item-bg": i?.colors?.selectedItemBackground,
@@ -1434,10 +1434,10 @@ var W = {
1434
1434
  selectedLabel: p,
1435
1435
  selectedVersion: m,
1436
1436
  menuItems: _,
1437
- menuHeader: R(() => !u && e && e.length > 0 ? /* @__PURE__ */ H("div", {
1437
+ menuHeader: I(() => !u && e && e.length > 0 ? /* @__PURE__ */ B("div", {
1438
1438
  style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
1439
- className: l("sticky top-0 z-10 pb-1 pe-2 pt-2", Nt.searchHeader, i?.searchHeaderClassName, W.modelMenuSearch),
1440
- children: /* @__PURE__ */ H(j, {
1439
+ className: l("sticky top-0 z-10 pb-1 pe-2 pt-2", K.searchHeader, i?.searchHeaderClassName, H.modelMenuSearch),
1440
+ children: /* @__PURE__ */ B(A, {
1441
1441
  value: a,
1442
1442
  placeholder: r?.searchPlaceholder ?? "Search",
1443
1443
  size: y.Small,
@@ -1457,7 +1457,7 @@ var W = {
1457
1457
  e || o("");
1458
1458
  }
1459
1459
  };
1460
- }, Ft = typeof window < "u" ? Ce : L;
1460
+ }, Ft = typeof window < "u" ? we : F;
1461
1461
  function It(e) {
1462
1462
  if (e !== void 0) switch (typeof e) {
1463
1463
  case "number": return e;
@@ -1466,11 +1466,11 @@ function It(e) {
1466
1466
  break;
1467
1467
  }
1468
1468
  }
1469
- function J({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1470
- let { styleHeight: s, styleWidth: c } = R(() => ({
1469
+ function Lt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1470
+ let { styleHeight: s, styleWidth: c } = I(() => ({
1471
1471
  styleHeight: It(o?.height),
1472
1472
  styleWidth: It(o?.width)
1473
- }), [o?.height, o?.width]), [l, u] = B({
1473
+ }), [o?.height, o?.width]), [l, u] = R({
1474
1474
  height: t,
1475
1475
  width: n
1476
1476
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
@@ -1494,7 +1494,7 @@ function J({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
1494
1494
  i,
1495
1495
  s,
1496
1496
  c
1497
- ]), R(() => ({
1497
+ ]), I(() => ({
1498
1498
  height: s ?? l.height,
1499
1499
  width: c ?? l.width
1500
1500
  }), [
@@ -1503,26 +1503,26 @@ function J({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
1503
1503
  c
1504
1504
  ]);
1505
1505
  }
1506
- function Y(e) {
1507
- let t = z(() => {
1506
+ function q(e) {
1507
+ let t = L(() => {
1508
1508
  throw Error("Cannot call during render.");
1509
1509
  });
1510
1510
  return Ft(() => {
1511
1511
  t.current = e;
1512
- }, [e]), I((e) => t.current?.(e), [t]);
1512
+ }, [e]), P((e) => t.current?.(e), [t]);
1513
1513
  }
1514
- var X = null;
1515
- function Lt(e = !1) {
1516
- if (X === null || e) {
1514
+ var J = null;
1515
+ function Y(e = !1) {
1516
+ if (J === null || e) {
1517
1517
  let e = document.createElement("div"), t = e.style;
1518
1518
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1519
1519
  let n = document.createElement("div"), r = n.style;
1520
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? X = "positive-descending" : (e.scrollLeft = 1, X = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), X;
1520
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? J = "positive-descending" : (e.scrollLeft = 1, J = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), J;
1521
1521
  }
1522
- return X;
1522
+ return J;
1523
1523
  }
1524
1524
  function Rt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1525
- if (t === "horizontal" && n) switch (Lt()) {
1525
+ if (t === "horizontal" && n) switch (Y()) {
1526
1526
  case "negative": return -r;
1527
1527
  case "positive-descending":
1528
1528
  if (e) {
@@ -1533,26 +1533,26 @@ function Rt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1533
1533
  }
1534
1534
  return r;
1535
1535
  }
1536
- function Z(e, t = "Assertion error") {
1536
+ function X(e, t = "Assertion error") {
1537
1537
  if (!e) throw console.error(t), Error(t);
1538
1538
  }
1539
- function Q(e, t) {
1539
+ function zt(e, t) {
1540
1540
  if (e === t) return !0;
1541
- if (!!e != !!t || (Z(e !== void 0), Z(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1541
+ if (!!e != !!t || (X(e !== void 0), X(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1542
1542
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1543
1543
  return !0;
1544
1544
  }
1545
- function zt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1545
+ function Z({ cachedBounds: e, itemCount: t, itemSize: n }) {
1546
1546
  if (t === 0) return 0;
1547
1547
  if (typeof n == "number") return t * n;
1548
1548
  {
1549
1549
  let n = e.get(e.size === 0 ? 0 : e.size - 1);
1550
- return Z(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1550
+ return X(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1551
1551
  }
1552
1552
  }
1553
1553
  function Bt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1554
1554
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1555
- let s = zt({
1555
+ let s = Z({
1556
1556
  cachedBounds: t,
1557
1557
  itemCount: r,
1558
1558
  itemSize: i
@@ -1587,7 +1587,7 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
1587
1587
  let r = /* @__PURE__ */ new Map();
1588
1588
  return {
1589
1589
  get(i) {
1590
- for (Z(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1590
+ for (X(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
1591
1591
  let e = r.size, a;
1592
1592
  switch (typeof n) {
1593
1593
  case "function":
@@ -1603,14 +1603,14 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
1603
1603
  });
1604
1604
  else {
1605
1605
  let t = r.get(e - 1);
1606
- Z(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1606
+ X(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
1607
1607
  scrollOffset: t.scrollOffset + t.size,
1608
1608
  size: a
1609
1609
  });
1610
1610
  }
1611
1611
  }
1612
1612
  let a = r.get(i);
1613
- return Z(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1613
+ return X(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
1614
1614
  },
1615
1615
  set(e, t) {
1616
1616
  r.set(e, t);
@@ -1621,7 +1621,7 @@ function Ht({ itemCount: e, itemProps: t, itemSize: n }) {
1621
1621
  };
1622
1622
  }
1623
1623
  function Ut({ itemCount: e, itemProps: t, itemSize: n }) {
1624
- return R(() => Ht({
1624
+ return I(() => Ht({
1625
1625
  itemCount: e,
1626
1626
  itemProps: t,
1627
1627
  itemSize: n
@@ -1635,7 +1635,7 @@ function Wt({ containerSize: e, itemSize: t }) {
1635
1635
  let n;
1636
1636
  switch (typeof t) {
1637
1637
  case "string":
1638
- 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;
1638
+ 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;
1639
1639
  break;
1640
1640
  default:
1641
1641
  n = t;
@@ -1644,20 +1644,20 @@ function Wt({ containerSize: e, itemSize: t }) {
1644
1644
  return n;
1645
1645
  }
1646
1646
  function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1647
- let { height: u = n, width: d = n } = J({
1647
+ let { height: u = n, width: d = n } = Lt({
1648
1648
  defaultHeight: r === "vertical" ? n : void 0,
1649
1649
  defaultWidth: r === "horizontal" ? n : void 0,
1650
1650
  element: e,
1651
1651
  mode: r === "vertical" ? "only-height" : "only-width",
1652
1652
  style: t
1653
- }), f = z({
1653
+ }), f = L({
1654
1654
  height: 0,
1655
1655
  width: 0
1656
1656
  }), p = r === "vertical" ? u : d, m = Wt({
1657
1657
  containerSize: p,
1658
1658
  itemSize: s
1659
1659
  });
1660
- Ce(() => {
1660
+ we(() => {
1661
1661
  if (typeof c == "function") {
1662
1662
  let e = f.current;
1663
1663
  (e.height !== u || e.width !== d) && (c({
@@ -1674,7 +1674,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1674
1674
  itemCount: a,
1675
1675
  itemProps: o,
1676
1676
  itemSize: m
1677
- }), g = I((e) => h.get(e), [h]), [_, v] = B(() => Vt({
1677
+ }), g = P((e) => h.get(e), [h]), [_, v] = R(() => Vt({
1678
1678
  cachedBounds: h,
1679
1679
  containerScrollOffset: 0,
1680
1680
  containerSize: p,
@@ -1685,7 +1685,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1685
1685
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1686
1686
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1687
1687
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1688
- }, C = I(() => zt({
1688
+ }, C = P(() => Z({
1689
1689
  cachedBounds: h,
1690
1690
  itemCount: a,
1691
1691
  itemSize: m
@@ -1693,7 +1693,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1693
1693
  h,
1694
1694
  a,
1695
1695
  m
1696
- ]), w = I((t) => Vt({
1696
+ ]), w = P((t) => Vt({
1697
1697
  cachedBounds: h,
1698
1698
  containerScrollOffset: Rt({
1699
1699
  containerElement: e,
@@ -1735,7 +1735,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1735
1735
  itemCount: a,
1736
1736
  overscanCount: l
1737
1737
  });
1738
- return Q(s, t) ? t : s;
1738
+ return zt(s, t) ? t : s;
1739
1739
  });
1740
1740
  };
1741
1741
  return e.addEventListener("scroll", t), () => {
@@ -1751,7 +1751,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1751
1751
  ]), {
1752
1752
  getCellBounds: g,
1753
1753
  getEstimatedSize: C,
1754
- scrollToIndex: Y(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1754
+ scrollToIndex: q(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1755
1755
  let s = Bt({
1756
1756
  align: t,
1757
1757
  cachedBounds: h,
@@ -1769,7 +1769,7 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1769
1769
  scrollOffset: s
1770
1770
  }), typeof e.scrollTo != "function") {
1771
1771
  let e = w(s);
1772
- Q(_, e) || v(e);
1772
+ zt(_, e) || v(e);
1773
1773
  }
1774
1774
  return s;
1775
1775
  }
@@ -1781,29 +1781,29 @@ function Gt({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1781
1781
  };
1782
1782
  }
1783
1783
  function Kt(e) {
1784
- return R(() => e, Object.values(e));
1784
+ return I(() => e, Object.values(e));
1785
1785
  }
1786
1786
  function qt(e, t) {
1787
1787
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1788
- return Q(n, a) && Q(r, o) && Q(i, s);
1788
+ return zt(n, a) && zt(r, o) && zt(i, s);
1789
1789
  }
1790
1790
  function Jt(e) {
1791
1791
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1792
1792
  }
1793
1793
  var Yt = "data-react-window-index";
1794
1794
  function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
1795
- let m = Kt(u), h = R(() => be(s, qt), [s]), [g, _] = B(null), v = Jt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Gt({
1795
+ let m = Kt(u), h = I(() => xe(s, qt), [s]), [g, _] = R(null), v = Jt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Gt({
1796
1796
  containerElement: g,
1797
1797
  containerStyle: f,
1798
1798
  defaultContainerSize: n,
1799
1799
  direction: "vertical",
1800
1800
  itemCount: c,
1801
1801
  itemProps: m,
1802
- itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1802
+ itemSize: I(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
1803
1803
  onResize: i,
1804
1804
  overscanCount: o
1805
1805
  });
1806
- Se(r, () => ({
1806
+ Ce(r, () => ({
1807
1807
  get element() {
1808
1808
  return g;
1809
1809
  },
@@ -1832,7 +1832,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1832
1832
  l,
1833
1833
  S,
1834
1834
  w
1835
- ]), L(() => {
1835
+ ]), F(() => {
1836
1836
  S >= 0 && w >= 0 && a && a({
1837
1837
  startIndex: C,
1838
1838
  stopIndex: T
@@ -1847,11 +1847,11 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1847
1847
  w,
1848
1848
  T
1849
1849
  ]);
1850
- let E = R(() => {
1850
+ let E = I(() => {
1851
1851
  let e = [];
1852
1852
  if (c > 0) for (let t = S; t <= w; t++) {
1853
1853
  let n = y(t);
1854
- e.push(/* @__PURE__ */ ve(h, {
1854
+ e.push(/* @__PURE__ */ ye(h, {
1855
1855
  ...m,
1856
1856
  ariaAttributes: {
1857
1857
  "aria-posinset": t + 1,
@@ -1878,7 +1878,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1878
1878
  m,
1879
1879
  S,
1880
1880
  w
1881
- ]), D = /* @__PURE__ */ H("div", {
1881
+ ]), D = /* @__PURE__ */ B("div", {
1882
1882
  "aria-hidden": !0,
1883
1883
  style: {
1884
1884
  height: b(),
@@ -1886,7 +1886,7 @@ function Xt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1886
1886
  zIndex: -1
1887
1887
  }
1888
1888
  });
1889
- return ve(d, {
1889
+ return ye(d, {
1890
1890
  role: "list",
1891
1891
  ...p,
1892
1892
  className: t,
@@ -1910,26 +1910,26 @@ var Zt = {
1910
1910
  itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
1911
1911
  itemSelectedText: "_itemSelectedText_5skzl_41"
1912
1912
  }, Qt = 44, $t = 8, en = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: u, hasSelectedText: d, onSelect: f }) => {
1913
- let m = r[e], h = q(m.iconUrl, m.type, m.displayName ?? m.id, g.SM), v = m.id === i;
1914
- return /* @__PURE__ */ H("div", {
1913
+ let m = r[e], h = Nt(m.iconUrl, m.type, m.displayName ?? m.id, g.SM), v = m.id === i;
1914
+ return /* @__PURE__ */ B("div", {
1915
1915
  style: t,
1916
1916
  ...n,
1917
- children: /* @__PURE__ */ H(p, {
1917
+ children: /* @__PURE__ */ B(p, {
1918
1918
  type: "button",
1919
1919
  "aria-current": v ? "true" : void 0,
1920
- className: l(Zt.item, "h-full w-full gap-3 px-4", v && u && Zt.itemSelectedBackground, v && d && Zt.itemSelectedText, s, v && c, W.modelMenuItem, v && W.modelMenuItemSelected),
1921
- iconBefore: /* @__PURE__ */ H("span", {
1920
+ className: l(Zt.item, "h-full w-full gap-3 px-4", v && u && Zt.itemSelectedBackground, v && d && Zt.itemSelectedText, s, v && c, H.modelMenuItem, v && H.modelMenuItemSelected),
1921
+ iconBefore: /* @__PURE__ */ B("span", {
1922
1922
  className: Zt.itemIcon,
1923
1923
  children: h
1924
1924
  }),
1925
- label: /* @__PURE__ */ U("span", {
1925
+ label: /* @__PURE__ */ V("span", {
1926
1926
  className: "flex flex-1 items-center justify-between gap-2",
1927
- children: [/* @__PURE__ */ H(S, {
1927
+ children: [/* @__PURE__ */ B(S, {
1928
1928
  text: m.displayName ?? m.id,
1929
1929
  query: o,
1930
1930
  maxLines: 1,
1931
1931
  className: l(a, "min-w-0 flex-1 text-start")
1932
- }), v && /* @__PURE__ */ H(oe, {
1932
+ }), v && /* @__PURE__ */ B(ce, {
1933
1933
  size: g.SM,
1934
1934
  className: Zt.checkIcon,
1935
1935
  "aria-hidden": !0,
@@ -1940,8 +1940,8 @@ var Zt = {
1940
1940
  })
1941
1941
  });
1942
1942
  }, tn = ({ 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: _ }) => {
1943
- let [v, b] = B("");
1944
- L(() => {
1943
+ let [v, b] = R("");
1944
+ F(() => {
1945
1945
  e || b("");
1946
1946
  }, [e]);
1947
1947
  let x = a && a.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? Mt(a, v) : [], T = (e) => {
@@ -1956,32 +1956,32 @@ var Zt = {
1956
1956
  "--ci-sheet-selected-bg": E?.selectedItemBackground,
1957
1957
  "--ci-sheet-selected-text": E?.selectedItemText
1958
1958
  });
1959
- return /* @__PURE__ */ H(Me, {
1959
+ return /* @__PURE__ */ B(U, {
1960
1960
  isOpen: e,
1961
1961
  title: t,
1962
1962
  closeLabel: n,
1963
1963
  onClose: i,
1964
1964
  style: p,
1965
1965
  titleClassName: m,
1966
- className: l("max-h-[80dvh]", _?.className, W.modelMenu),
1966
+ className: l("max-h-[80dvh]", _?.className, H.modelMenu),
1967
1967
  colors: g?.shell,
1968
- children: /* @__PURE__ */ U("div", {
1968
+ children: /* @__PURE__ */ V("div", {
1969
1969
  className: "contents",
1970
1970
  style: D,
1971
- children: [x && !S && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
1971
+ children: [x && !S && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
1972
1972
  style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
1973
- className: l("flex-shrink-0 px-4 py-[10px]", Zt.search, _?.searchHeaderClassName, W.modelMenuSearch),
1974
- children: /* @__PURE__ */ H(j, {
1973
+ className: l("flex-shrink-0 px-4 py-[10px]", Zt.search, _?.searchHeaderClassName, H.modelMenuSearch),
1974
+ children: /* @__PURE__ */ B(A, {
1975
1975
  value: v,
1976
1976
  placeholder: r,
1977
1977
  size: y.Standard,
1978
1978
  onChange: (e) => b(e ?? "")
1979
1979
  })
1980
- }), /* @__PURE__ */ H("div", { className: l(Zt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ H(At, { loadingLabel: u }) : C ? /* @__PURE__ */ H("div", {
1980
+ }), /* @__PURE__ */ B("div", { className: l(Zt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ B(At, { loadingLabel: u }) : C ? /* @__PURE__ */ B("div", {
1981
1981
  role: "list",
1982
1982
  className: l(Zt.stateLabel, h, "px-4 py-4"),
1983
1983
  children: C
1984
- }) : /* @__PURE__ */ H(Xt, {
1984
+ }) : /* @__PURE__ */ B(Xt, {
1985
1985
  role: "list",
1986
1986
  className: "overflow-y-auto",
1987
1987
  style: { height: Math.min(w.length, $t) * Qt },
@@ -2003,7 +2003,7 @@ var Zt = {
2003
2003
  })
2004
2004
  });
2005
2005
  }, nn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, isStreaming: a, isMobile: o, isDisabled: c = !1, style: u, modelPickerOverlay: d, isPickerOpen: f, onPickerToggle: m, onPickerOpenChange: h }) => {
2006
- let [y, b] = B(!1), { selectorIcon: S, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: O, onOpenChange: k } = Pt({
2006
+ let [y, b] = R(!1), { selectorIcon: S, selectorAriaLabel: C, selectedLabel: w, selectedVersion: T, menuItems: E, menuHeader: D, menuStyle: ee, onOpenChange: O } = Pt({
2007
2007
  deployments: e,
2008
2008
  selectedDeploymentId: t,
2009
2009
  onDeploymentChange: n,
@@ -2011,35 +2011,35 @@ var Zt = {
2011
2011
  styles: i
2012
2012
  });
2013
2013
  if (!e) return null;
2014
- let A = a || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, j = /* @__PURE__ */ H(se, {
2014
+ let k = a || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, te = /* @__PURE__ */ B(le, {
2015
2015
  size: g.SM,
2016
- className: l(K.modelSelectorCaret, W.modelSelectorCaret),
2016
+ className: l(G.modelSelectorCaret, H.modelSelectorCaret),
2017
2017
  "aria-hidden": !0,
2018
2018
  stroke: _
2019
- }), M = /* @__PURE__ */ H("span", {
2020
- className: l("flex shrink-0 items-center", W.modelSelectorIcon),
2019
+ }), A = /* @__PURE__ */ B("span", {
2020
+ className: l("flex shrink-0 items-center", H.modelSelectorIcon),
2021
2021
  children: S
2022
2022
  });
2023
- if (o) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(x, {
2023
+ if (o) return /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(x, {
2024
2024
  tooltipProps: { tooltip: w },
2025
- icon: /* @__PURE__ */ U("div", {
2025
+ icon: /* @__PURE__ */ V("div", {
2026
2026
  className: "flex items-center gap-1",
2027
- children: [M, j]
2027
+ children: [A, te]
2028
2028
  }),
2029
2029
  "aria-label": C,
2030
2030
  onClick: () => {
2031
2031
  c || b(!0);
2032
2032
  },
2033
- className: l("w-[50px]", K.modelSelectorButton, A, W.modelSelectorButton)
2034
- }), d ? /* @__PURE__ */ H(Me, {
2033
+ className: l("w-[50px]", G.modelSelectorButton, k, H.modelSelectorButton)
2034
+ }), d ? /* @__PURE__ */ B(U, {
2035
2035
  isOpen: y,
2036
2036
  title: r?.ariaLabel ?? "Select model",
2037
2037
  closeLabel: r?.closeLabel ?? "Close",
2038
2038
  onClose: () => b(!1),
2039
2039
  style: u,
2040
- className: l(i?.className, W.modelMenu),
2040
+ className: l(i?.className, H.modelMenu),
2041
2041
  children: d(() => b(!1))
2042
- }) : /* @__PURE__ */ H(tn, {
2042
+ }) : /* @__PURE__ */ B(tn, {
2043
2043
  isOpen: y,
2044
2044
  title: r?.ariaLabel ?? "Select model",
2045
2045
  closeLabel: r?.closeLabel ?? "Close",
@@ -2056,7 +2056,7 @@ var Zt = {
2056
2056
  })] });
2057
2057
  if (d) {
2058
2058
  let e = T ? `${w} · ${T}` : w;
2059
- return /* @__PURE__ */ H(v, {
2059
+ return /* @__PURE__ */ B(v, {
2060
2060
  placement: "top-end",
2061
2061
  matchReferenceWidth: !1,
2062
2062
  open: f,
@@ -2064,105 +2064,105 @@ var Zt = {
2064
2064
  trigger: [],
2065
2065
  outsideClosable: !0,
2066
2066
  renderOverlay: () => d(() => h?.(!1)),
2067
- listClassName: l("!w-[368px] !bg-layer-raised", i?.className, W.modelMenu),
2068
- children: /* @__PURE__ */ H(p, {
2067
+ listClassName: l("!w-[368px] !bg-layer-raised", i?.className, H.modelMenu),
2068
+ children: /* @__PURE__ */ B(p, {
2069
2069
  "aria-label": C,
2070
2070
  "aria-disabled": c || void 0,
2071
2071
  tooltipProps: { tooltip: e },
2072
- className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 pe-2 ps-1.5", K.modelSelectorButton, A, c && K.modelSelectorButtonDisabled, W.modelSelectorButton),
2072
+ className: l("h-auto min-w-0 gap-1.5 !rounded-full !border-0 px-0 py-1.5 pe-2 ps-1.5", G.modelSelectorButton, k, c && G.modelSelectorButtonDisabled, H.modelSelectorButton),
2073
2073
  onClick: () => {
2074
2074
  !a && !c && m?.();
2075
2075
  },
2076
- iconBefore: M,
2077
- iconAfter: j,
2076
+ iconBefore: A,
2077
+ iconAfter: te,
2078
2078
  textClassName: "min-w-0",
2079
- label: /* @__PURE__ */ U("span", {
2079
+ label: /* @__PURE__ */ V("span", {
2080
2080
  className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
2081
- children: [/* @__PURE__ */ H("span", {
2082
- className: l("dial-small-text max-w-[180px] shrink-0 truncate", K.modelSelectorName),
2081
+ children: [/* @__PURE__ */ B("span", {
2082
+ className: l("dial-small-text max-w-[180px] shrink-0 truncate", G.modelSelectorName),
2083
2083
  children: w
2084
- }), T && /* @__PURE__ */ H("span", {
2085
- className: l("dial-tiny-text min-w-0 truncate", K.modelSelectorVersion),
2084
+ }), T && /* @__PURE__ */ B("span", {
2085
+ className: l("dial-tiny-text min-w-0 truncate", G.modelSelectorVersion),
2086
2086
  children: T
2087
2087
  })]
2088
2088
  })
2089
2089
  })
2090
2090
  });
2091
2091
  }
2092
- return /* @__PURE__ */ H("div", {
2093
- className: l(c && A),
2092
+ return /* @__PURE__ */ B("div", {
2093
+ className: l(c && k),
2094
2094
  "aria-disabled": c || void 0,
2095
- children: /* @__PURE__ */ H(v, {
2095
+ children: /* @__PURE__ */ B(v, {
2096
2096
  items: E,
2097
2097
  menuHeader: D,
2098
2098
  placement: "bottom-end",
2099
2099
  matchReferenceWidth: !1,
2100
2100
  maxDropdownHeight: s,
2101
- listClassName: l("!w-[240px]", i?.className, W.modelMenu),
2102
- listStyle: O,
2101
+ listClassName: l("!w-[240px]", i?.className, H.modelMenu),
2102
+ listStyle: ee,
2103
2103
  disabled: c,
2104
- onOpenChange: c ? void 0 : k,
2105
- children: /* @__PURE__ */ H(p, {
2104
+ onOpenChange: c ? void 0 : O,
2105
+ children: /* @__PURE__ */ B(p, {
2106
2106
  "aria-label": C,
2107
2107
  "aria-disabled": c || void 0,
2108
2108
  tooltipProps: { tooltip: w },
2109
- iconBefore: M,
2110
- iconAfter: j,
2111
- className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", K.modelSelectorButton, c && K.modelSelectorButtonDisabled, W.modelSelectorButton)
2109
+ iconBefore: A,
2110
+ iconAfter: te,
2111
+ className: l("h-auto gap-1 !rounded-full !border-0 p-1.5", G.modelSelectorButton, c && G.modelSelectorButtonDisabled, H.modelSelectorButton)
2112
2112
  })
2113
2113
  })
2114
2114
  });
2115
- }, rn = ye(({ 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: y = "Attach file", fileAccept: S, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: O, sendLabel: k, sendTooltip: A, emptyMessageTooltip: j, stopLabel: M, micLabel: ee = "Dictate", recordVoiceLabel: N = "Record voice", stopRecordingLabel: te, discardRecordingLabel: ne, colors: P, typography: F, attachmentTray: re, modelMenu: ie, className: ae, pendingDropFiles: oe = [], onDropFilesConsumed: se, pendingAttachments: ce = [], onPendingAttachmentsConsumed: de, pasteTextThreshold: fe = 4e3, maxMessageLength: pe = 5e4, deployments: me, selectedDeploymentId: he, onDeploymentChange: ge, modelSelectorLabels: _e, initialAttachments: ve = [], hideAddButton: ye = !1, hideAttachFile: be = !1, hideActionBar: xe = !1, actionRowLayout: we = ot.Stacked, isInlineActionRowAllowedBelowDesktop: Ee = !1, renderFooterActions: De, isInputDisabled: ke = !1, isModelSelectorDisabled: Ae = !1, isSendDisabled: je = !1, isAudioMessageSupported: Me = !1, isVoiceRecordingSupported: Ne = Me, onTranscribeAudio: Fe, transcribingLabel: Ie, voiceErrorLabel: Le, sendOnEnter: Re = at.Enter, prefixAttachments: Ve = [], onRemovePrefixAttachment: He, chatSettings: Ge, toolsMenuItems: Ke, onToolToggle: Xe, canRemoveTools: et = !0, toolsMenuTitle: tt, toolsBackLabel: nt, toolsChipLabels: rt, menuOverlays: st, activeMentions: ct, onBackspaceAtCaret: lt, caretPositionOverride: ut, commandMenu: G, autoFocus: dt = !1, messageHistory: ft, onDialFileSystemClick: pt, dialFileSystemLabel: mt, validateAttachment: ht, onAttachmentClick: gt, modelPickerOverlay: vt, maximumAttachmentsAmount: yt, onAttachmentsLimitExceeded: xt, isAttachmentsEnabled: St = !0, isTextAttachmentsAllowed: Ct = !0, usageLimitsSlot: wt, onMessageTooLong: Ot }, kt) => {
2116
- let At = d(), [jt, Mt] = B(!1), q = Ue(ft), Nt = ct ?? [], Pt = Nt.length > 0, Ft = R(() => c({
2117
- "--ci-bg": P?.background,
2118
- "--ci-text": P?.text,
2119
- "--ci-border": P?.border,
2120
- "--ci-border-focus": P?.borderFocus,
2121
- "--ci-placeholder": P?.placeholder,
2122
- "--ci-text-disabled": P?.textDisabled,
2123
- "--ci-model-selector-caret-color": P?.modelSelectorCaret,
2124
- "--ci-model-selector-hover-bg": P?.modelSelectorHoverBg,
2125
- "--ci-model-selector-disabled-color": P?.modelSelectorDisabled,
2126
- "--ci-model-selector-name-color": P?.modelSelectorName,
2127
- "--ci-model-selector-version-color": P?.modelSelectorVersion,
2128
- "--ci-voice-error": P?.voiceError,
2129
- "--ci-voice-waveform": P?.voiceWaveform,
2130
- "--ci-voice-accent": P?.voiceAccent,
2131
- "--ci-mention-highlight-bg": P?.mentionHighlightBg,
2132
- "--ci-mention-highlight-text": P?.mentionHighlightText,
2133
- "--ci-mention-highlight-unsupported-bg": P?.mentionHighlightUnsupportedBg,
2134
- "--ci-mention-highlight-unsupported-text": P?.mentionHighlightUnsupportedText
2135
- }), [P]), It = R(() => pt ? [{
2115
+ }, Q = be(({ 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: y = "Attach file", fileAccept: S, addMenuTitle: C = "Add", menuTitle: w = "Menu", menuCloseLabel: T = "Close", removeLabel: E, retryLabel: D, uploadingLabel: ee, sendLabel: O, sendTooltip: k, emptyMessageTooltip: te, stopLabel: A, micLabel: ne = "Dictate", recordVoiceLabel: j = "Record voice", stopRecordingLabel: re, discardRecordingLabel: ie, colors: M, typography: N, attachmentTray: ae, modelMenu: oe, className: se, pendingDropFiles: ce = [], onDropFilesConsumed: le, pendingAttachments: ue = [], onPendingAttachmentsConsumed: pe, pasteTextThreshold: me = 4e3, maxMessageLength: he = 5e4, deployments: ge, selectedDeploymentId: _e, onDeploymentChange: ve, modelSelectorLabels: ye, initialAttachments: be = [], hideAddButton: xe = !1, hideAttachFile: Se = !1, hideActionBar: Te = !1, actionRowLayout: De = ot.Stacked, isInlineActionRowAllowedBelowDesktop: Oe = !1, renderFooterActions: Ae, isInputDisabled: je = !1, isModelSelectorDisabled: Me = !1, isSendDisabled: U = !1, isAudioMessageSupported: Ne = !1, isVoiceRecordingSupported: Fe = Ne, onTranscribeAudio: Ie, transcribingLabel: Le, voiceErrorLabel: Re, sendOnEnter: Ve = at.Enter, prefixAttachments: He = [], onRemovePrefixAttachment: Ge, chatSettings: Ke, toolsMenuItems: Xe, onToolToggle: et, canRemoveTools: tt = !0, toolsMenuTitle: nt, toolsBackLabel: rt, toolsChipLabels: st, menuOverlays: ct, activeMentions: lt, onBackspaceAtCaret: ut, caretPositionOverride: dt, commandMenu: W, autoFocus: ft = !1, messageHistory: pt, onDialFileSystemClick: mt, dialFileSystemLabel: ht, validateAttachment: gt, onAttachmentClick: vt, modelPickerOverlay: yt, maximumAttachmentsAmount: xt, onAttachmentsLimitExceeded: St, isAttachmentsEnabled: Ct = !0, isTextAttachmentsAllowed: wt = !0, usageLimitsSlot: Ot, onMessageTooLong: kt }, At) => {
2116
+ let jt = d(), [Mt, Nt] = R(!1), K = Ue(pt), Pt = lt ?? [], Ft = Pt.length > 0, It = I(() => c({
2117
+ "--ci-bg": M?.background,
2118
+ "--ci-text": M?.text,
2119
+ "--ci-border": M?.border,
2120
+ "--ci-border-focus": M?.borderFocus,
2121
+ "--ci-placeholder": M?.placeholder,
2122
+ "--ci-text-disabled": M?.textDisabled,
2123
+ "--ci-model-selector-caret-color": M?.modelSelectorCaret,
2124
+ "--ci-model-selector-hover-bg": M?.modelSelectorHoverBg,
2125
+ "--ci-model-selector-disabled-color": M?.modelSelectorDisabled,
2126
+ "--ci-model-selector-name-color": M?.modelSelectorName,
2127
+ "--ci-model-selector-version-color": M?.modelSelectorVersion,
2128
+ "--ci-voice-error": M?.voiceError,
2129
+ "--ci-voice-waveform": M?.voiceWaveform,
2130
+ "--ci-voice-accent": M?.voiceAccent,
2131
+ "--ci-mention-highlight-bg": M?.mentionHighlightBg,
2132
+ "--ci-mention-highlight-text": M?.mentionHighlightText,
2133
+ "--ci-mention-highlight-unsupported-bg": M?.mentionHighlightUnsupportedBg,
2134
+ "--ci-mention-highlight-unsupported-text": M?.mentionHighlightUnsupportedText
2135
+ }), [M]), Lt = I(() => mt ? [{
2136
2136
  key: "dial-fs",
2137
- label: mt ?? "DIAL file system",
2138
- icon: /* @__PURE__ */ H(le, {
2137
+ label: ht ?? "DIAL file system",
2138
+ icon: /* @__PURE__ */ B(de, {
2139
2139
  size: f,
2140
2140
  "aria-hidden": !0,
2141
2141
  stroke: _
2142
2142
  }),
2143
- onClick: pt
2144
- }] : [], [pt, mt]), { message: J, setMessage: Y, textareaRef: X } = Je({
2143
+ onClick: mt
2144
+ }] : [], [mt, ht]), { message: q, setMessage: J, textareaRef: Y } = Je({
2145
2145
  messageProp: e,
2146
2146
  messageRevision: t
2147
2147
  });
2148
- L(() => {
2149
- n !== void 0 && X.current?.focus();
2150
- }, [n, X]), Se(kt, () => ({ getCaretPosition: () => X.current?.selectionStart ?? J.length }), [J, X]);
2151
- let { handleUndoKeyDown: Lt } = Ze({
2148
+ F(() => {
2149
+ n !== void 0 && Y.current?.focus();
2150
+ }, [n, Y]), Ce(At, () => ({ getCaretPosition: () => Y.current?.selectionStart ?? q.length }), [q, Y]);
2151
+ let { handleUndoKeyDown: Rt } = Ze({
2152
2152
  insertion: r,
2153
- textareaRef: X
2154
- }), { isMenuOpen: Rt, query: Z, activeWordStart: Q, dismiss: zt, closeOnOutsidePress: Bt, handleCaretMove: Vt, handleValueChange: Ht, listboxId: Ut, overlayRef: Wt, activeOptionId: Gt, moveActiveOption: Kt, getActiveOption: qt } = Be({
2155
- config: G,
2156
- message: J
2157
- }), Jt = () => {
2158
- Vt(X.current?.selectionStart ?? J.length);
2159
- }, Yt = () => {
2153
+ textareaRef: Y
2154
+ }), { isMenuOpen: X, query: zt, activeWordStart: Z, dismiss: Bt, closeOnOutsidePress: Vt, handleCaretMove: Ht, handleValueChange: Ut, listboxId: Wt, overlayRef: Gt, activeOptionId: Kt, moveActiveOption: qt, getActiveOption: Jt } = Be({
2155
+ config: W,
2156
+ message: q
2157
+ }), Yt = () => {
2158
+ Ht(Y.current?.selectionStart ?? q.length);
2159
+ }, Xt = () => {
2160
2160
  requestAnimationFrame(() => {
2161
- Vt(X.current?.selectionStart ?? J.length);
2161
+ Ht(Y.current?.selectionStart ?? q.length);
2162
2162
  });
2163
- }, Xt = (e) => {
2164
- e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Vt(e.currentTarget.selectionStart ?? J.length);
2165
- }, Zt = G?.emptyQueryHint != null, Qt = G != null && Q != null ? Q + G.triggerPrefix.length : null, $t = Qt != null && J.slice(Qt).split("\n", 1)[0] !== "", en = Zt && Rt && Z === "" && Qt != null && !$t, tn = G != null && Rt ? Q ?? 0 : null, rn = z(null), an = z(null), [on, sn] = B(null), cn = I(() => {
2163
+ }, Zt = (e) => {
2164
+ e.key !== "ArrowLeft" && e.key !== "ArrowRight" && e.key !== "Home" && e.key !== "End" && e.key !== "PageUp" && e.key !== "PageDown" || Ht(e.currentTarget.selectionStart ?? q.length);
2165
+ }, Qt = W?.emptyQueryHint != null, $t = W != null && Z != null ? Z + W.triggerPrefix.length : null, en = $t != null && q.slice($t).split("\n", 1)[0] !== "", tn = Qt && X && zt === "" && $t != null && !en, Q = W != null && X ? Z ?? 0 : null, rn = L(null), an = L(null), [on, sn] = R(null), cn = P(() => {
2166
2166
  let e = rn.current, t = an.current;
2167
2167
  if (e == null || t == null) {
2168
2168
  sn(null);
@@ -2174,254 +2174,254 @@ var Zt = {
2174
2174
  top: n.top - r.top
2175
2175
  });
2176
2176
  }, []);
2177
- Ce(() => {
2177
+ we(() => {
2178
2178
  cn();
2179
2179
  }, [
2180
2180
  cn,
2181
- tn,
2182
- J
2183
- ]), L(() => {
2184
- if (tn == null) return;
2185
- let e = X.current;
2181
+ Q,
2182
+ q
2183
+ ]), F(() => {
2184
+ if (Q == null) return;
2185
+ let e = Y.current;
2186
2186
  if (e == null || typeof ResizeObserver > "u") return;
2187
2187
  let t = new ResizeObserver(cn);
2188
2188
  return t.observe(e), () => t.disconnect();
2189
2189
  }, [
2190
- tn,
2191
- X,
2190
+ Q,
2191
+ Y,
2192
2192
  cn
2193
2193
  ]);
2194
2194
  let { mirrorRef: ln, selectionRects: un, updateSelectionRects: dn } = qe({
2195
- textareaRef: X,
2196
- message: J,
2197
- hasActiveMentions: Pt
2198
- }), fn = I((e) => {
2199
- if (G == null || (zt(), !e?.consumeQuery) || (e.returnFocus !== !1 && X.current?.focus(), Q == null)) return;
2200
- let t = `${G.triggerPrefix}${Z}`, n = Q + t.length;
2201
- if (J.slice(Q, n) !== t) return;
2202
- let r = J.slice(0, Q) + J.slice(n);
2203
- Y(r), q.notifyChange(), u?.(r);
2195
+ textareaRef: Y,
2196
+ message: q,
2197
+ hasActiveMentions: Ft
2198
+ }), fn = P((e) => {
2199
+ if (W == null || (Bt(), !e?.consumeQuery) || (e.returnFocus !== !1 && Y.current?.focus(), Z == null)) return;
2200
+ let t = `${W.triggerPrefix}${zt}`, n = Z + t.length;
2201
+ if (q.slice(Z, n) !== t) return;
2202
+ let r = q.slice(0, Z) + q.slice(n);
2203
+ J(r), K.notifyChange(), u?.(r);
2204
2204
  }, [
2205
- G,
2205
+ W,
2206
+ Bt,
2206
2207
  zt,
2208
+ q,
2207
2209
  Z,
2208
2210
  J,
2209
- Q,
2210
- Y,
2211
- q,
2211
+ K,
2212
2212
  u,
2213
- X
2214
- ]), pn = z(void 0);
2215
- L(() => {
2216
- ut == null || pn.current === t || (pn.current = t, X.current?.setSelectionRange(ut, ut), Vt(ut));
2217
- }, [J]);
2213
+ Y
2214
+ ]), pn = L(void 0);
2215
+ F(() => {
2216
+ dt == null || pn.current === t || (pn.current = t, Y.current?.setSelectionRange(dt, dt), Ht(dt));
2217
+ }, [q]);
2218
2218
  let { attachments: mn, buildAttachments: hn, addAttachments: gn, resetAttachments: _n, handleRemove: vn, handleRetry: yn, handleExpand: bn, hasBlockedAttachments: xn } = Pe({
2219
- initialAttachments: ve,
2219
+ initialAttachments: be,
2220
2220
  onUploadAttachment: a,
2221
2221
  onAttachmentsChange: p,
2222
- validateAttachment: ht,
2223
- pendingDropFiles: oe,
2224
- onDropFilesConsumed: se,
2225
- pendingAttachments: ce,
2226
- onPendingAttachmentsConsumed: de,
2227
- onExpandPastedText: I((e) => {
2228
- Y((t) => t ? `${t}\n${e}` : e);
2229
- }, [Y]),
2230
- maximumAttachmentsAmount: yt,
2231
- baseAttachmentsAmount: Ve.length,
2232
- onAttachmentsLimitExceeded: xt
2233
- }), Sn = I((e) => {
2222
+ validateAttachment: gt,
2223
+ pendingDropFiles: ce,
2224
+ onDropFilesConsumed: le,
2225
+ pendingAttachments: ue,
2226
+ onPendingAttachmentsConsumed: pe,
2227
+ onExpandPastedText: P((e) => {
2228
+ J((t) => t ? `${t}\n${e}` : e);
2229
+ }, [J]),
2230
+ maximumAttachmentsAmount: xt,
2231
+ baseAttachmentsAmount: He.length,
2232
+ onAttachmentsLimitExceeded: St
2233
+ }), Sn = P((e) => {
2234
2234
  gn(hn([e]));
2235
- }, [gn, hn]), Cn = z(!1), wn = z(J);
2236
- wn.current = J;
2237
- let [Tn, En] = B({
2235
+ }, [gn, hn]), Cn = L(!1), wn = L(q);
2236
+ wn.current = q;
2237
+ let [Tn, En] = R({
2238
2238
  text: "",
2239
2239
  revision: 0
2240
2240
  }), { state: Dn, analyserNodeRef: On, errorMessage: kn, startRecording: An, stopRecording: jn, discardRecording: Mn } = it({
2241
2241
  onAttachAudio: Sn,
2242
- onTranscribeAudio: Fe,
2243
- onTranscript: I((e) => {
2242
+ onTranscribeAudio: Ie,
2243
+ onTranscript: P((e) => {
2244
2244
  let t = e.trim();
2245
2245
  if (t) {
2246
2246
  let e = wn.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
2247
- wn.current = n, Y(n), En((e) => ({
2247
+ wn.current = n, J(n), En((e) => ({
2248
2248
  text: t,
2249
2249
  revision: e.revision + 1
2250
- })), q.notifyChange(), u?.(n);
2250
+ })), K.notifyChange(), u?.(n);
2251
2251
  }
2252
2252
  Cn.current = !0;
2253
2253
  }, [
2254
- Y,
2255
- q,
2254
+ J,
2255
+ K,
2256
2256
  u
2257
2257
  ]),
2258
- errorLabel: Le
2258
+ errorLabel: Re
2259
2259
  }), $ = Dn === Qe.Recording || Dn === Qe.Processing;
2260
- L(() => {
2261
- (Dn === Qe.Error || Dn === Qe.Idle && Cn.current) && (Cn.current = !1, X.current?.focus());
2262
- }, [Dn, X]);
2263
- let Nn = z(null), Pn = z(null), Fn = St && Ct, { handlePaste: In } = Oe(gn, Fn ? fe : Infinity), Ln = I((e) => {
2260
+ F(() => {
2261
+ (Dn === Qe.Error || Dn === Qe.Idle && Cn.current) && (Cn.current = !1, Y.current?.focus());
2262
+ }, [Dn, Y]);
2263
+ let Nn = L(null), Pn = L(null), Fn = Ct && wt, { handlePaste: In } = ke(gn, Fn ? me : Infinity), Ln = P((e) => {
2264
2264
  if (!Fn) {
2265
2265
  let t = e.clipboardData.getData("text/plain");
2266
- t.length >= pe && Ot?.(t.length, pe);
2266
+ t.length >= he && kt?.(t.length, he);
2267
2267
  }
2268
2268
  In(e);
2269
2269
  }, [
2270
2270
  Fn,
2271
- pe,
2272
- Ot,
2271
+ he,
2272
+ kt,
2273
2273
  In
2274
- ]), Rn = J.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !je && !$, [Bn, Vn] = B([]);
2275
- L(() => {
2274
+ ]), Rn = q.trim().length > 0 || mn.length > 0, zn = Rn && !xn && !U && !$, [Bn, Vn] = R([]);
2275
+ F(() => {
2276
2276
  Vn([]);
2277
- }, [(Ke ?? []).map((e) => e.id).join("|")]);
2278
- let Hn = R(() => {
2279
- let e = Ke ?? [];
2280
- return et ? e.filter((e) => e.isSelected || !Bn.includes(e.id)) : e;
2277
+ }, [(Xe ?? []).map((e) => e.id).join("|")]);
2278
+ let Hn = I(() => {
2279
+ let e = Xe ?? [];
2280
+ return tt ? e.filter((e) => e.isSelected || !Bn.includes(e.id)) : e;
2281
2281
  }, [
2282
- Ke,
2282
+ Xe,
2283
2283
  Bn,
2284
- et
2285
- ]), Un = I((e) => {
2286
- Vn((t) => t.includes(e) ? t : [...t, e]), Ke?.find((t) => t.id === e)?.isSelected && Xe?.(e);
2287
- }, [Ke, Xe]), Wn = me === void 0 || he != null, Gn = Me && !s, Kn = async () => {
2288
- if (je || $) return;
2289
- if (J.length >= pe) {
2290
- Ot?.(J.length, pe);
2284
+ tt
2285
+ ]), Un = P((e) => {
2286
+ Vn((t) => t.includes(e) ? t : [...t, e]), Xe?.find((t) => t.id === e)?.isSelected && et?.(e);
2287
+ }, [Xe, et]), Wn = ge === void 0 || _e != null, Gn = Ne && !s, Kn = async () => {
2288
+ if (U || $) return;
2289
+ if (q.length >= he) {
2290
+ kt?.(q.length, he);
2291
2291
  return;
2292
2292
  }
2293
- let e = J, t = mn;
2294
- Y(""), q.reset();
2293
+ let e = q, t = mn;
2294
+ J(""), K.reset();
2295
2295
  try {
2296
2296
  await i?.(e, t), t.forEach((e) => {
2297
2297
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
2298
2298
  }), _n([]);
2299
2299
  } catch {
2300
- Y(e), _n(t);
2300
+ J(e), _n(t);
2301
2301
  }
2302
- }, qn = (e) => Re === at.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
2303
- if (!Rt || e.nativeEvent.isComposing) return !1;
2304
- if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), zt(), !0;
2305
- if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), Kt(e.key === "ArrowDown" ? ze.Next : ze.Previous), !0;
2302
+ }, qn = (e) => Ve === at.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey, Jn = (e) => {
2303
+ if (!X || e.nativeEvent.isComposing) return !1;
2304
+ if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), Bt(), !0;
2305
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), qt(e.key === "ArrowDown" ? ze.Next : ze.Previous), !0;
2306
2306
  if (e.key !== "Enter" || e.shiftKey) return !1;
2307
- let t = qt();
2307
+ let t = Jt();
2308
2308
  return t == null ? qn(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
2309
2309
  }, Yn = (e) => {
2310
- if (!$ && !Lt(e) && !Jn(e)) {
2311
- if (!e.nativeEvent.isComposing && !ke && !s) {
2310
+ if (!$ && !Rt(e) && !Jn(e)) {
2311
+ if (!e.nativeEvent.isComposing && !je && !s) {
2312
2312
  if (e.key === "ArrowUp" || e.key === "ArrowDown") {
2313
- let t = e.currentTarget.selectionStart ?? 0, n = q.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
2313
+ let t = e.currentTarget.selectionStart ?? 0, n = K.navigate(e.key === "ArrowUp" ? "up" : "down", q, t);
2314
2314
  if (n !== null) {
2315
- e.preventDefault(), Y(n);
2315
+ e.preventDefault(), J(n);
2316
2316
  return;
2317
2317
  }
2318
2318
  }
2319
- if (e.key === "Backspace" && lt != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
2320
- let t = lt(e.currentTarget.selectionStart);
2319
+ if (e.key === "Backspace" && ut != null && e.currentTarget.selectionStart === e.currentTarget.selectionEnd && e.currentTarget.selectionStart != null) {
2320
+ let t = ut(e.currentTarget.selectionStart);
2321
2321
  if (t != null) {
2322
2322
  e.preventDefault();
2323
2323
  let n = e.currentTarget;
2324
- n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ye(n, J.slice(0, t.start) + J.slice(t.start + t.length), t.start);
2324
+ n.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || Ye(n, q.slice(0, t.start) + q.slice(t.start + t.length), t.start);
2325
2325
  return;
2326
2326
  }
2327
2327
  }
2328
2328
  }
2329
- e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !ke && Kn());
2329
+ e.key === "Enter" && qn(e) && (e.preventDefault(), !s && zn && Wn && !je && Kn());
2330
2330
  }
2331
2331
  }, Xn = (e) => {
2332
2332
  let t = Array.from(e.target.files ?? []);
2333
2333
  if (t.length === 0) return;
2334
2334
  let n = hn(t);
2335
2335
  e.target.value = "", gn(n);
2336
- }, Zn = R(() => {
2336
+ }, Zn = I(() => {
2337
2337
  let e = [];
2338
- return tn != null && e.push({
2339
- offset: tn,
2340
- node: /* @__PURE__ */ H("span", {
2338
+ return Q != null && e.push({
2339
+ offset: Q,
2340
+ node: /* @__PURE__ */ B("span", {
2341
2341
  ref: rn,
2342
2342
  "aria-hidden": !0,
2343
2343
  className: "inline-block h-[1lh] w-0 align-text-top"
2344
2344
  }, "caret-marker")
2345
- }), en && G != null && Qt != null && e.push({
2346
- offset: Qt,
2347
- node: /* @__PURE__ */ H("span", {
2348
- className: K.commandHint,
2345
+ }), tn && W != null && $t != null && e.push({
2346
+ offset: $t,
2347
+ node: /* @__PURE__ */ B("span", {
2348
+ className: G.commandHint,
2349
2349
  "aria-hidden": !0,
2350
2350
  "data-mirror-synthetic": !0,
2351
- children: G.emptyQueryHint
2351
+ children: W.emptyQueryHint
2352
2352
  }, "command-hint")
2353
2353
  }), e;
2354
2354
  }, [
2355
+ Q,
2355
2356
  tn,
2356
- en,
2357
- G,
2358
- Qt
2359
- ]), Qn = /* @__PURE__ */ H("textarea", {
2360
- className: l(K.textarea, (Pt || Zn.length > 0) && K.textareaMentionMode, F?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2361
- ref: X,
2362
- autoFocus: dt,
2363
- value: J,
2357
+ W,
2358
+ $t
2359
+ ]), Qn = /* @__PURE__ */ B("textarea", {
2360
+ className: l(G.textarea, (Ft || Zn.length > 0) && G.textareaMentionMode, N?.fontClassName || "dial-body-paragraph-text", "relative z-0 max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent pe-1 ps-1 outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
2361
+ ref: Y,
2362
+ autoFocus: ft,
2363
+ value: q,
2364
2364
  onChange: (e) => {
2365
- Y(e.target.value), q.notifyChange();
2365
+ J(e.target.value), K.notifyChange();
2366
2366
  let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
2367
- Ht(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2367
+ Ut(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), u?.(e.target.value);
2368
2368
  },
2369
2369
  onSelect: dn,
2370
- onFocus: Yt,
2371
- onClick: Jt,
2370
+ onFocus: Xt,
2371
+ onClick: Yt,
2372
2372
  onKeyDown: Yn,
2373
- onKeyUp: Xt,
2373
+ onKeyUp: Zt,
2374
2374
  onPaste: Ln,
2375
2375
  placeholder: m,
2376
2376
  "aria-label": h,
2377
- "aria-autocomplete": G == null ? void 0 : "list",
2378
- "aria-controls": Rt ? Ut : void 0,
2379
- "aria-activedescendant": Gt ?? void 0,
2380
- "aria-hidden": Pt ? !0 : void 0,
2381
- disabled: ke,
2377
+ "aria-autocomplete": W == null ? void 0 : "list",
2378
+ "aria-controls": X ? Wt : void 0,
2379
+ "aria-activedescendant": Kt ?? void 0,
2380
+ "aria-hidden": Ft ? !0 : void 0,
2381
+ disabled: je,
2382
2382
  readOnly: $,
2383
2383
  rows: 1
2384
- }), $n = G == null ? Qn : /* @__PURE__ */ U(V, { children: [Qn, /* @__PURE__ */ H("div", {
2384
+ }), $n = W == null ? Qn : /* @__PURE__ */ V(z, { children: [Qn, /* @__PURE__ */ B("div", {
2385
2385
  "aria-hidden": !0,
2386
- className: l("pointer-events-none absolute", F?.fontClassName || "dial-body-paragraph-text"),
2386
+ className: l("pointer-events-none absolute", N?.fontClassName || "dial-body-paragraph-text"),
2387
2387
  style: {
2388
2388
  left: on?.left ?? 0,
2389
2389
  top: on?.top ?? 0
2390
2390
  },
2391
- children: /* @__PURE__ */ H(v, {
2392
- open: Rt,
2391
+ children: /* @__PURE__ */ B(v, {
2392
+ open: X,
2393
2393
  onOpenChange: (e) => {
2394
- e || Bt();
2394
+ e || Vt();
2395
2395
  },
2396
2396
  placement: "top-start",
2397
2397
  trigger: [],
2398
2398
  initialFocus: -1,
2399
2399
  matchReferenceWidth: !1,
2400
- outsidePressIgnoreRef: X,
2401
- renderOverlay: () => /* @__PURE__ */ H("div", {
2402
- ref: Wt,
2403
- role: G.menuLabel == null ? void 0 : "group",
2404
- "aria-label": G.menuLabel,
2405
- children: G.renderMenu({
2406
- query: Z,
2407
- caretPosition: Q ?? 0,
2400
+ outsidePressIgnoreRef: Y,
2401
+ renderOverlay: () => /* @__PURE__ */ B("div", {
2402
+ ref: Gt,
2403
+ role: W.menuLabel == null ? void 0 : "group",
2404
+ "aria-label": W.menuLabel,
2405
+ children: W.renderMenu({
2406
+ query: zt,
2407
+ caretPosition: Z ?? 0,
2408
2408
  close: fn,
2409
- listboxId: Ut,
2410
- activeOptionId: Gt
2409
+ listboxId: Wt,
2410
+ activeOptionId: Kt
2411
2411
  })
2412
2412
  }),
2413
- children: /* @__PURE__ */ H("span", {
2413
+ children: /* @__PURE__ */ B("span", {
2414
2414
  "aria-hidden": !0,
2415
2415
  className: "inline-block h-[1lh] w-0"
2416
2416
  })
2417
2417
  })
2418
- })] }), er = /* @__PURE__ */ U("div", {
2418
+ })] }), er = /* @__PURE__ */ V("div", {
2419
2419
  ref: an,
2420
2420
  className: "relative -me-1 -ms-1 w-[calc(100%+8px)]",
2421
- children: [(Pt || Zn.length > 0) && /* @__PURE__ */ U("div", {
2421
+ children: [(Ft || Zn.length > 0) && /* @__PURE__ */ V("div", {
2422
2422
  ref: ln,
2423
- className: l(K.textarea, F?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden whitespace-pre-wrap pe-1 ps-1 [overflow-wrap:anywhere]"),
2424
- children: [We(J, Nt, Zn, K.mentionHighlight, K.mentionHighlightUnsupported), un.map((e, t) => /* @__PURE__ */ H("div", {
2423
+ className: l(G.textarea, N?.fontClassName || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden whitespace-pre-wrap pe-1 ps-1 [overflow-wrap:anywhere]"),
2424
+ children: [We(q, Pt, Zn, G.mentionHighlight, G.mentionHighlightUnsupported), un.map((e, t) => /* @__PURE__ */ B("div", {
2425
2425
  "aria-hidden": !0,
2426
2426
  className: "pointer-events-none absolute rounded-sm bg-control-accent-alpha-active",
2427
2427
  style: {
@@ -2432,63 +2432,63 @@ var Zt = {
2432
2432
  }
2433
2433
  }, `selection-${t}`))]
2434
2434
  }), $n]
2435
- }), tr = ye ? void 0 : /* @__PURE__ */ H(_t, {
2436
- onAttachClick: be ? void 0 : () => Nn.current?.click(),
2435
+ }), tr = xe ? void 0 : /* @__PURE__ */ B(_t, {
2436
+ onAttachClick: Se ? void 0 : () => Nn.current?.click(),
2437
2437
  attachLabel: y,
2438
2438
  addMenuTitle: C,
2439
2439
  menuTitle: w,
2440
2440
  menuCloseLabel: T,
2441
- style: Ft,
2442
- isDisabled: ke || $,
2443
- chatSettings: Ge,
2444
- extraMenuItems: It,
2445
- onRecordVoice: Ne && St && !s && !$ ? () => An($e.Attachment) : void 0,
2446
- recordVoiceLabel: N,
2447
- toolsMenuItems: et ? Ke : void 0,
2448
- onToolToggle: Xe,
2449
- toolsMenuTitle: tt,
2450
- toolsBackLabel: nt,
2451
- menuOverlays: st,
2452
- getCaretPosition: () => X.current?.selectionStart ?? J.length
2453
- }), nr = we === ot.Inline && (!At || Ee), rr = tr && /* @__PURE__ */ H("div", {
2454
- className: l("flex", W.addCluster),
2441
+ style: It,
2442
+ isDisabled: je || $,
2443
+ chatSettings: Ke,
2444
+ extraMenuItems: Lt,
2445
+ onRecordVoice: Fe && Ct && !s && !$ ? () => An($e.Attachment) : void 0,
2446
+ recordVoiceLabel: j,
2447
+ toolsMenuItems: tt ? Xe : void 0,
2448
+ onToolToggle: et,
2449
+ toolsMenuTitle: nt,
2450
+ toolsBackLabel: rt,
2451
+ menuOverlays: ct,
2452
+ getCaretPosition: () => Y.current?.selectionStart ?? q.length
2453
+ }), nr = De === ot.Inline && (!jt || Oe), rr = tr && /* @__PURE__ */ B("div", {
2454
+ className: l("flex", H.addCluster),
2455
2455
  children: tr
2456
- }), ir = Hn.length > 0 && Xe != null && /* @__PURE__ */ H("div", {
2457
- className: l("min-w-0 flex-1", W.toolsChips),
2458
- children: /* @__PURE__ */ H(bt, {
2456
+ }), ir = Hn.length > 0 && et != null && /* @__PURE__ */ B("div", {
2457
+ className: l("min-w-0 flex-1", H.toolsChips),
2458
+ children: /* @__PURE__ */ B(bt, {
2459
2459
  items: Hn,
2460
- onToolToggle: Xe,
2460
+ onToolToggle: et,
2461
2461
  onToolDismiss: Un,
2462
- canRemove: et,
2463
- removeLabel: rt?.removeLabel,
2464
- stateOnLabel: rt?.stateOnLabel,
2465
- stateOffLabel: rt?.stateOffLabel
2462
+ canRemove: tt,
2463
+ removeLabel: st?.removeLabel,
2464
+ stateOnLabel: st?.stateOnLabel,
2465
+ stateOffLabel: st?.stateOffLabel
2466
2466
  })
2467
2467
  });
2468
- return /* @__PURE__ */ U("div", {
2468
+ return /* @__PURE__ */ V("div", {
2469
2469
  ref: Pn,
2470
- style: Ft,
2471
- className: l(K.wrapper, ke && K.wrapperDisabled, ke && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", mn.length > 6 ? "py-4 ps-4" : "p-4", ae, W.wrapper),
2470
+ style: It,
2471
+ className: l(G.wrapper, je && G.wrapperDisabled, je && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", mn.length > 6 ? "py-4 ps-4" : "p-4", se, H.wrapper),
2472
2472
  children: [
2473
- (Ve.length > 0 || mn.length > 0) && /* @__PURE__ */ H(Te, {
2474
- attachments: [...Ve, ...mn],
2473
+ (He.length > 0 || mn.length > 0) && /* @__PURE__ */ B(Ee, {
2474
+ attachments: [...He, ...mn],
2475
2475
  onRemove: (e) => {
2476
- Ve.some((t) => t.id === e) ? He?.(e) : vn(e);
2476
+ He.some((t) => t.id === e) ? Ge?.(e) : vn(e);
2477
2477
  },
2478
2478
  onRetry: yn,
2479
2479
  onExpand: bn,
2480
2480
  labels: {
2481
2481
  removeLabel: E,
2482
2482
  retryLabel: D,
2483
- uploadingLabel: O
2483
+ uploadingLabel: ee
2484
2484
  },
2485
- styles: re,
2486
- onAttachmentClick: gt == null ? void 0 : (e) => {
2487
- let t = [...Ve, ...mn].find((t) => t.id === e);
2488
- t != null && gt(t);
2485
+ styles: ae,
2486
+ onAttachmentClick: vt == null ? void 0 : (e) => {
2487
+ let t = [...He, ...mn].find((t) => t.id === e);
2488
+ t != null && vt(t);
2489
2489
  }
2490
2490
  }),
2491
- !ye && /* @__PURE__ */ H("input", {
2491
+ !xe && /* @__PURE__ */ B("input", {
2492
2492
  ref: Nn,
2493
2493
  type: "file",
2494
2494
  multiple: !0,
@@ -2498,11 +2498,11 @@ var Zt = {
2498
2498
  tabIndex: -1,
2499
2499
  onChange: Xn
2500
2500
  }),
2501
- kn && /* @__PURE__ */ H(b, {
2501
+ kn && /* @__PURE__ */ B(b, {
2502
2502
  text: kn,
2503
2503
  className: "min-w-0 break-words px-1"
2504
2504
  }),
2505
- $ && /* @__PURE__ */ H(Tt, {
2505
+ $ && /* @__PURE__ */ B(Tt, {
2506
2506
  embedded: !0,
2507
2507
  state: Dn,
2508
2508
  analyserNodeRef: On,
@@ -2510,112 +2510,112 @@ var Zt = {
2510
2510
  onStop: jn,
2511
2511
  onDiscard: Mn,
2512
2512
  attachButton: tr,
2513
- stopLabel: te,
2514
- discardLabel: ne,
2515
- processingLabel: Ie
2513
+ stopLabel: re,
2514
+ discardLabel: ie,
2515
+ processingLabel: Le
2516
2516
  }),
2517
- !$ && xe && er,
2518
- !$ && !xe && nr && ir && /* @__PURE__ */ H("div", {
2517
+ !$ && Te && er,
2518
+ !$ && !Te && nr && ir && /* @__PURE__ */ B("div", {
2519
2519
  className: "flex",
2520
2520
  children: ir
2521
2521
  }),
2522
- !$ && !xe && /* @__PURE__ */ U("div", {
2523
- className: l("flex items-center gap-2", nr ? "flex-nowrap" : "flex-wrap", W.actionRow),
2522
+ !$ && !Te && /* @__PURE__ */ V("div", {
2523
+ className: l("flex items-center gap-2", nr ? "flex-nowrap" : "flex-wrap", H.actionRow),
2524
2524
  children: [
2525
2525
  nr && rr,
2526
- /* @__PURE__ */ H("div", {
2527
- className: l("flex min-w-0 items-center self-stretch", nr ? "flex-1" : "w-full", W.textareaWrap),
2526
+ /* @__PURE__ */ B("div", {
2527
+ className: l("flex min-w-0 items-center self-stretch", nr ? "flex-1" : "w-full", H.textareaWrap),
2528
2528
  children: er
2529
2529
  }),
2530
2530
  !nr && rr,
2531
2531
  !nr && ir,
2532
- /* @__PURE__ */ H("div", {
2533
- className: l("ms-auto flex flex-shrink-0 items-center gap-2", W.footerActions),
2534
- children: De ? De({
2532
+ /* @__PURE__ */ B("div", {
2533
+ className: l("ms-auto flex flex-shrink-0 items-center gap-2", H.footerActions),
2534
+ children: Ae ? Ae({
2535
2535
  canSend: zn,
2536
2536
  onSend: Kn
2537
- }) : /* @__PURE__ */ U(V, { children: [
2538
- wt,
2539
- /* @__PURE__ */ H(nn, {
2540
- deployments: me,
2541
- selectedDeploymentId: he,
2542
- onDeploymentChange: ge,
2543
- modelSelectorLabels: _e,
2544
- menuStyles: ie,
2537
+ }) : /* @__PURE__ */ V(z, { children: [
2538
+ Ot,
2539
+ /* @__PURE__ */ B(nn, {
2540
+ deployments: ge,
2541
+ selectedDeploymentId: _e,
2542
+ onDeploymentChange: ve,
2543
+ modelSelectorLabels: ye,
2544
+ menuStyles: oe,
2545
2545
  isStreaming: s,
2546
- isMobile: At,
2547
- isDisabled: Ae,
2548
- style: Ft,
2549
- modelPickerOverlay: vt,
2550
- isPickerOpen: jt,
2551
- onPickerToggle: () => Mt((e) => !e),
2552
- onPickerOpenChange: Mt
2546
+ isMobile: jt,
2547
+ isDisabled: Me,
2548
+ style: It,
2549
+ modelPickerOverlay: yt,
2550
+ isPickerOpen: Mt,
2551
+ onPickerToggle: () => Nt((e) => !e),
2552
+ onPickerOpenChange: Nt
2553
2553
  }),
2554
- Gn && /* @__PURE__ */ H(x, {
2555
- icon: /* @__PURE__ */ H(ue, {
2554
+ Gn && /* @__PURE__ */ B(x, {
2555
+ icon: /* @__PURE__ */ B(fe, {
2556
2556
  size: g.LG,
2557
2557
  stroke: _,
2558
2558
  "aria-hidden": !0
2559
2559
  }),
2560
- "aria-label": ee,
2561
- tooltipProps: { tooltip: ee },
2560
+ "aria-label": ne,
2561
+ tooltipProps: { tooltip: ne },
2562
2562
  className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
2563
2563
  onClick: () => An($e.Dictation),
2564
- disabled: ke || s
2564
+ disabled: je || s
2565
2565
  }),
2566
- s && o ? /* @__PURE__ */ H(Dt, {
2566
+ s && o ? /* @__PURE__ */ B(Dt, {
2567
2567
  onStop: o,
2568
- ariaLabel: M
2569
- }) : !s && /* @__PURE__ */ H(Et, {
2568
+ ariaLabel: A
2569
+ }) : !s && /* @__PURE__ */ B(Et, {
2570
2570
  onSend: Kn,
2571
2571
  isDisabled: !Wn || !zn,
2572
- ariaLabel: k,
2573
- sendTooltip: Rn ? A : j ?? A
2572
+ ariaLabel: O,
2573
+ sendTooltip: Rn ? k : te ?? k
2574
2574
  })
2575
2575
  ] })
2576
2576
  })
2577
2577
  ]
2578
2578
  }),
2579
- /* @__PURE__ */ H("span", {
2579
+ /* @__PURE__ */ B("span", {
2580
2580
  className: "sr-only",
2581
2581
  role: "status",
2582
2582
  "aria-live": "polite",
2583
2583
  "aria-atomic": "true",
2584
- children: /* @__PURE__ */ H("span", { children: Tn.text }, Tn.revision)
2584
+ children: /* @__PURE__ */ B("span", { children: Tn.text }, Tn.revision)
2585
2585
  })
2586
2586
  ]
2587
2587
  });
2588
2588
  });
2589
- rn.displayName = "Input";
2590
- var an = {
2589
+ Q.displayName = "Input";
2590
+ var rn = {
2591
2591
  welcome: "_welcome_1icyo_1",
2592
2592
  description: "_description_1icyo_5"
2593
- }, on = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, styles: a, className: o, inputClassName: s, isInputDisabled: u = !1, ...d }) => {
2593
+ }, an = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, belowWelcomeSlot: i, styles: a, className: o, inputClassName: s, isInputDisabled: u = !1, ...d }) => {
2594
2594
  let { colors: f, typography: p, attachmentTray: m, modelMenu: h } = a ?? {};
2595
- return /* @__PURE__ */ U("div", {
2595
+ return /* @__PURE__ */ V("div", {
2596
2596
  style: c({
2597
2597
  "--ci-welcome-color": f?.welcomeText,
2598
2598
  "--ci-description-color": f?.descriptionText
2599
2599
  }),
2600
2600
  className: l("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", o),
2601
2601
  children: [
2602
- n && /* @__PURE__ */ U("div", {
2602
+ n && /* @__PURE__ */ V("div", {
2603
2603
  className: "flex flex-col items-center gap-4 text-center",
2604
- children: [/* @__PURE__ */ H("h1", {
2605
- className: l(an.welcome, "m-0", p?.welcomeClassName || "dial-display2-text"),
2604
+ children: [/* @__PURE__ */ B("h1", {
2605
+ className: l(rn.welcome, "m-0", p?.welcomeClassName || "dial-display2-text"),
2606
2606
  children: n
2607
- }), r && /* @__PURE__ */ H("p", {
2608
- className: l(an.description, "m-0 max-w-[540px]", p?.descriptionClassName || "dial-body-paragraph-text"),
2607
+ }), r && /* @__PURE__ */ B("p", {
2608
+ className: l(rn.description, "m-0 max-w-[540px]", p?.descriptionClassName || "dial-body-paragraph-text"),
2609
2609
  children: r
2610
2610
  })]
2611
2611
  }),
2612
- i != null && /* @__PURE__ */ H("div", {
2612
+ i != null && /* @__PURE__ */ B("div", {
2613
2613
  className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
2614
2614
  children: i
2615
2615
  }),
2616
- /* @__PURE__ */ H("div", {
2616
+ /* @__PURE__ */ B("div", {
2617
2617
  className: l("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
2618
- children: /* @__PURE__ */ H(rn, {
2618
+ children: /* @__PURE__ */ B(Q, {
2619
2619
  placeholder: t,
2620
2620
  isStreaming: e,
2621
2621
  isInputDisabled: u,
@@ -2629,42 +2629,42 @@ var an = {
2629
2629
  })
2630
2630
  ]
2631
2631
  });
2632
- }, sn = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, initialAttachments: u = [], onCancel: d, onSave: p, onUploadAttachment: m, cancelLabel: h = "Cancel", saveLabel: g = "Save & Submit", ariaLabel: v, removeLabel: y, retryLabel: b, uploadingLabel: x, addMenuTitle: S = "Add", attachLabel: C = "Attach file", menuTitle: T = "Menu", menuCloseLabel: E = "Close", className: O, pendingDropFiles: k, onDropFilesConsumed: A, validateAttachment: j, isAttachmentsEnabled: M, isTextAttachmentsAllowed: ee, hideAttachFile: N = !1, fileAccept: te, maximumAttachmentsAmount: ne, onAttachmentsLimitExceeded: P, onDialFileSystemClick: F, dialFileSystemLabel: re, pendingAttachments: ie, onPendingAttachmentsConsumed: ae, onAttachmentClick: oe, pasteTextThreshold: se, maxMessageLength: ce = 5e4, onMessageTooLong: ue }) => {
2633
- let de = z(null), fe = z(null), [pe, me] = B([]);
2634
- L(() => {
2635
- k?.length && (me(k), A?.());
2636
- }, [k, A]);
2637
- let [he, ge] = B(e ?? ""), [_e, ve] = B([]), [ye, be] = B(u), xe = _e.some((e) => e.status === a.Loading || e.status === a.Error), Se = (he.trim().length > 0 || _e.length > 0 || ye.length > 0) && !xe, Ce = (e) => {
2638
- be((t) => t.filter((t) => t.id !== e));
2639
- }, we = I((e, t) => {
2640
- p(e, ye, t);
2641
- }, [ye, p]), V = () => {
2642
- if (Se) {
2643
- if (he.length >= ce) {
2644
- ue?.(he.length, ce);
2632
+ }, on = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, initialAttachments: u = [], onCancel: d, onSave: p, onUploadAttachment: m, cancelLabel: h = "Cancel", saveLabel: g = "Save & Submit", ariaLabel: v, removeLabel: y, retryLabel: b, uploadingLabel: x, addMenuTitle: S = "Add", attachLabel: C = "Attach file", menuTitle: T = "Menu", menuCloseLabel: E = "Close", className: D, pendingDropFiles: O, onDropFilesConsumed: k, validateAttachment: te, isAttachmentsEnabled: A, isTextAttachmentsAllowed: ne, hideAttachFile: j = !1, fileAccept: re, maximumAttachmentsAmount: ie, onAttachmentsLimitExceeded: M, onDialFileSystemClick: N, dialFileSystemLabel: ae, pendingAttachments: oe, onPendingAttachmentsConsumed: se, onAttachmentClick: ce, pasteTextThreshold: le, maxMessageLength: ue = 5e4, onMessageTooLong: fe }) => {
2633
+ let pe = L(null), me = L(null), [he, ge] = R([]);
2634
+ F(() => {
2635
+ O?.length && (ge(O), k?.());
2636
+ }, [O, k]);
2637
+ let [_e, ve] = R(e ?? ""), [ye, be] = R([]), [xe, Se] = R(u), 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) => {
2638
+ Se((t) => t.filter((t) => t.id !== e));
2639
+ }, z = P((e, t) => {
2640
+ p(e, xe, t);
2641
+ }, [xe, p]), Ee = () => {
2642
+ if (we) {
2643
+ if (_e.length >= ue) {
2644
+ fe?.(_e.length, ue);
2645
2645
  return;
2646
2646
  }
2647
- we(he, _e);
2647
+ z(_e, ye);
2648
2648
  }
2649
- }, Te = I(() => me([]), []), Ee = I((e) => {
2650
- ge(e), n?.(e);
2651
- }, [n]), De = I((e) => {
2649
+ }, De = P(() => ge([]), []), Oe = P((e) => {
2650
+ ve(e), n?.(e);
2651
+ }, [n]), ke = P((e) => {
2652
2652
  let t = Array.from(e.target.files ?? []);
2653
- t.length !== 0 && (e.target.value = "", me(t));
2654
- }, []), Oe = R(() => F ? [{
2653
+ t.length !== 0 && (e.target.value = "", ge(t));
2654
+ }, []), H = I(() => N ? [{
2655
2655
  key: "dial-fs",
2656
- label: re ?? "DIAL file system",
2657
- icon: /* @__PURE__ */ H(le, {
2656
+ label: ae ?? "DIAL file system",
2657
+ icon: /* @__PURE__ */ B(de, {
2658
2658
  size: f,
2659
2659
  "aria-hidden": !0,
2660
2660
  stroke: _
2661
2661
  }),
2662
- onClick: F
2663
- }] : [], [F, re]);
2664
- return /* @__PURE__ */ U("div", {
2665
- className: l("flex w-full flex-col gap-2", O),
2666
- children: [/* @__PURE__ */ H(rn, {
2667
- ref: fe,
2662
+ onClick: N
2663
+ }] : [], [N, ae]);
2664
+ return /* @__PURE__ */ V("div", {
2665
+ className: l("flex w-full flex-col gap-2", D),
2666
+ children: [/* @__PURE__ */ B(Q, {
2667
+ ref: me,
2668
2668
  message: e,
2669
2669
  messageRevision: t,
2670
2670
  activeMentions: r,
@@ -2673,70 +2673,70 @@ var an = {
2673
2673
  commandMenu: s,
2674
2674
  ariaLabel: v,
2675
2675
  hideActionBar: !0,
2676
- pendingDropFiles: pe,
2677
- onDropFilesConsumed: Te,
2678
- onSend: we,
2676
+ pendingDropFiles: he,
2677
+ onDropFilesConsumed: De,
2678
+ onSend: z,
2679
2679
  onUploadAttachment: m,
2680
- onChange: Ee,
2681
- onAttachmentsChange: ve,
2680
+ onChange: Oe,
2681
+ onAttachmentsChange: be,
2682
2682
  removeLabel: y,
2683
2683
  retryLabel: b,
2684
2684
  uploadingLabel: x,
2685
2685
  className: "max-w-full",
2686
- prefixAttachments: ye,
2687
- onRemovePrefixAttachment: Ce,
2688
- validateAttachment: j,
2689
- isAttachmentsEnabled: M,
2690
- isTextAttachmentsAllowed: ee,
2691
- maximumAttachmentsAmount: ne,
2692
- onAttachmentsLimitExceeded: P,
2693
- pendingAttachments: ie,
2694
- onPendingAttachmentsConsumed: ae,
2695
- onAttachmentClick: oe,
2696
- pasteTextThreshold: se,
2697
- maxMessageLength: ce,
2698
- onMessageTooLong: ue
2699
- }), /* @__PURE__ */ U("div", {
2686
+ prefixAttachments: xe,
2687
+ onRemovePrefixAttachment: Te,
2688
+ validateAttachment: te,
2689
+ isAttachmentsEnabled: A,
2690
+ isTextAttachmentsAllowed: ne,
2691
+ maximumAttachmentsAmount: ie,
2692
+ onAttachmentsLimitExceeded: M,
2693
+ pendingAttachments: oe,
2694
+ onPendingAttachmentsConsumed: se,
2695
+ onAttachmentClick: ce,
2696
+ pasteTextThreshold: le,
2697
+ maxMessageLength: ue,
2698
+ onMessageTooLong: fe
2699
+ }), /* @__PURE__ */ V("div", {
2700
2700
  className: "flex items-center justify-between",
2701
- children: [/* @__PURE__ */ U("div", {
2701
+ children: [/* @__PURE__ */ V("div", {
2702
2702
  className: "flex",
2703
- children: [!N && /* @__PURE__ */ H("input", {
2704
- ref: de,
2703
+ children: [!j && /* @__PURE__ */ B("input", {
2704
+ ref: pe,
2705
2705
  type: "file",
2706
2706
  multiple: !0,
2707
- accept: te,
2707
+ accept: re,
2708
2708
  className: "sr-only",
2709
2709
  "aria-hidden": !0,
2710
2710
  tabIndex: -1,
2711
- onChange: De
2712
- }), (!N || (c?.length ?? 0) > 0) && /* @__PURE__ */ H(_t, {
2713
- onAttachClick: N ? void 0 : () => de.current?.click(),
2711
+ onChange: ke
2712
+ }), (!j || (c?.length ?? 0) > 0) && /* @__PURE__ */ B(_t, {
2713
+ onAttachClick: j ? void 0 : () => pe.current?.click(),
2714
2714
  attachLabel: C,
2715
2715
  addMenuTitle: S,
2716
2716
  menuTitle: T,
2717
2717
  menuCloseLabel: E,
2718
- extraMenuItems: Oe,
2718
+ extraMenuItems: H,
2719
2719
  menuOverlays: c,
2720
- getCaretPosition: () => fe.current?.getCaretPosition() ?? 0
2720
+ getCaretPosition: () => me.current?.getCaretPosition() ?? 0
2721
2721
  })]
2722
- }), /* @__PURE__ */ U("div", {
2722
+ }), /* @__PURE__ */ V("div", {
2723
2723
  className: "flex gap-2",
2724
- children: [/* @__PURE__ */ H(w, {
2724
+ children: [/* @__PURE__ */ B(w, {
2725
2725
  label: h,
2726
2726
  onClick: d
2727
- }), /* @__PURE__ */ H(D, {
2727
+ }), /* @__PURE__ */ B(ee, {
2728
2728
  label: g,
2729
- onClick: V,
2730
- disabled: !Se
2729
+ onClick: Ee,
2730
+ disabled: !we
2731
2731
  })]
2732
2732
  })]
2733
2733
  })]
2734
2734
  });
2735
- }, cn = (e) => {
2736
- let [t, n] = B({
2735
+ }, sn = (e) => {
2736
+ let [t, n] = R({
2737
2737
  text: e?.text,
2738
2738
  revision: e?.revision ?? 0
2739
- }), r = I((e) => {
2739
+ }), r = P((e) => {
2740
2740
  n((t) => ({
2741
2741
  text: e,
2742
2742
  revision: t.revision + 1
@@ -2747,11 +2747,11 @@ var an = {
2747
2747
  messageRevision: t.revision,
2748
2748
  seedMessage: r
2749
2749
  };
2750
- }, ln = (e, t) => {
2751
- let n = z(e), r = z(t);
2752
- r.current = t, L(() => {
2750
+ }, cn = (e, t) => {
2751
+ let n = L(e), r = L(t);
2752
+ r.current = t, F(() => {
2753
2753
  e !== n.current && (n.current = e, r.current());
2754
2754
  }, [e]);
2755
2755
  };
2756
2756
  //#endregion
2757
- export { ot as ActionRowLayout, Me as BottomSheetShell, W as CONVERSATION_INPUT_CLASS, pt as ChatSettingsModal, on as ConversationInput, sn as EditMessageInput, rn as Input, at as SendOnEnter, cn as useComposerSeed, ln as useComposerSeedSource };
2757
+ export { ot as ActionRowLayout, U as BottomSheetShell, H as CONVERSATION_INPUT_CLASS, pt as ChatSettingsModal, an as ConversationInput, on as EditMessageInput, Q as Input, at as SendOnEnter, sn as useComposerSeed, cn as useComposerSeedSource };