@epam/ai-dial-conversation-input 1.2.0-dev.2 → 1.2.0-dev.21
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/components/Input/Buttons/SendButton.d.ts +2 -0
- package/components/Input/Buttons/SendButton.d.ts.map +1 -1
- package/components/Input/Input.d.ts.map +1 -1
- package/hooks/useVoiceRecorder.d.ts.map +1 -1
- package/index.js +421 -415
- package/models/ConversationInput.d.ts +1 -1
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +1 -1
- package/models/Input.d.ts.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, RequestStatus as i, ResponseFormat as a, SELECT_LIST_MAX_HEIGHT_PX as o, buildCssVars as s, mergeClasses as c, useIsMobile as l } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as ne, TextareaResize as
|
|
3
|
-
import { IconArrowLeft as
|
|
4
|
-
import { createElement as he, memo as ge, useCallback as I, useEffect as L, useImperativeHandle as
|
|
5
|
-
import { createPortal as
|
|
2
|
+
import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as ne, TextareaResize as M, Tooltip as N } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as re, IconArrowNarrowRight as ie, IconCheck as ae, IconChevronDown as P, IconChevronRight as oe, IconFile as se, IconMicrophone as ce, IconPaperclip as le, IconPlayerStopFilled as F, IconPlaystationSquare as ue, IconPlus as de, IconSettings as fe, IconTool as pe, IconX as me } from "@tabler/icons-react";
|
|
4
|
+
import { createElement as he, memo as ge, useCallback as I, useEffect as L, useImperativeHandle as _e, useLayoutEffect as ve, useMemo as R, useRef as z, useState as B } from "react";
|
|
5
|
+
import { createPortal as V } from "react-dom";
|
|
6
6
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
7
7
|
import { AttachmentTray as ye, MAX_UPLOADS_PER_MINUTE as be, generateAttachmentId as xe, useClipboardPaste as Se } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
@@ -42,7 +42,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
42
42
|
title: "_title_1d50f_18",
|
|
43
43
|
divider: "_divider_1d50f_22"
|
|
44
44
|
}, Ee = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: l, titleClassName: u = "dial-body-semi-text", className: d, colors: h, children: _ }) => {
|
|
45
|
-
let y =
|
|
45
|
+
let y = z(null);
|
|
46
46
|
if (we(e, r, y), !e || typeof document > "u") return null;
|
|
47
47
|
let b = s({
|
|
48
48
|
"--ci-backdrop": h?.backdrop,
|
|
@@ -50,7 +50,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
50
50
|
"--ci-sheet-text": h?.sheetText,
|
|
51
51
|
"--ci-sheet-divider": h?.divider
|
|
52
52
|
});
|
|
53
|
-
return
|
|
53
|
+
return V(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
54
54
|
className: c(Te.backdrop, "fixed inset-0 z-[55]"),
|
|
55
55
|
style: b,
|
|
56
56
|
onPointerDown: r,
|
|
@@ -72,7 +72,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
72
72
|
i && /* @__PURE__ */ U("div", {
|
|
73
73
|
className: "absolute start-4",
|
|
74
74
|
children: /* @__PURE__ */ U(v, {
|
|
75
|
-
icon: /* @__PURE__ */ U(
|
|
75
|
+
icon: /* @__PURE__ */ U(re, {
|
|
76
76
|
size: p.LG,
|
|
77
77
|
stroke: m,
|
|
78
78
|
className: "rtl:scale-x-[-1]"
|
|
@@ -104,7 +104,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
104
104
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
105
105
|
await Promise.allSettled(i);
|
|
106
106
|
}, Oe = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
107
|
-
let [h, g] =
|
|
107
|
+
let [h, g] = B(n), _ = z(h);
|
|
108
108
|
L(() => {
|
|
109
109
|
_.current = h;
|
|
110
110
|
}, [h]), L(() => () => {
|
|
@@ -124,11 +124,11 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
124
124
|
previewUrl: a,
|
|
125
125
|
playUrl: o
|
|
126
126
|
};
|
|
127
|
-
}), []), y =
|
|
127
|
+
}), []), y = z(a);
|
|
128
128
|
L(() => {
|
|
129
129
|
y.current = a;
|
|
130
130
|
}, [a]);
|
|
131
|
-
let b =
|
|
131
|
+
let b = z(!0), x = I((e) => {
|
|
132
132
|
g((t) => {
|
|
133
133
|
let n = e(t);
|
|
134
134
|
return n === t ? t : n;
|
|
@@ -271,7 +271,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
271
271
|
let n = e.slice(t.length);
|
|
272
272
|
return !/\s/.test(n) && !n.includes(t);
|
|
273
273
|
}, Ae = ({ config: e, message: t }) => {
|
|
274
|
-
let [n, r] =
|
|
274
|
+
let [n, r] = B(!1), [i, a] = B(!1), o = e != null && ke(t, e.triggerPrefix) ? t.slice(e.triggerPrefix.length) : "", s = I((n, a, o) => {
|
|
275
275
|
if (e == null || a || t !== "" || i) return;
|
|
276
276
|
let s = n === e.triggerPrefix, c = o === "insertFromPaste" && ke(n, e.triggerPrefix);
|
|
277
277
|
(s || c) && r(!0);
|
|
@@ -295,9 +295,9 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
295
295
|
handleValueChange: s
|
|
296
296
|
};
|
|
297
297
|
}, je = (e, t) => !e.slice(0, t).includes("\n"), Me = (e, t) => !e.slice(t).includes("\n"), Ne = (e) => {
|
|
298
|
-
let t =
|
|
298
|
+
let t = z(e);
|
|
299
299
|
t.current = e;
|
|
300
|
-
let n =
|
|
300
|
+
let n = z(-1), r = z(""), i = I((e, i, a) => {
|
|
301
301
|
let o = t.current;
|
|
302
302
|
return !o || o.length === 0 ? null : e === "up" ? !je(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 || !Me(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
303
303
|
}, []), a = I(() => {
|
|
@@ -305,7 +305,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
305
305
|
}, []), o = I(() => {
|
|
306
306
|
n.current = -1, r.current = "";
|
|
307
307
|
}, []);
|
|
308
|
-
return
|
|
308
|
+
return R(() => ({
|
|
309
309
|
navigate: i,
|
|
310
310
|
notifyChange: a,
|
|
311
311
|
reset: o
|
|
@@ -315,7 +315,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
315
315
|
o
|
|
316
316
|
]);
|
|
317
317
|
}, Pe = ({ messageProp: e, messageRevision: t }) => {
|
|
318
|
-
let [n, r] =
|
|
318
|
+
let [n, r] = B(e), i = z(null);
|
|
319
319
|
return L(() => {
|
|
320
320
|
r(e);
|
|
321
321
|
}, [e, t]), {
|
|
@@ -327,9 +327,9 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
327
327
|
let r = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
328
328
|
r ? r.call(e, t) : e.value = t, e.setSelectionRange(n, n), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
329
329
|
}, Ie = ({ insertion: e, textareaRef: t }) => {
|
|
330
|
-
let n = e?.revision, r =
|
|
330
|
+
let n = e?.revision, r = z(e?.text);
|
|
331
331
|
r.current = e?.text;
|
|
332
|
-
let i =
|
|
332
|
+
let i = z(n);
|
|
333
333
|
L(() => {
|
|
334
334
|
if (n === i.current) return;
|
|
335
335
|
i.current = n;
|
|
@@ -347,7 +347,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
347
347
|
"audio/ogg;codecs=opus",
|
|
348
348
|
"audio/webm"
|
|
349
349
|
], Be = 100, Ve = 100, He = .01, Ue = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: r = "Voice input failed" }) => {
|
|
350
|
-
let [i, a] =
|
|
350
|
+
let [i, a] = B("idle"), [o, s] = B(null), c = z(null), l = z(null), u = z({
|
|
351
351
|
onAttachAudio: e,
|
|
352
352
|
onTranscribeAudio: t,
|
|
353
353
|
onTranscript: n,
|
|
@@ -362,7 +362,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
362
362
|
let d = I((e = "dictation") => {
|
|
363
363
|
if (l.current) return;
|
|
364
364
|
let t = { controller: new AbortController() };
|
|
365
|
-
l.current = t, a("recording");
|
|
365
|
+
l.current = t, s(null), a("recording");
|
|
366
366
|
let { signal: n } = t.controller, r = e === "dictation" ? u.current.onTranscribeAudio : void 0, i, o, d, f, p = !1, m = !1, h = [], g = () => {
|
|
367
367
|
clearInterval(f), f = void 0;
|
|
368
368
|
}, _ = () => {
|
|
@@ -374,7 +374,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
374
374
|
let v = () => {
|
|
375
375
|
n.aborted || (_(), l.current = null, s(null), a("idle"));
|
|
376
376
|
}, y = (e) => {
|
|
377
|
-
n.aborted || (t.controller.abort(), s(e instanceof Error ? e.message : u.current.errorLabel), a("error"));
|
|
377
|
+
n.aborted || (t.controller.abort(), l.current = null, s(e instanceof Error ? e.message : u.current.errorLabel), a("error"));
|
|
378
378
|
}, b = () => {
|
|
379
379
|
if (!i || n.aborted) return;
|
|
380
380
|
let e = ze.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(i, e ? { mimeType: e } : void 0);
|
|
@@ -491,7 +491,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
491
491
|
})
|
|
492
492
|
});
|
|
493
493
|
}, qe = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
494
|
-
let [s, c] =
|
|
494
|
+
let [s, c] = B(t), [l, u] = B(n), [d, f] = B(r), p = z(o);
|
|
495
495
|
L(() => {
|
|
496
496
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
497
497
|
}, [
|
|
@@ -523,12 +523,12 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
523
523
|
a
|
|
524
524
|
])
|
|
525
525
|
};
|
|
526
|
-
},
|
|
526
|
+
}, Je = { label: "_label_14i7c_1" }, Ye = ({ features: e, responseFormat: t, systemPrompt: n, temperature: i, onResponseFormatChange: o, onSystemPromptChange: l, 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 = [
|
|
527
527
|
"Precise",
|
|
528
528
|
"Neutral",
|
|
529
529
|
"Creative"
|
|
530
530
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
531
|
-
let S = s({ "--csf-label-text": x?.labelText }), C = c(b,
|
|
531
|
+
let S = s({ "--csf-label-text": x?.labelText }), C = c(b, Je.label, "gap-1");
|
|
532
532
|
return /* @__PURE__ */ W("div", {
|
|
533
533
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
534
534
|
style: S,
|
|
@@ -556,7 +556,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
556
556
|
value: n,
|
|
557
557
|
placeholder: g,
|
|
558
558
|
className: r,
|
|
559
|
-
resize:
|
|
559
|
+
resize: M.Vertical,
|
|
560
560
|
labelProps: {
|
|
561
561
|
className: C,
|
|
562
562
|
label: h
|
|
@@ -579,7 +579,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
579
579
|
})
|
|
580
580
|
]
|
|
581
581
|
});
|
|
582
|
-
},
|
|
582
|
+
}, G = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
|
|
583
583
|
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } = qe({
|
|
584
584
|
isOpen: e,
|
|
585
585
|
features: o,
|
|
@@ -597,7 +597,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
597
597
|
onBack: t,
|
|
598
598
|
backLabel: n,
|
|
599
599
|
style: a,
|
|
600
|
-
children: [/* @__PURE__ */ U(
|
|
600
|
+
children: [/* @__PURE__ */ U(Ye, {
|
|
601
601
|
features: o,
|
|
602
602
|
responseFormat: T,
|
|
603
603
|
systemPrompt: E,
|
|
@@ -616,7 +616,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
616
616
|
temperatureHint: x
|
|
617
617
|
}), /* @__PURE__ */ U("div", {
|
|
618
618
|
className: c("px-6 py-4 mobile:pb-8"),
|
|
619
|
-
children: /* @__PURE__ */ U(
|
|
619
|
+
children: /* @__PURE__ */ U(N, {
|
|
620
620
|
tooltip: C,
|
|
621
621
|
hideTooltip: O || !C,
|
|
622
622
|
triggerClassName: "w-full",
|
|
@@ -647,7 +647,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
647
647
|
className: y,
|
|
648
648
|
footer: /* @__PURE__ */ U("div", {
|
|
649
649
|
className: "flex justify-end px-6 py-4",
|
|
650
|
-
children: /* @__PURE__ */ U(
|
|
650
|
+
children: /* @__PURE__ */ U(N, {
|
|
651
651
|
tooltip: v,
|
|
652
652
|
hideTooltip: E || !v,
|
|
653
653
|
children: /* @__PURE__ */ U(w, {
|
|
@@ -657,7 +657,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
657
657
|
})
|
|
658
658
|
})
|
|
659
659
|
}),
|
|
660
|
-
children: /* @__PURE__ */ U(
|
|
660
|
+
children: /* @__PURE__ */ U(Ye, {
|
|
661
661
|
features: e,
|
|
662
662
|
responseFormat: b,
|
|
663
663
|
systemPrompt: x,
|
|
@@ -707,7 +707,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
707
707
|
}),
|
|
708
708
|
iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
|
|
709
709
|
className: c("ms-auto", Qe.selectedIcon),
|
|
710
|
-
children: /* @__PURE__ */ U(
|
|
710
|
+
children: /* @__PURE__ */ U(ae, {
|
|
711
711
|
size: u,
|
|
712
712
|
"aria-hidden": !0,
|
|
713
713
|
stroke: m
|
|
@@ -725,14 +725,14 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
725
725
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
726
726
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
727
727
|
}, tt = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: o, menuCloseLabel: d, style: f, listClassName: _ = "w-[240px]", isDisabled: y = !1, chatSettings: x, extraMenuItems: S, toolsMenuItems: C = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, colors: O }) => {
|
|
728
|
-
let k = l(), [ee, A] =
|
|
728
|
+
let k = l(), [ee, A] = B(!1), [te, j] = B(!1), [ne, M] = B(!1), [N, re] = B(null), [ie, ae] = B(!1), P = R(() => s({
|
|
729
729
|
"--aab-tool-icon": O?.toolIcon,
|
|
730
730
|
"--aab-chevron-icon": O?.chevronIcon
|
|
731
|
-
}), [O?.toolIcon, O?.chevronIcon]), se = C.length > 0 && w != null, F = D != null && D.length > 0, ue =
|
|
731
|
+
}), [O?.toolIcon, O?.chevronIcon]), se = C.length > 0 && w != null, F = D != null && D.length > 0, ue = R(() => C.map((e) => ({
|
|
732
732
|
key: e.id,
|
|
733
733
|
label: e.label,
|
|
734
734
|
icon: /* @__PURE__ */ U("span", {
|
|
735
|
-
style:
|
|
735
|
+
style: P,
|
|
736
736
|
className: c("flex items-center", et.toolIcon),
|
|
737
737
|
children: e.icon
|
|
738
738
|
}),
|
|
@@ -743,8 +743,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
743
743
|
})), [
|
|
744
744
|
C,
|
|
745
745
|
w,
|
|
746
|
-
|
|
747
|
-
]), me =
|
|
746
|
+
P
|
|
747
|
+
]), me = R(() => [
|
|
748
748
|
...e == null ? [] : [{
|
|
749
749
|
key: "attach",
|
|
750
750
|
label: r,
|
|
@@ -765,12 +765,12 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
765
765
|
stroke: m
|
|
766
766
|
}),
|
|
767
767
|
onClick: k ? () => {
|
|
768
|
-
|
|
768
|
+
M(!0), A(!1);
|
|
769
769
|
} : () => void 0,
|
|
770
|
-
...k ? { iconAfter: /* @__PURE__ */ U(
|
|
770
|
+
...k ? { iconAfter: /* @__PURE__ */ U(oe, {
|
|
771
771
|
size: u,
|
|
772
772
|
stroke: m,
|
|
773
|
-
style:
|
|
773
|
+
style: P,
|
|
774
774
|
className: c("rtl:scale-x-[-1]", et.chevronIcon),
|
|
775
775
|
"aria-hidden": !0
|
|
776
776
|
}) } : { children: ue }
|
|
@@ -780,12 +780,12 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
780
780
|
label: e.title,
|
|
781
781
|
icon: e.icon,
|
|
782
782
|
onClick: k ? () => {
|
|
783
|
-
|
|
783
|
+
re(e.key), A(!1);
|
|
784
784
|
} : () => void 0,
|
|
785
|
-
...k ? { iconAfter: /* @__PURE__ */ U(
|
|
785
|
+
...k ? { iconAfter: /* @__PURE__ */ U(oe, {
|
|
786
786
|
size: u,
|
|
787
787
|
stroke: m,
|
|
788
|
-
style:
|
|
788
|
+
style: P,
|
|
789
789
|
className: c("rtl:scale-x-[-1]", et.chevronIcon),
|
|
790
790
|
"aria-hidden": !0
|
|
791
791
|
}) } : {
|
|
@@ -793,7 +793,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
793
793
|
key: `${e.key}-panel`,
|
|
794
794
|
label: ""
|
|
795
795
|
}],
|
|
796
|
-
renderSubMenu: () => e.renderOverlay(() =>
|
|
796
|
+
renderSubMenu: () => e.renderOverlay(() => ae(!1))
|
|
797
797
|
}
|
|
798
798
|
})),
|
|
799
799
|
...t == null ? [] : [{
|
|
@@ -805,7 +805,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
805
805
|
stroke: m
|
|
806
806
|
}),
|
|
807
807
|
onClick: () => {
|
|
808
|
-
A(!1),
|
|
808
|
+
A(!1), ae(!1), t();
|
|
809
809
|
}
|
|
810
810
|
}],
|
|
811
811
|
...x == null ? [] : [{
|
|
@@ -816,10 +816,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
816
816
|
"aria-hidden": !0,
|
|
817
817
|
stroke: m
|
|
818
818
|
}),
|
|
819
|
-
iconAfter: k ? /* @__PURE__ */ U(
|
|
819
|
+
iconAfter: k ? /* @__PURE__ */ U(oe, {
|
|
820
820
|
size: u,
|
|
821
821
|
stroke: m,
|
|
822
|
-
style:
|
|
822
|
+
style: P,
|
|
823
823
|
className: c("rtl:scale-x-[-1]", et.chevronIcon),
|
|
824
824
|
"aria-hidden": !0
|
|
825
825
|
}) : null,
|
|
@@ -837,7 +837,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
837
837
|
T,
|
|
838
838
|
ue,
|
|
839
839
|
D,
|
|
840
|
-
|
|
840
|
+
P
|
|
841
841
|
]);
|
|
842
842
|
if (me.length === 0) return null;
|
|
843
843
|
let he = /* @__PURE__ */ U(h, {
|
|
@@ -845,8 +845,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
845
845
|
placement: "bottom-start",
|
|
846
846
|
listClassName: _,
|
|
847
847
|
items: me,
|
|
848
|
-
open: F ?
|
|
849
|
-
onOpenChange: F ?
|
|
848
|
+
open: F ? ie : void 0,
|
|
849
|
+
onOpenChange: F ? ae : void 0,
|
|
850
850
|
children: /* @__PURE__ */ U(v, {
|
|
851
851
|
icon: /* @__PURE__ */ U(de, {
|
|
852
852
|
size: p.LG,
|
|
@@ -884,10 +884,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
884
884
|
se && /* @__PURE__ */ U($e, {
|
|
885
885
|
isOpen: ne,
|
|
886
886
|
onBack: () => {
|
|
887
|
-
|
|
887
|
+
M(!1), A(!0);
|
|
888
888
|
},
|
|
889
889
|
backLabel: E,
|
|
890
|
-
onClose: () =>
|
|
890
|
+
onClose: () => M(!1),
|
|
891
891
|
closeLabel: d,
|
|
892
892
|
style: f,
|
|
893
893
|
title: T,
|
|
@@ -895,18 +895,18 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
895
895
|
onToolToggle: w
|
|
896
896
|
}),
|
|
897
897
|
D?.map((e) => /* @__PURE__ */ U(Ee, {
|
|
898
|
-
isOpen:
|
|
898
|
+
isOpen: N === e.key,
|
|
899
899
|
title: e.title,
|
|
900
900
|
closeLabel: d,
|
|
901
901
|
onBack: () => {
|
|
902
|
-
|
|
902
|
+
re(null), A(!0);
|
|
903
903
|
},
|
|
904
904
|
backLabel: e.backLabel ?? "Back",
|
|
905
|
-
onClose: () =>
|
|
905
|
+
onClose: () => re(null),
|
|
906
906
|
style: f,
|
|
907
|
-
children: e.renderOverlay(() =>
|
|
907
|
+
children: e.renderOverlay(() => re(null))
|
|
908
908
|
}, e.key)),
|
|
909
|
-
x != null && /* @__PURE__ */ U(
|
|
909
|
+
x != null && /* @__PURE__ */ U(G, {
|
|
910
910
|
isOpen: te,
|
|
911
911
|
onBack: () => {
|
|
912
912
|
j(!1), A(!0);
|
|
@@ -1017,17 +1017,17 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1017
1017
|
waveformCanvas: "_waveformCanvas_129ri_5",
|
|
1018
1018
|
recordingDot: "_recordingDot_129ri_19",
|
|
1019
1019
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
1020
|
-
}, ot = 3, st = 4,
|
|
1021
|
-
let h =
|
|
1020
|
+
}, ot = 3, st = 4, ct = 200, lt = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: l = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
|
|
1021
|
+
let h = z(null), g = z(new Float32Array(ct)), y = z(0), b = z(0), x = e === Le.Recording, S = e === Le.Error, C = e === Le.Processing, w = I((e) => {
|
|
1022
1022
|
let t = e.getContext("2d");
|
|
1023
1023
|
if (!t) return;
|
|
1024
1024
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
1025
1025
|
let { width: n, height: r } = e;
|
|
1026
1026
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
1027
|
-
let i = Math.min(Math.max(1, Math.floor(n / st)),
|
|
1027
|
+
let i = Math.min(Math.max(1, Math.floor(n / st)), ct - 1), a = y.current, o = b.current;
|
|
1028
1028
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
1029
1029
|
for (let e = 0; e <= i; e++) {
|
|
1030
|
-
let n = ((a - i + e) %
|
|
1030
|
+
let n = ((a - i + e) % ct + ct) % ct, o = g.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
1031
1031
|
t.fillRect(e * st, (r - c) / 2, ot, c);
|
|
1032
1032
|
}
|
|
1033
1033
|
t.restore();
|
|
@@ -1049,7 +1049,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1049
1049
|
let r = (t[e] - 128) / 128;
|
|
1050
1050
|
n += r * r;
|
|
1051
1051
|
}
|
|
1052
|
-
g.current[y.current %
|
|
1052
|
+
g.current[y.current % ct] = Math.sqrt(n / t.length), y.current++;
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
1055
|
w(e), n = requestAnimationFrame(r);
|
|
@@ -1129,28 +1129,29 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1129
1129
|
})
|
|
1130
1130
|
})]
|
|
1131
1131
|
});
|
|
1132
|
-
},
|
|
1132
|
+
}, ut = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ U(T, {
|
|
1133
1133
|
"aria-label": n,
|
|
1134
1134
|
onClick: () => e?.(),
|
|
1135
1135
|
disabled: t,
|
|
1136
|
-
|
|
1136
|
+
tooltipProps: r ? { tooltip: r } : void 0,
|
|
1137
|
+
icon: /* @__PURE__ */ U(ie, {
|
|
1137
1138
|
size: p.LG,
|
|
1138
1139
|
className: "rtl:scale-x-[-1]",
|
|
1139
1140
|
stroke: m
|
|
1140
1141
|
})
|
|
1141
|
-
}),
|
|
1142
|
+
}), dt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(j, {
|
|
1142
1143
|
icon: /* @__PURE__ */ U(ue, {
|
|
1143
1144
|
size: p.LG,
|
|
1144
1145
|
stroke: m
|
|
1145
1146
|
}),
|
|
1146
1147
|
onClick: () => e?.(),
|
|
1147
1148
|
"aria-label": t
|
|
1148
|
-
}),
|
|
1149
|
+
}), ft = ({ size: e = 20 }) => /* @__PURE__ */ U(k, {
|
|
1149
1150
|
variant: ee.Circular,
|
|
1150
1151
|
width: e,
|
|
1151
1152
|
height: e,
|
|
1152
1153
|
active: !0
|
|
1153
|
-
}),
|
|
1154
|
+
}), pt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
|
|
1154
1155
|
className: "flex min-w-0 flex-1 items-center",
|
|
1155
1156
|
children: [/* @__PURE__ */ U(k, {
|
|
1156
1157
|
variant: ee.Text,
|
|
@@ -1161,24 +1162,24 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1161
1162
|
className: "sr-only",
|
|
1162
1163
|
children: e
|
|
1163
1164
|
})]
|
|
1164
|
-
}),
|
|
1165
|
+
}), mt = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
|
|
1165
1166
|
role: "status",
|
|
1166
1167
|
"aria-label": e,
|
|
1167
1168
|
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
|
|
1168
1169
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1169
1170
|
"aria-hidden": "true",
|
|
1170
|
-
children: [/* @__PURE__ */ U(
|
|
1171
|
+
children: [/* @__PURE__ */ U(ft, {}), /* @__PURE__ */ U(pt, {})]
|
|
1171
1172
|
}, t))
|
|
1172
|
-
}),
|
|
1173
|
+
}), ht = (e) => e.displayName ?? e.id, gt = (e, t) => {
|
|
1173
1174
|
let n = t.trim().toLowerCase();
|
|
1174
|
-
return n ? e.filter((e) =>
|
|
1175
|
-
},
|
|
1175
|
+
return n ? e.filter((e) => ht(e).toLowerCase().includes(n)) : e;
|
|
1176
|
+
}, q = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
|
|
1176
1177
|
src: e,
|
|
1177
1178
|
size: i,
|
|
1178
1179
|
labels: { tooltip: a },
|
|
1179
1180
|
initialsName: r
|
|
1180
|
-
}),
|
|
1181
|
-
let [o, l] =
|
|
1181
|
+
}), J = { searchHeader: "_searchHeader_1728o_1" }, _t = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = J.searchHeader, colors: a }) => {
|
|
1182
|
+
let [o, l] = B(""), u = R(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = R(() => d ? /* @__PURE__ */ U(ft, { size: p.LG }) : q(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", p.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1182
1183
|
d,
|
|
1183
1184
|
u,
|
|
1184
1185
|
f,
|
|
@@ -1189,11 +1190,11 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1189
1190
|
selectorAriaLabel: h ? `${r?.ariaLabel ?? "Select model"}: ${h}` : r?.ariaLabel ?? "Select model",
|
|
1190
1191
|
selectedLabel: h,
|
|
1191
1192
|
selectedVersion: _,
|
|
1192
|
-
menuItems:
|
|
1193
|
+
menuItems: R(() => {
|
|
1193
1194
|
if (d) return Array.from({ length: 7 }, (e, t) => ({
|
|
1194
1195
|
key: `__loading-${t}`,
|
|
1195
|
-
icon: /* @__PURE__ */ U(
|
|
1196
|
-
label: /* @__PURE__ */ U(
|
|
1196
|
+
icon: /* @__PURE__ */ U(ft, {}),
|
|
1197
|
+
label: /* @__PURE__ */ U(pt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1197
1198
|
disabled: !0
|
|
1198
1199
|
}));
|
|
1199
1200
|
if (!e || e.length === 0) {
|
|
@@ -1204,14 +1205,14 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1204
1205
|
disabled: !0
|
|
1205
1206
|
}] : [];
|
|
1206
1207
|
}
|
|
1207
|
-
return
|
|
1208
|
+
return gt(e, o).map((e) => ({
|
|
1208
1209
|
key: e.id,
|
|
1209
1210
|
label: /* @__PURE__ */ U(y, {
|
|
1210
|
-
text:
|
|
1211
|
+
text: ht(e),
|
|
1211
1212
|
query: o,
|
|
1212
1213
|
maxLines: 1
|
|
1213
1214
|
}),
|
|
1214
|
-
icon:
|
|
1215
|
+
icon: q(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1215
1216
|
mark: b.Check,
|
|
1216
1217
|
checked: e.id === t,
|
|
1217
1218
|
onClick: () => n?.(e.id)
|
|
@@ -1224,7 +1225,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1224
1225
|
r,
|
|
1225
1226
|
n
|
|
1226
1227
|
]),
|
|
1227
|
-
menuHeader:
|
|
1228
|
+
menuHeader: R(() => !d && e && e.length > 0 ? /* @__PURE__ */ U("div", {
|
|
1228
1229
|
style: s({ "--ms-search-header-bg": a?.searchHeaderBackground }),
|
|
1229
1230
|
className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1230
1231
|
children: /* @__PURE__ */ U(O, {
|
|
@@ -1246,8 +1247,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1246
1247
|
e || l("");
|
|
1247
1248
|
}
|
|
1248
1249
|
};
|
|
1249
|
-
},
|
|
1250
|
-
function
|
|
1250
|
+
}, vt = typeof window < "u" ? ve : L;
|
|
1251
|
+
function yt(e) {
|
|
1251
1252
|
if (e !== void 0) switch (typeof e) {
|
|
1252
1253
|
case "number": return e;
|
|
1253
1254
|
case "string":
|
|
@@ -1255,15 +1256,15 @@ function vt(e) {
|
|
|
1255
1256
|
break;
|
|
1256
1257
|
}
|
|
1257
1258
|
}
|
|
1258
|
-
function
|
|
1259
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1260
|
-
styleHeight:
|
|
1261
|
-
styleWidth:
|
|
1262
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1259
|
+
function bt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1260
|
+
let { styleHeight: s, styleWidth: c } = R(() => ({
|
|
1261
|
+
styleHeight: yt(o?.height),
|
|
1262
|
+
styleWidth: yt(o?.width)
|
|
1263
|
+
}), [o?.height, o?.width]), [l, u] = B({
|
|
1263
1264
|
height: t,
|
|
1264
1265
|
width: n
|
|
1265
1266
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1266
|
-
return
|
|
1267
|
+
return vt(() => {
|
|
1267
1268
|
if (i === null || d) return;
|
|
1268
1269
|
let t = new ResizeObserver((e) => {
|
|
1269
1270
|
for (let t of e) {
|
|
@@ -1283,7 +1284,7 @@ function X({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
1283
1284
|
i,
|
|
1284
1285
|
s,
|
|
1285
1286
|
c
|
|
1286
|
-
]),
|
|
1287
|
+
]), R(() => ({
|
|
1287
1288
|
height: s ?? l.height,
|
|
1288
1289
|
width: c ?? l.width
|
|
1289
1290
|
}), [
|
|
@@ -1292,26 +1293,26 @@ function X({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
1292
1293
|
c
|
|
1293
1294
|
]);
|
|
1294
1295
|
}
|
|
1295
|
-
function
|
|
1296
|
-
let t =
|
|
1296
|
+
function xt(e) {
|
|
1297
|
+
let t = z(() => {
|
|
1297
1298
|
throw Error("Cannot call during render.");
|
|
1298
1299
|
});
|
|
1299
|
-
return
|
|
1300
|
+
return vt(() => {
|
|
1300
1301
|
t.current = e;
|
|
1301
1302
|
}, [e]), I((e) => t.current?.(e), [t]);
|
|
1302
1303
|
}
|
|
1303
|
-
var
|
|
1304
|
-
function
|
|
1305
|
-
if (
|
|
1304
|
+
var Y = null;
|
|
1305
|
+
function X(e = !1) {
|
|
1306
|
+
if (Y === null || e) {
|
|
1306
1307
|
let e = document.createElement("div"), t = e.style;
|
|
1307
1308
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1308
1309
|
let n = document.createElement("div"), r = n.style;
|
|
1309
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1310
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Y = "positive-descending" : (e.scrollLeft = 1, Y = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Y;
|
|
1310
1311
|
}
|
|
1311
|
-
return
|
|
1312
|
+
return Y;
|
|
1312
1313
|
}
|
|
1313
|
-
function
|
|
1314
|
-
if (t === "horizontal" && n) switch (
|
|
1314
|
+
function Z({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1315
|
+
if (t === "horizontal" && n) switch (X()) {
|
|
1315
1316
|
case "negative": return -r;
|
|
1316
1317
|
case "positive-descending":
|
|
1317
1318
|
if (e) {
|
|
@@ -1322,26 +1323,26 @@ function bt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1322
1323
|
}
|
|
1323
1324
|
return r;
|
|
1324
1325
|
}
|
|
1325
|
-
function
|
|
1326
|
+
function Q(e, t = "Assertion error") {
|
|
1326
1327
|
if (!e) throw console.error(t), Error(t);
|
|
1327
1328
|
}
|
|
1328
|
-
function
|
|
1329
|
+
function St(e, t) {
|
|
1329
1330
|
if (e === t) return !0;
|
|
1330
|
-
if (!!e != !!t || (
|
|
1331
|
+
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1331
1332
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1332
1333
|
return !0;
|
|
1333
1334
|
}
|
|
1334
|
-
function
|
|
1335
|
+
function Ct({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1335
1336
|
if (t === 0) return 0;
|
|
1336
1337
|
if (typeof n == "number") return t * n;
|
|
1337
1338
|
{
|
|
1338
1339
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1339
|
-
return
|
|
1340
|
+
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1340
1341
|
}
|
|
1341
1342
|
}
|
|
1342
|
-
function
|
|
1343
|
+
function wt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1343
1344
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1344
|
-
let s =
|
|
1345
|
+
let s = Ct({
|
|
1345
1346
|
cachedBounds: t,
|
|
1346
1347
|
itemCount: r,
|
|
1347
1348
|
itemSize: i
|
|
@@ -1353,7 +1354,7 @@ function Ct({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1353
1354
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1354
1355
|
}
|
|
1355
1356
|
}
|
|
1356
|
-
function
|
|
1357
|
+
function Tt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1357
1358
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1358
1359
|
for (; u < a;) {
|
|
1359
1360
|
let n = e.get(u);
|
|
@@ -1372,11 +1373,11 @@ function wt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1372
1373
|
stopIndexOverscan: l
|
|
1373
1374
|
};
|
|
1374
1375
|
}
|
|
1375
|
-
function
|
|
1376
|
+
function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1376
1377
|
let r = /* @__PURE__ */ new Map();
|
|
1377
1378
|
return {
|
|
1378
1379
|
get(i) {
|
|
1379
|
-
for (
|
|
1380
|
+
for (Q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1380
1381
|
let e = r.size, a;
|
|
1381
1382
|
switch (typeof n) {
|
|
1382
1383
|
case "function":
|
|
@@ -1392,14 +1393,14 @@ function Tt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1392
1393
|
});
|
|
1393
1394
|
else {
|
|
1394
1395
|
let t = r.get(e - 1);
|
|
1395
|
-
|
|
1396
|
+
Q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1396
1397
|
scrollOffset: t.scrollOffset + t.size,
|
|
1397
1398
|
size: a
|
|
1398
1399
|
});
|
|
1399
1400
|
}
|
|
1400
1401
|
}
|
|
1401
1402
|
let a = r.get(i);
|
|
1402
|
-
return
|
|
1403
|
+
return Q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1403
1404
|
},
|
|
1404
1405
|
set(e, t) {
|
|
1405
1406
|
r.set(e, t);
|
|
@@ -1409,8 +1410,8 @@ function Tt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1409
1410
|
}
|
|
1410
1411
|
};
|
|
1411
1412
|
}
|
|
1412
|
-
function
|
|
1413
|
-
return
|
|
1413
|
+
function Dt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1414
|
+
return R(() => Et({
|
|
1414
1415
|
itemCount: e,
|
|
1415
1416
|
itemProps: t,
|
|
1416
1417
|
itemSize: n
|
|
@@ -1420,11 +1421,11 @@ function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1420
1421
|
n
|
|
1421
1422
|
]);
|
|
1422
1423
|
}
|
|
1423
|
-
function
|
|
1424
|
+
function Ot({ containerSize: e, itemSize: t }) {
|
|
1424
1425
|
let n;
|
|
1425
1426
|
switch (typeof t) {
|
|
1426
1427
|
case "string":
|
|
1427
|
-
|
|
1428
|
+
Q(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Q(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
1428
1429
|
break;
|
|
1429
1430
|
default:
|
|
1430
1431
|
n = t;
|
|
@@ -1432,21 +1433,21 @@ function Dt({ containerSize: e, itemSize: t }) {
|
|
|
1432
1433
|
}
|
|
1433
1434
|
return n;
|
|
1434
1435
|
}
|
|
1435
|
-
function
|
|
1436
|
-
let { height: u = n, width: d = n } =
|
|
1436
|
+
function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1437
|
+
let { height: u = n, width: d = n } = bt({
|
|
1437
1438
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1438
1439
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1439
1440
|
element: e,
|
|
1440
1441
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1441
1442
|
style: t
|
|
1442
|
-
}), f =
|
|
1443
|
+
}), f = z({
|
|
1443
1444
|
height: 0,
|
|
1444
1445
|
width: 0
|
|
1445
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1446
|
+
}), p = r === "vertical" ? u : d, m = Ot({
|
|
1446
1447
|
containerSize: p,
|
|
1447
1448
|
itemSize: s
|
|
1448
1449
|
});
|
|
1449
|
-
|
|
1450
|
+
ve(() => {
|
|
1450
1451
|
if (typeof c == "function") {
|
|
1451
1452
|
let e = f.current;
|
|
1452
1453
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1459,11 +1460,11 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1459
1460
|
c,
|
|
1460
1461
|
d
|
|
1461
1462
|
]);
|
|
1462
|
-
let h =
|
|
1463
|
+
let h = Dt({
|
|
1463
1464
|
itemCount: a,
|
|
1464
1465
|
itemProps: o,
|
|
1465
1466
|
itemSize: m
|
|
1466
|
-
}), g = I((e) => h.get(e), [h]), [_, v] =
|
|
1467
|
+
}), g = I((e) => h.get(e), [h]), [_, v] = B(() => Tt({
|
|
1467
1468
|
cachedBounds: h,
|
|
1468
1469
|
containerScrollOffset: 0,
|
|
1469
1470
|
containerSize: p,
|
|
@@ -1474,7 +1475,7 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1474
1475
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1475
1476
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1476
1477
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1477
|
-
}, C = I(() =>
|
|
1478
|
+
}, C = I(() => Ct({
|
|
1478
1479
|
cachedBounds: h,
|
|
1479
1480
|
itemCount: a,
|
|
1480
1481
|
itemSize: m
|
|
@@ -1482,9 +1483,9 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1482
1483
|
h,
|
|
1483
1484
|
a,
|
|
1484
1485
|
m
|
|
1485
|
-
]), w = I((t) =>
|
|
1486
|
+
]), w = I((t) => Tt({
|
|
1486
1487
|
cachedBounds: h,
|
|
1487
|
-
containerScrollOffset:
|
|
1488
|
+
containerScrollOffset: Z({
|
|
1488
1489
|
containerElement: e,
|
|
1489
1490
|
direction: r,
|
|
1490
1491
|
isRtl: i,
|
|
@@ -1502,19 +1503,19 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1502
1503
|
a,
|
|
1503
1504
|
l
|
|
1504
1505
|
]);
|
|
1505
|
-
return
|
|
1506
|
+
return vt(() => {
|
|
1506
1507
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1507
1508
|
}, [
|
|
1508
1509
|
e,
|
|
1509
1510
|
r,
|
|
1510
1511
|
w
|
|
1511
|
-
]),
|
|
1512
|
+
]), vt(() => {
|
|
1512
1513
|
if (!e) return;
|
|
1513
1514
|
let t = () => {
|
|
1514
1515
|
v((t) => {
|
|
1515
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1516
|
+
let { scrollLeft: n, scrollTop: o } = e, s = Tt({
|
|
1516
1517
|
cachedBounds: h,
|
|
1517
|
-
containerScrollOffset:
|
|
1518
|
+
containerScrollOffset: Z({
|
|
1518
1519
|
containerElement: e,
|
|
1519
1520
|
direction: r,
|
|
1520
1521
|
isRtl: i,
|
|
@@ -1524,7 +1525,7 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1524
1525
|
itemCount: a,
|
|
1525
1526
|
overscanCount: l
|
|
1526
1527
|
});
|
|
1527
|
-
return
|
|
1528
|
+
return St(s, t) ? t : s;
|
|
1528
1529
|
});
|
|
1529
1530
|
};
|
|
1530
1531
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1540,8 +1541,8 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1540
1541
|
]), {
|
|
1541
1542
|
getCellBounds: g,
|
|
1542
1543
|
getEstimatedSize: C,
|
|
1543
|
-
scrollToIndex:
|
|
1544
|
-
let s =
|
|
1544
|
+
scrollToIndex: xt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1545
|
+
let s = wt({
|
|
1545
1546
|
align: t,
|
|
1546
1547
|
cachedBounds: h,
|
|
1547
1548
|
containerScrollOffset: n,
|
|
@@ -1551,14 +1552,14 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1551
1552
|
itemSize: m
|
|
1552
1553
|
});
|
|
1553
1554
|
if (e) {
|
|
1554
|
-
if (s =
|
|
1555
|
+
if (s = Z({
|
|
1555
1556
|
containerElement: e,
|
|
1556
1557
|
direction: r,
|
|
1557
1558
|
isRtl: i,
|
|
1558
1559
|
scrollOffset: s
|
|
1559
1560
|
}), typeof e.scrollTo != "function") {
|
|
1560
1561
|
let e = w(s);
|
|
1561
|
-
|
|
1562
|
+
St(_, e) || v(e);
|
|
1562
1563
|
}
|
|
1563
1564
|
return s;
|
|
1564
1565
|
}
|
|
@@ -1569,30 +1570,30 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1569
1570
|
stopIndexVisible: x
|
|
1570
1571
|
};
|
|
1571
1572
|
}
|
|
1572
|
-
function
|
|
1573
|
-
return
|
|
1573
|
+
function At(e) {
|
|
1574
|
+
return R(() => e, Object.values(e));
|
|
1574
1575
|
}
|
|
1575
|
-
function
|
|
1576
|
+
function jt(e, t) {
|
|
1576
1577
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1577
|
-
return
|
|
1578
|
+
return St(n, a) && St(r, o) && St(i, s);
|
|
1578
1579
|
}
|
|
1579
|
-
function
|
|
1580
|
+
function Mt(e) {
|
|
1580
1581
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1581
1582
|
}
|
|
1582
|
-
var
|
|
1583
|
-
function
|
|
1584
|
-
let m =
|
|
1583
|
+
var Nt = "data-react-window-index";
|
|
1584
|
+
function Pt({ 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 }) {
|
|
1585
|
+
let m = At(u), h = R(() => ge(s, jt), [s]), [g, _] = B(null), v = Mt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = kt({
|
|
1585
1586
|
containerElement: g,
|
|
1586
1587
|
containerStyle: f,
|
|
1587
1588
|
defaultContainerSize: n,
|
|
1588
1589
|
direction: "vertical",
|
|
1589
1590
|
itemCount: c,
|
|
1590
1591
|
itemProps: m,
|
|
1591
|
-
itemSize:
|
|
1592
|
+
itemSize: R(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1592
1593
|
onResize: i,
|
|
1593
1594
|
overscanCount: o
|
|
1594
1595
|
});
|
|
1595
|
-
|
|
1596
|
+
_e(r, () => ({
|
|
1596
1597
|
get element() {
|
|
1597
1598
|
return g;
|
|
1598
1599
|
},
|
|
@@ -1607,12 +1608,12 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1607
1608
|
top: r
|
|
1608
1609
|
});
|
|
1609
1610
|
}
|
|
1610
|
-
}), [g, x]),
|
|
1611
|
+
}), [g, x]), vt(() => {
|
|
1611
1612
|
if (!g) return;
|
|
1612
1613
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1613
1614
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1614
1615
|
let n = `${S + t}`;
|
|
1615
|
-
return e.setAttribute(
|
|
1616
|
+
return e.setAttribute(Nt, n), !0;
|
|
1616
1617
|
});
|
|
1617
1618
|
if (v) return l.observeRowElements(e);
|
|
1618
1619
|
}, [
|
|
@@ -1636,7 +1637,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1636
1637
|
w,
|
|
1637
1638
|
T
|
|
1638
1639
|
]);
|
|
1639
|
-
let E =
|
|
1640
|
+
let E = R(() => {
|
|
1640
1641
|
let e = [];
|
|
1641
1642
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1642
1643
|
let n = y(t);
|
|
@@ -1689,23 +1690,23 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1689
1690
|
}
|
|
1690
1691
|
}, E, e, D);
|
|
1691
1692
|
}
|
|
1692
|
-
var
|
|
1693
|
+
var Ft = {
|
|
1693
1694
|
divider: "_divider_1tiyp_1",
|
|
1694
1695
|
item: "_item_1tiyp_5",
|
|
1695
1696
|
itemIcon: "_itemIcon_1tiyp_15",
|
|
1696
1697
|
checkIcon: "_checkIcon_1tiyp_19",
|
|
1697
1698
|
stateLabel: "_stateLabel_1tiyp_23"
|
|
1698
|
-
},
|
|
1699
|
-
let l = r[e], u =
|
|
1699
|
+
}, It = 44, Lt = 8, Rt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
|
|
1700
|
+
let l = r[e], u = q(l.iconUrl, l.type, l.displayName ?? l.id, p.SM), f = l.id === i;
|
|
1700
1701
|
return /* @__PURE__ */ U("div", {
|
|
1701
1702
|
style: t,
|
|
1702
1703
|
...n,
|
|
1703
1704
|
children: /* @__PURE__ */ U(d, {
|
|
1704
1705
|
type: "button",
|
|
1705
1706
|
"aria-current": f ? "true" : void 0,
|
|
1706
|
-
className: c(
|
|
1707
|
+
className: c(Ft.item, "h-full w-full gap-3 px-4"),
|
|
1707
1708
|
iconBefore: /* @__PURE__ */ U("span", {
|
|
1708
|
-
className:
|
|
1709
|
+
className: Ft.itemIcon,
|
|
1709
1710
|
children: u
|
|
1710
1711
|
}),
|
|
1711
1712
|
label: /* @__PURE__ */ W("span", {
|
|
@@ -1715,9 +1716,9 @@ var Pt = {
|
|
|
1715
1716
|
query: o,
|
|
1716
1717
|
maxLines: 1,
|
|
1717
1718
|
className: c(a, "min-w-0 flex-1 text-start")
|
|
1718
|
-
}), f && /* @__PURE__ */ U(
|
|
1719
|
+
}), f && /* @__PURE__ */ U(ae, {
|
|
1719
1720
|
size: p.SM,
|
|
1720
|
-
className:
|
|
1721
|
+
className: Ft.checkIcon,
|
|
1721
1722
|
"aria-hidden": !0,
|
|
1722
1723
|
stroke: m
|
|
1723
1724
|
})]
|
|
@@ -1725,12 +1726,12 @@ var Pt = {
|
|
|
1725
1726
|
onClick: () => s(l.id)
|
|
1726
1727
|
})
|
|
1727
1728
|
});
|
|
1728
|
-
},
|
|
1729
|
-
let [v, y] =
|
|
1729
|
+
}, zt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: _ }) => {
|
|
1730
|
+
let [v, y] = B("");
|
|
1730
1731
|
L(() => {
|
|
1731
1732
|
e || y("");
|
|
1732
1733
|
}, [e]);
|
|
1733
|
-
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ?
|
|
1734
|
+
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? gt(a, v) : [], w = (e) => {
|
|
1734
1735
|
l(e), i();
|
|
1735
1736
|
}, T = s({
|
|
1736
1737
|
"--ci-sheet-divider": _?.divider,
|
|
@@ -1760,17 +1761,17 @@ var Pt = {
|
|
|
1760
1761
|
size: g.Standard,
|
|
1761
1762
|
onChange: (e) => y(e ?? "")
|
|
1762
1763
|
})
|
|
1763
|
-
}), /* @__PURE__ */ U("div", { className: c(
|
|
1764
|
+
}), /* @__PURE__ */ U("div", { className: c(Ft.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ U(mt, { loadingLabel: u }) : S ? /* @__PURE__ */ U("div", {
|
|
1764
1765
|
role: "list",
|
|
1765
|
-
className: c(
|
|
1766
|
+
className: c(Ft.stateLabel, h, "px-4 py-4"),
|
|
1766
1767
|
children: S
|
|
1767
|
-
}) : /* @__PURE__ */ U(
|
|
1768
|
+
}) : /* @__PURE__ */ U(Pt, {
|
|
1768
1769
|
role: "list",
|
|
1769
1770
|
className: "overflow-y-auto",
|
|
1770
|
-
style: { height: Math.min(C.length,
|
|
1771
|
-
rowComponent:
|
|
1771
|
+
style: { height: Math.min(C.length, Lt) * It },
|
|
1772
|
+
rowComponent: Rt,
|
|
1772
1773
|
rowCount: C.length,
|
|
1773
|
-
rowHeight:
|
|
1774
|
+
rowHeight: It,
|
|
1774
1775
|
rowProps: {
|
|
1775
1776
|
items: C,
|
|
1776
1777
|
selectedDeploymentId: o,
|
|
@@ -1781,21 +1782,21 @@ var Pt = {
|
|
|
1781
1782
|
})]
|
|
1782
1783
|
})
|
|
1783
1784
|
});
|
|
1784
|
-
},
|
|
1785
|
-
let [_, y] =
|
|
1785
|
+
}, Bt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: g }) => {
|
|
1786
|
+
let [_, y] = B(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: E } = _t({
|
|
1786
1787
|
deployments: e,
|
|
1787
1788
|
selectedDeploymentId: t,
|
|
1788
1789
|
onDeploymentChange: n,
|
|
1789
1790
|
modelSelectorLabels: r
|
|
1790
1791
|
});
|
|
1791
1792
|
if (!e) return null;
|
|
1792
|
-
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ U(
|
|
1793
|
+
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ U(P, {
|
|
1793
1794
|
size: p.SM,
|
|
1794
1795
|
className: K.modelSelectorCaret,
|
|
1795
1796
|
"aria-hidden": !0,
|
|
1796
1797
|
stroke: m
|
|
1797
1798
|
});
|
|
1798
|
-
return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
1799
|
+
return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(N, {
|
|
1799
1800
|
tooltip: S,
|
|
1800
1801
|
children: /* @__PURE__ */ U(v, {
|
|
1801
1802
|
icon: /* @__PURE__ */ W("div", {
|
|
@@ -1815,7 +1816,7 @@ var Pt = {
|
|
|
1815
1816
|
onClose: () => y(!1),
|
|
1816
1817
|
style: l,
|
|
1817
1818
|
children: u(() => y(!1))
|
|
1818
|
-
}) : /* @__PURE__ */ U(
|
|
1819
|
+
}) : /* @__PURE__ */ U(zt, {
|
|
1819
1820
|
isOpen: _,
|
|
1820
1821
|
title: r?.ariaLabel ?? "Select model",
|
|
1821
1822
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1837,7 +1838,7 @@ var Pt = {
|
|
|
1837
1838
|
outsideClosable: !0,
|
|
1838
1839
|
renderOverlay: () => u(() => g?.(!1)),
|
|
1839
1840
|
listClassName: "!w-[368px] !bg-layer-raised",
|
|
1840
|
-
children: /* @__PURE__ */ U(
|
|
1841
|
+
children: /* @__PURE__ */ U(N, {
|
|
1841
1842
|
tooltip: C ? `${S} · ${C}` : S,
|
|
1842
1843
|
children: /* @__PURE__ */ W("button", {
|
|
1843
1844
|
type: "button",
|
|
@@ -1875,7 +1876,7 @@ var Pt = {
|
|
|
1875
1876
|
listClassName: "!w-[240px]",
|
|
1876
1877
|
disabled: s,
|
|
1877
1878
|
onOpenChange: s ? void 0 : E,
|
|
1878
|
-
children: /* @__PURE__ */ U(
|
|
1879
|
+
children: /* @__PURE__ */ U(N, {
|
|
1879
1880
|
tooltip: S,
|
|
1880
1881
|
children: /* @__PURE__ */ W("button", {
|
|
1881
1882
|
type: "button",
|
|
@@ -1887,211 +1888,211 @@ var Pt = {
|
|
|
1887
1888
|
})
|
|
1888
1889
|
})
|
|
1889
1890
|
});
|
|
1890
|
-
},
|
|
1891
|
-
let
|
|
1892
|
-
"--ci-bg":
|
|
1893
|
-
"--ci-text":
|
|
1894
|
-
"--ci-border":
|
|
1895
|
-
"--ci-border-focus":
|
|
1896
|
-
"--ci-placeholder":
|
|
1897
|
-
"--ci-text-disabled":
|
|
1898
|
-
"--ci-model-selector-caret-color":
|
|
1899
|
-
"--ci-model-selector-hover-bg":
|
|
1900
|
-
"--ci-model-selector-disabled-color":
|
|
1901
|
-
"--ci-model-selector-name-color":
|
|
1902
|
-
"--ci-model-selector-version-color":
|
|
1903
|
-
"--ci-voice-error":
|
|
1904
|
-
"--ci-voice-waveform":
|
|
1905
|
-
"--ci-voice-accent":
|
|
1906
|
-
"--ci-first-line-indent":
|
|
1891
|
+
}, Vt = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: d, onAttachmentsChange: f, placeholder: g = "Type a message...", ariaLabel: y, attachLabel: b = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: E, uploadingLabel: D, sendLabel: O, sendTooltip: k, stopLabel: ee, micLabel: A = "Dictate", recordVoiceLabel: te = "Record voice", stopRecordingLabel: j, discardRecordingLabel: ne, colors: M, typography: N, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: ae, pendingAttachments: P = [], onPendingAttachmentsConsumed: oe, pasteTextThreshold: le = 4e3, maxMessageLength: F = 5e4, deployments: ue, selectedDeploymentId: de, onDeploymentChange: fe, modelSelectorLabels: pe, initialAttachments: me = [], hideAddButton: he = !1, hideAttachFile: ge = !1, hideActionBar: _e = !1, renderFooterActions: ve, isInputDisabled: V = !1, isModelSelectorDisabled: be = !1, isSendDisabled: xe = !1, isAudioMessageSupported: Ce = !1, isVoiceRecordingSupported: we = Ce, onTranscribeAudio: Te, transcribingLabel: Ee, voiceErrorLabel: De, sendOnEnter: ke = We.Enter, prefixAttachments: je = [], onRemovePrefixAttachment: Me, chatSettings: Fe, toolsMenuItems: ze, onToolToggle: Be, canRemoveTools: Ve = !0, toolsMenuTitle: He, toolsBackLabel: Ge, toolsChipLabels: Ke, menuOverlays: qe, inlineStartSlot: Je, onInlineStartRemove: Ye, commandMenu: G, autoFocus: Xe = !1, messageHistory: Ze, onDialFileSystemClick: Qe, dialFileSystemLabel: $e, validateAttachment: et, onAttachmentClick: nt, modelPickerOverlay: rt, maximumAttachmentsAmount: at, onAttachmentsLimitExceeded: ot, isAttachmentsEnabled: st = !0, isTextAttachmentsAllowed: ct = !0, usageLimitsSlot: ft, onMessageTooLong: pt }) => {
|
|
1892
|
+
let mt = l(), [ht, gt] = B(!1), q = Ne(Ze), J = Je != null, _t = z(null), [vt, yt] = B(0), bt = R(() => s({
|
|
1893
|
+
"--ci-bg": M?.background,
|
|
1894
|
+
"--ci-text": M?.text,
|
|
1895
|
+
"--ci-border": M?.border,
|
|
1896
|
+
"--ci-border-focus": M?.borderFocus,
|
|
1897
|
+
"--ci-placeholder": M?.placeholder,
|
|
1898
|
+
"--ci-text-disabled": M?.textDisabled,
|
|
1899
|
+
"--ci-model-selector-caret-color": M?.modelSelectorCaret,
|
|
1900
|
+
"--ci-model-selector-hover-bg": M?.modelSelectorHoverBg,
|
|
1901
|
+
"--ci-model-selector-disabled-color": M?.modelSelectorDisabled,
|
|
1902
|
+
"--ci-model-selector-name-color": M?.modelSelectorName,
|
|
1903
|
+
"--ci-model-selector-version-color": M?.modelSelectorVersion,
|
|
1904
|
+
"--ci-voice-error": M?.voiceError,
|
|
1905
|
+
"--ci-voice-waveform": M?.voiceWaveform,
|
|
1906
|
+
"--ci-voice-accent": M?.voiceAccent,
|
|
1907
|
+
"--ci-first-line-indent": J ? `calc(${vt}px + 4px)` : void 0
|
|
1907
1908
|
}), [
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
]),
|
|
1909
|
+
M,
|
|
1910
|
+
J,
|
|
1911
|
+
vt
|
|
1912
|
+
]), xt = R(() => Qe ? [{
|
|
1912
1913
|
key: "dial-fs",
|
|
1913
|
-
label:
|
|
1914
|
+
label: $e ?? "DIAL file system",
|
|
1914
1915
|
icon: /* @__PURE__ */ U(se, {
|
|
1915
1916
|
size: u,
|
|
1916
1917
|
"aria-hidden": !0,
|
|
1917
1918
|
stroke: m
|
|
1918
1919
|
}),
|
|
1919
|
-
onClick:
|
|
1920
|
-
}] : [], [
|
|
1920
|
+
onClick: Qe
|
|
1921
|
+
}] : [], [Qe, $e]), { message: Y, setMessage: X, textareaRef: Z } = Pe({
|
|
1921
1922
|
messageProp: e,
|
|
1922
1923
|
messageRevision: t
|
|
1923
1924
|
});
|
|
1924
1925
|
Ie({
|
|
1925
1926
|
insertion: n,
|
|
1926
|
-
textareaRef:
|
|
1927
|
+
textareaRef: Z
|
|
1927
1928
|
});
|
|
1928
|
-
let { isMenuOpen:
|
|
1929
|
+
let { isMenuOpen: Q, query: St, dismiss: Ct, handleValueChange: wt } = Ae({
|
|
1929
1930
|
config: G,
|
|
1930
|
-
message:
|
|
1931
|
-
}),
|
|
1932
|
-
if (G == null || (
|
|
1933
|
-
|
|
1934
|
-
let t = `${G.triggerPrefix}${
|
|
1935
|
-
if (!
|
|
1936
|
-
let n =
|
|
1937
|
-
|
|
1931
|
+
message: Y
|
|
1932
|
+
}), Tt = G?.emptyQueryHint != null, Et = Tt && Q && St === "", Dt = I((e) => {
|
|
1933
|
+
if (G == null || (Ct(), !e?.consumeQuery)) return;
|
|
1934
|
+
Z.current?.focus();
|
|
1935
|
+
let t = `${G.triggerPrefix}${St}`;
|
|
1936
|
+
if (!Y.startsWith(t)) return;
|
|
1937
|
+
let n = Y.slice(t.length);
|
|
1938
|
+
X(n), q.notifyChange(), d?.(n);
|
|
1938
1939
|
}, [
|
|
1939
1940
|
G,
|
|
1940
|
-
|
|
1941
|
-
|
|
1941
|
+
Ct,
|
|
1942
|
+
St,
|
|
1943
|
+
Y,
|
|
1942
1944
|
X,
|
|
1943
|
-
|
|
1944
|
-
J,
|
|
1945
|
+
q,
|
|
1945
1946
|
d,
|
|
1946
|
-
|
|
1947
|
+
Z
|
|
1947
1948
|
]);
|
|
1948
1949
|
L(() => {
|
|
1949
|
-
let e =
|
|
1950
|
+
let e = _t.current;
|
|
1950
1951
|
if (e == null) return;
|
|
1951
1952
|
let t = new ResizeObserver((e) => {
|
|
1952
1953
|
let t = e[0];
|
|
1953
|
-
t != null &&
|
|
1954
|
+
t != null && yt(t.contentRect.width);
|
|
1954
1955
|
});
|
|
1955
1956
|
return t.observe(e), () => t.disconnect();
|
|
1956
|
-
}, [
|
|
1957
|
-
let { attachments:
|
|
1958
|
-
initialAttachments:
|
|
1957
|
+
}, [J]);
|
|
1958
|
+
let { attachments: Ot, buildAttachments: kt, addAttachments: At, resetAttachments: jt, handleRemove: Mt, handleRetry: Nt, handleExpand: Pt, hasBlockedAttachments: Ft } = Oe({
|
|
1959
|
+
initialAttachments: me,
|
|
1959
1960
|
onUploadAttachment: i,
|
|
1960
1961
|
onAttachmentsChange: f,
|
|
1961
|
-
validateAttachment:
|
|
1962
|
+
validateAttachment: et,
|
|
1962
1963
|
pendingDropFiles: ie,
|
|
1963
1964
|
onDropFilesConsumed: ae,
|
|
1964
|
-
pendingAttachments:
|
|
1965
|
-
onPendingAttachmentsConsumed:
|
|
1965
|
+
pendingAttachments: P,
|
|
1966
|
+
onPendingAttachmentsConsumed: oe,
|
|
1966
1967
|
onExpandPastedText: I((e) => {
|
|
1967
|
-
|
|
1968
|
-
}, [
|
|
1969
|
-
maximumAttachmentsAmount:
|
|
1970
|
-
baseAttachmentsAmount:
|
|
1971
|
-
onAttachmentsLimitExceeded:
|
|
1972
|
-
}),
|
|
1973
|
-
|
|
1974
|
-
}, [
|
|
1975
|
-
|
|
1976
|
-
let [
|
|
1968
|
+
X((t) => t ? `${t}\n${e}` : e);
|
|
1969
|
+
}, [X]),
|
|
1970
|
+
maximumAttachmentsAmount: at,
|
|
1971
|
+
baseAttachmentsAmount: je.length,
|
|
1972
|
+
onAttachmentsLimitExceeded: ot
|
|
1973
|
+
}), It = I((e) => {
|
|
1974
|
+
At(kt([e]));
|
|
1975
|
+
}, [At, kt]), Lt = z(!1), Rt = z(Y);
|
|
1976
|
+
Rt.current = Y;
|
|
1977
|
+
let [zt, Vt] = B({
|
|
1977
1978
|
text: "",
|
|
1978
1979
|
revision: 0
|
|
1979
|
-
}), { state:
|
|
1980
|
-
onAttachAudio:
|
|
1981
|
-
onTranscribeAudio:
|
|
1980
|
+
}), { state: Ht, analyserNodeRef: Ut, errorMessage: Wt, startRecording: Gt, stopRecording: Kt, discardRecording: qt } = Ue({
|
|
1981
|
+
onAttachAudio: It,
|
|
1982
|
+
onTranscribeAudio: Te,
|
|
1982
1983
|
onTranscript: I((e) => {
|
|
1983
1984
|
let t = e.trim();
|
|
1984
1985
|
if (t) {
|
|
1985
|
-
let e =
|
|
1986
|
-
|
|
1986
|
+
let e = Rt.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
1987
|
+
Rt.current = n, X(n), Vt((e) => ({
|
|
1987
1988
|
text: t,
|
|
1988
1989
|
revision: e.revision + 1
|
|
1989
|
-
})),
|
|
1990
|
+
})), q.notifyChange(), d?.(n);
|
|
1990
1991
|
}
|
|
1991
|
-
|
|
1992
|
+
Lt.current = !0;
|
|
1992
1993
|
}, [
|
|
1993
|
-
|
|
1994
|
-
|
|
1994
|
+
X,
|
|
1995
|
+
q,
|
|
1995
1996
|
d
|
|
1996
1997
|
]),
|
|
1997
|
-
errorLabel:
|
|
1998
|
-
}),
|
|
1998
|
+
errorLabel: De
|
|
1999
|
+
}), $ = Ht === Le.Recording || Ht === Le.Processing;
|
|
1999
2000
|
L(() => {
|
|
2000
|
-
|
|
2001
|
-
}, [
|
|
2002
|
-
let
|
|
2003
|
-
if (!
|
|
2001
|
+
(Ht === Le.Error || Ht === Le.Idle && Lt.current) && (Lt.current = !1, Z.current?.focus());
|
|
2002
|
+
}, [Ht, Z]);
|
|
2003
|
+
let Jt = z(null), Yt = z(null), Xt = st && ct, { handlePaste: Zt } = Se(At, Xt ? le : Infinity), Qt = I((e) => {
|
|
2004
|
+
if (!Xt) {
|
|
2004
2005
|
let t = e.clipboardData.getData("text/plain");
|
|
2005
|
-
t.length >=
|
|
2006
|
+
t.length >= F && pt?.(t.length, F);
|
|
2006
2007
|
}
|
|
2007
|
-
|
|
2008
|
+
Zt(e);
|
|
2008
2009
|
}, [
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
]),
|
|
2010
|
+
Xt,
|
|
2011
|
+
F,
|
|
2012
|
+
pt,
|
|
2013
|
+
Zt
|
|
2014
|
+
]), $t = (Y.trim().length > 0 || Ot.length > 0 || J) && !Ft && !xe && !$, [en, tn] = B([]);
|
|
2014
2015
|
L(() => {
|
|
2015
|
-
|
|
2016
|
-
}, [(
|
|
2017
|
-
let
|
|
2018
|
-
let e =
|
|
2019
|
-
return
|
|
2016
|
+
tn([]);
|
|
2017
|
+
}, [(ze ?? []).map((e) => e.id).join("|")]);
|
|
2018
|
+
let nn = R(() => {
|
|
2019
|
+
let e = ze ?? [];
|
|
2020
|
+
return Ve ? e.filter((e) => e.isSelected || !en.includes(e.id)) : e;
|
|
2020
2021
|
}, [
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
]),
|
|
2025
|
-
|
|
2026
|
-
}, [
|
|
2027
|
-
if (
|
|
2028
|
-
if (
|
|
2029
|
-
|
|
2022
|
+
ze,
|
|
2023
|
+
en,
|
|
2024
|
+
Ve
|
|
2025
|
+
]), rn = I((e) => {
|
|
2026
|
+
tn((t) => t.includes(e) ? t : [...t, e]), ze?.find((t) => t.id === e)?.isSelected && Be?.(e);
|
|
2027
|
+
}, [ze, Be]), an = ue === void 0 || de != null, on = Ce && !o, sn = async () => {
|
|
2028
|
+
if (xe || $) return;
|
|
2029
|
+
if (Y.length >= F) {
|
|
2030
|
+
pt?.(Y.length, F);
|
|
2030
2031
|
return;
|
|
2031
2032
|
}
|
|
2032
|
-
let e =
|
|
2033
|
-
|
|
2033
|
+
let e = Y, t = Ot;
|
|
2034
|
+
X(""), q.reset();
|
|
2034
2035
|
try {
|
|
2035
2036
|
await r?.(e, t), t.forEach((e) => {
|
|
2036
2037
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2037
|
-
}),
|
|
2038
|
+
}), jt([]);
|
|
2038
2039
|
} catch {
|
|
2039
|
-
|
|
2040
|
+
X(e), jt(t);
|
|
2040
2041
|
}
|
|
2041
|
-
},
|
|
2042
|
-
if (
|
|
2043
|
-
if (!e.nativeEvent.isComposing && !
|
|
2042
|
+
}, cn = (e) => {
|
|
2043
|
+
if (!$) {
|
|
2044
|
+
if (!e.nativeEvent.isComposing && !V && !o) {
|
|
2044
2045
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2045
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
2046
|
+
let t = e.currentTarget.selectionStart ?? 0, n = q.navigate(e.key === "ArrowUp" ? "up" : "down", Y, t);
|
|
2046
2047
|
if (n !== null) {
|
|
2047
|
-
e.preventDefault(),
|
|
2048
|
+
e.preventDefault(), X(n);
|
|
2048
2049
|
return;
|
|
2049
2050
|
}
|
|
2050
2051
|
}
|
|
2051
|
-
if (e.key === "Backspace" &&
|
|
2052
|
-
e.preventDefault(),
|
|
2052
|
+
if (e.key === "Backspace" && J && Ye != null && e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) {
|
|
2053
|
+
e.preventDefault(), Ye();
|
|
2053
2054
|
return;
|
|
2054
2055
|
}
|
|
2055
2056
|
}
|
|
2056
|
-
e.key === "Enter" && (
|
|
2057
|
+
e.key === "Enter" && (ke === We.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && $t && an && !V && sn());
|
|
2057
2058
|
}
|
|
2058
|
-
},
|
|
2059
|
+
}, ln = (e) => {
|
|
2059
2060
|
let t = Array.from(e.target.files ?? []);
|
|
2060
2061
|
if (t.length === 0) return;
|
|
2061
|
-
let n =
|
|
2062
|
-
e.target.value = "",
|
|
2063
|
-
},
|
|
2064
|
-
className: c(K.textarea,
|
|
2065
|
-
ref:
|
|
2066
|
-
autoFocus:
|
|
2067
|
-
value:
|
|
2062
|
+
let n = kt(t);
|
|
2063
|
+
e.target.value = "", At(n);
|
|
2064
|
+
}, un = /* @__PURE__ */ U("textarea", {
|
|
2065
|
+
className: c(K.textarea, J && K.textareaIndented, N?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
|
|
2066
|
+
ref: Z,
|
|
2067
|
+
autoFocus: Xe,
|
|
2068
|
+
value: Y,
|
|
2068
2069
|
onChange: (e) => {
|
|
2069
|
-
|
|
2070
|
+
X(e.target.value), q.notifyChange();
|
|
2070
2071
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2071
|
-
|
|
2072
|
+
wt(e.target.value, t?.isComposing ?? !1, t?.inputType), d?.(e.target.value);
|
|
2072
2073
|
},
|
|
2073
|
-
onKeyDown:
|
|
2074
|
-
onPaste:
|
|
2075
|
-
placeholder:
|
|
2076
|
-
"aria-label":
|
|
2077
|
-
disabled:
|
|
2078
|
-
readOnly:
|
|
2074
|
+
onKeyDown: cn,
|
|
2075
|
+
onPaste: Qt,
|
|
2076
|
+
placeholder: J ? void 0 : g,
|
|
2077
|
+
"aria-label": y,
|
|
2078
|
+
disabled: V,
|
|
2079
|
+
readOnly: $,
|
|
2079
2080
|
rows: 1
|
|
2080
|
-
}),
|
|
2081
|
+
}), dn = G == null ? un : /* @__PURE__ */ U(h, {
|
|
2081
2082
|
className: "w-full",
|
|
2082
|
-
open:
|
|
2083
|
+
open: Q,
|
|
2083
2084
|
onOpenChange: (e) => {
|
|
2084
|
-
e ||
|
|
2085
|
+
e || Ct();
|
|
2085
2086
|
},
|
|
2086
2087
|
placement: "top-start",
|
|
2087
2088
|
trigger: [],
|
|
2088
2089
|
initialFocus: -1,
|
|
2089
2090
|
matchReferenceWidth: !1,
|
|
2090
|
-
outsidePressIgnoreRef:
|
|
2091
|
+
outsidePressIgnoreRef: Z,
|
|
2091
2092
|
renderOverlay: () => {
|
|
2092
2093
|
let e = G.renderMenu({
|
|
2093
|
-
query:
|
|
2094
|
-
close:
|
|
2094
|
+
query: St,
|
|
2095
|
+
close: Dt
|
|
2095
2096
|
});
|
|
2096
2097
|
return G.menuLabel == null ? e : /* @__PURE__ */ U("div", {
|
|
2097
2098
|
role: "group",
|
|
@@ -2099,149 +2100,154 @@ var Pt = {
|
|
|
2099
2100
|
children: e
|
|
2100
2101
|
});
|
|
2101
2102
|
},
|
|
2102
|
-
children:
|
|
2103
|
-
}),
|
|
2103
|
+
children: un
|
|
2104
|
+
}), fn = J || Tt ? /* @__PURE__ */ W("div", {
|
|
2104
2105
|
className: "relative w-full",
|
|
2105
2106
|
children: [
|
|
2106
|
-
|
|
2107
|
-
ref:
|
|
2107
|
+
J && /* @__PURE__ */ U("div", {
|
|
2108
|
+
ref: _t,
|
|
2108
2109
|
className: "absolute start-0 top-0",
|
|
2109
|
-
children:
|
|
2110
|
+
children: Je
|
|
2110
2111
|
}),
|
|
2111
|
-
|
|
2112
|
-
className: c(K.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0",
|
|
2112
|
+
Et && G != null && /* @__PURE__ */ W("span", {
|
|
2113
|
+
className: c(K.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", N?.fontClassName || "dial-body-paragraph-text"),
|
|
2113
2114
|
"aria-hidden": !0,
|
|
2114
2115
|
children: [/* @__PURE__ */ U("span", {
|
|
2115
2116
|
className: "invisible",
|
|
2116
2117
|
children: G.triggerPrefix
|
|
2117
2118
|
}), G.emptyQueryHint]
|
|
2118
2119
|
}),
|
|
2119
|
-
|
|
2120
|
+
dn
|
|
2120
2121
|
]
|
|
2121
|
-
}) :
|
|
2122
|
-
onAttachClick:
|
|
2123
|
-
attachLabel:
|
|
2124
|
-
addMenuTitle:
|
|
2125
|
-
menuTitle:
|
|
2126
|
-
menuCloseLabel:
|
|
2127
|
-
style:
|
|
2128
|
-
isDisabled:
|
|
2129
|
-
chatSettings:
|
|
2130
|
-
extraMenuItems:
|
|
2131
|
-
onRecordVoice:
|
|
2132
|
-
recordVoiceLabel:
|
|
2133
|
-
toolsMenuItems:
|
|
2134
|
-
onToolToggle:
|
|
2135
|
-
toolsMenuTitle:
|
|
2136
|
-
toolsBackLabel:
|
|
2137
|
-
menuOverlays:
|
|
2122
|
+
}) : dn, pn = he ? void 0 : /* @__PURE__ */ U(tt, {
|
|
2123
|
+
onAttachClick: ge ? void 0 : () => Jt.current?.click(),
|
|
2124
|
+
attachLabel: b,
|
|
2125
|
+
addMenuTitle: S,
|
|
2126
|
+
menuTitle: C,
|
|
2127
|
+
menuCloseLabel: w,
|
|
2128
|
+
style: bt,
|
|
2129
|
+
isDisabled: V || $,
|
|
2130
|
+
chatSettings: Fe,
|
|
2131
|
+
extraMenuItems: xt,
|
|
2132
|
+
onRecordVoice: we && st && !o && !$ ? () => Gt(Re.Attachment) : void 0,
|
|
2133
|
+
recordVoiceLabel: te,
|
|
2134
|
+
toolsMenuItems: Ve ? ze : void 0,
|
|
2135
|
+
onToolToggle: Be,
|
|
2136
|
+
toolsMenuTitle: He,
|
|
2137
|
+
toolsBackLabel: Ge,
|
|
2138
|
+
menuOverlays: qe
|
|
2138
2139
|
});
|
|
2139
2140
|
return /* @__PURE__ */ W("div", {
|
|
2140
|
-
ref:
|
|
2141
|
-
style:
|
|
2142
|
-
className: c(K.wrapper,
|
|
2141
|
+
ref: Yt,
|
|
2142
|
+
style: bt,
|
|
2143
|
+
className: c(K.wrapper, V && K.wrapperDisabled, V && "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", Ot.length > 6 ? "py-4 ps-4" : "p-4", re),
|
|
2143
2144
|
children: [
|
|
2144
|
-
(
|
|
2145
|
-
attachments: [...
|
|
2145
|
+
(je.length > 0 || Ot.length > 0) && /* @__PURE__ */ U(ye, {
|
|
2146
|
+
attachments: [...je, ...Ot],
|
|
2146
2147
|
onRemove: (e) => {
|
|
2147
|
-
|
|
2148
|
+
je.some((t) => t.id === e) ? Me?.(e) : Mt(e);
|
|
2148
2149
|
},
|
|
2149
|
-
onRetry:
|
|
2150
|
-
onExpand:
|
|
2150
|
+
onRetry: Nt,
|
|
2151
|
+
onExpand: Pt,
|
|
2151
2152
|
labels: {
|
|
2152
|
-
removeLabel:
|
|
2153
|
-
retryLabel:
|
|
2154
|
-
uploadingLabel:
|
|
2153
|
+
removeLabel: T,
|
|
2154
|
+
retryLabel: E,
|
|
2155
|
+
uploadingLabel: D
|
|
2155
2156
|
},
|
|
2156
|
-
onAttachmentClick:
|
|
2157
|
-
let t = [...
|
|
2158
|
-
t != null &&
|
|
2157
|
+
onAttachmentClick: nt == null ? void 0 : (e) => {
|
|
2158
|
+
let t = [...je, ...Ot].find((t) => t.id === e);
|
|
2159
|
+
t != null && nt(t);
|
|
2159
2160
|
}
|
|
2160
2161
|
}),
|
|
2161
|
-
!
|
|
2162
|
-
ref:
|
|
2162
|
+
!he && /* @__PURE__ */ U("input", {
|
|
2163
|
+
ref: Jt,
|
|
2163
2164
|
type: "file",
|
|
2164
2165
|
multiple: !0,
|
|
2165
|
-
accept:
|
|
2166
|
+
accept: x,
|
|
2166
2167
|
className: "sr-only",
|
|
2167
2168
|
"aria-hidden": !0,
|
|
2168
2169
|
tabIndex: -1,
|
|
2169
|
-
onChange:
|
|
2170
|
+
onChange: ln
|
|
2171
|
+
}),
|
|
2172
|
+
Wt && /* @__PURE__ */ U(_, {
|
|
2173
|
+
text: Wt,
|
|
2174
|
+
className: "min-w-0 break-words px-1"
|
|
2170
2175
|
}),
|
|
2171
|
-
|
|
2176
|
+
$ && /* @__PURE__ */ U(lt, {
|
|
2172
2177
|
embedded: !0,
|
|
2173
|
-
state:
|
|
2174
|
-
analyserNodeRef:
|
|
2175
|
-
errorMessage:
|
|
2176
|
-
onStop:
|
|
2177
|
-
onDiscard:
|
|
2178
|
-
attachButton:
|
|
2179
|
-
stopLabel:
|
|
2180
|
-
discardLabel:
|
|
2181
|
-
processingLabel:
|
|
2178
|
+
state: Ht,
|
|
2179
|
+
analyserNodeRef: Ut,
|
|
2180
|
+
errorMessage: Wt,
|
|
2181
|
+
onStop: Kt,
|
|
2182
|
+
onDiscard: qt,
|
|
2183
|
+
attachButton: pn,
|
|
2184
|
+
stopLabel: j,
|
|
2185
|
+
discardLabel: ne,
|
|
2186
|
+
processingLabel: Ee
|
|
2182
2187
|
}),
|
|
2183
|
-
|
|
2184
|
-
|
|
2188
|
+
!$ && _e && fn,
|
|
2189
|
+
!$ && !_e && /* @__PURE__ */ W("div", {
|
|
2185
2190
|
className: "flex flex-wrap items-center gap-2",
|
|
2186
2191
|
children: [
|
|
2187
2192
|
/* @__PURE__ */ U("div", {
|
|
2188
2193
|
className: "flex w-full min-w-0 items-center self-stretch",
|
|
2189
|
-
children:
|
|
2194
|
+
children: fn
|
|
2190
2195
|
}),
|
|
2191
|
-
|
|
2196
|
+
pn && /* @__PURE__ */ U("div", {
|
|
2192
2197
|
className: "flex",
|
|
2193
|
-
children:
|
|
2198
|
+
children: pn
|
|
2194
2199
|
}),
|
|
2195
|
-
|
|
2200
|
+
nn.length > 0 && Be != null && /* @__PURE__ */ U("div", {
|
|
2196
2201
|
className: "min-w-0 flex-1",
|
|
2197
2202
|
children: /* @__PURE__ */ U(it, {
|
|
2198
|
-
items:
|
|
2199
|
-
onToolToggle:
|
|
2200
|
-
onToolDismiss:
|
|
2201
|
-
canRemove:
|
|
2202
|
-
removeLabel:
|
|
2203
|
+
items: nn,
|
|
2204
|
+
onToolToggle: Be,
|
|
2205
|
+
onToolDismiss: rn,
|
|
2206
|
+
canRemove: Ve,
|
|
2207
|
+
removeLabel: Ke?.removeLabel
|
|
2203
2208
|
})
|
|
2204
2209
|
}),
|
|
2205
2210
|
/* @__PURE__ */ U("div", {
|
|
2206
2211
|
className: "ms-auto flex flex-shrink-0 items-center gap-2",
|
|
2207
|
-
children:
|
|
2208
|
-
canSend:
|
|
2209
|
-
onSend:
|
|
2212
|
+
children: ve ? ve({
|
|
2213
|
+
canSend: $t,
|
|
2214
|
+
onSend: sn
|
|
2210
2215
|
}) : /* @__PURE__ */ W(H, { children: [
|
|
2211
|
-
|
|
2212
|
-
/* @__PURE__ */ U(
|
|
2213
|
-
deployments:
|
|
2214
|
-
selectedDeploymentId:
|
|
2215
|
-
onDeploymentChange:
|
|
2216
|
-
modelSelectorLabels:
|
|
2216
|
+
ft,
|
|
2217
|
+
/* @__PURE__ */ U(Bt, {
|
|
2218
|
+
deployments: ue,
|
|
2219
|
+
selectedDeploymentId: de,
|
|
2220
|
+
onDeploymentChange: fe,
|
|
2221
|
+
modelSelectorLabels: pe,
|
|
2217
2222
|
isStreaming: o,
|
|
2218
|
-
isMobile:
|
|
2219
|
-
isDisabled:
|
|
2220
|
-
style:
|
|
2221
|
-
modelPickerOverlay:
|
|
2222
|
-
isPickerOpen:
|
|
2223
|
-
onPickerToggle: () =>
|
|
2224
|
-
onPickerOpenChange:
|
|
2223
|
+
isMobile: mt,
|
|
2224
|
+
isDisabled: be,
|
|
2225
|
+
style: bt,
|
|
2226
|
+
modelPickerOverlay: rt,
|
|
2227
|
+
isPickerOpen: ht,
|
|
2228
|
+
onPickerToggle: () => gt((e) => !e),
|
|
2229
|
+
onPickerOpenChange: gt
|
|
2225
2230
|
}),
|
|
2226
|
-
|
|
2231
|
+
on && /* @__PURE__ */ U(v, {
|
|
2227
2232
|
icon: /* @__PURE__ */ U(ce, {
|
|
2228
2233
|
size: p.LG,
|
|
2229
2234
|
stroke: m,
|
|
2230
2235
|
"aria-hidden": !0
|
|
2231
2236
|
}),
|
|
2232
|
-
"aria-label":
|
|
2233
|
-
tooltipProps: { tooltip:
|
|
2237
|
+
"aria-label": A,
|
|
2238
|
+
tooltipProps: { tooltip: A },
|
|
2234
2239
|
className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
|
|
2235
|
-
onClick: () =>
|
|
2236
|
-
disabled:
|
|
2240
|
+
onClick: () => Gt(Re.Dictation),
|
|
2241
|
+
disabled: V || o
|
|
2237
2242
|
}),
|
|
2238
|
-
o && a ? /* @__PURE__ */ U(
|
|
2243
|
+
o && a ? /* @__PURE__ */ U(dt, {
|
|
2239
2244
|
onStop: a,
|
|
2240
|
-
ariaLabel:
|
|
2241
|
-
}) : !o && /* @__PURE__ */ U(
|
|
2242
|
-
onSend:
|
|
2243
|
-
isDisabled: !
|
|
2244
|
-
ariaLabel:
|
|
2245
|
+
ariaLabel: ee
|
|
2246
|
+
}) : !o && /* @__PURE__ */ U(ut, {
|
|
2247
|
+
onSend: sn,
|
|
2248
|
+
isDisabled: !an || !$t,
|
|
2249
|
+
ariaLabel: O,
|
|
2250
|
+
sendTooltip: k
|
|
2245
2251
|
})
|
|
2246
2252
|
] })
|
|
2247
2253
|
})
|
|
@@ -2252,14 +2258,14 @@ var Pt = {
|
|
|
2252
2258
|
role: "status",
|
|
2253
2259
|
"aria-live": "polite",
|
|
2254
2260
|
"aria-atomic": "true",
|
|
2255
|
-
children: /* @__PURE__ */ U("span", { children:
|
|
2261
|
+
children: /* @__PURE__ */ U("span", { children: zt.text }, zt.revision)
|
|
2256
2262
|
})
|
|
2257
2263
|
]
|
|
2258
2264
|
});
|
|
2259
|
-
},
|
|
2265
|
+
}, Ht = {
|
|
2260
2266
|
welcome: "_welcome_1icyo_1",
|
|
2261
2267
|
description: "_description_1icyo_5"
|
|
2262
|
-
},
|
|
2268
|
+
}, Ut = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: l = !1, ...u }) => {
|
|
2263
2269
|
let { colors: d, typography: f } = i ?? {};
|
|
2264
2270
|
return /* @__PURE__ */ W("div", {
|
|
2265
2271
|
style: s({
|
|
@@ -2270,15 +2276,15 @@ var Pt = {
|
|
|
2270
2276
|
children: [n && /* @__PURE__ */ W("div", {
|
|
2271
2277
|
className: "flex flex-col items-center gap-4 text-center",
|
|
2272
2278
|
children: [/* @__PURE__ */ U("h1", {
|
|
2273
|
-
className: c(
|
|
2279
|
+
className: c(Ht.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
|
|
2274
2280
|
children: n
|
|
2275
2281
|
}), r && /* @__PURE__ */ U("p", {
|
|
2276
|
-
className: c(
|
|
2282
|
+
className: c(Ht.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
|
|
2277
2283
|
children: r
|
|
2278
2284
|
})]
|
|
2279
2285
|
}), /* @__PURE__ */ U("div", {
|
|
2280
2286
|
className: c("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
2281
|
-
children: /* @__PURE__ */ U(
|
|
2287
|
+
children: /* @__PURE__ */ U(Vt, {
|
|
2282
2288
|
placeholder: t,
|
|
2283
2289
|
isStreaming: e,
|
|
2284
2290
|
isInputDisabled: l,
|
|
@@ -2289,27 +2295,27 @@ var Pt = {
|
|
|
2289
2295
|
})
|
|
2290
2296
|
})]
|
|
2291
2297
|
});
|
|
2292
|
-
},
|
|
2293
|
-
let
|
|
2298
|
+
}, Wt = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel: ne, pendingAttachments: M, onPendingAttachmentsConsumed: N, onAttachmentClick: re, pasteTextThreshold: ie, maxMessageLength: ae = 5e4, onMessageTooLong: P }) => {
|
|
2299
|
+
let oe = z(null), [ce, le] = B([]);
|
|
2294
2300
|
L(() => {
|
|
2295
2301
|
C?.length && (le(C), T?.());
|
|
2296
2302
|
}, [C, T]);
|
|
2297
|
-
let [F, ue] =
|
|
2303
|
+
let [F, ue] = B(e ?? ""), [de, fe] = B([]), [pe, me] = B(r), he = de.some((e) => e.status === i.Loading || e.status === i.Error), ge = (F.trim().length > 0 || de.length > 0 || pe.length > 0) && !he, _e = (e) => {
|
|
2298
2304
|
me((t) => t.filter((t) => t.id !== e));
|
|
2299
|
-
},
|
|
2305
|
+
}, ve = I((e, t) => {
|
|
2300
2306
|
o(e, pe, t);
|
|
2301
|
-
}, [pe, o]),
|
|
2307
|
+
}, [pe, o]), V = () => {
|
|
2302
2308
|
if (ge) {
|
|
2303
|
-
if (F.length >=
|
|
2304
|
-
|
|
2309
|
+
if (F.length >= ae) {
|
|
2310
|
+
P?.(F.length, ae);
|
|
2305
2311
|
return;
|
|
2306
2312
|
}
|
|
2307
|
-
|
|
2313
|
+
ve(F, de);
|
|
2308
2314
|
}
|
|
2309
2315
|
}, ye = I(() => le([]), []), be = I((e) => {
|
|
2310
2316
|
let t = Array.from(e.target.files ?? []);
|
|
2311
2317
|
t.length !== 0 && (e.target.value = "", le(t));
|
|
2312
|
-
}, []), xe =
|
|
2318
|
+
}, []), xe = R(() => j ? [{
|
|
2313
2319
|
key: "dial-fs",
|
|
2314
2320
|
label: ne ?? "DIAL file system",
|
|
2315
2321
|
icon: /* @__PURE__ */ U(se, {
|
|
@@ -2321,7 +2327,7 @@ var Pt = {
|
|
|
2321
2327
|
}] : [], [j, ne]);
|
|
2322
2328
|
return /* @__PURE__ */ W("div", {
|
|
2323
2329
|
className: c("flex w-full flex-col gap-2", S),
|
|
2324
|
-
children: [/* @__PURE__ */ U(
|
|
2330
|
+
children: [/* @__PURE__ */ U(Vt, {
|
|
2325
2331
|
message: e,
|
|
2326
2332
|
inlineStartSlot: t,
|
|
2327
2333
|
onInlineStartRemove: n,
|
|
@@ -2329,7 +2335,7 @@ var Pt = {
|
|
|
2329
2335
|
hideActionBar: !0,
|
|
2330
2336
|
pendingDropFiles: ce,
|
|
2331
2337
|
onDropFilesConsumed: ye,
|
|
2332
|
-
onSend:
|
|
2338
|
+
onSend: ve,
|
|
2333
2339
|
onUploadAttachment: s,
|
|
2334
2340
|
onChange: ue,
|
|
2335
2341
|
onAttachmentsChange: fe,
|
|
@@ -2338,24 +2344,24 @@ var Pt = {
|
|
|
2338
2344
|
uploadingLabel: g,
|
|
2339
2345
|
className: "max-w-full",
|
|
2340
2346
|
prefixAttachments: pe,
|
|
2341
|
-
onRemovePrefixAttachment:
|
|
2347
|
+
onRemovePrefixAttachment: _e,
|
|
2342
2348
|
validateAttachment: E,
|
|
2343
2349
|
isAttachmentsEnabled: D,
|
|
2344
2350
|
isTextAttachmentsAllowed: O,
|
|
2345
2351
|
maximumAttachmentsAmount: A,
|
|
2346
2352
|
onAttachmentsLimitExceeded: te,
|
|
2347
|
-
pendingAttachments:
|
|
2348
|
-
onPendingAttachmentsConsumed:
|
|
2349
|
-
onAttachmentClick:
|
|
2350
|
-
pasteTextThreshold:
|
|
2351
|
-
maxMessageLength:
|
|
2352
|
-
onMessageTooLong:
|
|
2353
|
+
pendingAttachments: M,
|
|
2354
|
+
onPendingAttachmentsConsumed: N,
|
|
2355
|
+
onAttachmentClick: re,
|
|
2356
|
+
pasteTextThreshold: ie,
|
|
2357
|
+
maxMessageLength: ae,
|
|
2358
|
+
onMessageTooLong: P
|
|
2353
2359
|
}), /* @__PURE__ */ W("div", {
|
|
2354
2360
|
className: "flex items-center justify-between",
|
|
2355
2361
|
children: [/* @__PURE__ */ U("div", {
|
|
2356
2362
|
className: "flex",
|
|
2357
2363
|
children: !k && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
|
|
2358
|
-
ref:
|
|
2364
|
+
ref: oe,
|
|
2359
2365
|
type: "file",
|
|
2360
2366
|
multiple: !0,
|
|
2361
2367
|
accept: ee,
|
|
@@ -2364,7 +2370,7 @@ var Pt = {
|
|
|
2364
2370
|
tabIndex: -1,
|
|
2365
2371
|
onChange: be
|
|
2366
2372
|
}), /* @__PURE__ */ U(tt, {
|
|
2367
|
-
onAttachClick: () =>
|
|
2373
|
+
onAttachClick: () => oe.current?.click(),
|
|
2368
2374
|
attachLabel: v,
|
|
2369
2375
|
addMenuTitle: _,
|
|
2370
2376
|
menuTitle: y,
|
|
@@ -2378,7 +2384,7 @@ var Pt = {
|
|
|
2378
2384
|
onClick: a
|
|
2379
2385
|
}), /* @__PURE__ */ U(w, {
|
|
2380
2386
|
label: d,
|
|
2381
|
-
onClick:
|
|
2387
|
+
onClick: V,
|
|
2382
2388
|
disabled: !ge
|
|
2383
2389
|
})]
|
|
2384
2390
|
})]
|
|
@@ -2386,4 +2392,4 @@ var Pt = {
|
|
|
2386
2392
|
});
|
|
2387
2393
|
};
|
|
2388
2394
|
//#endregion
|
|
2389
|
-
export { Ee as BottomSheetShell, Ze as ChatSettingsModal,
|
|
2395
|
+
export { Ee as BottomSheetShell, Ze as ChatSettingsModal, Ut as ConversationInput, Wt as EditMessageInput, Vt as Input, We as SendOnEnter };
|