@epam/ai-dial-conversation-input 1.0.0-dev.536 → 1.0.0-dev.538
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, Highlight as r, RequestStatus as i, ResponseFormat as a, buildCssVars as o, mergeClasses as s, useIsMobile as c } from "@epam/ai-dial-chat-shared";
|
|
2
2
|
import { BASE_ICON_SIZE as l, ButtonAppearance as u, ButtonVariant as d, DIAL_ICON_SIZE as f, DialButton as p, DialCloseButton as m, DialDropdown as h, DialDropdownIcon as g, DialErrorText as _, DialGhostIconButton as v, DialInput as y, DialPopup as b, DialPrimaryButton as x, DialRadioGroup as S, DialSearch as C, DialSkeleton as w, DialSkeletonVariant as T, DialSlider as E, DialSpinner as D, DialTag as ee, DialTooltip as O, ElementSize as k, PopupSize as A, RadioGroupOrientation as te } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconArrowLeft as ne, IconArrowNarrowRight as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { AttachmentCard as
|
|
3
|
+
import { IconArrowLeft as ne, IconArrowNarrowRight as j, IconCheck as re, IconChevronDown as M, IconChevronRight as ie, IconFile as ae, IconMicrophone as oe, IconPaperclip as se, IconPlaystationSquare as ce, IconPlus as le, IconSettings as ue, IconX as de } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as N } from "react-dom";
|
|
5
|
+
import { createElement as fe, memo as pe, useCallback as P, useEffect as F, useImperativeHandle as me, useLayoutEffect as he, useMemo as I, useRef as L, useState as R } from "react";
|
|
6
|
+
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
7
|
+
import { AttachmentCard as ge, AttachmentGroup as _e, AttachmentTray as ve, AttachmentTray as ye, FileDndOverlay as be, MAX_UPLOADS_PER_MINUTE as xe, generateAttachmentId as Se, getAttachmentIcon as Ce, useClipboardPaste as we } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var Te = (e, t) => {
|
|
10
|
+
F(() => {
|
|
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]), F(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
20
|
}, [e]);
|
|
21
|
-
},
|
|
21
|
+
}, H = {
|
|
22
22
|
backdrop: "_backdrop_3xrn0_9",
|
|
23
23
|
sheet: "_sheet_3xrn0_13",
|
|
24
24
|
"slide-up": "_slide-up_3xrn0_1",
|
|
25
25
|
title: "_title_3xrn0_18",
|
|
26
26
|
divider: "_divider_3xrn0_22"
|
|
27
|
-
},
|
|
28
|
-
className: s(
|
|
27
|
+
}, U = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": o, style: c, titleClassName: l = "dial-body-semi-text", className: u, children: d }) => (Te(e, r), !e || typeof document > "u" ? null : N(/* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
|
|
28
|
+
className: s(H.backdrop, "fixed inset-0 z-[55]"),
|
|
29
29
|
onPointerDown: r,
|
|
30
30
|
"aria-hidden": !0
|
|
31
|
-
}), /* @__PURE__ */
|
|
31
|
+
}), /* @__PURE__ */ V("div", {
|
|
32
32
|
role: "dialog",
|
|
33
33
|
"aria-modal": !0,
|
|
34
34
|
"aria-label": t ?? o,
|
|
35
35
|
style: c,
|
|
36
|
-
className: s(
|
|
37
|
-
children: [t != null && /* @__PURE__ */ z
|
|
36
|
+
className: s(H.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", u),
|
|
37
|
+
children: [t != null && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ V("div", {
|
|
38
38
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
39
39
|
children: [
|
|
40
|
-
i && /* @__PURE__ */
|
|
40
|
+
i && /* @__PURE__ */ B("div", {
|
|
41
41
|
className: "absolute start-4",
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
icon: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ B(v, {
|
|
43
|
+
icon: /* @__PURE__ */ B(ne, {
|
|
44
44
|
size: f.LG,
|
|
45
45
|
stroke: 1.5,
|
|
46
46
|
className: "rtl:scale-x-[-1]"
|
|
@@ -49,40 +49,40 @@ var Ee = (e, t) => {
|
|
|
49
49
|
onClick: i
|
|
50
50
|
})
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
className: s(
|
|
52
|
+
/* @__PURE__ */ B("span", {
|
|
53
|
+
className: s(H.title, l),
|
|
54
54
|
children: t
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ B("div", {
|
|
57
57
|
className: "absolute end-4 m-2",
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ B(m, {
|
|
59
59
|
ariaLabel: n,
|
|
60
60
|
size: f.LG,
|
|
61
61
|
onClose: r
|
|
62
62
|
})
|
|
63
63
|
})
|
|
64
64
|
]
|
|
65
|
-
}), /* @__PURE__ */
|
|
65
|
+
}), /* @__PURE__ */ B("div", { className: "h-px flex-shrink-0" })] }), /* @__PURE__ */ B("div", {
|
|
66
66
|
className: "overflow-y-auto",
|
|
67
67
|
children: d
|
|
68
68
|
})]
|
|
69
|
-
})] }), document.body)),
|
|
69
|
+
})] }), document.body)), Ee = async (e, t, n) => {
|
|
70
70
|
let r = 6e4 / t, i = [];
|
|
71
71
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
72
72
|
await Promise.allSettled(i);
|
|
73
|
-
},
|
|
74
|
-
let [h, g] =
|
|
75
|
-
|
|
73
|
+
}, 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 }) => {
|
|
74
|
+
let [h, g] = R(n), _ = L(h);
|
|
75
|
+
F(() => {
|
|
76
76
|
_.current = h;
|
|
77
|
-
}, [h]),
|
|
77
|
+
}, [h]), F(() => () => {
|
|
78
78
|
_.current.forEach((e) => {
|
|
79
79
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl);
|
|
80
80
|
});
|
|
81
81
|
}, []);
|
|
82
|
-
let v =
|
|
82
|
+
let v = P((e) => e.map((e) => {
|
|
83
83
|
let n = e.type.startsWith("image/"), r = n ? URL.createObjectURL(e) : void 0;
|
|
84
84
|
return {
|
|
85
|
-
id:
|
|
85
|
+
id: Se(),
|
|
86
86
|
name: e.name,
|
|
87
87
|
contentType: e.type,
|
|
88
88
|
file: e,
|
|
@@ -90,14 +90,14 @@ var Ee = (e, t) => {
|
|
|
90
90
|
status: i.Idle,
|
|
91
91
|
previewUrl: r
|
|
92
92
|
};
|
|
93
|
-
}), []), y =
|
|
93
|
+
}), []), y = P((e) => {
|
|
94
94
|
g((t) => {
|
|
95
95
|
let n = e(t);
|
|
96
96
|
return n !== t && a?.(n), n;
|
|
97
97
|
});
|
|
98
|
-
}, [a]), b =
|
|
98
|
+
}, [a]), b = P((e) => {
|
|
99
99
|
g(e), a?.(e);
|
|
100
|
-
}, [a]), x =
|
|
100
|
+
}, [a]), x = P(async (t) => {
|
|
101
101
|
if (r) {
|
|
102
102
|
y((e) => e.map((e) => e.id === t.id ? {
|
|
103
103
|
...e,
|
|
@@ -119,7 +119,7 @@ var Ee = (e, t) => {
|
|
|
119
119
|
} : e));
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
}, [r, y]), S =
|
|
122
|
+
}, [r, y]), S = P((e, t = !0) => {
|
|
123
123
|
let n = [], r;
|
|
124
124
|
if (y((t) => {
|
|
125
125
|
let i = new Set(t.map((e) => e.id));
|
|
@@ -146,7 +146,7 @@ var Ee = (e, t) => {
|
|
|
146
146
|
status: i.Error,
|
|
147
147
|
errorReason: n
|
|
148
148
|
} : e));
|
|
149
|
-
}),
|
|
149
|
+
}), Ee(e, xe, x);
|
|
150
150
|
}
|
|
151
151
|
}, [
|
|
152
152
|
p,
|
|
@@ -156,20 +156,20 @@ var Ee = (e, t) => {
|
|
|
156
156
|
x,
|
|
157
157
|
o
|
|
158
158
|
]);
|
|
159
|
-
|
|
159
|
+
F(() => {
|
|
160
160
|
s.length !== 0 && (S(v(s)), c?.());
|
|
161
161
|
}, [
|
|
162
162
|
S,
|
|
163
163
|
v,
|
|
164
164
|
c,
|
|
165
165
|
s
|
|
166
|
-
]),
|
|
166
|
+
]), F(() => {
|
|
167
167
|
l.length !== 0 && (S(l, !1), u?.());
|
|
168
168
|
}, [
|
|
169
169
|
S,
|
|
170
170
|
u,
|
|
171
171
|
l
|
|
172
|
-
]),
|
|
172
|
+
]), F(() => {
|
|
173
173
|
if (!o) return;
|
|
174
174
|
let t = !1, n = [], r = _.current.map((r) => {
|
|
175
175
|
if (r.status === i.Loading) return r;
|
|
@@ -196,7 +196,7 @@ var Ee = (e, t) => {
|
|
|
196
196
|
y,
|
|
197
197
|
x
|
|
198
198
|
]);
|
|
199
|
-
let C =
|
|
199
|
+
let C = P((e) => {
|
|
200
200
|
y((t) => {
|
|
201
201
|
let n = t.find((t) => t.id === e);
|
|
202
202
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), t.filter((t) => t.id !== e);
|
|
@@ -208,11 +208,11 @@ var Ee = (e, t) => {
|
|
|
208
208
|
addAttachments: S,
|
|
209
209
|
resetAttachments: b,
|
|
210
210
|
handleRemove: C,
|
|
211
|
-
handleRetry:
|
|
211
|
+
handleRetry: P((e) => {
|
|
212
212
|
let t = h.find((t) => t.id === e);
|
|
213
213
|
t && x(t);
|
|
214
214
|
}, [h, x]),
|
|
215
|
-
handleExpand:
|
|
215
|
+
handleExpand: P(async (e) => {
|
|
216
216
|
let n = h.find((t) => t.id === e);
|
|
217
217
|
if (!n || n.type !== t.Pasted) return;
|
|
218
218
|
let r = await n.file.text();
|
|
@@ -224,9 +224,9 @@ var Ee = (e, t) => {
|
|
|
224
224
|
]),
|
|
225
225
|
hasBlockedAttachments: h.some((e) => e.status === i.Loading || e.status === i.Error)
|
|
226
226
|
};
|
|
227
|
-
},
|
|
228
|
-
let [n, r] =
|
|
229
|
-
return
|
|
227
|
+
}, Oe = (e, t) => {
|
|
228
|
+
let [n, r] = R(e), [i, a] = R(!1), [o, s] = R(0);
|
|
229
|
+
return F(() => {
|
|
230
230
|
if (e) {
|
|
231
231
|
r(!0), a(!1), s((e) => e + 1);
|
|
232
232
|
return;
|
|
@@ -242,18 +242,18 @@ var Ee = (e, t) => {
|
|
|
242
242
|
isExiting: i,
|
|
243
243
|
instanceKey: o
|
|
244
244
|
};
|
|
245
|
-
},
|
|
246
|
-
let t =
|
|
245
|
+
}, ke = (e, t) => !e.slice(0, t).includes("\n"), Ae = (e, t) => !e.slice(t).includes("\n"), je = (e) => {
|
|
246
|
+
let t = L(e);
|
|
247
247
|
t.current = e;
|
|
248
|
-
let n =
|
|
248
|
+
let n = L(-1), r = L(""), i = P((e, i, a) => {
|
|
249
249
|
let o = t.current;
|
|
250
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
251
|
-
}, []), a =
|
|
250
|
+
return !o || o.length === 0 ? null : e === "up" ? !ke(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !Ae(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
251
|
+
}, []), a = P(() => {
|
|
252
252
|
n.current = -1, r.current = "";
|
|
253
|
-
}, []), o =
|
|
253
|
+
}, []), o = P(() => {
|
|
254
254
|
n.current = -1, r.current = "";
|
|
255
255
|
}, []);
|
|
256
|
-
return
|
|
256
|
+
return I(() => ({
|
|
257
257
|
navigate: i,
|
|
258
258
|
notifyChange: a,
|
|
259
259
|
reset: o
|
|
@@ -262,13 +262,13 @@ var Ee = (e, t) => {
|
|
|
262
262
|
a,
|
|
263
263
|
o
|
|
264
264
|
]);
|
|
265
|
-
},
|
|
266
|
-
let [t, n] =
|
|
267
|
-
return
|
|
265
|
+
}, Me = ({ messageProp: e }) => {
|
|
266
|
+
let [t, n] = R(e), r = L(null), i = L(0), [a, o] = R(!1);
|
|
267
|
+
return F(() => {
|
|
268
268
|
e && n(e);
|
|
269
|
-
}, [e]),
|
|
269
|
+
}, [e]), F(() => {
|
|
270
270
|
r.current && (i.current = r.current.offsetHeight);
|
|
271
|
-
}, []),
|
|
271
|
+
}, []), he(() => {
|
|
272
272
|
if (!r.current || i.current === 0) return;
|
|
273
273
|
let e = r.current.offsetHeight > i.current;
|
|
274
274
|
o((n) => e ? !0 : t === "" ? !1 : n);
|
|
@@ -278,18 +278,18 @@ var Ee = (e, t) => {
|
|
|
278
278
|
textareaRef: r,
|
|
279
279
|
isMultiLine: a
|
|
280
280
|
};
|
|
281
|
-
},
|
|
281
|
+
}, Ne = /* @__PURE__ */ function(e) {
|
|
282
282
|
return e.Idle = "idle", e.Recording = "recording", e.Stopped = "stopped", e.Uploading = "uploading", e.Error = "error", e;
|
|
283
|
-
}({}),
|
|
283
|
+
}({}), Pe = [
|
|
284
284
|
"audio/webm;codecs=opus",
|
|
285
285
|
"audio/ogg;codecs=opus",
|
|
286
286
|
"audio/webm"
|
|
287
|
-
],
|
|
288
|
-
let [r, i] =
|
|
287
|
+
], Fe = () => Pe.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Ie = ({ onUploadAudio: e, onTranscribeAudio: t, onTranscript: n }) => {
|
|
288
|
+
let [r, i] = R("idle"), [a, o] = R(null), [s, c] = R(null), l = L(null), u = L(null), d = L(null), f = L(null), p = L([]), m = L(""), h = L(null), g = L(null), _ = L([]), v = L(!1), y = P(() => {
|
|
289
289
|
h.current != null && (cancelAnimationFrame(h.current), h.current = null);
|
|
290
|
-
}, []), b =
|
|
290
|
+
}, []), b = P(() => {
|
|
291
291
|
y(), l.current &&= (l.current.getTracks().forEach((e) => e.stop()), null), u.current &&= (u.current.close(), null), d.current = null, f.current = null;
|
|
292
|
-
}, [y]), x =
|
|
292
|
+
}, [y]), x = P(() => {
|
|
293
293
|
(async () => {
|
|
294
294
|
try {
|
|
295
295
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -298,7 +298,7 @@ var Ee = (e, t) => {
|
|
|
298
298
|
u.current = t;
|
|
299
299
|
let n = t.createAnalyser();
|
|
300
300
|
n.fftSize = 256, d.current = n, t.createMediaStreamSource(e).connect(n);
|
|
301
|
-
let r =
|
|
301
|
+
let r = Fe();
|
|
302
302
|
m.current = r, p.current = [], _.current = [];
|
|
303
303
|
let a = new MediaRecorder(e, r ? { mimeType: r } : void 0);
|
|
304
304
|
f.current = a, a.ondataavailable = (e) => {
|
|
@@ -321,13 +321,13 @@ var Ee = (e, t) => {
|
|
|
321
321
|
c(e instanceof Error ? e.message : "Microphone access denied"), i("error");
|
|
322
322
|
}
|
|
323
323
|
})();
|
|
324
|
-
}, []), S =
|
|
324
|
+
}, []), S = P(() => {
|
|
325
325
|
let e = f.current;
|
|
326
326
|
!e || e.state !== "recording" || (y(), e.onstop = () => {
|
|
327
327
|
let e = m.current || "audio/webm", t = new Blob(p.current, { type: e }), n = e.split(";")[0].split("/")[1] ?? "webm";
|
|
328
328
|
g.current = new File([t], `recording.${n}`, { type: e }), i("stopped");
|
|
329
329
|
}, e.stop());
|
|
330
|
-
}, [y]), C =
|
|
330
|
+
}, [y]), C = P(() => {
|
|
331
331
|
let r = g.current;
|
|
332
332
|
!r || !e || !t || (v.current = !1, i("uploading"), (async () => {
|
|
333
333
|
try {
|
|
@@ -346,10 +346,10 @@ var Ee = (e, t) => {
|
|
|
346
346
|
t,
|
|
347
347
|
n,
|
|
348
348
|
b
|
|
349
|
-
]), w =
|
|
349
|
+
]), w = P(() => {
|
|
350
350
|
v.current = !0, b(), g.current = null, o(null), c(null), i("idle");
|
|
351
351
|
}, [b]);
|
|
352
|
-
return
|
|
352
|
+
return F(() => () => {
|
|
353
353
|
v.current = !0, b();
|
|
354
354
|
}, [b]), {
|
|
355
355
|
state: r,
|
|
@@ -360,16 +360,16 @@ var Ee = (e, t) => {
|
|
|
360
360
|
confirmRecording: C,
|
|
361
361
|
discardRecording: w
|
|
362
362
|
};
|
|
363
|
-
},
|
|
363
|
+
}, Le = /* @__PURE__ */ function(e) {
|
|
364
364
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
365
|
-
}({}),
|
|
365
|
+
}({}), W = {
|
|
366
366
|
item: "_item_vou13_1",
|
|
367
367
|
itemIcon: "_itemIcon_vou13_11"
|
|
368
|
-
},
|
|
368
|
+
}, Re = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: o, titleClassName: c = "dial-body-semi-text", itemLabelClassName: l = "dial-small-text", btnTextClassName: u = "" }) => {
|
|
369
369
|
let d = (e) => {
|
|
370
370
|
e(), r();
|
|
371
371
|
};
|
|
372
|
-
return /* @__PURE__ */
|
|
372
|
+
return /* @__PURE__ */ B(U, {
|
|
373
373
|
isOpen: e,
|
|
374
374
|
title: t,
|
|
375
375
|
closeLabel: n,
|
|
@@ -377,22 +377,22 @@ var Ee = (e, t) => {
|
|
|
377
377
|
style: i,
|
|
378
378
|
className: o,
|
|
379
379
|
titleClassName: c,
|
|
380
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ B("ul", {
|
|
381
381
|
role: "list",
|
|
382
382
|
className: "flex flex-col",
|
|
383
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
383
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ B("li", { children: /* @__PURE__ */ B(p, {
|
|
384
384
|
type: "button",
|
|
385
|
-
className: s(
|
|
386
|
-
iconBefore: /* @__PURE__ */
|
|
387
|
-
className:
|
|
385
|
+
className: s(W.item, "flex w-full items-center gap-3 px-4 py-[10px] text-start"),
|
|
386
|
+
iconBefore: /* @__PURE__ */ B("span", {
|
|
387
|
+
className: W.itemIcon,
|
|
388
388
|
children: n
|
|
389
389
|
}),
|
|
390
|
-
iconAfter: r ? /* @__PURE__ */
|
|
390
|
+
iconAfter: r ? /* @__PURE__ */ B("span", {
|
|
391
391
|
className: "ms-auto",
|
|
392
392
|
children: r
|
|
393
393
|
}) : null,
|
|
394
394
|
textClassName: u,
|
|
395
|
-
label: /* @__PURE__ */
|
|
395
|
+
label: /* @__PURE__ */ B("span", {
|
|
396
396
|
className: l,
|
|
397
397
|
children: t
|
|
398
398
|
}),
|
|
@@ -400,62 +400,62 @@ var Ee = (e, t) => {
|
|
|
400
400
|
}) }, e))
|
|
401
401
|
})
|
|
402
402
|
});
|
|
403
|
-
},
|
|
403
|
+
}, G = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ V("svg", {
|
|
404
404
|
width: f.SM,
|
|
405
405
|
height: f.SM,
|
|
406
406
|
viewBox: "0 0 24 24",
|
|
407
407
|
fill: "none",
|
|
408
408
|
"aria-hidden": !0,
|
|
409
|
-
children: [/* @__PURE__ */
|
|
409
|
+
children: [/* @__PURE__ */ B("defs", { children: /* @__PURE__ */ V("linearGradient", {
|
|
410
410
|
id: e,
|
|
411
411
|
x1: "0",
|
|
412
412
|
y1: "0",
|
|
413
413
|
x2: "24",
|
|
414
414
|
y2: "24",
|
|
415
415
|
gradientUnits: "userSpaceOnUse",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
416
|
+
children: [/* @__PURE__ */ B("stop", {
|
|
417
417
|
offset: "0%",
|
|
418
418
|
stopColor: "#4b7be6"
|
|
419
|
-
}), /* @__PURE__ */
|
|
419
|
+
}), /* @__PURE__ */ B("stop", {
|
|
420
420
|
offset: "100%",
|
|
421
421
|
stopColor: "#9355f4"
|
|
422
422
|
})]
|
|
423
|
-
}) }), /* @__PURE__ */
|
|
423
|
+
}) }), /* @__PURE__ */ B("path", {
|
|
424
424
|
d: "M5 12l5 5L20 7",
|
|
425
425
|
stroke: `url(#${e})`,
|
|
426
426
|
strokeWidth: "2",
|
|
427
427
|
strokeLinecap: "round",
|
|
428
428
|
strokeLinejoin: "round"
|
|
429
429
|
})]
|
|
430
|
-
}),
|
|
430
|
+
}), K = {
|
|
431
431
|
tabContainer: "_tabContainer_rzv03_1",
|
|
432
432
|
tabActive: "_tabActive_rzv03_13"
|
|
433
433
|
};
|
|
434
|
-
|
|
434
|
+
pe(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
435
435
|
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
436
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ B("div", {
|
|
437
437
|
className: "flex flex-nowrap gap-1",
|
|
438
438
|
children: e.map((e) => {
|
|
439
439
|
let r = t === e.id;
|
|
440
|
-
return /* @__PURE__ */
|
|
440
|
+
return /* @__PURE__ */ B(ee, {
|
|
441
441
|
label: e.label,
|
|
442
442
|
selected: r,
|
|
443
443
|
onClick: () => n(e.id),
|
|
444
444
|
"aria-selected": r,
|
|
445
|
-
className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i,
|
|
445
|
+
className: s("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, K.tabContainer, r && K.tabActive)
|
|
446
446
|
}, e.id);
|
|
447
447
|
})
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
450
|
//#endregion
|
|
451
451
|
//#region ../ai-dial-kit/src/components/Button/Buttons.tsx
|
|
452
|
-
var
|
|
452
|
+
var ze = (e) => /* @__PURE__ */ B(x, { ...e }), Be = (e) => /* @__PURE__ */ B(p, {
|
|
453
453
|
...e,
|
|
454
454
|
variant: d.Neutral,
|
|
455
455
|
appearance: u.Outlined
|
|
456
|
-
}),
|
|
457
|
-
let [s, c] =
|
|
458
|
-
|
|
456
|
+
}), q = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
457
|
+
let [s, c] = R(t), [l, u] = R(n), [d, f] = R(r), p = L(o);
|
|
458
|
+
F(() => {
|
|
459
459
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
460
460
|
}, [
|
|
461
461
|
o,
|
|
@@ -472,7 +472,7 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
472
472
|
setResponseFormat: c,
|
|
473
473
|
setSystemPrompt: u,
|
|
474
474
|
setTemperature: f,
|
|
475
|
-
handleSubmit:
|
|
475
|
+
handleSubmit: P(() => {
|
|
476
476
|
if (!m) return;
|
|
477
477
|
let t = {};
|
|
478
478
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -486,16 +486,16 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
486
486
|
a
|
|
487
487
|
])
|
|
488
488
|
};
|
|
489
|
-
},
|
|
489
|
+
}, Ve = "!dial-small-semi-text !text-primary gap-1", He = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: i, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
|
|
490
490
|
"Precise",
|
|
491
491
|
"Neutral",
|
|
492
492
|
"Creative"
|
|
493
|
-
], temperatureHint: g }) => /* @__PURE__ */
|
|
493
|
+
], temperatureHint: g }) => /* @__PURE__ */ V("div", {
|
|
494
494
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
495
495
|
children: [
|
|
496
|
-
e.responseFormat && /* @__PURE__ */
|
|
496
|
+
e.responseFormat && /* @__PURE__ */ B(S, {
|
|
497
497
|
fieldTitle: c,
|
|
498
|
-
labelClassName:
|
|
498
|
+
labelClassName: Ve,
|
|
499
499
|
elementId: "response-format",
|
|
500
500
|
orientation: te.Column,
|
|
501
501
|
activeRadioButton: t ?? a.Markdown,
|
|
@@ -509,19 +509,19 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
509
509
|
}],
|
|
510
510
|
onChange: (e) => i(e)
|
|
511
511
|
}),
|
|
512
|
-
e.systemPrompt && /* @__PURE__ */
|
|
512
|
+
e.systemPrompt && /* @__PURE__ */ B(y, {
|
|
513
513
|
value: n,
|
|
514
514
|
placeholder: p,
|
|
515
515
|
labelProps: {
|
|
516
|
-
className:
|
|
516
|
+
className: Ve,
|
|
517
517
|
label: f
|
|
518
518
|
},
|
|
519
519
|
onChange: (e) => o(e ?? "")
|
|
520
520
|
}),
|
|
521
|
-
e.temperature && /* @__PURE__ */
|
|
521
|
+
e.temperature && /* @__PURE__ */ B(E, {
|
|
522
522
|
labelProps: {
|
|
523
523
|
label: m,
|
|
524
|
-
className:
|
|
524
|
+
className: Ve,
|
|
525
525
|
caption: g
|
|
526
526
|
},
|
|
527
527
|
value: r,
|
|
@@ -532,8 +532,8 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
532
532
|
onChange: s
|
|
533
533
|
})
|
|
534
534
|
]
|
|
535
|
-
}),
|
|
536
|
-
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: k, setTemperature: A, handleSubmit: te } =
|
|
535
|
+
}), Ue = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: o, initialResponseFormat: c, 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 }) => {
|
|
536
|
+
let { responseFormat: w, systemPrompt: T, temperature: E, canSubmit: D, setResponseFormat: ee, setSystemPrompt: k, setTemperature: A, handleSubmit: te } = q({
|
|
537
537
|
isOpen: e,
|
|
538
538
|
features: o,
|
|
539
539
|
initialResponseFormat: c,
|
|
@@ -542,7 +542,7 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
542
542
|
onSave: d,
|
|
543
543
|
onClose: r
|
|
544
544
|
});
|
|
545
|
-
return /* @__PURE__ */
|
|
545
|
+
return /* @__PURE__ */ V(U, {
|
|
546
546
|
isOpen: e,
|
|
547
547
|
title: f,
|
|
548
548
|
closeLabel: i,
|
|
@@ -550,7 +550,7 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
550
550
|
onBack: t,
|
|
551
551
|
backLabel: n,
|
|
552
552
|
style: a,
|
|
553
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ B(He, {
|
|
554
554
|
features: o,
|
|
555
555
|
responseFormat: w,
|
|
556
556
|
systemPrompt: T,
|
|
@@ -567,13 +567,13 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
567
567
|
temperatureLabel: y,
|
|
568
568
|
temperatureLabels: b,
|
|
569
569
|
temperatureHint: x
|
|
570
|
-
}), /* @__PURE__ */
|
|
570
|
+
}), /* @__PURE__ */ B("div", {
|
|
571
571
|
className: s("px-6 py-4 mobile:pb-8"),
|
|
572
|
-
children: /* @__PURE__ */
|
|
572
|
+
children: /* @__PURE__ */ B(O, {
|
|
573
573
|
tooltip: C,
|
|
574
574
|
hideTooltip: D || !C,
|
|
575
575
|
triggerClassName: "w-full",
|
|
576
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: /* @__PURE__ */ B(ze, {
|
|
577
577
|
label: S,
|
|
578
578
|
onClick: te,
|
|
579
579
|
disabled: !D,
|
|
@@ -582,8 +582,8 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
582
582
|
})
|
|
583
583
|
})]
|
|
584
584
|
});
|
|
585
|
-
},
|
|
586
|
-
let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } =
|
|
585
|
+
}, We = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: g = "Apply changes", saveDisabledTooltip: _ }) => {
|
|
586
|
+
let { responseFormat: v, systemPrompt: y, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: w, setTemperature: T, handleSubmit: E } = q({
|
|
587
587
|
features: e,
|
|
588
588
|
initialResponseFormat: t,
|
|
589
589
|
initialSystemPrompt: n,
|
|
@@ -591,25 +591,25 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
591
591
|
onSave: i,
|
|
592
592
|
onClose: a
|
|
593
593
|
});
|
|
594
|
-
return /* @__PURE__ */
|
|
594
|
+
return /* @__PURE__ */ B(b, {
|
|
595
595
|
open: !0,
|
|
596
596
|
header: o,
|
|
597
597
|
size: A.Sm,
|
|
598
598
|
onClose: a,
|
|
599
599
|
className: "!bg-layer-2",
|
|
600
|
-
footer: /* @__PURE__ */
|
|
600
|
+
footer: /* @__PURE__ */ B("div", {
|
|
601
601
|
className: "flex justify-end px-6 py-4",
|
|
602
|
-
children: /* @__PURE__ */
|
|
602
|
+
children: /* @__PURE__ */ B(O, {
|
|
603
603
|
tooltip: _,
|
|
604
604
|
hideTooltip: S || !_,
|
|
605
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ B(ze, {
|
|
606
606
|
label: g,
|
|
607
607
|
onClick: E,
|
|
608
608
|
disabled: !S
|
|
609
609
|
})
|
|
610
610
|
})
|
|
611
611
|
}),
|
|
612
|
-
children: /* @__PURE__ */
|
|
612
|
+
children: /* @__PURE__ */ B(He, {
|
|
613
613
|
features: e,
|
|
614
614
|
responseFormat: v,
|
|
615
615
|
systemPrompt: y,
|
|
@@ -629,15 +629,15 @@ var Be = (e) => /* @__PURE__ */ R(x, { ...e }), Ve = (e) => /* @__PURE__ */ R(p,
|
|
|
629
629
|
})
|
|
630
630
|
});
|
|
631
631
|
};
|
|
632
|
-
|
|
632
|
+
pe(We);
|
|
633
633
|
//#endregion
|
|
634
634
|
//#region src/components/AddAttachmentButton/AddAttachmentButton.tsx
|
|
635
|
-
var
|
|
636
|
-
let g = c(), [_, y] =
|
|
635
|
+
var Ge = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: i, style: o, listClassName: u = "cp-dropdown-overlay !w-[240px]", isDisabled: d = !1, chatSettings: p, extraMenuItems: m }) => {
|
|
636
|
+
let g = c(), [_, y] = R(!1), [b, x] = R(!1), S = I(() => [
|
|
637
637
|
...e == null ? [] : [{
|
|
638
638
|
key: "attach",
|
|
639
639
|
label: t,
|
|
640
|
-
icon: /* @__PURE__ */
|
|
640
|
+
icon: /* @__PURE__ */ B(se, {
|
|
641
641
|
size: l,
|
|
642
642
|
"aria-hidden": !0
|
|
643
643
|
}),
|
|
@@ -647,11 +647,11 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
647
647
|
...p == null ? [] : [{
|
|
648
648
|
key: "chat-settings",
|
|
649
649
|
label: p.menuItemLabel ?? "Chat settings",
|
|
650
|
-
icon: /* @__PURE__ */
|
|
650
|
+
icon: /* @__PURE__ */ B(ue, {
|
|
651
651
|
size: l,
|
|
652
652
|
"aria-hidden": !0
|
|
653
653
|
}),
|
|
654
|
-
iconAfter: g ? /* @__PURE__ */
|
|
654
|
+
iconAfter: g ? /* @__PURE__ */ B(ie, {
|
|
655
655
|
size: l,
|
|
656
656
|
stroke: 1.5,
|
|
657
657
|
className: "text-secondary rtl:scale-x-[-1]",
|
|
@@ -666,9 +666,9 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
666
666
|
m,
|
|
667
667
|
g
|
|
668
668
|
]);
|
|
669
|
-
return S.length === 0 ? null : /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
icon: /* @__PURE__ */
|
|
669
|
+
return S.length === 0 ? null : /* @__PURE__ */ B(z, { children: g ? /* @__PURE__ */ V(z, { children: [
|
|
670
|
+
/* @__PURE__ */ B(v, {
|
|
671
|
+
icon: /* @__PURE__ */ B(le, {
|
|
672
672
|
size: f.LG,
|
|
673
673
|
"aria-hidden": !0
|
|
674
674
|
}),
|
|
@@ -677,7 +677,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
677
677
|
className: s("size-10 flex-shrink-0", d && "pointer-events-none opacity-50"),
|
|
678
678
|
onClick: () => y(!0)
|
|
679
679
|
}),
|
|
680
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ B(Re, {
|
|
681
681
|
isOpen: _,
|
|
682
682
|
title: r,
|
|
683
683
|
closeLabel: i,
|
|
@@ -687,7 +687,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
687
687
|
className: "pb-4",
|
|
688
688
|
btnTextClassName: "flex-1"
|
|
689
689
|
}),
|
|
690
|
-
p != null && /* @__PURE__ */
|
|
690
|
+
p != null && /* @__PURE__ */ B(Ue, {
|
|
691
691
|
isOpen: b,
|
|
692
692
|
onBack: () => {
|
|
693
693
|
x(!1), y(!0);
|
|
@@ -714,13 +714,13 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
714
714
|
saveLabel: p.saveLabel,
|
|
715
715
|
saveDisabledTooltip: p.saveDisabledTooltip
|
|
716
716
|
})
|
|
717
|
-
] }) : /* @__PURE__ */ z
|
|
717
|
+
] }) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(h, {
|
|
718
718
|
matchReferenceWidth: !1,
|
|
719
719
|
placement: "bottom-start",
|
|
720
720
|
listClassName: u,
|
|
721
721
|
items: S,
|
|
722
|
-
children: /* @__PURE__ */
|
|
723
|
-
icon: /* @__PURE__ */
|
|
722
|
+
children: /* @__PURE__ */ B(v, {
|
|
723
|
+
icon: /* @__PURE__ */ B(le, {
|
|
724
724
|
size: f.LG,
|
|
725
725
|
"aria-hidden": !0
|
|
726
726
|
}),
|
|
@@ -729,7 +729,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
729
729
|
className: "size-10 flex-shrink-0",
|
|
730
730
|
disabled: d
|
|
731
731
|
})
|
|
732
|
-
}), p != null && b && /* @__PURE__ */
|
|
732
|
+
}), p != null && b && /* @__PURE__ */ B(We, {
|
|
733
733
|
features: p.features,
|
|
734
734
|
initialResponseFormat: p.responseFormat ?? a.Markdown,
|
|
735
735
|
initialSystemPrompt: p.systemPrompt,
|
|
@@ -749,16 +749,16 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
749
749
|
saveLabel: p.saveLabel,
|
|
750
750
|
saveDisabledTooltip: p.saveDisabledTooltip
|
|
751
751
|
})] }) });
|
|
752
|
-
},
|
|
753
|
-
container: "
|
|
754
|
-
containerError: "
|
|
755
|
-
waveformCanvas: "
|
|
756
|
-
recordingDot: "
|
|
757
|
-
micRecordingIcon: "
|
|
758
|
-
},
|
|
759
|
-
let m =
|
|
752
|
+
}, J = {
|
|
753
|
+
container: "_container_9pzud_1",
|
|
754
|
+
containerError: "_containerError_9pzud_14",
|
|
755
|
+
waveformCanvas: "_waveformCanvas_9pzud_18",
|
|
756
|
+
recordingDot: "_recordingDot_9pzud_22",
|
|
757
|
+
micRecordingIcon: "_micRecordingIcon_9pzud_26"
|
|
758
|
+
}, Ke = 3, qe = 6, Je = .12, Ye = ({ state: e, waveformData: t, errorMessage: n, onStop: r, onConfirm: i, onDiscard: a, stopLabel: o = "Stop recording", confirmLabel: c = "Send voice message", discardLabel: l = "Discard recording", uploadingLabel: u = "Uploading…", style: d, className: p }) => {
|
|
759
|
+
let m = L(null), h = L(null), g = L(!1), y = e === Ne.Recording, b = e === Ne.Uploading, x = e === Ne.Error;
|
|
760
760
|
g.current = y;
|
|
761
|
-
let S =
|
|
761
|
+
let S = P((e, t) => {
|
|
762
762
|
let n = e.getContext("2d");
|
|
763
763
|
if (!n) return;
|
|
764
764
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
@@ -766,10 +766,10 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
766
766
|
n.clearRect(0, 0, r, i), n.fillStyle = getComputedStyle(e).color;
|
|
767
767
|
let a = Math.min(1, t * 6), o = Math.max(1, Math.floor(r / 4));
|
|
768
768
|
for (let e = 0; e < o; e++) {
|
|
769
|
-
let t = e / o *
|
|
770
|
-
n.fillRect(e * 4, (i - s) / 2,
|
|
769
|
+
let t = e / o * qe * Math.PI, r = Math.max(Je, Math.abs(Math.sin(t)) * a), s = Math.max(3, r * i);
|
|
770
|
+
n.fillRect(e * 4, (i - s) / 2, Ke, s);
|
|
771
771
|
}
|
|
772
|
-
}, []), C =
|
|
772
|
+
}, []), C = P((e, t) => {
|
|
773
773
|
let n = e.getContext("2d");
|
|
774
774
|
if (!n) return;
|
|
775
775
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
@@ -779,10 +779,10 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
779
779
|
let a = Math.max(1, Math.floor(r / 4));
|
|
780
780
|
for (let e = 0; e < a; e++) {
|
|
781
781
|
let r = t[Math.floor(e / a * t.length)] ?? 0, o = Math.min(1, r * 6), s = Math.max(3, o * i);
|
|
782
|
-
n.fillRect(e * 4, (i - s) / 2,
|
|
782
|
+
n.fillRect(e * 4, (i - s) / 2, Ke, s);
|
|
783
783
|
}
|
|
784
784
|
}, []);
|
|
785
|
-
|
|
785
|
+
F(() => {
|
|
786
786
|
h.current = t;
|
|
787
787
|
let e = m.current;
|
|
788
788
|
e && (g.current ? S(e, t?.[t.length - 1] ?? 0) : C(e, t));
|
|
@@ -790,7 +790,7 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
790
790
|
t,
|
|
791
791
|
S,
|
|
792
792
|
C
|
|
793
|
-
]),
|
|
793
|
+
]), F(() => {
|
|
794
794
|
let e = m.current;
|
|
795
795
|
if (!e) return;
|
|
796
796
|
let t = new ResizeObserver(() => {
|
|
@@ -801,37 +801,37 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
801
801
|
});
|
|
802
802
|
return t.observe(e), () => t.disconnect();
|
|
803
803
|
}, [S, C]);
|
|
804
|
-
let w = /* @__PURE__ */
|
|
804
|
+
let w = /* @__PURE__ */ B("div", {
|
|
805
805
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
806
|
-
children: y ? /* @__PURE__ */
|
|
807
|
-
icon: /* @__PURE__ */
|
|
806
|
+
children: y ? /* @__PURE__ */ B(v, {
|
|
807
|
+
icon: /* @__PURE__ */ B(ce, {
|
|
808
808
|
size: f.LG,
|
|
809
|
-
className:
|
|
809
|
+
className: J.micRecordingIcon,
|
|
810
810
|
"aria-hidden": !0
|
|
811
811
|
}),
|
|
812
812
|
"aria-label": o,
|
|
813
813
|
className: "size-10 flex-shrink-0",
|
|
814
814
|
onClick: r
|
|
815
|
-
}) : /* @__PURE__ */ z
|
|
816
|
-
icon: /* @__PURE__ */
|
|
815
|
+
}) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(v, {
|
|
816
|
+
icon: /* @__PURE__ */ B(de, {
|
|
817
817
|
size: f.LG,
|
|
818
818
|
"aria-hidden": !0
|
|
819
819
|
}),
|
|
820
820
|
"aria-label": l,
|
|
821
821
|
className: "size-10 flex-shrink-0",
|
|
822
822
|
onClick: a
|
|
823
|
-
}), b ? /* @__PURE__ */
|
|
823
|
+
}), b ? /* @__PURE__ */ B(D, {
|
|
824
824
|
fullWidth: !1,
|
|
825
825
|
size: f.LG,
|
|
826
826
|
ariaLabel: u,
|
|
827
827
|
className: "flex size-10 flex-shrink-0 items-center justify-center"
|
|
828
|
-
}) : /* @__PURE__ */
|
|
829
|
-
icon: /* @__PURE__ */
|
|
828
|
+
}) : /* @__PURE__ */ B(v, {
|
|
829
|
+
icon: /* @__PURE__ */ B("div", {
|
|
830
830
|
className: "flex size-8 items-center justify-center rounded-full bg-controls-accent-primary",
|
|
831
|
-
children: /* @__PURE__ */
|
|
831
|
+
children: /* @__PURE__ */ B(re, {
|
|
832
832
|
size: 24,
|
|
833
833
|
"aria-hidden": !0,
|
|
834
|
-
className: "rounded-full bg-controls-accent-primary
|
|
834
|
+
className: "text-control-permanent rounded-full bg-controls-accent-primary"
|
|
835
835
|
})
|
|
836
836
|
}),
|
|
837
837
|
"aria-label": c,
|
|
@@ -839,28 +839,28 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
839
839
|
onClick: i
|
|
840
840
|
})] })
|
|
841
841
|
});
|
|
842
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ V("div", {
|
|
843
843
|
className: p,
|
|
844
|
-
children: [/* @__PURE__ */
|
|
844
|
+
children: [/* @__PURE__ */ V("div", {
|
|
845
845
|
style: d,
|
|
846
|
-
className: s(
|
|
847
|
-
children: [/* @__PURE__ */
|
|
846
|
+
className: s(J.container, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", x && J.containerError),
|
|
847
|
+
children: [/* @__PURE__ */ V("div", {
|
|
848
848
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
849
|
-
children: [y && /* @__PURE__ */
|
|
850
|
-
className: s(
|
|
849
|
+
children: [y && /* @__PURE__ */ B("span", {
|
|
850
|
+
className: s(J.recordingDot, "size-2 flex-shrink-0 rounded-full"),
|
|
851
851
|
"aria-hidden": !0
|
|
852
|
-
}), /* @__PURE__ */
|
|
852
|
+
}), /* @__PURE__ */ B("canvas", {
|
|
853
853
|
ref: m,
|
|
854
854
|
height: 32,
|
|
855
|
-
className: s(
|
|
855
|
+
className: s(J.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
856
856
|
})]
|
|
857
857
|
}), w]
|
|
858
|
-
}), x && n && /* @__PURE__ */
|
|
858
|
+
}), x && n && /* @__PURE__ */ B(_, {
|
|
859
859
|
text: n,
|
|
860
860
|
className: "mt-1 px-1"
|
|
861
861
|
})]
|
|
862
862
|
});
|
|
863
|
-
},
|
|
863
|
+
}, Y = {
|
|
864
864
|
wrapper: "_wrapper_1q2nu_2",
|
|
865
865
|
wrapperDisabled: "_wrapperDisabled_1q2nu_15",
|
|
866
866
|
textarea: "_textarea_1q2nu_20",
|
|
@@ -872,73 +872,73 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
872
872
|
sendButtonEnter: "_sendButtonEnter_1q2nu_1",
|
|
873
873
|
sendButtonExiting: "_sendButtonExiting_1q2nu_55",
|
|
874
874
|
sendButtonExit: "_sendButtonExit_1q2nu_55"
|
|
875
|
-
},
|
|
875
|
+
}, Xe = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ B(O, {
|
|
876
876
|
tooltip: r,
|
|
877
877
|
hideTooltip: !r,
|
|
878
|
-
children: /* @__PURE__ */
|
|
879
|
-
className: s("flex size-[32px] cursor-pointer items-center justify-center rounded-full disabled:cursor-not-allowed",
|
|
878
|
+
children: /* @__PURE__ */ B("button", {
|
|
879
|
+
className: s("flex size-[32px] cursor-pointer items-center justify-center rounded-full disabled:cursor-not-allowed", Y.sendButton, i && Y.sendButtonExiting),
|
|
880
880
|
"aria-label": n,
|
|
881
881
|
onClick: () => e?.(),
|
|
882
882
|
type: "button",
|
|
883
883
|
disabled: t,
|
|
884
884
|
"aria-hidden": i,
|
|
885
|
-
children: /* @__PURE__ */
|
|
885
|
+
children: /* @__PURE__ */ B(j, {
|
|
886
886
|
size: f.LG,
|
|
887
887
|
className: "rtl:scale-x-[-1]"
|
|
888
888
|
})
|
|
889
889
|
})
|
|
890
|
-
}),
|
|
890
|
+
}), Ze = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ B("button", {
|
|
891
891
|
className: s("flex cursor-pointer items-center justify-center disabled:cursor-not-allowed"),
|
|
892
892
|
"aria-label": t,
|
|
893
893
|
onClick: () => e?.(),
|
|
894
894
|
type: "button",
|
|
895
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ B(ce, {
|
|
896
896
|
size: f.LG,
|
|
897
|
-
className:
|
|
897
|
+
className: Y.stopIcon
|
|
898
898
|
})
|
|
899
|
-
}),
|
|
899
|
+
}), Qe = ({ size: e = 20 }) => /* @__PURE__ */ B(w, {
|
|
900
900
|
variant: T.Circular,
|
|
901
901
|
width: e,
|
|
902
902
|
height: e,
|
|
903
903
|
active: !0
|
|
904
|
-
}),
|
|
904
|
+
}), $e = ({ loadingLabel: e }) => /* @__PURE__ */ V("span", {
|
|
905
905
|
className: "flex min-w-0 flex-1 items-center",
|
|
906
|
-
children: [/* @__PURE__ */
|
|
906
|
+
children: [/* @__PURE__ */ B(w, {
|
|
907
907
|
variant: T.Text,
|
|
908
908
|
width: "100%",
|
|
909
909
|
height: 16,
|
|
910
910
|
active: !0
|
|
911
|
-
}), e && /* @__PURE__ */
|
|
911
|
+
}), e && /* @__PURE__ */ B("span", {
|
|
912
912
|
className: "sr-only",
|
|
913
913
|
children: e
|
|
914
914
|
})]
|
|
915
|
-
}),
|
|
915
|
+
}), et = ({ loadingLabel: e }) => /* @__PURE__ */ B("div", {
|
|
916
916
|
role: "status",
|
|
917
917
|
"aria-label": e,
|
|
918
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
918
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ V("div", {
|
|
919
919
|
className: "flex h-11 items-center gap-3 px-4",
|
|
920
920
|
"aria-hidden": "true",
|
|
921
|
-
children: [/* @__PURE__ */
|
|
921
|
+
children: [/* @__PURE__ */ B(Qe, {}), /* @__PURE__ */ B($e, {})]
|
|
922
922
|
}, t))
|
|
923
|
-
}),
|
|
923
|
+
}), tt = (e) => e.displayName ?? e.id, nt = (e, t) => {
|
|
924
924
|
let n = t.trim().toLowerCase();
|
|
925
|
-
return n ? e.filter((e) =>
|
|
926
|
-
},
|
|
925
|
+
return n ? e.filter((e) => tt(e).toLowerCase().includes(n)) : e;
|
|
926
|
+
}, rt = (e, t, r, i = 18, a) => /* @__PURE__ */ B(n, {
|
|
927
927
|
src: e,
|
|
928
928
|
size: i,
|
|
929
929
|
labels: { tooltip: a },
|
|
930
930
|
initialsName: r
|
|
931
|
-
}),
|
|
932
|
-
let [o, c] =
|
|
931
|
+
}), it = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: i, searchHeaderClassName: a = "bg-layer-0" }) => {
|
|
932
|
+
let [o, c] = R(""), l = I(() => e?.find((e) => e.id === t), [e, t]), u = i?.loading !== void 0, d = I(() => u ? /* @__PURE__ */ B(Qe, { size: f.LG }) : rt(l?.iconUrl, l?.type, l?.displayName ?? l?.id ?? "", f.LG), [u, l]), p = l?.displayName ?? l?.id;
|
|
933
933
|
return {
|
|
934
934
|
selectorIcon: d,
|
|
935
935
|
selectorAriaLabel: p ? `${i?.ariaLabel ?? "Select model"}: ${p}` : i?.ariaLabel ?? "Select model",
|
|
936
936
|
selectedLabel: p,
|
|
937
|
-
menuItems:
|
|
937
|
+
menuItems: I(() => {
|
|
938
938
|
if (u) return Array.from({ length: 7 }, (e, t) => ({
|
|
939
939
|
key: `__loading-${t}`,
|
|
940
|
-
icon: /* @__PURE__ */
|
|
941
|
-
label: /* @__PURE__ */
|
|
940
|
+
icon: /* @__PURE__ */ B(Qe, {}),
|
|
941
|
+
label: /* @__PURE__ */ B($e, { loadingLabel: t === 0 ? i?.loading : void 0 }),
|
|
942
942
|
disabled: !0
|
|
943
943
|
}));
|
|
944
944
|
if (!e || e.length === 0) {
|
|
@@ -949,19 +949,19 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
949
949
|
disabled: !0
|
|
950
950
|
}] : [];
|
|
951
951
|
}
|
|
952
|
-
return
|
|
952
|
+
return nt(e, o).map((e) => {
|
|
953
953
|
let i = e.id === t;
|
|
954
954
|
return {
|
|
955
955
|
key: e.id,
|
|
956
|
-
label: /* @__PURE__ */
|
|
956
|
+
label: /* @__PURE__ */ V("span", {
|
|
957
957
|
className: "flex w-full items-center justify-between gap-2",
|
|
958
|
-
children: [/* @__PURE__ */
|
|
959
|
-
text:
|
|
958
|
+
children: [/* @__PURE__ */ B(r, {
|
|
959
|
+
text: tt(e),
|
|
960
960
|
query: o,
|
|
961
961
|
maxLines: 1
|
|
962
|
-
}), i && /* @__PURE__ */
|
|
962
|
+
}), i && /* @__PURE__ */ B(G, { gradientId: "ms-check-grad" })]
|
|
963
963
|
}),
|
|
964
|
-
icon:
|
|
964
|
+
icon: rt(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
965
965
|
onClick: () => n?.(e.id),
|
|
966
966
|
className: i ? "bg-accent-primary-alpha" : void 0
|
|
967
967
|
};
|
|
@@ -974,9 +974,9 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
974
974
|
i,
|
|
975
975
|
n
|
|
976
976
|
]),
|
|
977
|
-
menuHeader:
|
|
977
|
+
menuHeader: I(() => !u && e && e.length > 0 ? /* @__PURE__ */ B("div", {
|
|
978
978
|
className: s("sticky top-0 z-10 pb-1 pe-2 pt-2", a),
|
|
979
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ B(C, {
|
|
980
980
|
value: o,
|
|
981
981
|
placeholder: i?.searchPlaceholder ?? "Search",
|
|
982
982
|
size: k.Small,
|
|
@@ -994,8 +994,8 @@ var Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, men
|
|
|
994
994
|
e || c("");
|
|
995
995
|
}
|
|
996
996
|
};
|
|
997
|
-
},
|
|
998
|
-
function
|
|
997
|
+
}, X = typeof window < "u" ? he : F;
|
|
998
|
+
function at(e) {
|
|
999
999
|
if (e !== void 0) switch (typeof e) {
|
|
1000
1000
|
case "number": return e;
|
|
1001
1001
|
case "string":
|
|
@@ -1003,15 +1003,15 @@ function ot(e) {
|
|
|
1003
1003
|
break;
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1007
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1008
|
-
styleHeight:
|
|
1009
|
-
styleWidth:
|
|
1010
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1006
|
+
function ot({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1007
|
+
let { styleHeight: s, styleWidth: c } = I(() => ({
|
|
1008
|
+
styleHeight: at(o?.height),
|
|
1009
|
+
styleWidth: at(o?.width)
|
|
1010
|
+
}), [o?.height, o?.width]), [l, u] = R({
|
|
1011
1011
|
height: t,
|
|
1012
1012
|
width: n
|
|
1013
1013
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1014
|
-
return
|
|
1014
|
+
return X(() => {
|
|
1015
1015
|
if (i === null || d) return;
|
|
1016
1016
|
let t = new ResizeObserver((e) => {
|
|
1017
1017
|
for (let t of e) {
|
|
@@ -1031,7 +1031,7 @@ function st({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1031
1031
|
i,
|
|
1032
1032
|
s,
|
|
1033
1033
|
c
|
|
1034
|
-
]),
|
|
1034
|
+
]), I(() => ({
|
|
1035
1035
|
height: s ?? l.height,
|
|
1036
1036
|
width: c ?? l.width
|
|
1037
1037
|
}), [
|
|
@@ -1040,26 +1040,26 @@ function st({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1040
1040
|
c
|
|
1041
1041
|
]);
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1044
|
-
let t =
|
|
1043
|
+
function st(e) {
|
|
1044
|
+
let t = L(() => {
|
|
1045
1045
|
throw Error("Cannot call during render.");
|
|
1046
1046
|
});
|
|
1047
|
-
return
|
|
1047
|
+
return X(() => {
|
|
1048
1048
|
t.current = e;
|
|
1049
|
-
}, [e]),
|
|
1049
|
+
}, [e]), P((e) => t.current?.(e), [t]);
|
|
1050
1050
|
}
|
|
1051
|
-
var
|
|
1052
|
-
function
|
|
1053
|
-
if (
|
|
1051
|
+
var Z = null;
|
|
1052
|
+
function ct(e = !1) {
|
|
1053
|
+
if (Z === null || e) {
|
|
1054
1054
|
let e = document.createElement("div"), t = e.style;
|
|
1055
1055
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1056
1056
|
let n = document.createElement("div"), r = n.style;
|
|
1057
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1057
|
+
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;
|
|
1058
1058
|
}
|
|
1059
|
-
return
|
|
1059
|
+
return Z;
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1062
|
-
if (t === "horizontal" && n) switch (
|
|
1061
|
+
function lt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1062
|
+
if (t === "horizontal" && n) switch (ct()) {
|
|
1063
1063
|
case "negative": return -r;
|
|
1064
1064
|
case "positive-descending":
|
|
1065
1065
|
if (e) {
|
|
@@ -1070,26 +1070,26 @@ function ut({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1070
1070
|
}
|
|
1071
1071
|
return r;
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function Q(e, t = "Assertion error") {
|
|
1074
1074
|
if (!e) throw console.error(t), Error(t);
|
|
1075
1075
|
}
|
|
1076
|
-
function
|
|
1076
|
+
function $(e, t) {
|
|
1077
1077
|
if (e === t) return !0;
|
|
1078
|
-
if (!!e != !!t || (
|
|
1078
|
+
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1079
1079
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1080
1080
|
return !0;
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function ut({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1083
1083
|
if (t === 0) return 0;
|
|
1084
1084
|
if (typeof n == "number") return t * n;
|
|
1085
1085
|
{
|
|
1086
1086
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1087
|
-
return
|
|
1087
|
+
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1088
1088
|
}
|
|
1089
1089
|
}
|
|
1090
|
-
function
|
|
1090
|
+
function dt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1091
1091
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1092
|
-
let s =
|
|
1092
|
+
let s = ut({
|
|
1093
1093
|
cachedBounds: t,
|
|
1094
1094
|
itemCount: r,
|
|
1095
1095
|
itemSize: i
|
|
@@ -1101,7 +1101,7 @@ function ft({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1101
1101
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1102
1102
|
}
|
|
1103
1103
|
}
|
|
1104
|
-
function
|
|
1104
|
+
function ft({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1105
1105
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1106
1106
|
for (; u < a;) {
|
|
1107
1107
|
let n = e.get(u);
|
|
@@ -1120,11 +1120,11 @@ function pt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemC
|
|
|
1120
1120
|
stopIndexOverscan: l
|
|
1121
1121
|
};
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function pt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1124
1124
|
let r = /* @__PURE__ */ new Map();
|
|
1125
1125
|
return {
|
|
1126
1126
|
get(i) {
|
|
1127
|
-
for (
|
|
1127
|
+
for (Q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1128
1128
|
let e = r.size, a;
|
|
1129
1129
|
switch (typeof n) {
|
|
1130
1130
|
case "function":
|
|
@@ -1140,14 +1140,14 @@ function mt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1140
1140
|
});
|
|
1141
1141
|
else {
|
|
1142
1142
|
let t = r.get(e - 1);
|
|
1143
|
-
|
|
1143
|
+
Q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1144
1144
|
scrollOffset: t.scrollOffset + t.size,
|
|
1145
1145
|
size: a
|
|
1146
1146
|
});
|
|
1147
1147
|
}
|
|
1148
1148
|
}
|
|
1149
1149
|
let a = r.get(i);
|
|
1150
|
-
return
|
|
1150
|
+
return Q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1151
1151
|
},
|
|
1152
1152
|
set(e, t) {
|
|
1153
1153
|
r.set(e, t);
|
|
@@ -1157,8 +1157,8 @@ function mt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1157
1157
|
}
|
|
1158
1158
|
};
|
|
1159
1159
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1160
|
+
function mt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1161
|
+
return I(() => pt({
|
|
1162
1162
|
itemCount: e,
|
|
1163
1163
|
itemProps: t,
|
|
1164
1164
|
itemSize: n
|
|
@@ -1168,11 +1168,11 @@ function ht({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1168
1168
|
n
|
|
1169
1169
|
]);
|
|
1170
1170
|
}
|
|
1171
|
-
function
|
|
1171
|
+
function ht({ containerSize: e, itemSize: t }) {
|
|
1172
1172
|
let n;
|
|
1173
1173
|
switch (typeof t) {
|
|
1174
1174
|
case "string":
|
|
1175
|
-
|
|
1175
|
+
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;
|
|
1176
1176
|
break;
|
|
1177
1177
|
default:
|
|
1178
1178
|
n = t;
|
|
@@ -1180,21 +1180,21 @@ function gt({ containerSize: e, itemSize: t }) {
|
|
|
1180
1180
|
}
|
|
1181
1181
|
return n;
|
|
1182
1182
|
}
|
|
1183
|
-
function
|
|
1184
|
-
let { height: u = n, width: d = n } =
|
|
1183
|
+
function gt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1184
|
+
let { height: u = n, width: d = n } = ot({
|
|
1185
1185
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1186
1186
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1187
1187
|
element: e,
|
|
1188
1188
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1189
1189
|
style: t
|
|
1190
|
-
}), f =
|
|
1190
|
+
}), f = L({
|
|
1191
1191
|
height: 0,
|
|
1192
1192
|
width: 0
|
|
1193
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1193
|
+
}), p = r === "vertical" ? u : d, m = ht({
|
|
1194
1194
|
containerSize: p,
|
|
1195
1195
|
itemSize: s
|
|
1196
1196
|
});
|
|
1197
|
-
|
|
1197
|
+
he(() => {
|
|
1198
1198
|
if (typeof c == "function") {
|
|
1199
1199
|
let e = f.current;
|
|
1200
1200
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1207,11 +1207,11 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1207
1207
|
c,
|
|
1208
1208
|
d
|
|
1209
1209
|
]);
|
|
1210
|
-
let h =
|
|
1210
|
+
let h = mt({
|
|
1211
1211
|
itemCount: a,
|
|
1212
1212
|
itemProps: o,
|
|
1213
1213
|
itemSize: m
|
|
1214
|
-
}), g =
|
|
1214
|
+
}), g = P((e) => h.get(e), [h]), [_, v] = R(() => ft({
|
|
1215
1215
|
cachedBounds: h,
|
|
1216
1216
|
containerScrollOffset: 0,
|
|
1217
1217
|
containerSize: p,
|
|
@@ -1222,7 +1222,7 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1222
1222
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1223
1223
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1224
1224
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1225
|
-
}, C =
|
|
1225
|
+
}, C = P(() => ut({
|
|
1226
1226
|
cachedBounds: h,
|
|
1227
1227
|
itemCount: a,
|
|
1228
1228
|
itemSize: m
|
|
@@ -1230,9 +1230,9 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1230
1230
|
h,
|
|
1231
1231
|
a,
|
|
1232
1232
|
m
|
|
1233
|
-
]), w =
|
|
1233
|
+
]), w = P((t) => ft({
|
|
1234
1234
|
cachedBounds: h,
|
|
1235
|
-
containerScrollOffset:
|
|
1235
|
+
containerScrollOffset: lt({
|
|
1236
1236
|
containerElement: e,
|
|
1237
1237
|
direction: r,
|
|
1238
1238
|
isRtl: i,
|
|
@@ -1250,19 +1250,19 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1250
1250
|
a,
|
|
1251
1251
|
l
|
|
1252
1252
|
]);
|
|
1253
|
-
return
|
|
1253
|
+
return X(() => {
|
|
1254
1254
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1255
1255
|
}, [
|
|
1256
1256
|
e,
|
|
1257
1257
|
r,
|
|
1258
1258
|
w
|
|
1259
|
-
]),
|
|
1259
|
+
]), X(() => {
|
|
1260
1260
|
if (!e) return;
|
|
1261
1261
|
let t = () => {
|
|
1262
1262
|
v((t) => {
|
|
1263
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1263
|
+
let { scrollLeft: n, scrollTop: o } = e, s = ft({
|
|
1264
1264
|
cachedBounds: h,
|
|
1265
|
-
containerScrollOffset:
|
|
1265
|
+
containerScrollOffset: lt({
|
|
1266
1266
|
containerElement: e,
|
|
1267
1267
|
direction: r,
|
|
1268
1268
|
isRtl: i,
|
|
@@ -1272,7 +1272,7 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1272
1272
|
itemCount: a,
|
|
1273
1273
|
overscanCount: l
|
|
1274
1274
|
});
|
|
1275
|
-
return
|
|
1275
|
+
return $(s, t) ? t : s;
|
|
1276
1276
|
});
|
|
1277
1277
|
};
|
|
1278
1278
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1288,8 +1288,8 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1288
1288
|
]), {
|
|
1289
1289
|
getCellBounds: g,
|
|
1290
1290
|
getEstimatedSize: C,
|
|
1291
|
-
scrollToIndex:
|
|
1292
|
-
let s =
|
|
1291
|
+
scrollToIndex: st(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1292
|
+
let s = dt({
|
|
1293
1293
|
align: t,
|
|
1294
1294
|
cachedBounds: h,
|
|
1295
1295
|
containerScrollOffset: n,
|
|
@@ -1299,14 +1299,14 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1299
1299
|
itemSize: m
|
|
1300
1300
|
});
|
|
1301
1301
|
if (e) {
|
|
1302
|
-
if (s =
|
|
1302
|
+
if (s = lt({
|
|
1303
1303
|
containerElement: e,
|
|
1304
1304
|
direction: r,
|
|
1305
1305
|
isRtl: i,
|
|
1306
1306
|
scrollOffset: s
|
|
1307
1307
|
}), typeof e.scrollTo != "function") {
|
|
1308
1308
|
let e = w(s);
|
|
1309
|
-
|
|
1309
|
+
$(_, e) || v(e);
|
|
1310
1310
|
}
|
|
1311
1311
|
return s;
|
|
1312
1312
|
}
|
|
@@ -1317,30 +1317,30 @@ function _t({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1317
1317
|
stopIndexVisible: x
|
|
1318
1318
|
};
|
|
1319
1319
|
}
|
|
1320
|
-
function
|
|
1321
|
-
return
|
|
1320
|
+
function _t(e) {
|
|
1321
|
+
return I(() => e, Object.values(e));
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function vt(e, t) {
|
|
1324
1324
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1325
|
-
return
|
|
1325
|
+
return $(n, a) && $(r, o) && $(i, s);
|
|
1326
1326
|
}
|
|
1327
|
-
function
|
|
1327
|
+
function yt(e) {
|
|
1328
1328
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1329
1329
|
}
|
|
1330
|
-
var
|
|
1331
|
-
function
|
|
1332
|
-
let m =
|
|
1330
|
+
var bt = "data-react-window-index";
|
|
1331
|
+
function xt({ 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 }) {
|
|
1332
|
+
let m = _t(u), h = I(() => pe(s, vt), [s]), [g, _] = R(null), v = yt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = gt({
|
|
1333
1333
|
containerElement: g,
|
|
1334
1334
|
containerStyle: f,
|
|
1335
1335
|
defaultContainerSize: n,
|
|
1336
1336
|
direction: "vertical",
|
|
1337
1337
|
itemCount: c,
|
|
1338
1338
|
itemProps: m,
|
|
1339
|
-
itemSize:
|
|
1339
|
+
itemSize: I(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1340
1340
|
onResize: i,
|
|
1341
1341
|
overscanCount: o
|
|
1342
1342
|
});
|
|
1343
|
-
|
|
1343
|
+
me(r, () => ({
|
|
1344
1344
|
get element() {
|
|
1345
1345
|
return g;
|
|
1346
1346
|
},
|
|
@@ -1355,12 +1355,12 @@ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1355
1355
|
top: r
|
|
1356
1356
|
});
|
|
1357
1357
|
}
|
|
1358
|
-
}), [g, x]),
|
|
1358
|
+
}), [g, x]), X(() => {
|
|
1359
1359
|
if (!g) return;
|
|
1360
1360
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1361
1361
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1362
1362
|
let n = `${S + t}`;
|
|
1363
|
-
return e.setAttribute(
|
|
1363
|
+
return e.setAttribute(bt, n), !0;
|
|
1364
1364
|
});
|
|
1365
1365
|
if (v) return l.observeRowElements(e);
|
|
1366
1366
|
}, [
|
|
@@ -1369,7 +1369,7 @@ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1369
1369
|
l,
|
|
1370
1370
|
S,
|
|
1371
1371
|
w
|
|
1372
|
-
]),
|
|
1372
|
+
]), F(() => {
|
|
1373
1373
|
S >= 0 && w >= 0 && a && a({
|
|
1374
1374
|
startIndex: C,
|
|
1375
1375
|
stopIndex: T
|
|
@@ -1384,11 +1384,11 @@ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1384
1384
|
w,
|
|
1385
1385
|
T
|
|
1386
1386
|
]);
|
|
1387
|
-
let E =
|
|
1387
|
+
let E = I(() => {
|
|
1388
1388
|
let e = [];
|
|
1389
1389
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1390
1390
|
let n = y(t);
|
|
1391
|
-
e.push(/* @__PURE__ */
|
|
1391
|
+
e.push(/* @__PURE__ */ fe(h, {
|
|
1392
1392
|
...m,
|
|
1393
1393
|
ariaAttributes: {
|
|
1394
1394
|
"aria-posinset": t + 1,
|
|
@@ -1415,7 +1415,7 @@ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1415
1415
|
m,
|
|
1416
1416
|
S,
|
|
1417
1417
|
w
|
|
1418
|
-
]), D = /* @__PURE__ */
|
|
1418
|
+
]), D = /* @__PURE__ */ B("div", {
|
|
1419
1419
|
"aria-hidden": !0,
|
|
1420
1420
|
style: {
|
|
1421
1421
|
height: b(),
|
|
@@ -1423,7 +1423,7 @@ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1423
1423
|
zIndex: -1
|
|
1424
1424
|
}
|
|
1425
1425
|
});
|
|
1426
|
-
return
|
|
1426
|
+
return fe(d, {
|
|
1427
1427
|
role: "list",
|
|
1428
1428
|
...p,
|
|
1429
1429
|
className: t,
|
|
@@ -1437,34 +1437,34 @@ function St({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1437
1437
|
}
|
|
1438
1438
|
}, E, e, D);
|
|
1439
1439
|
}
|
|
1440
|
-
var
|
|
1440
|
+
var St = {
|
|
1441
1441
|
divider: "_divider_3wv6u_1",
|
|
1442
1442
|
item: "_item_3wv6u_5",
|
|
1443
1443
|
itemIcon: "_itemIcon_3wv6u_15",
|
|
1444
1444
|
checkIcon: "_checkIcon_3wv6u_19",
|
|
1445
1445
|
stateLabel: "_stateLabel_3wv6u_23"
|
|
1446
1446
|
}, Ct = 44, wt = 8, Tt = ({ index: e, style: t, ariaAttributes: n, items: i, selectedDeploymentId: a, labelClassName: o, query: c, onSelect: l }) => {
|
|
1447
|
-
let u = i[e], d =
|
|
1448
|
-
return /* @__PURE__ */
|
|
1447
|
+
let u = i[e], d = rt(u.iconUrl, u.type, u.displayName ?? u.id, f.SM), m = u.id === a;
|
|
1448
|
+
return /* @__PURE__ */ B("div", {
|
|
1449
1449
|
style: t,
|
|
1450
1450
|
...n,
|
|
1451
|
-
children: /* @__PURE__ */
|
|
1451
|
+
children: /* @__PURE__ */ B(p, {
|
|
1452
1452
|
type: "button",
|
|
1453
|
-
className: s(
|
|
1454
|
-
iconBefore: /* @__PURE__ */
|
|
1455
|
-
className:
|
|
1453
|
+
className: s(St.item, "flex h-full w-full items-center gap-3 px-4"),
|
|
1454
|
+
iconBefore: /* @__PURE__ */ B("span", {
|
|
1455
|
+
className: St.itemIcon,
|
|
1456
1456
|
children: d
|
|
1457
1457
|
}),
|
|
1458
|
-
label: /* @__PURE__ */
|
|
1458
|
+
label: /* @__PURE__ */ V("span", {
|
|
1459
1459
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1460
|
-
children: [/* @__PURE__ */
|
|
1460
|
+
children: [/* @__PURE__ */ B(r, {
|
|
1461
1461
|
text: u.displayName ?? u.id,
|
|
1462
1462
|
query: c,
|
|
1463
1463
|
maxLines: 1,
|
|
1464
1464
|
className: s(o, "min-w-0 flex-1 text-start")
|
|
1465
|
-
}), m && /* @__PURE__ */
|
|
1465
|
+
}), m && /* @__PURE__ */ B(re, {
|
|
1466
1466
|
size: f.SM,
|
|
1467
|
-
className:
|
|
1467
|
+
className: St.checkIcon,
|
|
1468
1468
|
"aria-hidden": !0
|
|
1469
1469
|
})]
|
|
1470
1470
|
}),
|
|
@@ -1472,12 +1472,12 @@ var $ = {
|
|
|
1472
1472
|
})
|
|
1473
1473
|
});
|
|
1474
1474
|
}, Et = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: o, onSelect: c, loadingLabel: l, errorLabel: u, emptyLabel: d, style: f, titleClassName: p = "dial-body-semi-text", labelClassName: m = "dial-small-text" }) => {
|
|
1475
|
-
let [h, g] =
|
|
1476
|
-
|
|
1475
|
+
let [h, g] = R("");
|
|
1476
|
+
F(() => {
|
|
1477
1477
|
e || g("");
|
|
1478
1478
|
}, [e]);
|
|
1479
|
-
let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ?
|
|
1480
|
-
return /* @__PURE__ */
|
|
1479
|
+
let _ = a && a.length > 0, v = l !== void 0, y = !_ && !v ? u ?? d : void 0, b = _ ? nt(a, h) : [];
|
|
1480
|
+
return /* @__PURE__ */ V(U, {
|
|
1481
1481
|
isOpen: e,
|
|
1482
1482
|
title: t,
|
|
1483
1483
|
closeLabel: n,
|
|
@@ -1485,19 +1485,19 @@ var $ = {
|
|
|
1485
1485
|
style: f,
|
|
1486
1486
|
titleClassName: p,
|
|
1487
1487
|
className: "max-h-[80dvh]",
|
|
1488
|
-
children: [_ && !v && /* @__PURE__ */ z
|
|
1488
|
+
children: [_ && !v && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("div", {
|
|
1489
1489
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1490
|
-
children: /* @__PURE__ */
|
|
1490
|
+
children: /* @__PURE__ */ B(C, {
|
|
1491
1491
|
value: h,
|
|
1492
1492
|
placeholder: r,
|
|
1493
1493
|
size: k.Standard,
|
|
1494
1494
|
onChange: g
|
|
1495
1495
|
})
|
|
1496
|
-
}), /* @__PURE__ */
|
|
1496
|
+
}), /* @__PURE__ */ B("div", { className: s(St.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ B(et, { loadingLabel: l }) : y ? /* @__PURE__ */ B("div", {
|
|
1497
1497
|
role: "list",
|
|
1498
|
-
className: s(
|
|
1498
|
+
className: s(St.stateLabel, m, "px-4 py-4"),
|
|
1499
1499
|
children: y
|
|
1500
|
-
}) : /* @__PURE__ */
|
|
1500
|
+
}) : /* @__PURE__ */ B(xt, {
|
|
1501
1501
|
role: "list",
|
|
1502
1502
|
className: "overflow-y-auto",
|
|
1503
1503
|
style: { height: Math.min(b.length, wt) * Ct },
|
|
@@ -1516,22 +1516,22 @@ var $ = {
|
|
|
1516
1516
|
})]
|
|
1517
1517
|
});
|
|
1518
1518
|
}, Dt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: o = !1, isDisabled: c = !1, style: l, modelPickerOverlay: u, isPickerOpen: d, onPickerToggle: p, onPickerOpenChange: m }) => {
|
|
1519
|
-
let [_, y] =
|
|
1519
|
+
let [_, y] = R(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: w, onOpenChange: T } = it({
|
|
1520
1520
|
deployments: e,
|
|
1521
1521
|
selectedDeploymentId: t,
|
|
1522
1522
|
onDeploymentChange: n,
|
|
1523
1523
|
modelSelectorLabels: r
|
|
1524
1524
|
});
|
|
1525
1525
|
if (!e) return null;
|
|
1526
|
-
let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */
|
|
1526
|
+
let E = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, D = /* @__PURE__ */ B(M, {
|
|
1527
1527
|
size: f.SM,
|
|
1528
|
-
className:
|
|
1528
|
+
className: Y.modelSelectorCaret,
|
|
1529
1529
|
"aria-hidden": !0
|
|
1530
1530
|
});
|
|
1531
|
-
return a ? /* @__PURE__ */ z
|
|
1531
|
+
return a ? /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(O, {
|
|
1532
1532
|
tooltip: S,
|
|
1533
|
-
children: /* @__PURE__ */
|
|
1534
|
-
icon: /* @__PURE__ */
|
|
1533
|
+
children: /* @__PURE__ */ B(v, {
|
|
1534
|
+
icon: /* @__PURE__ */ V("div", {
|
|
1535
1535
|
className: "flex items-center gap-1",
|
|
1536
1536
|
children: [b, D]
|
|
1537
1537
|
}),
|
|
@@ -1539,16 +1539,16 @@ var $ = {
|
|
|
1539
1539
|
onClick: () => {
|
|
1540
1540
|
c || y(!0);
|
|
1541
1541
|
},
|
|
1542
|
-
className: s(
|
|
1542
|
+
className: s(Y.modelSelectorButton, E)
|
|
1543
1543
|
})
|
|
1544
|
-
}), u ? /* @__PURE__ */
|
|
1544
|
+
}), u ? /* @__PURE__ */ B(U, {
|
|
1545
1545
|
isOpen: _,
|
|
1546
1546
|
title: r?.ariaLabel ?? "Select model",
|
|
1547
1547
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1548
1548
|
onClose: () => y(!1),
|
|
1549
1549
|
style: l,
|
|
1550
1550
|
children: u(() => y(!1))
|
|
1551
|
-
}) : /* @__PURE__ */
|
|
1551
|
+
}) : /* @__PURE__ */ B(Et, {
|
|
1552
1552
|
isOpen: _,
|
|
1553
1553
|
title: r?.ariaLabel ?? "Select model",
|
|
1554
1554
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1561,7 +1561,7 @@ var $ = {
|
|
|
1561
1561
|
errorLabel: r?.error,
|
|
1562
1562
|
emptyLabel: r?.empty,
|
|
1563
1563
|
style: l
|
|
1564
|
-
})] }) : u ? /* @__PURE__ */
|
|
1564
|
+
})] }) : u ? /* @__PURE__ */ B(h, {
|
|
1565
1565
|
placement: "top-end",
|
|
1566
1566
|
matchReferenceWidth: !1,
|
|
1567
1567
|
open: d,
|
|
@@ -1570,24 +1570,24 @@ var $ = {
|
|
|
1570
1570
|
outsideClosable: !0,
|
|
1571
1571
|
renderOverlay: () => u(() => m?.(!1)),
|
|
1572
1572
|
listClassName: "cp-dropdown-overlay !w-[320px]",
|
|
1573
|
-
children: /* @__PURE__ */
|
|
1573
|
+
children: /* @__PURE__ */ B(O, {
|
|
1574
1574
|
tooltip: S,
|
|
1575
|
-
children: /* @__PURE__ */
|
|
1575
|
+
children: /* @__PURE__ */ V("button", {
|
|
1576
1576
|
type: "button",
|
|
1577
1577
|
"aria-label": x,
|
|
1578
|
-
className: s("flex items-center justify-center gap-1 rounded-md p-2",
|
|
1578
|
+
className: s("flex items-center justify-center gap-1 rounded-md p-2", Y.modelSelectorButton, o || i || c ? E : void 0, (o || c) && Y.modelSelectorButtonDisabled),
|
|
1579
1579
|
onClick: () => {
|
|
1580
1580
|
!o && !i && !c && p?.();
|
|
1581
1581
|
},
|
|
1582
1582
|
children: [b, D]
|
|
1583
1583
|
})
|
|
1584
1584
|
})
|
|
1585
|
-
}) : /* @__PURE__ */
|
|
1585
|
+
}) : /* @__PURE__ */ B("div", {
|
|
1586
1586
|
className: s(c && E),
|
|
1587
1587
|
"aria-disabled": c || void 0,
|
|
1588
|
-
children: /* @__PURE__ */
|
|
1588
|
+
children: /* @__PURE__ */ B(O, {
|
|
1589
1589
|
tooltip: S,
|
|
1590
|
-
children: /* @__PURE__ */
|
|
1590
|
+
children: /* @__PURE__ */ B(g, {
|
|
1591
1591
|
icon: b,
|
|
1592
1592
|
ariaLabel: x,
|
|
1593
1593
|
items: C,
|
|
@@ -1599,12 +1599,12 @@ var $ = {
|
|
|
1599
1599
|
size: k.Standard,
|
|
1600
1600
|
caretIcon: D,
|
|
1601
1601
|
iconClassName: o || c ? E : void 0,
|
|
1602
|
-
buttonClassName: s("bg-transparent",
|
|
1602
|
+
buttonClassName: s("bg-transparent", Y.modelSelectorButton, (o || c) && E && Y.modelSelectorButtonDisabled)
|
|
1603
1603
|
})
|
|
1604
1604
|
})
|
|
1605
1605
|
});
|
|
1606
|
-
}, Ot = 160, kt = ({ message: e = "", onSend: t, onUploadAttachment: n, onStop: r, isStreaming: i = !1, onChange: a, onAttachmentsChange: u, placeholder: d = "Type a message...", ariaLabel: p, attachLabel: m = "Attach file", fileAccept: h, addMenuTitle: g = "Add", menuTitle: _ = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", colors: T, typography: E, className: D, pendingDropFiles: ee = [], onDropFilesConsumed: O, pendingAttachments: k = [], onPendingAttachmentsConsumed: A, pasteTextThreshold: te = 4e3, deployments: ne, selectedDeploymentId:
|
|
1607
|
-
let
|
|
1606
|
+
}, Ot = 160, kt = ({ message: e = "", onSend: t, onUploadAttachment: n, onStop: r, isStreaming: i = !1, onChange: a, onAttachmentsChange: u, placeholder: d = "Type a message...", ariaLabel: p, attachLabel: m = "Attach file", fileAccept: h, addMenuTitle: g = "Add", menuTitle: _ = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", colors: T, typography: E, className: D, pendingDropFiles: ee = [], onDropFilesConsumed: O, pendingAttachments: k = [], onPendingAttachmentsConsumed: A, pasteTextThreshold: te = 4e3, deployments: ne, selectedDeploymentId: j, onDeploymentChange: re, modelSelectorLabels: M, initialAttachments: ie = [], isStacked: se = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: de, isInputDisabled: N = !1, isModelSelectorDisabled: fe = !1, isTranscriptionSupported: pe = !1, onUploadAudio: F, onTranscribeAudio: me, sendOnEnter: he = Le.Enter, prefixAttachments: ge = [], onRemovePrefixAttachment: _e, chatSettings: ve, autoFocus: be = !1, messageHistory: xe, onDialFileSystemClick: Se, dialFileSystemLabel: Ce, validateAttachment: Te, onAttachmentClick: H, modelPickerOverlay: U, maximumAttachmentsAmount: Ee, onAttachmentsLimitExceeded: ke }) => {
|
|
1607
|
+
let Ae = c(), [Ne, Pe] = R(!1), Fe = je(xe), W = I(() => o({
|
|
1608
1608
|
"--ci-bg": T?.background,
|
|
1609
1609
|
"--ci-text": T?.text,
|
|
1610
1610
|
"--ci-border": T?.border,
|
|
@@ -1616,170 +1616,170 @@ var $ = {
|
|
|
1616
1616
|
"--ci-send-bg": T?.sendBackground,
|
|
1617
1617
|
"--ci-send-text": T?.sendText,
|
|
1618
1618
|
"--ci-stop-color": T?.stopColor
|
|
1619
|
-
}), [T]),
|
|
1619
|
+
}), [T]), Re = I(() => Se ? [{
|
|
1620
1620
|
key: "dial-fs",
|
|
1621
|
-
label:
|
|
1622
|
-
icon: /* @__PURE__ */
|
|
1621
|
+
label: Ce ?? "DIAL file system",
|
|
1622
|
+
icon: /* @__PURE__ */ B(ae, {
|
|
1623
1623
|
size: l,
|
|
1624
1624
|
"aria-hidden": !0
|
|
1625
1625
|
}),
|
|
1626
|
-
onClick:
|
|
1627
|
-
}] : [], [
|
|
1628
|
-
initialAttachments:
|
|
1626
|
+
onClick: Se
|
|
1627
|
+
}] : [], [Se, Ce]), { message: G, setMessage: K, textareaRef: ze, isMultiLine: Be } = Me({ messageProp: e }), { attachments: q, buildAttachments: Ve, addAttachments: He, resetAttachments: Ue, handleRemove: We, handleRetry: J, handleExpand: Ke, hasBlockedAttachments: qe } = De({
|
|
1628
|
+
initialAttachments: ie,
|
|
1629
1629
|
onUploadAttachment: n,
|
|
1630
1630
|
onAttachmentsChange: u,
|
|
1631
|
-
validateAttachment:
|
|
1631
|
+
validateAttachment: Te,
|
|
1632
1632
|
pendingDropFiles: ee,
|
|
1633
1633
|
onDropFilesConsumed: O,
|
|
1634
1634
|
pendingAttachments: k,
|
|
1635
1635
|
onPendingAttachmentsConsumed: A,
|
|
1636
|
-
onExpandPastedText:
|
|
1637
|
-
|
|
1638
|
-
}, [
|
|
1639
|
-
maximumAttachmentsAmount:
|
|
1640
|
-
baseAttachmentsAmount:
|
|
1641
|
-
onAttachmentsLimitExceeded:
|
|
1642
|
-
}), { state:
|
|
1643
|
-
onUploadAudio:
|
|
1644
|
-
onTranscribeAudio:
|
|
1645
|
-
onTranscript:
|
|
1646
|
-
|
|
1647
|
-
}, [a,
|
|
1648
|
-
}),
|
|
1649
|
-
let e =
|
|
1650
|
-
|
|
1636
|
+
onExpandPastedText: P((e) => {
|
|
1637
|
+
K((t) => t ? `${t}\n${e}` : e);
|
|
1638
|
+
}, [K]),
|
|
1639
|
+
maximumAttachmentsAmount: Ee,
|
|
1640
|
+
baseAttachmentsAmount: ge.length,
|
|
1641
|
+
onAttachmentsLimitExceeded: ke
|
|
1642
|
+
}), { state: Je, waveformData: Qe, errorMessage: $e, startRecording: et, stopRecording: tt, confirmRecording: nt, discardRecording: rt } = Ie({
|
|
1643
|
+
onUploadAudio: F,
|
|
1644
|
+
onTranscribeAudio: me,
|
|
1645
|
+
onTranscript: P((e) => {
|
|
1646
|
+
K(e), a?.(e);
|
|
1647
|
+
}, [a, K])
|
|
1648
|
+
}), it = L(null), X = L(null), { handlePaste: at } = we(He, te), ot = G.trim().length > 0 || q.length > 0, st = ot && !qe, { shouldRender: Z, isExiting: ct, instanceKey: lt } = Oe(!i && ot, Ot), Q = se || q.length > 0 || G.includes("\n") || Be, $ = ne === void 0 || j != null, ut = async () => {
|
|
1649
|
+
let e = G, n = q;
|
|
1650
|
+
K(""), Fe.reset();
|
|
1651
1651
|
try {
|
|
1652
1652
|
await t?.(e, n), n.forEach((e) => {
|
|
1653
1653
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl);
|
|
1654
|
-
}),
|
|
1654
|
+
}), Ue([]);
|
|
1655
1655
|
} catch {
|
|
1656
|
-
|
|
1656
|
+
K(e), Ue(n);
|
|
1657
1657
|
}
|
|
1658
|
-
},
|
|
1659
|
-
if (!e.nativeEvent.isComposing && !
|
|
1660
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1658
|
+
}, dt = (e) => {
|
|
1659
|
+
if (!e.nativeEvent.isComposing && !N && !i && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1660
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Fe.navigate(e.key === "ArrowUp" ? "up" : "down", G, t);
|
|
1661
1661
|
if (n !== null) {
|
|
1662
|
-
e.preventDefault(),
|
|
1662
|
+
e.preventDefault(), K(n);
|
|
1663
1663
|
return;
|
|
1664
1664
|
}
|
|
1665
1665
|
}
|
|
1666
|
-
e.key === "Enter" && (
|
|
1667
|
-
},
|
|
1666
|
+
e.key === "Enter" && (he === Le.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !i && st && $ && !N && ut());
|
|
1667
|
+
}, ft = (e) => {
|
|
1668
1668
|
let t = Array.from(e.target.files ?? []);
|
|
1669
1669
|
if (t.length === 0) return;
|
|
1670
|
-
let n =
|
|
1671
|
-
e.target.value = "",
|
|
1670
|
+
let n = Ve(t);
|
|
1671
|
+
e.target.value = "", He(n);
|
|
1672
1672
|
};
|
|
1673
|
-
if (
|
|
1674
|
-
state:
|
|
1675
|
-
waveformData:
|
|
1676
|
-
errorMessage:
|
|
1677
|
-
onStop:
|
|
1678
|
-
onConfirm:
|
|
1679
|
-
onDiscard:
|
|
1680
|
-
style:
|
|
1673
|
+
if (Je !== "idle") return /* @__PURE__ */ B(Ye, {
|
|
1674
|
+
state: Je,
|
|
1675
|
+
waveformData: Qe,
|
|
1676
|
+
errorMessage: $e,
|
|
1677
|
+
onStop: tt,
|
|
1678
|
+
onConfirm: nt,
|
|
1679
|
+
onDiscard: rt,
|
|
1680
|
+
style: W,
|
|
1681
1681
|
className: D
|
|
1682
1682
|
});
|
|
1683
|
-
let
|
|
1684
|
-
className: s(
|
|
1685
|
-
ref:
|
|
1686
|
-
autoFocus:
|
|
1687
|
-
value:
|
|
1683
|
+
let pt = /* @__PURE__ */ B("textarea", {
|
|
1684
|
+
className: s(Y.textarea, E?.fontClassName, "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1685
|
+
ref: ze,
|
|
1686
|
+
autoFocus: be,
|
|
1687
|
+
value: G,
|
|
1688
1688
|
onChange: (e) => {
|
|
1689
|
-
|
|
1689
|
+
K(e.target.value), Fe.notifyChange(), a?.(e.target.value);
|
|
1690
1690
|
},
|
|
1691
|
-
onKeyDown:
|
|
1692
|
-
onPaste:
|
|
1691
|
+
onKeyDown: dt,
|
|
1692
|
+
onPaste: at,
|
|
1693
1693
|
placeholder: d,
|
|
1694
1694
|
"aria-label": p,
|
|
1695
|
-
disabled:
|
|
1695
|
+
disabled: N,
|
|
1696
1696
|
rows: 1
|
|
1697
1697
|
});
|
|
1698
|
-
return /* @__PURE__ */
|
|
1699
|
-
ref:
|
|
1700
|
-
style:
|
|
1701
|
-
className: s(
|
|
1702
|
-
children: [(
|
|
1703
|
-
attachments: [...
|
|
1698
|
+
return /* @__PURE__ */ V("div", {
|
|
1699
|
+
ref: X,
|
|
1700
|
+
style: W,
|
|
1701
|
+
className: s(Y.wrapper, N && Y.wrapperDisabled, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", q.length > 6 ? "py-3 ps-3" : "p-3", D),
|
|
1702
|
+
children: [(ge.length > 0 || q.length > 0) && /* @__PURE__ */ B(ye, {
|
|
1703
|
+
attachments: [...ge, ...q],
|
|
1704
1704
|
onRemove: (e) => {
|
|
1705
|
-
|
|
1705
|
+
ge.some((t) => t.id === e) ? _e?.(e) : We(e);
|
|
1706
1706
|
},
|
|
1707
|
-
onRetry:
|
|
1708
|
-
onExpand:
|
|
1707
|
+
onRetry: J,
|
|
1708
|
+
onExpand: Ke,
|
|
1709
1709
|
labels: {
|
|
1710
1710
|
removeLabel: b,
|
|
1711
1711
|
retryLabel: x
|
|
1712
1712
|
},
|
|
1713
|
-
onAttachmentClick:
|
|
1714
|
-
let t =
|
|
1715
|
-
t != null &&
|
|
1713
|
+
onAttachmentClick: H == null ? void 0 : (e) => {
|
|
1714
|
+
let t = q.find((t) => t.id === e);
|
|
1715
|
+
t != null && H(t);
|
|
1716
1716
|
}
|
|
1717
|
-
}),
|
|
1718
|
-
className: s("flex items-center gap-2",
|
|
1717
|
+
}), ue ? Q && pt : /* @__PURE__ */ V("div", {
|
|
1718
|
+
className: s("flex items-center gap-2", Q ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1719
1719
|
children: [
|
|
1720
|
-
!
|
|
1721
|
-
className: s("order-2 flex", !
|
|
1722
|
-
children: [/* @__PURE__ */
|
|
1723
|
-
ref:
|
|
1720
|
+
!ce && /* @__PURE__ */ V("div", {
|
|
1721
|
+
className: s("order-2 flex", !Q && "desktop:order-1"),
|
|
1722
|
+
children: [/* @__PURE__ */ B("input", {
|
|
1723
|
+
ref: it,
|
|
1724
1724
|
type: "file",
|
|
1725
1725
|
multiple: !0,
|
|
1726
1726
|
accept: h,
|
|
1727
1727
|
className: "sr-only",
|
|
1728
1728
|
"aria-hidden": !0,
|
|
1729
1729
|
tabIndex: -1,
|
|
1730
|
-
onChange:
|
|
1731
|
-
}), /* @__PURE__ */
|
|
1732
|
-
onAttachClick:
|
|
1730
|
+
onChange: ft
|
|
1731
|
+
}), /* @__PURE__ */ B(Ge, {
|
|
1732
|
+
onAttachClick: le ? void 0 : () => it.current?.click(),
|
|
1733
1733
|
attachLabel: m,
|
|
1734
1734
|
addMenuTitle: g,
|
|
1735
1735
|
menuTitle: _,
|
|
1736
1736
|
menuCloseLabel: y,
|
|
1737
|
-
style:
|
|
1738
|
-
isDisabled:
|
|
1739
|
-
chatSettings:
|
|
1740
|
-
extraMenuItems:
|
|
1737
|
+
style: W,
|
|
1738
|
+
isDisabled: N,
|
|
1739
|
+
chatSettings: ve,
|
|
1740
|
+
extraMenuItems: Re
|
|
1741
1741
|
})]
|
|
1742
1742
|
}),
|
|
1743
|
-
/* @__PURE__ */
|
|
1744
|
-
className: s("order-1 flex w-full min-w-0 items-center self-stretch", !
|
|
1745
|
-
children:
|
|
1743
|
+
/* @__PURE__ */ B("div", {
|
|
1744
|
+
className: s("order-1 flex w-full min-w-0 items-center self-stretch", !Q && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1745
|
+
children: pt
|
|
1746
1746
|
}),
|
|
1747
|
-
/* @__PURE__ */
|
|
1748
|
-
className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto", !
|
|
1749
|
-
children: [
|
|
1750
|
-
canSend:
|
|
1751
|
-
onSend:
|
|
1752
|
-
}) : /* @__PURE__ */ z
|
|
1747
|
+
/* @__PURE__ */ V("div", {
|
|
1748
|
+
className: s("flex flex-shrink-0 items-center gap-2", "order-3 ms-auto", !Q && "desktop:ms-0"),
|
|
1749
|
+
children: [de ? de({
|
|
1750
|
+
canSend: st,
|
|
1751
|
+
onSend: ut
|
|
1752
|
+
}) : /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(Dt, {
|
|
1753
1753
|
deployments: ne,
|
|
1754
|
-
selectedDeploymentId:
|
|
1755
|
-
onDeploymentChange:
|
|
1756
|
-
modelSelectorLabels:
|
|
1754
|
+
selectedDeploymentId: j,
|
|
1755
|
+
onDeploymentChange: re,
|
|
1756
|
+
modelSelectorLabels: M,
|
|
1757
1757
|
isStreaming: i,
|
|
1758
|
-
isMobile:
|
|
1759
|
-
isInputDisabled:
|
|
1760
|
-
isDisabled:
|
|
1761
|
-
style:
|
|
1762
|
-
modelPickerOverlay:
|
|
1763
|
-
isPickerOpen:
|
|
1764
|
-
onPickerToggle: () =>
|
|
1765
|
-
onPickerOpenChange:
|
|
1766
|
-
}), i && r ? /* @__PURE__ */
|
|
1758
|
+
isMobile: Ae,
|
|
1759
|
+
isInputDisabled: N,
|
|
1760
|
+
isDisabled: fe,
|
|
1761
|
+
style: W,
|
|
1762
|
+
modelPickerOverlay: U,
|
|
1763
|
+
isPickerOpen: Ne,
|
|
1764
|
+
onPickerToggle: () => Pe((e) => !e),
|
|
1765
|
+
onPickerOpenChange: Pe
|
|
1766
|
+
}), i && r ? /* @__PURE__ */ B(Ze, {
|
|
1767
1767
|
onStop: r,
|
|
1768
1768
|
ariaLabel: C
|
|
1769
|
-
}) : !i &&
|
|
1770
|
-
onSend:
|
|
1771
|
-
isDisabled:
|
|
1769
|
+
}) : !i && Z && /* @__PURE__ */ B(Xe, {
|
|
1770
|
+
onSend: ut,
|
|
1771
|
+
isDisabled: !$ || qe,
|
|
1772
1772
|
ariaLabel: S,
|
|
1773
|
-
isExiting:
|
|
1774
|
-
},
|
|
1775
|
-
icon: /* @__PURE__ */
|
|
1773
|
+
isExiting: ct
|
|
1774
|
+
}, lt)] }), pe && !G.trim() && !ct && /* @__PURE__ */ B(v, {
|
|
1775
|
+
icon: /* @__PURE__ */ B(oe, {
|
|
1776
1776
|
size: f.LG,
|
|
1777
1777
|
"aria-hidden": !0
|
|
1778
1778
|
}),
|
|
1779
1779
|
"aria-label": w,
|
|
1780
1780
|
className: "size-8 flex-shrink-0",
|
|
1781
|
-
onClick:
|
|
1782
|
-
disabled:
|
|
1781
|
+
onClick: et,
|
|
1782
|
+
disabled: N || i
|
|
1783
1783
|
})]
|
|
1784
1784
|
})
|
|
1785
1785
|
]
|
|
@@ -1787,18 +1787,18 @@ var $ = {
|
|
|
1787
1787
|
});
|
|
1788
1788
|
}, At = { welcome: "_welcome_n2ph8_1" }, jt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, isInputDisabled: a = !1, ...c }) => {
|
|
1789
1789
|
let { colors: l, typography: u } = r ?? {};
|
|
1790
|
-
return /* @__PURE__ */
|
|
1790
|
+
return /* @__PURE__ */ V("div", {
|
|
1791
1791
|
style: o({
|
|
1792
1792
|
"--ci-root-bg": l?.background,
|
|
1793
1793
|
"--ci-welcome-color": l?.welcomeText
|
|
1794
1794
|
}),
|
|
1795
1795
|
className: s("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
1796
|
-
children: [n && /* @__PURE__ */
|
|
1796
|
+
children: [n && /* @__PURE__ */ B("h1", {
|
|
1797
1797
|
className: s(At.welcome, "m-0 text-center", u?.welcomeClassName),
|
|
1798
1798
|
children: n
|
|
1799
|
-
}), /* @__PURE__ */
|
|
1799
|
+
}), /* @__PURE__ */ B("div", {
|
|
1800
1800
|
className: "relative w-full max-w-[748px]",
|
|
1801
|
-
children: /* @__PURE__ */
|
|
1801
|
+
children: /* @__PURE__ */ B(kt, {
|
|
1802
1802
|
placeholder: t,
|
|
1803
1803
|
isStreaming: e,
|
|
1804
1804
|
isInputDisabled: a,
|
|
@@ -1808,75 +1808,86 @@ var $ = {
|
|
|
1808
1808
|
})
|
|
1809
1809
|
})]
|
|
1810
1810
|
});
|
|
1811
|
-
}, Mt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "Save & Submit", ariaLabel:
|
|
1812
|
-
let
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
}, [
|
|
1816
|
-
let [
|
|
1817
|
-
|
|
1818
|
-
},
|
|
1819
|
-
r(e,
|
|
1820
|
-
}, [
|
|
1821
|
-
|
|
1822
|
-
},
|
|
1811
|
+
}, Mt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: r, onUploadAttachment: a, cancelLabel: o = "Cancel", saveLabel: c = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, hideAttachFile: x = !1, fileAccept: S, maximumAttachmentsAmount: C, onAttachmentsLimitExceeded: w, onDialFileSystemClick: T, dialFileSystemLabel: E, pendingAttachments: D, onPendingAttachmentsConsumed: ee }) => {
|
|
1812
|
+
let O = L(null), [k, A] = R([]);
|
|
1813
|
+
F(() => {
|
|
1814
|
+
v?.length && (A(v), y?.());
|
|
1815
|
+
}, [v, y]);
|
|
1816
|
+
let [te, ne] = R(e ?? ""), [j, re] = R([]), [M, ie] = R(t), oe = j.some((e) => e.status === i.Loading || e.status === i.Error), se = (te.trim().length > 0 || j.length > 0 || M.length > 0) && !oe, ce = (e) => {
|
|
1817
|
+
ie((t) => t.filter((t) => t.id !== e));
|
|
1818
|
+
}, le = P((e, t) => {
|
|
1819
|
+
r(e, M, t);
|
|
1820
|
+
}, [M, r]), ue = () => {
|
|
1821
|
+
se && le(te, j);
|
|
1822
|
+
}, de = P(() => A([]), []), N = P((e) => {
|
|
1823
1823
|
let t = Array.from(e.target.files ?? []);
|
|
1824
|
-
t.length !== 0 && (e.target.value = "",
|
|
1825
|
-
}, [])
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1824
|
+
t.length !== 0 && (e.target.value = "", A(t));
|
|
1825
|
+
}, []), fe = I(() => T ? [{
|
|
1826
|
+
key: "dial-fs",
|
|
1827
|
+
label: E ?? "DIAL file system",
|
|
1828
|
+
icon: /* @__PURE__ */ B(ae, {
|
|
1829
|
+
size: l,
|
|
1830
|
+
"aria-hidden": !0
|
|
1831
|
+
}),
|
|
1832
|
+
onClick: T
|
|
1833
|
+
}] : [], [T, E]);
|
|
1834
|
+
return /* @__PURE__ */ V("div", {
|
|
1835
|
+
className: s("flex w-full flex-col gap-2", _),
|
|
1836
|
+
children: [/* @__PURE__ */ B(kt, {
|
|
1829
1837
|
message: e,
|
|
1830
|
-
ariaLabel:
|
|
1838
|
+
ariaLabel: u,
|
|
1831
1839
|
isStacked: !0,
|
|
1832
1840
|
hideActionBar: !0,
|
|
1833
|
-
pendingDropFiles:
|
|
1834
|
-
onDropFilesConsumed:
|
|
1835
|
-
onSend:
|
|
1841
|
+
pendingDropFiles: k,
|
|
1842
|
+
onDropFilesConsumed: de,
|
|
1843
|
+
onSend: le,
|
|
1836
1844
|
onUploadAttachment: a,
|
|
1837
|
-
onChange:
|
|
1838
|
-
onAttachmentsChange:
|
|
1839
|
-
removeLabel:
|
|
1840
|
-
retryLabel:
|
|
1845
|
+
onChange: ne,
|
|
1846
|
+
onAttachmentsChange: re,
|
|
1847
|
+
removeLabel: d,
|
|
1848
|
+
retryLabel: f,
|
|
1841
1849
|
className: "max-w-full",
|
|
1842
|
-
prefixAttachments:
|
|
1843
|
-
onRemovePrefixAttachment:
|
|
1844
|
-
validateAttachment:
|
|
1845
|
-
maximumAttachmentsAmount:
|
|
1846
|
-
onAttachmentsLimitExceeded:
|
|
1847
|
-
|
|
1850
|
+
prefixAttachments: M,
|
|
1851
|
+
onRemovePrefixAttachment: ce,
|
|
1852
|
+
validateAttachment: b,
|
|
1853
|
+
maximumAttachmentsAmount: C,
|
|
1854
|
+
onAttachmentsLimitExceeded: w,
|
|
1855
|
+
pendingAttachments: D,
|
|
1856
|
+
onPendingAttachmentsConsumed: ee
|
|
1857
|
+
}), /* @__PURE__ */ V("div", {
|
|
1848
1858
|
className: "flex items-center justify-between",
|
|
1849
|
-
children: [/* @__PURE__ */
|
|
1859
|
+
children: [/* @__PURE__ */ B("div", {
|
|
1850
1860
|
className: "flex",
|
|
1851
|
-
children: !
|
|
1852
|
-
ref:
|
|
1861
|
+
children: !x && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("input", {
|
|
1862
|
+
ref: O,
|
|
1853
1863
|
type: "file",
|
|
1854
1864
|
multiple: !0,
|
|
1855
|
-
accept:
|
|
1865
|
+
accept: S,
|
|
1856
1866
|
className: "sr-only",
|
|
1857
1867
|
"aria-hidden": !0,
|
|
1858
1868
|
tabIndex: -1,
|
|
1859
|
-
onChange:
|
|
1860
|
-
}), /* @__PURE__ */
|
|
1861
|
-
onAttachClick: () =>
|
|
1862
|
-
attachLabel:
|
|
1863
|
-
addMenuTitle:
|
|
1864
|
-
menuTitle:
|
|
1865
|
-
menuCloseLabel:
|
|
1869
|
+
onChange: N
|
|
1870
|
+
}), /* @__PURE__ */ B(Ge, {
|
|
1871
|
+
onAttachClick: () => O.current?.click(),
|
|
1872
|
+
attachLabel: m,
|
|
1873
|
+
addMenuTitle: p,
|
|
1874
|
+
menuTitle: h,
|
|
1875
|
+
menuCloseLabel: g,
|
|
1876
|
+
extraMenuItems: fe
|
|
1866
1877
|
})] })
|
|
1867
|
-
}), /* @__PURE__ */
|
|
1878
|
+
}), /* @__PURE__ */ V("div", {
|
|
1868
1879
|
className: "flex gap-2",
|
|
1869
|
-
children: [/* @__PURE__ */
|
|
1880
|
+
children: [/* @__PURE__ */ B(Be, {
|
|
1870
1881
|
label: o,
|
|
1871
1882
|
onClick: n
|
|
1872
|
-
}), /* @__PURE__ */
|
|
1883
|
+
}), /* @__PURE__ */ B(ze, {
|
|
1873
1884
|
label: c,
|
|
1874
|
-
onClick:
|
|
1875
|
-
disabled: !
|
|
1885
|
+
onClick: ue,
|
|
1886
|
+
disabled: !se
|
|
1876
1887
|
})]
|
|
1877
1888
|
})]
|
|
1878
1889
|
})]
|
|
1879
1890
|
});
|
|
1880
1891
|
};
|
|
1881
1892
|
//#endregion
|
|
1882
|
-
export {
|
|
1893
|
+
export { ge as AttachmentCard, _e as AttachmentGroup, ve as AttachmentTray, U as BottomSheetShell, We as ChatSettingsModal, jt as ConversationInput, Mt as EditMessageInput, be as FileDndOverlay, kt as Input, Le as SendOnEnter, Ce as getAttachmentIcon };
|