@epam/ai-dial-conversation-input 1.1.0-dev.177 → 1.1.0-dev.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RequestStatus as r, ResponseFormat as i, buildCssVars as a, mergeClasses as o, useIsMobile as s } from "@epam/ai-dial-chat-shared";
2
2
  import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, DialRadioGroup as p, DialSearch as m, DialSlider as h, DialTooltip as g, Dropdown as _, ElementSize as v, ErrorText as y, GhostIconButton as b, Highlight as x, Input as S, NeutralButton as C, Popup as w, PopupSize as T, PrimaryButton as E, PrimaryIconButton as D, RadioGroupOrientation as O, Skeleton as k, SkeletonVariant as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
3
- import { IconArrowLeft as M, IconArrowNarrowRight as N, IconCheck as ee, IconChevronDown as P, IconChevronRight as te, IconFile as ne, IconMicrophone as re, IconPaperclip as F, IconPlayerStopFilled as ie, IconPlaystationSquare as ae, IconPlus as oe, IconSettings as se, IconTool as ce, IconX as le } from "@tabler/icons-react";
4
- import { createPortal as ue } from "react-dom";
5
- import { createElement as de, memo as I, useCallback as L, useEffect as R, useImperativeHandle as fe, useLayoutEffect as pe, useMemo as z, useRef as B, useState as V } from "react";
3
+ import { IconArrowLeft as ee, IconArrowNarrowRight as M, IconCheck as te, IconChevronDown as N, IconChevronRight as ne, IconFile as re, IconMicrophone as ie, IconPaperclip as ae, IconPlayerStopFilled as oe, IconPlaystationSquare as se, IconPlus as ce, IconPrompt as le, IconSettings as ue, IconTool as de, IconX as P } from "@tabler/icons-react";
4
+ import { createPortal as F } from "react-dom";
5
+ import { createElement as I, memo as fe, useCallback as L, useEffect as R, useImperativeHandle as pe, useLayoutEffect as me, useMemo as z, useRef as B, useState as V } from "react";
6
6
  import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
7
- import { AttachmentCard as me, AttachmentGroup as G, AttachmentTray as he, AttachmentTray as ge, FileDndOverlay as _e, MAX_UPLOADS_PER_MINUTE as ve, generateAttachmentId as ye, getAttachmentIcon as be, useClipboardPaste as xe } from "@epam/ai-dial-attachment-input";
7
+ import { AttachmentCard as he, AttachmentGroup as ge, AttachmentTray as _e, AttachmentTray as ve, FileDndOverlay as ye, MAX_UPLOADS_PER_MINUTE as be, generateAttachmentId as xe, getAttachmentIcon as Se, useClipboardPaste as Ce } from "@epam/ai-dial-attachment-input";
8
8
  //#region src/hooks/useBottomSheet.ts
9
- var Se = (e, t) => {
9
+ var we = (e, t) => {
10
10
  R(() => {
11
11
  if (!e) return;
12
12
  let n = (e) => {
@@ -18,22 +18,22 @@ var Se = (e, t) => {
18
18
  document.body.style.overflow = "";
19
19
  };
20
20
  }, [e]);
21
- }, Ce = {
21
+ }, Te = {
22
22
  backdrop: "_backdrop_1d50f_9",
23
23
  sheet: "_sheet_1d50f_13",
24
24
  "slide-up": "_slide-up_1d50f_1",
25
25
  title: "_title_1d50f_18",
26
26
  divider: "_divider_1d50f_22"
27
- }, K = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: m, children: h }) => {
28
- if (Se(e, r), !e || typeof document > "u") return null;
27
+ }, G = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: m, children: h }) => {
28
+ if (we(e, r), !e || typeof document > "u") return null;
29
29
  let g = a({
30
30
  "--ci-backdrop": m?.backdrop,
31
31
  "--ci-sheet-bg": m?.sheetBg,
32
32
  "--ci-sheet-text": m?.sheetText,
33
33
  "--ci-sheet-divider": m?.divider
34
34
  });
35
- return ue(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
36
- className: o(Ce.backdrop, "fixed inset-0 z-[55]"),
35
+ return F(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
36
+ className: o(Te.backdrop, "fixed inset-0 z-[55]"),
37
37
  style: g,
38
38
  onPointerDown: r,
39
39
  "aria-hidden": !0
@@ -45,14 +45,14 @@ var Se = (e, t) => {
45
45
  ...g,
46
46
  ...l
47
47
  },
48
- className: o(Ce.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", p),
48
+ className: o(Te.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", p),
49
49
  children: [t != null && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("div", {
50
50
  className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
51
51
  children: [
52
52
  i && /* @__PURE__ */ U("div", {
53
53
  className: "absolute start-4",
54
54
  children: /* @__PURE__ */ U(b, {
55
- icon: /* @__PURE__ */ U(M, {
55
+ icon: /* @__PURE__ */ U(ee, {
56
56
  size: d.LG,
57
57
  stroke: 1.5,
58
58
  className: "rtl:scale-x-[-1]"
@@ -62,7 +62,7 @@ var Se = (e, t) => {
62
62
  })
63
63
  }),
64
64
  /* @__PURE__ */ U("span", {
65
- className: o(Ce.title, f),
65
+ className: o(Te.title, f),
66
66
  children: t
67
67
  }),
68
68
  /* @__PURE__ */ U("div", {
@@ -74,16 +74,16 @@ var Se = (e, t) => {
74
74
  })
75
75
  })
76
76
  ]
77
- }), /* @__PURE__ */ U("div", { className: o(Ce.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
77
+ }), /* @__PURE__ */ U("div", { className: o(Te.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
78
78
  className: "overflow-y-auto",
79
79
  children: h
80
80
  })]
81
81
  })] }), document.body);
82
- }, we = async (e, t, n) => {
82
+ }, Ee = async (e, t, n) => {
83
83
  let r = 6e4 / t, i = [];
84
84
  for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
85
85
  await Promise.allSettled(i);
86
- }, Te = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
86
+ }, De = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
87
87
  let [h, g] = V(n), _ = B(h);
88
88
  R(() => {
89
89
  _.current = h;
@@ -95,7 +95,7 @@ var Se = (e, t) => {
95
95
  let v = L((e) => e.map((e) => {
96
96
  let n = e.type.startsWith("image/"), i = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = i ? URL.createObjectURL(e) : void 0;
97
97
  return {
98
- id: ye(),
98
+ id: xe(),
99
99
  name: e.name,
100
100
  contentType: e.type,
101
101
  file: e,
@@ -166,7 +166,7 @@ var Se = (e, t) => {
166
166
  status: r.Error,
167
167
  errorReason: n
168
168
  } : e));
169
- }), we(e, ve, C);
169
+ }), Ee(e, be, C);
170
170
  }
171
171
  }
172
172
  }, [
@@ -245,7 +245,7 @@ var Se = (e, t) => {
245
245
  ]),
246
246
  hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
247
247
  };
