@epam/ai-dial-conversation-input 1.4.0-dev.12 → 1.4.0-dev.122
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/components/Input/InputCommandMenuArea.d.ts.map +1 -1
- package/components/Input/ModelSelectorControl.d.ts.map +1 -1
- package/components/ToolsChips/ToolsChips.d.ts.map +1 -1
- package/hooks/useAttachments.d.ts.map +1 -1
- package/hooks/useModelSelector.d.ts +2 -0
- package/hooks/useModelSelector.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +1048 -1040
- package/models/ConversationInput.d.ts +6 -0
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +6 -0
- package/models/Input.d.ts.map +1 -1
- package/package.json +7 -3
- package/utils/file-type.d.ts +2 -0
- package/utils/file-type.d.ts.map +1 -0
package/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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,
|
|
2
|
-
import { BASE_ICON_SIZE as
|
|
3
|
-
import { Fragment as
|
|
4
|
-
import { AttachmentTray as
|
|
5
|
-
import { IconArrowNarrowRight as
|
|
6
|
-
import { Fragment as
|
|
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, getBaseMimeType as l, inferMimeTypeFromPath as u, mergeClasses as d, normalizeMimeType as f, useIsMobile as p, useIsPhone as m } from "@epam/ai-dial-chat-shared";
|
|
2
|
+
import { BASE_ICON_SIZE as h, BottomSheet as g, Button as _, ButtonVariant as v, CloseButton as y, DIAL_ICON_SIZE as b, DIAL_KIT_ICON_STROKE as x, Dropdown as S, DropdownOverlayRole as C, ElementSize as w, ErrorText as T, GhostIconButton as E, Highlight as D, LiveRegion as O, LiveRegionElement as k, LiveRegionPoliteness as A, MenuItem as j, MenuItemMark as M, NeutralButton as N, NeutralIconButton as P, Notification as ee, NotificationType as F, NotificationVariant as I, Popup as te, PopupSize as L, PrimaryButton as R, PrimaryIconButton as z, RadioGroup as B, RadioGroupOrientation as ne, Search as re, Skeleton as ie, SkeletonVariant as ae, Slider as oe, Spinner as se, Textarea as ce, TextareaResize as le, ToggleChip as ue, Tooltip as de } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
4
|
+
import { AttachmentTray as fe, MAX_UPLOADS_PER_MINUTE as pe, generateAttachmentId as me, useClipboardPaste as he } from "@epam/ai-dial-attachment-input";
|
|
5
|
+
import { IconArrowNarrowRight as ge, IconCheck as _e, IconChevronDown as ve, IconChevronRight as ye, IconFile as be, IconMicrophone as xe, IconPaperclip as Se, IconPlayerStop as Ce, IconPlus as we, IconSettings as Te, IconTool as Ee, IconX as De } from "@tabler/icons-react";
|
|
6
|
+
import { Fragment as Oe, createElement as ke, forwardRef as Ae, memo as je, useCallback as W, useEffect as G, useId as Me, useImperativeHandle as Ne, useLayoutEffect as Pe, useMemo as K, useRef as q, useState as J, useSyncExternalStore as Fe } from "react";
|
|
7
7
|
//#region src/constants/public-class-names.ts
|
|
8
|
-
var
|
|
8
|
+
var Y = {
|
|
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 J = {
|
|
|
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
|
+
}, Ie = {
|
|
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
|
+
}, Le = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: s, titleClassName: l = "dial-body-semi-text", className: u, colors: f, portalId: p, overlayClassName: m, overlayStyle: h, 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__ */ H(g, {
|
|
36
36
|
open: e,
|
|
37
37
|
onClose: r,
|
|
38
38
|
title: t,
|
|
@@ -46,56 +46,66 @@ var J = {
|
|
|
46
46
|
},
|
|
47
47
|
overlayStyle: {
|
|
48
48
|
...v,
|
|
49
|
-
...
|
|
49
|
+
...h
|
|
50
50
|
},
|
|
51
|
-
className:
|
|
52
|
-
overlayClassName:
|
|
51
|
+
className: d(Ie.sheet, u),
|
|
52
|
+
overlayClassName: d(Ie.backdrop, m),
|
|
53
53
|
portalId: p,
|
|
54
|
-
headerClassName:
|
|
55
|
-
titleClassName:
|
|
54
|
+
headerClassName: Ie.divider,
|
|
55
|
+
titleClassName: d(Ie.title, l),
|
|
56
56
|
children: _
|
|
57
57
|
});
|
|
58
|
-
},
|
|
58
|
+
}, Re = 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
|
|
64
|
-
|
|
62
|
+
}, ze = "application/octet-stream", Be = (e) => {
|
|
63
|
+
let t = l(e);
|
|
64
|
+
return t === "" || t === ze;
|
|
65
|
+
}, Ve = (e) => {
|
|
66
|
+
if (!Be(e.type)) return e;
|
|
67
|
+
let t = u(e.name);
|
|
68
|
+
return t == null ? e : new File([e], e.name, {
|
|
69
|
+
type: t,
|
|
70
|
+
lastModified: e.lastModified
|
|
71
|
+
});
|
|
72
|
+
}, He = ({ 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 }) => {
|
|
73
|
+
let [g, _] = J(n), v = q(g);
|
|
74
|
+
G(() => {
|
|
65
75
|
v.current = g;
|
|
66
|
-
}, [g]),
|
|
76
|
+
}, [g]), G(() => () => {
|
|
67
77
|
v.current.forEach((e) => {
|
|
68
78
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
69
79
|
});
|
|
70
80
|
}, []);
|
|
71
|
-
let y =
|
|
72
|
-
let n = e.type.startsWith("image/"),
|
|
73
|
-
return
|
|
74
|
-
id:
|
|
75
|
-
name:
|
|
76
|
-
contentType:
|
|
77
|
-
file:
|
|
78
|
-
type:
|
|
81
|
+
let y = W((e) => e.map((e) => {
|
|
82
|
+
let n = Ve(e), r = n.type.startsWith("image/"), i = n.type.startsWith("audio/"), o = r ? URL.createObjectURL(n) : void 0, s = i ? URL.createObjectURL(n) : void 0, c = t.File;
|
|
83
|
+
return r ? c = t.Image : i && (c = t.Audio), {
|
|
84
|
+
id: me(),
|
|
85
|
+
name: n.name,
|
|
86
|
+
contentType: n.type,
|
|
87
|
+
file: n,
|
|
88
|
+
type: c,
|
|
79
89
|
status: a.Idle,
|
|
80
|
-
previewUrl:
|
|
81
|
-
playUrl:
|
|
90
|
+
previewUrl: o,
|
|
91
|
+
playUrl: s
|
|
82
92
|
};
|
|
83
|
-
}), []), b =
|
|
84
|
-
|
|
93
|
+
}), []), b = q(i);
|
|
94
|
+
G(() => {
|
|
85
95
|
b.current = i;
|
|
86
96
|
}, [i]);
|
|
87
|
-
let x =
|
|
97
|
+
let x = q(!0), S = W((e) => {
|
|
88
98
|
_((t) => {
|
|
89
99
|
let n = e(t);
|
|
90
100
|
return n === t ? t : n;
|
|
91
101
|
});
|
|
92
102
|
}, []);
|
|
93
|
-
|
|
103
|
+
G(() => {
|
|
94
104
|
x.current ? x.current = !1 : b.current?.(g);
|
|
95
105
|
}, [g]);
|
|
96
|
-
let C =
|
|
106
|
+
let C = W((e) => {
|
|
97
107
|
_(e);
|
|
98
|
-
}, []), w =
|
|
108
|
+
}, []), w = W(async (t) => {
|
|
99
109
|
if (r) {
|
|
100
110
|
S((e) => e.map((e) => e.id === t.id ? {
|
|
101
111
|
...e,
|
|
@@ -118,7 +128,7 @@ var J = {
|
|
|
118
128
|
} : e));
|
|
119
129
|
}
|
|
120
130
|
}
|
|
121
|
-
}, [r, S]), T =
|
|
131
|
+
}, [r, S]), T = W((e, t = !0) => {
|
|
122
132
|
let n = new Set(v.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
|
|
123
133
|
if (r.length !== 0) {
|
|
124
134
|
if (p != null && p > 0 && Number.isFinite(p)) {
|
|
@@ -139,7 +149,7 @@ var J = {
|
|
|
139
149
|
status: a.Error,
|
|
140
150
|
errorReason: n
|
|
141
151
|
} : e));
|
|
142
|
-
}),
|
|
152
|
+
}), Re(e, pe, w);
|
|
143
153
|
}
|
|
144
154
|
}
|
|
145
155
|
}, [
|
|
@@ -149,8 +159,8 @@ var J = {
|
|
|
149
159
|
S,
|
|
150
160
|
w,
|
|
151
161
|
o
|
|
152
|
-
]), E =
|
|
153
|
-
|
|
162
|
+
]), E = q(/* @__PURE__ */ new WeakSet());
|
|
163
|
+
G(() => {
|
|
154
164
|
if (s.length === 0) {
|
|
155
165
|
E.current = /* @__PURE__ */ new WeakSet();
|
|
156
166
|
return;
|
|
@@ -163,13 +173,13 @@ var J = {
|
|
|
163
173
|
l,
|
|
164
174
|
c,
|
|
165
175
|
s
|
|
166
|
-
]),
|
|
176
|
+
]), G(() => {
|
|
167
177
|
u.length !== 0 && (T(u, !1), d?.());
|
|
168
178
|
}, [
|
|
169
179
|
T,
|
|
170
180
|
d,
|
|
171
181
|
u
|
|
172
|
-
]),
|
|
182
|
+
]), G(() => {
|
|
173
183
|
if (!o) return;
|
|
174
184
|
let t = !1, n = [], r = v.current.map((r) => {
|
|
175
185
|
if (r.status === a.Loading) return r;
|
|
@@ -196,7 +206,7 @@ var J = {
|
|
|
196
206
|
S,
|
|
197
207
|
w
|
|
198
208
|
]);
|
|
199
|
-
let D =
|
|
209
|
+
let D = W((e) => {
|
|
200
210
|
S((t) => {
|
|
201
211
|
let n = t.find((t) => t.id === e);
|
|
202
212
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -208,11 +218,11 @@ var J = {
|
|
|
208
218
|
addAttachments: T,
|
|
209
219
|
resetAttachments: C,
|
|
210
220
|
handleRemove: D,
|
|
211
|
-
handleRetry:
|
|
221
|
+
handleRetry: W((e) => {
|
|
212
222
|
let t = g.find((t) => t.id === e);
|
|
213
223
|
t && w(t);
|
|
214
224
|
}, [g, w]),
|
|
215
|
-
handleExpand:
|
|
225
|
+
handleExpand: W(async (e) => {
|
|
216
226
|
let n = g.find((t) => t.id === e);
|
|
217
227
|
if (!n || n.type !== t.Pasted) return;
|
|
218
228
|
let r = await n.file.text();
|
|
@@ -224,18 +234,18 @@ var J = {
|
|
|
224
234
|
]),
|
|
225
235
|
hasBlockedAttachments: g.some((e) => e.status === a.Loading || e.status === a.Error)
|
|
226
236
|
};
|
|
227
|
-
},
|
|
228
|
-
let t =
|
|
237
|
+
}, Ue = (e, t) => !e.slice(0, t).includes("\n"), We = (e, t) => !e.slice(t).includes("\n"), Ge = (e) => {
|
|
238
|
+
let t = q(e);
|
|
229
239
|
t.current = e;
|
|
230
|
-
let n =
|
|
240
|
+
let n = q(-1), r = q(""), i = W((e, i, a) => {
|
|
231
241
|
let o = t.current;
|
|
232
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
233
|
-
}, []), a =
|
|
242
|
+
return !o || o.length === 0 ? null : e === "up" ? !Ue(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 || !We(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
243
|
+
}, []), a = W(() => {
|
|
234
244
|
n.current = -1, r.current = "";
|
|
235
|
-
}, []), o =
|
|
245
|
+
}, []), o = W(() => {
|
|
236
246
|
n.current = -1, r.current = "";
|
|
237
247
|
}, []);
|
|
238
|
-
return
|
|
248
|
+
return K(() => ({
|
|
239
249
|
navigate: i,
|
|
240
250
|
notifyChange: a,
|
|
241
251
|
reset: o
|
|
@@ -244,29 +254,29 @@ var J = {
|
|
|
244
254
|
a,
|
|
245
255
|
o
|
|
246
256
|
]);
|
|
247
|
-
},
|
|
248
|
-
let [n, r] =
|
|
249
|
-
return
|
|
257
|
+
}, Ke = ({ messageProp: e, messageRevision: t }) => {
|
|
258
|
+
let [n, r] = J(e), i = q(null);
|
|
259
|
+
return G(() => {
|
|
250
260
|
r(e);
|
|
251
261
|
}, [e, t]), {
|
|
252
262
|
message: n,
|
|
253
263
|
setMessage: r,
|
|
254
264
|
textareaRef: i
|
|
255
265
|
};
|
|
256
|
-
},
|
|
266
|
+
}, qe = (e, t, n, r = n) => {
|
|
257
267
|
let i = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
258
268
|
i ? i.call(e, t) : e.value = t, e.setSelectionRange(n, r), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
259
|
-
},
|
|
260
|
-
let n = e?.revision, r =
|
|
269
|
+
}, Je = (e) => e.key.toLowerCase() === "z" && (e.ctrlKey || e.metaKey) && !e.shiftKey && !e.altKey, Ye = ({ insertion: e, textareaRef: t }) => {
|
|
270
|
+
let n = e?.revision, r = q(e?.text);
|
|
261
271
|
r.current = e?.text;
|
|
262
|
-
let i =
|
|
263
|
-
return
|
|
272
|
+
let i = q(n), a = q(null), o = q(!1);
|
|
273
|
+
return G(() => {
|
|
264
274
|
document.activeElement === t.current && (o.current = !0);
|
|
265
275
|
let e = (e) => {
|
|
266
276
|
e.target === t.current && (o.current = !0);
|
|
267
277
|
};
|
|
268
278
|
return document.addEventListener("focusin", e), () => document.removeEventListener("focusin", e);
|
|
269
|
-
}, [t]),
|
|
279
|
+
}, [t]), G(() => {
|
|
270
280
|
if (n === i.current) return;
|
|
271
281
|
i.current = n;
|
|
272
282
|
let e = r.current;
|
|
@@ -276,7 +286,7 @@ var J = {
|
|
|
276
286
|
let { value: r, selectionStart: i, selectionEnd: s } = n, c = !o.current && r.length > 0 && i === 0 && s === 0, l = c ? r.length : i ?? r.length, u = c ? l : s ?? l;
|
|
277
287
|
if (n.focus(), c && n.setSelectionRange(l, u), a.current = null, typeof document.execCommand == "function" && document.execCommand("insertText", !1, e)) return;
|
|
278
288
|
let d = `${r.slice(0, l)}${e}${r.slice(u)}`;
|
|
279
|
-
|
|
289
|
+
qe(n, d, l + e.length), a.current = {
|
|
280
290
|
insertedValue: d,
|
|
281
291
|
previousValue: r,
|
|
282
292
|
previousSelectionStart: l,
|
|
@@ -286,69 +296,69 @@ var J = {
|
|
|
286
296
|
}, [n, t]), {
|
|
287
297
|
handleUndoKeyDown: (e) => {
|
|
288
298
|
let n = a.current, r = t.current;
|
|
289
|
-
return n == null || r == null || !
|
|
299
|
+
return n == null || r == null || !Je(e) || (a.current = null, r.value !== n.insertedValue) ? !1 : (e.preventDefault(), qe(r, n.previousValue, n.previousSelectionStart, n.previousSelectionEnd), !0);
|
|
290
300
|
},
|
|
291
301
|
markCaretPlaced: () => {
|
|
292
302
|
o.current = !0;
|
|
293
303
|
}
|
|
294
304
|
};
|
|
295
|
-
},
|
|
305
|
+
}, Xe = /* @__PURE__ */ function(e) {
|
|
296
306
|
return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
|
|
297
|
-
}({}),
|
|
307
|
+
}({}), Ze = /* @__PURE__ */ function(e) {
|
|
298
308
|
return e.Dictation = "dictation", e.Attachment = "attachment", e;
|
|
299
|
-
}({}),
|
|
309
|
+
}({}), Qe = [
|
|
300
310
|
"audio/webm;codecs=opus",
|
|
301
311
|
"audio/ogg;codecs=opus",
|
|
302
312
|
"audio/webm"
|
|
303
|
-
],
|
|
304
|
-
let [a, o] =
|
|
313
|
+
], $e = 100, et = 100, tt = .01, nt = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: i = "Voice input failed" }) => {
|
|
314
|
+
let [a, o] = J("idle"), [s, c] = J(null), l = q(null), u = q(null), d = q({
|
|
305
315
|
onAttachAudio: e,
|
|
306
316
|
onTranscribeAudio: t,
|
|
307
317
|
onTranscript: n,
|
|
308
318
|
errorLabel: i
|
|
309
319
|
});
|
|
310
|
-
|
|
320
|
+
d.current = {
|
|
311
321
|
onAttachAudio: e,
|
|
312
322
|
onTranscribeAudio: t,
|
|
313
323
|
onTranscript: n,
|
|
314
324
|
errorLabel: i
|
|
315
325
|
};
|
|
316
|
-
let p =
|
|
317
|
-
if (
|
|
326
|
+
let p = W((e = "dictation") => {
|
|
327
|
+
if (u.current) return;
|
|
318
328
|
let t = { controller: new AbortController() };
|
|
319
|
-
|
|
320
|
-
let { signal: n } = t.controller, i = e === "dictation" ?
|
|
329
|
+
u.current = t, c(null), o("recording");
|
|
330
|
+
let { signal: n } = t.controller, i = e === "dictation" ? d.current.onTranscribeAudio : void 0, a, s, p, m, h = !1, g = !1, _ = [], v = () => {
|
|
321
331
|
clearInterval(m), m = void 0;
|
|
322
332
|
}, y = () => {
|
|
323
|
-
v(), p &&= (p.ondataavailable = null, p.onstop = null, p.onerror = null, p.state !== "inactive" && p.stop(), void 0), a?.getTracks().forEach((e) => e.stop()), a = void 0, s &&= (s.close(), void 0),
|
|
333
|
+
v(), p &&= (p.ondataavailable = null, p.onstop = null, p.onerror = null, p.state !== "inactive" && p.stop(), void 0), a?.getTracks().forEach((e) => e.stop()), a = void 0, s &&= (s.close(), void 0), u.current === t && (l.current = null);
|
|
324
334
|
};
|
|
325
335
|
n.addEventListener("abort", () => {
|
|
326
336
|
_.length = 0, y();
|
|
327
337
|
}, { once: !0 });
|
|
328
338
|
let b = () => {
|
|
329
|
-
n.aborted || (y(),
|
|
339
|
+
n.aborted || (y(), u.current = null, c(null), o("idle"));
|
|
330
340
|
}, x = (e) => {
|
|
331
|
-
n.aborted || (t.controller.abort(),
|
|
341
|
+
n.aborted || (t.controller.abort(), u.current = null, c(e instanceof Error ? e.message : d.current.errorLabel), o("error"));
|
|
332
342
|
}, S = () => {
|
|
333
343
|
if (!a || n.aborted) return;
|
|
334
|
-
let e =
|
|
344
|
+
let e = Qe.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(a, e ? { mimeType: e } : void 0);
|
|
335
345
|
p = t;
|
|
336
|
-
let s = Date.now(), c = !1,
|
|
346
|
+
let s = Date.now(), c = !1, u = !1, S = new Uint8Array(l.current?.fftSize ?? 256), C = async () => {
|
|
337
347
|
if (!(g || n.aborted)) {
|
|
338
348
|
g = !0, h = !0;
|
|
339
349
|
try {
|
|
340
350
|
let a = t.mimeType || e || "audio/webm", l = new Blob(_, { type: a });
|
|
341
351
|
_.length = 0, y();
|
|
342
|
-
let p = Date.now() - s >=
|
|
343
|
-
if (l.size && (!i || p && (!c ||
|
|
344
|
-
let e =
|
|
352
|
+
let p = Date.now() - s >= et;
|
|
353
|
+
if (l.size && (!i || p && (!c || u))) {
|
|
354
|
+
let e = f(a), t = r[e] ?? e.split("/")[1] ?? "webm", s = new File([l], "voice-" + crypto.randomUUID() + "." + t, { type: a });
|
|
345
355
|
if (i) {
|
|
346
356
|
o("processing");
|
|
347
357
|
let e = await i(s, n);
|
|
348
358
|
if (n.aborted) return;
|
|
349
|
-
|
|
350
|
-
} else
|
|
351
|
-
} else i &&
|
|
359
|
+
d.current.onTranscript?.(e);
|
|
360
|
+
} else d.current.onAttachAudio(s);
|
|
361
|
+
} else i && d.current.onTranscript?.("");
|
|
352
362
|
b();
|
|
353
363
|
} catch (e) {
|
|
354
364
|
x(e);
|
|
@@ -357,7 +367,7 @@ var J = {
|
|
|
357
367
|
};
|
|
358
368
|
t.ondataavailable = (e) => {
|
|
359
369
|
e.data.size && _.push(e.data);
|
|
360
|
-
}, t.onerror = () => x(Error(
|
|
370
|
+
}, t.onerror = () => x(Error(d.current.errorLabel)), t.onstop = () => {
|
|
361
371
|
C();
|
|
362
372
|
}, t.start(), i && (m = setInterval(() => {
|
|
363
373
|
let e = l.current;
|
|
@@ -365,8 +375,8 @@ var J = {
|
|
|
365
375
|
e.getByteTimeDomainData(S), c = !0;
|
|
366
376
|
let t = 0;
|
|
367
377
|
for (let e of S) t += ((e - 128) / 128) ** 2;
|
|
368
|
-
Math.sqrt(t / S.length) >=
|
|
369
|
-
},
|
|
378
|
+
Math.sqrt(t / S.length) >= tt && (u = !0, v());
|
|
379
|
+
}, $e));
|
|
370
380
|
};
|
|
371
381
|
t.stop = () => {
|
|
372
382
|
h || n.aborted || (h = !0, v(), o("processing"), p?.state === "recording" && p.stop());
|
|
@@ -384,11 +394,11 @@ var J = {
|
|
|
384
394
|
x(e);
|
|
385
395
|
}
|
|
386
396
|
})();
|
|
387
|
-
}, []), m =
|
|
388
|
-
|
|
397
|
+
}, []), m = W(() => u.current?.stop?.(), []), h = W(() => {
|
|
398
|
+
u.current?.controller.abort(), u.current = null, c(null), o("idle");
|
|
389
399
|
}, []);
|
|
390
|
-
return
|
|
391
|
-
|
|
400
|
+
return G(() => () => {
|
|
401
|
+
u.current?.controller.abort(), u.current = null;
|
|
392
402
|
}, []), {
|
|
393
403
|
state: a,
|
|
394
404
|
analyserNodeRef: l,
|
|
@@ -397,19 +407,19 @@ var J = {
|
|
|
397
407
|
stopRecording: m,
|
|
398
408
|
discardRecording: h
|
|
399
409
|
};
|
|
400
|
-
},
|
|
410
|
+
}, rt = /* @__PURE__ */ function(e) {
|
|
401
411
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
402
|
-
}({}),
|
|
412
|
+
}({}), it = /* @__PURE__ */ function(e) {
|
|
403
413
|
return e.Stacked = "stacked", e.Inline = "inline", e;
|
|
404
|
-
}({}),
|
|
414
|
+
}({}), at = {
|
|
405
415
|
icon: "_icon_1fv6z_1",
|
|
406
416
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
407
|
-
},
|
|
408
|
-
let
|
|
417
|
+
}, ot = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: l, itemLabelClassName: u = "dial-small-text", colors: f }) => {
|
|
418
|
+
let p = c({
|
|
409
419
|
"--tbs-icon-text": f?.iconText,
|
|
410
420
|
"--tbs-selected-icon-text": f?.selectedIconText
|
|
411
421
|
});
|
|
412
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ H(Le, {
|
|
413
423
|
isOpen: e,
|
|
414
424
|
title: o,
|
|
415
425
|
closeLabel: i,
|
|
@@ -417,137 +427,137 @@ var J = {
|
|
|
417
427
|
onBack: t,
|
|
418
428
|
backLabel: n,
|
|
419
429
|
style: a,
|
|
420
|
-
children: /* @__PURE__ */
|
|
430
|
+
children: /* @__PURE__ */ H("div", {
|
|
421
431
|
role: "menu",
|
|
422
432
|
"aria-label": o,
|
|
423
433
|
className: "flex flex-col px-2 pb-4",
|
|
424
|
-
style:
|
|
425
|
-
children: s.map((e) => /* @__PURE__ */
|
|
434
|
+
style: p,
|
|
435
|
+
children: s.map((e) => /* @__PURE__ */ H(j, {
|
|
426
436
|
role: "menuitemcheckbox",
|
|
427
437
|
"aria-checked": e.isSelected,
|
|
428
|
-
icon: /* @__PURE__ */
|
|
429
|
-
className:
|
|
438
|
+
icon: /* @__PURE__ */ H("span", {
|
|
439
|
+
className: d("flex items-center", at.icon),
|
|
430
440
|
children: e.icon
|
|
431
441
|
}),
|
|
432
442
|
label: e.label,
|
|
433
|
-
labelClassName:
|
|
434
|
-
trailing: e.isSelected ? /* @__PURE__ */
|
|
435
|
-
className:
|
|
436
|
-
children: /* @__PURE__ */
|
|
437
|
-
size:
|
|
443
|
+
labelClassName: u,
|
|
444
|
+
trailing: e.isSelected ? /* @__PURE__ */ H("span", {
|
|
445
|
+
className: d("flex", at.selectedIcon),
|
|
446
|
+
children: /* @__PURE__ */ H(_e, {
|
|
447
|
+
size: h,
|
|
438
448
|
"aria-hidden": !0,
|
|
439
|
-
stroke:
|
|
449
|
+
stroke: x
|
|
440
450
|
})
|
|
441
451
|
}) : void 0,
|
|
442
|
-
onClick: () =>
|
|
452
|
+
onClick: () => l(e.id)
|
|
443
453
|
}, e.id))
|
|
444
454
|
})
|
|
445
455
|
});
|
|
446
|
-
},
|
|
456
|
+
}, X = {
|
|
447
457
|
chip: "_chip_1lvv5_1",
|
|
448
458
|
chipSelected: "_chipSelected_1lvv5_9",
|
|
449
459
|
chipIcon: "_chipIcon_1lvv5_16",
|
|
450
460
|
chipText: "_chipText_1lvv5_19",
|
|
451
461
|
chipState: "_chipState_1lvv5_22",
|
|
452
462
|
chipClose: "_chipClose_1lvv5_25"
|
|
453
|
-
},
|
|
463
|
+
}, st = (e) => `Remove ${e}`, ct = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = st, stateOnLabel: a, stateOffLabel: o, typography: s, colors: l }) => {
|
|
454
464
|
if (e.length === 0) return null;
|
|
455
|
-
let
|
|
456
|
-
"--ci-chip-bg":
|
|
457
|
-
"--ci-chip-border":
|
|
458
|
-
"--ci-chip-icon":
|
|
459
|
-
"--ci-chip-text":
|
|
460
|
-
"--ci-chip-hover-bg":
|
|
461
|
-
"--ci-chip-selected-bg":
|
|
462
|
-
"--ci-chip-selected-bg-hover":
|
|
463
|
-
"--ci-chip-selected-border":
|
|
464
|
-
"--ci-chip-selected-icon":
|
|
465
|
-
"--ci-chip-selected-text":
|
|
466
|
-
"--ci-chip-state-text":
|
|
467
|
-
"--ci-chip-close":
|
|
468
|
-
"--ci-chip-close-hover":
|
|
469
|
-
}), p = (e) => /* @__PURE__ */
|
|
470
|
-
className:
|
|
465
|
+
let u = !!(a && o), f = c({
|
|
466
|
+
"--ci-chip-bg": l?.chipBg,
|
|
467
|
+
"--ci-chip-border": l?.chipBorder,
|
|
468
|
+
"--ci-chip-icon": l?.chipIcon,
|
|
469
|
+
"--ci-chip-text": l?.chipText,
|
|
470
|
+
"--ci-chip-hover-bg": l?.chipHoverBg,
|
|
471
|
+
"--ci-chip-selected-bg": l?.chipSelectedBg,
|
|
472
|
+
"--ci-chip-selected-bg-hover": l?.chipSelectedHoverBg,
|
|
473
|
+
"--ci-chip-selected-border": l?.chipSelectedBorder,
|
|
474
|
+
"--ci-chip-selected-icon": l?.chipSelectedIcon,
|
|
475
|
+
"--ci-chip-selected-text": l?.chipSelectedText,
|
|
476
|
+
"--ci-chip-state-text": l?.chipStateText,
|
|
477
|
+
"--ci-chip-close": l?.chipClose,
|
|
478
|
+
"--ci-chip-close-hover": l?.chipCloseHover
|
|
479
|
+
}), p = (e) => /* @__PURE__ */ H("span", {
|
|
480
|
+
className: d(X.chipIcon, "flex shrink-0"),
|
|
471
481
|
children: e.icon
|
|
472
|
-
}), m = (e) => /* @__PURE__ */
|
|
473
|
-
className: "flex min-w-0 items-
|
|
474
|
-
children: [/* @__PURE__ */
|
|
475
|
-
className:
|
|
476
|
-
children: [e.label,
|
|
482
|
+
}), m = (e) => /* @__PURE__ */ U("span", {
|
|
483
|
+
className: "flex min-w-0 items-baseline",
|
|
484
|
+
children: [/* @__PURE__ */ U("span", {
|
|
485
|
+
className: d(X.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
486
|
+
children: [e.label, u && /* @__PURE__ */ H("span", {
|
|
477
487
|
"aria-hidden": !0,
|
|
478
488
|
children: ":"
|
|
479
489
|
})]
|
|
480
|
-
}),
|
|
481
|
-
className:
|
|
490
|
+
}), u && /* @__PURE__ */ H("span", {
|
|
491
|
+
className: d(X.chipState, s?.stateClassName || "dial-tiny-lead-text", "ms-1 shrink-0"),
|
|
482
492
|
"aria-hidden": !0,
|
|
483
493
|
children: e.isSelected ? a : o
|
|
484
494
|
})]
|
|
485
495
|
});
|
|
486
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ H("div", {
|
|
487
497
|
className: "flex flex-wrap items-center gap-2",
|
|
488
498
|
style: f,
|
|
489
|
-
children: e.map((e) => r ? /* @__PURE__ */
|
|
490
|
-
className:
|
|
491
|
-
children: [/* @__PURE__ */
|
|
499
|
+
children: e.map((e) => r ? /* @__PURE__ */ U("div", {
|
|
500
|
+
className: d(X.chip, e.isSelected && X.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 ps-2 pe-1 transition-colors"),
|
|
501
|
+
children: [/* @__PURE__ */ U("button", {
|
|
492
502
|
type: "button",
|
|
493
503
|
onClick: () => t(e.id),
|
|
494
504
|
"aria-pressed": e.isSelected,
|
|
495
505
|
className: "flex min-w-0 items-center gap-1.5",
|
|
496
|
-
children: [/* @__PURE__ */
|
|
506
|
+
children: [/* @__PURE__ */ H("span", {
|
|
497
507
|
className: "flex shrink-0",
|
|
498
508
|
"aria-hidden": !0,
|
|
499
509
|
children: p(e)
|
|
500
510
|
}), m(e)]
|
|
501
|
-
}), /* @__PURE__ */
|
|
511
|
+
}), /* @__PURE__ */ H("button", {
|
|
502
512
|
type: "button",
|
|
503
513
|
onClick: () => n(e.id),
|
|
504
514
|
"aria-label": i(e.label),
|
|
505
|
-
className:
|
|
506
|
-
children: /* @__PURE__ */
|
|
515
|
+
className: d(X.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
516
|
+
children: /* @__PURE__ */ H(De, {
|
|
507
517
|
size: 12,
|
|
508
518
|
"aria-hidden": !0,
|
|
509
|
-
stroke:
|
|
519
|
+
stroke: x
|
|
510
520
|
})
|
|
511
521
|
})]
|
|
512
|
-
}, e.id) : /* @__PURE__ */
|
|
522
|
+
}, e.id) : /* @__PURE__ */ H(ue, {
|
|
513
523
|
icon: p(e),
|
|
514
524
|
label: m(e),
|
|
515
525
|
isSelected: e.isSelected,
|
|
516
526
|
onToggle: () => t(e.id),
|
|
517
|
-
className:
|
|
527
|
+
className: d(X.chip, e.isSelected && X.chipSelected, "h-auto min-w-0 gap-1.5 border px-2 py-1 transition-colors")
|
|
518
528
|
}, e.id))
|
|
519
529
|
});
|
|
520
|
-
},
|
|
530
|
+
}, lt = (e, t) => `Tools: ${e} of ${t} on`, ut = ({ items: e, title: t = "Tools", summaryLabel: n = lt, onClick: r, fontClassName: i = "dial-small-paragraph-text", countClassName: a = "dial-tiny-lead-text" }) => {
|
|
521
531
|
if (e.length === 0) return null;
|
|
522
532
|
let o = e.filter((e) => e.isSelected).length, s = o > 0;
|
|
523
|
-
return /* @__PURE__ */
|
|
533
|
+
return /* @__PURE__ */ U("button", {
|
|
524
534
|
type: "button",
|
|
525
535
|
onClick: r,
|
|
526
536
|
"aria-haspopup": "dialog",
|
|
527
537
|
"aria-label": n(o, e.length),
|
|
528
|
-
className:
|
|
538
|
+
className: d(X.chip, s && X.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1 transition-colors"),
|
|
529
539
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
className:
|
|
532
|
-
children: /* @__PURE__ */
|
|
540
|
+
/* @__PURE__ */ H("span", {
|
|
541
|
+
className: d(X.chipIcon, "flex shrink-0"),
|
|
542
|
+
children: /* @__PURE__ */ H(Ee, {
|
|
533
543
|
size: 16,
|
|
534
544
|
"aria-hidden": !0,
|
|
535
|
-
stroke:
|
|
545
|
+
stroke: x
|
|
536
546
|
})
|
|
537
547
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
className:
|
|
548
|
+
/* @__PURE__ */ H("span", {
|
|
549
|
+
className: d(X.chipText, i, "truncate"),
|
|
540
550
|
"aria-hidden": !0,
|
|
541
551
|
children: t
|
|
542
552
|
}),
|
|
543
|
-
s && /* @__PURE__ */
|
|
544
|
-
className:
|
|
553
|
+
s && /* @__PURE__ */ H("span", {
|
|
554
|
+
className: d(X.chipState, a, "shrink-0"),
|
|
545
555
|
"aria-hidden": !0,
|
|
546
556
|
children: o
|
|
547
557
|
})
|
|
548
558
|
]
|
|
549
559
|
});
|
|
550
|
-
},
|
|
560
|
+
}, Z = {
|
|
551
561
|
wrapper: "_wrapper_13067_2",
|
|
552
562
|
wrapperDisabled: "_wrapperDisabled_13067_9",
|
|
553
563
|
textarea: "_textarea_13067_13",
|
|
@@ -562,33 +572,33 @@ var J = {
|
|
|
562
572
|
modelSelectorName: "_modelSelectorName_13067_85",
|
|
563
573
|
modelSelectorVersion: "_modelSelectorVersion_13067_88",
|
|
564
574
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_13067_97"
|
|
565
|
-
},
|
|
575
|
+
}, dt = {
|
|
566
576
|
waveformCanvas: "_waveformCanvas_18zb5_1",
|
|
567
577
|
recordingDot: "_recordingDot_18zb5_15",
|
|
568
578
|
"recording-pulse": "_recording-pulse_18zb5_1"
|
|
569
|
-
},
|
|
570
|
-
let f =
|
|
579
|
+
}, ft = 3, pt = 4, mt = 200, ht = ({ 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: l, embedded: u = !1 }) => {
|
|
580
|
+
let f = q(null), p = q(new Float32Array(mt)), m = q(0), h = q(0), g = e === Xe.Recording, _ = e === Xe.Processing, v = W((e) => {
|
|
571
581
|
let t = e.getContext("2d");
|
|
572
582
|
if (!t) return;
|
|
573
583
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
574
584
|
let { width: n, height: r } = e;
|
|
575
585
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
576
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
586
|
+
let i = Math.min(Math.max(1, Math.floor(n / pt)), 199), a = m.current, o = h.current;
|
|
577
587
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
578
588
|
for (let e = 0; e <= i; e++) {
|
|
579
|
-
let n = ((a - i + e) %
|
|
580
|
-
t.fillRect(e *
|
|
589
|
+
let n = ((a - i + e) % mt + mt) % mt, o = p.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
590
|
+
t.fillRect(e * pt, (r - c) / 2, ft, c);
|
|
581
591
|
}
|
|
582
592
|
t.restore();
|
|
583
593
|
}, []);
|
|
584
|
-
|
|
594
|
+
G(() => {
|
|
585
595
|
if (!g) return;
|
|
586
596
|
let e = f.current;
|
|
587
597
|
if (!e) return;
|
|
588
598
|
p.current.fill(0), m.current = 0, h.current = 0;
|
|
589
599
|
let n, r = () => {
|
|
590
|
-
if (h.current += 1, h.current >=
|
|
591
|
-
h.current -=
|
|
600
|
+
if (h.current += 1, h.current >= pt) {
|
|
601
|
+
h.current -= pt;
|
|
592
602
|
let e = t.current;
|
|
593
603
|
if (e) {
|
|
594
604
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -598,10 +608,10 @@ var J = {
|
|
|
598
608
|
let r = (t[e] - 128) / 128;
|
|
599
609
|
n += r * r;
|
|
600
610
|
}
|
|
601
|
-
p.current[m.current %
|
|
611
|
+
p.current[m.current % mt] = Math.sqrt(n / t.length), m.current++;
|
|
602
612
|
}
|
|
603
613
|
}
|
|
604
|
-
|
|
614
|
+
v(e), n = requestAnimationFrame(r);
|
|
605
615
|
};
|
|
606
616
|
return n = requestAnimationFrame(r), () => {
|
|
607
617
|
cancelAnimationFrame(n);
|
|
@@ -609,97 +619,97 @@ var J = {
|
|
|
609
619
|
}, [
|
|
610
620
|
g,
|
|
611
621
|
t,
|
|
612
|
-
|
|
613
|
-
]),
|
|
622
|
+
v
|
|
623
|
+
]), G(() => {
|
|
614
624
|
let e = f.current;
|
|
615
625
|
if (!e) return;
|
|
616
626
|
let t = new ResizeObserver(() => {
|
|
617
|
-
|
|
627
|
+
v(e);
|
|
618
628
|
});
|
|
619
629
|
return t.observe(e), () => t.disconnect();
|
|
620
|
-
}, [
|
|
621
|
-
let
|
|
630
|
+
}, [v]);
|
|
631
|
+
let y = /* @__PURE__ */ U("div", {
|
|
622
632
|
className: "flex shrink-0 items-center justify-end gap-1",
|
|
623
633
|
children: [
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
icon: /* @__PURE__ */
|
|
626
|
-
size:
|
|
634
|
+
/* @__PURE__ */ H(P, {
|
|
635
|
+
icon: /* @__PURE__ */ H(De, {
|
|
636
|
+
size: b.LG,
|
|
627
637
|
"aria-hidden": !0,
|
|
628
|
-
stroke:
|
|
638
|
+
stroke: x
|
|
629
639
|
}),
|
|
630
640
|
"aria-label": o,
|
|
631
641
|
className: "mobile:min-h-11 mobile:min-w-11",
|
|
632
642
|
onClick: r
|
|
633
643
|
}),
|
|
634
|
-
g && /* @__PURE__ */
|
|
635
|
-
icon: /* @__PURE__ */
|
|
636
|
-
size:
|
|
644
|
+
g && /* @__PURE__ */ H(z, {
|
|
645
|
+
icon: /* @__PURE__ */ H(_e, {
|
|
646
|
+
size: b.LG,
|
|
637
647
|
"aria-hidden": !0,
|
|
638
|
-
stroke:
|
|
648
|
+
stroke: x
|
|
639
649
|
}),
|
|
640
650
|
onClick: () => n?.(),
|
|
641
651
|
autoFocus: !0,
|
|
642
652
|
"aria-label": a,
|
|
643
653
|
className: "mobile:min-h-11 mobile:min-w-11"
|
|
644
654
|
}),
|
|
645
|
-
_ && /* @__PURE__ */
|
|
655
|
+
_ && /* @__PURE__ */ H("span", {
|
|
646
656
|
className: "flex size-[40px] shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
|
|
647
|
-
children: /* @__PURE__ */
|
|
657
|
+
children: /* @__PURE__ */ H(se, {
|
|
648
658
|
size: 20,
|
|
649
659
|
ariaLabel: s
|
|
650
660
|
})
|
|
651
661
|
})
|
|
652
662
|
]
|
|
653
663
|
});
|
|
654
|
-
return /* @__PURE__ */
|
|
655
|
-
className:
|
|
656
|
-
children: /* @__PURE__ */
|
|
664
|
+
return /* @__PURE__ */ H("div", {
|
|
665
|
+
className: l,
|
|
666
|
+
children: /* @__PURE__ */ U("div", {
|
|
657
667
|
style: c,
|
|
658
|
-
className:
|
|
659
|
-
children: [/* @__PURE__ */
|
|
668
|
+
className: d("flex w-full min-w-0 flex-col justify-center gap-2", !u && Z.wrapper, !u && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md"),
|
|
669
|
+
children: [/* @__PURE__ */ U("div", {
|
|
660
670
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
661
|
-
children: [g && /* @__PURE__ */
|
|
662
|
-
className:
|
|
671
|
+
children: [g && /* @__PURE__ */ H("span", {
|
|
672
|
+
className: d(dt.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
663
673
|
"aria-hidden": !0
|
|
664
|
-
}), /* @__PURE__ */
|
|
674
|
+
}), /* @__PURE__ */ H("canvas", {
|
|
665
675
|
ref: f,
|
|
666
676
|
height: 26,
|
|
667
677
|
"aria-hidden": !0,
|
|
668
|
-
className:
|
|
678
|
+
className: d(dt.waveformCanvas, "h-[26px] min-w-0 flex-1")
|
|
669
679
|
})]
|
|
670
|
-
}), /* @__PURE__ */
|
|
680
|
+
}), /* @__PURE__ */ U("div", {
|
|
671
681
|
className: "flex items-center justify-between gap-2",
|
|
672
|
-
children: [i ?? /* @__PURE__ */
|
|
682
|
+
children: [i ?? /* @__PURE__ */ H("span", { "aria-hidden": !0 }), y]
|
|
673
683
|
})]
|
|
674
684
|
})
|
|
675
685
|
});
|
|
676
|
-
},
|
|
686
|
+
}, gt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", sendTooltip: r }) => /* @__PURE__ */ H(z, {
|
|
677
687
|
"aria-label": n,
|
|
678
688
|
onClick: () => e?.(),
|
|
679
689
|
disabled: t,
|
|
680
690
|
tooltipProps: r ? { tooltip: r } : void 0,
|
|
681
|
-
icon: /* @__PURE__ */
|
|
682
|
-
size:
|
|
691
|
+
icon: /* @__PURE__ */ H(ge, {
|
|
692
|
+
size: b.LG,
|
|
683
693
|
className: "rtl:scale-x-[-1]",
|
|
684
|
-
stroke:
|
|
694
|
+
stroke: x
|
|
685
695
|
})
|
|
686
|
-
}),
|
|
687
|
-
icon: /* @__PURE__ */
|
|
688
|
-
size:
|
|
689
|
-
stroke:
|
|
696
|
+
}), _t = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ H(P, {
|
|
697
|
+
icon: /* @__PURE__ */ H(Ce, {
|
|
698
|
+
size: b.LG,
|
|
699
|
+
stroke: x
|
|
690
700
|
}),
|
|
691
701
|
onClick: () => e?.(),
|
|
692
702
|
"aria-label": t
|
|
693
|
-
}),
|
|
703
|
+
}), vt = (e, t, n, r, i) => {
|
|
694
704
|
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) => {
|
|
695
705
|
if (n <= t) return;
|
|
696
706
|
let r = t;
|
|
697
707
|
o.filter((e) => e.offset >= t && e.offset <= n).forEach((t) => {
|
|
698
|
-
t.offset > r && s.push(/* @__PURE__ */
|
|
708
|
+
t.offset > r && s.push(/* @__PURE__ */ H("span", {
|
|
699
709
|
"aria-hidden": !0,
|
|
700
710
|
children: e.slice(r, t.offset)
|
|
701
711
|
}, `text-${l++}`)), s.push(t.node), r = t.offset;
|
|
702
|
-
}), r < n && s.push(/* @__PURE__ */
|
|
712
|
+
}), r < n && s.push(/* @__PURE__ */ H("span", {
|
|
703
713
|
"aria-hidden": !0,
|
|
704
714
|
children: e.slice(r, n)
|
|
705
715
|
}, `text-${l++}`));
|
|
@@ -707,16 +717,16 @@ var J = {
|
|
|
707
717
|
return a.forEach((t, n) => {
|
|
708
718
|
if (u(c, t.start), t.start + t.length <= c) return;
|
|
709
719
|
let a = e.slice(t.start, t.start + t.length);
|
|
710
|
-
s.push(t.render ? /* @__PURE__ */
|
|
720
|
+
s.push(t.render ? /* @__PURE__ */ H("span", {
|
|
711
721
|
className: "pointer-events-auto",
|
|
712
722
|
children: t.render()
|
|
713
|
-
}, `range-${n}`) : /* @__PURE__ */
|
|
723
|
+
}, `range-${n}`) : /* @__PURE__ */ H("span", {
|
|
714
724
|
"aria-hidden": !0,
|
|
715
725
|
className: t.isUnsupported ? i : r,
|
|
716
726
|
children: a
|
|
717
727
|
}, `range-${n}`)), c = Math.max(c, t.start + t.length);
|
|
718
728
|
}), u(c, e.length), s;
|
|
719
|
-
},
|
|
729
|
+
}, yt = (e, t) => {
|
|
720
730
|
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;
|
|
721
731
|
for (let e = n.nextNode(); e != null; e = n.nextNode()) {
|
|
722
732
|
let n = e.textContent?.length ?? 0;
|
|
@@ -727,24 +737,24 @@ var J = {
|
|
|
727
737
|
r += n;
|
|
728
738
|
}
|
|
729
739
|
return null;
|
|
730
|
-
},
|
|
731
|
-
let r =
|
|
740
|
+
}, bt = (e, t, n) => {
|
|
741
|
+
let r = yt(e, t), i = yt(e, n);
|
|
732
742
|
if (r == null || i == null) return null;
|
|
733
743
|
let a = document.createRange();
|
|
734
744
|
return a.setStart(r.node, r.offset), a.setEnd(i.node, i.offset), a;
|
|
735
|
-
},
|
|
736
|
-
let r =
|
|
745
|
+
}, xt = ({ textareaRef: e, message: t, isMirrorActive: n }) => {
|
|
746
|
+
let r = q(null), [i, a] = J([]), o = W(() => {
|
|
737
747
|
let t = e.current, n = r.current;
|
|
738
748
|
if (t == null || n == null) return;
|
|
739
749
|
let i = t.offsetWidth > t.clientWidth;
|
|
740
750
|
n.style.scrollbarGutter = i ? "stable" : "", n.scrollTop = t.scrollTop;
|
|
741
|
-
}, [e]), s =
|
|
751
|
+
}, [e]), s = W(() => {
|
|
742
752
|
let t = e.current, i = r.current, o = t?.selectionStart, s = t?.selectionEnd;
|
|
743
753
|
if (!n || t == null || i == null || o == null || s == null || o === s) {
|
|
744
754
|
a((e) => e.length === 0 ? e : []);
|
|
745
755
|
return;
|
|
746
756
|
}
|
|
747
|
-
let c =
|
|
757
|
+
let c = bt(i, o, s);
|
|
748
758
|
if (c == null) {
|
|
749
759
|
a((e) => e.length === 0 ? e : []);
|
|
750
760
|
return;
|
|
@@ -752,14 +762,14 @@ var J = {
|
|
|
752
762
|
let l = i.getBoundingClientRect();
|
|
753
763
|
a(Array.from(c.getClientRects()).map((e) => new DOMRect(e.left - l.left, e.top - l.top + i.scrollTop, e.width, e.height)));
|
|
754
764
|
}, [n, e]);
|
|
755
|
-
return
|
|
765
|
+
return Pe(() => {
|
|
756
766
|
n && o(), s();
|
|
757
767
|
}, [
|
|
758
768
|
n,
|
|
759
769
|
o,
|
|
760
770
|
s,
|
|
761
771
|
t
|
|
762
|
-
]),
|
|
772
|
+
]), G(() => {
|
|
763
773
|
if (!n) return;
|
|
764
774
|
let t = e.current;
|
|
765
775
|
if (t == null || typeof ResizeObserver > "u") return;
|
|
@@ -778,8 +788,8 @@ var J = {
|
|
|
778
788
|
updateSelectionRects: s,
|
|
779
789
|
syncMirrorToTextarea: o
|
|
780
790
|
};
|
|
781
|
-
},
|
|
782
|
-
let s =
|
|
791
|
+
}, St = ({ commandMenu: e, message: t, textareaRef: n, hasActiveMentions: r, markerOffset: i, triggerEnd: a, hasCommandEmptyQueryHint: o }) => {
|
|
792
|
+
let s = q(null), c = q(null), [l, u] = J(null), d = W(() => {
|
|
783
793
|
let e = s.current, t = c.current;
|
|
784
794
|
if (e == null || t == null) {
|
|
785
795
|
u(null);
|
|
@@ -791,7 +801,7 @@ var J = {
|
|
|
791
801
|
top: n.top - r.top
|
|
792
802
|
});
|
|
793
803
|
}, []);
|
|
794
|
-
|
|
804
|
+
G(() => {
|
|
795
805
|
if (i == null) return;
|
|
796
806
|
let e = n.current;
|
|
797
807
|
if (e == null || typeof ResizeObserver > "u") return;
|
|
@@ -802,19 +812,19 @@ var J = {
|
|
|
802
812
|
n,
|
|
803
813
|
d
|
|
804
814
|
]);
|
|
805
|
-
let f =
|
|
815
|
+
let f = K(() => {
|
|
806
816
|
let t = [];
|
|
807
817
|
return i != null && t.push({
|
|
808
818
|
offset: i,
|
|
809
|
-
node: /* @__PURE__ */
|
|
819
|
+
node: /* @__PURE__ */ H("span", {
|
|
810
820
|
ref: s,
|
|
811
821
|
"aria-hidden": !0,
|
|
812
822
|
className: "inline-block h-lh w-0 align-text-top"
|
|
813
823
|
}, "caret-marker")
|
|
814
824
|
}), o && e != null && a != null && t.push({
|
|
815
825
|
offset: a,
|
|
816
|
-
node: /* @__PURE__ */
|
|
817
|
-
className:
|
|
826
|
+
node: /* @__PURE__ */ H("span", {
|
|
827
|
+
className: Z.commandHint,
|
|
818
828
|
"aria-hidden": !0,
|
|
819
829
|
"data-mirror-synthetic": !0,
|
|
820
830
|
children: e.emptyQueryHint
|
|
@@ -825,12 +835,12 @@ var J = {
|
|
|
825
835
|
o,
|
|
826
836
|
e,
|
|
827
837
|
a
|
|
828
|
-
]), p = r || f.length > 0, { mirrorRef: m, selectionRects: h, updateSelectionRects: g, syncMirrorToTextarea: _ } =
|
|
838
|
+
]), p = r || f.length > 0, { mirrorRef: m, selectionRects: h, updateSelectionRects: g, syncMirrorToTextarea: _ } = xt({
|
|
829
839
|
textareaRef: n,
|
|
830
840
|
message: t,
|
|
831
841
|
isMirrorActive: p
|
|
832
842
|
});
|
|
833
|
-
return
|
|
843
|
+
return Pe(() => {
|
|
834
844
|
d();
|
|
835
845
|
}, [
|
|
836
846
|
d,
|
|
@@ -848,31 +858,31 @@ var J = {
|
|
|
848
858
|
_(), i != null && d();
|
|
849
859
|
}
|
|
850
860
|
};
|
|
851
|
-
},
|
|
861
|
+
}, Ct = (e, t) => {
|
|
852
862
|
let n = t;
|
|
853
863
|
for (; n < e.length && !/\s/.test(e[n]);) n++;
|
|
854
864
|
return n;
|
|
855
|
-
},
|
|
865
|
+
}, wt = (e, t) => {
|
|
856
866
|
let n = t;
|
|
857
867
|
for (; n > 0 && !/\s/.test(e[n - 1]);) n--;
|
|
858
868
|
return {
|
|
859
869
|
start: n,
|
|
860
|
-
end:
|
|
870
|
+
end: Ct(e, n)
|
|
861
871
|
};
|
|
862
|
-
},
|
|
872
|
+
}, Tt = (e, t) => e.startsWith(t) && !e.slice(t.length).includes(t), Et = "[role=\"option\"]:not([aria-disabled=\"true\"])", Dt = /* @__PURE__ */ function(e) {
|
|
863
873
|
return e.Next = "next", e.Previous = "previous", e;
|
|
864
|
-
}({}),
|
|
865
|
-
let [n, r] =
|
|
874
|
+
}({}), Ot = ({ config: e, message: t }) => {
|
|
875
|
+
let [n, r] = J(!1), [i, a] = J(null), [o, s] = J(null), c = q(null);
|
|
866
876
|
c.current = i;
|
|
867
877
|
let l = e != null && i != null && i <= t.length ? (() => {
|
|
868
|
-
let n = t.slice(i,
|
|
869
|
-
return
|
|
870
|
-
})() : "", u =
|
|
878
|
+
let n = t.slice(i, Ct(t, i));
|
|
879
|
+
return Tt(n, e.triggerPrefix) ? n.slice(e.triggerPrefix.length) : "";
|
|
880
|
+
})() : "", u = W((t, n, i) => {
|
|
871
881
|
if (e == null || i) return;
|
|
872
|
-
let { start: c, end: l } =
|
|
873
|
-
|
|
882
|
+
let { start: c, end: l } = wt(t, n), u = t.slice(c, l);
|
|
883
|
+
Tt(u, e.triggerPrefix) ? (a(c), u === e.triggerPrefix || o !== c ? (r(!0), s(null)) : r(!1)) : (r(!1), s(null), a(null));
|
|
874
884
|
}, [e, o]);
|
|
875
|
-
|
|
885
|
+
G(() => {
|
|
876
886
|
if (e == null) {
|
|
877
887
|
r(!1), s(null), a(null);
|
|
878
888
|
return;
|
|
@@ -880,25 +890,25 @@ var J = {
|
|
|
880
890
|
let n = c.current;
|
|
881
891
|
if (n == null) return;
|
|
882
892
|
let i = Math.min(n, t.length);
|
|
883
|
-
|
|
893
|
+
Tt(t.slice(i, Ct(t, i)), e.triggerPrefix) || (r(!1), s(null), a(null));
|
|
884
894
|
}, [e, t]);
|
|
885
|
-
let d =
|
|
895
|
+
let d = W(() => {
|
|
886
896
|
r(!1), s(i);
|
|
887
|
-
}, [i]), f =
|
|
897
|
+
}, [i]), f = W(() => {
|
|
888
898
|
r(!1);
|
|
889
|
-
}, []), p =
|
|
899
|
+
}, []), p = W((n) => {
|
|
890
900
|
if (e == null) return;
|
|
891
|
-
let { start: i, end: s } =
|
|
892
|
-
|
|
901
|
+
let { start: i, end: s } = wt(t, n);
|
|
902
|
+
Tt(t.slice(i, s), e.triggerPrefix) ? (a(i), r(o !== i)) : (a(null), r(!1));
|
|
893
903
|
}, [
|
|
894
904
|
e,
|
|
895
905
|
t,
|
|
896
906
|
o
|
|
897
|
-
]), m =
|
|
898
|
-
|
|
907
|
+
]), m = Me(), h = q(null), [g, _] = J(null);
|
|
908
|
+
G(() => {
|
|
899
909
|
_(null);
|
|
900
910
|
}, [n, l]);
|
|
901
|
-
let v =
|
|
911
|
+
let v = W(() => Array.from(h.current?.querySelectorAll(Et) ?? []), []), y = W((e) => {
|
|
902
912
|
let t = v();
|
|
903
913
|
if (t.length === 0) {
|
|
904
914
|
_(null);
|
|
@@ -906,7 +916,7 @@ var J = {
|
|
|
906
916
|
}
|
|
907
917
|
let n = t.findIndex((e) => e.id === g), r = t[e === "next" ? (n + 1) % t.length : (n <= 0 ? t.length : n) - 1];
|
|
908
918
|
_(r.id), r.scrollIntoView?.({ block: "nearest" });
|
|
909
|
-
}, [v, g]), b =
|
|
919
|
+
}, [v, g]), b = W(() => v().find((e) => e.id === g) ?? null, [v, g]);
|
|
910
920
|
return {
|
|
911
921
|
isMenuOpen: n,
|
|
912
922
|
query: l,
|
|
@@ -921,22 +931,22 @@ var J = {
|
|
|
921
931
|
moveActiveOption: y,
|
|
922
932
|
getActiveOption: b
|
|
923
933
|
};
|
|
924
|
-
},
|
|
925
|
-
let { isMenuOpen: u, query: d, activeWordStart: f, dismiss: p, closeOnOutsidePress: m, handleCaretMove: h, handleValueChange: g, listboxId: _, overlayRef: v, activeOptionId: y, moveActiveOption: b, getActiveOption: x } =
|
|
934
|
+
}, kt = ({ commandMenu: e, message: t, setMessage: n, textareaRef: r, historyNav: i, onChange: a, caretPositionOverride: o, messageRevision: s, markCaretPlaced: c, sendOnEnter: l }) => {
|
|
935
|
+
let { isMenuOpen: u, query: d, activeWordStart: f, dismiss: p, closeOnOutsidePress: m, handleCaretMove: h, handleValueChange: g, listboxId: _, overlayRef: v, activeOptionId: y, moveActiveOption: b, getActiveOption: x } = Ot({
|
|
926
936
|
config: e,
|
|
927
937
|
message: t
|
|
928
|
-
}), S =
|
|
938
|
+
}), S = q(h);
|
|
929
939
|
S.current = h;
|
|
930
940
|
let C = () => {
|
|
931
941
|
h(r.current?.selectionStart ?? t.length);
|
|
932
|
-
}, w =
|
|
942
|
+
}, w = q(!1), T = () => {
|
|
933
943
|
w.current ? w.current = !1 : requestAnimationFrame(() => {
|
|
934
944
|
let e = r.current;
|
|
935
945
|
S.current(e?.selectionStart ?? e?.value.length ?? 0);
|
|
936
946
|
});
|
|
937
947
|
}, E = (e) => {
|
|
938
948
|
(e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Home" || e.key === "End" || e.key === "PageUp" || e.key === "PageDown") && h(e.currentTarget.selectionStart ?? t.length);
|
|
939
|
-
}, D = e?.emptyQueryHint != null, O = e != null && f != null ? f + e.triggerPrefix.length : null, k = O != null && t.slice(O).split("\n", 1)[0] !== "", A = D && u && d === "" && O != null && !k, j = e != null && u ? f ?? 0 : null, M =
|
|
949
|
+
}, D = e?.emptyQueryHint != null, O = e != null && f != null ? f + e.triggerPrefix.length : null, k = O != null && t.slice(O).split("\n", 1)[0] !== "", A = D && u && d === "" && O != null && !k, j = e != null && u ? f ?? 0 : null, M = W((o) => {
|
|
940
950
|
if (e == null || (p(), !o?.consumeQuery) || (o.returnFocus !== !1 && r.current?.focus(), f == null)) return;
|
|
941
951
|
let s = `${e.triggerPrefix}${d}`, c = f + s.length;
|
|
942
952
|
if (t.slice(f, c) !== s) return;
|
|
@@ -952,11 +962,11 @@ var J = {
|
|
|
952
962
|
i,
|
|
953
963
|
a,
|
|
954
964
|
r
|
|
955
|
-
]), N =
|
|
956
|
-
|
|
965
|
+
]), N = q(void 0);
|
|
966
|
+
G(() => {
|
|
957
967
|
o != null && N.current !== s && (N.current = s, r.current?.setSelectionRange(o, o), c(), h(o));
|
|
958
968
|
}, [t]);
|
|
959
|
-
let P = (e) => l ===
|
|
969
|
+
let P = (e) => l === rt.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey;
|
|
960
970
|
return {
|
|
961
971
|
isMenuOpen: u,
|
|
962
972
|
query: d,
|
|
@@ -978,18 +988,18 @@ var J = {
|
|
|
978
988
|
handleCommandMenuKeyDown: (e) => {
|
|
979
989
|
if (!u || e.nativeEvent.isComposing) return !1;
|
|
980
990
|
if (e.key === "Escape") return e.preventDefault(), e.stopPropagation(), p(), !0;
|
|
981
|
-
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), b(e.key === "ArrowDown" ?
|
|
991
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") return e.preventDefault(), b(e.key === "ArrowDown" ? Dt.Next : Dt.Previous), !0;
|
|
982
992
|
if (e.key !== "Enter" || e.shiftKey) return !1;
|
|
983
993
|
let t = x();
|
|
984
994
|
return t == null ? P(e) ? (e.preventDefault(), !0) : !1 : (e.preventDefault(), t.click(), !0);
|
|
985
995
|
}
|
|
986
996
|
};
|
|
987
|
-
},
|
|
988
|
-
let [r, i] =
|
|
989
|
-
return
|
|
997
|
+
}, At = ({ toolsMenuItems: e, canRemoveTools: t, onToolToggle: n }) => {
|
|
998
|
+
let [r, i] = J([]), a = (e ?? []).map((e) => e.id).join("|");
|
|
999
|
+
return G(() => {
|
|
990
1000
|
i([]);
|
|
991
1001
|
}, [a]), {
|
|
992
|
-
visibleTools:
|
|
1002
|
+
visibleTools: K(() => {
|
|
993
1003
|
let n = e ?? [];
|
|
994
1004
|
return t ? n.filter((e) => e.isSelected || !r.includes(e.id)) : n;
|
|
995
1005
|
}, [
|
|
@@ -997,13 +1007,13 @@ var J = {
|
|
|
997
1007
|
r,
|
|
998
1008
|
t
|
|
999
1009
|
]),
|
|
1000
|
-
handleToolDismiss:
|
|
1010
|
+
handleToolDismiss: W((t) => {
|
|
1001
1011
|
i((e) => e.includes(t) ? e : [...e, t]), e?.find((e) => e.id === t)?.isSelected && n?.(t);
|
|
1002
1012
|
}, [e, n])
|
|
1003
1013
|
};
|
|
1004
|
-
},
|
|
1005
|
-
let s = t && n, { handlePaste: c } =
|
|
1006
|
-
return
|
|
1014
|
+
}, jt = ({ addAttachments: e, isAttachmentsEnabled: t, isTextAttachmentsAllowed: n, pasteTextThreshold: r, maxMessageLength: i, onMessageTooLong: a, commandMenu: o }) => {
|
|
1015
|
+
let s = t && n, { handlePaste: c } = he(e, s ? r : Infinity);
|
|
1016
|
+
return W((e) => {
|
|
1007
1017
|
if (!s) {
|
|
1008
1018
|
let t = e.clipboardData.getData("text/plain");
|
|
1009
1019
|
t.length >= i && a?.(t.length, i);
|
|
@@ -1018,7 +1028,7 @@ var J = {
|
|
|
1018
1028
|
c,
|
|
1019
1029
|
o
|
|
1020
1030
|
]);
|
|
1021
|
-
},
|
|
1031
|
+
}, Mt = ({ message: e, setMessage: t, attachments: n, resetAttachments: r, historyNav: i, onSend: a, onMessageTooLong: o, maxMessageLength: s, isSendDisabled: c, isVoiceActive: l, isInputDisabled: u, isStreaming: d, canSend: f, hasModelSelected: p, handleUndoKeyDown: m, handleCommandMenuKeyDown: h, isSendGesture: g, onBackspaceAtCaret: _ }) => {
|
|
1022
1032
|
let v = async () => {
|
|
1023
1033
|
if (c || l) return;
|
|
1024
1034
|
if (e.length >= s) {
|
|
@@ -1052,7 +1062,7 @@ var J = {
|
|
|
1052
1062
|
if (t != null) {
|
|
1053
1063
|
n.preventDefault();
|
|
1054
1064
|
let r = n.currentTarget;
|
|
1055
|
-
r.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) ||
|
|
1065
|
+
r.setSelectionRange(t.start, t.start + t.length), typeof document.execCommand == "function" && document.execCommand("delete", !1) || qe(r, e.slice(0, t.start) + e.slice(t.start + t.length), t.start);
|
|
1056
1066
|
return;
|
|
1057
1067
|
}
|
|
1058
1068
|
}
|
|
@@ -1061,16 +1071,16 @@ var J = {
|
|
|
1061
1071
|
}
|
|
1062
1072
|
}
|
|
1063
1073
|
};
|
|
1064
|
-
},
|
|
1065
|
-
let u =
|
|
1074
|
+
}, Nt = ({ addAttachments: e, buildAttachments: t, draftRef: n, setMessage: r, historyNav: i, onChange: a, onTranscribeAudio: o, voiceErrorLabel: s, textareaRef: c, skipFocusMenuEvaluationRef: l }) => {
|
|
1075
|
+
let u = W((n) => {
|
|
1066
1076
|
e(t([n]));
|
|
1067
|
-
}, [e, t]), d =
|
|
1077
|
+
}, [e, t]), d = q(!1), [f, p] = J({
|
|
1068
1078
|
text: "",
|
|
1069
1079
|
revision: 0
|
|
1070
|
-
}), { state: m, analyserNodeRef: h, errorMessage: g, startRecording: _, stopRecording: v, discardRecording: y } =
|
|
1080
|
+
}), { state: m, analyserNodeRef: h, errorMessage: g, startRecording: _, stopRecording: v, discardRecording: y } = nt({
|
|
1071
1081
|
onAttachAudio: u,
|
|
1072
1082
|
onTranscribeAudio: o,
|
|
1073
|
-
onTranscript:
|
|
1083
|
+
onTranscript: W((e) => {
|
|
1074
1084
|
let t = e.trim();
|
|
1075
1085
|
if (t) {
|
|
1076
1086
|
let e = n.current, o = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
@@ -1087,9 +1097,9 @@ var J = {
|
|
|
1087
1097
|
a
|
|
1088
1098
|
]),
|
|
1089
1099
|
errorLabel: s
|
|
1090
|
-
}), b = m ===
|
|
1091
|
-
return
|
|
1092
|
-
if (m ===
|
|
1100
|
+
}), b = m === Xe.Recording || m === Xe.Processing;
|
|
1101
|
+
return G(() => {
|
|
1102
|
+
if (m === Xe.Error || m === Xe.Idle && d.current) {
|
|
1093
1103
|
d.current = !1;
|
|
1094
1104
|
let e = c.current;
|
|
1095
1105
|
if (e != null) {
|
|
@@ -1112,7 +1122,7 @@ var J = {
|
|
|
1112
1122
|
isVoiceActive: b,
|
|
1113
1123
|
latestTranscript: f
|
|
1114
1124
|
};
|
|
1115
|
-
},
|
|
1125
|
+
}, Pt = (e) => c({
|
|
1116
1126
|
"--ci-bg": e?.background,
|
|
1117
1127
|
"--ci-text": e?.text,
|
|
1118
1128
|
"--ci-border": e?.border,
|
|
@@ -1131,10 +1141,10 @@ var J = {
|
|
|
1131
1141
|
"--ci-mention-highlight-unsupported-bg": e?.mentionHighlightUnsupportedBg,
|
|
1132
1142
|
"--ci-mention-highlight-unsupported-text": e?.mentionHighlightUnsupportedText,
|
|
1133
1143
|
"--ci-selection-highlight-bg": e?.selectionHighlightBg
|
|
1134
|
-
}),
|
|
1144
|
+
}), Ft = {
|
|
1135
1145
|
item: "_item_1sr2n_1",
|
|
1136
1146
|
itemIcon: "_itemIcon_1sr2n_11"
|
|
1137
|
-
},
|
|
1147
|
+
}, It = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: s = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "", colors: f }) => {
|
|
1138
1148
|
let p = (e) => {
|
|
1139
1149
|
e(), r();
|
|
1140
1150
|
}, m = c({
|
|
@@ -1143,7 +1153,7 @@ var J = {
|
|
|
1143
1153
|
"--ci-sheet-item-active": f?.itemActiveBg,
|
|
1144
1154
|
"--ci-sheet-icon": f?.itemIcon
|
|
1145
1155
|
});
|
|
1146
|
-
return /* @__PURE__ */
|
|
1156
|
+
return /* @__PURE__ */ H(Le, {
|
|
1147
1157
|
isOpen: e,
|
|
1148
1158
|
title: t,
|
|
1149
1159
|
closeLabel: n,
|
|
@@ -1152,33 +1162,33 @@ var J = {
|
|
|
1152
1162
|
className: o,
|
|
1153
1163
|
titleClassName: s,
|
|
1154
1164
|
colors: f?.shell,
|
|
1155
|
-
children: /* @__PURE__ */
|
|
1165
|
+
children: /* @__PURE__ */ H("ul", {
|
|
1156
1166
|
role: "list",
|
|
1157
1167
|
className: "flex flex-col",
|
|
1158
1168
|
style: m,
|
|
1159
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
1169
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ H("li", { children: /* @__PURE__ */ H(_, {
|
|
1160
1170
|
type: "button",
|
|
1161
|
-
className:
|
|
1162
|
-
iconBefore: /* @__PURE__ */
|
|
1163
|
-
className:
|
|
1171
|
+
className: d(Ft.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
1172
|
+
iconBefore: /* @__PURE__ */ H("span", {
|
|
1173
|
+
className: Ft.itemIcon,
|
|
1164
1174
|
children: n
|
|
1165
1175
|
}),
|
|
1166
|
-
iconAfter: r ? /* @__PURE__ */
|
|
1176
|
+
iconAfter: r ? /* @__PURE__ */ H("span", {
|
|
1167
1177
|
className: "ms-auto",
|
|
1168
1178
|
children: r
|
|
1169
1179
|
}) : null,
|
|
1170
|
-
textClassName:
|
|
1171
|
-
label: /* @__PURE__ */
|
|
1172
|
-
className:
|
|
1180
|
+
textClassName: u,
|
|
1181
|
+
label: /* @__PURE__ */ H("span", {
|
|
1182
|
+
className: l,
|
|
1173
1183
|
children: t
|
|
1174
1184
|
}),
|
|
1175
1185
|
onClick: () => p(i)
|
|
1176
1186
|
}) }, e))
|
|
1177
1187
|
})
|
|
1178
1188
|
});
|
|
1179
|
-
},
|
|
1180
|
-
let [s, c] =
|
|
1181
|
-
|
|
1189
|
+
}, Lt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
1190
|
+
let [s, c] = J(t), [l, u] = J(n), [d, f] = J(r), p = q(o);
|
|
1191
|
+
G(() => {
|
|
1182
1192
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
1183
1193
|
}, [
|
|
1184
1194
|
o,
|
|
@@ -1195,7 +1205,7 @@ var J = {
|
|
|
1195
1205
|
setResponseFormat: c,
|
|
1196
1206
|
setSystemPrompt: u,
|
|
1197
1207
|
setTemperature: f,
|
|
1198
|
-
handleSubmit:
|
|
1208
|
+
handleSubmit: W(() => {
|
|
1199
1209
|
if (!m) return;
|
|
1200
1210
|
let t = {};
|
|
1201
1211
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -1209,25 +1219,25 @@ var J = {
|
|
|
1209
1219
|
a
|
|
1210
1220
|
])
|
|
1211
1221
|
};
|
|
1212
|
-
},
|
|
1222
|
+
}, Q = { label: "_label_14i7c_1" }, Rt = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: s, onTemperatureChange: l, responseFormatLabel: u = "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 = [
|
|
1213
1223
|
"Precise",
|
|
1214
1224
|
"Neutral",
|
|
1215
1225
|
"Creative"
|
|
1216
1226
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
1217
|
-
let S = c({ "--csf-label-text": x?.labelText }), C =
|
|
1218
|
-
return /* @__PURE__ */
|
|
1227
|
+
let S = c({ "--csf-label-text": x?.labelText }), C = d(b, Q.label, "gap-1");
|
|
1228
|
+
return /* @__PURE__ */ U("div", {
|
|
1219
1229
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
1220
1230
|
style: S,
|
|
1221
1231
|
children: [
|
|
1222
|
-
e.responseFormat && /* @__PURE__ */
|
|
1232
|
+
e.responseFormat && /* @__PURE__ */ H(B, {
|
|
1223
1233
|
id: "response-format",
|
|
1224
1234
|
labelProps: {
|
|
1225
|
-
label:
|
|
1235
|
+
label: u,
|
|
1226
1236
|
className: C,
|
|
1227
1237
|
caption: f
|
|
1228
1238
|
},
|
|
1229
1239
|
optionsClassName: "mb-2",
|
|
1230
|
-
orientation:
|
|
1240
|
+
orientation: ne.Column,
|
|
1231
1241
|
value: t ?? o.Markdown,
|
|
1232
1242
|
items: [{
|
|
1233
1243
|
value: o.Markdown,
|
|
@@ -1238,18 +1248,18 @@ var J = {
|
|
|
1238
1248
|
}],
|
|
1239
1249
|
onChange: (e) => a(e)
|
|
1240
1250
|
}),
|
|
1241
|
-
e.systemPrompt && /* @__PURE__ */
|
|
1251
|
+
e.systemPrompt && /* @__PURE__ */ H(ce, {
|
|
1242
1252
|
value: n,
|
|
1243
1253
|
placeholder: g,
|
|
1244
1254
|
className: i,
|
|
1245
|
-
resize:
|
|
1255
|
+
resize: le.Vertical,
|
|
1246
1256
|
labelProps: {
|
|
1247
1257
|
className: C,
|
|
1248
1258
|
label: h
|
|
1249
1259
|
},
|
|
1250
1260
|
onChange: (e) => s(e ?? "")
|
|
1251
1261
|
}),
|
|
1252
|
-
e.temperature && /* @__PURE__ */
|
|
1262
|
+
e.temperature && /* @__PURE__ */ H(oe, {
|
|
1253
1263
|
labelProps: {
|
|
1254
1264
|
label: _,
|
|
1255
1265
|
className: C,
|
|
@@ -1262,21 +1272,21 @@ var J = {
|
|
|
1262
1272
|
labels: v,
|
|
1263
1273
|
showTooltip: !0,
|
|
1264
1274
|
showTicks: !0,
|
|
1265
|
-
onChange:
|
|
1275
|
+
onChange: l
|
|
1266
1276
|
})
|
|
1267
1277
|
]
|
|
1268
1278
|
});
|
|
1269
|
-
},
|
|
1270
|
-
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } =
|
|
1279
|
+
}, $ = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: c, initialTemperature: l, onSave: u, 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 }) => {
|
|
1280
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: O, setSystemPrompt: k, setTemperature: A, handleSubmit: j } = Lt({
|
|
1271
1281
|
isOpen: e,
|
|
1272
1282
|
features: o,
|
|
1273
1283
|
initialResponseFormat: s,
|
|
1274
1284
|
initialSystemPrompt: c,
|
|
1275
|
-
initialTemperature:
|
|
1276
|
-
onSave:
|
|
1285
|
+
initialTemperature: l,
|
|
1286
|
+
onSave: u,
|
|
1277
1287
|
onClose: r
|
|
1278
1288
|
});
|
|
1279
|
-
return /* @__PURE__ */
|
|
1289
|
+
return /* @__PURE__ */ U(Le, {
|
|
1280
1290
|
isOpen: e,
|
|
1281
1291
|
title: f,
|
|
1282
1292
|
closeLabel: i,
|
|
@@ -1284,7 +1294,7 @@ var J = {
|
|
|
1284
1294
|
onBack: t,
|
|
1285
1295
|
backLabel: n,
|
|
1286
1296
|
style: a,
|
|
1287
|
-
children: [/* @__PURE__ */
|
|
1297
|
+
children: [/* @__PURE__ */ H(Rt, {
|
|
1288
1298
|
features: o,
|
|
1289
1299
|
responseFormat: w,
|
|
1290
1300
|
systemPrompt: T,
|
|
@@ -1301,13 +1311,13 @@ var J = {
|
|
|
1301
1311
|
temperatureLabel: y,
|
|
1302
1312
|
temperatureLabels: b,
|
|
1303
1313
|
temperatureHint: x
|
|
1304
|
-
}), /* @__PURE__ */
|
|
1305
|
-
className:
|
|
1306
|
-
children: /* @__PURE__ */
|
|
1314
|
+
}), /* @__PURE__ */ H("div", {
|
|
1315
|
+
className: d("px-6 py-4 mobile:pb-8"),
|
|
1316
|
+
children: /* @__PURE__ */ H(de, {
|
|
1307
1317
|
tooltip: C,
|
|
1308
1318
|
hideTooltip: D || !C,
|
|
1309
1319
|
triggerClassName: "w-full",
|
|
1310
|
-
children: /* @__PURE__ */
|
|
1320
|
+
children: /* @__PURE__ */ H(R, {
|
|
1311
1321
|
label: S,
|
|
1312
1322
|
onClick: j,
|
|
1313
1323
|
disabled: !D,
|
|
@@ -1316,8 +1326,8 @@ var J = {
|
|
|
1316
1326
|
})
|
|
1317
1327
|
})]
|
|
1318
1328
|
});
|
|
1319
|
-
},
|
|
1320
|
-
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } =
|
|
1329
|
+
}, zt = { modal: "_modal_kl0h0_1" }, Bt = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: l, responseFormatHint: u, responseFormatMarkdownLabel: d, responseFormatPlainTextLabel: f, systemPromptLabel: p, systemPromptTooltip: m, temperatureLabel: h, temperatureLabels: g, temperatureHint: _, saveLabel: y = "Apply changes", saveDisabledTooltip: b, backgroundClassName: x = zt.modal, colors: S }) => {
|
|
1330
|
+
let { responseFormat: C, systemPrompt: w, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Lt({
|
|
1321
1331
|
features: e,
|
|
1322
1332
|
initialResponseFormat: t,
|
|
1323
1333
|
initialSystemPrompt: n,
|
|
@@ -1325,17 +1335,17 @@ var J = {
|
|
|
1325
1335
|
onSave: i,
|
|
1326
1336
|
onClose: a
|
|
1327
1337
|
});
|
|
1328
|
-
return /* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ H(te, {
|
|
1329
1339
|
open: !0,
|
|
1330
1340
|
header: o,
|
|
1331
1341
|
titleClassName: s,
|
|
1332
|
-
size:
|
|
1342
|
+
size: L.Sm,
|
|
1333
1343
|
onClose: a,
|
|
1334
1344
|
className: x,
|
|
1335
1345
|
overlayStyle: c({ "--csm-bg": S?.background }),
|
|
1336
1346
|
mainButtons: [{
|
|
1337
1347
|
label: y,
|
|
1338
|
-
variant:
|
|
1348
|
+
variant: v.Primary,
|
|
1339
1349
|
onClick: A,
|
|
1340
1350
|
disabled: !E,
|
|
1341
1351
|
tooltipProps: b ? {
|
|
@@ -1343,7 +1353,7 @@ var J = {
|
|
|
1343
1353
|
hideTooltip: E
|
|
1344
1354
|
} : void 0
|
|
1345
1355
|
}],
|
|
1346
|
-
children: /* @__PURE__ */
|
|
1356
|
+
children: /* @__PURE__ */ H(Rt, {
|
|
1347
1357
|
features: e,
|
|
1348
1358
|
responseFormat: C,
|
|
1349
1359
|
systemPrompt: w,
|
|
@@ -1358,53 +1368,53 @@ var J = {
|
|
|
1358
1368
|
systemPromptLabel: p,
|
|
1359
1369
|
systemPromptTooltip: m,
|
|
1360
1370
|
temperatureLabel: h,
|
|
1361
|
-
temperatureLabels:
|
|
1362
|
-
temperatureHint:
|
|
1371
|
+
temperatureLabels: g,
|
|
1372
|
+
temperatureHint: _
|
|
1363
1373
|
})
|
|
1364
1374
|
});
|
|
1365
|
-
},
|
|
1375
|
+
}, Vt = {
|
|
1366
1376
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
1367
1377
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
1368
|
-
},
|
|
1369
|
-
let k =
|
|
1370
|
-
e && (P.current = 0), F(e), e || (
|
|
1371
|
-
}, []), re =
|
|
1372
|
-
|
|
1373
|
-
re.current !==
|
|
1378
|
+
}, Ht = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: a, menuCloseLabel: s, style: l, listClassName: u = "w-[240px]", isDisabled: f = !1, chatSettings: g, extraMenuItems: _, toolsMenuItems: v = [], onToolToggle: y, toolsMenuTitle: C = "Tools", toolsBackLabel: w = "Back", menuOverlays: T, getCaretPosition: D, colors: O }) => {
|
|
1379
|
+
let k = p(), A = m(), [j, N] = J(!1), P = q(0), [ee, F] = J(!1), [I, te] = J(!1), [L, R] = J(!1), [z, B] = J(null), ne = W((e) => {
|
|
1380
|
+
e && (P.current = 0), F(e), e || (R(!1), B(null));
|
|
1381
|
+
}, []), re = q(A);
|
|
1382
|
+
G(() => {
|
|
1383
|
+
re.current !== A && (re.current = A, A ? (N(ee && !L && z === null), F(!1)) : (P.current = L || z !== null ? -1 : 0, F(j || L || z !== null), N(!1)));
|
|
1374
1384
|
}, [
|
|
1375
|
-
|
|
1385
|
+
A,
|
|
1376
1386
|
ee,
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1387
|
+
j,
|
|
1388
|
+
L,
|
|
1389
|
+
z
|
|
1380
1390
|
]);
|
|
1381
|
-
let ie =
|
|
1391
|
+
let ie = K(() => c({
|
|
1382
1392
|
"--aab-tool-icon": O?.toolIcon,
|
|
1383
1393
|
"--aab-chevron-icon": O?.chevronIcon
|
|
1384
|
-
}), [O?.toolIcon, O?.chevronIcon]), ae =
|
|
1394
|
+
}), [O?.toolIcon, O?.chevronIcon]), ae = v.length > 0 && y != null, oe = K(() => v.map((e) => ({
|
|
1385
1395
|
key: e.id,
|
|
1386
1396
|
label: e.label,
|
|
1387
|
-
icon: /* @__PURE__ */
|
|
1397
|
+
icon: /* @__PURE__ */ H("span", {
|
|
1388
1398
|
style: ie,
|
|
1389
|
-
className:
|
|
1399
|
+
className: d("flex items-center", Vt.toolIcon),
|
|
1390
1400
|
children: e.icon
|
|
1391
1401
|
}),
|
|
1392
1402
|
selectable: !0,
|
|
1393
|
-
mark:
|
|
1403
|
+
mark: M.Check,
|
|
1394
1404
|
checked: e.isSelected,
|
|
1395
|
-
onClick: () =>
|
|
1405
|
+
onClick: () => y?.(e.id)
|
|
1396
1406
|
})), [
|
|
1397
|
-
|
|
1398
|
-
|
|
1407
|
+
v,
|
|
1408
|
+
y,
|
|
1399
1409
|
ie
|
|
1400
|
-
]), se =
|
|
1410
|
+
]), se = K(() => [
|
|
1401
1411
|
...e == null ? [] : [{
|
|
1402
1412
|
key: "attach",
|
|
1403
1413
|
label: r,
|
|
1404
|
-
icon: /* @__PURE__ */
|
|
1405
|
-
size:
|
|
1414
|
+
icon: /* @__PURE__ */ H(Se, {
|
|
1415
|
+
size: h,
|
|
1406
1416
|
"aria-hidden": !0,
|
|
1407
|
-
stroke:
|
|
1417
|
+
stroke: x
|
|
1408
1418
|
}),
|
|
1409
1419
|
onClick: e
|
|
1410
1420
|
}],
|
|
@@ -1412,45 +1422,45 @@ var J = {
|
|
|
1412
1422
|
...ae ? [{
|
|
1413
1423
|
key: "tools",
|
|
1414
1424
|
label: C,
|
|
1415
|
-
icon: /* @__PURE__ */
|
|
1416
|
-
size:
|
|
1425
|
+
icon: /* @__PURE__ */ H(Ee, {
|
|
1426
|
+
size: h,
|
|
1417
1427
|
"aria-hidden": !0,
|
|
1418
|
-
stroke:
|
|
1428
|
+
stroke: x
|
|
1419
1429
|
}),
|
|
1420
|
-
onClick:
|
|
1421
|
-
|
|
1430
|
+
onClick: A ? () => {
|
|
1431
|
+
R(!0);
|
|
1422
1432
|
} : () => void 0,
|
|
1423
|
-
...
|
|
1424
|
-
size:
|
|
1425
|
-
stroke:
|
|
1433
|
+
...A ? { iconAfter: /* @__PURE__ */ H(ye, {
|
|
1434
|
+
size: h,
|
|
1435
|
+
stroke: x,
|
|
1426
1436
|
style: ie,
|
|
1427
|
-
className:
|
|
1437
|
+
className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
|
|
1428
1438
|
"aria-hidden": !0
|
|
1429
1439
|
}) } : {
|
|
1430
1440
|
children: oe,
|
|
1431
|
-
subMenuOpen:
|
|
1441
|
+
subMenuOpen: L,
|
|
1432
1442
|
onSubMenuOpenChange: (e) => {
|
|
1433
|
-
|
|
1443
|
+
R(e), e && B(null);
|
|
1434
1444
|
}
|
|
1435
1445
|
}
|
|
1436
1446
|
}] : [],
|
|
1437
|
-
...(
|
|
1447
|
+
...(T ?? []).map((e) => ({
|
|
1438
1448
|
key: e.key,
|
|
1439
1449
|
label: e.title,
|
|
1440
1450
|
icon: e.icon,
|
|
1441
|
-
onClick:
|
|
1442
|
-
|
|
1451
|
+
onClick: A ? () => {
|
|
1452
|
+
B(e.key);
|
|
1443
1453
|
} : () => void 0,
|
|
1444
|
-
...
|
|
1445
|
-
size:
|
|
1446
|
-
stroke:
|
|
1454
|
+
...A ? { iconAfter: /* @__PURE__ */ H(ye, {
|
|
1455
|
+
size: h,
|
|
1456
|
+
stroke: x,
|
|
1447
1457
|
style: ie,
|
|
1448
|
-
className:
|
|
1458
|
+
className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
|
|
1449
1459
|
"aria-hidden": !0
|
|
1450
1460
|
}) } : {
|
|
1451
|
-
subMenuOpen:
|
|
1461
|
+
subMenuOpen: z === e.key,
|
|
1452
1462
|
onSubMenuOpenChange: (t) => {
|
|
1453
|
-
|
|
1463
|
+
B((n) => t ? e.key : n === e.key ? null : n), t && R(!1);
|
|
1454
1464
|
},
|
|
1455
1465
|
renderSubMenu: () => e.renderOverlay(() => ne(!1), D?.() ?? 0)
|
|
1456
1466
|
}
|
|
@@ -1458,10 +1468,10 @@ var J = {
|
|
|
1458
1468
|
...t == null ? [] : [{
|
|
1459
1469
|
key: "record-voice",
|
|
1460
1470
|
label: n,
|
|
1461
|
-
icon: /* @__PURE__ */
|
|
1462
|
-
size:
|
|
1471
|
+
icon: /* @__PURE__ */ H(xe, {
|
|
1472
|
+
size: h,
|
|
1463
1473
|
"aria-hidden": !0,
|
|
1464
|
-
stroke:
|
|
1474
|
+
stroke: x
|
|
1465
1475
|
}),
|
|
1466
1476
|
onClick: () => {
|
|
1467
1477
|
ne(!1), t();
|
|
@@ -1470,19 +1480,19 @@ var J = {
|
|
|
1470
1480
|
...g == null ? [] : [{
|
|
1471
1481
|
key: "chat-settings",
|
|
1472
1482
|
label: g.menuItemLabel ?? "Chat settings",
|
|
1473
|
-
icon: /* @__PURE__ */
|
|
1474
|
-
size:
|
|
1483
|
+
icon: /* @__PURE__ */ H(Te, {
|
|
1484
|
+
size: h,
|
|
1475
1485
|
"aria-hidden": !0,
|
|
1476
|
-
stroke:
|
|
1486
|
+
stroke: x
|
|
1477
1487
|
}),
|
|
1478
|
-
iconAfter: k ? /* @__PURE__ */
|
|
1479
|
-
size:
|
|
1480
|
-
stroke:
|
|
1488
|
+
iconAfter: k ? /* @__PURE__ */ H(ye, {
|
|
1489
|
+
size: h,
|
|
1490
|
+
stroke: x,
|
|
1481
1491
|
style: ie,
|
|
1482
|
-
className:
|
|
1492
|
+
className: d("rtl:scale-x-[-1]", Vt.chevronIcon),
|
|
1483
1493
|
"aria-hidden": !0
|
|
1484
1494
|
}) : null,
|
|
1485
|
-
onClick: () =>
|
|
1495
|
+
onClick: () => te(!0)
|
|
1486
1496
|
}]
|
|
1487
1497
|
], [
|
|
1488
1498
|
ne,
|
|
@@ -1493,101 +1503,101 @@ var J = {
|
|
|
1493
1503
|
g,
|
|
1494
1504
|
_,
|
|
1495
1505
|
k,
|
|
1496
|
-
|
|
1506
|
+
A,
|
|
1497
1507
|
ae,
|
|
1498
|
-
|
|
1499
|
-
|
|
1508
|
+
L,
|
|
1509
|
+
z,
|
|
1500
1510
|
C,
|
|
1501
1511
|
oe,
|
|
1502
|
-
|
|
1512
|
+
T,
|
|
1503
1513
|
D,
|
|
1504
1514
|
ie
|
|
1505
1515
|
]);
|
|
1506
1516
|
if (se.length === 0) return null;
|
|
1507
|
-
let ce = /* @__PURE__ */
|
|
1517
|
+
let ce = /* @__PURE__ */ H(S, {
|
|
1508
1518
|
matchReferenceWidth: !1,
|
|
1509
1519
|
placement: "bottom-start",
|
|
1510
|
-
listClassName:
|
|
1520
|
+
listClassName: u,
|
|
1511
1521
|
initialFocus: P.current,
|
|
1512
1522
|
overlayAriaLabel: i,
|
|
1513
1523
|
items: se,
|
|
1514
|
-
disabled:
|
|
1524
|
+
disabled: f,
|
|
1515
1525
|
open: ee,
|
|
1516
1526
|
onOpenChange: ne,
|
|
1517
|
-
children: /* @__PURE__ */
|
|
1518
|
-
icon: /* @__PURE__ */
|
|
1519
|
-
size:
|
|
1527
|
+
children: /* @__PURE__ */ H(E, {
|
|
1528
|
+
icon: /* @__PURE__ */ H(we, {
|
|
1529
|
+
size: b.LG,
|
|
1520
1530
|
"aria-hidden": !0,
|
|
1521
|
-
stroke:
|
|
1531
|
+
stroke: x
|
|
1522
1532
|
}),
|
|
1523
1533
|
"aria-label": i,
|
|
1524
1534
|
"aria-haspopup": "menu",
|
|
1525
1535
|
tooltipProps: { tooltip: i },
|
|
1526
|
-
disabled:
|
|
1536
|
+
disabled: f
|
|
1527
1537
|
})
|
|
1528
1538
|
});
|
|
1529
|
-
return /* @__PURE__ */
|
|
1530
|
-
|
|
1531
|
-
/* @__PURE__ */
|
|
1532
|
-
icon: /* @__PURE__ */
|
|
1533
|
-
size:
|
|
1539
|
+
return /* @__PURE__ */ U(V, { children: [
|
|
1540
|
+
A ? /* @__PURE__ */ U(V, { children: [
|
|
1541
|
+
/* @__PURE__ */ H(E, {
|
|
1542
|
+
icon: /* @__PURE__ */ H(we, {
|
|
1543
|
+
size: b.LG,
|
|
1534
1544
|
"aria-hidden": !0,
|
|
1535
|
-
stroke:
|
|
1545
|
+
stroke: x
|
|
1536
1546
|
}),
|
|
1537
1547
|
"aria-label": i,
|
|
1538
1548
|
tooltipProps: { tooltip: i },
|
|
1539
|
-
disabled:
|
|
1549
|
+
disabled: f,
|
|
1540
1550
|
onClick: () => N(!0)
|
|
1541
1551
|
}),
|
|
1542
|
-
/* @__PURE__ */
|
|
1543
|
-
isOpen:
|
|
1552
|
+
/* @__PURE__ */ H(It, {
|
|
1553
|
+
isOpen: j,
|
|
1544
1554
|
title: a,
|
|
1545
1555
|
closeLabel: s,
|
|
1546
1556
|
onClose: () => N(!1),
|
|
1547
|
-
style:
|
|
1557
|
+
style: l,
|
|
1548
1558
|
items: se,
|
|
1549
1559
|
className: "pb-4",
|
|
1550
1560
|
btnTextClassName: "flex-1"
|
|
1551
1561
|
}),
|
|
1552
|
-
ae && /* @__PURE__ */
|
|
1553
|
-
isOpen:
|
|
1562
|
+
ae && /* @__PURE__ */ H(ot, {
|
|
1563
|
+
isOpen: L,
|
|
1554
1564
|
onBack: () => {
|
|
1555
|
-
|
|
1565
|
+
R(!1), N(!0);
|
|
1556
1566
|
},
|
|
1557
|
-
backLabel:
|
|
1567
|
+
backLabel: w,
|
|
1558
1568
|
onClose: () => ne(!1),
|
|
1559
1569
|
closeLabel: s,
|
|
1560
|
-
style:
|
|
1570
|
+
style: l,
|
|
1561
1571
|
title: C,
|
|
1562
|
-
items:
|
|
1563
|
-
onToolToggle:
|
|
1572
|
+
items: v,
|
|
1573
|
+
onToolToggle: y
|
|
1564
1574
|
}),
|
|
1565
|
-
|
|
1566
|
-
isOpen:
|
|
1575
|
+
T?.map((e) => /* @__PURE__ */ H(Le, {
|
|
1576
|
+
isOpen: z === e.key,
|
|
1567
1577
|
title: e.title,
|
|
1568
1578
|
closeLabel: s,
|
|
1569
1579
|
onBack: () => {
|
|
1570
|
-
|
|
1580
|
+
B(null), N(!0);
|
|
1571
1581
|
},
|
|
1572
1582
|
backLabel: e.backLabel ?? "Back",
|
|
1573
1583
|
onClose: () => ne(!1),
|
|
1574
|
-
style:
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1584
|
+
style: l,
|
|
1585
|
+
children: /* @__PURE__ */ H("div", {
|
|
1576
1586
|
role: "menu",
|
|
1577
1587
|
"aria-label": e.title,
|
|
1578
1588
|
children: e.renderOverlay(() => ne(!1), D?.() ?? 0)
|
|
1579
1589
|
})
|
|
1580
1590
|
}, e.key))
|
|
1581
|
-
] }) : /* @__PURE__ */ V
|
|
1582
|
-
k && g != null && /* @__PURE__ */
|
|
1591
|
+
] }) : /* @__PURE__ */ H(V, { children: ce }),
|
|
1592
|
+
k && g != null && /* @__PURE__ */ H($, {
|
|
1583
1593
|
isOpen: I,
|
|
1584
1594
|
onBack: () => {
|
|
1585
|
-
|
|
1595
|
+
te(!1), A ? N(!0) : F(!0);
|
|
1586
1596
|
},
|
|
1587
1597
|
backLabel: g.backLabel ?? "Back",
|
|
1588
|
-
onClose: () =>
|
|
1598
|
+
onClose: () => te(!1),
|
|
1589
1599
|
closeLabel: s,
|
|
1590
|
-
style:
|
|
1600
|
+
style: l,
|
|
1591
1601
|
features: g.features,
|
|
1592
1602
|
initialResponseFormat: g.responseFormat ?? o.Markdown,
|
|
1593
1603
|
initialSystemPrompt: g.systemPrompt,
|
|
@@ -1606,13 +1616,13 @@ var J = {
|
|
|
1606
1616
|
saveLabel: g.saveLabel,
|
|
1607
1617
|
saveDisabledTooltip: g.saveDisabledTooltip
|
|
1608
1618
|
}),
|
|
1609
|
-
!k && g != null && I && /* @__PURE__ */
|
|
1619
|
+
!k && g != null && I && /* @__PURE__ */ H(Bt, {
|
|
1610
1620
|
features: g.features,
|
|
1611
1621
|
initialResponseFormat: g.responseFormat ?? o.Markdown,
|
|
1612
1622
|
initialSystemPrompt: g.systemPrompt,
|
|
1613
1623
|
initialTemperature: g.temperature,
|
|
1614
1624
|
onSave: g.onSave,
|
|
1615
|
-
onClose: () =>
|
|
1625
|
+
onClose: () => te(!1),
|
|
1616
1626
|
title: g.title,
|
|
1617
1627
|
responseFormatLabel: g.responseFormatLabel,
|
|
1618
1628
|
responseFormatHint: g.responseFormatHint,
|
|
@@ -1628,20 +1638,20 @@ var J = {
|
|
|
1628
1638
|
colors: g.modalColors
|
|
1629
1639
|
})
|
|
1630
1640
|
] });
|
|
1631
|
-
},
|
|
1632
|
-
let O =
|
|
1641
|
+
}, Ut = ({ fileInputRef: e, textareaRef: t, message: n, style: r, hideAttachFile: i, isInputDisabled: a, isStreaming: o, isAttachmentsEnabled: s, isVoiceRecordingSupported: c, isVoiceActive: l, startRecording: u, isPhone: d, canRemoveTools: f, toolsMenuItems: p, onToolToggle: m, chatSettings: g, menuOverlays: _, onDialFileSystemClick: v, dialFileSystemLabel: y, attachLabel: b, addMenuTitle: S, menuTitle: C, menuCloseLabel: w, recordVoiceLabel: T, toolsMenuTitle: E, toolsBackLabel: D }) => {
|
|
1642
|
+
let O = K(() => v ? [{
|
|
1633
1643
|
key: "dial-fs",
|
|
1634
|
-
label:
|
|
1635
|
-
icon: /* @__PURE__ */
|
|
1636
|
-
size:
|
|
1644
|
+
label: y ?? "DIAL file system",
|
|
1645
|
+
icon: /* @__PURE__ */ H(be, {
|
|
1646
|
+
size: h,
|
|
1637
1647
|
"aria-hidden": !0,
|
|
1638
|
-
stroke:
|
|
1648
|
+
stroke: x
|
|
1639
1649
|
}),
|
|
1640
1650
|
onClick: v
|
|
1641
|
-
}] : [], [v,
|
|
1642
|
-
return /* @__PURE__ */
|
|
1651
|
+
}] : [], [v, y]);
|
|
1652
|
+
return /* @__PURE__ */ H(Ht, {
|
|
1643
1653
|
onAttachClick: i ? void 0 : () => e.current?.click(),
|
|
1644
|
-
attachLabel:
|
|
1654
|
+
attachLabel: b,
|
|
1645
1655
|
addMenuTitle: S,
|
|
1646
1656
|
menuTitle: C,
|
|
1647
1657
|
menuCloseLabel: w,
|
|
@@ -1649,23 +1659,23 @@ var J = {
|
|
|
1649
1659
|
isDisabled: a || l,
|
|
1650
1660
|
chatSettings: g,
|
|
1651
1661
|
extraMenuItems: O,
|
|
1652
|
-
onRecordVoice: c && s && !o && !l ? () => u(
|
|
1662
|
+
onRecordVoice: c && s && !o && !l ? () => u(Ze.Attachment) : void 0,
|
|
1653
1663
|
recordVoiceLabel: T,
|
|
1654
|
-
toolsMenuItems: f || d ?
|
|
1655
|
-
onToolToggle:
|
|
1664
|
+
toolsMenuItems: f || d ? p : void 0,
|
|
1665
|
+
onToolToggle: m,
|
|
1656
1666
|
toolsMenuTitle: E,
|
|
1657
1667
|
toolsBackLabel: D,
|
|
1658
1668
|
menuOverlays: _,
|
|
1659
1669
|
getCaretPosition: () => t.current?.selectionStart ?? n.length
|
|
1660
1670
|
});
|
|
1661
|
-
},
|
|
1671
|
+
}, Wt = ({ textarea: e, textareaRef: t, commandMenu: n, caretAnchor: r, fontClassName: i, isMenuOpen: a, query: o, activeWordStart: s, listboxId: c, activeOptionId: l, overlayRef: u, onOutsidePress: f, onClose: p }) => /* @__PURE__ */ U(V, { children: [e, n != null && /* @__PURE__ */ H("div", {
|
|
1662
1672
|
"aria-hidden": !0,
|
|
1663
|
-
className:
|
|
1673
|
+
className: d("pointer-events-none absolute", i || "dial-body-paragraph-text"),
|
|
1664
1674
|
style: {
|
|
1665
1675
|
left: r?.left ?? 0,
|
|
1666
1676
|
top: r?.top ?? 0
|
|
1667
1677
|
},
|
|
1668
|
-
children: /* @__PURE__ */
|
|
1678
|
+
children: /* @__PURE__ */ H(S, {
|
|
1669
1679
|
open: a,
|
|
1670
1680
|
onOpenChange: (e) => {
|
|
1671
1681
|
e || f();
|
|
@@ -1673,13 +1683,15 @@ var J = {
|
|
|
1673
1683
|
placement: "top-start",
|
|
1674
1684
|
trigger: [],
|
|
1675
1685
|
initialFocus: -1,
|
|
1676
|
-
overlayRole:
|
|
1686
|
+
overlayRole: C.None,
|
|
1677
1687
|
matchReferenceWidth: !1,
|
|
1688
|
+
listClassName: "flex flex-col overflow-hidden",
|
|
1678
1689
|
outsidePressIgnoreRef: t,
|
|
1679
1690
|
renderOverlay: () => {
|
|
1680
1691
|
let e = n.menuLabel != null;
|
|
1681
|
-
return /* @__PURE__ */
|
|
1682
|
-
ref:
|
|
1692
|
+
return /* @__PURE__ */ H("div", {
|
|
1693
|
+
ref: u,
|
|
1694
|
+
className: "flex min-h-0 flex-col",
|
|
1683
1695
|
role: e ? "group" : void 0,
|
|
1684
1696
|
"aria-label": n.menuLabel,
|
|
1685
1697
|
children: n.renderMenu({
|
|
@@ -1687,24 +1699,24 @@ var J = {
|
|
|
1687
1699
|
caretPosition: s ?? 0,
|
|
1688
1700
|
close: p,
|
|
1689
1701
|
listboxId: c,
|
|
1690
|
-
activeOptionId:
|
|
1702
|
+
activeOptionId: l
|
|
1691
1703
|
})
|
|
1692
1704
|
});
|
|
1693
1705
|
},
|
|
1694
|
-
children: /* @__PURE__ */
|
|
1706
|
+
children: /* @__PURE__ */ H("span", {
|
|
1695
1707
|
"aria-hidden": !0,
|
|
1696
1708
|
className: "inline-block h-lh w-0"
|
|
1697
1709
|
})
|
|
1698
1710
|
})
|
|
1699
|
-
})] }),
|
|
1711
|
+
})] }), Gt = ({ areaRef: e, mirrorRef: t, isMirrorActive: n, fontClassName: r, message: i, mentionRanges: a, mirrorInsertions: o, selectionRects: s, children: c }) => /* @__PURE__ */ U("div", {
|
|
1700
1712
|
ref: e,
|
|
1701
1713
|
className: "relative -ms-1 -me-1 w-[calc(100%+8px)]",
|
|
1702
|
-
children: [n && /* @__PURE__ */
|
|
1714
|
+
children: [n && /* @__PURE__ */ U("div", {
|
|
1703
1715
|
ref: t,
|
|
1704
|
-
className:
|
|
1705
|
-
children: [
|
|
1716
|
+
className: d(Z.textarea, r || "dial-body-paragraph-text", "pointer-events-none absolute inset-0 z-10 max-h-[272px] w-full overflow-hidden ps-1 pe-1 wrap-anywhere whitespace-pre-wrap"),
|
|
1717
|
+
children: [vt(i, a, o, Z.mentionHighlight, Z.mentionHighlightUnsupported), s.map((e, t) => /* @__PURE__ */ H("div", {
|
|
1706
1718
|
"aria-hidden": !0,
|
|
1707
|
-
className:
|
|
1719
|
+
className: d("pointer-events-none absolute rounded-sm", Z.selectionHighlight),
|
|
1708
1720
|
style: {
|
|
1709
1721
|
left: e.left,
|
|
1710
1722
|
top: e.top,
|
|
@@ -1713,54 +1725,49 @@ var J = {
|
|
|
1713
1725
|
}
|
|
1714
1726
|
}, `selection-${t}`))]
|
|
1715
1727
|
}), c]
|
|
1716
|
-
}),
|
|
1717
|
-
variant:
|
|
1728
|
+
}), Kt = ({ size: e = 20 }) => /* @__PURE__ */ H(ie, {
|
|
1729
|
+
variant: ae.Circular,
|
|
1718
1730
|
width: e,
|
|
1719
1731
|
height: e,
|
|
1720
1732
|
active: !0
|
|
1721
|
-
}),
|
|
1733
|
+
}), qt = ({ loadingLabel: e }) => /* @__PURE__ */ U("span", {
|
|
1722
1734
|
className: "flex min-w-0 flex-1 items-center",
|
|
1723
|
-
children: [/* @__PURE__ */
|
|
1724
|
-
variant:
|
|
1735
|
+
children: [/* @__PURE__ */ H(ie, {
|
|
1736
|
+
variant: ae.Text,
|
|
1725
1737
|
width: "100%",
|
|
1726
1738
|
height: 16,
|
|
1727
1739
|
active: !0
|
|
1728
|
-
}), e && /* @__PURE__ */
|
|
1740
|
+
}), e && /* @__PURE__ */ H("span", {
|
|
1729
1741
|
className: "sr-only",
|
|
1730
1742
|
children: e
|
|
1731
1743
|
})]
|
|
1732
|
-
}),
|
|
1744
|
+
}), Jt = () => /* @__PURE__ */ H("div", {
|
|
1733
1745
|
"aria-hidden": "true",
|
|
1734
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1746
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ U("div", {
|
|
1735
1747
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1736
|
-
children: [/* @__PURE__ */
|
|
1748
|
+
children: [/* @__PURE__ */ H(Kt, {}), /* @__PURE__ */ H(qt, {})]
|
|
1737
1749
|
}, t))
|
|
1738
|
-
}),
|
|
1750
|
+
}), Yt = (e) => e.displayName ?? e.id, Xt = (e, t) => {
|
|
1739
1751
|
let n = t.trim().toLowerCase();
|
|
1740
|
-
return n ? e.filter((e) =>
|
|
1741
|
-
},
|
|
1752
|
+
return n ? e.filter((e) => Yt(e).toLowerCase().includes(n)) : e;
|
|
1753
|
+
}, Zt = (e, t, r, i = 18, a) => /* @__PURE__ */ H(n, {
|
|
1742
1754
|
src: e,
|
|
1743
1755
|
size: i,
|
|
1744
1756
|
labels: { tooltip: a },
|
|
1745
1757
|
initialsName: r
|
|
1746
|
-
}),
|
|
1758
|
+
}), Qt = {
|
|
1747
1759
|
searchHeader: "_searchHeader_1u7db_1",
|
|
1748
1760
|
itemText: "_itemText_1u7db_13",
|
|
1749
1761
|
itemHover: "_itemHover_1u7db_17",
|
|
1750
1762
|
selectedItemBackground: "_selectedItemBackground_1u7db_22",
|
|
1751
1763
|
selectedItemText: "_selectedItemText_1u7db_26",
|
|
1752
1764
|
checkIcon: "_checkIcon_1u7db_30"
|
|
1753
|
-
},
|
|
1754
|
-
let [a, o] =
|
|
1755
|
-
|
|
1756
|
-
s,
|
|
1757
|
-
d,
|
|
1758
|
-
r?.unavailableTooltip
|
|
1759
|
-
]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", g = G(() => {
|
|
1760
|
-
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
1765
|
+
}, $t = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, styles: i }) => {
|
|
1766
|
+
let [a, o] = J(""), s = K(() => e?.find((e) => e.id === t), [e, t]), l = r?.loading !== void 0, u = !l && !s && !!t, f = K(() => l ? /* @__PURE__ */ H(Kt, { size: b.LG }) : Zt(s?.iconUrl, s?.type, s?.displayName ?? s?.id ?? "", b.LG), [l, s]), p = s?.displayName ?? s?.id, m = s?.displayVersion, h = u ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0, g = p ? `${r?.ariaLabel ?? "Select model"}: ${p}` : r?.ariaLabel ?? "Select model", _ = K(() => {
|
|
1767
|
+
if (l) return Array.from({ length: 7 }, (e, t) => ({
|
|
1761
1768
|
key: `__loading-${t}`,
|
|
1762
|
-
icon: /* @__PURE__ */
|
|
1763
|
-
label: /* @__PURE__ */
|
|
1769
|
+
icon: /* @__PURE__ */ H(Kt, {}),
|
|
1770
|
+
label: /* @__PURE__ */ H(qt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1764
1771
|
disabled: !0
|
|
1765
1772
|
}));
|
|
1766
1773
|
if (!e || e.length === 0) {
|
|
@@ -1772,25 +1779,25 @@ var J = {
|
|
|
1772
1779
|
}] : [];
|
|
1773
1780
|
}
|
|
1774
1781
|
let o = i?.colors;
|
|
1775
|
-
return
|
|
1782
|
+
return Xt(e, a).map((e) => {
|
|
1776
1783
|
let r = e.id === t;
|
|
1777
1784
|
return {
|
|
1778
1785
|
key: e.id,
|
|
1779
|
-
label: /* @__PURE__ */
|
|
1780
|
-
text:
|
|
1786
|
+
label: /* @__PURE__ */ H(D, {
|
|
1787
|
+
text: Yt(e),
|
|
1781
1788
|
query: a,
|
|
1782
1789
|
maxLines: 1
|
|
1783
1790
|
}),
|
|
1784
|
-
icon:
|
|
1785
|
-
mark:
|
|
1791
|
+
icon: Zt(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1792
|
+
mark: M.Check,
|
|
1786
1793
|
checked: r,
|
|
1787
|
-
className:
|
|
1794
|
+
className: d(o?.itemText && Qt.itemText, o?.itemHoverBackground && Qt.itemHover, r && o?.selectedItemBackground && Qt.selectedItemBackground, r && o?.selectedItemText && Qt.selectedItemText, r && o?.checkIcon && Qt.checkIcon, i?.itemClassName, r && i?.selectedItemClassName, Y.modelMenuItem, r && Y.modelMenuItemSelected),
|
|
1788
1795
|
onClick: () => n?.(e.id)
|
|
1789
1796
|
};
|
|
1790
1797
|
});
|
|
1791
1798
|
}, [
|
|
1792
1799
|
e,
|
|
1793
|
-
|
|
1800
|
+
l,
|
|
1794
1801
|
a,
|
|
1795
1802
|
t,
|
|
1796
1803
|
r,
|
|
@@ -1798,7 +1805,7 @@ var J = {
|
|
|
1798
1805
|
i?.itemClassName,
|
|
1799
1806
|
i?.selectedItemClassName,
|
|
1800
1807
|
i?.colors
|
|
1801
|
-
]),
|
|
1808
|
+
]), v = K(() => c({
|
|
1802
1809
|
"--ms-item-text": i?.colors?.itemText,
|
|
1803
1810
|
"--ms-item-hover-bg": i?.colors?.itemHoverBackground,
|
|
1804
1811
|
"--ms-selected-item-bg": i?.colors?.selectedItemBackground,
|
|
@@ -1809,35 +1816,36 @@ var J = {
|
|
|
1809
1816
|
searchQuery: a,
|
|
1810
1817
|
onSearchQueryChange: o,
|
|
1811
1818
|
selectorIcon: f,
|
|
1812
|
-
selectorAriaLabel:
|
|
1819
|
+
selectorAriaLabel: g,
|
|
1820
|
+
unavailableTooltip: h,
|
|
1813
1821
|
selectedLabel: p,
|
|
1814
1822
|
selectedVersion: m,
|
|
1815
|
-
menuItems:
|
|
1816
|
-
menuHeader:
|
|
1823
|
+
menuItems: _,
|
|
1824
|
+
menuHeader: K(() => !l && e && e.length > 0 ? /* @__PURE__ */ H("div", {
|
|
1817
1825
|
style: c({ "--ms-search-header-bg": i?.colors?.searchHeaderBackground }),
|
|
1818
|
-
className:
|
|
1819
|
-
children: /* @__PURE__ */
|
|
1826
|
+
className: d("sticky top-0 z-10 pe-2 pt-2 pb-1", Qt.searchHeader, i?.searchHeaderClassName, Y.modelMenuSearch),
|
|
1827
|
+
children: /* @__PURE__ */ H(re, {
|
|
1820
1828
|
value: a,
|
|
1821
1829
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1822
|
-
size:
|
|
1830
|
+
size: w.Small,
|
|
1823
1831
|
wrapperClassName: "border-0",
|
|
1824
1832
|
onChange: (e) => o(e ?? "")
|
|
1825
1833
|
})
|
|
1826
1834
|
}) : void 0, [
|
|
1827
1835
|
e,
|
|
1828
|
-
|
|
1836
|
+
l,
|
|
1829
1837
|
a,
|
|
1830
1838
|
r,
|
|
1831
1839
|
i?.searchHeaderClassName,
|
|
1832
1840
|
i?.colors?.searchHeaderBackground
|
|
1833
1841
|
]),
|
|
1834
|
-
menuStyle:
|
|
1842
|
+
menuStyle: v,
|
|
1835
1843
|
onOpenChange: (e) => {
|
|
1836
1844
|
e || o("");
|
|
1837
1845
|
}
|
|
1838
1846
|
};
|
|
1839
|
-
},
|
|
1840
|
-
function
|
|
1847
|
+
}, en = typeof window < "u" ? Pe : G;
|
|
1848
|
+
function tn(e) {
|
|
1841
1849
|
let t = e;
|
|
1842
1850
|
for (; t;) {
|
|
1843
1851
|
if (t.dir) return t.dir === "rtl";
|
|
@@ -1845,35 +1853,35 @@ function Xt(e) {
|
|
|
1845
1853
|
}
|
|
1846
1854
|
return !1;
|
|
1847
1855
|
}
|
|
1848
|
-
function
|
|
1856
|
+
function nn() {
|
|
1849
1857
|
return () => {};
|
|
1850
1858
|
}
|
|
1851
|
-
function
|
|
1852
|
-
return
|
|
1859
|
+
function rn() {
|
|
1860
|
+
return Fe(nn, () => !1, () => !0);
|
|
1853
1861
|
}
|
|
1854
|
-
function
|
|
1862
|
+
function an(e) {
|
|
1855
1863
|
return e?.ownerDocument.defaultView ?? window;
|
|
1856
1864
|
}
|
|
1857
|
-
function
|
|
1858
|
-
return
|
|
1865
|
+
function on(e) {
|
|
1866
|
+
return an(e).ResizeObserver ?? (typeof ResizeObserver < "u" ? ResizeObserver : void 0);
|
|
1859
1867
|
}
|
|
1860
|
-
function
|
|
1868
|
+
function sn(e) {
|
|
1861
1869
|
if (e !== void 0) switch (typeof e) {
|
|
1862
1870
|
case "number": return e;
|
|
1863
1871
|
case "string": if (e.endsWith("px")) return parseFloat(e);
|
|
1864
1872
|
}
|
|
1865
1873
|
}
|
|
1866
|
-
function
|
|
1867
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1868
|
-
styleHeight:
|
|
1869
|
-
styleWidth:
|
|
1870
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1874
|
+
function cn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1875
|
+
let { styleHeight: s, styleWidth: c } = K(() => ({
|
|
1876
|
+
styleHeight: sn(o?.height),
|
|
1877
|
+
styleWidth: sn(o?.width)
|
|
1878
|
+
}), [o?.height, o?.width]), [l, u] = J({
|
|
1871
1879
|
height: t,
|
|
1872
1880
|
width: n
|
|
1873
1881
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1874
|
-
return
|
|
1882
|
+
return en(() => {
|
|
1875
1883
|
if (i === null || d) return;
|
|
1876
|
-
let t =
|
|
1884
|
+
let t = on(i);
|
|
1877
1885
|
if (!t) return;
|
|
1878
1886
|
let n = new t((e) => {
|
|
1879
1887
|
for (let t of e) {
|
|
@@ -1893,7 +1901,7 @@ function nn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1893
1901
|
i,
|
|
1894
1902
|
s,
|
|
1895
1903
|
c
|
|
1896
|
-
]),
|
|
1904
|
+
]), K(() => ({
|
|
1897
1905
|
height: s ?? l.height,
|
|
1898
1906
|
width: c ?? l.width
|
|
1899
1907
|
}), [
|
|
@@ -1902,27 +1910,27 @@ function nn({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1902
1910
|
c
|
|
1903
1911
|
]);
|
|
1904
1912
|
}
|
|
1905
|
-
function
|
|
1906
|
-
let t =
|
|
1913
|
+
function ln(e) {
|
|
1914
|
+
let t = q(() => {
|
|
1907
1915
|
throw Error("Cannot call an event handler while rendering.");
|
|
1908
1916
|
});
|
|
1909
|
-
return
|
|
1917
|
+
return en(() => {
|
|
1910
1918
|
t.current = e;
|
|
1911
|
-
}, [e]),
|
|
1919
|
+
}, [e]), W((...e) => t.current?.(...e), [t]);
|
|
1912
1920
|
}
|
|
1913
|
-
var
|
|
1914
|
-
function
|
|
1915
|
-
let n =
|
|
1921
|
+
var un = /* @__PURE__ */ new WeakMap();
|
|
1922
|
+
function dn(e = !1, t = document) {
|
|
1923
|
+
let n = un.get(t);
|
|
1916
1924
|
if (n === void 0 || e) {
|
|
1917
1925
|
let e = t.createElement("div"), r = e.style;
|
|
1918
1926
|
r.width = "50px", r.height = "50px", r.overflow = "scroll", r.direction = "rtl";
|
|
1919
1927
|
let i = t.createElement("div"), a = i.style;
|
|
1920
|
-
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e),
|
|
1928
|
+
a.width = "100px", a.height = "100px", e.appendChild(i), t.body.appendChild(e), e.scrollLeft > 0 ? n = "positive-descending" : (e.scrollLeft = 1, n = e.scrollLeft === 0 ? "negative" : "positive-ascending"), t.body.removeChild(e), un.set(t, n);
|
|
1921
1929
|
}
|
|
1922
1930
|
return n;
|
|
1923
1931
|
}
|
|
1924
|
-
function
|
|
1925
|
-
if (t === "horizontal" && n) switch (
|
|
1932
|
+
function fn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1933
|
+
if (t === "horizontal" && n) switch (dn(!1, e?.ownerDocument ?? document)) {
|
|
1926
1934
|
case "negative": return -r;
|
|
1927
1935
|
case "positive-descending": if (e) {
|
|
1928
1936
|
let { clientWidth: t, scrollWidth: n } = e;
|
|
@@ -1931,8 +1939,8 @@ function sn({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1931
1939
|
}
|
|
1932
1940
|
return r;
|
|
1933
1941
|
}
|
|
1934
|
-
function
|
|
1935
|
-
let r =
|
|
1942
|
+
function pn({ container: e, element: t, onChange: n }) {
|
|
1943
|
+
let r = an(t), i = on(t), a = r.MutationObserver ?? (typeof MutationObserver < "u" ? MutationObserver : void 0), o = i ? new i(n) : void 0, s = (e) => !e.isConnected || (e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0, c = a ? new a((e) => {
|
|
1936
1944
|
e.some((e) => Array.from(e.addedNodes).some(s) || e.removedNodes.length > 0 && e.nextSibling !== null && s(e.nextSibling)) && (u(), n());
|
|
1937
1945
|
}) : void 0, l = /* @__PURE__ */ new Set(), u = () => {
|
|
1938
1946
|
for (let e of l) o?.unobserve(e);
|
|
@@ -1949,33 +1957,33 @@ function cn({ container: e, element: t, onChange: n }) {
|
|
|
1949
1957
|
o?.disconnect(), c?.disconnect();
|
|
1950
1958
|
};
|
|
1951
1959
|
}
|
|
1952
|
-
function
|
|
1960
|
+
function mn(e) {
|
|
1953
1961
|
return e.window === e;
|
|
1954
1962
|
}
|
|
1955
|
-
function
|
|
1956
|
-
return t === "window" ? e ?
|
|
1963
|
+
function hn(e, t) {
|
|
1964
|
+
return t === "window" ? e ? an(e) : null : t ?? null;
|
|
1957
1965
|
}
|
|
1958
|
-
function
|
|
1959
|
-
return
|
|
1966
|
+
function gn(e, t) {
|
|
1967
|
+
return mn(e) ? t === "vertical" ? e.scrollY : e.scrollX : t === "vertical" ? e.scrollTop : e.scrollLeft;
|
|
1960
1968
|
}
|
|
1961
|
-
function
|
|
1962
|
-
let n =
|
|
1969
|
+
function _n(e, t) {
|
|
1970
|
+
let n = mn(e) ? e.document.scrollingElement ?? e.document.documentElement : e;
|
|
1963
1971
|
return t === "vertical" ? n.scrollHeight - n.clientHeight : n.scrollWidth - n.clientWidth;
|
|
1964
1972
|
}
|
|
1965
|
-
function
|
|
1966
|
-
let { overflowX: n, overflowY: r } =
|
|
1973
|
+
function vn(e, t) {
|
|
1974
|
+
let { overflowX: n, overflowY: r } = an(e).getComputedStyle(e), i = t === "vertical" ? r : n;
|
|
1967
1975
|
return i === "visible" || i === "clip" ? !1 : t === "vertical" ? e.scrollHeight - e.clientHeight > 1 : e.scrollWidth - e.clientWidth > 1;
|
|
1968
1976
|
}
|
|
1969
|
-
function
|
|
1977
|
+
function yn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
1970
1978
|
let i = t === "vertical", a, o;
|
|
1971
|
-
if (
|
|
1979
|
+
if (mn(r)) {
|
|
1972
1980
|
let { documentElement: e } = r.document;
|
|
1973
1981
|
a = 0, o = i ? e.clientHeight : e.clientWidth;
|
|
1974
1982
|
} else {
|
|
1975
1983
|
let e = r.getBoundingClientRect();
|
|
1976
1984
|
a = i ? e.top + r.clientTop : e.left + r.clientLeft, o = i ? r.clientHeight : r.clientWidth;
|
|
1977
1985
|
}
|
|
1978
|
-
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f =
|
|
1986
|
+
let s = a + o, c = e.getBoundingClientRect(), l = i ? c.top + e.clientTop : c.left + e.clientLeft, u = i ? e.clientHeight : e.clientWidth, d = l + u, f = fn({
|
|
1979
1987
|
containerElement: e,
|
|
1980
1988
|
direction: t,
|
|
1981
1989
|
isRtl: n,
|
|
@@ -1988,8 +1996,8 @@ function mn({ containerElement: e, direction: t, isRtl: n, scrollTarget: r }) {
|
|
|
1988
1996
|
viewportSize: o
|
|
1989
1997
|
};
|
|
1990
1998
|
}
|
|
1991
|
-
function
|
|
1992
|
-
let i =
|
|
1999
|
+
function bn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
2000
|
+
let i = mn(n) ? n.document.documentElement : n, a = an(i).getComputedStyle(i), o = (e) => {
|
|
1993
2001
|
let t = parseFloat(e ?? "");
|
|
1994
2002
|
return !Number.isFinite(t) || t < 0 ? 0 : e.endsWith("px") ? t : e.endsWith("%") ? t * r / 100 : 0;
|
|
1995
2003
|
};
|
|
@@ -2006,26 +2014,26 @@ function hn({ direction: e, isRtl: t, scrollTarget: n, viewportSize: r }) {
|
|
|
2006
2014
|
start: s
|
|
2007
2015
|
};
|
|
2008
2016
|
}
|
|
2009
|
-
function
|
|
2017
|
+
function xn(e, t = "Assertion error") {
|
|
2010
2018
|
if (!e) throw console.error(t), Error(t);
|
|
2011
2019
|
}
|
|
2012
|
-
function
|
|
2020
|
+
function Sn(e, t) {
|
|
2013
2021
|
if (e === t) return !0;
|
|
2014
|
-
if (!!e != !!t || (
|
|
2022
|
+
if (!!e != !!t || (xn(e !== void 0), xn(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
2015
2023
|
for (let n in e) if (!Object.hasOwn(t, n) || !Object.is(t[n], e[n])) return !1;
|
|
2016
2024
|
return !0;
|
|
2017
2025
|
}
|
|
2018
|
-
function
|
|
2026
|
+
function Cn({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
2019
2027
|
if (t === 0) return 0;
|
|
2020
2028
|
if (typeof n == "number") return t * n;
|
|
2021
2029
|
{
|
|
2022
2030
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
2023
|
-
return
|
|
2031
|
+
return xn(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
2024
2032
|
}
|
|
2025
2033
|
}
|
|
2026
|
-
function
|
|
2034
|
+
function wn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i, itemSize: a, containerScrollOffset: o, containerSize: s }) {
|
|
2027
2035
|
if (r < 0 || r >= i) throw RangeError(`Invalid index specified: ${r}`, { cause: `Index ${r} is not within the range of 0 - ${i - 1}` });
|
|
2028
|
-
let c = t.get(r), l =
|
|
2036
|
+
let c = t.get(r), l = Cn({
|
|
2029
2037
|
cachedBounds: t,
|
|
2030
2038
|
itemCount: i,
|
|
2031
2039
|
itemSize: a
|
|
@@ -2037,7 +2045,7 @@ function yn({ align: e, cachedBounds: t, clamp: n = !0, index: r, itemCount: i,
|
|
|
2037
2045
|
default: return p ? o : o < f ? f : d;
|
|
2038
2046
|
}
|
|
2039
2047
|
}
|
|
2040
|
-
function
|
|
2048
|
+
function Tn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
2041
2049
|
let a = r - 1;
|
|
2042
2050
|
if (r === 0) return {
|
|
2043
2051
|
startIndexVisible: 0,
|
|
@@ -2071,12 +2079,12 @@ function bn({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
2071
2079
|
stopIndexOverscan: Math.min(a, s + i)
|
|
2072
2080
|
};
|
|
2073
2081
|
}
|
|
2074
|
-
function
|
|
2082
|
+
function En({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
2075
2083
|
let r = /* @__PURE__ */ new Map();
|
|
2076
2084
|
return {
|
|
2077
2085
|
itemSize: typeof n == "number" ? n : void 0,
|
|
2078
2086
|
get(i) {
|
|
2079
|
-
if (
|
|
2087
|
+
if (xn(i < e, `Invalid index ${i}`), typeof n == "number") return xn(i >= 0, `Invalid index ${i}`), {
|
|
2080
2088
|
size: n,
|
|
2081
2089
|
scrollOffset: i * n
|
|
2082
2090
|
};
|
|
@@ -2088,14 +2096,14 @@ function xn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
2088
2096
|
});
|
|
2089
2097
|
else {
|
|
2090
2098
|
let t = r.get(e - 1);
|
|
2091
|
-
|
|
2099
|
+
xn(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
2092
2100
|
scrollOffset: t.scrollOffset + t.size,
|
|
2093
2101
|
size: a
|
|
2094
2102
|
});
|
|
2095
2103
|
}
|
|
2096
2104
|
}
|
|
2097
2105
|
let a = r.get(i);
|
|
2098
|
-
return
|
|
2106
|
+
return xn(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
2099
2107
|
},
|
|
2100
2108
|
set(e, t) {
|
|
2101
2109
|
r.set(e, t);
|
|
@@ -2105,8 +2113,8 @@ function xn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
2105
2113
|
}
|
|
2106
2114
|
};
|
|
2107
2115
|
}
|
|
2108
|
-
function
|
|
2109
|
-
return
|
|
2116
|
+
function Dn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
2117
|
+
return K(() => En({
|
|
2110
2118
|
itemCount: e,
|
|
2111
2119
|
itemProps: t,
|
|
2112
2120
|
itemSize: n
|
|
@@ -2116,31 +2124,31 @@ function Sn({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
2116
2124
|
n
|
|
2117
2125
|
]);
|
|
2118
2126
|
}
|
|
2119
|
-
function
|
|
2127
|
+
function On({ containerSize: e, itemSize: t }) {
|
|
2120
2128
|
let n;
|
|
2121
2129
|
switch (typeof t) {
|
|
2122
2130
|
case "string":
|
|
2123
|
-
|
|
2131
|
+
xn(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), xn(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseFloat(t) / 100;
|
|
2124
2132
|
break;
|
|
2125
2133
|
default: n = t;
|
|
2126
2134
|
}
|
|
2127
2135
|
return typeof n == "number" && !(Number.isFinite(n) && n > 0) && (n = 0), n;
|
|
2128
2136
|
}
|
|
2129
|
-
function
|
|
2130
|
-
let f = d !== void 0, p = f ?
|
|
2137
|
+
function kn({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, defaultScrollOffset: r = 0, direction: i, isRtl: a = !1, itemCount: o, itemProps: s, itemSize: c, onResize: l, overscanCount: u, scrollElement: d }) {
|
|
2138
|
+
let f = d !== void 0, p = f ? hn(e, d) : e, { height: m = n, width: h = n } = cn({
|
|
2131
2139
|
defaultHeight: i === "vertical" ? n : void 0,
|
|
2132
2140
|
defaultWidth: i === "horizontal" ? n : void 0,
|
|
2133
2141
|
element: e,
|
|
2134
2142
|
mode: i === "vertical" ? "only-height" : "only-width",
|
|
2135
2143
|
style: t
|
|
2136
|
-
}), g =
|
|
2144
|
+
}), g = q({
|
|
2137
2145
|
height: 0,
|
|
2138
2146
|
width: 0
|
|
2139
|
-
}), [_, v] =
|
|
2147
|
+
}), [_, v] = J(n), y = f ? _ : i === "vertical" ? m : h, b = On({
|
|
2140
2148
|
containerSize: y,
|
|
2141
2149
|
itemSize: c
|
|
2142
2150
|
});
|
|
2143
|
-
|
|
2151
|
+
en(() => {
|
|
2144
2152
|
if (typeof l == "function") {
|
|
2145
2153
|
let e = g.current;
|
|
2146
2154
|
(e.height !== m || e.width !== h) && (l({
|
|
@@ -2153,11 +2161,11 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2153
2161
|
l,
|
|
2154
2162
|
h
|
|
2155
2163
|
]);
|
|
2156
|
-
let x =
|
|
2164
|
+
let x = Dn({
|
|
2157
2165
|
itemCount: o,
|
|
2158
2166
|
itemProps: s,
|
|
2159
2167
|
itemSize: b
|
|
2160
|
-
}), S =
|
|
2168
|
+
}), S = rn(), [C] = J(() => S || f ? 0 : r), w = W((e) => x.get(e), [x]), [T, E] = J(() => Tn({
|
|
2161
2169
|
cachedBounds: x,
|
|
2162
2170
|
containerScrollOffset: C,
|
|
2163
2171
|
containerSize: y,
|
|
@@ -2168,7 +2176,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2168
2176
|
startIndexOverscan: Math.min(o - 1, T.startIndexOverscan),
|
|
2169
2177
|
stopIndexVisible: Math.min(o - 1, T.stopIndexVisible),
|
|
2170
2178
|
stopIndexOverscan: Math.min(o - 1, T.stopIndexOverscan)
|
|
2171
|
-
}, j =
|
|
2179
|
+
}, j = W(() => Cn({
|
|
2172
2180
|
cachedBounds: x,
|
|
2173
2181
|
itemCount: o,
|
|
2174
2182
|
itemSize: b
|
|
@@ -2176,14 +2184,14 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2176
2184
|
x,
|
|
2177
2185
|
o,
|
|
2178
2186
|
b
|
|
2179
|
-
]), M =
|
|
2180
|
-
let n =
|
|
2187
|
+
]), M = W((t) => {
|
|
2188
|
+
let n = fn({
|
|
2181
2189
|
containerElement: e,
|
|
2182
2190
|
direction: i,
|
|
2183
2191
|
isRtl: a,
|
|
2184
2192
|
scrollOffset: t
|
|
2185
2193
|
});
|
|
2186
|
-
return
|
|
2194
|
+
return Tn({
|
|
2187
2195
|
cachedBounds: x,
|
|
2188
2196
|
containerScrollOffset: n,
|
|
2189
2197
|
containerSize: y,
|
|
@@ -2198,17 +2206,17 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2198
2206
|
a,
|
|
2199
2207
|
o,
|
|
2200
2208
|
u
|
|
2201
|
-
]), N =
|
|
2202
|
-
|
|
2209
|
+
]), N = q(!1);
|
|
2210
|
+
en(() => {
|
|
2203
2211
|
if (!e || o === 0 || f || N.current || (N.current = !0, r <= 0)) return;
|
|
2204
|
-
let t = i === "horizontal" &&
|
|
2205
|
-
if (
|
|
2212
|
+
let t = i === "horizontal" && tn(e);
|
|
2213
|
+
if (fn({
|
|
2206
2214
|
containerElement: e,
|
|
2207
2215
|
direction: i,
|
|
2208
2216
|
isRtl: t,
|
|
2209
2217
|
scrollOffset: i === "vertical" ? e.scrollTop : e.scrollLeft
|
|
2210
2218
|
}) !== 0) return;
|
|
2211
|
-
let n =
|
|
2219
|
+
let n = fn({
|
|
2212
2220
|
containerElement: e,
|
|
2213
2221
|
direction: i,
|
|
2214
2222
|
isRtl: t,
|
|
@@ -2218,16 +2226,16 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2218
2226
|
behavior: "instant",
|
|
2219
2227
|
[i === "vertical" ? "top" : "left"]: n
|
|
2220
2228
|
}) : i === "vertical" ? e.scrollTop = n : e.scrollLeft = n;
|
|
2221
|
-
}, [e, o]),
|
|
2229
|
+
}, [e, o]), en(() => {
|
|
2222
2230
|
if (f && e && p) return;
|
|
2223
|
-
let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) :
|
|
2231
|
+
let t = e && !f ? M(i === "vertical" ? e.scrollTop : e.scrollLeft) : Tn({
|
|
2224
2232
|
cachedBounds: x,
|
|
2225
2233
|
containerScrollOffset: C,
|
|
2226
2234
|
containerSize: y,
|
|
2227
2235
|
itemCount: o,
|
|
2228
2236
|
overscanCount: u
|
|
2229
2237
|
});
|
|
2230
|
-
E((e) =>
|
|
2238
|
+
E((e) => Sn(t, e) ? e : t);
|
|
2231
2239
|
}, [
|
|
2232
2240
|
x,
|
|
2233
2241
|
e,
|
|
@@ -2239,23 +2247,23 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2239
2247
|
o,
|
|
2240
2248
|
u,
|
|
2241
2249
|
p
|
|
2242
|
-
]),
|
|
2250
|
+
]), en(() => {
|
|
2243
2251
|
if (!e || f) return;
|
|
2244
2252
|
let t = () => {
|
|
2245
2253
|
E((t) => {
|
|
2246
|
-
let { scrollLeft: n, scrollTop: r } = e, s =
|
|
2254
|
+
let { scrollLeft: n, scrollTop: r } = e, s = fn({
|
|
2247
2255
|
containerElement: e,
|
|
2248
2256
|
direction: i,
|
|
2249
2257
|
isRtl: a,
|
|
2250
2258
|
scrollOffset: i === "vertical" ? r : n
|
|
2251
|
-
}), c =
|
|
2259
|
+
}), c = Tn({
|
|
2252
2260
|
cachedBounds: x,
|
|
2253
2261
|
containerScrollOffset: s,
|
|
2254
2262
|
containerSize: y,
|
|
2255
2263
|
itemCount: o,
|
|
2256
2264
|
overscanCount: u
|
|
2257
2265
|
});
|
|
2258
|
-
return
|
|
2266
|
+
return Sn(c, t) ? t : c;
|
|
2259
2267
|
});
|
|
2260
2268
|
};
|
|
2261
2269
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -2271,34 +2279,34 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2271
2279
|
o,
|
|
2272
2280
|
u
|
|
2273
2281
|
]);
|
|
2274
|
-
let P =
|
|
2282
|
+
let P = ln(() => {
|
|
2275
2283
|
if (!e || !p) return;
|
|
2276
|
-
let { offset: t, size: n, viewportSize: r } =
|
|
2284
|
+
let { offset: t, size: n, viewportSize: r } = yn({
|
|
2277
2285
|
containerElement: e,
|
|
2278
2286
|
direction: i,
|
|
2279
2287
|
isRtl: a,
|
|
2280
2288
|
scrollTarget: p
|
|
2281
2289
|
});
|
|
2282
2290
|
v(r);
|
|
2283
|
-
let s =
|
|
2291
|
+
let s = Tn({
|
|
2284
2292
|
cachedBounds: x,
|
|
2285
2293
|
containerScrollOffset: t,
|
|
2286
2294
|
containerSize: n,
|
|
2287
2295
|
itemCount: o,
|
|
2288
2296
|
overscanCount: u
|
|
2289
2297
|
});
|
|
2290
|
-
E((e) =>
|
|
2298
|
+
E((e) => Sn(s, e) ? e : s);
|
|
2291
2299
|
});
|
|
2292
|
-
return
|
|
2300
|
+
return en(() => {
|
|
2293
2301
|
f && P();
|
|
2294
|
-
}),
|
|
2302
|
+
}), en(() => {
|
|
2295
2303
|
if (!f || !e || !p) return;
|
|
2296
|
-
let t =
|
|
2304
|
+
let t = an(e), n = () => P();
|
|
2297
2305
|
p.addEventListener("scroll", n, { passive: !0 }), e.addEventListener("scroll", n, { passive: !0 }), t.addEventListener("resize", n);
|
|
2298
|
-
let r, i =
|
|
2299
|
-
i && !
|
|
2300
|
-
let a =
|
|
2301
|
-
container:
|
|
2306
|
+
let r, i = on(e);
|
|
2307
|
+
i && !mn(p) && (r = new i(n), r.observe(p));
|
|
2308
|
+
let a = pn({
|
|
2309
|
+
container: mn(p) ? p.document.documentElement : p,
|
|
2302
2310
|
element: e,
|
|
2303
2311
|
onChange: n
|
|
2304
2312
|
});
|
|
@@ -2313,9 +2321,9 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2313
2321
|
]), {
|
|
2314
2322
|
getCellBounds: w,
|
|
2315
2323
|
getEstimatedSize: j,
|
|
2316
|
-
getScrollPositionForIndex:
|
|
2324
|
+
getScrollPositionForIndex: ln(({ align: t = "auto", index: n }) => {
|
|
2317
2325
|
let r = ({ clamp: e, containerScrollOffset: r, containerSize: i, padding: a }) => {
|
|
2318
|
-
if (a.start === 0 && a.end === 0) return
|
|
2326
|
+
if (a.start === 0 && a.end === 0) return wn({
|
|
2319
2327
|
align: t,
|
|
2320
2328
|
cachedBounds: x,
|
|
2321
2329
|
clamp: e,
|
|
@@ -2325,7 +2333,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2325
2333
|
itemCount: o,
|
|
2326
2334
|
itemSize: b
|
|
2327
2335
|
});
|
|
2328
|
-
let s =
|
|
2336
|
+
let s = wn({
|
|
2329
2337
|
align: t,
|
|
2330
2338
|
cachedBounds: x,
|
|
2331
2339
|
clamp: !1,
|
|
@@ -2337,8 +2345,8 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2337
2345
|
}) - a.start;
|
|
2338
2346
|
return e ? Math.max(0, Math.min(j() - i, s)) : s;
|
|
2339
2347
|
};
|
|
2340
|
-
if (f && e && p && !
|
|
2341
|
-
let { viewportOffset: t, viewportSize: n } =
|
|
2348
|
+
if (f && e && p && !vn(e, i)) {
|
|
2349
|
+
let { viewportOffset: t, viewportSize: n } = yn({
|
|
2342
2350
|
containerElement: e,
|
|
2343
2351
|
direction: i,
|
|
2344
2352
|
isRtl: a,
|
|
@@ -2347,7 +2355,7 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2347
2355
|
clamp: !1,
|
|
2348
2356
|
containerScrollOffset: t,
|
|
2349
2357
|
containerSize: n,
|
|
2350
|
-
padding:
|
|
2358
|
+
padding: bn({
|
|
2351
2359
|
direction: i,
|
|
2352
2360
|
isRtl: a,
|
|
2353
2361
|
scrollTarget: p,
|
|
@@ -2355,20 +2363,20 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2355
2363
|
})
|
|
2356
2364
|
}) - t, s = i === "horizontal" && a ? -o : o;
|
|
2357
2365
|
return {
|
|
2358
|
-
scrollOffset:
|
|
2366
|
+
scrollOffset: gn(p, i) + s,
|
|
2359
2367
|
scrollTarget: p
|
|
2360
2368
|
};
|
|
2361
2369
|
}
|
|
2362
2370
|
let s = e ? i === "vertical" ? e.scrollTop : e.scrollLeft : 0, c = f && e ? i === "vertical" ? e.clientHeight : e.clientWidth : y, l = r({
|
|
2363
2371
|
clamp: !0,
|
|
2364
|
-
containerScrollOffset:
|
|
2372
|
+
containerScrollOffset: fn({
|
|
2365
2373
|
containerElement: e,
|
|
2366
2374
|
direction: i,
|
|
2367
2375
|
isRtl: a,
|
|
2368
2376
|
scrollOffset: s
|
|
2369
2377
|
}),
|
|
2370
2378
|
containerSize: c,
|
|
2371
|
-
padding: e ?
|
|
2379
|
+
padding: e ? bn({
|
|
2372
2380
|
direction: i,
|
|
2373
2381
|
isRtl: a,
|
|
2374
2382
|
scrollTarget: e,
|
|
@@ -2379,14 +2387,14 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2379
2387
|
}
|
|
2380
2388
|
});
|
|
2381
2389
|
if (e && (!f || p)) {
|
|
2382
|
-
if (l =
|
|
2390
|
+
if (l = fn({
|
|
2383
2391
|
containerElement: e,
|
|
2384
2392
|
direction: i,
|
|
2385
2393
|
isRtl: a,
|
|
2386
2394
|
scrollOffset: l
|
|
2387
2395
|
}), !f && typeof e.scrollTo != "function") {
|
|
2388
2396
|
let e = M(l);
|
|
2389
|
-
|
|
2397
|
+
Sn(T, e) || E(e);
|
|
2390
2398
|
}
|
|
2391
2399
|
return {
|
|
2392
2400
|
scrollOffset: l,
|
|
@@ -2401,33 +2409,33 @@ function wn({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
2401
2409
|
stopIndexVisible: k
|
|
2402
2410
|
};
|
|
2403
2411
|
}
|
|
2404
|
-
function
|
|
2405
|
-
let [t, n] =
|
|
2406
|
-
return
|
|
2412
|
+
function An(e) {
|
|
2413
|
+
let [t, n] = J(e);
|
|
2414
|
+
return Sn(t, e) ? t : (n(e), e);
|
|
2407
2415
|
}
|
|
2408
|
-
function
|
|
2416
|
+
function jn(e, t) {
|
|
2409
2417
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
2410
|
-
return
|
|
2418
|
+
return Sn(n, a) && Sn(r, o) && Sn(i, s);
|
|
2411
2419
|
}
|
|
2412
|
-
var
|
|
2413
|
-
function
|
|
2414
|
-
let t = e.getAttribute(
|
|
2420
|
+
var Mn = "data-react-window-index", Nn = "data-index";
|
|
2421
|
+
function Pn(e) {
|
|
2422
|
+
let t = e.getAttribute(Mn) ?? e.getAttribute(Nn);
|
|
2415
2423
|
return t !== null && /^\d+$/.test(t) ? Number(t) : void 0;
|
|
2416
2424
|
}
|
|
2417
|
-
var
|
|
2418
|
-
function
|
|
2425
|
+
var Fn = 1e3, In = 500;
|
|
2426
|
+
function Ln(e) {
|
|
2419
2427
|
return 1 - (1 - e) ** 3;
|
|
2420
2428
|
}
|
|
2421
|
-
function
|
|
2422
|
-
let c = e === "vertical", l =
|
|
2429
|
+
function Rn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, itemCount: i, itemElements: a, scrollTarget: o, getScrollPositionForIndex: s }) {
|
|
2430
|
+
let c = e === "vertical", l = q(null), u = q(void 0), d = ln(() => {
|
|
2423
2431
|
l.current = null, u.current !== void 0 && (u.current.view.cancelAnimationFrame(u.current.id), u.current = void 0);
|
|
2424
|
-
}), f =
|
|
2425
|
-
let e =
|
|
2432
|
+
}), f = ln(() => {
|
|
2433
|
+
let e = an(t);
|
|
2426
2434
|
u.current = {
|
|
2427
2435
|
id: e.requestAnimationFrame(p),
|
|
2428
2436
|
view: e
|
|
2429
2437
|
};
|
|
2430
|
-
}), p =
|
|
2438
|
+
}), p = ln(() => {
|
|
2431
2439
|
u.current = void 0;
|
|
2432
2440
|
let o = l.current;
|
|
2433
2441
|
if (!o) return;
|
|
@@ -2441,27 +2449,27 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2441
2449
|
index: o.index
|
|
2442
2450
|
});
|
|
2443
2451
|
if (m !== void 0) {
|
|
2444
|
-
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t,
|
|
2452
|
+
let { scrollOffset: t, scrollTarget: r } = m, s = Math.max(0, Math.min(t, _n(r, e)));
|
|
2445
2453
|
o.animation === void 0 && (o.animation = {
|
|
2446
|
-
deadline: p + (o.smooth ?
|
|
2447
|
-
startOffset:
|
|
2454
|
+
deadline: p + (o.smooth ? In : 0) + Fn,
|
|
2455
|
+
startOffset: gn(r, e),
|
|
2448
2456
|
startTime: p
|
|
2449
2457
|
});
|
|
2450
|
-
let l = o.smooth ? (p - o.animation.startTime) /
|
|
2458
|
+
let l = o.smooth ? (p - o.animation.startTime) / In : 1;
|
|
2451
2459
|
if (l < 1) {
|
|
2452
2460
|
let { startOffset: e } = o.animation;
|
|
2453
2461
|
o.stableFrames = 0, r.scrollTo({
|
|
2454
2462
|
behavior: "instant",
|
|
2455
|
-
[c ? "top" : "left"]: e + (s - e) *
|
|
2463
|
+
[c ? "top" : "left"]: e + (s - e) * Ln(l)
|
|
2456
2464
|
});
|
|
2457
|
-
} else if (Math.abs(s -
|
|
2465
|
+
} else if (Math.abs(s - gn(r, e)) > 1) o.stableFrames = 0, r.scrollTo({
|
|
2458
2466
|
behavior: "instant",
|
|
2459
2467
|
[c ? "top" : "left"]: s
|
|
2460
2468
|
});
|
|
2461
2469
|
else {
|
|
2462
2470
|
let e = a.current;
|
|
2463
|
-
if (!(e.some((e) =>
|
|
2464
|
-
let t =
|
|
2471
|
+
if (!(e.some((e) => Pn(e) === o.index) && e.every((e) => {
|
|
2472
|
+
let t = Pn(e);
|
|
2465
2473
|
if (t === void 0 || t >= i) return !0;
|
|
2466
2474
|
let r = c ? e.offsetHeight : e.offsetWidth;
|
|
2467
2475
|
return Math.abs(n(t).size - r) <= 1;
|
|
@@ -2474,7 +2482,7 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2474
2482
|
}
|
|
2475
2483
|
f();
|
|
2476
2484
|
});
|
|
2477
|
-
return
|
|
2485
|
+
return en(() => {
|
|
2478
2486
|
let e = o ?? t;
|
|
2479
2487
|
if (!e) return;
|
|
2480
2488
|
let n = (e) => {
|
|
@@ -2497,13 +2505,13 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2497
2505
|
d,
|
|
2498
2506
|
t,
|
|
2499
2507
|
o
|
|
2500
|
-
]),
|
|
2508
|
+
]), W(({ align: n = "auto", behavior: i = "auto", index: a }) => {
|
|
2501
2509
|
if (r && n === "smart") {
|
|
2502
2510
|
let t = s({
|
|
2503
2511
|
align: "auto",
|
|
2504
2512
|
index: a
|
|
2505
2513
|
});
|
|
2506
|
-
n = t === void 0 || t.scrollOffset ===
|
|
2514
|
+
n = t === void 0 || t.scrollOffset === gn(t.scrollTarget, e) ? "auto" : "center";
|
|
2507
2515
|
}
|
|
2508
2516
|
let o = s({
|
|
2509
2517
|
align: n,
|
|
@@ -2535,11 +2543,11 @@ function Nn({ direction: e, element: t, getCellBounds: n, isDynamicSize: r, item
|
|
|
2535
2543
|
s
|
|
2536
2544
|
]);
|
|
2537
2545
|
}
|
|
2538
|
-
function
|
|
2539
|
-
let r =
|
|
2540
|
-
|
|
2546
|
+
function zn({ callback: e, element: t, enabled: n = !0 }) {
|
|
2547
|
+
let r = ln(e);
|
|
2548
|
+
G(() => {
|
|
2541
2549
|
if (!n || !t) return;
|
|
2542
|
-
let e =
|
|
2550
|
+
let e = an(t), i = e.requestAnimationFrame(() => {
|
|
2543
2551
|
i = e.requestAnimationFrame(r);
|
|
2544
2552
|
});
|
|
2545
2553
|
return () => {
|
|
@@ -2551,7 +2559,7 @@ function Pn({ callback: e, element: t, enabled: n = !0 }) {
|
|
|
2551
2559
|
r
|
|
2552
2560
|
]);
|
|
2553
2561
|
}
|
|
2554
|
-
function
|
|
2562
|
+
function Bn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopIndex: i }) {
|
|
2555
2563
|
if (r < 0 || i < r) return [];
|
|
2556
2564
|
let a = [], o = /* @__PURE__ */ new Set(), s = !0;
|
|
2557
2565
|
for (let t of e) {
|
|
@@ -2574,20 +2582,20 @@ function Fn({ elements: e, isFlowLayout: t, rowCount: n, startIndex: r, stopInde
|
|
|
2574
2582
|
index: r + t
|
|
2575
2583
|
}));
|
|
2576
2584
|
}
|
|
2577
|
-
function
|
|
2585
|
+
function Vn(e) {
|
|
2578
2586
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
2579
2587
|
}
|
|
2580
|
-
var
|
|
2581
|
-
function
|
|
2582
|
-
let _ =
|
|
2583
|
-
|
|
2588
|
+
var Hn = "data-react-window-sizer";
|
|
2589
|
+
function Un({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffset: r = 0, listRef: i, onResize: a, onRowsRendered: o, overscanCount: s = 3, rowComponent: c, rowCount: l, rowHeight: u, rowKey: d, rowProps: f, scrollElement: p, tagName: m = "div", style: h, ...g }) {
|
|
2590
|
+
let _ = An(f), v = K(() => je(c, jn), [c]), [y, b] = J(null), x = Vn(u), S = K(() => x ? (e) => u.getRowHeight(e) ?? u.getAverageRowHeight() : u, [x, u]), C = rn(), [w, T] = J(() => C && x), E = q(u);
|
|
2591
|
+
en(() => {
|
|
2584
2592
|
w && E.current !== u && T(!1);
|
|
2585
|
-
}, [w, u]),
|
|
2593
|
+
}, [w, u]), zn({
|
|
2586
2594
|
callback: () => T(!1),
|
|
2587
2595
|
element: y,
|
|
2588
2596
|
enabled: w
|
|
2589
2597
|
});
|
|
2590
|
-
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: P } =
|
|
2598
|
+
let { getCellBounds: D, getEstimatedSize: O, scrollTarget: k, getScrollPositionForIndex: A, startIndexOverscan: j, startIndexVisible: M, stopIndexOverscan: N, stopIndexVisible: P } = kn({
|
|
2591
2599
|
containerElement: y,
|
|
2592
2600
|
containerStyle: h,
|
|
2593
2601
|
defaultContainerSize: n,
|
|
@@ -2599,7 +2607,7 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2599
2607
|
onResize: a,
|
|
2600
2608
|
overscanCount: s,
|
|
2601
2609
|
scrollElement: p
|
|
2602
|
-
}), ee =
|
|
2610
|
+
}), ee = q([]), F = Rn({
|
|
2603
2611
|
direction: "vertical",
|
|
2604
2612
|
element: y,
|
|
2605
2613
|
getCellBounds: D,
|
|
@@ -2609,16 +2617,16 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2609
2617
|
scrollTarget: k,
|
|
2610
2618
|
getScrollPositionForIndex: A
|
|
2611
2619
|
});
|
|
2612
|
-
|
|
2620
|
+
Ne(i, () => ({
|
|
2613
2621
|
get element() {
|
|
2614
2622
|
return y;
|
|
2615
2623
|
},
|
|
2616
2624
|
scrollToRow: F
|
|
2617
2625
|
}), [y, F]);
|
|
2618
2626
|
let I = w && x && j === 0;
|
|
2619
|
-
|
|
2627
|
+
en(() => {
|
|
2620
2628
|
if (!y) return;
|
|
2621
|
-
let e = Array.from(y.children).filter((e) => !e.hasAttribute(
|
|
2629
|
+
let e = Array.from(y.children).filter((e) => !e.hasAttribute(Hn)), t = Bn({
|
|
2622
2630
|
elements: e,
|
|
2623
2631
|
isFlowLayout: I,
|
|
2624
2632
|
rowCount: l,
|
|
@@ -2626,9 +2634,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2626
2634
|
stopIndex: N
|
|
2627
2635
|
}), n = t.map(({ element: e }) => e);
|
|
2628
2636
|
if (e.forEach((e) => {
|
|
2629
|
-
n.includes(e) || e.removeAttribute(
|
|
2637
|
+
n.includes(e) || e.removeAttribute(Mn);
|
|
2630
2638
|
}), t.forEach(({ element: e, index: t }) => {
|
|
2631
|
-
e.setAttribute(
|
|
2639
|
+
e.setAttribute(Mn, `${t}`);
|
|
2632
2640
|
}), ee.current = n, x) return u.observeRowElements(n);
|
|
2633
2641
|
}, [
|
|
2634
2642
|
v,
|
|
@@ -2641,7 +2649,7 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2641
2649
|
_,
|
|
2642
2650
|
j,
|
|
2643
2651
|
N
|
|
2644
|
-
]),
|
|
2652
|
+
]), G(() => {
|
|
2645
2653
|
j >= 0 && N >= 0 && o && o({
|
|
2646
2654
|
startIndex: M,
|
|
2647
2655
|
stopIndex: P
|
|
@@ -2656,11 +2664,11 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2656
2664
|
N,
|
|
2657
2665
|
P
|
|
2658
2666
|
]);
|
|
2659
|
-
let
|
|
2667
|
+
let te = K(() => {
|
|
2660
2668
|
let e = [];
|
|
2661
2669
|
if (l > 0) for (let t = j; t <= N; t++) {
|
|
2662
2670
|
let n = D(t);
|
|
2663
|
-
e.push(/* @__PURE__ */
|
|
2671
|
+
e.push(/* @__PURE__ */ ke(v, {
|
|
2664
2672
|
..._,
|
|
2665
2673
|
ariaAttributes: {
|
|
2666
2674
|
"aria-posinset": t + 1,
|
|
@@ -2689,9 +2697,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2689
2697
|
_,
|
|
2690
2698
|
j,
|
|
2691
2699
|
N
|
|
2692
|
-
]),
|
|
2700
|
+
]), L = /* @__PURE__ */ H("div", {
|
|
2693
2701
|
"aria-hidden": !0,
|
|
2694
|
-
[
|
|
2702
|
+
[Hn]: "",
|
|
2695
2703
|
style: {
|
|
2696
2704
|
position: I ? "absolute" : void 0,
|
|
2697
2705
|
top: I ? 0 : void 0,
|
|
@@ -2699,8 +2707,8 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2699
2707
|
width: "100%",
|
|
2700
2708
|
zIndex: -1
|
|
2701
2709
|
}
|
|
2702
|
-
}, "sizer"),
|
|
2703
|
-
return
|
|
2710
|
+
}, "sizer"), R = /* @__PURE__ */ H(Oe, { children: e }, "children"), z = /* @__PURE__ */ H(Oe, { children: te }, "rows");
|
|
2711
|
+
return ke(m, {
|
|
2704
2712
|
role: "list",
|
|
2705
2713
|
...g,
|
|
2706
2714
|
className: t,
|
|
@@ -2714,9 +2722,9 @@ function Rn({ children: e, className: t, defaultHeight: n = 0, defaultScrollOffs
|
|
|
2714
2722
|
},
|
|
2715
2723
|
...h
|
|
2716
2724
|
}
|
|
2717
|
-
}, ...I ? [
|
|
2725
|
+
}, ...I ? [R, z] : [z, R], L);
|
|
2718
2726
|
}
|
|
2719
|
-
var
|
|
2727
|
+
var Wn = /* @__PURE__ */ Object.assign(Un, { displayName: "List" }), Gn = {
|
|
2720
2728
|
search: "_search_5skzl_1",
|
|
2721
2729
|
divider: "_divider_5skzl_5",
|
|
2722
2730
|
item: "_item_5skzl_9",
|
|
@@ -2725,42 +2733,42 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
|
|
|
2725
2733
|
stateLabel: "_stateLabel_5skzl_27",
|
|
2726
2734
|
itemSelectedBackground: "_itemSelectedBackground_5skzl_37",
|
|
2727
2735
|
itemSelectedText: "_itemSelectedText_5skzl_41"
|
|
2728
|
-
},
|
|
2729
|
-
let p = r[e], m =
|
|
2730
|
-
return /* @__PURE__ */
|
|
2736
|
+
}, Kn = 44, qn = 8, Jn = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, itemClassName: s, selectedItemClassName: c, hasSelectedBackground: l, hasSelectedText: u, onSelect: f }) => {
|
|
2737
|
+
let p = r[e], m = Zt(p.iconUrl, p.type, p.displayName ?? p.id, b.SM), h = p.id === i;
|
|
2738
|
+
return /* @__PURE__ */ H("div", {
|
|
2731
2739
|
style: t,
|
|
2732
2740
|
...n,
|
|
2733
|
-
children: /* @__PURE__ */
|
|
2741
|
+
children: /* @__PURE__ */ H(_, {
|
|
2734
2742
|
type: "button",
|
|
2735
|
-
"aria-current":
|
|
2736
|
-
className:
|
|
2737
|
-
iconBefore: /* @__PURE__ */
|
|
2738
|
-
className:
|
|
2743
|
+
"aria-current": h ? "true" : void 0,
|
|
2744
|
+
className: d(Gn.item, "h-full w-full gap-3 px-4", h && l && Gn.itemSelectedBackground, h && u && Gn.itemSelectedText, s, h && c, Y.modelMenuItem, h && Y.modelMenuItemSelected),
|
|
2745
|
+
iconBefore: /* @__PURE__ */ H("span", {
|
|
2746
|
+
className: Gn.itemIcon,
|
|
2739
2747
|
children: m
|
|
2740
2748
|
}),
|
|
2741
|
-
label: /* @__PURE__ */
|
|
2749
|
+
label: /* @__PURE__ */ U("span", {
|
|
2742
2750
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
2743
|
-
children: [/* @__PURE__ */
|
|
2751
|
+
children: [/* @__PURE__ */ H(D, {
|
|
2744
2752
|
text: p.displayName ?? p.id,
|
|
2745
2753
|
query: o,
|
|
2746
2754
|
maxLines: 1,
|
|
2747
|
-
className:
|
|
2748
|
-
}),
|
|
2749
|
-
size:
|
|
2750
|
-
className:
|
|
2755
|
+
className: d(a, "min-w-0 flex-1 text-start")
|
|
2756
|
+
}), h && /* @__PURE__ */ H(_e, {
|
|
2757
|
+
size: b.SM,
|
|
2758
|
+
className: Gn.checkIcon,
|
|
2751
2759
|
"aria-hidden": !0,
|
|
2752
|
-
stroke:
|
|
2760
|
+
stroke: x
|
|
2753
2761
|
})]
|
|
2754
2762
|
}),
|
|
2755
2763
|
onClick: () => f(p.id)
|
|
2756
2764
|
})
|
|
2757
2765
|
});
|
|
2758
|
-
},
|
|
2759
|
-
let [b, x] =
|
|
2760
|
-
|
|
2766
|
+
}, Yn = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: s, loadingLabel: l, errorLabel: u, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g, menuStyles: _, searchQuery: v, onSearchQueryChange: y }) => {
|
|
2767
|
+
let [b, x] = J(""), S = v ?? b, C = y ?? x;
|
|
2768
|
+
G(() => {
|
|
2761
2769
|
e || x("");
|
|
2762
2770
|
}, [e]);
|
|
2763
|
-
let T = a && a.length > 0,
|
|
2771
|
+
let T = a && a.length > 0, E = l !== void 0, D = !T && !E ? u ?? f : void 0, k = T ? Xt(a, S) : [], A = (e) => {
|
|
2764
2772
|
s(e), i();
|
|
2765
2773
|
}, j = _?.colors, M = c({
|
|
2766
2774
|
"--ci-sheet-divider": g?.divider,
|
|
@@ -2772,63 +2780,63 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
|
|
|
2772
2780
|
"--ci-sheet-selected-bg": j?.selectedItemBackground,
|
|
2773
2781
|
"--ci-sheet-selected-text": j?.selectedItemText
|
|
2774
2782
|
}), N;
|
|
2775
|
-
return N =
|
|
2783
|
+
return N = E ? /* @__PURE__ */ H(Jt, {}) : D ? /* @__PURE__ */ H("div", {
|
|
2776
2784
|
role: "list",
|
|
2777
|
-
className:
|
|
2778
|
-
children:
|
|
2779
|
-
}) : /* @__PURE__ */
|
|
2785
|
+
className: d(Gn.stateLabel, h, "px-4 py-4"),
|
|
2786
|
+
children: D
|
|
2787
|
+
}) : /* @__PURE__ */ H(Wn, {
|
|
2780
2788
|
role: "list",
|
|
2781
2789
|
className: "overflow-y-auto",
|
|
2782
|
-
style: { height: Math.min(k.length,
|
|
2783
|
-
rowComponent:
|
|
2790
|
+
style: { height: Math.min(k.length, qn) * Kn },
|
|
2791
|
+
rowComponent: Jn,
|
|
2784
2792
|
rowCount: k.length,
|
|
2785
|
-
rowHeight:
|
|
2793
|
+
rowHeight: Kn,
|
|
2786
2794
|
rowProps: {
|
|
2787
2795
|
items: k,
|
|
2788
2796
|
selectedDeploymentId: o,
|
|
2789
2797
|
labelClassName: h,
|
|
2790
|
-
query:
|
|
2798
|
+
query: S,
|
|
2791
2799
|
itemClassName: _?.itemClassName,
|
|
2792
2800
|
selectedItemClassName: _?.selectedItemClassName,
|
|
2793
2801
|
hasSelectedBackground: !!j?.selectedItemBackground,
|
|
2794
2802
|
hasSelectedText: !!j?.selectedItemText,
|
|
2795
2803
|
onSelect: A
|
|
2796
2804
|
}
|
|
2797
|
-
}), /* @__PURE__ */
|
|
2805
|
+
}), /* @__PURE__ */ H(Le, {
|
|
2798
2806
|
isOpen: e,
|
|
2799
2807
|
title: t,
|
|
2800
2808
|
closeLabel: n,
|
|
2801
2809
|
onClose: i,
|
|
2802
2810
|
style: p,
|
|
2803
2811
|
titleClassName: m,
|
|
2804
|
-
className:
|
|
2812
|
+
className: d("max-h-[80dvh]", _?.className, Y.modelMenu),
|
|
2805
2813
|
colors: g?.shell,
|
|
2806
|
-
children: /* @__PURE__ */
|
|
2814
|
+
children: /* @__PURE__ */ U("div", {
|
|
2807
2815
|
className: "contents",
|
|
2808
2816
|
style: M,
|
|
2809
2817
|
children: [
|
|
2810
|
-
/* @__PURE__ */
|
|
2818
|
+
/* @__PURE__ */ H(O, {
|
|
2811
2819
|
visuallyHidden: !0,
|
|
2812
|
-
children:
|
|
2820
|
+
children: E ? l : null
|
|
2813
2821
|
}),
|
|
2814
|
-
T && !
|
|
2822
|
+
T && !E && /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H("div", {
|
|
2815
2823
|
style: c({ "--ci-sheet-search-bg": _?.colors?.searchHeaderBackground }),
|
|
2816
|
-
className:
|
|
2817
|
-
children: /* @__PURE__ */
|
|
2818
|
-
value:
|
|
2824
|
+
className: d("shrink-0 px-4 py-[10px]", Gn.search, _?.searchHeaderClassName, Y.modelMenuSearch),
|
|
2825
|
+
children: /* @__PURE__ */ H(re, {
|
|
2826
|
+
value: S,
|
|
2819
2827
|
placeholder: r,
|
|
2820
|
-
size:
|
|
2821
|
-
onChange: (e) =>
|
|
2828
|
+
size: w.Standard,
|
|
2829
|
+
onChange: (e) => C(e ?? "")
|
|
2822
2830
|
})
|
|
2823
|
-
}), /* @__PURE__ */
|
|
2831
|
+
}), /* @__PURE__ */ H("div", { className: d(Gn.divider, "h-px shrink-0") })] }),
|
|
2824
2832
|
N
|
|
2825
2833
|
]
|
|
2826
2834
|
})
|
|
2827
2835
|
});
|
|
2828
|
-
},
|
|
2829
|
-
let [
|
|
2830
|
-
|
|
2831
|
-
}, { searchQuery: O, onSearchQueryChange: k, selectorIcon: A, selectorAriaLabel: j,
|
|
2836
|
+
}, Xn = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, menuStyles: i, nameClassName: a = "dial-small-text", versionClassName: o = "dial-tiny-text", isStreaming: l, isMobile: u, isDisabled: f = !1, style: p, modelPickerOverlay: m, isPickerOpen: h, onPickerToggle: g, onPickerOpenChange: v }) => {
|
|
2837
|
+
let [y, w] = J(!1), T = h ?? y, D = (e) => {
|
|
2838
|
+
w(e), v?.(e), te(e);
|
|
2839
|
+
}, { searchQuery: O, onSearchQueryChange: k, selectorIcon: A, selectorAriaLabel: j, unavailableTooltip: M, selectedLabel: N, selectedVersion: P, menuItems: ee, menuHeader: F, menuStyle: I, onOpenChange: te } = $t({
|
|
2832
2840
|
deployments: e,
|
|
2833
2841
|
selectedDeploymentId: t,
|
|
2834
2842
|
onDeploymentChange: n,
|
|
@@ -2836,18 +2844,18 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
|
|
|
2836
2844
|
styles: i
|
|
2837
2845
|
});
|
|
2838
2846
|
if (!e) return null;
|
|
2839
|
-
let L =
|
|
2840
|
-
size:
|
|
2841
|
-
className:
|
|
2847
|
+
let L = l || f, R = L ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, z = /* @__PURE__ */ H(ve, {
|
|
2848
|
+
size: b.SM,
|
|
2849
|
+
className: d(Z.modelSelectorCaret, Y.modelSelectorCaret),
|
|
2842
2850
|
"aria-hidden": !0,
|
|
2843
|
-
stroke:
|
|
2844
|
-
}), B = /* @__PURE__ */
|
|
2845
|
-
className:
|
|
2851
|
+
stroke: x
|
|
2852
|
+
}), B = /* @__PURE__ */ H("span", {
|
|
2853
|
+
className: d("flex shrink-0 items-center", Y.modelSelectorIcon),
|
|
2846
2854
|
children: A
|
|
2847
2855
|
});
|
|
2848
|
-
if (
|
|
2849
|
-
tooltipProps: { tooltip: M },
|
|
2850
|
-
icon: /* @__PURE__ */
|
|
2856
|
+
if (u) return /* @__PURE__ */ U(V, { children: [/* @__PURE__ */ H(E, {
|
|
2857
|
+
tooltipProps: { tooltip: M ?? N },
|
|
2858
|
+
icon: /* @__PURE__ */ U("div", {
|
|
2851
2859
|
className: "flex items-center gap-1",
|
|
2852
2860
|
children: [B, z]
|
|
2853
2861
|
}),
|
|
@@ -2856,19 +2864,19 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
|
|
|
2856
2864
|
onClick: () => {
|
|
2857
2865
|
L || D(!0);
|
|
2858
2866
|
},
|
|
2859
|
-
className:
|
|
2860
|
-
}), m ? /* @__PURE__ */
|
|
2861
|
-
isOpen:
|
|
2867
|
+
className: d("w-[50px]", Z.modelSelectorButton, R, Y.modelSelectorButton)
|
|
2868
|
+
}), m ? /* @__PURE__ */ H(Le, {
|
|
2869
|
+
isOpen: T,
|
|
2862
2870
|
title: r?.ariaLabel ?? "Select model",
|
|
2863
2871
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2864
2872
|
onClose: () => D(!1),
|
|
2865
2873
|
style: p,
|
|
2866
|
-
className:
|
|
2874
|
+
className: d(i?.className, Y.modelMenu),
|
|
2867
2875
|
children: m(() => D(!1))
|
|
2868
|
-
}) : /* @__PURE__ */
|
|
2876
|
+
}) : /* @__PURE__ */ H(Yn, {
|
|
2869
2877
|
searchQuery: O,
|
|
2870
2878
|
onSearchQueryChange: k,
|
|
2871
|
-
isOpen:
|
|
2879
|
+
isOpen: T,
|
|
2872
2880
|
title: r?.ariaLabel ?? "Select model",
|
|
2873
2881
|
closeLabel: r?.closeLabel ?? "Close",
|
|
2874
2882
|
searchPlaceholder: r?.searchPlaceholder ?? "Search",
|
|
@@ -2883,441 +2891,441 @@ var zn = /* @__PURE__ */ Object.assign(Rn, { displayName: "List" }), Bn = {
|
|
|
2883
2891
|
menuStyles: i
|
|
2884
2892
|
})] });
|
|
2885
2893
|
if (m) {
|
|
2886
|
-
let e =
|
|
2887
|
-
return /* @__PURE__ */
|
|
2894
|
+
let e = P ? `${N} · ${P}` : N;
|
|
2895
|
+
return /* @__PURE__ */ H(S, {
|
|
2888
2896
|
placement: "top-end",
|
|
2889
2897
|
matchReferenceWidth: !1,
|
|
2890
|
-
open:
|
|
2898
|
+
open: T,
|
|
2891
2899
|
onOpenChange: D,
|
|
2892
2900
|
trigger: [],
|
|
2893
2901
|
outsideClosable: !0,
|
|
2894
|
-
overlayRole:
|
|
2902
|
+
overlayRole: C.Dialog,
|
|
2895
2903
|
overlayAriaLabel: r?.ariaLabel ?? "Select model",
|
|
2896
2904
|
renderOverlay: () => m(() => D(!1)),
|
|
2897
|
-
listClassName:
|
|
2905
|
+
listClassName: d("w-[368px]!", Z.modelOverlayPanel, i?.className, Y.modelMenu),
|
|
2898
2906
|
listStyle: c({ "--ci-model-overlay-bg": i?.colors?.overlayBackground }),
|
|
2899
|
-
children: /* @__PURE__ */
|
|
2907
|
+
children: /* @__PURE__ */ H(_, {
|
|
2900
2908
|
"aria-label": j,
|
|
2901
2909
|
"aria-disabled": L || void 0,
|
|
2902
|
-
tooltipProps: { tooltip: e },
|
|
2903
|
-
className:
|
|
2910
|
+
tooltipProps: { tooltip: M ?? e },
|
|
2911
|
+
className: d("h-auto min-w-0 gap-1.5 rounded-full! border-0! px-0 py-1.5 ps-1.5 pe-2", Z.modelSelectorButton, R, L && Z.modelSelectorButtonDisabled, Y.modelSelectorButton),
|
|
2904
2912
|
onClick: () => {
|
|
2905
|
-
L || (
|
|
2913
|
+
L || (g ? g() : D(!T));
|
|
2906
2914
|
},
|
|
2907
2915
|
iconBefore: B,
|
|
2908
2916
|
iconAfter: z,
|
|
2909
2917
|
textClassName: "min-w-0",
|
|
2910
|
-
label: /* @__PURE__ */
|
|
2918
|
+
label: /* @__PURE__ */ U("span", {
|
|
2911
2919
|
className: "flex max-w-[180px] min-w-0 items-baseline gap-1",
|
|
2912
|
-
children: [/* @__PURE__ */
|
|
2913
|
-
className:
|
|
2914
|
-
children: M
|
|
2915
|
-
}), N && /* @__PURE__ */ V("span", {
|
|
2916
|
-
className: l("min-w-0 truncate", o, X.modelSelectorVersion),
|
|
2920
|
+
children: [/* @__PURE__ */ H("span", {
|
|
2921
|
+
className: d("max-w-[180px] shrink-0 truncate", a, Z.modelSelectorName),
|
|
2917
2922
|
children: N
|
|
2923
|
+
}), P && /* @__PURE__ */ H("span", {
|
|
2924
|
+
className: d("min-w-0 truncate", o, Z.modelSelectorVersion),
|
|
2925
|
+
children: P
|
|
2918
2926
|
})]
|
|
2919
2927
|
})
|
|
2920
2928
|
})
|
|
2921
2929
|
});
|
|
2922
2930
|
}
|
|
2923
|
-
return /* @__PURE__ */
|
|
2924
|
-
className:
|
|
2931
|
+
return /* @__PURE__ */ H("div", {
|
|
2932
|
+
className: d(R),
|
|
2925
2933
|
"aria-disabled": L || void 0,
|
|
2926
|
-
children: /* @__PURE__ */
|
|
2927
|
-
items:
|
|
2928
|
-
menuHeader:
|
|
2934
|
+
children: /* @__PURE__ */ H(S, {
|
|
2935
|
+
items: ee,
|
|
2936
|
+
menuHeader: F,
|
|
2929
2937
|
placement: "bottom-end",
|
|
2930
2938
|
matchReferenceWidth: !1,
|
|
2931
2939
|
maxDropdownHeight: s,
|
|
2932
|
-
listClassName:
|
|
2933
|
-
listStyle:
|
|
2940
|
+
listClassName: d("w-[240px]!", i?.className, Y.modelMenu),
|
|
2941
|
+
listStyle: I,
|
|
2934
2942
|
disabled: L,
|
|
2935
|
-
open:
|
|
2943
|
+
open: T,
|
|
2936
2944
|
onOpenChange: L ? void 0 : D,
|
|
2937
|
-
children: /* @__PURE__ */
|
|
2945
|
+
children: /* @__PURE__ */ H(_, {
|
|
2938
2946
|
"aria-label": j,
|
|
2939
2947
|
"aria-disabled": L || void 0,
|
|
2940
|
-
tooltipProps: { tooltip: M },
|
|
2948
|
+
tooltipProps: { tooltip: M ?? N },
|
|
2941
2949
|
iconBefore: B,
|
|
2942
2950
|
iconAfter: z,
|
|
2943
|
-
className:
|
|
2951
|
+
className: d("h-auto gap-1 rounded-full! border-0! p-1.5", Z.modelSelectorButton, L && Z.modelSelectorButtonDisabled, Y.modelSelectorButton)
|
|
2944
2952
|
})
|
|
2945
2953
|
})
|
|
2946
2954
|
});
|
|
2947
|
-
},
|
|
2948
|
-
let
|
|
2949
|
-
|
|
2950
|
-
},
|
|
2955
|
+
}, Zn = Ae(({ message: e = "", messageRevision: t, focusRequestId: n, textInsertion: r, onSend: i, onUploadAttachment: a, onStop: o, isStreaming: s = !1, onChange: c, onAttachmentsChange: l, placeholder: u = "Type a message...", ariaLabel: f, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: S, retryLabel: C, uploadingLabel: w, expandLabel: D, clickLabel: j, sendLabel: M, sendTooltip: N, emptyMessageTooltip: P, stopLabel: ee, micLabel: F = "Dictate", recordVoiceLabel: I = "Record voice", stopRecordingLabel: te, discardRecordingLabel: L, colors: R, typography: z, attachmentTray: B, modelMenu: ne, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: ae, pendingAttachments: oe = [], onPendingAttachmentsConsumed: se, pasteTextThreshold: ce = 4e3, maxMessageLength: le = 5e4, deployments: ue, selectedDeploymentId: de, onDeploymentChange: pe, modelSelectorLabels: me, initialAttachments: he = [], hideAddButton: ge = !1, hideAttachFile: _e = !1, hideActionBar: ve = !1, actionRowLayout: ye = it.Stacked, isInlineActionRowAllowedBelowDesktop: be = !1, isToolChipRowAllowedOnPhone: Se = !1, renderFooterActions: Ce, isInputDisabled: we = !1, isModelSelectorDisabled: Te = !1, isSendDisabled: Ee = !1, isAudioMessageSupported: De = !1, isVoiceRecordingSupported: Oe = De, onTranscribeAudio: ke, transcribingLabel: Ae, voiceErrorLabel: je, sendOnEnter: Me = rt.Enter, prefixAttachments: Pe = [], onRemovePrefixAttachment: Fe, chatSettings: Ie, toolsMenuItems: Le, onToolToggle: Re, canRemoveTools: ze = !0, toolsMenuTitle: Be, toolsBackLabel: Ve, toolsChipLabels: Ue, menuOverlays: We, activeMentions: qe, onBackspaceAtCaret: Je, caretPositionOverride: Xe, commandMenu: Qe, autoFocus: $e = !1, messageHistory: et, onDialFileSystemClick: tt, dialFileSystemLabel: nt, validateAttachment: at, onAttachmentClick: X, modelPickerOverlay: st, onModelPickerOpenChange: lt, maximumAttachmentsAmount: dt, onAttachmentsLimitExceeded: ft, isAttachmentsEnabled: pt = !0, isTextAttachmentsAllowed: mt = !0, usageLimitsSlot: vt, onMessageTooLong: yt }, bt) => {
|
|
2956
|
+
let xt = p(), Ct = m(), wt = Ct && !Se, [Tt, Et] = J(!1), Dt = (e) => {
|
|
2957
|
+
Et(e), lt?.(e);
|
|
2958
|
+
}, Ot = Ge(et), Ft = qe ?? [], It = Ft.length > 0, Lt = K(() => Pt(R), [R]), { message: Q, setMessage: Rt, textareaRef: $ } = Ke({
|
|
2951
2959
|
messageProp: e,
|
|
2952
2960
|
messageRevision: t
|
|
2953
2961
|
});
|
|
2954
|
-
|
|
2955
|
-
let e =
|
|
2962
|
+
G(() => {
|
|
2963
|
+
let e = $.current;
|
|
2956
2964
|
e != null && e.value.length !== 0 && document.activeElement === e && e.setSelectionRange(e.value.length, e.value.length);
|
|
2957
|
-
}, [
|
|
2958
|
-
n !== void 0 &&
|
|
2959
|
-
}, [n,
|
|
2960
|
-
let { handleUndoKeyDown:
|
|
2965
|
+
}, [$]), G(() => {
|
|
2966
|
+
n !== void 0 && $.current?.focus();
|
|
2967
|
+
}, [n, $]), Ne(bt, () => ({ getCaretPosition: () => $.current?.selectionStart ?? Q.length }), [Q, $]);
|
|
2968
|
+
let { handleUndoKeyDown: zt, markCaretPlaced: Bt } = Ye({
|
|
2961
2969
|
insertion: r,
|
|
2962
|
-
textareaRef:
|
|
2963
|
-
}), { isMenuOpen:
|
|
2970
|
+
textareaRef: $
|
|
2971
|
+
}), { isMenuOpen: Vt, query: Ht, activeWordStart: Kt, closeOnOutsidePress: qt, handleValueChange: Jt, commandMenuListboxId: Yt, commandMenuOverlayRef: Xt, activeCommandOptionId: Zt, handleTextareaClick: Qt, handleTextareaFocus: $t, handleTextareaKeyUp: en, skipFocusMenuEvaluationRef: tn, triggerEnd: nn, hasCommandEmptyQueryHint: rn, markerOffset: an, handleCloseCommandMenu: on, isSendGesture: sn, handleCommandMenuKeyDown: cn } = kt({
|
|
2964
2972
|
commandMenu: Qe,
|
|
2965
|
-
message:
|
|
2966
|
-
setMessage:
|
|
2967
|
-
textareaRef:
|
|
2968
|
-
historyNav:
|
|
2973
|
+
message: Q,
|
|
2974
|
+
setMessage: Rt,
|
|
2975
|
+
textareaRef: $,
|
|
2976
|
+
historyNav: Ot,
|
|
2969
2977
|
onChange: c,
|
|
2970
|
-
caretPositionOverride:
|
|
2978
|
+
caretPositionOverride: Xe,
|
|
2971
2979
|
messageRevision: t,
|
|
2972
|
-
markCaretPlaced:
|
|
2973
|
-
sendOnEnter:
|
|
2974
|
-
}),
|
|
2975
|
-
|
|
2976
|
-
let { attachments:
|
|
2977
|
-
initialAttachments:
|
|
2980
|
+
markCaretPlaced: Bt,
|
|
2981
|
+
sendOnEnter: Me
|
|
2982
|
+
}), ln = q(Q);
|
|
2983
|
+
ln.current = Q;
|
|
2984
|
+
let { attachments: un, buildAttachments: dn, addAttachments: fn, resetAttachments: pn, handleRemove: mn, handleRetry: hn, handleExpand: gn, hasBlockedAttachments: _n } = He({
|
|
2985
|
+
initialAttachments: he,
|
|
2978
2986
|
onUploadAttachment: a,
|
|
2979
|
-
onAttachmentsChange:
|
|
2980
|
-
validateAttachment:
|
|
2987
|
+
onAttachmentsChange: l,
|
|
2988
|
+
validateAttachment: at,
|
|
2981
2989
|
pendingDropFiles: ie,
|
|
2982
2990
|
onDropFilesConsumed: ae,
|
|
2983
2991
|
isDropDisabled: we,
|
|
2984
2992
|
pendingAttachments: oe,
|
|
2985
2993
|
onPendingAttachmentsConsumed: se,
|
|
2986
|
-
onExpandPastedText:
|
|
2987
|
-
let t =
|
|
2988
|
-
|
|
2989
|
-
}, [
|
|
2990
|
-
maximumAttachmentsAmount:
|
|
2994
|
+
onExpandPastedText: W((e) => {
|
|
2995
|
+
let t = ln.current, n = t ? `${t}\n${e}` : e;
|
|
2996
|
+
ln.current = n, Rt(n), c?.(n);
|
|
2997
|
+
}, [Rt, c]),
|
|
2998
|
+
maximumAttachmentsAmount: dt,
|
|
2991
2999
|
baseAttachmentsAmount: Pe.length,
|
|
2992
|
-
onAttachmentsLimitExceeded:
|
|
2993
|
-
}), { voiceState:
|
|
2994
|
-
addAttachments:
|
|
2995
|
-
buildAttachments:
|
|
2996
|
-
draftRef:
|
|
2997
|
-
setMessage:
|
|
2998
|
-
historyNav:
|
|
3000
|
+
onAttachmentsLimitExceeded: ft
|
|
3001
|
+
}), { voiceState: vn, analyserNodeRef: yn, voiceError: bn, startRecording: xn, stopRecording: Sn, discardRecording: Cn, isVoiceActive: wn, latestTranscript: Tn } = Nt({
|
|
3002
|
+
addAttachments: fn,
|
|
3003
|
+
buildAttachments: dn,
|
|
3004
|
+
draftRef: ln,
|
|
3005
|
+
setMessage: Rt,
|
|
3006
|
+
historyNav: Ot,
|
|
2999
3007
|
onChange: c,
|
|
3000
3008
|
onTranscribeAudio: ke,
|
|
3001
3009
|
voiceErrorLabel: je,
|
|
3002
|
-
textareaRef:
|
|
3003
|
-
skipFocusMenuEvaluationRef:
|
|
3004
|
-
}),
|
|
3005
|
-
addAttachments:
|
|
3006
|
-
isAttachmentsEnabled:
|
|
3007
|
-
isTextAttachmentsAllowed:
|
|
3010
|
+
textareaRef: $,
|
|
3011
|
+
skipFocusMenuEvaluationRef: tn
|
|
3012
|
+
}), En = q(null), Dn = q(null), On = jt({
|
|
3013
|
+
addAttachments: fn,
|
|
3014
|
+
isAttachmentsEnabled: pt,
|
|
3015
|
+
isTextAttachmentsAllowed: mt,
|
|
3008
3016
|
pasteTextThreshold: ce,
|
|
3009
3017
|
maxMessageLength: le,
|
|
3010
|
-
onMessageTooLong:
|
|
3018
|
+
onMessageTooLong: yt,
|
|
3011
3019
|
commandMenu: Qe
|
|
3012
|
-
}),
|
|
3020
|
+
}), kn = Q.trim().length > 0 || un.length > 0, An = kn && !_n && !Ee && !wn, { visibleTools: jn, handleToolDismiss: Mn } = At({
|
|
3013
3021
|
toolsMenuItems: Le,
|
|
3014
|
-
canRemoveTools:
|
|
3015
|
-
onToolToggle:
|
|
3016
|
-
}), [
|
|
3017
|
-
message:
|
|
3018
|
-
setMessage:
|
|
3019
|
-
attachments:
|
|
3020
|
-
resetAttachments:
|
|
3021
|
-
historyNav:
|
|
3022
|
+
canRemoveTools: ze,
|
|
3023
|
+
onToolToggle: Re
|
|
3024
|
+
}), [Nn, Pn] = J(!1), Fn = ue === void 0 || de != null, In = De && !s, { handleSend: Ln, handleKeyDown: Rn } = Mt({
|
|
3025
|
+
message: Q,
|
|
3026
|
+
setMessage: Rt,
|
|
3027
|
+
attachments: un,
|
|
3028
|
+
resetAttachments: pn,
|
|
3029
|
+
historyNav: Ot,
|
|
3022
3030
|
onSend: i,
|
|
3023
|
-
onMessageTooLong:
|
|
3031
|
+
onMessageTooLong: yt,
|
|
3024
3032
|
maxMessageLength: le,
|
|
3025
3033
|
isSendDisabled: Ee,
|
|
3026
|
-
isVoiceActive:
|
|
3034
|
+
isVoiceActive: wn,
|
|
3027
3035
|
isInputDisabled: we,
|
|
3028
3036
|
isStreaming: s,
|
|
3029
|
-
canSend:
|
|
3030
|
-
hasModelSelected:
|
|
3031
|
-
handleUndoKeyDown:
|
|
3032
|
-
handleCommandMenuKeyDown:
|
|
3033
|
-
isSendGesture:
|
|
3034
|
-
onBackspaceAtCaret:
|
|
3035
|
-
}),
|
|
3037
|
+
canSend: An,
|
|
3038
|
+
hasModelSelected: Fn,
|
|
3039
|
+
handleUndoKeyDown: zt,
|
|
3040
|
+
handleCommandMenuKeyDown: cn,
|
|
3041
|
+
isSendGesture: sn,
|
|
3042
|
+
onBackspaceAtCaret: Je
|
|
3043
|
+
}), zn = (e) => {
|
|
3036
3044
|
let t = Array.from(e.target.files ?? []);
|
|
3037
3045
|
if (t.length === 0) return;
|
|
3038
|
-
let n =
|
|
3039
|
-
e.target.value = "",
|
|
3040
|
-
}, { textareaAreaRef:
|
|
3046
|
+
let n = dn(t);
|
|
3047
|
+
e.target.value = "", fn(n);
|
|
3048
|
+
}, { textareaAreaRef: Bn, caretAnchor: Vn, mirrorInsertions: Hn, isMirrorActive: Un, mirrorRef: Wn, selectionRects: Gn, updateSelectionRects: Kn, handleTextareaScroll: qn } = St({
|
|
3041
3049
|
commandMenu: Qe,
|
|
3042
|
-
message:
|
|
3043
|
-
textareaRef:
|
|
3044
|
-
hasActiveMentions:
|
|
3045
|
-
markerOffset:
|
|
3046
|
-
triggerEnd:
|
|
3047
|
-
hasCommandEmptyQueryHint:
|
|
3048
|
-
}),
|
|
3049
|
-
className:
|
|
3050
|
-
ref:
|
|
3051
|
-
autoFocus:
|
|
3052
|
-
value:
|
|
3050
|
+
message: Q,
|
|
3051
|
+
textareaRef: $,
|
|
3052
|
+
hasActiveMentions: It,
|
|
3053
|
+
markerOffset: an,
|
|
3054
|
+
triggerEnd: nn,
|
|
3055
|
+
hasCommandEmptyQueryHint: rn
|
|
3056
|
+
}), Jn = /* @__PURE__ */ H("textarea", {
|
|
3057
|
+
className: d(Z.textarea, Un && Z.textareaMentionMode, z?.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"),
|
|
3058
|
+
ref: $,
|
|
3059
|
+
autoFocus: $e,
|
|
3060
|
+
value: Q,
|
|
3053
3061
|
onChange: (e) => {
|
|
3054
|
-
|
|
3062
|
+
Rt(e.target.value), Ot.notifyChange();
|
|
3055
3063
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
3056
|
-
|
|
3064
|
+
Jt(e.target.value, e.target.selectionStart ?? e.target.value.length, t?.isComposing ?? !1), c?.(e.target.value);
|
|
3057
3065
|
},
|
|
3058
|
-
onSelect:
|
|
3059
|
-
onScroll:
|
|
3060
|
-
onFocus:
|
|
3061
|
-
onClick:
|
|
3062
|
-
onKeyDown:
|
|
3063
|
-
onKeyUp:
|
|
3064
|
-
onPaste:
|
|
3065
|
-
placeholder:
|
|
3066
|
-
"aria-label":
|
|
3066
|
+
onSelect: Kn,
|
|
3067
|
+
onScroll: qn,
|
|
3068
|
+
onFocus: $t,
|
|
3069
|
+
onClick: Qt,
|
|
3070
|
+
onKeyDown: Rn,
|
|
3071
|
+
onKeyUp: en,
|
|
3072
|
+
onPaste: On,
|
|
3073
|
+
placeholder: u,
|
|
3074
|
+
"aria-label": f,
|
|
3067
3075
|
"aria-autocomplete": Qe == null ? void 0 : "list",
|
|
3068
|
-
"aria-controls":
|
|
3069
|
-
"aria-activedescendant":
|
|
3070
|
-
"aria-hidden":
|
|
3076
|
+
"aria-controls": Vt ? Yt : void 0,
|
|
3077
|
+
"aria-activedescendant": Zt ?? void 0,
|
|
3078
|
+
"aria-hidden": It ? !0 : void 0,
|
|
3071
3079
|
disabled: we,
|
|
3072
|
-
readOnly:
|
|
3080
|
+
readOnly: wn,
|
|
3073
3081
|
rows: 1
|
|
3074
|
-
}),
|
|
3075
|
-
areaRef:
|
|
3076
|
-
mirrorRef:
|
|
3077
|
-
isMirrorActive:
|
|
3078
|
-
fontClassName:
|
|
3079
|
-
message:
|
|
3080
|
-
mentionRanges:
|
|
3081
|
-
mirrorInsertions:
|
|
3082
|
-
selectionRects:
|
|
3083
|
-
children: /* @__PURE__ */
|
|
3084
|
-
textarea:
|
|
3085
|
-
textareaRef:
|
|
3082
|
+
}), Yn = /* @__PURE__ */ H(Gt, {
|
|
3083
|
+
areaRef: Bn,
|
|
3084
|
+
mirrorRef: Wn,
|
|
3085
|
+
isMirrorActive: Un,
|
|
3086
|
+
fontClassName: z?.fontClassName,
|
|
3087
|
+
message: Q,
|
|
3088
|
+
mentionRanges: Ft,
|
|
3089
|
+
mirrorInsertions: Hn,
|
|
3090
|
+
selectionRects: Gn,
|
|
3091
|
+
children: /* @__PURE__ */ H(Wt, {
|
|
3092
|
+
textarea: Jn,
|
|
3093
|
+
textareaRef: $,
|
|
3086
3094
|
commandMenu: Qe,
|
|
3087
|
-
caretAnchor:
|
|
3088
|
-
fontClassName:
|
|
3089
|
-
isMenuOpen:
|
|
3090
|
-
query:
|
|
3091
|
-
activeWordStart:
|
|
3092
|
-
listboxId:
|
|
3093
|
-
activeOptionId:
|
|
3094
|
-
overlayRef:
|
|
3095
|
-
onOutsidePress:
|
|
3096
|
-
onClose:
|
|
3095
|
+
caretAnchor: Vn,
|
|
3096
|
+
fontClassName: z?.fontClassName,
|
|
3097
|
+
isMenuOpen: Vt,
|
|
3098
|
+
query: Ht,
|
|
3099
|
+
activeWordStart: Kt,
|
|
3100
|
+
listboxId: Yt,
|
|
3101
|
+
activeOptionId: Zt,
|
|
3102
|
+
overlayRef: Xt,
|
|
3103
|
+
onOutsidePress: qt,
|
|
3104
|
+
onClose: on
|
|
3097
3105
|
})
|
|
3098
|
-
}),
|
|
3099
|
-
fileInputRef:
|
|
3100
|
-
textareaRef:
|
|
3101
|
-
message:
|
|
3102
|
-
style:
|
|
3103
|
-
hideAttachFile:
|
|
3106
|
+
}), Zn = ge ? void 0 : /* @__PURE__ */ H(Ut, {
|
|
3107
|
+
fileInputRef: En,
|
|
3108
|
+
textareaRef: $,
|
|
3109
|
+
message: Q,
|
|
3110
|
+
style: Lt,
|
|
3111
|
+
hideAttachFile: _e,
|
|
3104
3112
|
isInputDisabled: we,
|
|
3105
3113
|
isStreaming: s,
|
|
3106
|
-
isAttachmentsEnabled:
|
|
3114
|
+
isAttachmentsEnabled: pt,
|
|
3107
3115
|
isVoiceRecordingSupported: Oe,
|
|
3108
|
-
isVoiceActive:
|
|
3109
|
-
startRecording:
|
|
3110
|
-
isPhone:
|
|
3111
|
-
canRemoveTools:
|
|
3116
|
+
isVoiceActive: wn,
|
|
3117
|
+
startRecording: xn,
|
|
3118
|
+
isPhone: wt,
|
|
3119
|
+
canRemoveTools: ze,
|
|
3112
3120
|
toolsMenuItems: Le,
|
|
3113
|
-
onToolToggle:
|
|
3121
|
+
onToolToggle: Re,
|
|
3114
3122
|
chatSettings: Ie,
|
|
3115
|
-
menuOverlays:
|
|
3116
|
-
onDialFileSystemClick:
|
|
3117
|
-
dialFileSystemLabel:
|
|
3123
|
+
menuOverlays: We,
|
|
3124
|
+
onDialFileSystemClick: tt,
|
|
3125
|
+
dialFileSystemLabel: nt,
|
|
3118
3126
|
attachLabel: h,
|
|
3119
3127
|
addMenuTitle: _,
|
|
3120
|
-
menuTitle:
|
|
3121
|
-
menuCloseLabel:
|
|
3128
|
+
menuTitle: v,
|
|
3129
|
+
menuCloseLabel: y,
|
|
3122
3130
|
recordVoiceLabel: I,
|
|
3123
|
-
toolsMenuTitle:
|
|
3124
|
-
toolsBackLabel:
|
|
3125
|
-
}),
|
|
3126
|
-
className:
|
|
3127
|
-
children:
|
|
3128
|
-
}),
|
|
3129
|
-
className:
|
|
3130
|
-
children: [/* @__PURE__ */
|
|
3131
|
-
items:
|
|
3132
|
-
title:
|
|
3133
|
-
summaryLabel:
|
|
3134
|
-
onClick: () =>
|
|
3135
|
-
}), /* @__PURE__ */
|
|
3136
|
-
isOpen:
|
|
3137
|
-
onClose: () =>
|
|
3138
|
-
closeLabel:
|
|
3139
|
-
style:
|
|
3140
|
-
title:
|
|
3141
|
-
items:
|
|
3142
|
-
onToolToggle:
|
|
3131
|
+
toolsMenuTitle: Be,
|
|
3132
|
+
toolsBackLabel: Ve
|
|
3133
|
+
}), Qn = ye === it.Inline && (!xt || be), $n = Zn && /* @__PURE__ */ H("div", {
|
|
3134
|
+
className: d("flex", Y.addCluster),
|
|
3135
|
+
children: Zn
|
|
3136
|
+
}), er = Le ?? [], tr = er.length > 0 && Re != null && /* @__PURE__ */ U("div", {
|
|
3137
|
+
className: d("max-w-full min-w-0 flex-[1_0_auto]", Y.toolsChips),
|
|
3138
|
+
children: [/* @__PURE__ */ H(ut, {
|
|
3139
|
+
items: er,
|
|
3140
|
+
title: Be,
|
|
3141
|
+
summaryLabel: Ue?.summaryLabel,
|
|
3142
|
+
onClick: () => Pn(!0)
|
|
3143
|
+
}), /* @__PURE__ */ H(ot, {
|
|
3144
|
+
isOpen: Nn,
|
|
3145
|
+
onClose: () => Pn(!1),
|
|
3146
|
+
closeLabel: y,
|
|
3147
|
+
style: Lt,
|
|
3148
|
+
title: Be,
|
|
3149
|
+
items: er,
|
|
3150
|
+
onToolToggle: Re
|
|
3143
3151
|
})]
|
|
3144
|
-
}),
|
|
3145
|
-
className:
|
|
3146
|
-
children: /* @__PURE__ */
|
|
3147
|
-
items:
|
|
3148
|
-
onToolToggle:
|
|
3149
|
-
onToolDismiss:
|
|
3150
|
-
canRemove:
|
|
3151
|
-
removeLabel:
|
|
3152
|
-
stateOnLabel:
|
|
3153
|
-
stateOffLabel:
|
|
3152
|
+
}), nr = jn.length > 0 && Re != null && /* @__PURE__ */ H("div", {
|
|
3153
|
+
className: d("min-w-0", Qn ? "flex-1" : "max-w-full flex-[1_0_auto]", Y.toolsChips),
|
|
3154
|
+
children: /* @__PURE__ */ H(ct, {
|
|
3155
|
+
items: jn,
|
|
3156
|
+
onToolToggle: Re,
|
|
3157
|
+
onToolDismiss: Mn,
|
|
3158
|
+
canRemove: ze,
|
|
3159
|
+
removeLabel: Ue?.removeLabel,
|
|
3160
|
+
stateOnLabel: Ue?.stateOnLabel,
|
|
3161
|
+
stateOffLabel: Ue?.stateOffLabel
|
|
3154
3162
|
})
|
|
3155
|
-
}),
|
|
3156
|
-
return /* @__PURE__ */
|
|
3157
|
-
ref:
|
|
3158
|
-
style:
|
|
3159
|
-
className:
|
|
3163
|
+
}), rr = wt ? tr : nr;
|
|
3164
|
+
return /* @__PURE__ */ U("div", {
|
|
3165
|
+
ref: Dn,
|
|
3166
|
+
style: Lt,
|
|
3167
|
+
className: d(Z.wrapper, we && Z.wrapperDisabled, we && "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", re, Y.wrapper),
|
|
3160
3168
|
children: [
|
|
3161
|
-
(Pe.length > 0 ||
|
|
3162
|
-
attachments: [...Pe, ...
|
|
3169
|
+
(Pe.length > 0 || un.length > 0) && /* @__PURE__ */ H(fe, {
|
|
3170
|
+
attachments: [...Pe, ...un],
|
|
3163
3171
|
onRemove: (e) => {
|
|
3164
|
-
Pe.some((t) => t.id === e) ? Fe?.(e) :
|
|
3172
|
+
Pe.some((t) => t.id === e) ? Fe?.(e) : mn(e);
|
|
3165
3173
|
},
|
|
3166
|
-
onRetry:
|
|
3167
|
-
onExpand:
|
|
3174
|
+
onRetry: hn,
|
|
3175
|
+
onExpand: gn,
|
|
3168
3176
|
labels: {
|
|
3169
3177
|
removeLabel: S,
|
|
3170
|
-
retryLabel:
|
|
3171
|
-
uploadingLabel:
|
|
3172
|
-
expandLabel:
|
|
3178
|
+
retryLabel: C,
|
|
3179
|
+
uploadingLabel: w,
|
|
3180
|
+
expandLabel: D,
|
|
3173
3181
|
clickLabel: j
|
|
3174
3182
|
},
|
|
3175
3183
|
styles: {
|
|
3176
|
-
...
|
|
3177
|
-
className:
|
|
3184
|
+
...B,
|
|
3185
|
+
className: d(un.length > 6 && "-me-4", B?.className)
|
|
3178
3186
|
},
|
|
3179
|
-
onAttachmentClick:
|
|
3180
|
-
let t = [...Pe, ...
|
|
3181
|
-
t != null &&
|
|
3187
|
+
onAttachmentClick: X == null ? void 0 : (e) => {
|
|
3188
|
+
let t = [...Pe, ...un].find((t) => t.id === e);
|
|
3189
|
+
t != null && X(t);
|
|
3182
3190
|
}
|
|
3183
3191
|
}),
|
|
3184
|
-
!
|
|
3185
|
-
ref:
|
|
3192
|
+
!ge && /* @__PURE__ */ H("input", {
|
|
3193
|
+
ref: En,
|
|
3186
3194
|
type: "file",
|
|
3187
3195
|
multiple: !0,
|
|
3188
3196
|
accept: g,
|
|
3189
3197
|
className: "sr-only",
|
|
3190
3198
|
"aria-hidden": !0,
|
|
3191
3199
|
tabIndex: -1,
|
|
3192
|
-
onChange:
|
|
3200
|
+
onChange: zn
|
|
3193
3201
|
}),
|
|
3194
|
-
/* @__PURE__ */
|
|
3195
|
-
politeness:
|
|
3202
|
+
/* @__PURE__ */ H(O, {
|
|
3203
|
+
politeness: A.Assertive,
|
|
3196
3204
|
className: "min-w-0 px-1 wrap-break-word",
|
|
3197
|
-
children:
|
|
3205
|
+
children: bn && /* @__PURE__ */ H(T, { text: bn })
|
|
3198
3206
|
}),
|
|
3199
|
-
|
|
3207
|
+
wn && /* @__PURE__ */ H(ht, {
|
|
3200
3208
|
embedded: !0,
|
|
3201
|
-
state:
|
|
3202
|
-
analyserNodeRef:
|
|
3203
|
-
onStop:
|
|
3204
|
-
onDiscard:
|
|
3205
|
-
attachButton:
|
|
3206
|
-
stopLabel:
|
|
3207
|
-
discardLabel:
|
|
3209
|
+
state: vn,
|
|
3210
|
+
analyserNodeRef: yn,
|
|
3211
|
+
onStop: Sn,
|
|
3212
|
+
onDiscard: Cn,
|
|
3213
|
+
attachButton: Zn,
|
|
3214
|
+
stopLabel: te,
|
|
3215
|
+
discardLabel: L,
|
|
3208
3216
|
processingLabel: Ae
|
|
3209
3217
|
}),
|
|
3210
|
-
!
|
|
3211
|
-
!
|
|
3218
|
+
!wn && ve && Yn,
|
|
3219
|
+
!wn && !ve && Qn && rr && /* @__PURE__ */ H("div", {
|
|
3212
3220
|
className: "flex",
|
|
3213
|
-
children:
|
|
3221
|
+
children: rr
|
|
3214
3222
|
}),
|
|
3215
|
-
!
|
|
3216
|
-
className:
|
|
3223
|
+
!wn && !ve && /* @__PURE__ */ U("div", {
|
|
3224
|
+
className: d("flex items-center gap-2", Qn ? "flex-nowrap" : "flex-wrap", Y.actionRow),
|
|
3217
3225
|
children: [
|
|
3218
|
-
|
|
3219
|
-
/* @__PURE__ */
|
|
3220
|
-
className:
|
|
3221
|
-
children:
|
|
3226
|
+
Qn && $n,
|
|
3227
|
+
/* @__PURE__ */ H("div", {
|
|
3228
|
+
className: d("flex min-w-0 items-center self-stretch", Qn ? "flex-1" : "w-full", Y.textareaWrap),
|
|
3229
|
+
children: Yn
|
|
3222
3230
|
}),
|
|
3223
|
-
!
|
|
3224
|
-
!
|
|
3225
|
-
/* @__PURE__ */
|
|
3226
|
-
className:
|
|
3231
|
+
!Qn && $n,
|
|
3232
|
+
!Qn && rr,
|
|
3233
|
+
/* @__PURE__ */ H("div", {
|
|
3234
|
+
className: d("ms-auto flex shrink-0 items-center gap-2", Y.footerActions),
|
|
3227
3235
|
children: Ce ? Ce({
|
|
3228
|
-
canSend:
|
|
3229
|
-
onSend:
|
|
3230
|
-
}) : /* @__PURE__ */
|
|
3231
|
-
|
|
3232
|
-
/* @__PURE__ */
|
|
3233
|
-
deployments:
|
|
3234
|
-
selectedDeploymentId:
|
|
3235
|
-
onDeploymentChange:
|
|
3236
|
-
modelSelectorLabels:
|
|
3236
|
+
canSend: An,
|
|
3237
|
+
onSend: Ln
|
|
3238
|
+
}) : /* @__PURE__ */ U(V, { children: [
|
|
3239
|
+
vt,
|
|
3240
|
+
/* @__PURE__ */ H(Xn, {
|
|
3241
|
+
deployments: ue,
|
|
3242
|
+
selectedDeploymentId: de,
|
|
3243
|
+
onDeploymentChange: pe,
|
|
3244
|
+
modelSelectorLabels: me,
|
|
3237
3245
|
menuStyles: ne,
|
|
3238
|
-
nameClassName:
|
|
3239
|
-
versionClassName:
|
|
3246
|
+
nameClassName: z?.modelSelectorNameClassName,
|
|
3247
|
+
versionClassName: z?.modelSelectorVersionClassName,
|
|
3240
3248
|
isStreaming: s,
|
|
3241
3249
|
isMobile: Ct,
|
|
3242
3250
|
isDisabled: Te,
|
|
3243
|
-
style:
|
|
3244
|
-
modelPickerOverlay:
|
|
3245
|
-
isPickerOpen:
|
|
3246
|
-
onPickerToggle: () =>
|
|
3247
|
-
onPickerOpenChange:
|
|
3251
|
+
style: Lt,
|
|
3252
|
+
modelPickerOverlay: st,
|
|
3253
|
+
isPickerOpen: Tt,
|
|
3254
|
+
onPickerToggle: () => Dt(!Tt),
|
|
3255
|
+
onPickerOpenChange: Dt
|
|
3248
3256
|
}),
|
|
3249
|
-
|
|
3250
|
-
icon: /* @__PURE__ */
|
|
3251
|
-
size:
|
|
3252
|
-
stroke:
|
|
3257
|
+
In && /* @__PURE__ */ H(E, {
|
|
3258
|
+
icon: /* @__PURE__ */ H(xe, {
|
|
3259
|
+
size: b.LG,
|
|
3260
|
+
stroke: x,
|
|
3253
3261
|
"aria-hidden": !0
|
|
3254
3262
|
}),
|
|
3255
3263
|
"aria-label": F,
|
|
3256
3264
|
tooltipProps: { tooltip: F },
|
|
3257
3265
|
className: "shrink-0",
|
|
3258
|
-
onClick: () =>
|
|
3266
|
+
onClick: () => xn(Ze.Dictation),
|
|
3259
3267
|
disabled: we || s
|
|
3260
3268
|
}),
|
|
3261
|
-
s && o ? /* @__PURE__ */
|
|
3269
|
+
s && o ? /* @__PURE__ */ H(_t, {
|
|
3262
3270
|
onStop: o,
|
|
3263
3271
|
ariaLabel: ee
|
|
3264
|
-
}) : !s && /* @__PURE__ */
|
|
3265
|
-
onSend:
|
|
3266
|
-
isDisabled: !
|
|
3272
|
+
}) : !s && /* @__PURE__ */ H(gt, {
|
|
3273
|
+
onSend: Ln,
|
|
3274
|
+
isDisabled: !Fn || !An,
|
|
3267
3275
|
ariaLabel: M,
|
|
3268
|
-
sendTooltip:
|
|
3276
|
+
sendTooltip: kn ? N : P ?? N
|
|
3269
3277
|
})
|
|
3270
3278
|
] })
|
|
3271
3279
|
})
|
|
3272
3280
|
]
|
|
3273
3281
|
}),
|
|
3274
|
-
/* @__PURE__ */
|
|
3282
|
+
/* @__PURE__ */ H(O, {
|
|
3275
3283
|
visuallyHidden: !0,
|
|
3276
3284
|
atomic: !0,
|
|
3277
|
-
as:
|
|
3278
|
-
children: /* @__PURE__ */
|
|
3285
|
+
as: k.Span,
|
|
3286
|
+
children: /* @__PURE__ */ H("span", { children: Tn.text }, Tn.revision)
|
|
3279
3287
|
})
|
|
3280
3288
|
]
|
|
3281
3289
|
});
|
|
3282
3290
|
});
|
|
3283
|
-
|
|
3284
|
-
var
|
|
3291
|
+
Zn.displayName = "Input";
|
|
3292
|
+
var Qn = {
|
|
3285
3293
|
welcome: "_welcome_1icyo_1",
|
|
3286
3294
|
description: "_description_1icyo_5"
|
|
3287
|
-
},
|
|
3295
|
+
}, $n = ({ 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: l, isInputDisabled: u = !1, ...f }) => {
|
|
3288
3296
|
let { colors: p, typography: m, attachmentTray: h, modelMenu: g } = o ?? {}, _ = c({
|
|
3289
3297
|
"--ci-welcome-color": p?.welcomeText,
|
|
3290
3298
|
"--ci-description-color": p?.descriptionText
|
|
3291
3299
|
});
|
|
3292
|
-
return /* @__PURE__ */
|
|
3300
|
+
return /* @__PURE__ */ U("div", {
|
|
3293
3301
|
style: _,
|
|
3294
|
-
className:
|
|
3302
|
+
className: d("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", s),
|
|
3295
3303
|
children: [
|
|
3296
|
-
n && /* @__PURE__ */
|
|
3304
|
+
n && /* @__PURE__ */ U("div", {
|
|
3297
3305
|
className: "flex max-w-full flex-col items-center gap-4 text-center",
|
|
3298
|
-
children: [/* @__PURE__ */
|
|
3299
|
-
className:
|
|
3306
|
+
children: [/* @__PURE__ */ H("h1", {
|
|
3307
|
+
className: d(Qn.welcome, "m-0 max-w-full wrap-anywhere", m?.welcomeClassName || "dial-display2-text"),
|
|
3300
3308
|
children: n
|
|
3301
|
-
}), r && /* @__PURE__ */
|
|
3302
|
-
className:
|
|
3309
|
+
}), r && /* @__PURE__ */ H("p", {
|
|
3310
|
+
className: d(Qn.description, "m-0 max-w-[540px]", m?.descriptionClassName || "dial-body-paragraph-text"),
|
|
3303
3311
|
children: r
|
|
3304
3312
|
})]
|
|
3305
3313
|
}),
|
|
3306
|
-
i != null && /* @__PURE__ */
|
|
3314
|
+
i != null && /* @__PURE__ */ H("div", {
|
|
3307
3315
|
className: "flex w-full max-w-[700px] flex-col items-center empty:hidden",
|
|
3308
3316
|
children: i
|
|
3309
3317
|
}),
|
|
3310
|
-
/* @__PURE__ */
|
|
3311
|
-
className:
|
|
3312
|
-
children: [a != null && /* @__PURE__ */
|
|
3318
|
+
/* @__PURE__ */ U("div", {
|
|
3319
|
+
className: d("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
3320
|
+
children: [a != null && /* @__PURE__ */ H("div", {
|
|
3313
3321
|
className: "mb-2",
|
|
3314
3322
|
children: a
|
|
3315
|
-
}), /* @__PURE__ */
|
|
3323
|
+
}), /* @__PURE__ */ H(Zn, {
|
|
3316
3324
|
placeholder: t,
|
|
3317
3325
|
isStreaming: e,
|
|
3318
|
-
isInputDisabled:
|
|
3326
|
+
isInputDisabled: u,
|
|
3319
3327
|
...f,
|
|
3320
|
-
className:
|
|
3328
|
+
className: l,
|
|
3321
3329
|
colors: p?.input,
|
|
3322
3330
|
typography: m?.input,
|
|
3323
3331
|
attachmentTray: h,
|
|
@@ -3326,35 +3334,35 @@ var qn = {
|
|
|
3326
3334
|
})
|
|
3327
3335
|
]
|
|
3328
3336
|
});
|
|
3329
|
-
},
|
|
3330
|
-
let ce =
|
|
3331
|
-
|
|
3332
|
-
A?.length && (de(A),
|
|
3333
|
-
}, [A,
|
|
3334
|
-
let [
|
|
3335
|
-
|
|
3336
|
-
},
|
|
3337
|
-
|
|
3338
|
-
}, [
|
|
3339
|
-
|
|
3340
|
-
},
|
|
3341
|
-
|
|
3342
|
-
}, [n]),
|
|
3337
|
+
}, er = ({ message: e, messageRevision: t, onChange: n, activeMentions: r, onBackspaceAtCaret: i, caretPositionOverride: o, commandMenu: s, menuOverlays: c, sendOnEnter: l, initialAttachments: u = [], onCancel: f, onSave: p, onUploadAttachment: m, cancelLabel: g = "Cancel", saveLabel: _ = "Save & Submit", ariaLabel: v, removeLabel: y, retryLabel: b, uploadingLabel: S, expandLabel: C, clickLabel: w, addMenuTitle: T = "Add", attachLabel: E = "Attach file", menuTitle: D = "Menu", menuCloseLabel: O = "Close", className: k, pendingDropFiles: A, onDropFilesConsumed: j, validateAttachment: M, isAttachmentsEnabled: P, isTextAttachmentsAllowed: ee, hideAttachFile: F = !1, fileAccept: I, maximumAttachmentsAmount: te, onAttachmentsLimitExceeded: L, onDialFileSystemClick: z, dialFileSystemLabel: B, pendingAttachments: ne, onPendingAttachmentsConsumed: re, onAttachmentClick: ie, pasteTextThreshold: ae, maxMessageLength: oe = 5e4, onMessageTooLong: se }) => {
|
|
3338
|
+
let ce = q(null), le = q(null), [ue, de] = J([]);
|
|
3339
|
+
G(() => {
|
|
3340
|
+
A?.length && (de(A), j?.());
|
|
3341
|
+
}, [A, j]);
|
|
3342
|
+
let [V, fe] = J(e ?? ""), [pe, me] = J([]), [he, ge] = J(u), _e = pe.some((e) => e.status === a.Loading || e.status === a.Error), ve = (V.trim().length > 0 || pe.length > 0 || he.length > 0) && !_e, ye = (e) => {
|
|
3343
|
+
ge((t) => t.filter((t) => t.id !== e));
|
|
3344
|
+
}, xe = W((e, t) => {
|
|
3345
|
+
p(e, he, t);
|
|
3346
|
+
}, [he, p]), Se = () => {
|
|
3347
|
+
ve && (V.length >= oe ? se?.(V.length, oe) : xe(V, pe));
|
|
3348
|
+
}, Ce = W(() => de([]), []), we = W((e) => {
|
|
3349
|
+
fe(e), n?.(e);
|
|
3350
|
+
}, [n]), Te = W((e) => {
|
|
3343
3351
|
let t = Array.from(e.target.files ?? []);
|
|
3344
3352
|
t.length !== 0 && (e.target.value = "", de(t));
|
|
3345
|
-
}, []),
|
|
3353
|
+
}, []), Ee = K(() => z ? [{
|
|
3346
3354
|
key: "dial-fs",
|
|
3347
|
-
label:
|
|
3348
|
-
icon: /* @__PURE__ */
|
|
3349
|
-
size:
|
|
3355
|
+
label: B ?? "DIAL file system",
|
|
3356
|
+
icon: /* @__PURE__ */ H(be, {
|
|
3357
|
+
size: h,
|
|
3350
3358
|
"aria-hidden": !0,
|
|
3351
|
-
stroke:
|
|
3359
|
+
stroke: x
|
|
3352
3360
|
}),
|
|
3353
|
-
onClick:
|
|
3354
|
-
}] : [], [
|
|
3355
|
-
return /* @__PURE__ */
|
|
3356
|
-
className:
|
|
3357
|
-
children: [/* @__PURE__ */
|
|
3361
|
+
onClick: z
|
|
3362
|
+
}] : [], [z, B]);
|
|
3363
|
+
return /* @__PURE__ */ U("div", {
|
|
3364
|
+
className: d("flex w-full flex-col gap-2", k),
|
|
3365
|
+
children: [/* @__PURE__ */ H(Zn, {
|
|
3358
3366
|
ref: le,
|
|
3359
3367
|
message: e,
|
|
3360
3368
|
messageRevision: t,
|
|
@@ -3364,37 +3372,37 @@ var qn = {
|
|
|
3364
3372
|
commandMenu: s,
|
|
3365
3373
|
ariaLabel: v,
|
|
3366
3374
|
hideActionBar: !0,
|
|
3367
|
-
sendOnEnter:
|
|
3375
|
+
sendOnEnter: l,
|
|
3368
3376
|
pendingDropFiles: ue,
|
|
3369
|
-
onDropFilesConsumed:
|
|
3370
|
-
onSend:
|
|
3371
|
-
onUploadAttachment:
|
|
3372
|
-
onChange:
|
|
3373
|
-
onAttachmentsChange:
|
|
3374
|
-
removeLabel:
|
|
3375
|
-
retryLabel:
|
|
3377
|
+
onDropFilesConsumed: Ce,
|
|
3378
|
+
onSend: xe,
|
|
3379
|
+
onUploadAttachment: m,
|
|
3380
|
+
onChange: we,
|
|
3381
|
+
onAttachmentsChange: me,
|
|
3382
|
+
removeLabel: y,
|
|
3383
|
+
retryLabel: b,
|
|
3376
3384
|
uploadingLabel: S,
|
|
3377
3385
|
expandLabel: C,
|
|
3378
3386
|
clickLabel: w,
|
|
3379
3387
|
className: "max-w-full",
|
|
3380
|
-
prefixAttachments:
|
|
3381
|
-
onRemovePrefixAttachment:
|
|
3382
|
-
validateAttachment:
|
|
3388
|
+
prefixAttachments: he,
|
|
3389
|
+
onRemovePrefixAttachment: ye,
|
|
3390
|
+
validateAttachment: M,
|
|
3383
3391
|
isAttachmentsEnabled: P,
|
|
3384
3392
|
isTextAttachmentsAllowed: ee,
|
|
3385
|
-
maximumAttachmentsAmount:
|
|
3386
|
-
onAttachmentsLimitExceeded:
|
|
3393
|
+
maximumAttachmentsAmount: te,
|
|
3394
|
+
onAttachmentsLimitExceeded: L,
|
|
3387
3395
|
pendingAttachments: ne,
|
|
3388
3396
|
onPendingAttachmentsConsumed: re,
|
|
3389
3397
|
onAttachmentClick: ie,
|
|
3390
3398
|
pasteTextThreshold: ae,
|
|
3391
3399
|
maxMessageLength: oe,
|
|
3392
3400
|
onMessageTooLong: se
|
|
3393
|
-
}), /* @__PURE__ */
|
|
3401
|
+
}), /* @__PURE__ */ U("div", {
|
|
3394
3402
|
className: "flex items-center justify-between",
|
|
3395
|
-
children: [/* @__PURE__ */
|
|
3403
|
+
children: [/* @__PURE__ */ U("div", {
|
|
3396
3404
|
className: "flex",
|
|
3397
|
-
children: [!F && /* @__PURE__ */
|
|
3405
|
+
children: [!F && /* @__PURE__ */ H("input", {
|
|
3398
3406
|
ref: ce,
|
|
3399
3407
|
type: "file",
|
|
3400
3408
|
multiple: !0,
|
|
@@ -3402,71 +3410,71 @@ var qn = {
|
|
|
3402
3410
|
className: "sr-only",
|
|
3403
3411
|
"aria-hidden": !0,
|
|
3404
3412
|
tabIndex: -1,
|
|
3405
|
-
onChange:
|
|
3406
|
-
}), (!F || (c?.length ?? 0) > 0) && /* @__PURE__ */
|
|
3413
|
+
onChange: Te
|
|
3414
|
+
}), (!F || (c?.length ?? 0) > 0) && /* @__PURE__ */ H(Ht, {
|
|
3407
3415
|
onAttachClick: F ? void 0 : () => ce.current?.click(),
|
|
3408
3416
|
attachLabel: E,
|
|
3409
3417
|
addMenuTitle: T,
|
|
3410
3418
|
menuTitle: D,
|
|
3411
3419
|
menuCloseLabel: O,
|
|
3412
|
-
extraMenuItems:
|
|
3420
|
+
extraMenuItems: Ee,
|
|
3413
3421
|
menuOverlays: c,
|
|
3414
3422
|
getCaretPosition: () => le.current?.getCaretPosition() ?? 0
|
|
3415
3423
|
})]
|
|
3416
|
-
}), /* @__PURE__ */
|
|
3424
|
+
}), /* @__PURE__ */ U("div", {
|
|
3417
3425
|
className: "flex gap-2",
|
|
3418
|
-
children: [/* @__PURE__ */
|
|
3426
|
+
children: [/* @__PURE__ */ H(N, {
|
|
3419
3427
|
label: g,
|
|
3420
3428
|
onClick: f
|
|
3421
|
-
}), /* @__PURE__ */
|
|
3429
|
+
}), /* @__PURE__ */ H(R, {
|
|
3422
3430
|
label: _,
|
|
3423
|
-
onClick:
|
|
3424
|
-
disabled: !
|
|
3431
|
+
onClick: Se,
|
|
3432
|
+
disabled: !ve
|
|
3425
3433
|
})]
|
|
3426
3434
|
})]
|
|
3427
3435
|
})]
|
|
3428
3436
|
});
|
|
3429
|
-
},
|
|
3437
|
+
}, tr = /* @__PURE__ */ function(e) {
|
|
3430
3438
|
return e.Warning = "warning", e.Reached = "reached", e;
|
|
3431
|
-
}({}),
|
|
3432
|
-
[
|
|
3433
|
-
[
|
|
3434
|
-
},
|
|
3435
|
-
let f = /* @__PURE__ */
|
|
3439
|
+
}({}), nr = { banner: "_banner_180n6_2" }, rr = {
|
|
3440
|
+
[tr.Warning]: I.Warning,
|
|
3441
|
+
[tr.Reached]: I.Error
|
|
3442
|
+
}, ir = ({ 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", isLiveRegion: s = !0, className: l, colors: u }) => {
|
|
3443
|
+
let f = /* @__PURE__ */ H("span", {
|
|
3436
3444
|
className: a,
|
|
3437
3445
|
children: t
|
|
3438
|
-
}), p = n != null && /* @__PURE__ */
|
|
3446
|
+
}), p = n != null && /* @__PURE__ */ U(V, { children: [
|
|
3439
3447
|
" ",
|
|
3440
|
-
/* @__PURE__ */
|
|
3448
|
+
/* @__PURE__ */ H("time", {
|
|
3441
3449
|
dateTime: n.isoValue,
|
|
3442
3450
|
"aria-hidden": n.ariaLabel != null || void 0,
|
|
3443
3451
|
className: o,
|
|
3444
3452
|
children: n.label
|
|
3445
3453
|
}),
|
|
3446
|
-
n.ariaLabel != null && /* @__PURE__ */
|
|
3454
|
+
n.ariaLabel != null && /* @__PURE__ */ H("span", {
|
|
3447
3455
|
className: "sr-only",
|
|
3448
3456
|
children: n.ariaLabel
|
|
3449
3457
|
})
|
|
3450
3458
|
] });
|
|
3451
|
-
return /* @__PURE__ */
|
|
3459
|
+
return /* @__PURE__ */ H(ee, {
|
|
3452
3460
|
role: s ? "status" : "none",
|
|
3453
|
-
variant:
|
|
3454
|
-
type:
|
|
3461
|
+
variant: rr[e],
|
|
3462
|
+
type: F.SectionMessage,
|
|
3455
3463
|
title: p ? f : void 0,
|
|
3456
3464
|
message: p || f,
|
|
3457
|
-
className:
|
|
3458
|
-
style: c({ "--ci-usage-banner-bg":
|
|
3459
|
-
children: r != null && /* @__PURE__ */
|
|
3465
|
+
className: d(nr.banner, Y.usageBanner, l),
|
|
3466
|
+
style: c({ "--ci-usage-banner-bg": u?.background }),
|
|
3467
|
+
children: r != null && /* @__PURE__ */ H(y, {
|
|
3460
3468
|
className: "shrink-0 self-start",
|
|
3461
3469
|
ariaLabel: i,
|
|
3462
3470
|
onClose: () => r()
|
|
3463
3471
|
})
|
|
3464
3472
|
});
|
|
3465
|
-
},
|
|
3466
|
-
let [t, n] =
|
|
3473
|
+
}, ar = (e) => {
|
|
3474
|
+
let [t, n] = J({
|
|
3467
3475
|
text: e?.text,
|
|
3468
3476
|
revision: e?.revision ?? 0
|
|
3469
|
-
}), r =
|
|
3477
|
+
}), r = W((e) => {
|
|
3470
3478
|
n((t) => ({
|
|
3471
3479
|
text: e,
|
|
3472
3480
|
revision: t.revision + 1
|
|
@@ -3477,11 +3485,11 @@ var qn = {
|
|
|
3477
3485
|
messageRevision: t.revision,
|
|
3478
3486
|
seedMessage: r
|
|
3479
3487
|
};
|
|
3480
|
-
},
|
|
3481
|
-
let n =
|
|
3482
|
-
r.current = t,
|
|
3488
|
+
}, or = (e, t) => {
|
|
3489
|
+
let n = q(e), r = q(t);
|
|
3490
|
+
r.current = t, G(() => {
|
|
3483
3491
|
e !== n.current && (n.current = e, r.current());
|
|
3484
3492
|
}, [e]);
|
|
3485
3493
|
};
|
|
3486
3494
|
//#endregion
|
|
3487
|
-
export {
|
|
3495
|
+
export { it as ActionRowLayout, Le as BottomSheetShell, Y as CONVERSATION_INPUT_CLASS, Bt as ChatSettingsModal, $n as ConversationInput, er as EditMessageInput, Zn as Input, rt as SendOnEnter, tr as UsageLimitBannerSeverity, ir as UsageLimitBannerView, ar as useComposerSeed, or as useComposerSeedSource };
|