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