248
- }, Ee = (e, t) => {
248
+ }, Oe = (e, t) => {
249
249
  let [n, r] = V(e), [i, a] = V(!1), [o, s] = V(0);
250
250
  return R(() => {
251
251
  if (e) {
@@ -263,12 +263,12 @@ var Se = (e, t) => {
263
263
  isExiting: i,
264
264
  instanceKey: o
265
265
  };
266
- }, De = (e, t) => !e.slice(0, t).includes("\n"), Oe = (e, t) => !e.slice(t).includes("\n"), ke = (e) => {
266
+ }, ke = (e, t) => !e.slice(0, t).includes("\n"), Ae = (e, t) => !e.slice(t).includes("\n"), je = (e) => {
267
267
  let t = B(e);
268
268
  t.current = e;
269
269
  let n = B(-1), r = B(""), i = L((e, i, a) => {
270
270
  let o = t.current;
271
- return !o || o.length === 0 ? null : e === "up" ? !De(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 || !Oe(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
271
+ return !o || o.length === 0 ? null : e === "up" ? !ke(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 || !Ae(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
272
272
  }, []), a = L(() => {
273
273
  n.current = -1, r.current = "";
274
274
  }, []), o = L(() => {
@@ -283,13 +283,13 @@ var Se = (e, t) => {
283
283
  a,
284
284
  o
285
285
  ]);
286
- }, Ae = ({ messageProp: e, messageRevision: t }) => {
286
+ }, Me = ({ messageProp: e, messageRevision: t }) => {
287
287
  let [n, r] = V(e), i = B(null), a = B(0), [o, s] = V(!1);
288
288
  return R(() => {
289
289
  r(e);
290
290
  }, [e, t]), R(() => {
291
291
  i.current && (a.current = i.current.offsetHeight);
292
- }, []), pe(() => {
292
+ }, []), me(() => {
293
293
  if (!i.current || a.current === 0) return;
294
294
  let e = i.current.offsetHeight > a.current;
295
295
  s((t) => e ? !0 : n === "" ? !1 : t);
@@ -299,13 +299,13 @@ var Se = (e, t) => {
299
299
  textareaRef: i,
300
300
  isMultiLine: o
301
301
  };
302
- }, je = /* @__PURE__ */ function(e) {
302
+ }, Ne = /* @__PURE__ */ function(e) {
303
303
  return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
304
- }({}), Me = [
304
+ }({}), Pe = [
305
305
  "audio/webm;codecs=opus",
306
306
  "audio/ogg;codecs=opus",
307
307
  "audio/webm"
308
- ], Ne = () => Me.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Pe = ({ onAttachAudio: e }) => {
308
+ ], Fe = () => Pe.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Ie = ({ onAttachAudio: e }) => {
309
309
  let [t, n] = V("idle"), [r, i] = V(null), a = B(null), o = B(null), s = B(null), c = B(null), l = B([]), u = B(""), d = B(e);
310
310
  d.current = e;
311
311
  let f = L(() => {
@@ -319,7 +319,7 @@ var Se = (e, t) => {
319
319
  o.current = t;
320
320
  let r = t.createAnalyser();
321
321
  r.fftSize = 256, s.current = r, t.createMediaStreamSource(e).connect(r);
322
- let i = Ne();
322
+ let i = Fe();
323
323
  u.current = i, l.current = [];
324
324
  let d = new MediaRecorder(e, i ? { mimeType: i } : void 0);
325
325
  c.current = d, d.ondataavailable = (e) => {
@@ -349,12 +349,12 @@ var Se = (e, t) => {
349
349
  stopRecording: m,
350
350
  discardRecording: h
351
351
  };
352
- }, Fe = /* @__PURE__ */ function(e) {
352
+ }, Le = /* @__PURE__ */ function(e) {
353
353
  return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
354
- }({}), Ie = {
354
+ }({}), Re = {
355
355
  item: "_item_5iycw_1",
356
356
  itemIcon: "_itemIcon_5iycw_11"
357
- }, Le = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
357
+ }, ze = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
358
358
  let m = (e) => {
359
359
  e(), r();
360
360
  }, h = a({
@@ -363,7 +363,7 @@ var Se = (e, t) => {
363
363
  "--ci-sheet-item-active": p?.itemActiveBg,
364
364
  "--ci-sheet-icon": p?.itemIcon
365
365
  });
366
- return /* @__PURE__ */ U(K, {
366
+ return /* @__PURE__ */ U(G, {
367
367
  isOpen: e,
368
368
  title: t,
369
369
  closeLabel: n,
@@ -378,9 +378,9 @@ var Se = (e, t) => {
378
378
  style: h,
379
379
  children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(l, {
380
380
  type: "button",
381
- className: o(Ie.item, "w-full gap-3 px-4 py-[10px] text-start"),
381
+ className: o(Re.item, "w-full gap-3 px-4 py-[10px] text-start"),
382
382
  iconBefore: /* @__PURE__ */ U("span", {
383
- className: Ie.itemIcon,
383
+ className: Re.itemIcon,
384
384
  children: n
385
385
  }),
386
386
  iconAfter: r ? /* @__PURE__ */ U("span", {
@@ -396,7 +396,7 @@ var Se = (e, t) => {
396
396
  }) }, e))
397
397
  })
398
398
  });
399
- }, Re = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
399
+ }, Be = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
400
400
  let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
401
401
  R(() => {
402
402
  o && !p.current && (c(t), u(n), f(r)), p.current = o;
@@ -429,12 +429,12 @@ var Se = (e, t) => {
429
429
  a
430
430
  ])
431
431
  };
432
- }, ze = { label: "_label_14i7c_1" }, Be = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
432
+ }, Ve = { label: "_label_14i7c_1" }, He = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
433
433
  "Precise",
434
434
  "Neutral",
435
435
  "Creative"
436
436
  ], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: C }) => {
437
- let w = a({ "--csf-label-text": C?.labelText }), T = o(x, ze.label, "gap-1");
437
+ let w = a({ "--csf-label-text": C?.labelText }), T = o(x, Ve.label, "gap-1");
438
438
  return /* @__PURE__ */ W("div", {
439
439
  className: "flex flex-col gap-4 px-6 py-3",
440
440
  style: w,
@@ -479,8 +479,8 @@ var Se = (e, t) => {
479
479
  })
480
480
  ]
481
481
  });
482
- }, Ve = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: _, systemPromptLabel: v, systemPromptTooltip: y, temperatureLabel: b, temperatureLabels: x, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
483
- let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: M, handleSubmit: N } = Re({
482
+ }, Ue = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: _, systemPromptLabel: v, systemPromptTooltip: y, temperatureLabel: b, temperatureLabels: x, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
483
+ let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: ee, handleSubmit: M } = Be({
484
484
  isOpen: e,
485
485
  features: s,
486
486
  initialResponseFormat: c,
@@ -489,7 +489,7 @@ var Se = (e, t) => {
489
489
  onSave: d,
490
490
  onClose: r
491
491
  });
492
- return /* @__PURE__ */ W(K, {
492
+ return /* @__PURE__ */ W(G, {
493
493
  isOpen: e,
494
494
  title: f,
495
495
  closeLabel: i,
@@ -497,14 +497,14 @@ var Se = (e, t) => {
497
497
  onBack: t,
498
498
  backLabel: n,
499
499
  style: a,
500
- children: [/* @__PURE__ */ U(Be, {
500
+ children: [/* @__PURE__ */ U(He, {
501
501
  features: s,
502
502
  responseFormat: T,
503
503
  systemPrompt: D,
504
504
  temperature: O,
505
505
  onResponseFormatChange: A,
506
506
  onSystemPromptChange: j,
507
- onTemperatureChange: M,
507
+ onTemperatureChange: ee,
508
508
  responseFormatLabel: p,
509
509
  responseFormatHint: m,
510
510
  responseFormatMarkdownLabel: h,
@@ -522,15 +522,15 @@ var Se = (e, t) => {
522
522
  triggerClassName: "w-full",
523
523
  children: /* @__PURE__ */ U(E, {
524
524
  label: C,
525
- onClick: N,
525
+ onClick: M,
526
526
  disabled: !k,
527
527
  className: "w-full"
528
528
  })
529
529
  })
530
530
  })]
531
531
  });
532
- }, He = { modal: "_modal_od073_1" }, Ue = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = He.modal }) => {
533
- let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Re({
532
+ }, We = { modal: "_modal_od073_1" }, Ge = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = We.modal }) => {
533
+ let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Be({
534
534
  features: e,
535
535
  initialResponseFormat: t,
536
536
  initialSystemPrompt: n,
@@ -556,7 +556,7 @@ var Se = (e, t) => {
556
556
  })
557
557
  })
558
558
  }),
559
- children: /* @__PURE__ */ U(Be, {
559
+ children: /* @__PURE__ */ U(He, {
560
560
  features: e,
561
561
  responseFormat: b,
562
562
  systemPrompt: x,
@@ -576,11 +576,11 @@ var Se = (e, t) => {
576
576
  })
577
577
  });
578
578
  };
579
- I(Ue);
580
- var We = {
579
+ fe(Ge);
580
+ var Ke = {
581
581
  icon: "_icon_1fv6z_1",
582
582
  selectedIcon: "_selectedIcon_1fv6z_5"
583
- }, Ge = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: m }) => /* @__PURE__ */ U(K, {
583
+ }, qe = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: m }) => /* @__PURE__ */ U(G, {
584
584
  isOpen: e,
585
585
  title: u,
586
586
  closeLabel: i,
@@ -603,12 +603,12 @@ var We = {
603
603
  "aria-checked": e.isSelected,
604
604
  className: "w-full gap-3 px-4 py-[10px] text-start",
605
605
  iconBefore: /* @__PURE__ */ U("span", {
606
- className: o("flex items-center", We.icon),
606
+ className: o("flex items-center", Ke.icon),
607
607
  children: e.icon
608
608
  }),
609
609
  iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
610
- className: o("ms-auto", We.selectedIcon),
611
- children: /* @__PURE__ */ U(ee, {
610
+ className: o("ms-auto", Ke.selectedIcon),
611
+ children: /* @__PURE__ */ U(te, {
612
612
  size: c,
613
613
  "aria-hidden": !0
614
614
  })
@@ -621,102 +621,142 @@ var We = {
621
621
  })
622
622
  }, e.id))
623
623
  })
624
- }), Ke = {
624
+ }), K = {
625
625
  selectedToolIcon: "_selectedToolIcon_r268y_1",
626
626
  toolIcon: "_toolIcon_r268y_5",
627
627
  chevronIcon: "_chevronIcon_r268y_9"
628
- }, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: h, toolsMenuItems: g = [], onToolToggle: y, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", colors: C }) => {
629
- let w = s(), [T, E] = V(!1), [D, O] = V(!1), [k, A] = V(!1), j = z(() => a({
630
- "--aab-selected-tool-icon": C?.selectedToolIcon,
631
- "--aab-tool-icon": C?.toolIcon,
632
- "--aab-chevron-icon": C?.chevronIcon
628
+ }, Je = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: h, toolsMenuItems: g = [], onToolToggle: y, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
629
+ let D = s(), [O, k] = V(!1), [A, j] = V(!1), [ee, M] = V(!1), [N, re] = V(!1), [ie, oe] = V(!1), [se, P] = V(!1), F = z(() => a({
630
+ "--aab-selected-tool-icon": E?.selectedToolIcon,
631
+ "--aab-tool-icon": E?.toolIcon,
632
+ "--aab-chevron-icon": E?.chevronIcon
633
633
  }), [
634
- C?.selectedToolIcon,
635
- C?.toolIcon,
636
- C?.chevronIcon
637
- ]), M = g.length > 0 && y != null, N = z(() => g.map((e) => ({
634
+ E?.selectedToolIcon,
635
+ E?.toolIcon,
636
+ E?.chevronIcon
637
+ ]), I = g.length > 0 && y != null, fe = z(() => g.map((e) => ({
638
638
  key: e.id,
639
639
  label: /* @__PURE__ */ W("span", {
640
640
  className: "flex flex-1 items-center gap-2",
641
641
  children: [/* @__PURE__ */ U("span", {
642
642
  className: "flex-1",
643
643
  children: e.label
644
- }), e.isSelected && /* @__PURE__ */ U(ee, {
644
+ }), e.isSelected && /* @__PURE__ */ U(te, {
645
645
  size: c,
646
- style: j,
647
- className: Ke.selectedToolIcon,
646
+ style: F,
647
+ className: K.selectedToolIcon,
648
648
  "aria-hidden": !0
649
649
  })]
650
650
  }),
651
651
  icon: /* @__PURE__ */ U("span", {
652
- style: j,
653
- className: o("flex items-center", Ke.toolIcon),
652
+ style: F,
653
+ className: o("flex items-center", K.toolIcon),
654
654
  children: e.icon
655
655
  }),
656
656
  onClick: () => y?.(e.id)
657
657
  })), [
658
658
  g,
659
659
  y,
660
- j
661
- ]), P = z(() => [
660
+ F
661
+ ]), L = z(() => [
662
662
  ...e == null ? [] : [{
663
663
  key: "attach",
664
664
  label: t,
665
- icon: /* @__PURE__ */ U(F, {
665
+ icon: /* @__PURE__ */ U(ae, {
666
666
  size: c,
667
667
  "aria-hidden": !0
668
668
  }),
669
669
  onClick: e
670
670
  }],
671
671
  ...h ?? [],
672
- ...M ? [{
672
+ ...I ? [{
673
673
  key: "tools",
674
674
  label: x,
675
- icon: /* @__PURE__ */ U(ce, {
675
+ icon: /* @__PURE__ */ U(de, {
676
676
  size: c,
677
677
  "aria-hidden": !0
678
678
  }),
679
- onClick: w ? () => {
680
- A(!0), E(!1);
679
+ onClick: D ? () => {
680
+ M(!0), k(!1);
681
681
  } : () => void 0,
682
- ...w ? { iconAfter: /* @__PURE__ */ U(te, {
682
+ ...D ? { iconAfter: /* @__PURE__ */ U(ne, {
683
683
  size: c,
684
684
  stroke: 1.5,
685
- style: j,
686
- className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
685
+ style: F,
686
+ className: o("rtl:scale-x-[-1]", K.chevronIcon),
687
687
  "aria-hidden": !0
688
- }) } : { children: N }
688
+ }) } : { children: fe }
689
689
  }] : [],
690
+ ...C == null ? [] : [{
691
+ key: "prompts",
692
+ label: w,
693
+ icon: /* @__PURE__ */ U(le, {
694
+ size: c,
695
+ "aria-hidden": !0
696
+ }),
697
+ onClick: D ? () => {
698
+ re(!0), k(!1);
699
+ } : () => {
700
+ oe(!1), P(!0);
701
+ },
702
+ iconAfter: D ? /* @__PURE__ */ U(ne, {
703
+ size: c,
704
+ stroke: 1.5,
705
+ style: F,
706
+ className: o("rtl:scale-x-[-1]", K.chevronIcon),
707
+ "aria-hidden": !0
708
+ }) : null
709
+ }],
690
710
  ...m == null ? [] : [{
691
711
  key: "chat-settings",
692
712
  label: m.menuItemLabel ?? "Chat settings",
693
- icon: /* @__PURE__ */ U(se, {
713
+ icon: /* @__PURE__ */ U(ue, {
694
714
  size: c,
695
715
  "aria-hidden": !0
696
716
  }),
697
- iconAfter: w ? /* @__PURE__ */ U(te, {
717
+ iconAfter: D ? /* @__PURE__ */ U(ne, {
698
718
  size: c,
699
719
  stroke: 1.5,
700
- style: j,
701
- className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
720
+ style: F,
721
+ className: o("rtl:scale-x-[-1]", K.chevronIcon),
702
722
  "aria-hidden": !0
703
723
  }) : null,
704
- onClick: () => O(!0)
724
+ onClick: () => j(!0)
705
725
  }]
706
726
  ], [
707
727
  t,
708
728
  e,
709
729
  m,
710
730
  h,
711
- w,
712
- M,
731
+ D,
732
+ I,
713
733
  x,
714
- N,
715
- j
734
+ fe,
735
+ C,
736
+ w,
737
+ F
716
738
  ]);
717
- return P.length === 0 ? null : /* @__PURE__ */ U(H, { children: w ? /* @__PURE__ */ W(H, { children: [
739
+ if (L.length === 0) return null;
740
+ let R = /* @__PURE__ */ U(_, {
741
+ matchReferenceWidth: !1,
742
+ placement: "bottom-start",
743
+ listClassName: f,
744
+ items: L,
745
+ open: C == null ? void 0 : ie,
746
+ onOpenChange: C == null ? void 0 : oe,
747
+ children: /* @__PURE__ */ U(b, {
748
+ icon: /* @__PURE__ */ U(ce, {
749
+ size: d.LG,
750
+ "aria-hidden": !0
751
+ }),
752
+ "aria-label": n,
753
+ tooltipProps: { tooltip: n },
754
+ disabled: p
755
+ })
756
+ });
757
+ return /* @__PURE__ */ U(H, { children: D ? /* @__PURE__ */ W(H, { children: [
718
758
  /* @__PURE__ */ U(b, {
719
- icon: /* @__PURE__ */ U(oe, {
759
+ icon: /* @__PURE__ */ U(ce, {
720
760
  size: d.LG,
721
761
  "aria-hidden": !0
722
762
  }),
@@ -724,38 +764,50 @@ var We = {
724
764
  size: v.Large,
725
765
  tooltipProps: { tooltip: n },
726
766
  disabled: p,
727
- onClick: () => E(!0)
767
+ onClick: () => k(!0)
728
768
  }),
729
- /* @__PURE__ */ U(Le, {
730
- isOpen: T,
769
+ /* @__PURE__ */ U(ze, {
770
+ isOpen: O,
731
771
  title: r,
732
772
  closeLabel: l,
733
- onClose: () => E(!1),
773
+ onClose: () => k(!1),
734
774
  style: u,
735
- items: P,
775
+ items: L,
736
776
  className: "pb-4",
737
777
  btnTextClassName: "flex-1"
738
778
  }),
739
- M && /* @__PURE__ */ U(Ge, {
740
- isOpen: k,
779
+ I && /* @__PURE__ */ U(qe, {
780
+ isOpen: ee,
741
781
  onBack: () => {
742
- A(!1), E(!0);
782
+ M(!1), k(!0);
743
783
  },
744
784
  backLabel: S,
745
- onClose: () => A(!1),
785
+ onClose: () => M(!1),
746
786
  closeLabel: l,
747
787
  style: u,
748
788
  title: x,
749
789
  items: g,
750
790
  onToolToggle: y
751
791
  }),
752
- m != null && /* @__PURE__ */ U(Ve, {
753
- isOpen: D,
792
+ C != null && /* @__PURE__ */ U(G, {
793
+ isOpen: N,
794
+ title: w,
795
+ closeLabel: l,
796
+ onBack: () => {
797
+ re(!1), k(!0);
798
+ },
799
+ backLabel: T,
800
+ onClose: () => re(!1),
801
+ style: u,
802
+ children: C(() => re(!1))
803
+ }),
804
+ m != null && /* @__PURE__ */ U(Ue, {
805
+ isOpen: A,
754
806
  onBack: () => {
755
- O(!1), E(!0);
807
+ j(!1), k(!0);
756
808
  },
757
809
  backLabel: m.backLabel ?? "Back",
758
- onClose: () => O(!1),
810
+ onClose: () => j(!1),
759
811
  closeLabel: l,
760
812
  style: u,
761
813
  features: m.features,
@@ -776,27 +828,23 @@ var We = {
776
828
  saveLabel: m.saveLabel,
777
829
  saveDisabledTooltip: m.saveDisabledTooltip
778
830
  })
779
- ] }) : /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(_, {
831
+ ] }) : /* @__PURE__ */ W(H, { children: [C == null ? R : /* @__PURE__ */ U(_, {
780
832
  matchReferenceWidth: !1,
781
833
  placement: "bottom-start",
782
- listClassName: f,
783
- items: P,
784
- children: /* @__PURE__ */ U(b, {
785
- icon: /* @__PURE__ */ U(oe, {
786
- size: d.LG,
787
- "aria-hidden": !0
788
- }),
789
- "aria-label": n,
790
- tooltipProps: { tooltip: n },
791
- disabled: p
792
- })
793
- }), m != null && D && /* @__PURE__ */ U(Ue, {
834
+ trigger: [],
835
+ open: se,
836
+ onOpenChange: P,
837
+ renderOverlay: () => C(() => P(!1), () => {
838
+ P(!1), oe(!0);
839
+ }),
840
+ children: R
841
+ }), m != null && A && /* @__PURE__ */ U(Ge, {
794
842
  features: m.features,
795
843
  initialResponseFormat: m.responseFormat ?? i.Markdown,
796
844
  initialSystemPrompt: m.systemPrompt,
797
845
  initialTemperature: m.temperature,
798
846
  onSave: m.onSave,
799
- onClose: () => O(!1),
847
+ onClose: () => j(!1),
800
848
  title: m.title,
801
849
  responseFormatLabel: m.responseFormatLabel,
802
850
  responseFormatHint: m.responseFormatHint,
@@ -815,7 +863,7 @@ var We = {
815
863
  chipIcon: "_chipIcon_1gu87_6",
816
864
  chipText: "_chipText_1gu87_10",
817
865
  chipClose: "_chipClose_1gu87_14"
818
- }, J = (e) => `${e} tool${e === 1 ? "" : "s"}`, Je = (e) => `Remove ${e}`, Ye = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = J, removeLabel: i = Je, typography: s, colors: l }) => {
866
+ }, Ye = (e) => `${e} tool${e === 1 ? "" : "s"}`, J = (e) => `Remove ${e}`, Xe = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = Ye, removeLabel: i = J, typography: s, colors: l }) => {
819
867
  let u = e.filter((e) => e.isSelected);
820
868
  if (u.length === 0) return null;
821
869
  let d = a({
@@ -827,7 +875,7 @@ var We = {
827
875
  "--ci-chip-close-hover": l?.chipCloseHover
828
876
  });
829
877
  if (n) {
830
- let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ U(ce, {
878
+ let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ U(de, {
831
879
  size: c,
832
880
  "aria-hidden": !0
833
881
  }), n = e ? u[0].label : r(u.length);
@@ -867,7 +915,7 @@ var We = {
867
915
  onClick: () => t(e.id),
868
916
  className: o(q.chipClose, "flex items-center rounded p-0.5 transition-colors"),
869
917
  "aria-label": i(e.label),
870
- children: /* @__PURE__ */ U(le, {
918
+ children: /* @__PURE__ */ U(P, {
871
919
  size: 12,
872
920
  "aria-hidden": !0
873
921
  })
@@ -882,23 +930,23 @@ var We = {
882
930
  modelSelectorButton: "_modelSelectorButton_teqwe_24",
883
931
  modelSelectorCaret: "_modelSelectorCaret_teqwe_24",
884
932
  modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_teqwe_33"
885
- }, Xe = {
933
+ }, X = {
886
934
  wrapperError: "_wrapperError_129ri_1",
887
935
  waveformCanvas: "_waveformCanvas_129ri_5",
888
936
  recordingDot: "_recordingDot_129ri_19",
889
937
  "recording-pulse": "_recording-pulse_129ri_1"
890
- }, X = 3, Ze = 4, Z = 200, Qe = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
891
- let u = B(null), f = B(new Float32Array(Z)), p = B(0), m = B(0), h = e === je.Recording, g = e === je.Error, _ = L((e) => {
938
+ }, Ze = 3, Qe = 4, Z = 200, $e = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
939
+ let u = B(null), f = B(new Float32Array(Z)), p = B(0), m = B(0), h = e === Ne.Recording, g = e === Ne.Error, _ = L((e) => {
892
940
  let t = e.getContext("2d");
893
941
  if (!t) return;
894
942
  e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
895
943
  let { width: n, height: r } = e;
896
944
  t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
897
- let i = Math.min(Math.max(1, Math.floor(n / Ze)), Z - 1), a = p.current, o = m.current;
945
+ let i = Math.min(Math.max(1, Math.floor(n / Qe)), Z - 1), a = p.current, o = m.current;
898
946
  t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
899
947
  for (let e = 0; e <= i; e++) {
900
948
  let n = ((a - i + e) % Z + Z) % Z, o = f.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
901
- t.fillRect(e * Ze, (r - c) / 2, X, c);
949
+ t.fillRect(e * Qe, (r - c) / 2, Ze, c);
902
950
  }
903
951
  t.restore();
904
952
  }, []);
@@ -908,8 +956,8 @@ var We = {
908
956
  if (!e) return;
909
957
  f.current.fill(0), p.current = 0, m.current = 0;
910
958
  let n, r = () => {
911
- if (m.current += 1, m.current >= Ze) {
912
- m.current -= Ze;
959
+ if (m.current += 1, m.current >= Qe) {
960
+ m.current -= Qe;
913
961
  let e = t.current;
914
962
  if (e) {
915
963
  let t = new Uint8Array(e.frequencyBinCount);
@@ -942,14 +990,14 @@ var We = {
942
990
  let v = /* @__PURE__ */ W("div", {
943
991
  className: "flex flex-shrink-0 items-center justify-end gap-1",
944
992
  children: [/* @__PURE__ */ U(b, {
945
- icon: /* @__PURE__ */ U(le, {
993
+ icon: /* @__PURE__ */ U(P, {
946
994
  size: d.LG,
947
995
  "aria-hidden": !0
948
996
  }),
949
997
  "aria-label": s,
950
998
  onClick: i
951
999
  }), h && /* @__PURE__ */ U(D, {
952
- icon: /* @__PURE__ */ U(ie, {
1000
+ icon: /* @__PURE__ */ U(oe, {
953
1001
  size: d.LG,
954
1002
  "aria-hidden": !0
955
1003
  }),
@@ -961,16 +1009,16 @@ var We = {
961
1009
  className: l,
962
1010
  children: [/* @__PURE__ */ W("div", {
963
1011
  style: c,
964
- className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", g && Xe.wrapperError),
1012
+ className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", g && X.wrapperError),
965
1013
  children: [/* @__PURE__ */ W("div", {
966
1014
  className: "flex min-w-0 flex-1 items-center gap-3",
967
1015
  children: [h && /* @__PURE__ */ U("span", {
968
- className: o(Xe.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
1016
+ className: o(X.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
969
1017
  "aria-hidden": !0
970
1018
  }), /* @__PURE__ */ U("canvas", {
971
1019
  ref: u,
972
1020
  height: 32,
973
- className: o(Xe.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
1021
+ className: o(X.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
974
1022
  })]
975
1023
  }), v]
976
1024
  }), g && n && /* @__PURE__ */ U(y, {
@@ -978,25 +1026,25 @@ var We = {
978
1026
  className: "mt-1 px-1"
979
1027
  })]
980
1028
  });
981
- }, $e = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(D, {
1029
+ }, et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(D, {
982
1030
  "aria-label": n,
983
1031
  onClick: () => e?.(),
984
1032
  disabled: t,
985
1033
  "aria-hidden": r,
986
- icon: /* @__PURE__ */ U(N, {
1034
+ icon: /* @__PURE__ */ U(M, {
987
1035
  size: d.LG,
988
1036
  className: "rtl:scale-x-[-1]"
989
1037
  })
990
- }), et = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(j, {
991
- icon: /* @__PURE__ */ U(ae, { size: d.LG }),
1038
+ }), tt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(j, {
1039
+ icon: /* @__PURE__ */ U(se, { size: d.LG }),
992
1040
  onClick: () => e?.(),
993
1041
  "aria-label": t
994
- }), tt = ({ size: e = 20 }) => /* @__PURE__ */ U(k, {
1042
+ }), nt = ({ size: e = 20 }) => /* @__PURE__ */ U(k, {
995
1043
  variant: A.Circular,
996
1044
  width: e,
997
1045
  height: e,
998
1046
  active: !0
999
- }), nt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
1047
+ }), rt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
1000
1048
  className: "flex min-w-0 flex-1 items-center",
1001
1049
  children: [/* @__PURE__ */ U(k, {
1002
1050
  variant: A.Text,
@@ -1007,28 +1055,28 @@ var We = {
1007
1055
  className: "sr-only",
1008
1056
  children: e
1009
1057
  })]
1010
- }), rt = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
1058
+ }), it = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
1011
1059
  role: "status",
1012
1060
  "aria-label": e,
1013
1061
  children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
1014
1062
  className: "flex h-11 items-center gap-3 px-4",
1015
1063
  "aria-hidden": "true",
1016
- children: [/* @__PURE__ */ U(tt, {}), /* @__PURE__ */ U(nt, {})]
1064
+ children: [/* @__PURE__ */ U(nt, {}), /* @__PURE__ */ U(rt, {})]
1017
1065
  }, t))
1018
- }), it = (e) => e.displayName ?? e.id, at = (e, t) => {
1066
+ }), at = (e) => e.displayName ?? e.id, ot = (e, t) => {
1019
1067
  let n = t.trim().toLowerCase();
1020
- return n ? e.filter((e) => it(e).toLowerCase().includes(n)) : e;
1021
- }, ot = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
1068
+ return n ? e.filter((e) => at(e).toLowerCase().includes(n)) : e;
1069
+ }, st = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
1022
1070
  src: e,
1023
1071
  size: i,
1024
1072
  labels: { tooltip: a },
1025
1073
  initialsName: r
1026
- }), st = {
1074
+ }), ct = {
1027
1075
  searchHeader: "_searchHeader_ibyso_1",
1028
1076
  selectedItem: "_selectedItem_ibyso_5",
1029
1077
  selectedItemCheck: "_selectedItemCheck_ibyso_9"
1030
- }, ct = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = st.searchHeader, selectedItemClassName: s = st.selectedItem, selectedItemCheckClassName: c = st.selectedItemCheck, colors: l }) => {
1031
- let [u, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = z(() => h ? /* @__PURE__ */ U(tt, { size: d.LG }) : ot(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG), [h, p]), _ = p?.displayName ?? p?.id;
1078
+ }, lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = ct.searchHeader, selectedItemClassName: s = ct.selectedItem, selectedItemCheckClassName: c = ct.selectedItemCheck, colors: l }) => {
1079
+ let [u, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = z(() => h ? /* @__PURE__ */ U(nt, { size: d.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG), [h, p]), _ = p?.displayName ?? p?.id;
1032
1080
  return {
1033
1081
  selectorIcon: g,
1034
1082
  selectorAriaLabel: _ ? `${r?.ariaLabel ?? "Select model"}: ${_}` : r?.ariaLabel ?? "Select model",
@@ -1036,8 +1084,8 @@ var We = {
1036
1084
  menuItems: z(() => {
1037
1085
  if (h) return Array.from({ length: 7 }, (e, t) => ({
1038
1086
  key: `__loading-${t}`,
1039
- icon: /* @__PURE__ */ U(tt, {}),
1040
- label: /* @__PURE__ */ U(nt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1087
+ icon: /* @__PURE__ */ U(nt, {}),
1088
+ label: /* @__PURE__ */ U(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
1041
1089
  disabled: !0
1042
1090
  }));
1043
1091
  if (!e || e.length === 0) {
@@ -1048,7 +1096,7 @@ var We = {
1048
1096
  disabled: !0
1049
1097
  }] : [];
1050
1098
  }
1051
- return at(e, u).map((e) => {
1099
+ return ot(e, u).map((e) => {
1052
1100
  let r = e.id === t;
1053
1101
  return {
1054
1102
  key: e.id,
@@ -1056,17 +1104,17 @@ var We = {
1056
1104
  className: "flex w-full items-center justify-between gap-2",
1057
1105
  style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
1058
1106
  children: [/* @__PURE__ */ U(x, {
1059
- text: it(e),
1107
+ text: at(e),
1060
1108
  query: u,
1061
1109
  maxLines: 1
1062
- }), r && /* @__PURE__ */ U(ee, {
1110
+ }), r && /* @__PURE__ */ U(te, {
1063
1111
  size: d.SM,
1064
1112
  stroke: 2,
1065
1113
  className: c,
1066
1114
  "aria-hidden": !0
1067
1115
  })]
1068
1116
  }),
1069
- icon: ot(e.iconUrl, e.type, e.displayName ?? e.id),
1117
+ icon: st(e.iconUrl, e.type, e.displayName ?? e.id),
1070
1118
  onClick: () => n?.(e.id),
1071
1119
  className: r ? s : void 0
1072
1120
  };
@@ -1104,8 +1152,8 @@ var We = {
1104
1152
  e || f("");
1105
1153
  }
1106
1154
  };
1107
- }, lt = typeof window < "u" ? pe : R;
1108
- function ut(e) {
1155
+ }, ut = typeof window < "u" ? me : R;
1156
+ function dt(e) {
1109
1157
  if (e !== void 0) switch (typeof e) {
1110
1158
  case "number": return e;
1111
1159
  case "string":
@@ -1113,15 +1161,15 @@ function ut(e) {
1113
1161
  break;
1114
1162
  }
1115
1163
  }
1116
- function dt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1164
+ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
1117
1165
  let { styleHeight: s, styleWidth: c } = z(() => ({
1118
- styleHeight: ut(o?.height),
1119
- styleWidth: ut(o?.width)
1166
+ styleHeight: dt(o?.height),
1167
+ styleWidth: dt(o?.width)
1120
1168
  }), [o?.height, o?.width]), [l, u] = V({
1121
1169
  height: t,
1122
1170
  width: n
1123
1171
  }), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
1124
- return lt(() => {
1172
+ return ut(() => {
1125
1173
  if (i === null || d) return;
1126
1174
  let t = new ResizeObserver((e) => {
1127
1175
  for (let t of e) {
@@ -1150,26 +1198,26 @@ function dt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
1150
1198
  c
1151
1199
  ]);
1152
1200
  }
1153
- function ft(e) {
1201
+ function pt(e) {
1154
1202
  let t = B(() => {
1155
1203
  throw Error("Cannot call during render.");
1156
1204
  });
1157
- return lt(() => {
1205
+ return ut(() => {
1158
1206
  t.current = e;
1159
1207
  }, [e]), L((e) => t.current?.(e), [t]);
1160
1208
  }
1161
- var pt = null;
1162
- function mt(e = !1) {
1163
- if (pt === null || e) {
1209
+ var mt = null;
1210
+ function ht(e = !1) {
1211
+ if (mt === null || e) {
1164
1212
  let e = document.createElement("div"), t = e.style;
1165
1213
  t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
1166
1214
  let n = document.createElement("div"), r = n.style;
1167
- return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? pt = "positive-descending" : (e.scrollLeft = 1, pt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), pt;
1215
+ return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? mt = "positive-descending" : (e.scrollLeft = 1, mt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), mt;
1168
1216
  }
1169
- return pt;
1217
+ return mt;
1170
1218
  }
1171
- function ht({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1172
- if (t === "horizontal" && n) switch (mt()) {
1219
+ function gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1220
+ if (t === "horizontal" && n) switch (ht()) {
1173
1221
  case "negative": return -r;
1174
1222
  case "positive-descending":
1175
1223
  if (e) {
@@ -1183,13 +1231,13 @@ function ht({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
1183
1231
  function Q(e, t = "Assertion error") {
1184
1232
  if (!e) throw console.error(t), Error(t);
1185
1233
  }
1186
- function gt(e, t) {
1234
+ function _t(e, t) {
1187
1235
  if (e === t) return !0;
1188
1236
  if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
1189
1237
  for (let n in e) if (!Object.is(t[n], e[n])) return !1;
1190
1238
  return !0;
1191
1239
  }
1192
- function _t({ cachedBounds: e, itemCount: t, itemSize: n }) {
1240
+ function vt({ cachedBounds: e, itemCount: t, itemSize: n }) {
1193
1241
  if (t === 0) return 0;
1194
1242
  if (typeof n == "number") return t * n;
1195
1243
  {
@@ -1197,9 +1245,9 @@ function _t({ cachedBounds: e, itemCount: t, itemSize: n }) {
1197
1245
  return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
1198
1246
  }
1199
1247
  }
1200
- function vt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1248
+ function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
1201
1249
  if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
1202
- let s = _t({
1250
+ let s = vt({
1203
1251
  cachedBounds: t,
1204
1252
  itemCount: r,
1205
1253
  itemSize: i
@@ -1211,7 +1259,7 @@ function vt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
1211
1259
  default: return a >= u && a <= l ? a : a < u ? u : l;
1212
1260
  }
1213
1261
  }
1214
- function yt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1262
+ function bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
1215
1263
  let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
1216
1264
  for (; u < a;) {
1217
1265
  let n = e.get(u);
@@ -1230,7 +1278,7 @@ function yt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
1230
1278
  stopIndexOverscan: l
1231
1279
  };
1232
1280
  }
1233
- function bt({ itemCount: e, itemProps: t, itemSize: n }) {
1281
+ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
1234
1282
  let r = /* @__PURE__ */ new Map();
1235
1283
  return {
1236
1284
  get(i) {
@@ -1267,8 +1315,8 @@ function bt({ itemCount: e, itemProps: t, itemSize: n }) {
1267
1315
  }
1268
1316
  };
1269
1317
  }
1270
- function $({ itemCount: e, itemProps: t, itemSize: n }) {
1271
- return z(() => bt({
1318
+ function St({ itemCount: e, itemProps: t, itemSize: n }) {
1319
+ return z(() => xt({
1272
1320
  itemCount: e,
1273
1321
  itemProps: t,
1274
1322
  itemSize: n
@@ -1278,7 +1326,7 @@ function $({ itemCount: e, itemProps: t, itemSize: n }) {
1278
1326
  n
1279
1327
  ]);
1280
1328
  }
1281
- function xt({ containerSize: e, itemSize: t }) {
1329
+ function Ct({ containerSize: e, itemSize: t }) {
1282
1330
  let n;
1283
1331
  switch (typeof t) {
1284
1332
  case "string":
@@ -1290,8 +1338,8 @@ function xt({ containerSize: e, itemSize: t }) {
1290
1338
  }
1291
1339
  return n;
1292
1340
  }
1293
- function St({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1294
- let { height: u = n, width: d = n } = dt({
1341
+ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
1342
+ let { height: u = n, width: d = n } = ft({
1295
1343
  defaultHeight: r === "vertical" ? n : void 0,
1296
1344
  defaultWidth: r === "horizontal" ? n : void 0,
1297
1345
  element: e,
@@ -1300,11 +1348,11 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1300
1348
  }), f = B({
1301
1349
  height: 0,
1302
1350
  width: 0
1303
- }), p = r === "vertical" ? u : d, m = xt({
1351
+ }), p = r === "vertical" ? u : d, m = Ct({
1304
1352
  containerSize: p,
1305
1353
  itemSize: s
1306
1354
  });
1307
- pe(() => {
1355
+ me(() => {
1308
1356
  if (typeof c == "function") {
1309
1357
  let e = f.current;
1310
1358
  (e.height !== u || e.width !== d) && (c({
@@ -1317,11 +1365,11 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1317
1365
  c,
1318
1366
  d
1319
1367
  ]);
1320
- let h = $({
1368
+ let h = St({
1321
1369
  itemCount: a,
1322
1370
  itemProps: o,
1323
1371
  itemSize: m
1324
- }), g = L((e) => h.get(e), [h]), [_, v] = V(() => yt({
1372
+ }), g = L((e) => h.get(e), [h]), [_, v] = V(() => bt({
1325
1373
  cachedBounds: h,
1326
1374
  containerScrollOffset: 0,
1327
1375
  containerSize: p,
@@ -1332,7 +1380,7 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1332
1380
  startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
1333
1381
  stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
1334
1382
  stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
1335
- }, C = L(() => _t({
1383
+ }, C = L(() => vt({
1336
1384
  cachedBounds: h,
1337
1385
  itemCount: a,
1338
1386
  itemSize: m
@@ -1340,9 +1388,9 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1340
1388
  h,
1341
1389
  a,
1342
1390
  m
1343
- ]), w = L((t) => yt({
1391
+ ]), w = L((t) => bt({
1344
1392
  cachedBounds: h,
1345
- containerScrollOffset: ht({
1393
+ containerScrollOffset: gt({
1346
1394
  containerElement: e,
1347
1395
  direction: r,
1348
1396
  isRtl: i,
@@ -1360,19 +1408,19 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1360
1408
  a,
1361
1409
  l
1362
1410
  ]);
1363
- return lt(() => {
1411
+ return ut(() => {
1364
1412
  v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
1365
1413
  }, [
1366
1414
  e,
1367
1415
  r,
1368
1416
  w
1369
- ]), lt(() => {
1417
+ ]), ut(() => {
1370
1418
  if (!e) return;
1371
1419
  let t = () => {
1372
1420
  v((t) => {
1373
- let { scrollLeft: n, scrollTop: o } = e, s = yt({
1421
+ let { scrollLeft: n, scrollTop: o } = e, s = bt({
1374
1422
  cachedBounds: h,
1375
- containerScrollOffset: ht({
1423
+ containerScrollOffset: gt({
1376
1424
  containerElement: e,
1377
1425
  direction: r,
1378
1426
  isRtl: i,
@@ -1382,7 +1430,7 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1382
1430
  itemCount: a,
1383
1431
  overscanCount: l
1384
1432
  });
1385
- return gt(s, t) ? t : s;
1433
+ return _t(s, t) ? t : s;
1386
1434
  });
1387
1435
  };
1388
1436
  return e.addEventListener("scroll", t), () => {
@@ -1398,8 +1446,8 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1398
1446
  ]), {
1399
1447
  getCellBounds: g,
1400
1448
  getEstimatedSize: C,
1401
- scrollToIndex: ft(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1402
- let s = vt({
1449
+ scrollToIndex: pt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
1450
+ let s = yt({
1403
1451
  align: t,
1404
1452
  cachedBounds: h,
1405
1453
  containerScrollOffset: n,
@@ -1409,14 +1457,14 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1409
1457
  itemSize: m
1410
1458
  });
1411
1459
  if (e) {
1412
- if (s = ht({
1460
+ if (s = gt({
1413
1461
  containerElement: e,
1414
1462
  direction: r,
1415
1463
  isRtl: i,
1416
1464
  scrollOffset: s
1417
1465
  }), typeof e.scrollTo != "function") {
1418
1466
  let e = w(s);
1419
- gt(_, e) || v(e);
1467
+ _t(_, e) || v(e);
1420
1468
  }
1421
1469
  return s;
1422
1470
  }
@@ -1427,19 +1475,19 @@ function St({ containerElement: e, containerStyle: t, defaultContainerSize: n =
1427
1475
  stopIndexVisible: x
1428
1476
  };
1429
1477
  }
1430
- function Ct(e) {
1478
+ function wt(e) {
1431
1479
  return z(() => e, Object.values(e));
1432
1480
  }
1433
- function wt(e, t) {
1481
+ function Tt(e, t) {
1434
1482
  let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
1435
- return gt(n, a) && gt(r, o) && gt(i, s);
1483
+ return _t(n, a) && _t(r, o) && _t(i, s);
1436
1484
  }
1437
- function Tt(e) {
1485
+ function Et(e) {
1438
1486
  return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
1439
1487
  }
1440
- var Et = "data-react-window-index";
1441
- function Dt({ 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 }) {
1442
- let m = Ct(u), h = z(() => I(s, wt), [s]), [g, _] = V(null), v = Tt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = St({
1488
+ var Dt = "data-react-window-index";
1489
+ function Ot({ 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 }) {
1490
+ let m = wt(u), h = z(() => fe(s, Tt), [s]), [g, _] = V(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = $({
1443
1491
  containerElement: g,
1444
1492
  containerStyle: f,
1445
1493
  defaultContainerSize: n,
@@ -1450,7 +1498,7 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1450
1498
  onResize: i,
1451
1499
  overscanCount: o
1452
1500
  });
1453
- fe(r, () => ({
1501
+ pe(r, () => ({
1454
1502
  get element() {
1455
1503
  return g;
1456
1504
  },
@@ -1465,12 +1513,12 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1465
1513
  top: r
1466
1514
  });
1467
1515
  }
1468
- }), [g, x]), lt(() => {
1516
+ }), [g, x]), ut(() => {
1469
1517
  if (!g) return;
1470
1518
  let e = Array.from(g.children).filter((e, t) => {
1471
1519
  if (e.hasAttribute("aria-hidden")) return !1;
1472
1520
  let n = `${S + t}`;
1473
- return e.setAttribute(Et, n), !0;
1521
+ return e.setAttribute(Dt, n), !0;
1474
1522
  });
1475
1523
  if (v) return l.observeRowElements(e);
1476
1524
  }, [
@@ -1498,7 +1546,7 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1498
1546
  let e = [];
1499
1547
  if (c > 0) for (let t = S; t <= w; t++) {
1500
1548
  let n = y(t);
1501
- e.push(/* @__PURE__ */ de(h, {
1549
+ e.push(/* @__PURE__ */ I(h, {
1502
1550
  ...m,
1503
1551
  ariaAttributes: {
1504
1552
  "aria-posinset": t + 1,
@@ -1533,7 +1581,7 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1533
1581
  zIndex: -1
1534
1582
  }
1535
1583
  });
1536
- return de(d, {
1584
+ return I(d, {
1537
1585
  role: "list",
1538
1586
  ...p,
1539
1587
  className: t,
@@ -1547,22 +1595,22 @@ function Dt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
1547
1595
  }
1548
1596
  }, E, e, D);
1549
1597
  }
1550
- var Ot = {
1598
+ var kt = {
1551
1599
  divider: "_divider_s5khb_1",
1552
1600
  item: "_item_s5khb_5",
1553
1601
  itemIcon: "_itemIcon_s5khb_15",
1554
1602
  checkIcon: "_checkIcon_s5khb_19",
1555
1603
  stateLabel: "_stateLabel_s5khb_23"
1556
- }, kt = 44, At = 8, jt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
1557
- let u = r[e], f = ot(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
1604
+ }, At = 44, jt = 8, Mt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
1605
+ let u = r[e], f = st(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
1558
1606
  return /* @__PURE__ */ U("div", {
1559
1607
  style: t,
1560
1608
  ...n,
1561
1609
  children: /* @__PURE__ */ U(l, {
1562
1610
  type: "button",
1563
- className: o(Ot.item, "h-full w-full gap-3 px-4"),
1611
+ className: o(kt.item, "h-full w-full gap-3 px-4"),
1564
1612
  iconBefore: /* @__PURE__ */ U("span", {
1565
- className: Ot.itemIcon,
1613
+ className: kt.itemIcon,
1566
1614
  children: f
1567
1615
  }),
1568
1616
  label: /* @__PURE__ */ W("span", {
@@ -1572,21 +1620,21 @@ var Ot = {
1572
1620
  query: s,
1573
1621
  maxLines: 1,
1574
1622
  className: o(a, "min-w-0 flex-1 text-start")
1575
- }), p && /* @__PURE__ */ U(ee, {
1623
+ }), p && /* @__PURE__ */ U(te, {
1576
1624
  size: d.SM,
1577
- className: Ot.checkIcon,
1625
+ className: kt.checkIcon,
1578
1626
  "aria-hidden": !0
1579
1627
  })]
1580
1628
  }),
1581
1629
  onClick: () => c(u.id)
1582
1630
  })
1583
1631
  });
1584
- }, Mt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
1632
+ }, Nt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
1585
1633
  let [y, b] = V("");
1586
1634
  R(() => {
1587
1635
  e || b("");
1588
1636
  }, [e]);
1589
- let x = s && s.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? at(s, y) : [], T = (e) => {
1637
+ let x = s && s.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? ot(s, y) : [], T = (e) => {
1590
1638
  l(e), i();
1591
1639
  }, E = a({
1592
1640
  "--ci-sheet-divider": _?.divider,
@@ -1596,7 +1644,7 @@ var Ot = {
1596
1644
  "--ci-sheet-icon": _?.itemIcon,
1597
1645
  "--ci-check-icon": _?.checkIcon
1598
1646
  });
1599
- return /* @__PURE__ */ U(K, {
1647
+ return /* @__PURE__ */ U(G, {
1600
1648
  isOpen: e,
1601
1649
  title: t,
1602
1650
  closeLabel: n,
@@ -1616,17 +1664,17 @@ var Ot = {
1616
1664
  size: v.Standard,
1617
1665
  onChange: b
1618
1666
  })
1619
- }), /* @__PURE__ */ U("div", { className: o(Ot.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ U(rt, { loadingLabel: u }) : C ? /* @__PURE__ */ U("div", {
1667
+ }), /* @__PURE__ */ U("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ U(it, { loadingLabel: u }) : C ? /* @__PURE__ */ U("div", {
1620
1668
  role: "list",
1621
- className: o(Ot.stateLabel, g, "px-4 py-4"),
1669
+ className: o(kt.stateLabel, g, "px-4 py-4"),
1622
1670
  children: C
1623
- }) : /* @__PURE__ */ U(Dt, {
1671
+ }) : /* @__PURE__ */ U(Ot, {
1624
1672
  role: "list",
1625
1673
  className: "overflow-y-auto",
1626
- style: { height: Math.min(w.length, At) * kt },
1627
- rowComponent: jt,
1674
+ style: { height: Math.min(w.length, jt) * At },
1675
+ rowComponent: Mt,
1628
1676
  rowCount: w.length,
1629
- rowHeight: kt,
1677
+ rowHeight: At,
1630
1678
  rowProps: {
1631
1679
  items: w,
1632
1680
  selectedDeploymentId: c,
@@ -1637,15 +1685,15 @@ var Ot = {
1637
1685
  })]
1638
1686
  })
1639
1687
  });
1640
- }, Nt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: p, onPickerOpenChange: m }) => {
1641
- let [h, y] = V(!1), { selectorIcon: x, selectorAriaLabel: S, selectedLabel: C, menuItems: w, menuHeader: T, onOpenChange: E } = ct({
1688
+ }, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: p, onPickerOpenChange: m }) => {
1689
+ let [h, y] = V(!1), { selectorIcon: x, selectorAriaLabel: S, selectedLabel: C, menuItems: w, menuHeader: T, onOpenChange: E } = lt({
1642
1690
  deployments: e,
1643
1691
  selectedDeploymentId: t,
1644
1692
  onDeploymentChange: n,
1645
1693
  modelSelectorLabels: r
1646
1694
  });
1647
1695
  if (!e) return null;
1648
- let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ U(P, {
1696
+ let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ U(N, {
1649
1697
  size: d.SM,
1650
1698
  className: Y.modelSelectorCaret,
1651
1699
  "aria-hidden": !0
@@ -1663,14 +1711,14 @@ var Ot = {
1663
1711
  },
1664
1712
  className: o("w-[50px]", Y.modelSelectorButton, D)
1665
1713
  })
1666
- }), l ? /* @__PURE__ */ U(K, {
1714
+ }), l ? /* @__PURE__ */ U(G, {
1667
1715
  isOpen: h,
1668
1716
  title: r?.ariaLabel ?? "Select model",
1669
1717
  closeLabel: r?.closeLabel ?? "Close",
1670
1718
  onClose: () => y(!1),
1671
1719
  style: c,
1672
1720
  children: l(() => y(!1))
1673
- }) : /* @__PURE__ */ U(Mt, {
1721
+ }) : /* @__PURE__ */ U(Nt, {
1674
1722
  isOpen: h,
1675
1723
  title: r?.ariaLabel ?? "Select model",
1676
1724
  closeLabel: r?.closeLabel ?? "Close",
@@ -1726,8 +1774,8 @@ var Ot = {
1726
1774
  })
1727
1775
  })
1728
1776
  });
1729
- }, Pt = 160, Ft = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: k, pendingDropFiles: A = [], onDropFilesConsumed: M, pendingAttachments: N = [], onPendingAttachmentsConsumed: ee, pasteTextThreshold: P = 4e3, deployments: te, selectedDeploymentId: F, onDeploymentChange: ie, modelSelectorLabels: ae, initialAttachments: oe = [], isStacked: se = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: de, isInputDisabled: I = !1, isModelSelectorDisabled: R = !1, isSendDisabled: fe = !1, isAudioMessageSupported: pe = !1, sendOnEnter: me = Fe.Enter, prefixAttachments: G = [], onRemovePrefixAttachment: he, chatSettings: _e, toolsMenuItems: ve, onToolToggle: ye, toolsMenuTitle: be, toolsBackLabel: Se, toolsChipLabels: Ce, autoFocus: K = !1, messageHistory: we, onDialFileSystemClick: De, dialFileSystemLabel: Oe, validateAttachment: je, onAttachmentClick: Me, modelPickerOverlay: Ne, maximumAttachmentsAmount: Ie, onAttachmentsLimitExceeded: Le, isAttachmentsEnabled: Re = !0, usageLimitsSlot: ze, onMessageTooLong: Be }) => {
1730
- let Ve = s(), [He, Ue] = V(!1), We = ke(we), Ge = z(() => a({
1777
+ }, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: k, pendingDropFiles: A = [], onDropFilesConsumed: ee, pendingAttachments: M = [], onPendingAttachmentsConsumed: te, pasteTextThreshold: N = 4e3, deployments: ne, selectedDeploymentId: ae, onDeploymentChange: oe, modelSelectorLabels: se, initialAttachments: ce = [], isStacked: le = !1, hideAddButton: ue = !1, hideAttachFile: de = !1, hideActionBar: P = !1, renderFooterActions: F, isInputDisabled: I = !1, isModelSelectorDisabled: fe = !1, isSendDisabled: R = !1, isAudioMessageSupported: pe = !1, sendOnEnter: me = Le.Enter, prefixAttachments: he = [], onRemovePrefixAttachment: ge, chatSettings: _e, toolsMenuItems: ye, onToolToggle: be, toolsMenuTitle: xe, toolsBackLabel: Se, toolsChipLabels: we, promptsMenuOverlay: Te, promptsMenuTitle: G, promptsBackLabel: Ee, autoFocus: ke = !1, messageHistory: Ae, onDialFileSystemClick: Ne, dialFileSystemLabel: Pe, validateAttachment: Fe, onAttachmentClick: Re, modelPickerOverlay: ze, maximumAttachmentsAmount: Be, onAttachmentsLimitExceeded: Ve, isAttachmentsEnabled: He = !0, usageLimitsSlot: Ue, onMessageTooLong: We }) => {
1778
+ let Ge = s(), [Ke, qe] = V(!1), K = je(Ae), q = z(() => a({
1731
1779
  "--ci-bg": D?.background,
1732
1780
  "--ci-text": D?.text,
1733
1781
  "--ci-border": D?.border,
@@ -1740,223 +1788,226 @@ var Ot = {
1740
1788
  "--ci-voice-error": D?.voiceError,
1741
1789
  "--ci-voice-waveform": D?.voiceWaveform,
1742
1790
  "--ci-voice-accent": D?.voiceAccent
1743
- }), [D]), Ke = z(() => De ? [{
1791
+ }), [D]), Ye = z(() => Ne ? [{
1744
1792
  key: "dial-fs",
1745
- label: Oe ?? "DIAL file system",
1746
- icon: /* @__PURE__ */ U(ne, {
1793
+ label: Pe ?? "DIAL file system",
1794
+ icon: /* @__PURE__ */ U(re, {
1747
1795
  size: c,
1748
1796
  "aria-hidden": !0
1749
1797
  }),
1750
- onClick: De
1751
- }] : [], [De, Oe]), { message: q, setMessage: J, textareaRef: Je, isMultiLine: Xe } = Ae({
1798
+ onClick: Ne
1799
+ }] : [], [Ne, Pe]), { message: J, setMessage: X, textareaRef: Ze, isMultiLine: Qe } = Me({
1752
1800
  messageProp: e,
1753
1801
  messageRevision: t
1754
- }), { attachments: X, buildAttachments: Ze, addAttachments: Z, resetAttachments: tt, handleRemove: nt, handleRetry: rt, handleExpand: it, hasBlockedAttachments: at } = Te({
1755
- initialAttachments: oe,
1802
+ }), { attachments: Z, buildAttachments: nt, addAttachments: rt, resetAttachments: it, handleRemove: at, handleRetry: ot, handleExpand: st, hasBlockedAttachments: ct } = De({
1803
+ initialAttachments: ce,
1756
1804
  onUploadAttachment: r,
1757
1805
  onAttachmentsChange: f,
1758
- validateAttachment: je,
1806
+ validateAttachment: Fe,
1759
1807
  pendingDropFiles: A,
1760
- onDropFilesConsumed: M,
1761
- pendingAttachments: N,
1762
- onPendingAttachmentsConsumed: ee,
1808
+ onDropFilesConsumed: ee,
1809
+ pendingAttachments: M,
1810
+ onPendingAttachmentsConsumed: te,
1763
1811
  onExpandPastedText: L((e) => {
1764
- J((t) => t ? `${t}\n${e}` : e);
1765
- }, [J]),
1766
- maximumAttachmentsAmount: Ie,
1767
- baseAttachmentsAmount: G.length,
1768
- onAttachmentsLimitExceeded: Le
1769
- }), { state: ot, analyserNodeRef: st, errorMessage: ct, startRecording: lt, stopRecording: ut, discardRecording: dt } = Pe({ onAttachAudio: L((e) => {
1770
- Z(Ze([e]));
1771
- }, [Z, Ze]) }), ft = B(null), pt = B(null), { handlePaste: mt } = xe(Z, Re ? P : Infinity), ht = L((e) => {
1772
- if (!Re) {
1812
+ X((t) => t ? `${t}\n${e}` : e);
1813
+ }, [X]),
1814
+ maximumAttachmentsAmount: Be,
1815
+ baseAttachmentsAmount: he.length,
1816
+ onAttachmentsLimitExceeded: Ve
1817
+ }), { state: lt, analyserNodeRef: ut, errorMessage: dt, startRecording: ft, stopRecording: pt, discardRecording: mt } = Ie({ onAttachAudio: L((e) => {
1818
+ rt(nt([e]));
1819
+ }, [rt, nt]) }), ht = B(null), gt = B(null), { handlePaste: Q } = Ce(rt, He ? N : Infinity), _t = L((e) => {
1820
+ if (!He) {
1773
1821
  let t = e.clipboardData.getData("text/plain");
1774
- t.length >= P && Be?.(t.length, P);
1822
+ t.length >= N && We?.(t.length, N);
1775
1823
  }
1776
- mt(e);
1824
+ Q(e);
1777
1825
  }, [
1778
- Re,
1779
- P,
1780
- Be,
1781
- mt
1782
- ]), Q = q.trim().length > 0 || X.length > 0, gt = Q && !at && !fe, { shouldRender: _t, isExiting: vt, instanceKey: yt } = Ee(!l && Q, Pt), bt = (ve?.some((e) => e.isSelected) ?? !1) && ye != null, $ = se || q.includes("\n") || Xe || bt, xt = te === void 0 || F != null, St = z(() => pe && !vt && !l, [
1826
+ He,
1827
+ N,
1828
+ We,
1829
+ Q
1830
+ ]), vt = J.trim().length > 0 || Z.length > 0, yt = vt && !ct && !R, { shouldRender: bt, isExiting: xt, instanceKey: St } = Oe(!l && vt, Ft), Ct = (ye?.some((e) => e.isSelected) ?? !1) && be != null, $ = le || J.includes("\n") || Qe || Ct, wt = ne === void 0 || ae != null, Tt = z(() => pe && !xt && !l, [
1783
1831
  pe,
1784
- vt,
1832
+ xt,
1785
1833
  l
1786
- ]), Ct = async () => {
1787
- if (fe) return;
1788
- if (!Re && q.length >= P) {
1789
- Be?.(q.length, P);
1834
+ ]), Et = async () => {
1835
+ if (R) return;
1836
+ if (!He && J.length >= N) {
1837
+ We?.(J.length, N);
1790
1838
  return;
1791
1839
  }
1792
- let e = q, t = X;
1793
- J(""), We.reset();
1840
+ let e = J, t = Z;
1841
+ X(""), K.reset();
1794
1842
  try {
1795
1843
  await n?.(e, t), t.forEach((e) => {
1796
1844
  e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
1797
- }), tt([]);
1845
+ }), it([]);
1798
1846
  } catch {
1799
- J(e), tt(t);
1847
+ X(e), it(t);
1800
1848
  }
1801
- }, wt = (e) => {
1849
+ }, Dt = (e) => {
1802
1850
  if (!e.nativeEvent.isComposing && !I && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
1803
- let t = e.currentTarget.selectionStart ?? 0, n = We.navigate(e.key === "ArrowUp" ? "up" : "down", q, t);
1851
+ let t = e.currentTarget.selectionStart ?? 0, n = K.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
1804
1852
  if (n !== null) {
1805
- e.preventDefault(), J(n);
1853
+ e.preventDefault(), X(n);
1806
1854
  return;
1807
1855
  }
1808
1856
  }
1809
- e.key === "Enter" && (me === Fe.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && gt && xt && !I && Ct());
1810
- }, Tt = (e) => {
1857
+ e.key === "Enter" && (me === Le.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && yt && wt && !I && Et());
1858
+ }, Ot = (e) => {
1811
1859
  let t = Array.from(e.target.files ?? []);
1812
1860
  if (t.length === 0) return;
1813
- let n = Ze(t);
1814
- e.target.value = "", Z(n);
1861
+ let n = nt(t);
1862
+ e.target.value = "", rt(n);
1815
1863
  };
1816
- if (ot !== "idle") return /* @__PURE__ */ U(Qe, {
1817
- state: ot,
1818
- analyserNodeRef: st,
1819
- errorMessage: ct,
1820
- onStop: ut,
1821
- onDiscard: dt,
1864
+ if (lt !== "idle") return /* @__PURE__ */ U($e, {
1865
+ state: lt,
1866
+ analyserNodeRef: ut,
1867
+ errorMessage: dt,
1868
+ onStop: pt,
1869
+ onDiscard: mt,
1822
1870
  stopLabel: T,
1823
1871
  discardLabel: E,
1824
- style: Ge,
1872
+ style: q,
1825
1873
  className: k
1826
1874
  });
1827
- let Et = /* @__PURE__ */ U("textarea", {
1875
+ let kt = /* @__PURE__ */ U("textarea", {
1828
1876
  className: o(Y.textarea, O?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
1829
- ref: Je,
1830
- autoFocus: K,
1831
- value: q,
1877
+ ref: Ze,
1878
+ autoFocus: ke,
1879
+ value: J,
1832
1880
  onChange: (e) => {
1833
- J(e.target.value), We.notifyChange(), u?.(e.target.value);
1881
+ X(e.target.value), K.notifyChange(), u?.(e.target.value);
1834
1882
  },
1835
- onKeyDown: wt,
1836
- onPaste: ht,
1883
+ onKeyDown: Dt,
1884
+ onPaste: _t,
1837
1885
  placeholder: p,
1838
1886
  "aria-label": m,
1839
1887
  disabled: I,
1840
1888
  rows: 1
1841
1889
  });
1842
1890
  return /* @__PURE__ */ W("div", {
1843
- ref: pt,
1844
- style: Ge,
1845
- className: o(Y.wrapper, I && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", X.length > 6 ? "py-3 ps-3" : "p-3", k),
1846
- children: [(G.length > 0 || X.length > 0) && /* @__PURE__ */ U(ge, {
1847
- attachments: [...G, ...X],
1891
+ ref: gt,
1892
+ style: q,
1893
+ className: o(Y.wrapper, I && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", Z.length > 6 ? "py-3 ps-3" : "p-3", k),
1894
+ children: [(he.length > 0 || Z.length > 0) && /* @__PURE__ */ U(ve, {
1895
+ attachments: [...he, ...Z],
1848
1896
  onRemove: (e) => {
1849
- G.some((t) => t.id === e) ? he?.(e) : nt(e);
1897
+ he.some((t) => t.id === e) ? ge?.(e) : at(e);
1850
1898
  },
1851
- onRetry: rt,
1852
- onExpand: it,
1899
+ onRetry: ot,
1900
+ onExpand: st,
1853
1901
  labels: {
1854
1902
  removeLabel: b,
1855
1903
  retryLabel: x
1856
1904
  },
1857
- onAttachmentClick: Me == null ? void 0 : (e) => {
1858
- let t = [...G, ...X].find((t) => t.id === e);
1859
- t != null && Me(t);
1905
+ onAttachmentClick: Re == null ? void 0 : (e) => {
1906
+ let t = [...he, ...Z].find((t) => t.id === e);
1907
+ t != null && Re(t);
1860
1908
  }
1861
- }), ue ? $ && Et : /* @__PURE__ */ W("div", {
1909
+ }), P ? $ && kt : /* @__PURE__ */ W("div", {
1862
1910
  className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
1863
1911
  children: [
1864
- !ce && /* @__PURE__ */ W("div", {
1912
+ !ue && /* @__PURE__ */ W("div", {
1865
1913
  className: o("flex", "order-2", !$ && "desktop:order-1"),
1866
1914
  children: [/* @__PURE__ */ U("input", {
1867
- ref: ft,
1915
+ ref: ht,
1868
1916
  type: "file",
1869
1917
  multiple: !0,
1870
1918
  accept: g,
1871
1919
  className: "sr-only",
1872
1920
  "aria-hidden": !0,
1873
1921
  tabIndex: -1,
1874
- onChange: Tt
1875
- }), /* @__PURE__ */ U(qe, {
1876
- onAttachClick: le ? void 0 : () => ft.current?.click(),
1922
+ onChange: Ot
1923
+ }), /* @__PURE__ */ U(Je, {
1924
+ onAttachClick: de ? void 0 : () => ht.current?.click(),
1877
1925
  attachLabel: h,
1878
1926
  addMenuTitle: _,
1879
1927
  menuTitle: v,
1880
1928
  menuCloseLabel: y,
1881
- style: Ge,
1929
+ style: q,
1882
1930
  isDisabled: I,
1883
1931
  chatSettings: _e,
1884
- extraMenuItems: Ke,
1885
- toolsMenuItems: ve,
1886
- onToolToggle: ye,
1887
- toolsMenuTitle: be,
1888
- toolsBackLabel: Se
1932
+ extraMenuItems: Ye,
1933
+ toolsMenuItems: ye,
1934
+ onToolToggle: be,
1935
+ toolsMenuTitle: xe,
1936
+ toolsBackLabel: Se,
1937
+ promptsMenuOverlay: Te,
1938
+ promptsMenuTitle: G,
1939
+ promptsBackLabel: Ee
1889
1940
  })]
1890
1941
  }),
1891
- $ && bt && /* @__PURE__ */ U("div", {
1942
+ $ && Ct && /* @__PURE__ */ U("div", {
1892
1943
  className: "order-3 min-w-0 flex-1",
1893
- children: /* @__PURE__ */ U(Ye, {
1894
- items: ve ?? [],
1895
- onToolToggle: ye,
1896
- isMobile: Ve,
1897
- countLabel: Ce?.countLabel,
1898
- removeLabel: Ce?.removeLabel
1944
+ children: /* @__PURE__ */ U(Xe, {
1945
+ items: ye ?? [],
1946
+ onToolToggle: be,
1947
+ isMobile: Ge,
1948
+ countLabel: we?.countLabel,
1949
+ removeLabel: we?.removeLabel
1899
1950
  })
1900
1951
  }),
1901
1952
  /* @__PURE__ */ U("div", {
1902
1953
  className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
1903
- children: Et
1954
+ children: kt
1904
1955
  }),
1905
1956
  /* @__PURE__ */ W("div", {
1906
- className: o("flex flex-shrink-0 items-center gap-2", $ && bt ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
1907
- children: [de ? de({
1908
- canSend: gt,
1909
- onSend: Ct
1957
+ className: o("flex flex-shrink-0 items-center gap-2", $ && Ct ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
1958
+ children: [F ? F({
1959
+ canSend: yt,
1960
+ onSend: Et
1910
1961
  }) : /* @__PURE__ */ W(H, { children: [
1911
- ze,
1912
- /* @__PURE__ */ U(Nt, {
1913
- deployments: te,
1914
- selectedDeploymentId: F,
1915
- onDeploymentChange: ie,
1916
- modelSelectorLabels: ae,
1962
+ Ue,
1963
+ /* @__PURE__ */ U(Pt, {
1964
+ deployments: ne,
1965
+ selectedDeploymentId: ae,
1966
+ onDeploymentChange: oe,
1967
+ modelSelectorLabels: se,
1917
1968
  isStreaming: l,
1918
- isMobile: Ve,
1919
- isDisabled: R,
1920
- style: Ge,
1921
- modelPickerOverlay: Ne,
1922
- isPickerOpen: He,
1923
- onPickerToggle: () => Ue((e) => !e),
1924
- onPickerOpenChange: Ue
1969
+ isMobile: Ge,
1970
+ isDisabled: fe,
1971
+ style: q,
1972
+ modelPickerOverlay: ze,
1973
+ isPickerOpen: Ke,
1974
+ onPickerToggle: () => qe((e) => !e),
1975
+ onPickerOpenChange: qe
1925
1976
  }),
1926
- l && i ? /* @__PURE__ */ U(et, {
1977
+ l && i ? /* @__PURE__ */ U(tt, {
1927
1978
  onStop: i,
1928
1979
  ariaLabel: C
1929
- }) : !l && _t && /* @__PURE__ */ U($e, {
1930
- onSend: Ct,
1931
- isDisabled: !xt || at || fe,
1980
+ }) : !l && bt && /* @__PURE__ */ U(et, {
1981
+ onSend: Et,
1982
+ isDisabled: !wt || ct || R,
1932
1983
  ariaLabel: S,
1933
- isExiting: vt
1934
- }, yt)
1935
- ] }), St && /* @__PURE__ */ U(j, {
1936
- icon: /* @__PURE__ */ U(re, {
1984
+ isExiting: xt
1985
+ }, St)
1986
+ ] }), Tt && /* @__PURE__ */ U(j, {
1987
+ icon: /* @__PURE__ */ U(ie, {
1937
1988
  size: d.LG,
1938
1989
  "aria-hidden": !0
1939
1990
  }),
1940
1991
  "aria-label": w,
1941
1992
  className: "size-8 flex-shrink-0",
1942
- onClick: lt,
1993
+ onClick: ft,
1943
1994
  disabled: I || l
1944
1995
  })]
1945
1996
  })
1946
1997
  ]
1947
1998
  })]
1948
1999
  });
1949
- }, It = { welcome: "_welcome_n2ph8_1" }, Lt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
2000
+ }, Lt = { welcome: "_welcome_n2ph8_1" }, Rt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
1950
2001
  let { colors: u, typography: d } = r ?? {};
1951
2002
  return /* @__PURE__ */ W("div", {
1952
2003
  style: a({ "--ci-welcome-color": u?.welcomeText }),
1953
2004
  className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
1954
2005
  children: [n && /* @__PURE__ */ U("h1", {
1955
- className: o(It.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
2006
+ className: o(Lt.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
1956
2007
  children: n
1957
2008
  }), /* @__PURE__ */ U("div", {
1958
2009
  className: "relative w-full max-w-[748px]",
1959
- children: /* @__PURE__ */ U(Ft, {
2010
+ children: /* @__PURE__ */ U(It, {
1960
2011
  placeholder: t,
1961
2012
  isStreaming: e,
1962
2013
  isInputDisabled: c,
@@ -1967,30 +2018,30 @@ var Ot = {
1967
2018
  })
1968
2019
  })]
1969
2020
  });
1970
- }, Rt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: M, pasteTextThreshold: N, onMessageTooLong: ee }) => {
1971
- let P = B(null), [te, re] = V([]);
2021
+ }, zt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: M, onMessageTooLong: te }) => {
2022
+ let N = B(null), [ne, ie] = V([]);
1972
2023
  R(() => {
1973
- v?.length && (re(v), y?.());
2024
+ v?.length && (ie(v), y?.());
1974
2025
  }, [v, y]);
1975
- let [F, ie] = V(e ?? ""), [ae, oe] = V([]), [se, ce] = V(t), le = ae.some((e) => e.status === r.Loading || e.status === r.Error), ue = (F.trim().length > 0 || ae.length > 0 || se.length > 0) && !le, de = (e) => {
1976
- ce((t) => t.filter((t) => t.id !== e));
2026
+ let [ae, oe] = V(e ?? ""), [se, ce] = V([]), [le, ue] = V(t), de = se.some((e) => e.status === r.Loading || e.status === r.Error), P = (ae.trim().length > 0 || se.length > 0 || le.length > 0) && !de, F = (e) => {
2027
+ ue((t) => t.filter((t) => t.id !== e));
1977
2028
  }, I = L((e, t) => {
1978
- i(e, se, t);
1979
- }, [se, i]), fe = () => {
1980
- if (ue) {
1981
- if (!x && F.length >= (N ?? 4e3)) {
1982
- ee?.(F.length, N ?? 4e3);
2029
+ i(e, le, t);
2030
+ }, [le, i]), fe = () => {
2031
+ if (P) {
2032
+ if (!x && ae.length >= (M ?? 4e3)) {
2033
+ te?.(ae.length, M ?? 4e3);
1983
2034
  return;
1984
2035
  }
1985
- I(F, ae);
2036
+ I(ae, se);
1986
2037
  }
1987
- }, pe = L(() => re([]), []), me = L((e) => {
2038
+ }, pe = L(() => ie([]), []), me = L((e) => {
1988
2039
  let t = Array.from(e.target.files ?? []);
1989
- t.length !== 0 && (e.target.value = "", re(t));
1990
- }, []), G = z(() => O ? [{
2040
+ t.length !== 0 && (e.target.value = "", ie(t));
2041
+ }, []), he = z(() => O ? [{
1991
2042
  key: "dial-fs",
1992
2043
  label: k ?? "DIAL file system",
1993
- icon: /* @__PURE__ */ U(ne, {
2044
+ icon: /* @__PURE__ */ U(re, {
1994
2045
  size: c,
1995
2046
  "aria-hidden": !0
1996
2047
  }),
@@ -1998,37 +2049,37 @@ var Ot = {
1998
2049
  }] : [], [O, k]);
1999
2050
  return /* @__PURE__ */ W("div", {
2000
2051
  className: o("flex w-full flex-col gap-2", _),
2001
- children: [/* @__PURE__ */ U(Ft, {
2052
+ children: [/* @__PURE__ */ U(It, {
2002
2053
  message: e,
2003
2054
  ariaLabel: u,
2004
2055
  isStacked: !0,
2005
2056
  hideActionBar: !0,
2006
- pendingDropFiles: te,
2057
+ pendingDropFiles: ne,
2007
2058
  onDropFilesConsumed: pe,
2008
2059
  onSend: I,
2009
2060
  onUploadAttachment: a,
2010
- onChange: ie,
2011
- onAttachmentsChange: oe,
2061
+ onChange: oe,
2062
+ onAttachmentsChange: ce,
2012
2063
  removeLabel: d,
2013
2064
  retryLabel: f,
2014
2065
  className: "max-w-full",
2015
- prefixAttachments: se,
2016
- onRemovePrefixAttachment: de,
2066
+ prefixAttachments: le,
2067
+ onRemovePrefixAttachment: F,
2017
2068
  validateAttachment: b,
2018
2069
  isAttachmentsEnabled: x,
2019
2070
  maximumAttachmentsAmount: T,
2020
2071
  onAttachmentsLimitExceeded: D,
2021
2072
  pendingAttachments: A,
2022
2073
  onPendingAttachmentsConsumed: j,
2023
- onAttachmentClick: M,
2024
- pasteTextThreshold: N,
2025
- onMessageTooLong: ee
2074
+ onAttachmentClick: ee,
2075
+ pasteTextThreshold: M,
2076
+ onMessageTooLong: te
2026
2077
  }), /* @__PURE__ */ W("div", {
2027
2078
  className: "flex items-center justify-between",
2028
2079
  children: [/* @__PURE__ */ U("div", {
2029
2080
  className: "flex",
2030
2081
  children: !S && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
2031
- ref: P,
2082
+ ref: N,
2032
2083
  type: "file",
2033
2084
  multiple: !0,
2034
2085
  accept: w,
@@ -2036,13 +2087,13 @@ var Ot = {
2036
2087
  "aria-hidden": !0,
2037
2088
  tabIndex: -1,
2038
2089
  onChange: me
2039
- }), /* @__PURE__ */ U(qe, {
2040
- onAttachClick: () => P.current?.click(),
2090
+ }), /* @__PURE__ */ U(Je, {
2091
+ onAttachClick: () => N.current?.click(),
2041
2092
  attachLabel: m,
2042
2093
  addMenuTitle: p,
2043
2094
  menuTitle: h,
2044
2095
  menuCloseLabel: g,
2045
- extraMenuItems: G
2096
+ extraMenuItems: he
2046
2097
  })] })
2047
2098
  }), /* @__PURE__ */ W("div", {
2048
2099
  className: "flex gap-2",
@@ -2052,11 +2103,11 @@ var Ot = {
2052
2103
  }), /* @__PURE__ */ U(E, {
2053
2104
  label: l,
2054
2105
  onClick: fe,
2055
- disabled: !ue
2106
+ disabled: !P
2056
2107
  })]
2057
2108
  })]
2058
2109
  })]
2059
2110
  });
2060
2111
  };
2061
2112
  //#endregion
2062
- export { me as AttachmentCard, G as AttachmentGroup, he as AttachmentTray, K as BottomSheetShell, Ue as ChatSettingsModal, Lt as ConversationInput, Rt as EditMessageInput, _e as FileDndOverlay, Ft as Input, Fe as SendOnEnter, be as getAttachmentIcon };
2113
+ export { he as AttachmentCard, ge as AttachmentGroup, _e as AttachmentTray, G as BottomSheetShell, Ge as ChatSettingsModal, Rt as ConversationInput, zt as EditMessageInput, ye as FileDndOverlay, It as Input, Le as SendOnEnter, Se as getAttachmentIcon };