@epam/ai-dial-conversation-input 1.2.0-dev.3 → 1.2.0-dev.6
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/hooks/useVoiceRecorder.d.ts.map +1 -1
- package/index.js +620 -616
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RESIZABLE_TEXTAREA_CLASS_NAME as r, RequestStatus as i, ResponseFormat as a, SELECT_LIST_MAX_HEIGHT_PX as o, buildCssVars as s, mergeClasses as c, useIsMobile as l } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as
|
|
3
|
-
import { IconArrowLeft as
|
|
4
|
-
import { createElement as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { AttachmentTray as
|
|
2
|
+
import { BASE_ICON_SIZE as u, Button as d, CloseButton as f, DIAL_ICON_SIZE as p, DIAL_KIT_ICON_STROKE as m, Dropdown as h, ElementSize as g, ErrorText as _, GhostIconButton as v, Highlight as y, MenuItemMark as b, NeutralButton as x, Popup as S, PopupSize as C, PrimaryButton as w, PrimaryIconButton as T, RadioGroup as E, RadioGroupOrientation as D, Search as O, Skeleton as k, SkeletonVariant as ee, Slider as A, Spinner as te, StaticIconButton as j, Textarea as M, TextareaResize as ne, Tooltip as re } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as ie, IconArrowNarrowRight as ae, IconCheck as N, IconChevronDown as P, IconChevronRight as oe, IconFile as se, IconMicrophone as ce, IconPaperclip as F, IconPlayerStopFilled as I, IconPlaystationSquare as le, IconPlus as ue, IconSettings as de, IconTool as fe, IconX as pe } from "@tabler/icons-react";
|
|
4
|
+
import { createElement as me, memo as he, useCallback as L, useEffect as R, useImperativeHandle as ge, useLayoutEffect as z, useMemo as B, useRef as V, useState as H } from "react";
|
|
5
|
+
import { createPortal as _e } from "react-dom";
|
|
6
|
+
import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
|
|
7
|
+
import { AttachmentTray as ve, MAX_UPLOADS_PER_MINUTE as ye, generateAttachmentId as be, useClipboardPaste as xe } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var Se = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", Ce = (e, t, n) => {
|
|
10
|
+
R(() => {
|
|
11
11
|
if (!e) return;
|
|
12
12
|
let n = (e) => {
|
|
13
13
|
e.key === "Escape" && t();
|
|
14
14
|
};
|
|
15
15
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
16
|
-
}, [e, t]),
|
|
16
|
+
}, [e, t]), R(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
|
-
}, [e]),
|
|
20
|
+
}, [e]), R(() => {
|
|
21
21
|
if (!e || n?.current == null) return;
|
|
22
22
|
let t = n.current, r = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
23
|
-
(t.querySelector(
|
|
23
|
+
(t.querySelector(Se) ?? t).focus();
|
|
24
24
|
let i = (e) => {
|
|
25
25
|
if (e.key !== "Tab") return;
|
|
26
|
-
let n = Array.from(t.querySelectorAll(
|
|
26
|
+
let n = Array.from(t.querySelectorAll(Se));
|
|
27
27
|
if (n.length === 0) {
|
|
28
28
|
e.preventDefault(), t.focus();
|
|
29
29
|
return;
|
|
@@ -35,27 +35,27 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
35
35
|
document.removeEventListener("keydown", i), r?.focus();
|
|
36
36
|
};
|
|
37
37
|
}, [e, n]);
|
|
38
|
-
},
|
|
38
|
+
}, we = {
|
|
39
39
|
backdrop: "_backdrop_1d50f_9",
|
|
40
40
|
sheet: "_sheet_1d50f_13",
|
|
41
41
|
"slide-up": "_slide-up_1d50f_1",
|
|
42
42
|
title: "_title_1d50f_18",
|
|
43
43
|
divider: "_divider_1d50f_22"
|
|
44
|
-
},
|
|
45
|
-
let y =
|
|
46
|
-
if (
|
|
44
|
+
}, Te = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: l, titleClassName: u = "dial-body-semi-text", className: d, colors: h, children: _ }) => {
|
|
45
|
+
let y = V(null);
|
|
46
|
+
if (Ce(e, r, y), !e || typeof document > "u") return null;
|
|
47
47
|
let b = s({
|
|
48
48
|
"--ci-backdrop": h?.backdrop,
|
|
49
49
|
"--ci-sheet-bg": h?.sheetBg,
|
|
50
50
|
"--ci-sheet-text": h?.sheetText,
|
|
51
51
|
"--ci-sheet-divider": h?.divider
|
|
52
52
|
});
|
|
53
|
-
return
|
|
54
|
-
className: c(
|
|
53
|
+
return _e(/* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
54
|
+
className: c(we.backdrop, "fixed inset-0 z-[55]"),
|
|
55
55
|
style: b,
|
|
56
56
|
onPointerDown: r,
|
|
57
57
|
"aria-hidden": !0
|
|
58
|
-
}), /* @__PURE__ */
|
|
58
|
+
}), /* @__PURE__ */ G("div", {
|
|
59
59
|
ref: y,
|
|
60
60
|
role: "dialog",
|
|
61
61
|
"aria-modal": !0,
|
|
@@ -65,14 +65,14 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
65
65
|
...b,
|
|
66
66
|
...l
|
|
67
67
|
},
|
|
68
|
-
className: c(
|
|
69
|
-
children: [t != null && /* @__PURE__ */
|
|
68
|
+
className: c(we.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", d),
|
|
69
|
+
children: [t != null && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ G("div", {
|
|
70
70
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
71
71
|
children: [
|
|
72
|
-
i && /* @__PURE__ */
|
|
72
|
+
i && /* @__PURE__ */ W("div", {
|
|
73
73
|
className: "absolute start-4",
|
|
74
|
-
children: /* @__PURE__ */
|
|
75
|
-
icon: /* @__PURE__ */
|
|
74
|
+
children: /* @__PURE__ */ W(v, {
|
|
75
|
+
icon: /* @__PURE__ */ W(ie, {
|
|
76
76
|
size: p.LG,
|
|
77
77
|
stroke: m,
|
|
78
78
|
className: "rtl:scale-x-[-1]"
|
|
@@ -81,41 +81,41 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
81
81
|
onClick: i
|
|
82
82
|
})
|
|
83
83
|
}),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
-
className: c(
|
|
84
|
+
/* @__PURE__ */ W("span", {
|
|
85
|
+
className: c(we.title, u),
|
|
86
86
|
children: t
|
|
87
87
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
88
|
+
/* @__PURE__ */ W("div", {
|
|
89
89
|
className: "absolute end-4 m-2",
|
|
90
|
-
children: /* @__PURE__ */
|
|
90
|
+
children: /* @__PURE__ */ W(f, {
|
|
91
91
|
ariaLabel: n,
|
|
92
92
|
onClose: r,
|
|
93
93
|
size: g.Standard
|
|
94
94
|
})
|
|
95
95
|
})
|
|
96
96
|
]
|
|
97
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ W("div", { className: c(we.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ W("div", {
|
|
98
98
|
className: "overflow-y-auto",
|
|
99
99
|
children: _
|
|
100
100
|
})]
|
|
101
101
|
})] }), document.body);
|
|
102
|
-
},
|
|
102
|
+
}, Ee = async (e, t, n) => {
|
|
103
103
|
let r = 6e4 / t, i = [];
|
|
104
104
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
105
105
|
await Promise.allSettled(i);
|
|
106
|
-
},
|
|
107
|
-
let [h, g] =
|
|
108
|
-
|
|
106
|
+
}, De = ({ initialAttachments: n, onUploadAttachment: r, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
107
|
+
let [h, g] = H(n), _ = V(h);
|
|
108
|
+
R(() => {
|
|
109
109
|
_.current = h;
|
|
110
|
-
}, [h]),
|
|
110
|
+
}, [h]), R(() => () => {
|
|
111
111
|
_.current.forEach((e) => {
|
|
112
112
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
113
113
|
});
|
|
114
114
|
}, []);
|
|
115
|
-
let v =
|
|
115
|
+
let v = L((e) => e.map((e) => {
|
|
116
116
|
let n = e.type.startsWith("image/"), r = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = r ? URL.createObjectURL(e) : void 0;
|
|
117
117
|
return {
|
|
118
|
-
id:
|
|
118
|
+
id: be(),
|
|
119
119
|
name: e.name,
|
|
120
120
|
contentType: e.type,
|
|
121
121
|
file: e,
|
|
@@ -124,26 +124,26 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
124
124
|
previewUrl: a,
|
|
125
125
|
playUrl: o
|
|
126
126
|
};
|
|
127
|
-
}), []), y =
|
|
128
|
-
|
|
127
|
+
}), []), y = V(a);
|
|
128
|
+
R(() => {
|
|
129
129
|
y.current = a;
|
|
130
130
|
}, [a]);
|
|
131
|
-
let b =
|
|
131
|
+
let b = V(!0), x = L((e) => {
|
|
132
132
|
g((t) => {
|
|
133
133
|
let n = e(t);
|
|
134
134
|
return n === t ? t : n;
|
|
135
135
|
});
|
|
136
136
|
}, []);
|
|
137
|
-
|
|
137
|
+
R(() => {
|
|
138
138
|
if (b.current) {
|
|
139
139
|
b.current = !1;
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
y.current?.(h);
|
|
143
143
|
}, [h]);
|
|
144
|
-
let S =
|
|
144
|
+
let S = L((e) => {
|
|
145
145
|
g(e);
|
|
146
|
-
}, []), C =
|
|
146
|
+
}, []), C = L(async (t) => {
|
|
147
147
|
if (r) {
|
|
148
148
|
x((e) => e.map((e) => e.id === t.id ? {
|
|
149
149
|
...e,
|
|
@@ -166,7 +166,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
166
166
|
} : e));
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
}, [r, x]), w =
|
|
169
|
+
}, [r, x]), w = L((e, t = !0) => {
|
|
170
170
|
let n = new Set(_.current.map((e) => e.id)), r = e.filter((e) => !n.has(e.id));
|
|
171
171
|
if (r.length !== 0) {
|
|
172
172
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -187,7 +187,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
187
187
|
status: i.Error,
|
|
188
188
|
errorReason: n
|
|
189
189
|
} : e));
|
|
190
|
-
}),
|
|
190
|
+
}), Ee(e, ye, C);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
}, [
|
|
@@ -198,20 +198,20 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
198
198
|
C,
|
|
199
199
|
o
|
|
200
200
|
]);
|
|
201
|
-
|
|
201
|
+
R(() => {
|
|
202
202
|
s.length !== 0 && (w(v(s)), c?.());
|
|
203
203
|
}, [
|
|
204
204
|
w,
|
|
205
205
|
v,
|
|
206
206
|
c,
|
|
207
207
|
s
|
|
208
|
-
]),
|
|
208
|
+
]), R(() => {
|
|
209
209
|
l.length !== 0 && (w(l, !1), u?.());
|
|
210
210
|
}, [
|
|
211
211
|
w,
|
|
212
212
|
u,
|
|
213
213
|
l
|
|
214
|
-
]),
|
|
214
|
+
]), R(() => {
|
|
215
215
|
if (!o) return;
|
|
216
216
|
let t = !1, n = [], r = _.current.map((r) => {
|
|
217
217
|
if (r.status === i.Loading) return r;
|
|
@@ -238,7 +238,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
238
238
|
x,
|
|
239
239
|
C
|
|
240
240
|
]);
|
|
241
|
-
let T =
|
|
241
|
+
let T = L((e) => {
|
|
242
242
|
x((t) => {
|
|
243
243
|
let n = t.find((t) => t.id === e);
|
|
244
244
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -250,11 +250,11 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
250
250
|
addAttachments: w,
|
|
251
251
|
resetAttachments: S,
|
|
252
252
|
handleRemove: T,
|
|
253
|
-
handleRetry:
|
|
253
|
+
handleRetry: L((e) => {
|
|
254
254
|
let t = h.find((t) => t.id === e);
|
|
255
255
|
t && C(t);
|
|
256
256
|
}, [h, C]),
|
|
257
|
-
handleExpand:
|
|
257
|
+
handleExpand: L(async (e) => {
|
|
258
258
|
let n = h.find((t) => t.id === e);
|
|
259
259
|
if (!n || n.type !== t.Pasted) return;
|
|
260
260
|
let r = await n.file.text();
|
|
@@ -266,46 +266,46 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
266
266
|
]),
|
|
267
267
|
hasBlockedAttachments: h.some((e) => e.status === i.Loading || e.status === i.Error)
|
|
268
268
|
};
|
|
269
|
-
},
|
|
269
|
+
}, Oe = (e, t) => {
|
|
270
270
|
if (!e.startsWith(t)) return !1;
|
|
271
271
|
let n = e.slice(t.length);
|
|
272
272
|
return !/\s/.test(n) && !n.includes(t);
|
|
273
|
-
},
|
|
274
|
-
let [n, r] =
|
|
273
|
+
}, ke = ({ config: e, message: t }) => {
|
|
274
|
+
let [n, r] = H(!1), [i, a] = H(!1), o = e != null && Oe(t, e.triggerPrefix) ? t.slice(e.triggerPrefix.length) : "", s = L((n, a, o) => {
|
|
275
275
|
if (e == null || a || t !== "" || i) return;
|
|
276
|
-
let s = n === e.triggerPrefix, c = o === "insertFromPaste" &&
|
|
276
|
+
let s = n === e.triggerPrefix, c = o === "insertFromPaste" && Oe(n, e.triggerPrefix);
|
|
277
277
|
(s || c) && r(!0);
|
|
278
278
|
}, [
|
|
279
279
|
e,
|
|
280
280
|
t,
|
|
281
281
|
i
|
|
282
282
|
]);
|
|
283
|
-
return
|
|
283
|
+
return R(() => {
|
|
284
284
|
if (e == null) {
|
|
285
285
|
r(!1), a(!1);
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
|
-
|
|
288
|
+
Oe(t, e.triggerPrefix) || (r(!1), a(!1));
|
|
289
289
|
}, [e, t]), {
|
|
290
290
|
isMenuOpen: n,
|
|
291
291
|
query: o,
|
|
292
|
-
dismiss:
|
|
292
|
+
dismiss: L(() => {
|
|
293
293
|
r(!1), a(!0);
|
|
294
294
|
}, []),
|
|
295
295
|
handleValueChange: s
|
|
296
296
|
};
|
|
297
|
-
},
|
|
298
|
-
let t =
|
|
297
|
+
}, Ae = (e, t) => !e.slice(0, t).includes("\n"), je = (e, t) => !e.slice(t).includes("\n"), Me = (e) => {
|
|
298
|
+
let t = V(e);
|
|
299
299
|
t.current = e;
|
|
300
|
-
let n =
|
|
300
|
+
let n = V(-1), r = V(""), i = L((e, i, a) => {
|
|
301
301
|
let o = t.current;
|
|
302
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
303
|
-
}, []), a =
|
|
302
|
+
return !o || o.length === 0 ? null : e === "up" ? !Ae(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 || !je(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
303
|
+
}, []), a = L(() => {
|
|
304
304
|
n.current = -1, r.current = "";
|
|
305
|
-
}, []), o =
|
|
305
|
+
}, []), o = L(() => {
|
|
306
306
|
n.current = -1, r.current = "";
|
|
307
307
|
}, []);
|
|
308
|
-
return
|
|
308
|
+
return B(() => ({
|
|
309
309
|
navigate: i,
|
|
310
310
|
notifyChange: a,
|
|
311
311
|
reset: o
|
|
@@ -314,40 +314,40 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
314
314
|
a,
|
|
315
315
|
o
|
|
316
316
|
]);
|
|
317
|
-
},
|
|
318
|
-
let [n, r] =
|
|
319
|
-
return
|
|
317
|
+
}, Ne = ({ messageProp: e, messageRevision: t }) => {
|
|
318
|
+
let [n, r] = H(e), i = V(null);
|
|
319
|
+
return R(() => {
|
|
320
320
|
r(e);
|
|
321
321
|
}, [e, t]), {
|
|
322
322
|
message: n,
|
|
323
323
|
setMessage: r,
|
|
324
324
|
textareaRef: i
|
|
325
325
|
};
|
|
326
|
-
},
|
|
326
|
+
}, Pe = (e, t, n) => {
|
|
327
327
|
let r = Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set;
|
|
328
328
|
r ? r.call(e, t) : e.value = t, e.setSelectionRange(n, n), e.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
329
|
-
},
|
|
330
|
-
let n = e?.revision, r =
|
|
329
|
+
}, Fe = ({ insertion: e, textareaRef: t }) => {
|
|
330
|
+
let n = e?.revision, r = V(e?.text);
|
|
331
331
|
r.current = e?.text;
|
|
332
|
-
let i =
|
|
333
|
-
|
|
332
|
+
let i = V(n);
|
|
333
|
+
R(() => {
|
|
334
334
|
if (n === i.current) return;
|
|
335
335
|
i.current = n;
|
|
336
336
|
let e = t.current, a = r.current;
|
|
337
337
|
if (!e || !a) return;
|
|
338
338
|
let { value: o, selectionStart: s, selectionEnd: c } = e, l = s ?? o.length, u = c ?? l;
|
|
339
|
-
e.focus(), !(typeof document.execCommand == "function" && document.execCommand("insertText", !1, a)) &&
|
|
339
|
+
e.focus(), !(typeof document.execCommand == "function" && document.execCommand("insertText", !1, a)) && Pe(e, `${o.slice(0, l)}${a}${o.slice(u)}`, l + a.length);
|
|
340
340
|
}, [n, t]);
|
|
341
|
-
},
|
|
341
|
+
}, Ie = /* @__PURE__ */ function(e) {
|
|
342
342
|
return e.Idle = "idle", e.Recording = "recording", e.Processing = "processing", e.Error = "error", e;
|
|
343
|
-
}({}),
|
|
343
|
+
}({}), Le = /* @__PURE__ */ function(e) {
|
|
344
344
|
return e.Dictation = "dictation", e.Attachment = "attachment", e;
|
|
345
|
-
}({}),
|
|
345
|
+
}({}), Re = [
|
|
346
346
|
"audio/webm;codecs=opus",
|
|
347
347
|
"audio/ogg;codecs=opus",
|
|
348
348
|
"audio/webm"
|
|
349
|
-
],
|
|
350
|
-
let [i, a] =
|
|
349
|
+
], ze = 100, Be = 100, Ve = .01, He = ({ onAttachAudio: e, onTranscribeAudio: t, onTranscript: n, errorLabel: r = "Voice input failed" }) => {
|
|
350
|
+
let [i, a] = H("idle"), [o, s] = H(null), c = V(null), l = V(null), u = V({
|
|
351
351
|
onAttachAudio: e,
|
|
352
352
|
onTranscribeAudio: t,
|
|
353
353
|
onTranscript: n,
|
|
@@ -359,10 +359,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
359
359
|
onTranscript: n,
|
|
360
360
|
errorLabel: r
|
|
361
361
|
};
|
|
362
|
-
let d =
|
|
362
|
+
let d = L((e = "dictation") => {
|
|
363
363
|
if (l.current) return;
|
|
364
364
|
let t = { controller: new AbortController() };
|
|
365
|
-
l.current = t, a("recording");
|
|
365
|
+
l.current = t, s(null), a("recording");
|
|
366
366
|
let { signal: n } = t.controller, r = e === "dictation" ? u.current.onTranscribeAudio : void 0, i, o, d, f, p = !1, m = !1, h = [], g = () => {
|
|
367
367
|
clearInterval(f), f = void 0;
|
|
368
368
|
}, _ = () => {
|
|
@@ -374,10 +374,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
374
374
|
let v = () => {
|
|
375
375
|
n.aborted || (_(), l.current = null, s(null), a("idle"));
|
|
376
376
|
}, y = (e) => {
|
|
377
|
-
n.aborted || (t.controller.abort(), s(e instanceof Error ? e.message : u.current.errorLabel), a("error"));
|
|
377
|
+
n.aborted || (t.controller.abort(), l.current = null, s(e instanceof Error ? e.message : u.current.errorLabel), a("error"));
|
|
378
378
|
}, b = () => {
|
|
379
379
|
if (!i || n.aborted) return;
|
|
380
|
-
let e =
|
|
380
|
+
let e = Re.find((e) => MediaRecorder.isTypeSupported(e)), t = new MediaRecorder(i, e ? { mimeType: e } : void 0);
|
|
381
381
|
d = t;
|
|
382
382
|
let o = Date.now(), s = !1, l = !1, b = new Uint8Array(c.current?.fftSize ?? 256), x = async () => {
|
|
383
383
|
if (!(m || n.aborted)) {
|
|
@@ -385,7 +385,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
385
385
|
try {
|
|
386
386
|
let i = t.mimeType || e || "audio/webm", c = new Blob(h, { type: i });
|
|
387
387
|
h.length = 0, _();
|
|
388
|
-
let d = Date.now() - o >=
|
|
388
|
+
let d = Date.now() - o >= Be;
|
|
389
389
|
if (c.size && (!r || d && (!s || l))) {
|
|
390
390
|
let e = i.split(";")[0].split("/")[1] ?? "webm", t = new File([c], "voice-" + crypto.randomUUID() + "." + e, { type: i });
|
|
391
391
|
if (r) {
|
|
@@ -411,8 +411,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
411
411
|
e.getByteTimeDomainData(b), s = !0;
|
|
412
412
|
let t = 0;
|
|
413
413
|
for (let e of b) t += ((e - 128) / 128) ** 2;
|
|
414
|
-
Math.sqrt(t / b.length) >=
|
|
415
|
-
},
|
|
414
|
+
Math.sqrt(t / b.length) >= Ve && (l = !0, g());
|
|
415
|
+
}, ze));
|
|
416
416
|
};
|
|
417
417
|
t.stop = () => {
|
|
418
418
|
p || n.aborted || (p = !0, g(), a("processing"), d?.state === "recording" && d.stop());
|
|
@@ -430,10 +430,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
430
430
|
y(e);
|
|
431
431
|
}
|
|
432
432
|
})();
|
|
433
|
-
}, []), f =
|
|
433
|
+
}, []), f = L(() => l.current?.stop?.(), []), p = L(() => {
|
|
434
434
|
l.current?.controller.abort(), l.current = null, s(null), a("idle");
|
|
435
435
|
}, []);
|
|
436
|
-
return
|
|
436
|
+
return R(() => () => {
|
|
437
437
|
l.current?.controller.abort(), l.current = null;
|
|
438
438
|
}, []), {
|
|
439
439
|
state: i,
|
|
@@ -443,12 +443,12 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
443
443
|
stopRecording: f,
|
|
444
444
|
discardRecording: p
|
|
445
445
|
};
|
|
446
|
-
},
|
|
446
|
+
}, Ue = /* @__PURE__ */ function(e) {
|
|
447
447
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
448
|
-
}({}),
|
|
448
|
+
}({}), We = {
|
|
449
449
|
item: "_item_1sr2n_1",
|
|
450
450
|
itemIcon: "_itemIcon_1sr2n_11"
|
|
451
|
-
},
|
|
451
|
+
}, Ge = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: l = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
|
|
452
452
|
let m = (e) => {
|
|
453
453
|
e(), r();
|
|
454
454
|
}, h = s({
|
|
@@ -457,7 +457,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
457
457
|
"--ci-sheet-item-active": p?.itemActiveBg,
|
|
458
458
|
"--ci-sheet-icon": p?.itemIcon
|
|
459
459
|
});
|
|
460
|
-
return /* @__PURE__ */
|
|
460
|
+
return /* @__PURE__ */ W(Te, {
|
|
461
461
|
isOpen: e,
|
|
462
462
|
title: t,
|
|
463
463
|
closeLabel: n,
|
|
@@ -466,23 +466,23 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
466
466
|
className: o,
|
|
467
467
|
titleClassName: l,
|
|
468
468
|
colors: p?.shell,
|
|
469
|
-
children: /* @__PURE__ */
|
|
469
|
+
children: /* @__PURE__ */ W("ul", {
|
|
470
470
|
role: "list",
|
|
471
471
|
className: "flex flex-col",
|
|
472
472
|
style: h,
|
|
473
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
473
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ W("li", { children: /* @__PURE__ */ W(d, {
|
|
474
474
|
type: "button",
|
|
475
|
-
className: c(
|
|
476
|
-
iconBefore: /* @__PURE__ */
|
|
477
|
-
className:
|
|
475
|
+
className: c(We.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
476
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
477
|
+
className: We.itemIcon,
|
|
478
478
|
children: n
|
|
479
479
|
}),
|
|
480
|
-
iconAfter: r ? /* @__PURE__ */
|
|
480
|
+
iconAfter: r ? /* @__PURE__ */ W("span", {
|
|
481
481
|
className: "ms-auto",
|
|
482
482
|
children: r
|
|
483
483
|
}) : null,
|
|
484
484
|
textClassName: f,
|
|
485
|
-
label: /* @__PURE__ */
|
|
485
|
+
label: /* @__PURE__ */ W("span", {
|
|
486
486
|
className: u,
|
|
487
487
|
children: t
|
|
488
488
|
}),
|
|
@@ -490,9 +490,9 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
490
490
|
}) }, e))
|
|
491
491
|
})
|
|
492
492
|
});
|
|
493
|
-
},
|
|
494
|
-
let [s, c] =
|
|
495
|
-
|
|
493
|
+
}, Ke = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
494
|
+
let [s, c] = H(t), [l, u] = H(n), [d, f] = H(r), p = V(o);
|
|
495
|
+
R(() => {
|
|
496
496
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
497
497
|
}, [
|
|
498
498
|
o,
|
|
@@ -509,7 +509,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
509
509
|
setResponseFormat: c,
|
|
510
510
|
setSystemPrompt: u,
|
|
511
511
|
setTemperature: f,
|
|
512
|
-
handleSubmit:
|
|
512
|
+
handleSubmit: L(() => {
|
|
513
513
|
if (!m) return;
|
|
514
514
|
let t = {};
|
|
515
515
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -523,17 +523,17 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
523
523
|
a
|
|
524
524
|
])
|
|
525
525
|
};
|
|
526
|
-
},
|
|
526
|
+
}, qe = { label: "_label_14i7c_1" }, K = ({ features: e, responseFormat: t, systemPrompt: n, temperature: i, onResponseFormatChange: o, onSystemPromptChange: l, onTemperatureChange: u, responseFormatLabel: d = "Response format", responseFormatHint: f = "Applies to new and existing messages", responseFormatMarkdownLabel: p = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: h = "System prompt", systemPromptTooltip: g = "Enter a prompt", temperatureLabel: _ = "Temperature", temperatureLabels: v = [
|
|
527
527
|
"Precise",
|
|
528
528
|
"Neutral",
|
|
529
529
|
"Creative"
|
|
530
530
|
], temperatureHint: y, labelClassName: b = "!dial-small-semi-text", colors: x }) => {
|
|
531
|
-
let S = s({ "--csf-label-text": x?.labelText }), C = c(b,
|
|
532
|
-
return /* @__PURE__ */
|
|
531
|
+
let S = s({ "--csf-label-text": x?.labelText }), C = c(b, qe.label, "gap-1");
|
|
532
|
+
return /* @__PURE__ */ G("div", {
|
|
533
533
|
className: "flex flex-col gap-4 px-6 pb-3",
|
|
534
534
|
style: S,
|
|
535
535
|
children: [
|
|
536
|
-
e.responseFormat && /* @__PURE__ */
|
|
536
|
+
e.responseFormat && /* @__PURE__ */ W(E, {
|
|
537
537
|
id: "response-format",
|
|
538
538
|
labelProps: {
|
|
539
539
|
label: d,
|
|
@@ -552,18 +552,18 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
552
552
|
}],
|
|
553
553
|
onChange: (e) => o(e)
|
|
554
554
|
}),
|
|
555
|
-
e.systemPrompt && /* @__PURE__ */
|
|
555
|
+
e.systemPrompt && /* @__PURE__ */ W(M, {
|
|
556
556
|
value: n,
|
|
557
557
|
placeholder: g,
|
|
558
558
|
className: r,
|
|
559
|
-
resize:
|
|
559
|
+
resize: ne.Vertical,
|
|
560
560
|
labelProps: {
|
|
561
561
|
className: C,
|
|
562
562
|
label: h
|
|
563
563
|
},
|
|
564
564
|
onChange: (e) => l(e ?? "")
|
|
565
565
|
}),
|
|
566
|
-
e.temperature && /* @__PURE__ */
|
|
566
|
+
e.temperature && /* @__PURE__ */ W(A, {
|
|
567
567
|
labelProps: {
|
|
568
568
|
label: _,
|
|
569
569
|
className: C,
|
|
@@ -579,8 +579,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
579
579
|
})
|
|
580
580
|
]
|
|
581
581
|
});
|
|
582
|
-
},
|
|
583
|
-
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } =
|
|
582
|
+
}, Je = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: s, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: S = "Apply changes", saveDisabledTooltip: C }) => {
|
|
583
|
+
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: k, setSystemPrompt: ee, setTemperature: A, handleSubmit: te } = Ke({
|
|
584
584
|
isOpen: e,
|
|
585
585
|
features: o,
|
|
586
586
|
initialResponseFormat: s,
|
|
@@ -589,7 +589,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
589
589
|
onSave: d,
|
|
590
590
|
onClose: r
|
|
591
591
|
});
|
|
592
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ G(Te, {
|
|
593
593
|
isOpen: e,
|
|
594
594
|
title: f,
|
|
595
595
|
closeLabel: i,
|
|
@@ -597,7 +597,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
597
597
|
onBack: t,
|
|
598
598
|
backLabel: n,
|
|
599
599
|
style: a,
|
|
600
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ W(K, {
|
|
601
601
|
features: o,
|
|
602
602
|
responseFormat: T,
|
|
603
603
|
systemPrompt: E,
|
|
@@ -614,13 +614,13 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
614
614
|
temperatureLabel: y,
|
|
615
615
|
temperatureLabels: b,
|
|
616
616
|
temperatureHint: x
|
|
617
|
-
}), /* @__PURE__ */
|
|
617
|
+
}), /* @__PURE__ */ W("div", {
|
|
618
618
|
className: c("px-6 py-4 mobile:pb-8"),
|
|
619
|
-
children: /* @__PURE__ */
|
|
619
|
+
children: /* @__PURE__ */ W(re, {
|
|
620
620
|
tooltip: C,
|
|
621
621
|
hideTooltip: O || !C,
|
|
622
622
|
triggerClassName: "w-full",
|
|
623
|
-
children: /* @__PURE__ */
|
|
623
|
+
children: /* @__PURE__ */ W(w, {
|
|
624
624
|
label: S,
|
|
625
625
|
onClick: te,
|
|
626
626
|
disabled: !O,
|
|
@@ -629,8 +629,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
629
629
|
})
|
|
630
630
|
})]
|
|
631
631
|
});
|
|
632
|
-
},
|
|
633
|
-
let { responseFormat: b, systemPrompt: x, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } =
|
|
632
|
+
}, Ye = { modal: "_modal_kl0h0_1" }, Xe = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", titleClassName: s = "dial-h1-text", responseFormatLabel: c, responseFormatHint: l, responseFormatMarkdownLabel: u, responseFormatPlainTextLabel: d, systemPromptLabel: f, systemPromptTooltip: p, temperatureLabel: m, temperatureLabels: h, temperatureHint: g, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = Ye.modal }) => {
|
|
633
|
+
let { responseFormat: b, systemPrompt: x, temperature: T, canSubmit: E, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: ee } = Ke({
|
|
634
634
|
features: e,
|
|
635
635
|
initialResponseFormat: t,
|
|
636
636
|
initialSystemPrompt: n,
|
|
@@ -638,26 +638,26 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
638
638
|
onSave: i,
|
|
639
639
|
onClose: a
|
|
640
640
|
});
|
|
641
|
-
return /* @__PURE__ */
|
|
641
|
+
return /* @__PURE__ */ W(S, {
|
|
642
642
|
open: !0,
|
|
643
643
|
header: o,
|
|
644
644
|
titleClassName: s,
|
|
645
645
|
size: C.Sm,
|
|
646
646
|
onClose: a,
|
|
647
647
|
className: y,
|
|
648
|
-
footer: /* @__PURE__ */
|
|
648
|
+
footer: /* @__PURE__ */ W("div", {
|
|
649
649
|
className: "flex justify-end px-6 py-4",
|
|
650
|
-
children: /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ W(re, {
|
|
651
651
|
tooltip: v,
|
|
652
652
|
hideTooltip: E || !v,
|
|
653
|
-
children: /* @__PURE__ */
|
|
653
|
+
children: /* @__PURE__ */ W(w, {
|
|
654
654
|
label: _,
|
|
655
655
|
onClick: ee,
|
|
656
656
|
disabled: !E
|
|
657
657
|
})
|
|
658
658
|
})
|
|
659
659
|
}),
|
|
660
|
-
children: /* @__PURE__ */
|
|
660
|
+
children: /* @__PURE__ */ W(K, {
|
|
661
661
|
features: e,
|
|
662
662
|
responseFormat: b,
|
|
663
663
|
systemPrompt: x,
|
|
@@ -676,10 +676,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
676
676
|
temperatureHint: g
|
|
677
677
|
})
|
|
678
678
|
});
|
|
679
|
-
},
|
|
679
|
+
}, Ze = {
|
|
680
680
|
icon: "_icon_1fv6z_1",
|
|
681
681
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
682
|
-
},
|
|
682
|
+
}, Qe = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: l, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: h }) => /* @__PURE__ */ W(Te, {
|
|
683
683
|
isOpen: e,
|
|
684
684
|
title: o,
|
|
685
685
|
closeLabel: i,
|
|
@@ -687,33 +687,33 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
687
687
|
onBack: t,
|
|
688
688
|
backLabel: n,
|
|
689
689
|
style: a,
|
|
690
|
-
children: /* @__PURE__ */
|
|
690
|
+
children: /* @__PURE__ */ W("ul", {
|
|
691
691
|
role: "menu",
|
|
692
692
|
className: "flex flex-col pb-4",
|
|
693
693
|
style: s({
|
|
694
694
|
"--tbs-icon-text": h?.iconText,
|
|
695
695
|
"--tbs-selected-icon-text": h?.selectedIconText
|
|
696
696
|
}),
|
|
697
|
-
children: l.map((e) => /* @__PURE__ */
|
|
697
|
+
children: l.map((e) => /* @__PURE__ */ W("li", {
|
|
698
698
|
role: "none",
|
|
699
|
-
children: /* @__PURE__ */
|
|
699
|
+
children: /* @__PURE__ */ W(d, {
|
|
700
700
|
type: "button",
|
|
701
701
|
role: "menuitemcheckbox",
|
|
702
702
|
"aria-checked": e.isSelected,
|
|
703
703
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
704
|
-
iconBefore: /* @__PURE__ */
|
|
705
|
-
className: c("flex items-center",
|
|
704
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
705
|
+
className: c("flex items-center", Ze.icon),
|
|
706
706
|
children: e.icon
|
|
707
707
|
}),
|
|
708
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
709
|
-
className: c("ms-auto",
|
|
710
|
-
children: /* @__PURE__ */
|
|
708
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ W("span", {
|
|
709
|
+
className: c("ms-auto", Ze.selectedIcon),
|
|
710
|
+
children: /* @__PURE__ */ W(N, {
|
|
711
711
|
size: u,
|
|
712
712
|
"aria-hidden": !0,
|
|
713
713
|
stroke: m
|
|
714
714
|
})
|
|
715
715
|
}) : null,
|
|
716
|
-
label: /* @__PURE__ */
|
|
716
|
+
label: /* @__PURE__ */ W("span", {
|
|
717
717
|
className: p,
|
|
718
718
|
children: e.label
|
|
719
719
|
}),
|
|
@@ -721,19 +721,19 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
721
721
|
})
|
|
722
722
|
}, e.id))
|
|
723
723
|
})
|
|
724
|
-
}),
|
|
724
|
+
}), $e = {
|
|
725
725
|
toolIcon: "_toolIcon_ma5s5_1",
|
|
726
726
|
chevronIcon: "_chevronIcon_ma5s5_5"
|
|
727
|
-
},
|
|
728
|
-
let k = l(), [ee, A] =
|
|
727
|
+
}, et = ({ onAttachClick: e, onRecordVoice: t, recordVoiceLabel: n = "Record voice", attachLabel: r, addMenuTitle: i, menuTitle: o, menuCloseLabel: d, style: f, listClassName: _ = "w-[240px]", isDisabled: y = !1, chatSettings: x, extraMenuItems: S, toolsMenuItems: C = [], onToolToggle: w, toolsMenuTitle: T = "Tools", toolsBackLabel: E = "Back", menuOverlays: D, colors: O }) => {
|
|
728
|
+
let k = l(), [ee, A] = H(!1), [te, j] = H(!1), [M, ne] = H(!1), [re, ie] = H(null), [ae, N] = H(!1), P = B(() => s({
|
|
729
729
|
"--aab-tool-icon": O?.toolIcon,
|
|
730
730
|
"--aab-chevron-icon": O?.chevronIcon
|
|
731
|
-
}), [O?.toolIcon, O?.chevronIcon]), se = C.length > 0 && w != null,
|
|
731
|
+
}), [O?.toolIcon, O?.chevronIcon]), se = C.length > 0 && w != null, I = D != null && D.length > 0, le = B(() => C.map((e) => ({
|
|
732
732
|
key: e.id,
|
|
733
733
|
label: e.label,
|
|
734
|
-
icon: /* @__PURE__ */
|
|
735
|
-
style:
|
|
736
|
-
className: c("flex items-center",
|
|
734
|
+
icon: /* @__PURE__ */ W("span", {
|
|
735
|
+
style: P,
|
|
736
|
+
className: c("flex items-center", $e.toolIcon),
|
|
737
737
|
children: e.icon
|
|
738
738
|
}),
|
|
739
739
|
selectable: !0,
|
|
@@ -743,12 +743,12 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
743
743
|
})), [
|
|
744
744
|
C,
|
|
745
745
|
w,
|
|
746
|
-
|
|
747
|
-
]),
|
|
746
|
+
P
|
|
747
|
+
]), pe = B(() => [
|
|
748
748
|
...e == null ? [] : [{
|
|
749
749
|
key: "attach",
|
|
750
750
|
label: r,
|
|
751
|
-
icon: /* @__PURE__ */
|
|
751
|
+
icon: /* @__PURE__ */ W(F, {
|
|
752
752
|
size: u,
|
|
753
753
|
"aria-hidden": !0,
|
|
754
754
|
stroke: m
|
|
@@ -759,68 +759,68 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
759
759
|
...se ? [{
|
|
760
760
|
key: "tools",
|
|
761
761
|
label: T,
|
|
762
|
-
icon: /* @__PURE__ */
|
|
762
|
+
icon: /* @__PURE__ */ W(fe, {
|
|
763
763
|
size: u,
|
|
764
764
|
"aria-hidden": !0,
|
|
765
765
|
stroke: m
|
|
766
766
|
}),
|
|
767
767
|
onClick: k ? () => {
|
|
768
|
-
|
|
768
|
+
ne(!0), A(!1);
|
|
769
769
|
} : () => void 0,
|
|
770
|
-
...k ? { iconAfter: /* @__PURE__ */
|
|
770
|
+
...k ? { iconAfter: /* @__PURE__ */ W(oe, {
|
|
771
771
|
size: u,
|
|
772
772
|
stroke: m,
|
|
773
|
-
style:
|
|
774
|
-
className: c("rtl:scale-x-[-1]",
|
|
773
|
+
style: P,
|
|
774
|
+
className: c("rtl:scale-x-[-1]", $e.chevronIcon),
|
|
775
775
|
"aria-hidden": !0
|
|
776
|
-
}) } : { children:
|
|
776
|
+
}) } : { children: le }
|
|
777
777
|
}] : [],
|
|
778
778
|
...(D ?? []).map((e) => ({
|
|
779
779
|
key: e.key,
|
|
780
780
|
label: e.title,
|
|
781
781
|
icon: e.icon,
|
|
782
782
|
onClick: k ? () => {
|
|
783
|
-
|
|
783
|
+
ie(e.key), A(!1);
|
|
784
784
|
} : () => void 0,
|
|
785
|
-
...k ? { iconAfter: /* @__PURE__ */
|
|
785
|
+
...k ? { iconAfter: /* @__PURE__ */ W(oe, {
|
|
786
786
|
size: u,
|
|
787
787
|
stroke: m,
|
|
788
|
-
style:
|
|
789
|
-
className: c("rtl:scale-x-[-1]",
|
|
788
|
+
style: P,
|
|
789
|
+
className: c("rtl:scale-x-[-1]", $e.chevronIcon),
|
|
790
790
|
"aria-hidden": !0
|
|
791
791
|
}) } : {
|
|
792
792
|
children: [{
|
|
793
793
|
key: `${e.key}-panel`,
|
|
794
794
|
label: ""
|
|
795
795
|
}],
|
|
796
|
-
renderSubMenu: () => e.renderOverlay(() =>
|
|
796
|
+
renderSubMenu: () => e.renderOverlay(() => N(!1))
|
|
797
797
|
}
|
|
798
798
|
})),
|
|
799
799
|
...t == null ? [] : [{
|
|
800
800
|
key: "record-voice",
|
|
801
801
|
label: n,
|
|
802
|
-
icon: /* @__PURE__ */
|
|
802
|
+
icon: /* @__PURE__ */ W(ce, {
|
|
803
803
|
size: u,
|
|
804
804
|
"aria-hidden": !0,
|
|
805
805
|
stroke: m
|
|
806
806
|
}),
|
|
807
807
|
onClick: () => {
|
|
808
|
-
A(!1),
|
|
808
|
+
A(!1), N(!1), t();
|
|
809
809
|
}
|
|
810
810
|
}],
|
|
811
811
|
...x == null ? [] : [{
|
|
812
812
|
key: "chat-settings",
|
|
813
813
|
label: x.menuItemLabel ?? "Chat settings",
|
|
814
|
-
icon: /* @__PURE__ */
|
|
814
|
+
icon: /* @__PURE__ */ W(de, {
|
|
815
815
|
size: u,
|
|
816
816
|
"aria-hidden": !0,
|
|
817
817
|
stroke: m
|
|
818
818
|
}),
|
|
819
|
-
iconAfter: k ? /* @__PURE__ */
|
|
819
|
+
iconAfter: k ? /* @__PURE__ */ W(oe, {
|
|
820
820
|
size: u,
|
|
821
821
|
stroke: m,
|
|
822
|
-
style:
|
|
823
|
-
className: c("rtl:scale-x-[-1]",
|
|
822
|
+
style: P,
|
|
823
|
+
className: c("rtl:scale-x-[-1]", $e.chevronIcon),
|
|
824
824
|
"aria-hidden": !0
|
|
825
825
|
}) : null,
|
|
826
826
|
onClick: () => j(!0)
|
|
@@ -835,20 +835,20 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
835
835
|
k,
|
|
836
836
|
se,
|
|
837
837
|
T,
|
|
838
|
-
|
|
838
|
+
le,
|
|
839
839
|
D,
|
|
840
|
-
|
|
840
|
+
P
|
|
841
841
|
]);
|
|
842
|
-
if (
|
|
843
|
-
let
|
|
842
|
+
if (pe.length === 0) return null;
|
|
843
|
+
let me = /* @__PURE__ */ W(h, {
|
|
844
844
|
matchReferenceWidth: !1,
|
|
845
845
|
placement: "bottom-start",
|
|
846
846
|
listClassName: _,
|
|
847
|
-
items:
|
|
848
|
-
open:
|
|
849
|
-
onOpenChange:
|
|
850
|
-
children: /* @__PURE__ */
|
|
851
|
-
icon: /* @__PURE__ */
|
|
847
|
+
items: pe,
|
|
848
|
+
open: I ? ae : void 0,
|
|
849
|
+
onOpenChange: I ? N : void 0,
|
|
850
|
+
children: /* @__PURE__ */ W(v, {
|
|
851
|
+
icon: /* @__PURE__ */ W(ue, {
|
|
852
852
|
size: p.LG,
|
|
853
853
|
"aria-hidden": !0,
|
|
854
854
|
stroke: m
|
|
@@ -858,9 +858,9 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
858
858
|
disabled: y
|
|
859
859
|
})
|
|
860
860
|
});
|
|
861
|
-
return /* @__PURE__ */ U
|
|
862
|
-
/* @__PURE__ */
|
|
863
|
-
icon: /* @__PURE__ */
|
|
861
|
+
return /* @__PURE__ */ W(U, { children: k ? /* @__PURE__ */ G(U, { children: [
|
|
862
|
+
/* @__PURE__ */ W(v, {
|
|
863
|
+
icon: /* @__PURE__ */ W(ue, {
|
|
864
864
|
size: p.LG,
|
|
865
865
|
"aria-hidden": !0,
|
|
866
866
|
stroke: m
|
|
@@ -871,42 +871,42 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
871
871
|
disabled: y,
|
|
872
872
|
onClick: () => A(!0)
|
|
873
873
|
}),
|
|
874
|
-
/* @__PURE__ */
|
|
874
|
+
/* @__PURE__ */ W(Ge, {
|
|
875
875
|
isOpen: ee,
|
|
876
876
|
title: o,
|
|
877
877
|
closeLabel: d,
|
|
878
878
|
onClose: () => A(!1),
|
|
879
879
|
style: f,
|
|
880
|
-
items:
|
|
880
|
+
items: pe,
|
|
881
881
|
className: "pb-4",
|
|
882
882
|
btnTextClassName: "flex-1"
|
|
883
883
|
}),
|
|
884
|
-
se && /* @__PURE__ */
|
|
885
|
-
isOpen:
|
|
884
|
+
se && /* @__PURE__ */ W(Qe, {
|
|
885
|
+
isOpen: M,
|
|
886
886
|
onBack: () => {
|
|
887
|
-
|
|
887
|
+
ne(!1), A(!0);
|
|
888
888
|
},
|
|
889
889
|
backLabel: E,
|
|
890
|
-
onClose: () =>
|
|
890
|
+
onClose: () => ne(!1),
|
|
891
891
|
closeLabel: d,
|
|
892
892
|
style: f,
|
|
893
893
|
title: T,
|
|
894
894
|
items: C,
|
|
895
895
|
onToolToggle: w
|
|
896
896
|
}),
|
|
897
|
-
D?.map((e) => /* @__PURE__ */
|
|
898
|
-
isOpen:
|
|
897
|
+
D?.map((e) => /* @__PURE__ */ W(Te, {
|
|
898
|
+
isOpen: re === e.key,
|
|
899
899
|
title: e.title,
|
|
900
900
|
closeLabel: d,
|
|
901
901
|
onBack: () => {
|
|
902
|
-
|
|
902
|
+
ie(null), A(!0);
|
|
903
903
|
},
|
|
904
904
|
backLabel: e.backLabel ?? "Back",
|
|
905
|
-
onClose: () =>
|
|
905
|
+
onClose: () => ie(null),
|
|
906
906
|
style: f,
|
|
907
|
-
children: e.renderOverlay(() =>
|
|
907
|
+
children: e.renderOverlay(() => ie(null))
|
|
908
908
|
}, e.key)),
|
|
909
|
-
x != null && /* @__PURE__ */
|
|
909
|
+
x != null && /* @__PURE__ */ W(Je, {
|
|
910
910
|
isOpen: te,
|
|
911
911
|
onBack: () => {
|
|
912
912
|
j(!1), A(!0);
|
|
@@ -933,7 +933,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
933
933
|
saveLabel: x.saveLabel,
|
|
934
934
|
saveDisabledTooltip: x.saveDisabledTooltip
|
|
935
935
|
})
|
|
936
|
-
] }) : /* @__PURE__ */
|
|
936
|
+
] }) : /* @__PURE__ */ G(U, { children: [me, x != null && te && /* @__PURE__ */ W(Xe, {
|
|
937
937
|
features: x.features,
|
|
938
938
|
initialResponseFormat: x.responseFormat ?? a.Markdown,
|
|
939
939
|
initialSystemPrompt: x.systemPrompt,
|
|
@@ -953,13 +953,13 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
953
953
|
saveLabel: x.saveLabel,
|
|
954
954
|
saveDisabledTooltip: x.saveDisabledTooltip
|
|
955
955
|
})] }) });
|
|
956
|
-
},
|
|
956
|
+
}, tt = {
|
|
957
957
|
chip: "_chip_ydmd8_1",
|
|
958
958
|
chipSelected: "_chipSelected_ydmd8_9",
|
|
959
959
|
chipIcon: "_chipIcon_ydmd8_16",
|
|
960
960
|
chipText: "_chipText_ydmd8_19",
|
|
961
961
|
chipClose: "_chipClose_ydmd8_22"
|
|
962
|
-
},
|
|
962
|
+
}, nt = (e) => `Remove ${e}`, rt = ({ items: e, onToolToggle: t, onToolDismiss: n, canRemove: r = !0, removeLabel: i = nt, typography: a, colors: o }) => e.length === 0 ? null : /* @__PURE__ */ W("div", {
|
|
963
963
|
className: "flex flex-wrap items-center gap-2",
|
|
964
964
|
style: s({
|
|
965
965
|
"--ci-chip-bg": o?.chipBg,
|
|
@@ -974,34 +974,34 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
974
974
|
"--ci-chip-close": o?.chipClose,
|
|
975
975
|
"--ci-chip-close-hover": o?.chipCloseHover
|
|
976
976
|
}),
|
|
977
|
-
children: e.map((e) => /* @__PURE__ */
|
|
978
|
-
className: c(
|
|
979
|
-
children: [/* @__PURE__ */
|
|
977
|
+
children: e.map((e) => /* @__PURE__ */ G("div", {
|
|
978
|
+
className: c(tt.chip, e.isSelected && tt.chipSelected, "flex min-w-0 items-center gap-1.5 rounded-full border py-1 transition-colors", r ? "pe-1 ps-2" : "px-2"),
|
|
979
|
+
children: [/* @__PURE__ */ G("button", {
|
|
980
980
|
type: "button",
|
|
981
981
|
onClick: () => t(e.id),
|
|
982
982
|
"aria-pressed": e.isSelected,
|
|
983
983
|
className: "flex min-w-0 items-center gap-1.5",
|
|
984
|
-
children: [/* @__PURE__ */
|
|
985
|
-
className: c(
|
|
984
|
+
children: [/* @__PURE__ */ W("span", {
|
|
985
|
+
className: c(tt.chipIcon, "shrink-0"),
|
|
986
986
|
"aria-hidden": !0,
|
|
987
987
|
children: e.icon
|
|
988
|
-
}), /* @__PURE__ */
|
|
989
|
-
className: c(
|
|
988
|
+
}), /* @__PURE__ */ W("span", {
|
|
989
|
+
className: c(tt.chipText, a?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
990
990
|
children: e.label
|
|
991
991
|
})]
|
|
992
|
-
}), r && /* @__PURE__ */
|
|
992
|
+
}), r && /* @__PURE__ */ W("button", {
|
|
993
993
|
type: "button",
|
|
994
994
|
onClick: () => n(e.id),
|
|
995
995
|
"aria-label": i(e.label),
|
|
996
|
-
className: c(
|
|
997
|
-
children: /* @__PURE__ */
|
|
996
|
+
className: c(tt.chipClose, "flex shrink-0 items-center rounded p-0.5 transition-colors"),
|
|
997
|
+
children: /* @__PURE__ */ W(pe, {
|
|
998
998
|
size: 12,
|
|
999
999
|
"aria-hidden": !0,
|
|
1000
1000
|
stroke: m
|
|
1001
1001
|
})
|
|
1002
1002
|
})]
|
|
1003
1003
|
}, e.id))
|
|
1004
|
-
}),
|
|
1004
|
+
}), q = {
|
|
1005
1005
|
wrapper: "_wrapper_q1jcl_2",
|
|
1006
1006
|
wrapperDisabled: "_wrapperDisabled_q1jcl_9",
|
|
1007
1007
|
textarea: "_textarea_q1jcl_13",
|
|
@@ -1012,34 +1012,34 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1012
1012
|
modelSelectorName: "_modelSelectorName_q1jcl_50",
|
|
1013
1013
|
modelSelectorVersion: "_modelSelectorVersion_q1jcl_53",
|
|
1014
1014
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_q1jcl_62"
|
|
1015
|
-
},
|
|
1015
|
+
}, it = {
|
|
1016
1016
|
wrapperError: "_wrapperError_129ri_1",
|
|
1017
1017
|
waveformCanvas: "_waveformCanvas_129ri_5",
|
|
1018
1018
|
recordingDot: "_recordingDot_129ri_19",
|
|
1019
1019
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
1020
|
-
},
|
|
1021
|
-
let h =
|
|
1020
|
+
}, at = 3, ot = 4, st = 200, ct = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, attachButton: a, stopLabel: o = "Stop recording", discardLabel: s = "Discard recording", processingLabel: l = "Transcribing audio…", style: u, className: d, embedded: f = !1 }) => {
|
|
1021
|
+
let h = V(null), g = V(new Float32Array(st)), y = V(0), b = V(0), x = e === Ie.Recording, S = e === Ie.Error, C = e === Ie.Processing, w = L((e) => {
|
|
1022
1022
|
let t = e.getContext("2d");
|
|
1023
1023
|
if (!t) return;
|
|
1024
1024
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
1025
1025
|
let { width: n, height: r } = e;
|
|
1026
1026
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
1027
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
1027
|
+
let i = Math.min(Math.max(1, Math.floor(n / ot)), st - 1), a = y.current, o = b.current;
|
|
1028
1028
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
1029
1029
|
for (let e = 0; e <= i; e++) {
|
|
1030
|
-
let n = ((a - i + e) %
|
|
1031
|
-
t.fillRect(e *
|
|
1030
|
+
let n = ((a - i + e) % st + st) % st, o = g.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
1031
|
+
t.fillRect(e * ot, (r - c) / 2, at, c);
|
|
1032
1032
|
}
|
|
1033
1033
|
t.restore();
|
|
1034
1034
|
}, []);
|
|
1035
|
-
|
|
1035
|
+
R(() => {
|
|
1036
1036
|
if (!x) return;
|
|
1037
1037
|
let e = h.current;
|
|
1038
1038
|
if (!e) return;
|
|
1039
1039
|
g.current.fill(0), y.current = 0, b.current = 0;
|
|
1040
1040
|
let n, r = () => {
|
|
1041
|
-
if (b.current += 1, b.current >=
|
|
1042
|
-
b.current -=
|
|
1041
|
+
if (b.current += 1, b.current >= ot) {
|
|
1042
|
+
b.current -= ot;
|
|
1043
1043
|
let e = t.current;
|
|
1044
1044
|
if (e) {
|
|
1045
1045
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -1049,7 +1049,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1049
1049
|
let r = (t[e] - 128) / 128;
|
|
1050
1050
|
n += r * r;
|
|
1051
1051
|
}
|
|
1052
|
-
g.current[y.current %
|
|
1052
|
+
g.current[y.current % st] = Math.sqrt(n / t.length), y.current++;
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
1055
|
w(e), n = requestAnimationFrame(r);
|
|
@@ -1061,7 +1061,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1061
1061
|
x,
|
|
1062
1062
|
t,
|
|
1063
1063
|
w
|
|
1064
|
-
]),
|
|
1064
|
+
]), R(() => {
|
|
1065
1065
|
let e = h.current;
|
|
1066
1066
|
if (!e) return;
|
|
1067
1067
|
let t = new ResizeObserver(() => {
|
|
@@ -1069,11 +1069,11 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1069
1069
|
});
|
|
1070
1070
|
return t.observe(e), () => t.disconnect();
|
|
1071
1071
|
}, [w]);
|
|
1072
|
-
let E = /* @__PURE__ */
|
|
1072
|
+
let E = /* @__PURE__ */ G("div", {
|
|
1073
1073
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
1074
1074
|
children: [
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
icon: /* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ W(v, {
|
|
1076
|
+
icon: /* @__PURE__ */ W(pe, {
|
|
1077
1077
|
size: p.LG,
|
|
1078
1078
|
"aria-hidden": !0,
|
|
1079
1079
|
stroke: m
|
|
@@ -1082,8 +1082,8 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1082
1082
|
className: "mobile:min-h-11 mobile:min-w-11",
|
|
1083
1083
|
onClick: i
|
|
1084
1084
|
}),
|
|
1085
|
-
x && /* @__PURE__ */
|
|
1086
|
-
icon: /* @__PURE__ */
|
|
1085
|
+
x && /* @__PURE__ */ W(T, {
|
|
1086
|
+
icon: /* @__PURE__ */ W(I, {
|
|
1087
1087
|
size: p.LG,
|
|
1088
1088
|
"aria-hidden": !0
|
|
1089
1089
|
}),
|
|
@@ -1092,93 +1092,93 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1092
1092
|
"aria-label": o,
|
|
1093
1093
|
className: "mobile:min-h-11 mobile:min-w-11"
|
|
1094
1094
|
}),
|
|
1095
|
-
C && /* @__PURE__ */
|
|
1095
|
+
C && /* @__PURE__ */ W("span", {
|
|
1096
1096
|
className: "flex size-[40px] flex-shrink-0 items-center justify-center mobile:min-h-11 mobile:min-w-11",
|
|
1097
|
-
children: /* @__PURE__ */
|
|
1097
|
+
children: /* @__PURE__ */ W(te, {
|
|
1098
1098
|
size: 20,
|
|
1099
1099
|
ariaLabel: l
|
|
1100
1100
|
})
|
|
1101
1101
|
})
|
|
1102
1102
|
]
|
|
1103
1103
|
});
|
|
1104
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ G("div", {
|
|
1105
1105
|
className: d,
|
|
1106
|
-
children: [/* @__PURE__ */
|
|
1106
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1107
1107
|
style: u,
|
|
1108
|
-
className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f &&
|
|
1109
|
-
children: [/* @__PURE__ */
|
|
1108
|
+
className: c("flex w-full min-w-0 flex-col justify-center gap-2", !f && q.wrapper, !f && "min-h-[64px] max-w-[748px] rounded-xl border px-3 shadow-md", S && it.wrapperError),
|
|
1109
|
+
children: [/* @__PURE__ */ G("div", {
|
|
1110
1110
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1111
|
-
children: [x && /* @__PURE__ */
|
|
1112
|
-
className: c(
|
|
1111
|
+
children: [x && /* @__PURE__ */ W("span", {
|
|
1112
|
+
className: c(it.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1113
1113
|
"aria-hidden": !0
|
|
1114
|
-
}), /* @__PURE__ */
|
|
1114
|
+
}), /* @__PURE__ */ W("canvas", {
|
|
1115
1115
|
ref: h,
|
|
1116
1116
|
height: 26,
|
|
1117
1117
|
"aria-hidden": !0,
|
|
1118
|
-
className: c(
|
|
1118
|
+
className: c(it.waveformCanvas, "h-[26px] min-w-0 flex-1")
|
|
1119
1119
|
})]
|
|
1120
|
-
}), /* @__PURE__ */
|
|
1120
|
+
}), /* @__PURE__ */ G("div", {
|
|
1121
1121
|
className: "flex items-center justify-between gap-2",
|
|
1122
|
-
children: [a ?? /* @__PURE__ */
|
|
1122
|
+
children: [a ?? /* @__PURE__ */ W("span", { "aria-hidden": !0 }), E]
|
|
1123
1123
|
})]
|
|
1124
|
-
}), S && n && /* @__PURE__ */
|
|
1124
|
+
}), S && n && /* @__PURE__ */ W("div", {
|
|
1125
1125
|
role: "alert",
|
|
1126
|
-
children: /* @__PURE__ */
|
|
1126
|
+
children: /* @__PURE__ */ W(_, {
|
|
1127
1127
|
text: n,
|
|
1128
1128
|
className: "mt-1 px-1"
|
|
1129
1129
|
})
|
|
1130
1130
|
})]
|
|
1131
1131
|
});
|
|
1132
|
-
}, lt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message" }) => /* @__PURE__ */
|
|
1132
|
+
}, lt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message" }) => /* @__PURE__ */ W(T, {
|
|
1133
1133
|
"aria-label": n,
|
|
1134
1134
|
onClick: () => e?.(),
|
|
1135
1135
|
disabled: t,
|
|
1136
|
-
icon: /* @__PURE__ */
|
|
1136
|
+
icon: /* @__PURE__ */ W(ae, {
|
|
1137
1137
|
size: p.LG,
|
|
1138
1138
|
className: "rtl:scale-x-[-1]",
|
|
1139
1139
|
stroke: m
|
|
1140
1140
|
})
|
|
1141
|
-
}), ut = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */
|
|
1142
|
-
icon: /* @__PURE__ */
|
|
1141
|
+
}), ut = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ W(j, {
|
|
1142
|
+
icon: /* @__PURE__ */ W(le, {
|
|
1143
1143
|
size: p.LG,
|
|
1144
1144
|
stroke: m
|
|
1145
1145
|
}),
|
|
1146
1146
|
onClick: () => e?.(),
|
|
1147
1147
|
"aria-label": t
|
|
1148
|
-
}), dt = ({ size: e = 20 }) => /* @__PURE__ */
|
|
1148
|
+
}), dt = ({ size: e = 20 }) => /* @__PURE__ */ W(k, {
|
|
1149
1149
|
variant: ee.Circular,
|
|
1150
1150
|
width: e,
|
|
1151
1151
|
height: e,
|
|
1152
1152
|
active: !0
|
|
1153
|
-
}), ft = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1153
|
+
}), ft = ({ loadingLabel: e }) => /* @__PURE__ */ G("span", {
|
|
1154
1154
|
className: "flex min-w-0 flex-1 items-center",
|
|
1155
|
-
children: [/* @__PURE__ */
|
|
1155
|
+
children: [/* @__PURE__ */ W(k, {
|
|
1156
1156
|
variant: ee.Text,
|
|
1157
1157
|
width: "100%",
|
|
1158
1158
|
height: 16,
|
|
1159
1159
|
active: !0
|
|
1160
|
-
}), e && /* @__PURE__ */
|
|
1160
|
+
}), e && /* @__PURE__ */ W("span", {
|
|
1161
1161
|
className: "sr-only",
|
|
1162
1162
|
children: e
|
|
1163
1163
|
})]
|
|
1164
|
-
}), pt = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1164
|
+
}), pt = ({ loadingLabel: e }) => /* @__PURE__ */ W("div", {
|
|
1165
1165
|
role: "status",
|
|
1166
1166
|
"aria-label": e,
|
|
1167
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1167
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ G("div", {
|
|
1168
1168
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1169
1169
|
"aria-hidden": "true",
|
|
1170
|
-
children: [/* @__PURE__ */
|
|
1170
|
+
children: [/* @__PURE__ */ W(dt, {}), /* @__PURE__ */ W(ft, {})]
|
|
1171
1171
|
}, t))
|
|
1172
|
-
}),
|
|
1172
|
+
}), mt = (e) => e.displayName ?? e.id, J = (e, t) => {
|
|
1173
1173
|
let n = t.trim().toLowerCase();
|
|
1174
|
-
return n ? e.filter((e) =>
|
|
1175
|
-
},
|
|
1174
|
+
return n ? e.filter((e) => mt(e).toLowerCase().includes(n)) : e;
|
|
1175
|
+
}, Y = (e, t, r, i = 18, a) => /* @__PURE__ */ W(n, {
|
|
1176
1176
|
src: e,
|
|
1177
1177
|
size: i,
|
|
1178
1178
|
labels: { tooltip: a },
|
|
1179
1179
|
initialsName: r
|
|
1180
1180
|
}), ht = { searchHeader: "_searchHeader_1728o_1" }, gt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = ht.searchHeader, colors: a }) => {
|
|
1181
|
-
let [o, l] =
|
|
1181
|
+
let [o, l] = H(""), u = B(() => e?.find((e) => e.id === t), [e, t]), d = r?.loading !== void 0, f = !d && !u && !!t, m = B(() => d ? /* @__PURE__ */ W(dt, { size: p.LG }) : Y(u?.iconUrl, u?.type, u?.displayName ?? u?.id ?? "", p.LG, f ? r?.unavailableTooltip ?? "This deployment is no longer available" : void 0), [
|
|
1182
1182
|
d,
|
|
1183
1183
|
u,
|
|
1184
1184
|
f,
|
|
@@ -1189,11 +1189,11 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1189
1189
|
selectorAriaLabel: h ? `${r?.ariaLabel ?? "Select model"}: ${h}` : r?.ariaLabel ?? "Select model",
|
|
1190
1190
|
selectedLabel: h,
|
|
1191
1191
|
selectedVersion: _,
|
|
1192
|
-
menuItems:
|
|
1192
|
+
menuItems: B(() => {
|
|
1193
1193
|
if (d) return Array.from({ length: 7 }, (e, t) => ({
|
|
1194
1194
|
key: `__loading-${t}`,
|
|
1195
|
-
icon: /* @__PURE__ */
|
|
1196
|
-
label: /* @__PURE__ */
|
|
1195
|
+
icon: /* @__PURE__ */ W(dt, {}),
|
|
1196
|
+
label: /* @__PURE__ */ W(ft, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1197
1197
|
disabled: !0
|
|
1198
1198
|
}));
|
|
1199
1199
|
if (!e || e.length === 0) {
|
|
@@ -1204,14 +1204,14 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1204
1204
|
disabled: !0
|
|
1205
1205
|
}] : [];
|
|
1206
1206
|
}
|
|
1207
|
-
return
|
|
1207
|
+
return J(e, o).map((e) => ({
|
|
1208
1208
|
key: e.id,
|
|
1209
|
-
label: /* @__PURE__ */
|
|
1210
|
-
text:
|
|
1209
|
+
label: /* @__PURE__ */ W(y, {
|
|
1210
|
+
text: mt(e),
|
|
1211
1211
|
query: o,
|
|
1212
1212
|
maxLines: 1
|
|
1213
1213
|
}),
|
|
1214
|
-
icon:
|
|
1214
|
+
icon: Y(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1215
1215
|
mark: b.Check,
|
|
1216
1216
|
checked: e.id === t,
|
|
1217
1217
|
onClick: () => n?.(e.id)
|
|
@@ -1224,10 +1224,10 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1224
1224
|
r,
|
|
1225
1225
|
n
|
|
1226
1226
|
]),
|
|
1227
|
-
menuHeader:
|
|
1227
|
+
menuHeader: B(() => !d && e && e.length > 0 ? /* @__PURE__ */ W("div", {
|
|
1228
1228
|
style: s({ "--ms-search-header-bg": a?.searchHeaderBackground }),
|
|
1229
1229
|
className: c("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1230
|
-
children: /* @__PURE__ */
|
|
1230
|
+
children: /* @__PURE__ */ W(O, {
|
|
1231
1231
|
value: o,
|
|
1232
1232
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1233
1233
|
size: g.Small,
|
|
@@ -1246,7 +1246,7 @@ var Ce = "a[href], button:not([disabled]), input:not([disabled]), select:not([di
|
|
|
1246
1246
|
e || l("");
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
|
-
}, _t = typeof window < "u" ?
|
|
1249
|
+
}, _t = typeof window < "u" ? z : R;
|
|
1250
1250
|
function vt(e) {
|
|
1251
1251
|
if (e !== void 0) switch (typeof e) {
|
|
1252
1252
|
case "number": return e;
|
|
@@ -1255,11 +1255,11 @@ function vt(e) {
|
|
|
1255
1255
|
break;
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1258
|
+
function yt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1259
|
+
let { styleHeight: s, styleWidth: c } = B(() => ({
|
|
1260
1260
|
styleHeight: vt(o?.height),
|
|
1261
1261
|
styleWidth: vt(o?.width)
|
|
1262
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1262
|
+
}), [o?.height, o?.width]), [l, u] = H({
|
|
1263
1263
|
height: t,
|
|
1264
1264
|
width: n
|
|
1265
1265
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
@@ -1283,7 +1283,7 @@ function X({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
1283
1283
|
i,
|
|
1284
1284
|
s,
|
|
1285
1285
|
c
|
|
1286
|
-
]),
|
|
1286
|
+
]), B(() => ({
|
|
1287
1287
|
height: s ?? l.height,
|
|
1288
1288
|
width: c ?? l.width
|
|
1289
1289
|
}), [
|
|
@@ -1292,26 +1292,26 @@ function X({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i,
|
|
|
1292
1292
|
c
|
|
1293
1293
|
]);
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1296
|
-
let t =
|
|
1295
|
+
function X(e) {
|
|
1296
|
+
let t = V(() => {
|
|
1297
1297
|
throw Error("Cannot call during render.");
|
|
1298
1298
|
});
|
|
1299
1299
|
return _t(() => {
|
|
1300
1300
|
t.current = e;
|
|
1301
|
-
}, [e]),
|
|
1301
|
+
}, [e]), L((e) => t.current?.(e), [t]);
|
|
1302
1302
|
}
|
|
1303
|
-
var
|
|
1304
|
-
function
|
|
1305
|
-
if (
|
|
1303
|
+
var Z = null;
|
|
1304
|
+
function bt(e = !1) {
|
|
1305
|
+
if (Z === null || e) {
|
|
1306
1306
|
let e = document.createElement("div"), t = e.style;
|
|
1307
1307
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1308
1308
|
let n = document.createElement("div"), r = n.style;
|
|
1309
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1309
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Z = "positive-descending" : (e.scrollLeft = 1, Z = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Z;
|
|
1310
1310
|
}
|
|
1311
|
-
return
|
|
1311
|
+
return Z;
|
|
1312
1312
|
}
|
|
1313
|
-
function
|
|
1314
|
-
if (t === "horizontal" && n) switch (
|
|
1313
|
+
function xt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1314
|
+
if (t === "horizontal" && n) switch (bt()) {
|
|
1315
1315
|
case "negative": return -r;
|
|
1316
1316
|
case "positive-descending":
|
|
1317
1317
|
if (e) {
|
|
@@ -1322,26 +1322,26 @@ function bt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1322
1322
|
}
|
|
1323
1323
|
return r;
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function Q(e, t = "Assertion error") {
|
|
1326
1326
|
if (!e) throw console.error(t), Error(t);
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function St(e, t) {
|
|
1329
1329
|
if (e === t) return !0;
|
|
1330
|
-
if (!!e != !!t || (
|
|
1330
|
+
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1331
1331
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1332
1332
|
return !0;
|
|
1333
1333
|
}
|
|
1334
|
-
function
|
|
1334
|
+
function Ct({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1335
1335
|
if (t === 0) return 0;
|
|
1336
1336
|
if (typeof n == "number") return t * n;
|
|
1337
1337
|
{
|
|
1338
1338
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1339
|
-
return
|
|
1339
|
+
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1342
|
+
function wt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1343
1343
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1344
|
-
let s =
|
|
1344
|
+
let s = Ct({
|
|
1345
1345
|
cachedBounds: t,
|
|
1346
1346
|
itemCount: r,
|
|
1347
1347
|
itemSize: i
|
|
@@ -1353,7 +1353,7 @@ function Ct({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1353
1353
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
|
-
function
|
|
1356
|
+
function Tt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1357
1357
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1358
1358
|
for (; u < a;) {
|
|
1359
1359
|
let n = e.get(u);
|
|
@@ -1372,11 +1372,11 @@ function wt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1372
1372
|
stopIndexOverscan: l
|
|
1373
1373
|
};
|
|
1374
1374
|
}
|
|
1375
|
-
function
|
|
1375
|
+
function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1376
1376
|
let r = /* @__PURE__ */ new Map();
|
|
1377
1377
|
return {
|
|
1378
1378
|
get(i) {
|
|
1379
|
-
for (
|
|
1379
|
+
for (Q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1380
1380
|
let e = r.size, a;
|
|
1381
1381
|
switch (typeof n) {
|
|
1382
1382
|
case "function":
|
|
@@ -1392,14 +1392,14 @@ function Tt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1392
1392
|
});
|
|
1393
1393
|
else {
|
|
1394
1394
|
let t = r.get(e - 1);
|
|
1395
|
-
|
|
1395
|
+
Q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1396
1396
|
scrollOffset: t.scrollOffset + t.size,
|
|
1397
1397
|
size: a
|
|
1398
1398
|
});
|
|
1399
1399
|
}
|
|
1400
1400
|
}
|
|
1401
1401
|
let a = r.get(i);
|
|
1402
|
-
return
|
|
1402
|
+
return Q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1403
1403
|
},
|
|
1404
1404
|
set(e, t) {
|
|
1405
1405
|
r.set(e, t);
|
|
@@ -1409,8 +1409,8 @@ function Tt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1409
1409
|
}
|
|
1410
1410
|
};
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1413
|
-
return
|
|
1412
|
+
function Dt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1413
|
+
return B(() => Et({
|
|
1414
1414
|
itemCount: e,
|
|
1415
1415
|
itemProps: t,
|
|
1416
1416
|
itemSize: n
|
|
@@ -1420,11 +1420,11 @@ function Et({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1420
1420
|
n
|
|
1421
1421
|
]);
|
|
1422
1422
|
}
|
|
1423
|
-
function
|
|
1423
|
+
function Ot({ containerSize: e, itemSize: t }) {
|
|
1424
1424
|
let n;
|
|
1425
1425
|
switch (typeof t) {
|
|
1426
1426
|
case "string":
|
|
1427
|
-
|
|
1427
|
+
Q(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Q(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
|
|
1428
1428
|
break;
|
|
1429
1429
|
default:
|
|
1430
1430
|
n = t;
|
|
@@ -1432,21 +1432,21 @@ function Dt({ containerSize: e, itemSize: t }) {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
return n;
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1436
|
-
let { height: u = n, width: d = n } =
|
|
1435
|
+
function kt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1436
|
+
let { height: u = n, width: d = n } = yt({
|
|
1437
1437
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1438
1438
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1439
1439
|
element: e,
|
|
1440
1440
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1441
1441
|
style: t
|
|
1442
|
-
}), f =
|
|
1442
|
+
}), f = V({
|
|
1443
1443
|
height: 0,
|
|
1444
1444
|
width: 0
|
|
1445
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1445
|
+
}), p = r === "vertical" ? u : d, m = Ot({
|
|
1446
1446
|
containerSize: p,
|
|
1447
1447
|
itemSize: s
|
|
1448
1448
|
});
|
|
1449
|
-
|
|
1449
|
+
z(() => {
|
|
1450
1450
|
if (typeof c == "function") {
|
|
1451
1451
|
let e = f.current;
|
|
1452
1452
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1459,11 +1459,11 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1459
1459
|
c,
|
|
1460
1460
|
d
|
|
1461
1461
|
]);
|
|
1462
|
-
let h =
|
|
1462
|
+
let h = Dt({
|
|
1463
1463
|
itemCount: a,
|
|
1464
1464
|
itemProps: o,
|
|
1465
1465
|
itemSize: m
|
|
1466
|
-
}), g =
|
|
1466
|
+
}), g = L((e) => h.get(e), [h]), [_, v] = H(() => Tt({
|
|
1467
1467
|
cachedBounds: h,
|
|
1468
1468
|
containerScrollOffset: 0,
|
|
1469
1469
|
containerSize: p,
|
|
@@ -1474,7 +1474,7 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1474
1474
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1475
1475
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1476
1476
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1477
|
-
}, C =
|
|
1477
|
+
}, C = L(() => Ct({
|
|
1478
1478
|
cachedBounds: h,
|
|
1479
1479
|
itemCount: a,
|
|
1480
1480
|
itemSize: m
|
|
@@ -1482,9 +1482,9 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1482
1482
|
h,
|
|
1483
1483
|
a,
|
|
1484
1484
|
m
|
|
1485
|
-
]), w =
|
|
1485
|
+
]), w = L((t) => Tt({
|
|
1486
1486
|
cachedBounds: h,
|
|
1487
|
-
containerScrollOffset:
|
|
1487
|
+
containerScrollOffset: xt({
|
|
1488
1488
|
containerElement: e,
|
|
1489
1489
|
direction: r,
|
|
1490
1490
|
isRtl: i,
|
|
@@ -1512,9 +1512,9 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1512
1512
|
if (!e) return;
|
|
1513
1513
|
let t = () => {
|
|
1514
1514
|
v((t) => {
|
|
1515
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1515
|
+
let { scrollLeft: n, scrollTop: o } = e, s = Tt({
|
|
1516
1516
|
cachedBounds: h,
|
|
1517
|
-
containerScrollOffset:
|
|
1517
|
+
containerScrollOffset: xt({
|
|
1518
1518
|
containerElement: e,
|
|
1519
1519
|
direction: r,
|
|
1520
1520
|
isRtl: i,
|
|
@@ -1524,7 +1524,7 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1524
1524
|
itemCount: a,
|
|
1525
1525
|
overscanCount: l
|
|
1526
1526
|
});
|
|
1527
|
-
return
|
|
1527
|
+
return St(s, t) ? t : s;
|
|
1528
1528
|
});
|
|
1529
1529
|
};
|
|
1530
1530
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1540,8 +1540,8 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1540
1540
|
]), {
|
|
1541
1541
|
getCellBounds: g,
|
|
1542
1542
|
getEstimatedSize: C,
|
|
1543
|
-
scrollToIndex:
|
|
1544
|
-
let s =
|
|
1543
|
+
scrollToIndex: X(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1544
|
+
let s = wt({
|
|
1545
1545
|
align: t,
|
|
1546
1546
|
cachedBounds: h,
|
|
1547
1547
|
containerScrollOffset: n,
|
|
@@ -1551,14 +1551,14 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1551
1551
|
itemSize: m
|
|
1552
1552
|
});
|
|
1553
1553
|
if (e) {
|
|
1554
|
-
if (s =
|
|
1554
|
+
if (s = xt({
|
|
1555
1555
|
containerElement: e,
|
|
1556
1556
|
direction: r,
|
|
1557
1557
|
isRtl: i,
|
|
1558
1558
|
scrollOffset: s
|
|
1559
1559
|
}), typeof e.scrollTo != "function") {
|
|
1560
1560
|
let e = w(s);
|
|
1561
|
-
|
|
1561
|
+
St(_, e) || v(e);
|
|
1562
1562
|
}
|
|
1563
1563
|
return s;
|
|
1564
1564
|
}
|
|
@@ -1569,30 +1569,30 @@ function Ot({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1569
1569
|
stopIndexVisible: x
|
|
1570
1570
|
};
|
|
1571
1571
|
}
|
|
1572
|
-
function
|
|
1573
|
-
return
|
|
1572
|
+
function At(e) {
|
|
1573
|
+
return B(() => e, Object.values(e));
|
|
1574
1574
|
}
|
|
1575
|
-
function
|
|
1575
|
+
function jt(e, t) {
|
|
1576
1576
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1577
|
-
return
|
|
1577
|
+
return St(n, a) && St(r, o) && St(i, s);
|
|
1578
1578
|
}
|
|
1579
|
-
function
|
|
1579
|
+
function Mt(e) {
|
|
1580
1580
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1581
1581
|
}
|
|
1582
|
-
var
|
|
1583
|
-
function
|
|
1584
|
-
let m =
|
|
1582
|
+
var Nt = "data-react-window-index";
|
|
1583
|
+
function Pt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
|
|
1584
|
+
let m = At(u), h = B(() => he(s, jt), [s]), [g, _] = H(null), v = Mt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = kt({
|
|
1585
1585
|
containerElement: g,
|
|
1586
1586
|
containerStyle: f,
|
|
1587
1587
|
defaultContainerSize: n,
|
|
1588
1588
|
direction: "vertical",
|
|
1589
1589
|
itemCount: c,
|
|
1590
1590
|
itemProps: m,
|
|
1591
|
-
itemSize:
|
|
1591
|
+
itemSize: B(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1592
1592
|
onResize: i,
|
|
1593
1593
|
overscanCount: o
|
|
1594
1594
|
});
|
|
1595
|
-
|
|
1595
|
+
ge(r, () => ({
|
|
1596
1596
|
get element() {
|
|
1597
1597
|
return g;
|
|
1598
1598
|
},
|
|
@@ -1612,7 +1612,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1612
1612
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1613
1613
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1614
1614
|
let n = `${S + t}`;
|
|
1615
|
-
return e.setAttribute(
|
|
1615
|
+
return e.setAttribute(Nt, n), !0;
|
|
1616
1616
|
});
|
|
1617
1617
|
if (v) return l.observeRowElements(e);
|
|
1618
1618
|
}, [
|
|
@@ -1621,7 +1621,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1621
1621
|
l,
|
|
1622
1622
|
S,
|
|
1623
1623
|
w
|
|
1624
|
-
]),
|
|
1624
|
+
]), R(() => {
|
|
1625
1625
|
S >= 0 && w >= 0 && a && a({
|
|
1626
1626
|
startIndex: C,
|
|
1627
1627
|
stopIndex: T
|
|
@@ -1636,11 +1636,11 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1636
1636
|
w,
|
|
1637
1637
|
T
|
|
1638
1638
|
]);
|
|
1639
|
-
let E =
|
|
1639
|
+
let E = B(() => {
|
|
1640
1640
|
let e = [];
|
|
1641
1641
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1642
1642
|
let n = y(t);
|
|
1643
|
-
e.push(/* @__PURE__ */
|
|
1643
|
+
e.push(/* @__PURE__ */ me(h, {
|
|
1644
1644
|
...m,
|
|
1645
1645
|
ariaAttributes: {
|
|
1646
1646
|
"aria-posinset": t + 1,
|
|
@@ -1667,7 +1667,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1667
1667
|
m,
|
|
1668
1668
|
S,
|
|
1669
1669
|
w
|
|
1670
|
-
]), D = /* @__PURE__ */
|
|
1670
|
+
]), D = /* @__PURE__ */ W("div", {
|
|
1671
1671
|
"aria-hidden": !0,
|
|
1672
1672
|
style: {
|
|
1673
1673
|
height: b(),
|
|
@@ -1675,7 +1675,7 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1675
1675
|
zIndex: -1
|
|
1676
1676
|
}
|
|
1677
1677
|
});
|
|
1678
|
-
return
|
|
1678
|
+
return me(d, {
|
|
1679
1679
|
role: "list",
|
|
1680
1680
|
...p,
|
|
1681
1681
|
className: t,
|
|
@@ -1689,35 +1689,35 @@ function Nt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1689
1689
|
}
|
|
1690
1690
|
}, E, e, D);
|
|
1691
1691
|
}
|
|
1692
|
-
var
|
|
1692
|
+
var Ft = {
|
|
1693
1693
|
divider: "_divider_1tiyp_1",
|
|
1694
1694
|
item: "_item_1tiyp_5",
|
|
1695
1695
|
itemIcon: "_itemIcon_1tiyp_15",
|
|
1696
1696
|
checkIcon: "_checkIcon_1tiyp_19",
|
|
1697
1697
|
stateLabel: "_stateLabel_1tiyp_23"
|
|
1698
|
-
},
|
|
1699
|
-
let l = r[e], u =
|
|
1700
|
-
return /* @__PURE__ */
|
|
1698
|
+
}, It = 44, Lt = 8, Rt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: o, onSelect: s }) => {
|
|
1699
|
+
let l = r[e], u = Y(l.iconUrl, l.type, l.displayName ?? l.id, p.SM), f = l.id === i;
|
|
1700
|
+
return /* @__PURE__ */ W("div", {
|
|
1701
1701
|
style: t,
|
|
1702
1702
|
...n,
|
|
1703
|
-
children: /* @__PURE__ */
|
|
1703
|
+
children: /* @__PURE__ */ W(d, {
|
|
1704
1704
|
type: "button",
|
|
1705
1705
|
"aria-current": f ? "true" : void 0,
|
|
1706
|
-
className: c(
|
|
1707
|
-
iconBefore: /* @__PURE__ */
|
|
1708
|
-
className:
|
|
1706
|
+
className: c(Ft.item, "h-full w-full gap-3 px-4"),
|
|
1707
|
+
iconBefore: /* @__PURE__ */ W("span", {
|
|
1708
|
+
className: Ft.itemIcon,
|
|
1709
1709
|
children: u
|
|
1710
1710
|
}),
|
|
1711
|
-
label: /* @__PURE__ */
|
|
1711
|
+
label: /* @__PURE__ */ G("span", {
|
|
1712
1712
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1713
|
-
children: [/* @__PURE__ */
|
|
1713
|
+
children: [/* @__PURE__ */ W(y, {
|
|
1714
1714
|
text: l.displayName ?? l.id,
|
|
1715
1715
|
query: o,
|
|
1716
1716
|
maxLines: 1,
|
|
1717
1717
|
className: c(a, "min-w-0 flex-1 text-start")
|
|
1718
|
-
}), f && /* @__PURE__ */
|
|
1718
|
+
}), f && /* @__PURE__ */ W(N, {
|
|
1719
1719
|
size: p.SM,
|
|
1720
|
-
className:
|
|
1720
|
+
className: Ft.checkIcon,
|
|
1721
1721
|
"aria-hidden": !0,
|
|
1722
1722
|
stroke: m
|
|
1723
1723
|
})]
|
|
@@ -1725,12 +1725,12 @@ var Pt = {
|
|
|
1725
1725
|
onClick: () => s(l.id)
|
|
1726
1726
|
})
|
|
1727
1727
|
});
|
|
1728
|
-
},
|
|
1729
|
-
let [v, y] =
|
|
1730
|
-
|
|
1728
|
+
}, zt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: _ }) => {
|
|
1729
|
+
let [v, y] = H("");
|
|
1730
|
+
R(() => {
|
|
1731
1731
|
e || y("");
|
|
1732
1732
|
}, [e]);
|
|
1733
|
-
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ?
|
|
1733
|
+
let b = a && a.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, C = b ? J(a, v) : [], w = (e) => {
|
|
1734
1734
|
l(e), i();
|
|
1735
1735
|
}, T = s({
|
|
1736
1736
|
"--ci-sheet-divider": _?.divider,
|
|
@@ -1740,7 +1740,7 @@ var Pt = {
|
|
|
1740
1740
|
"--ci-sheet-icon": _?.itemIcon,
|
|
1741
1741
|
"--ci-check-icon": _?.checkIcon
|
|
1742
1742
|
});
|
|
1743
|
-
return /* @__PURE__ */
|
|
1743
|
+
return /* @__PURE__ */ W(Te, {
|
|
1744
1744
|
isOpen: e,
|
|
1745
1745
|
title: t,
|
|
1746
1746
|
closeLabel: n,
|
|
@@ -1749,28 +1749,28 @@ var Pt = {
|
|
|
1749
1749
|
titleClassName: m,
|
|
1750
1750
|
className: "max-h-[80dvh]",
|
|
1751
1751
|
colors: _?.shell,
|
|
1752
|
-
children: /* @__PURE__ */
|
|
1752
|
+
children: /* @__PURE__ */ G("div", {
|
|
1753
1753
|
className: "contents",
|
|
1754
1754
|
style: T,
|
|
1755
|
-
children: [b && !x && /* @__PURE__ */
|
|
1755
|
+
children: [b && !x && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("div", {
|
|
1756
1756
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1757
|
-
children: /* @__PURE__ */
|
|
1757
|
+
children: /* @__PURE__ */ W(O, {
|
|
1758
1758
|
value: v,
|
|
1759
1759
|
placeholder: r,
|
|
1760
1760
|
size: g.Standard,
|
|
1761
1761
|
onChange: (e) => y(e ?? "")
|
|
1762
1762
|
})
|
|
1763
|
-
}), /* @__PURE__ */
|
|
1763
|
+
}), /* @__PURE__ */ W("div", { className: c(Ft.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ W(pt, { loadingLabel: u }) : S ? /* @__PURE__ */ W("div", {
|
|
1764
1764
|
role: "list",
|
|
1765
|
-
className: c(
|
|
1765
|
+
className: c(Ft.stateLabel, h, "px-4 py-4"),
|
|
1766
1766
|
children: S
|
|
1767
|
-
}) : /* @__PURE__ */
|
|
1767
|
+
}) : /* @__PURE__ */ W(Pt, {
|
|
1768
1768
|
role: "list",
|
|
1769
1769
|
className: "overflow-y-auto",
|
|
1770
|
-
style: { height: Math.min(C.length,
|
|
1771
|
-
rowComponent:
|
|
1770
|
+
style: { height: Math.min(C.length, Lt) * It },
|
|
1771
|
+
rowComponent: Rt,
|
|
1772
1772
|
rowCount: C.length,
|
|
1773
|
-
rowHeight:
|
|
1773
|
+
rowHeight: It,
|
|
1774
1774
|
rowProps: {
|
|
1775
1775
|
items: C,
|
|
1776
1776
|
selectedDeploymentId: o,
|
|
@@ -1781,24 +1781,24 @@ var Pt = {
|
|
|
1781
1781
|
})]
|
|
1782
1782
|
})
|
|
1783
1783
|
});
|
|
1784
|
-
},
|
|
1785
|
-
let [_, y] =
|
|
1784
|
+
}, Bt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: f, onPickerOpenChange: g }) => {
|
|
1785
|
+
let [_, y] = H(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, selectedVersion: C, menuItems: w, menuHeader: T, onOpenChange: E } = gt({
|
|
1786
1786
|
deployments: e,
|
|
1787
1787
|
selectedDeploymentId: t,
|
|
1788
1788
|
onDeploymentChange: n,
|
|
1789
1789
|
modelSelectorLabels: r
|
|
1790
1790
|
});
|
|
1791
1791
|
if (!e) return null;
|
|
1792
|
-
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */
|
|
1792
|
+
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ W(P, {
|
|
1793
1793
|
size: p.SM,
|
|
1794
|
-
className:
|
|
1794
|
+
className: q.modelSelectorCaret,
|
|
1795
1795
|
"aria-hidden": !0,
|
|
1796
1796
|
stroke: m
|
|
1797
1797
|
});
|
|
1798
|
-
return a ? /* @__PURE__ */
|
|
1798
|
+
return a ? /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(re, {
|
|
1799
1799
|
tooltip: S,
|
|
1800
|
-
children: /* @__PURE__ */
|
|
1801
|
-
icon: /* @__PURE__ */
|
|
1800
|
+
children: /* @__PURE__ */ W(v, {
|
|
1801
|
+
icon: /* @__PURE__ */ G("div", {
|
|
1802
1802
|
className: "flex items-center gap-1",
|
|
1803
1803
|
children: [b, O]
|
|
1804
1804
|
}),
|
|
@@ -1806,16 +1806,16 @@ var Pt = {
|
|
|
1806
1806
|
onClick: () => {
|
|
1807
1807
|
s || y(!0);
|
|
1808
1808
|
},
|
|
1809
|
-
className: c("w-[50px]",
|
|
1809
|
+
className: c("w-[50px]", q.modelSelectorButton, D)
|
|
1810
1810
|
})
|
|
1811
|
-
}), u ? /* @__PURE__ */
|
|
1811
|
+
}), u ? /* @__PURE__ */ W(Te, {
|
|
1812
1812
|
isOpen: _,
|
|
1813
1813
|
title: r?.ariaLabel ?? "Select model",
|
|
1814
1814
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1815
1815
|
onClose: () => y(!1),
|
|
1816
1816
|
style: l,
|
|
1817
1817
|
children: u(() => y(!1))
|
|
1818
|
-
}) : /* @__PURE__ */
|
|
1818
|
+
}) : /* @__PURE__ */ W(zt, {
|
|
1819
1819
|
isOpen: _,
|
|
1820
1820
|
title: r?.ariaLabel ?? "Select model",
|
|
1821
1821
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1828,7 +1828,7 @@ var Pt = {
|
|
|
1828
1828
|
errorLabel: r?.error,
|
|
1829
1829
|
emptyLabel: r?.empty,
|
|
1830
1830
|
style: l
|
|
1831
|
-
})] }) : u ? /* @__PURE__ */
|
|
1831
|
+
})] }) : u ? /* @__PURE__ */ W(h, {
|
|
1832
1832
|
placement: "top-end",
|
|
1833
1833
|
matchReferenceWidth: !1,
|
|
1834
1834
|
open: d,
|
|
@@ -1837,25 +1837,25 @@ var Pt = {
|
|
|
1837
1837
|
outsideClosable: !0,
|
|
1838
1838
|
renderOverlay: () => u(() => g?.(!1)),
|
|
1839
1839
|
listClassName: "!w-[368px] !bg-layer-raised",
|
|
1840
|
-
children: /* @__PURE__ */
|
|
1840
|
+
children: /* @__PURE__ */ W(re, {
|
|
1841
1841
|
tooltip: C ? `${S} · ${C}` : S,
|
|
1842
|
-
children: /* @__PURE__ */
|
|
1842
|
+
children: /* @__PURE__ */ G("button", {
|
|
1843
1843
|
type: "button",
|
|
1844
1844
|
"aria-label": x,
|
|
1845
1845
|
"aria-disabled": s || void 0,
|
|
1846
|
-
className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5",
|
|
1846
|
+
className: c("flex min-w-0 items-center gap-1.5 rounded-full py-1.5 pe-2 ps-1.5", q.modelSelectorButton, D, s && q.modelSelectorButtonDisabled),
|
|
1847
1847
|
onClick: () => {
|
|
1848
1848
|
!i && !s && f?.();
|
|
1849
1849
|
},
|
|
1850
1850
|
children: [
|
|
1851
1851
|
b,
|
|
1852
|
-
/* @__PURE__ */
|
|
1852
|
+
/* @__PURE__ */ G("span", {
|
|
1853
1853
|
className: "flex min-w-0 max-w-[180px] items-baseline gap-1",
|
|
1854
|
-
children: [/* @__PURE__ */
|
|
1855
|
-
className: c("dial-small-text max-w-[180px] shrink-0 truncate",
|
|
1854
|
+
children: [/* @__PURE__ */ W("span", {
|
|
1855
|
+
className: c("dial-small-text max-w-[180px] shrink-0 truncate", q.modelSelectorName),
|
|
1856
1856
|
children: S
|
|
1857
|
-
}), C && /* @__PURE__ */
|
|
1858
|
-
className: c("dial-tiny-text min-w-0 truncate",
|
|
1857
|
+
}), C && /* @__PURE__ */ W("span", {
|
|
1858
|
+
className: c("dial-tiny-text min-w-0 truncate", q.modelSelectorVersion),
|
|
1859
1859
|
children: C
|
|
1860
1860
|
})]
|
|
1861
1861
|
}),
|
|
@@ -1863,10 +1863,10 @@ var Pt = {
|
|
|
1863
1863
|
]
|
|
1864
1864
|
})
|
|
1865
1865
|
})
|
|
1866
|
-
}) : /* @__PURE__ */
|
|
1866
|
+
}) : /* @__PURE__ */ W("div", {
|
|
1867
1867
|
className: c(s && D),
|
|
1868
1868
|
"aria-disabled": s || void 0,
|
|
1869
|
-
children: /* @__PURE__ */
|
|
1869
|
+
children: /* @__PURE__ */ W(h, {
|
|
1870
1870
|
items: w,
|
|
1871
1871
|
menuHeader: T,
|
|
1872
1872
|
placement: "bottom-end",
|
|
@@ -1875,172 +1875,172 @@ var Pt = {
|
|
|
1875
1875
|
listClassName: "!w-[240px]",
|
|
1876
1876
|
disabled: s,
|
|
1877
1877
|
onOpenChange: s ? void 0 : E,
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1878
|
+
children: /* @__PURE__ */ W(re, {
|
|
1879
1879
|
tooltip: S,
|
|
1880
|
-
children: /* @__PURE__ */
|
|
1880
|
+
children: /* @__PURE__ */ G("button", {
|
|
1881
1881
|
type: "button",
|
|
1882
1882
|
"aria-label": x,
|
|
1883
1883
|
"aria-disabled": s || void 0,
|
|
1884
|
-
className: c("flex items-center gap-1 rounded-full p-1.5",
|
|
1884
|
+
className: c("flex items-center gap-1 rounded-full p-1.5", q.modelSelectorButton, s && q.modelSelectorButtonDisabled),
|
|
1885
1885
|
children: [b, O]
|
|
1886
1886
|
})
|
|
1887
1887
|
})
|
|
1888
1888
|
})
|
|
1889
1889
|
});
|
|
1890
|
-
},
|
|
1891
|
-
let
|
|
1892
|
-
"--ci-bg":
|
|
1893
|
-
"--ci-text":
|
|
1894
|
-
"--ci-border":
|
|
1895
|
-
"--ci-border-focus":
|
|
1896
|
-
"--ci-placeholder":
|
|
1897
|
-
"--ci-text-disabled":
|
|
1898
|
-
"--ci-model-selector-caret-color":
|
|
1899
|
-
"--ci-model-selector-hover-bg":
|
|
1900
|
-
"--ci-model-selector-disabled-color":
|
|
1901
|
-
"--ci-model-selector-name-color":
|
|
1902
|
-
"--ci-model-selector-version-color":
|
|
1903
|
-
"--ci-voice-error":
|
|
1904
|
-
"--ci-voice-waveform":
|
|
1905
|
-
"--ci-voice-accent":
|
|
1906
|
-
"--ci-first-line-indent": Y ? `calc(${
|
|
1890
|
+
}, $ = ({ message: e = "", messageRevision: t, textInsertion: n, onSend: r, onUploadAttachment: i, onStop: a, isStreaming: o = !1, onChange: d, onAttachmentsChange: f, placeholder: g = "Type a message...", ariaLabel: y, attachLabel: b = "Attach file", fileAccept: x, addMenuTitle: S = "Add", menuTitle: C = "Menu", menuCloseLabel: w = "Close", removeLabel: T, retryLabel: E, uploadingLabel: D, sendLabel: O, stopLabel: k, micLabel: ee = "Dictate", recordVoiceLabel: A = "Record voice", stopRecordingLabel: te, discardRecordingLabel: j, colors: M, typography: ne, className: re, pendingDropFiles: ie = [], onDropFilesConsumed: ae, pendingAttachments: N = [], onPendingAttachmentsConsumed: P, pasteTextThreshold: oe = 4e3, maxMessageLength: F = 5e4, deployments: I, selectedDeploymentId: le, onDeploymentChange: ue, modelSelectorLabels: de, initialAttachments: fe = [], hideAddButton: pe = !1, hideAttachFile: me = !1, hideActionBar: he = !1, renderFooterActions: ge, isInputDisabled: z = !1, isModelSelectorDisabled: _e = !1, isSendDisabled: ye = !1, isAudioMessageSupported: be = !1, isVoiceRecordingSupported: Se = be, onTranscribeAudio: Ce, transcribingLabel: we, voiceErrorLabel: Te, sendOnEnter: Ee = Ue.Enter, prefixAttachments: Oe = [], onRemovePrefixAttachment: Ae, chatSettings: je, toolsMenuItems: Pe, onToolToggle: Re, canRemoveTools: ze = !0, toolsMenuTitle: Be, toolsBackLabel: Ve, toolsChipLabels: We, menuOverlays: Ge, inlineStartSlot: Ke, onInlineStartRemove: qe, commandMenu: K, autoFocus: Je = !1, messageHistory: Ye, onDialFileSystemClick: Xe, dialFileSystemLabel: Ze, validateAttachment: Qe, onAttachmentClick: $e, modelPickerOverlay: tt, maximumAttachmentsAmount: nt, onAttachmentsLimitExceeded: it, isAttachmentsEnabled: at = !0, isTextAttachmentsAllowed: ot = !0, usageLimitsSlot: st, onMessageTooLong: dt }) => {
|
|
1891
|
+
let ft = l(), [pt, mt] = H(!1), J = Me(Ye), Y = Ke != null, ht = V(null), [gt, _t] = H(0), vt = B(() => s({
|
|
1892
|
+
"--ci-bg": M?.background,
|
|
1893
|
+
"--ci-text": M?.text,
|
|
1894
|
+
"--ci-border": M?.border,
|
|
1895
|
+
"--ci-border-focus": M?.borderFocus,
|
|
1896
|
+
"--ci-placeholder": M?.placeholder,
|
|
1897
|
+
"--ci-text-disabled": M?.textDisabled,
|
|
1898
|
+
"--ci-model-selector-caret-color": M?.modelSelectorCaret,
|
|
1899
|
+
"--ci-model-selector-hover-bg": M?.modelSelectorHoverBg,
|
|
1900
|
+
"--ci-model-selector-disabled-color": M?.modelSelectorDisabled,
|
|
1901
|
+
"--ci-model-selector-name-color": M?.modelSelectorName,
|
|
1902
|
+
"--ci-model-selector-version-color": M?.modelSelectorVersion,
|
|
1903
|
+
"--ci-voice-error": M?.voiceError,
|
|
1904
|
+
"--ci-voice-waveform": M?.voiceWaveform,
|
|
1905
|
+
"--ci-voice-accent": M?.voiceAccent,
|
|
1906
|
+
"--ci-first-line-indent": Y ? `calc(${gt}px + 4px)` : void 0
|
|
1907
1907
|
}), [
|
|
1908
|
-
|
|
1908
|
+
M,
|
|
1909
1909
|
Y,
|
|
1910
|
-
|
|
1911
|
-
]),
|
|
1910
|
+
gt
|
|
1911
|
+
]), yt = B(() => Xe ? [{
|
|
1912
1912
|
key: "dial-fs",
|
|
1913
1913
|
label: Ze ?? "DIAL file system",
|
|
1914
|
-
icon: /* @__PURE__ */
|
|
1914
|
+
icon: /* @__PURE__ */ W(se, {
|
|
1915
1915
|
size: u,
|
|
1916
1916
|
"aria-hidden": !0,
|
|
1917
1917
|
stroke: m
|
|
1918
1918
|
}),
|
|
1919
1919
|
onClick: Xe
|
|
1920
|
-
}] : [], [Xe, Ze]), { message: X, setMessage: Z, textareaRef:
|
|
1920
|
+
}] : [], [Xe, Ze]), { message: X, setMessage: Z, textareaRef: bt } = Ne({
|
|
1921
1921
|
messageProp: e,
|
|
1922
1922
|
messageRevision: t
|
|
1923
1923
|
});
|
|
1924
|
-
|
|
1924
|
+
Fe({
|
|
1925
1925
|
insertion: n,
|
|
1926
|
-
textareaRef:
|
|
1926
|
+
textareaRef: bt
|
|
1927
1927
|
});
|
|
1928
|
-
let { isMenuOpen:
|
|
1929
|
-
config:
|
|
1928
|
+
let { isMenuOpen: xt, query: Q, dismiss: St, handleValueChange: Ct } = ke({
|
|
1929
|
+
config: K,
|
|
1930
1930
|
message: X
|
|
1931
|
-
}),
|
|
1932
|
-
if (
|
|
1933
|
-
|
|
1934
|
-
let t = `${
|
|
1931
|
+
}), wt = K?.emptyQueryHint != null, Tt = wt && xt && Q === "", Et = L((e) => {
|
|
1932
|
+
if (K == null || (St(), !e?.consumeQuery)) return;
|
|
1933
|
+
bt.current?.focus();
|
|
1934
|
+
let t = `${K.triggerPrefix}${Q}`;
|
|
1935
1935
|
if (!X.startsWith(t)) return;
|
|
1936
1936
|
let n = X.slice(t.length);
|
|
1937
1937
|
Z(n), J.notifyChange(), d?.(n);
|
|
1938
1938
|
}, [
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1939
|
+
K,
|
|
1940
|
+
St,
|
|
1941
|
+
Q,
|
|
1942
1942
|
X,
|
|
1943
1943
|
Z,
|
|
1944
1944
|
J,
|
|
1945
1945
|
d,
|
|
1946
|
-
|
|
1946
|
+
bt
|
|
1947
1947
|
]);
|
|
1948
|
-
|
|
1949
|
-
let e =
|
|
1948
|
+
R(() => {
|
|
1949
|
+
let e = ht.current;
|
|
1950
1950
|
if (e == null) return;
|
|
1951
1951
|
let t = new ResizeObserver((e) => {
|
|
1952
1952
|
let t = e[0];
|
|
1953
|
-
t != null &&
|
|
1953
|
+
t != null && _t(t.contentRect.width);
|
|
1954
1954
|
});
|
|
1955
1955
|
return t.observe(e), () => t.disconnect();
|
|
1956
1956
|
}, [Y]);
|
|
1957
|
-
let { attachments:
|
|
1957
|
+
let { attachments: Dt, buildAttachments: Ot, addAttachments: kt, resetAttachments: At, handleRemove: jt, handleRetry: Mt, handleExpand: Nt, hasBlockedAttachments: Pt } = De({
|
|
1958
1958
|
initialAttachments: fe,
|
|
1959
1959
|
onUploadAttachment: i,
|
|
1960
1960
|
onAttachmentsChange: f,
|
|
1961
1961
|
validateAttachment: Qe,
|
|
1962
1962
|
pendingDropFiles: ie,
|
|
1963
1963
|
onDropFilesConsumed: ae,
|
|
1964
|
-
pendingAttachments:
|
|
1965
|
-
onPendingAttachmentsConsumed:
|
|
1966
|
-
onExpandPastedText:
|
|
1964
|
+
pendingAttachments: N,
|
|
1965
|
+
onPendingAttachmentsConsumed: P,
|
|
1966
|
+
onExpandPastedText: L((e) => {
|
|
1967
1967
|
Z((t) => t ? `${t}\n${e}` : e);
|
|
1968
1968
|
}, [Z]),
|
|
1969
1969
|
maximumAttachmentsAmount: nt,
|
|
1970
|
-
baseAttachmentsAmount:
|
|
1971
|
-
onAttachmentsLimitExceeded:
|
|
1972
|
-
}),
|
|
1973
|
-
|
|
1974
|
-
}, [
|
|
1975
|
-
|
|
1976
|
-
let [
|
|
1970
|
+
baseAttachmentsAmount: Oe.length,
|
|
1971
|
+
onAttachmentsLimitExceeded: it
|
|
1972
|
+
}), Ft = L((e) => {
|
|
1973
|
+
kt(Ot([e]));
|
|
1974
|
+
}, [kt, Ot]), It = V(!1), Lt = V(X);
|
|
1975
|
+
Lt.current = X;
|
|
1976
|
+
let [Rt, zt] = H({
|
|
1977
1977
|
text: "",
|
|
1978
1978
|
revision: 0
|
|
1979
|
-
}), { state:
|
|
1980
|
-
onAttachAudio:
|
|
1979
|
+
}), { state: $, analyserNodeRef: Vt, errorMessage: Ht, startRecording: Ut, stopRecording: Wt, discardRecording: Gt } = He({
|
|
1980
|
+
onAttachAudio: Ft,
|
|
1981
1981
|
onTranscribeAudio: Ce,
|
|
1982
|
-
onTranscript:
|
|
1982
|
+
onTranscript: L((e) => {
|
|
1983
1983
|
let t = e.trim();
|
|
1984
1984
|
if (t) {
|
|
1985
|
-
let e =
|
|
1986
|
-
|
|
1985
|
+
let e = Lt.current, n = `${e}${e && !/\s$/.test(e) ? " " : ""}${t}`;
|
|
1986
|
+
Lt.current = n, Z(n), zt((e) => ({
|
|
1987
1987
|
text: t,
|
|
1988
1988
|
revision: e.revision + 1
|
|
1989
1989
|
})), J.notifyChange(), d?.(n);
|
|
1990
1990
|
}
|
|
1991
|
-
|
|
1991
|
+
It.current = !0;
|
|
1992
1992
|
}, [
|
|
1993
1993
|
Z,
|
|
1994
1994
|
J,
|
|
1995
1995
|
d
|
|
1996
1996
|
]),
|
|
1997
1997
|
errorLabel: Te
|
|
1998
|
-
}),
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
}, [
|
|
2002
|
-
let
|
|
2003
|
-
if (!
|
|
1998
|
+
}), Kt = $ === Ie.Recording || $ === Ie.Processing;
|
|
1999
|
+
R(() => {
|
|
2000
|
+
($ === Ie.Error || $ === Ie.Idle && It.current) && (It.current = !1, bt.current?.focus());
|
|
2001
|
+
}, [$, bt]);
|
|
2002
|
+
let qt = V(null), Jt = V(null), Yt = at && ot, { handlePaste: Xt } = xe(kt, Yt ? oe : Infinity), Zt = L((e) => {
|
|
2003
|
+
if (!Yt) {
|
|
2004
2004
|
let t = e.clipboardData.getData("text/plain");
|
|
2005
|
-
t.length >=
|
|
2005
|
+
t.length >= F && dt?.(t.length, F);
|
|
2006
2006
|
}
|
|
2007
|
-
|
|
2007
|
+
Xt(e);
|
|
2008
2008
|
}, [
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
]),
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
}, [(
|
|
2017
|
-
let
|
|
2018
|
-
let e =
|
|
2019
|
-
return ze ? e.filter((e) => e.isSelected ||
|
|
2009
|
+
Yt,
|
|
2010
|
+
F,
|
|
2011
|
+
dt,
|
|
2012
|
+
Xt
|
|
2013
|
+
]), Qt = (X.trim().length > 0 || Dt.length > 0 || Y) && !Pt && !ye && !Kt, [$t, en] = H([]);
|
|
2014
|
+
R(() => {
|
|
2015
|
+
en([]);
|
|
2016
|
+
}, [(Pe ?? []).map((e) => e.id).join("|")]);
|
|
2017
|
+
let tn = B(() => {
|
|
2018
|
+
let e = Pe ?? [];
|
|
2019
|
+
return ze ? e.filter((e) => e.isSelected || !$t.includes(e.id)) : e;
|
|
2020
2020
|
}, [
|
|
2021
|
-
|
|
2022
|
-
|
|
2021
|
+
Pe,
|
|
2022
|
+
$t,
|
|
2023
2023
|
ze
|
|
2024
|
-
]),
|
|
2025
|
-
|
|
2026
|
-
}, [
|
|
2027
|
-
if (
|
|
2028
|
-
if (X.length >=
|
|
2029
|
-
|
|
2024
|
+
]), nn = L((e) => {
|
|
2025
|
+
en((t) => t.includes(e) ? t : [...t, e]), Pe?.find((t) => t.id === e)?.isSelected && Re?.(e);
|
|
2026
|
+
}, [Pe, Re]), rn = I === void 0 || le != null, an = be && !o, on = async () => {
|
|
2027
|
+
if (ye || Kt) return;
|
|
2028
|
+
if (X.length >= F) {
|
|
2029
|
+
dt?.(X.length, F);
|
|
2030
2030
|
return;
|
|
2031
2031
|
}
|
|
2032
|
-
let e = X, t =
|
|
2032
|
+
let e = X, t = Dt;
|
|
2033
2033
|
Z(""), J.reset();
|
|
2034
2034
|
try {
|
|
2035
2035
|
await r?.(e, t), t.forEach((e) => {
|
|
2036
2036
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
2037
|
-
}),
|
|
2037
|
+
}), At([]);
|
|
2038
2038
|
} catch {
|
|
2039
|
-
Z(e),
|
|
2039
|
+
Z(e), At(t);
|
|
2040
2040
|
}
|
|
2041
|
-
},
|
|
2042
|
-
if (!
|
|
2043
|
-
if (!e.nativeEvent.isComposing && !
|
|
2041
|
+
}, sn = (e) => {
|
|
2042
|
+
if (!Kt) {
|
|
2043
|
+
if (!e.nativeEvent.isComposing && !z && !o) {
|
|
2044
2044
|
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
2045
2045
|
let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
|
|
2046
2046
|
if (n !== null) {
|
|
@@ -2053,206 +2053,210 @@ var Pt = {
|
|
|
2053
2053
|
return;
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
|
-
e.key === "Enter" && (Ee ===
|
|
2056
|
+
e.key === "Enter" && (Ee === Ue.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !o && Qt && rn && !z && on());
|
|
2057
2057
|
}
|
|
2058
|
-
},
|
|
2058
|
+
}, cn = (e) => {
|
|
2059
2059
|
let t = Array.from(e.target.files ?? []);
|
|
2060
2060
|
if (t.length === 0) return;
|
|
2061
|
-
let n =
|
|
2062
|
-
e.target.value = "",
|
|
2063
|
-
},
|
|
2064
|
-
className: c(
|
|
2065
|
-
ref:
|
|
2061
|
+
let n = Ot(t);
|
|
2062
|
+
e.target.value = "", kt(n);
|
|
2063
|
+
}, ln = /* @__PURE__ */ W("textarea", {
|
|
2064
|
+
className: c(q.textarea, Y && q.textareaIndented, ne?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]", "disabled:cursor-not-allowed"),
|
|
2065
|
+
ref: bt,
|
|
2066
2066
|
autoFocus: Je,
|
|
2067
2067
|
value: X,
|
|
2068
2068
|
onChange: (e) => {
|
|
2069
2069
|
Z(e.target.value), J.notifyChange();
|
|
2070
2070
|
let t = e.nativeEvent instanceof InputEvent ? e.nativeEvent : void 0;
|
|
2071
|
-
|
|
2071
|
+
Ct(e.target.value, t?.isComposing ?? !1, t?.inputType), d?.(e.target.value);
|
|
2072
2072
|
},
|
|
2073
|
-
onKeyDown:
|
|
2074
|
-
onPaste:
|
|
2073
|
+
onKeyDown: sn,
|
|
2074
|
+
onPaste: Zt,
|
|
2075
2075
|
placeholder: Y ? void 0 : g,
|
|
2076
|
-
"aria-label":
|
|
2077
|
-
disabled:
|
|
2078
|
-
readOnly:
|
|
2076
|
+
"aria-label": y,
|
|
2077
|
+
disabled: z,
|
|
2078
|
+
readOnly: Kt,
|
|
2079
2079
|
rows: 1
|
|
2080
|
-
}),
|
|
2080
|
+
}), un = K == null ? ln : /* @__PURE__ */ W(h, {
|
|
2081
2081
|
className: "w-full",
|
|
2082
|
-
open:
|
|
2082
|
+
open: xt,
|
|
2083
2083
|
onOpenChange: (e) => {
|
|
2084
|
-
e ||
|
|
2084
|
+
e || St();
|
|
2085
2085
|
},
|
|
2086
2086
|
placement: "top-start",
|
|
2087
2087
|
trigger: [],
|
|
2088
2088
|
initialFocus: -1,
|
|
2089
2089
|
matchReferenceWidth: !1,
|
|
2090
|
-
outsidePressIgnoreRef:
|
|
2090
|
+
outsidePressIgnoreRef: bt,
|
|
2091
2091
|
renderOverlay: () => {
|
|
2092
|
-
let e =
|
|
2093
|
-
query:
|
|
2094
|
-
close:
|
|
2092
|
+
let e = K.renderMenu({
|
|
2093
|
+
query: Q,
|
|
2094
|
+
close: Et
|
|
2095
2095
|
});
|
|
2096
|
-
return
|
|
2096
|
+
return K.menuLabel == null ? e : /* @__PURE__ */ W("div", {
|
|
2097
2097
|
role: "group",
|
|
2098
|
-
"aria-label":
|
|
2098
|
+
"aria-label": K.menuLabel,
|
|
2099
2099
|
children: e
|
|
2100
2100
|
});
|
|
2101
2101
|
},
|
|
2102
|
-
children:
|
|
2103
|
-
}),
|
|
2102
|
+
children: ln
|
|
2103
|
+
}), dn = Y || wt ? /* @__PURE__ */ G("div", {
|
|
2104
2104
|
className: "relative w-full",
|
|
2105
2105
|
children: [
|
|
2106
|
-
Y && /* @__PURE__ */
|
|
2107
|
-
ref:
|
|
2106
|
+
Y && /* @__PURE__ */ W("div", {
|
|
2107
|
+
ref: ht,
|
|
2108
2108
|
className: "absolute start-0 top-0",
|
|
2109
2109
|
children: Ke
|
|
2110
2110
|
}),
|
|
2111
|
-
|
|
2112
|
-
className: c(
|
|
2111
|
+
Tt && K != null && /* @__PURE__ */ G("span", {
|
|
2112
|
+
className: c(q.commandHint, "pointer-events-none absolute start-[var(--ci-first-line-indent,0px)] top-0", ne?.fontClassName || "dial-body-paragraph-text"),
|
|
2113
2113
|
"aria-hidden": !0,
|
|
2114
|
-
children: [/* @__PURE__ */
|
|
2114
|
+
children: [/* @__PURE__ */ W("span", {
|
|
2115
2115
|
className: "invisible",
|
|
2116
|
-
children:
|
|
2117
|
-
}),
|
|
2116
|
+
children: K.triggerPrefix
|
|
2117
|
+
}), K.emptyQueryHint]
|
|
2118
2118
|
}),
|
|
2119
|
-
|
|
2119
|
+
un
|
|
2120
2120
|
]
|
|
2121
|
-
}) :
|
|
2122
|
-
onAttachClick: me ? void 0 : () =>
|
|
2123
|
-
attachLabel:
|
|
2124
|
-
addMenuTitle:
|
|
2125
|
-
menuTitle:
|
|
2126
|
-
menuCloseLabel:
|
|
2127
|
-
style:
|
|
2128
|
-
isDisabled:
|
|
2121
|
+
}) : un, fn = pe ? void 0 : /* @__PURE__ */ W(et, {
|
|
2122
|
+
onAttachClick: me ? void 0 : () => qt.current?.click(),
|
|
2123
|
+
attachLabel: b,
|
|
2124
|
+
addMenuTitle: S,
|
|
2125
|
+
menuTitle: C,
|
|
2126
|
+
menuCloseLabel: w,
|
|
2127
|
+
style: vt,
|
|
2128
|
+
isDisabled: z || Kt && $ !== Ie.Recording,
|
|
2129
2129
|
chatSettings: je,
|
|
2130
|
-
extraMenuItems:
|
|
2131
|
-
onRecordVoice:
|
|
2132
|
-
recordVoiceLabel:
|
|
2133
|
-
toolsMenuItems: ze ?
|
|
2134
|
-
onToolToggle:
|
|
2130
|
+
extraMenuItems: yt,
|
|
2131
|
+
onRecordVoice: Se && at && !o && !Kt ? () => Ut(Le.Attachment) : void 0,
|
|
2132
|
+
recordVoiceLabel: A,
|
|
2133
|
+
toolsMenuItems: ze ? Pe : void 0,
|
|
2134
|
+
onToolToggle: Re,
|
|
2135
2135
|
toolsMenuTitle: Be,
|
|
2136
2136
|
toolsBackLabel: Ve,
|
|
2137
2137
|
menuOverlays: Ge
|
|
2138
2138
|
});
|
|
2139
|
-
return /* @__PURE__ */
|
|
2140
|
-
ref:
|
|
2141
|
-
style:
|
|
2142
|
-
className: c(
|
|
2139
|
+
return /* @__PURE__ */ G("div", {
|
|
2140
|
+
ref: Jt,
|
|
2141
|
+
style: vt,
|
|
2142
|
+
className: c(q.wrapper, z && q.wrapperDisabled, z && "cursor-not-allowed", "flex w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", Dt.length > 6 ? "py-4 ps-4" : "p-4", re),
|
|
2143
2143
|
children: [
|
|
2144
|
-
(
|
|
2145
|
-
attachments: [...
|
|
2144
|
+
(Oe.length > 0 || Dt.length > 0) && /* @__PURE__ */ W(ve, {
|
|
2145
|
+
attachments: [...Oe, ...Dt],
|
|
2146
2146
|
onRemove: (e) => {
|
|
2147
|
-
|
|
2147
|
+
Oe.some((t) => t.id === e) ? Ae?.(e) : jt(e);
|
|
2148
2148
|
},
|
|
2149
|
-
onRetry:
|
|
2150
|
-
onExpand:
|
|
2149
|
+
onRetry: Mt,
|
|
2150
|
+
onExpand: Nt,
|
|
2151
2151
|
labels: {
|
|
2152
|
-
removeLabel:
|
|
2153
|
-
retryLabel:
|
|
2154
|
-
uploadingLabel:
|
|
2152
|
+
removeLabel: T,
|
|
2153
|
+
retryLabel: E,
|
|
2154
|
+
uploadingLabel: D
|
|
2155
2155
|
},
|
|
2156
2156
|
onAttachmentClick: $e == null ? void 0 : (e) => {
|
|
2157
|
-
let t = [...
|
|
2157
|
+
let t = [...Oe, ...Dt].find((t) => t.id === e);
|
|
2158
2158
|
t != null && $e(t);
|
|
2159
2159
|
}
|
|
2160
2160
|
}),
|
|
2161
|
-
!pe && /* @__PURE__ */
|
|
2162
|
-
ref:
|
|
2161
|
+
!pe && /* @__PURE__ */ W("input", {
|
|
2162
|
+
ref: qt,
|
|
2163
2163
|
type: "file",
|
|
2164
2164
|
multiple: !0,
|
|
2165
|
-
accept:
|
|
2165
|
+
accept: x,
|
|
2166
2166
|
className: "sr-only",
|
|
2167
2167
|
"aria-hidden": !0,
|
|
2168
2168
|
tabIndex: -1,
|
|
2169
|
-
onChange:
|
|
2169
|
+
onChange: cn
|
|
2170
|
+
}),
|
|
2171
|
+
Ht && /* @__PURE__ */ W(_, {
|
|
2172
|
+
text: Ht,
|
|
2173
|
+
className: "min-w-0 break-words px-1"
|
|
2170
2174
|
}),
|
|
2171
|
-
|
|
2175
|
+
Kt && /* @__PURE__ */ W(ct, {
|
|
2172
2176
|
embedded: !0,
|
|
2173
|
-
state:
|
|
2174
|
-
analyserNodeRef:
|
|
2175
|
-
errorMessage:
|
|
2176
|
-
onStop:
|
|
2177
|
-
onDiscard:
|
|
2178
|
-
attachButton:
|
|
2179
|
-
stopLabel:
|
|
2180
|
-
discardLabel:
|
|
2177
|
+
state: $,
|
|
2178
|
+
analyserNodeRef: Vt,
|
|
2179
|
+
errorMessage: Ht,
|
|
2180
|
+
onStop: Wt,
|
|
2181
|
+
onDiscard: Gt,
|
|
2182
|
+
attachButton: fn,
|
|
2183
|
+
stopLabel: te,
|
|
2184
|
+
discardLabel: j,
|
|
2181
2185
|
processingLabel: we
|
|
2182
2186
|
}),
|
|
2183
|
-
!
|
|
2184
|
-
!
|
|
2187
|
+
!Kt && he && dn,
|
|
2188
|
+
!Kt && !he && /* @__PURE__ */ G("div", {
|
|
2185
2189
|
className: "flex flex-wrap items-center gap-2",
|
|
2186
2190
|
children: [
|
|
2187
|
-
/* @__PURE__ */
|
|
2191
|
+
/* @__PURE__ */ W("div", {
|
|
2188
2192
|
className: "flex w-full min-w-0 items-center self-stretch",
|
|
2189
|
-
children:
|
|
2193
|
+
children: dn
|
|
2190
2194
|
}),
|
|
2191
|
-
|
|
2195
|
+
fn && /* @__PURE__ */ W("div", {
|
|
2192
2196
|
className: "flex",
|
|
2193
|
-
children:
|
|
2197
|
+
children: fn
|
|
2194
2198
|
}),
|
|
2195
|
-
|
|
2199
|
+
tn.length > 0 && Re != null && /* @__PURE__ */ W("div", {
|
|
2196
2200
|
className: "min-w-0 flex-1",
|
|
2197
|
-
children: /* @__PURE__ */
|
|
2198
|
-
items:
|
|
2199
|
-
onToolToggle:
|
|
2200
|
-
onToolDismiss:
|
|
2201
|
+
children: /* @__PURE__ */ W(rt, {
|
|
2202
|
+
items: tn,
|
|
2203
|
+
onToolToggle: Re,
|
|
2204
|
+
onToolDismiss: nn,
|
|
2201
2205
|
canRemove: ze,
|
|
2202
|
-
removeLabel:
|
|
2206
|
+
removeLabel: We?.removeLabel
|
|
2203
2207
|
})
|
|
2204
2208
|
}),
|
|
2205
|
-
/* @__PURE__ */
|
|
2209
|
+
/* @__PURE__ */ W("div", {
|
|
2206
2210
|
className: "ms-auto flex flex-shrink-0 items-center gap-2",
|
|
2207
2211
|
children: ge ? ge({
|
|
2208
|
-
canSend:
|
|
2209
|
-
onSend:
|
|
2210
|
-
}) : /* @__PURE__ */
|
|
2212
|
+
canSend: Qt,
|
|
2213
|
+
onSend: on
|
|
2214
|
+
}) : /* @__PURE__ */ G(U, { children: [
|
|
2211
2215
|
st,
|
|
2212
|
-
/* @__PURE__ */
|
|
2213
|
-
deployments:
|
|
2214
|
-
selectedDeploymentId:
|
|
2216
|
+
/* @__PURE__ */ W(Bt, {
|
|
2217
|
+
deployments: I,
|
|
2218
|
+
selectedDeploymentId: le,
|
|
2215
2219
|
onDeploymentChange: ue,
|
|
2216
2220
|
modelSelectorLabels: de,
|
|
2217
2221
|
isStreaming: o,
|
|
2218
|
-
isMobile:
|
|
2222
|
+
isMobile: ft,
|
|
2219
2223
|
isDisabled: _e,
|
|
2220
|
-
style:
|
|
2221
|
-
modelPickerOverlay:
|
|
2222
|
-
isPickerOpen:
|
|
2223
|
-
onPickerToggle: () =>
|
|
2224
|
-
onPickerOpenChange:
|
|
2224
|
+
style: vt,
|
|
2225
|
+
modelPickerOverlay: tt,
|
|
2226
|
+
isPickerOpen: pt,
|
|
2227
|
+
onPickerToggle: () => mt((e) => !e),
|
|
2228
|
+
onPickerOpenChange: mt
|
|
2225
2229
|
}),
|
|
2226
|
-
|
|
2227
|
-
icon: /* @__PURE__ */
|
|
2230
|
+
an && /* @__PURE__ */ W(v, {
|
|
2231
|
+
icon: /* @__PURE__ */ W(ce, {
|
|
2228
2232
|
size: p.LG,
|
|
2229
2233
|
stroke: m,
|
|
2230
2234
|
"aria-hidden": !0
|
|
2231
2235
|
}),
|
|
2232
|
-
"aria-label":
|
|
2233
|
-
tooltipProps: { tooltip:
|
|
2236
|
+
"aria-label": ee,
|
|
2237
|
+
tooltipProps: { tooltip: ee },
|
|
2234
2238
|
className: "size-[40px] flex-shrink-0 mobile:min-h-11 mobile:min-w-11",
|
|
2235
|
-
onClick: () =>
|
|
2236
|
-
disabled:
|
|
2239
|
+
onClick: () => Ut(Le.Dictation),
|
|
2240
|
+
disabled: z || o
|
|
2237
2241
|
}),
|
|
2238
|
-
o && a ? /* @__PURE__ */
|
|
2242
|
+
o && a ? /* @__PURE__ */ W(ut, {
|
|
2239
2243
|
onStop: a,
|
|
2244
|
+
ariaLabel: k
|
|
2245
|
+
}) : !o && /* @__PURE__ */ W(lt, {
|
|
2246
|
+
onSend: on,
|
|
2247
|
+
isDisabled: !rn || !Qt,
|
|
2240
2248
|
ariaLabel: O
|
|
2241
|
-
}) : !o && /* @__PURE__ */ U(lt, {
|
|
2242
|
-
onSend: an,
|
|
2243
|
-
isDisabled: !nn || !Zt,
|
|
2244
|
-
ariaLabel: D
|
|
2245
2249
|
})
|
|
2246
2250
|
] })
|
|
2247
2251
|
})
|
|
2248
2252
|
]
|
|
2249
2253
|
}),
|
|
2250
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ W("span", {
|
|
2251
2255
|
className: "sr-only",
|
|
2252
2256
|
role: "status",
|
|
2253
2257
|
"aria-live": "polite",
|
|
2254
2258
|
"aria-atomic": "true",
|
|
2255
|
-
children: /* @__PURE__ */
|
|
2259
|
+
children: /* @__PURE__ */ W("span", { children: Rt.text }, Rt.revision)
|
|
2256
2260
|
})
|
|
2257
2261
|
]
|
|
2258
2262
|
});
|
|
@@ -2261,24 +2265,24 @@ var Pt = {
|
|
|
2261
2265
|
description: "_description_1icyo_5"
|
|
2262
2266
|
}, Ht = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, descriptionText: r, styles: i, className: a, inputClassName: o, isInputDisabled: l = !1, ...u }) => {
|
|
2263
2267
|
let { colors: d, typography: f } = i ?? {};
|
|
2264
|
-
return /* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ G("div", {
|
|
2265
2269
|
style: s({
|
|
2266
2270
|
"--ci-welcome-color": d?.welcomeText,
|
|
2267
2271
|
"--ci-description-color": d?.descriptionText
|
|
2268
2272
|
}),
|
|
2269
2273
|
className: c("relative flex w-full flex-col items-center gap-9 px-4 py-5 desktop:p-5", a),
|
|
2270
|
-
children: [n && /* @__PURE__ */
|
|
2274
|
+
children: [n && /* @__PURE__ */ G("div", {
|
|
2271
2275
|
className: "flex flex-col items-center gap-4 text-center",
|
|
2272
|
-
children: [/* @__PURE__ */
|
|
2276
|
+
children: [/* @__PURE__ */ W("h1", {
|
|
2273
2277
|
className: c(Vt.welcome, "m-0", f?.welcomeClassName || "dial-display2-text"),
|
|
2274
2278
|
children: n
|
|
2275
|
-
}), r && /* @__PURE__ */
|
|
2279
|
+
}), r && /* @__PURE__ */ W("p", {
|
|
2276
2280
|
className: c(Vt.description, "m-0 max-w-[540px]", f?.descriptionClassName || "dial-body-paragraph-text"),
|
|
2277
2281
|
children: r
|
|
2278
2282
|
})]
|
|
2279
|
-
}), /* @__PURE__ */
|
|
2283
|
+
}), /* @__PURE__ */ W("div", {
|
|
2280
2284
|
className: c("relative w-full", n ? "max-w-[700px]" : "max-w-[748px]"),
|
|
2281
|
-
children: /* @__PURE__ */
|
|
2285
|
+
children: /* @__PURE__ */ W($, {
|
|
2282
2286
|
placeholder: t,
|
|
2283
2287
|
isStreaming: e,
|
|
2284
2288
|
isInputDisabled: l,
|
|
@@ -2289,101 +2293,101 @@ var Pt = {
|
|
|
2289
2293
|
})
|
|
2290
2294
|
})]
|
|
2291
2295
|
});
|
|
2292
|
-
}, Ut = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel:
|
|
2293
|
-
let
|
|
2294
|
-
|
|
2295
|
-
C?.length && (
|
|
2296
|
+
}, Ut = ({ message: e, inlineStartSlot: t, onInlineStartRemove: n, initialAttachments: r = [], onCancel: a, onSave: o, onUploadAttachment: s, cancelLabel: l = "Cancel", saveLabel: d = "Save & Submit", ariaLabel: f, removeLabel: p, retryLabel: h, uploadingLabel: g, addMenuTitle: _ = "Add", attachLabel: v = "Attach file", menuTitle: y = "Menu", menuCloseLabel: b = "Close", className: S, pendingDropFiles: C, onDropFilesConsumed: T, validateAttachment: E, isAttachmentsEnabled: D, isTextAttachmentsAllowed: O, hideAttachFile: k = !1, fileAccept: ee, maximumAttachmentsAmount: A, onAttachmentsLimitExceeded: te, onDialFileSystemClick: j, dialFileSystemLabel: M, pendingAttachments: ne, onPendingAttachmentsConsumed: re, onAttachmentClick: ie, pasteTextThreshold: ae, maxMessageLength: N = 5e4, onMessageTooLong: P }) => {
|
|
2297
|
+
let oe = V(null), [ce, F] = H([]);
|
|
2298
|
+
R(() => {
|
|
2299
|
+
C?.length && (F(C), T?.());
|
|
2296
2300
|
}, [C, T]);
|
|
2297
|
-
let [
|
|
2298
|
-
|
|
2299
|
-
},
|
|
2300
|
-
o(e,
|
|
2301
|
-
}, [
|
|
2302
|
-
if (
|
|
2303
|
-
if (
|
|
2304
|
-
|
|
2301
|
+
let [I, le] = H(e ?? ""), [ue, de] = H([]), [fe, pe] = H(r), me = ue.some((e) => e.status === i.Loading || e.status === i.Error), he = (I.trim().length > 0 || ue.length > 0 || fe.length > 0) && !me, ge = (e) => {
|
|
2302
|
+
pe((t) => t.filter((t) => t.id !== e));
|
|
2303
|
+
}, z = L((e, t) => {
|
|
2304
|
+
o(e, fe, t);
|
|
2305
|
+
}, [fe, o]), _e = () => {
|
|
2306
|
+
if (he) {
|
|
2307
|
+
if (I.length >= N) {
|
|
2308
|
+
P?.(I.length, N);
|
|
2305
2309
|
return;
|
|
2306
2310
|
}
|
|
2307
|
-
|
|
2311
|
+
z(I, ue);
|
|
2308
2312
|
}
|
|
2309
|
-
},
|
|
2313
|
+
}, ve = L(() => F([]), []), ye = L((e) => {
|
|
2310
2314
|
let t = Array.from(e.target.files ?? []);
|
|
2311
|
-
t.length !== 0 && (e.target.value = "",
|
|
2312
|
-
}, []),
|
|
2315
|
+
t.length !== 0 && (e.target.value = "", F(t));
|
|
2316
|
+
}, []), be = B(() => j ? [{
|
|
2313
2317
|
key: "dial-fs",
|
|
2314
|
-
label:
|
|
2315
|
-
icon: /* @__PURE__ */
|
|
2318
|
+
label: M ?? "DIAL file system",
|
|
2319
|
+
icon: /* @__PURE__ */ W(se, {
|
|
2316
2320
|
size: u,
|
|
2317
2321
|
"aria-hidden": !0,
|
|
2318
2322
|
stroke: m
|
|
2319
2323
|
}),
|
|
2320
2324
|
onClick: j
|
|
2321
|
-
}] : [], [j,
|
|
2322
|
-
return /* @__PURE__ */
|
|
2325
|
+
}] : [], [j, M]);
|
|
2326
|
+
return /* @__PURE__ */ G("div", {
|
|
2323
2327
|
className: c("flex w-full flex-col gap-2", S),
|
|
2324
|
-
children: [/* @__PURE__ */
|
|
2328
|
+
children: [/* @__PURE__ */ W($, {
|
|
2325
2329
|
message: e,
|
|
2326
2330
|
inlineStartSlot: t,
|
|
2327
2331
|
onInlineStartRemove: n,
|
|
2328
2332
|
ariaLabel: f,
|
|
2329
2333
|
hideActionBar: !0,
|
|
2330
2334
|
pendingDropFiles: ce,
|
|
2331
|
-
onDropFilesConsumed:
|
|
2332
|
-
onSend:
|
|
2335
|
+
onDropFilesConsumed: ve,
|
|
2336
|
+
onSend: z,
|
|
2333
2337
|
onUploadAttachment: s,
|
|
2334
|
-
onChange:
|
|
2335
|
-
onAttachmentsChange:
|
|
2338
|
+
onChange: le,
|
|
2339
|
+
onAttachmentsChange: de,
|
|
2336
2340
|
removeLabel: p,
|
|
2337
2341
|
retryLabel: h,
|
|
2338
2342
|
uploadingLabel: g,
|
|
2339
2343
|
className: "max-w-full",
|
|
2340
|
-
prefixAttachments:
|
|
2341
|
-
onRemovePrefixAttachment:
|
|
2344
|
+
prefixAttachments: fe,
|
|
2345
|
+
onRemovePrefixAttachment: ge,
|
|
2342
2346
|
validateAttachment: E,
|
|
2343
2347
|
isAttachmentsEnabled: D,
|
|
2344
2348
|
isTextAttachmentsAllowed: O,
|
|
2345
2349
|
maximumAttachmentsAmount: A,
|
|
2346
2350
|
onAttachmentsLimitExceeded: te,
|
|
2347
|
-
pendingAttachments:
|
|
2348
|
-
onPendingAttachmentsConsumed:
|
|
2349
|
-
onAttachmentClick:
|
|
2350
|
-
pasteTextThreshold:
|
|
2351
|
-
maxMessageLength:
|
|
2352
|
-
onMessageTooLong:
|
|
2353
|
-
}), /* @__PURE__ */
|
|
2351
|
+
pendingAttachments: ne,
|
|
2352
|
+
onPendingAttachmentsConsumed: re,
|
|
2353
|
+
onAttachmentClick: ie,
|
|
2354
|
+
pasteTextThreshold: ae,
|
|
2355
|
+
maxMessageLength: N,
|
|
2356
|
+
onMessageTooLong: P
|
|
2357
|
+
}), /* @__PURE__ */ G("div", {
|
|
2354
2358
|
className: "flex items-center justify-between",
|
|
2355
|
-
children: [/* @__PURE__ */
|
|
2359
|
+
children: [/* @__PURE__ */ W("div", {
|
|
2356
2360
|
className: "flex",
|
|
2357
|
-
children: !k && /* @__PURE__ */
|
|
2358
|
-
ref:
|
|
2361
|
+
children: !k && /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W("input", {
|
|
2362
|
+
ref: oe,
|
|
2359
2363
|
type: "file",
|
|
2360
2364
|
multiple: !0,
|
|
2361
2365
|
accept: ee,
|
|
2362
2366
|
className: "sr-only",
|
|
2363
2367
|
"aria-hidden": !0,
|
|
2364
2368
|
tabIndex: -1,
|
|
2365
|
-
onChange:
|
|
2366
|
-
}), /* @__PURE__ */
|
|
2367
|
-
onAttachClick: () =>
|
|
2369
|
+
onChange: ye
|
|
2370
|
+
}), /* @__PURE__ */ W(et, {
|
|
2371
|
+
onAttachClick: () => oe.current?.click(),
|
|
2368
2372
|
attachLabel: v,
|
|
2369
2373
|
addMenuTitle: _,
|
|
2370
2374
|
menuTitle: y,
|
|
2371
2375
|
menuCloseLabel: b,
|
|
2372
|
-
extraMenuItems:
|
|
2376
|
+
extraMenuItems: be
|
|
2373
2377
|
})] })
|
|
2374
|
-
}), /* @__PURE__ */
|
|
2378
|
+
}), /* @__PURE__ */ G("div", {
|
|
2375
2379
|
className: "flex gap-2",
|
|
2376
|
-
children: [/* @__PURE__ */
|
|
2380
|
+
children: [/* @__PURE__ */ W(x, {
|
|
2377
2381
|
label: l,
|
|
2378
2382
|
onClick: a
|
|
2379
|
-
}), /* @__PURE__ */
|
|
2383
|
+
}), /* @__PURE__ */ W(w, {
|
|
2380
2384
|
label: d,
|
|
2381
|
-
onClick:
|
|
2382
|
-
disabled: !
|
|
2385
|
+
onClick: _e,
|
|
2386
|
+
disabled: !he
|
|
2383
2387
|
})]
|
|
2384
2388
|
})]
|
|
2385
2389
|
})]
|
|
2386
2390
|
});
|
|
2387
2391
|
};
|
|
2388
2392
|
//#endregion
|
|
2389
|
-
export {
|
|
2393
|
+
export { Te as BottomSheetShell, Xe as ChatSettingsModal, Ht as ConversationInput, Ut as EditMessageInput, $ as Input, Ue as SendOnEnter };
|