@epam/ai-dial-conversation-input 1.1.0-dev.127 → 1.1.0-dev.129
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/BottomSheetShell/BottomSheetShell.d.ts.map +1 -1
- package/components/ChatSettingsModal/ChatSettingsModal.d.ts +1 -1
- package/components/Input/ModelSelectorControl.d.ts +1 -1
- package/components/Input/ModelSelectorControl.d.ts.map +1 -1
- package/components/ModelSelectorSkeleton/ModelSelectorSkeleton.d.ts.map +1 -1
- package/components/VoiceBar/VoiceBar.d.ts.map +1 -1
- package/index.js +351 -352
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { AttachmentErrorReason as e, AttachmentType as t, DeploymentIcon as n, RequestStatus as r, ResponseFormat as i, buildCssVars as a, mergeClasses as o, useIsMobile as s } from "@epam/ai-dial-chat-shared";
|
|
2
|
-
import { BASE_ICON_SIZE as c, Button as l,
|
|
3
|
-
import { IconArrowLeft as M, IconArrowNarrowRight as N, IconCheck as P, IconChevronDown as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
2
|
+
import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, DialRadioGroup as p, DialSearch as m, DialSlider as h, DialTooltip as g, Dropdown as _, ElementSize as v, ErrorText as y, GhostIconButton as b, Highlight as x, Input as S, NeutralButton as C, Popup as w, PopupSize as T, PrimaryButton as E, PrimaryIconButton as D, RadioGroupOrientation as O, Skeleton as k, SkeletonVariant as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as M, IconArrowNarrowRight as N, IconCheck as P, IconChevronDown as F, IconChevronRight as I, IconFile as ee, IconMicrophone as te, IconPaperclip as ne, IconPlayerStopFilled as re, IconPlaystationSquare as ie, IconPlus as ae, IconSettings as oe, IconTool as se, IconX as ce } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as le } from "react-dom";
|
|
5
|
+
import { createElement as ue, memo as de, useCallback as L, useEffect as R, useImperativeHandle as fe, useLayoutEffect as pe, useMemo as z, useRef as B, useState as V } from "react";
|
|
6
6
|
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
7
7
|
import { AttachmentCard as me, AttachmentGroup as he, AttachmentTray as ge, AttachmentTray as _e, FileDndOverlay as ve, MAX_UPLOADS_PER_MINUTE as ye, generateAttachmentId as be, getAttachmentIcon as xe, useClipboardPaste as Se } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
9
|
var Ce = (e, t) => {
|
|
10
|
-
|
|
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
|
};
|
|
@@ -32,7 +32,7 @@ var Ce = (e, t) => {
|
|
|
32
32
|
"--ci-sheet-text": m?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": m?.divider
|
|
34
34
|
});
|
|
35
|
-
return
|
|
35
|
+
return le(/* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
36
36
|
className: o(we.backdrop, "fixed inset-0 z-[55]"),
|
|
37
37
|
style: g,
|
|
38
38
|
onPointerDown: r,
|
|
@@ -51,9 +51,9 @@ var Ce = (e, t) => {
|
|
|
51
51
|
children: [
|
|
52
52
|
i && /* @__PURE__ */ U("div", {
|
|
53
53
|
className: "absolute start-4",
|
|
54
|
-
children: /* @__PURE__ */ U(
|
|
54
|
+
children: /* @__PURE__ */ U(b, {
|
|
55
55
|
icon: /* @__PURE__ */ U(M, {
|
|
56
|
-
size:
|
|
56
|
+
size: d.LG,
|
|
57
57
|
stroke: 1.5,
|
|
58
58
|
className: "rtl:scale-x-[-1]"
|
|
59
59
|
}),
|
|
@@ -67,9 +67,8 @@ var Ce = (e, t) => {
|
|
|
67
67
|
}),
|
|
68
68
|
/* @__PURE__ */ U("div", {
|
|
69
69
|
className: "absolute end-4 m-2",
|
|
70
|
-
children: /* @__PURE__ */ U(
|
|
70
|
+
children: /* @__PURE__ */ U(u, {
|
|
71
71
|
ariaLabel: n,
|
|
72
|
-
size: u.LG,
|
|
73
72
|
onClose: r
|
|
74
73
|
})
|
|
75
74
|
})
|
|
@@ -85,14 +84,14 @@ var Ce = (e, t) => {
|
|
|
85
84
|
await Promise.allSettled(i);
|
|
86
85
|
}, Ee = ({ initialAttachments: n, onUploadAttachment: i, onAttachmentsChange: a, validateAttachment: o, pendingDropFiles: s, onDropFilesConsumed: c, pendingAttachments: l, onPendingAttachmentsConsumed: u, onExpandPastedText: d, maximumAttachmentsAmount: f, baseAttachmentsAmount: p = 0, onAttachmentsLimitExceeded: m }) => {
|
|
87
86
|
let [h, g] = V(n), _ = B(h);
|
|
88
|
-
|
|
87
|
+
R(() => {
|
|
89
88
|
_.current = h;
|
|
90
|
-
}, [h]),
|
|
89
|
+
}, [h]), R(() => () => {
|
|
91
90
|
_.current.forEach((e) => {
|
|
92
91
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
93
92
|
});
|
|
94
93
|
}, []);
|
|
95
|
-
let v =
|
|
94
|
+
let v = L((e) => e.map((e) => {
|
|
96
95
|
let n = e.type.startsWith("image/"), i = e.type.startsWith("audio/"), a = n ? URL.createObjectURL(e) : void 0, o = i ? URL.createObjectURL(e) : void 0;
|
|
97
96
|
return {
|
|
98
97
|
id: be(),
|
|
@@ -105,25 +104,25 @@ var Ce = (e, t) => {
|
|
|
105
104
|
playUrl: o
|
|
106
105
|
};
|
|
107
106
|
}), []), y = B(a);
|
|
108
|
-
|
|
107
|
+
R(() => {
|
|
109
108
|
y.current = a;
|
|
110
109
|
}, [a]);
|
|
111
|
-
let b = B(!0), x =
|
|
110
|
+
let b = B(!0), x = L((e) => {
|
|
112
111
|
g((t) => {
|
|
113
112
|
let n = e(t);
|
|
114
113
|
return n === t ? t : n;
|
|
115
114
|
});
|
|
116
115
|
}, []);
|
|
117
|
-
|
|
116
|
+
R(() => {
|
|
118
117
|
if (b.current) {
|
|
119
118
|
b.current = !1;
|
|
120
119
|
return;
|
|
121
120
|
}
|
|
122
121
|
y.current?.(h);
|
|
123
122
|
}, [h]);
|
|
124
|
-
let S =
|
|
123
|
+
let S = L((e) => {
|
|
125
124
|
g(e);
|
|
126
|
-
}, []), C =
|
|
125
|
+
}, []), C = L(async (t) => {
|
|
127
126
|
if (i) {
|
|
128
127
|
x((e) => e.map((e) => e.id === t.id ? {
|
|
129
128
|
...e,
|
|
@@ -145,7 +144,7 @@ var Ce = (e, t) => {
|
|
|
145
144
|
} : e));
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
|
-
}, [i, x]), w =
|
|
147
|
+
}, [i, x]), w = L((e, t = !0) => {
|
|
149
148
|
let n = new Set(_.current.map((e) => e.id)), i = e.filter((e) => !n.has(e.id));
|
|
150
149
|
if (i.length !== 0) {
|
|
151
150
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -177,20 +176,20 @@ var Ce = (e, t) => {
|
|
|
177
176
|
C,
|
|
178
177
|
o
|
|
179
178
|
]);
|
|
180
|
-
|
|
179
|
+
R(() => {
|
|
181
180
|
s.length !== 0 && (w(v(s)), c?.());
|
|
182
181
|
}, [
|
|
183
182
|
w,
|
|
184
183
|
v,
|
|
185
184
|
c,
|
|
186
185
|
s
|
|
187
|
-
]),
|
|
186
|
+
]), R(() => {
|
|
188
187
|
l.length !== 0 && (w(l, !1), u?.());
|
|
189
188
|
}, [
|
|
190
189
|
w,
|
|
191
190
|
u,
|
|
192
191
|
l
|
|
193
|
-
]),
|
|
192
|
+
]), R(() => {
|
|
194
193
|
if (!o) return;
|
|
195
194
|
let t = !1, n = [], i = _.current.map((i) => {
|
|
196
195
|
if (i.status === r.Loading) return i;
|
|
@@ -217,7 +216,7 @@ var Ce = (e, t) => {
|
|
|
217
216
|
x,
|
|
218
217
|
C
|
|
219
218
|
]);
|
|
220
|
-
let T =
|
|
219
|
+
let T = L((e) => {
|
|
221
220
|
x((t) => {
|
|
222
221
|
let n = t.find((t) => t.id === e);
|
|
223
222
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -229,11 +228,11 @@ var Ce = (e, t) => {
|
|
|
229
228
|
addAttachments: w,
|
|
230
229
|
resetAttachments: S,
|
|
231
230
|
handleRemove: T,
|
|
232
|
-
handleRetry:
|
|
231
|
+
handleRetry: L((e) => {
|
|
233
232
|
let t = h.find((t) => t.id === e);
|
|
234
233
|
t && C(t);
|
|
235
234
|
}, [h, C]),
|
|
236
|
-
handleExpand:
|
|
235
|
+
handleExpand: L(async (e) => {
|
|
237
236
|
let n = h.find((t) => t.id === e);
|
|
238
237
|
if (!n || n.type !== t.Pasted) return;
|
|
239
238
|
let r = await n.file.text();
|
|
@@ -247,7 +246,7 @@ var Ce = (e, t) => {
|
|
|
247
246
|
};
|
|
248
247
|
}, De = (e, t) => {
|
|
249
248
|
let [n, r] = V(e), [i, a] = V(!1), [o, s] = V(0);
|
|
250
|
-
return
|
|
249
|
+
return R(() => {
|
|
251
250
|
if (e) {
|
|
252
251
|
r(!0), a(!1), s((e) => e + 1);
|
|
253
252
|
return;
|
|
@@ -266,12 +265,12 @@ var Ce = (e, t) => {
|
|
|
266
265
|
}, Oe = (e, t) => !e.slice(0, t).includes("\n"), ke = (e, t) => !e.slice(t).includes("\n"), Ae = (e) => {
|
|
267
266
|
let t = B(e);
|
|
268
267
|
t.current = e;
|
|
269
|
-
let n = B(-1), r = B(""), i =
|
|
268
|
+
let n = B(-1), r = B(""), i = L((e, i, a) => {
|
|
270
269
|
let o = t.current;
|
|
271
270
|
return !o || o.length === 0 ? null : e === "up" ? !Oe(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 || !ke(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
272
|
-
}, []), a =
|
|
271
|
+
}, []), a = L(() => {
|
|
273
272
|
n.current = -1, r.current = "";
|
|
274
|
-
}, []), o =
|
|
273
|
+
}, []), o = L(() => {
|
|
275
274
|
n.current = -1, r.current = "";
|
|
276
275
|
}, []);
|
|
277
276
|
return z(() => ({
|
|
@@ -285,11 +284,11 @@ var Ce = (e, t) => {
|
|
|
285
284
|
]);
|
|
286
285
|
}, je = ({ messageProp: e, messageRevision: t }) => {
|
|
287
286
|
let [n, r] = V(e), i = B(null), a = B(0), [o, s] = V(!1);
|
|
288
|
-
return
|
|
287
|
+
return R(() => {
|
|
289
288
|
r(e);
|
|
290
|
-
}, [e, t]),
|
|
289
|
+
}, [e, t]), R(() => {
|
|
291
290
|
i.current && (a.current = i.current.offsetHeight);
|
|
292
|
-
}, []),
|
|
291
|
+
}, []), pe(() => {
|
|
293
292
|
if (!i.current || a.current === 0) return;
|
|
294
293
|
let e = i.current.offsetHeight > a.current;
|
|
295
294
|
s((t) => e ? !0 : n === "" ? !1 : t);
|
|
@@ -308,11 +307,11 @@ var Ce = (e, t) => {
|
|
|
308
307
|
], Pe = () => Ne.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Fe = ({ onAttachAudio: e }) => {
|
|
309
308
|
let [t, n] = V("idle"), [r, i] = V(null), [a, o] = V(0), s = B(null), c = B(null), l = B(null), u = B(null), d = B([]), f = B(""), p = B(null), m = B(e);
|
|
310
309
|
m.current = e;
|
|
311
|
-
let h =
|
|
310
|
+
let h = L(() => {
|
|
312
311
|
p.current != null && (clearInterval(p.current), p.current = null);
|
|
313
|
-
}, []), g =
|
|
312
|
+
}, []), g = L(() => {
|
|
314
313
|
h(), s.current &&= (s.current.getTracks().forEach((e) => e.stop()), null), c.current &&= (c.current.close(), null), l.current = null, u.current = null;
|
|
315
|
-
}, [h]), _ =
|
|
314
|
+
}, [h]), _ = L(() => {
|
|
316
315
|
(async () => {
|
|
317
316
|
try {
|
|
318
317
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -333,17 +332,17 @@ var Ce = (e, t) => {
|
|
|
333
332
|
i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
|
|
334
333
|
}
|
|
335
334
|
})();
|
|
336
|
-
}, []), v =
|
|
335
|
+
}, []), v = L(() => {
|
|
337
336
|
let e = u.current;
|
|
338
337
|
!e || e.state !== "recording" || (h(), e.onstop = () => {
|
|
339
338
|
let e = f.current || "audio/webm", t = new Blob(d.current, { type: e }), r = e.split(";")[0], a = r.split("/")[1] ?? "webm", s = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -1), c = new File([t], `voice-${s}.${a}`, { type: r });
|
|
340
339
|
m.current(c), g(), o(0), i(null), n("idle");
|
|
341
340
|
}, e.stop());
|
|
342
|
-
}, [h, g]), y =
|
|
341
|
+
}, [h, g]), y = L(() => {
|
|
343
342
|
let e = u.current;
|
|
344
343
|
e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), g(), o(0), i(null), n("idle");
|
|
345
344
|
}, [g]);
|
|
346
|
-
return
|
|
345
|
+
return R(() => () => {
|
|
347
346
|
g();
|
|
348
347
|
}, [g]), {
|
|
349
348
|
state: t,
|
|
@@ -403,7 +402,7 @@ var Ce = (e, t) => {
|
|
|
403
402
|
});
|
|
404
403
|
}, ze = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
405
404
|
let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
|
|
406
|
-
|
|
405
|
+
R(() => {
|
|
407
406
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
408
407
|
}, [
|
|
409
408
|
o,
|
|
@@ -420,7 +419,7 @@ var Ce = (e, t) => {
|
|
|
420
419
|
setResponseFormat: c,
|
|
421
420
|
setSystemPrompt: u,
|
|
422
421
|
setTemperature: f,
|
|
423
|
-
handleSubmit:
|
|
422
|
+
handleSubmit: L(() => {
|
|
424
423
|
if (!m) return;
|
|
425
424
|
let t = {};
|
|
426
425
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -434,21 +433,21 @@ var Ce = (e, t) => {
|
|
|
434
433
|
a
|
|
435
434
|
])
|
|
436
435
|
};
|
|
437
|
-
}, Be = { label: "_label_14i7c_1" }, Ve = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel:
|
|
436
|
+
}, Be = { label: "_label_14i7c_1" }, Ve = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
|
|
438
437
|
"Precise",
|
|
439
438
|
"Neutral",
|
|
440
439
|
"Creative"
|
|
441
|
-
], temperatureHint:
|
|
442
|
-
let
|
|
440
|
+
], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: C }) => {
|
|
441
|
+
let w = a({ "--csf-label-text": C?.labelText }), T = o(x, Be.label, "gap-1");
|
|
443
442
|
return /* @__PURE__ */ W("div", {
|
|
444
443
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
445
|
-
style:
|
|
444
|
+
style: w,
|
|
446
445
|
children: [
|
|
447
|
-
e.responseFormat && /* @__PURE__ */ U(
|
|
446
|
+
e.responseFormat && /* @__PURE__ */ U(p, {
|
|
448
447
|
fieldTitle: u,
|
|
449
|
-
labelClassName:
|
|
448
|
+
labelClassName: T,
|
|
450
449
|
elementId: "response-format",
|
|
451
|
-
orientation:
|
|
450
|
+
orientation: O.Column,
|
|
452
451
|
activeRadioButton: t ?? i.Markdown,
|
|
453
452
|
labelDescription: d,
|
|
454
453
|
radioButtons: [{
|
|
@@ -456,36 +455,36 @@ var Ce = (e, t) => {
|
|
|
456
455
|
name: f
|
|
457
456
|
}, {
|
|
458
457
|
id: i.PlainText,
|
|
459
|
-
name:
|
|
458
|
+
name: m
|
|
460
459
|
}],
|
|
461
460
|
onChange: (e) => s(e)
|
|
462
461
|
}),
|
|
463
|
-
e.systemPrompt && /* @__PURE__ */ U(
|
|
462
|
+
e.systemPrompt && /* @__PURE__ */ U(S, {
|
|
464
463
|
value: n,
|
|
465
|
-
placeholder:
|
|
464
|
+
placeholder: _,
|
|
466
465
|
labelProps: {
|
|
467
|
-
className:
|
|
468
|
-
label:
|
|
466
|
+
className: T,
|
|
467
|
+
label: g
|
|
469
468
|
},
|
|
470
469
|
onChange: (e) => c(e ?? "")
|
|
471
470
|
}),
|
|
472
|
-
e.temperature && /* @__PURE__ */ U(
|
|
471
|
+
e.temperature && /* @__PURE__ */ U(h, {
|
|
473
472
|
labelProps: {
|
|
474
|
-
label:
|
|
475
|
-
className:
|
|
476
|
-
caption:
|
|
473
|
+
label: v,
|
|
474
|
+
className: T,
|
|
475
|
+
caption: b
|
|
477
476
|
},
|
|
478
477
|
value: r,
|
|
479
478
|
min: 0,
|
|
480
479
|
max: 1,
|
|
481
480
|
step: .1,
|
|
482
|
-
labels:
|
|
481
|
+
labels: y,
|
|
483
482
|
onChange: l
|
|
484
483
|
})
|
|
485
484
|
]
|
|
486
485
|
});
|
|
487
|
-
}, He = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel:
|
|
488
|
-
let { responseFormat: T, systemPrompt:
|
|
486
|
+
}, He = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: _, systemPromptLabel: v, systemPromptTooltip: y, temperatureLabel: b, temperatureLabels: x, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
|
|
487
|
+
let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: M, handleSubmit: N } = ze({
|
|
489
488
|
isOpen: e,
|
|
490
489
|
features: s,
|
|
491
490
|
initialResponseFormat: c,
|
|
@@ -505,27 +504,27 @@ var Ce = (e, t) => {
|
|
|
505
504
|
children: [/* @__PURE__ */ U(Ve, {
|
|
506
505
|
features: s,
|
|
507
506
|
responseFormat: T,
|
|
508
|
-
systemPrompt:
|
|
509
|
-
temperature:
|
|
507
|
+
systemPrompt: D,
|
|
508
|
+
temperature: O,
|
|
510
509
|
onResponseFormatChange: A,
|
|
511
510
|
onSystemPromptChange: j,
|
|
512
511
|
onTemperatureChange: M,
|
|
513
512
|
responseFormatLabel: p,
|
|
514
513
|
responseFormatHint: m,
|
|
515
514
|
responseFormatMarkdownLabel: h,
|
|
516
|
-
responseFormatPlainTextLabel:
|
|
517
|
-
systemPromptLabel:
|
|
518
|
-
systemPromptTooltip:
|
|
519
|
-
temperatureLabel:
|
|
520
|
-
temperatureLabels:
|
|
515
|
+
responseFormatPlainTextLabel: _,
|
|
516
|
+
systemPromptLabel: v,
|
|
517
|
+
systemPromptTooltip: y,
|
|
518
|
+
temperatureLabel: b,
|
|
519
|
+
temperatureLabels: x,
|
|
521
520
|
temperatureHint: S
|
|
522
521
|
}), /* @__PURE__ */ U("div", {
|
|
523
522
|
className: o("px-6 py-4 mobile:pb-8"),
|
|
524
|
-
children: /* @__PURE__ */ U(
|
|
523
|
+
children: /* @__PURE__ */ U(g, {
|
|
525
524
|
tooltip: w,
|
|
526
525
|
hideTooltip: k || !w,
|
|
527
526
|
triggerClassName: "w-full",
|
|
528
|
-
children: /* @__PURE__ */ U(
|
|
527
|
+
children: /* @__PURE__ */ U(E, {
|
|
529
528
|
label: C,
|
|
530
529
|
onClick: N,
|
|
531
530
|
disabled: !k,
|
|
@@ -534,8 +533,8 @@ var Ce = (e, t) => {
|
|
|
534
533
|
})
|
|
535
534
|
})]
|
|
536
535
|
});
|
|
537
|
-
}, Ue = { modal: "_modal_od073_1" }, 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:
|
|
538
|
-
let { responseFormat: b, systemPrompt:
|
|
536
|
+
}, Ue = { modal: "_modal_od073_1" }, 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: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = Ue.modal }) => {
|
|
537
|
+
let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = ze({
|
|
539
538
|
features: e,
|
|
540
539
|
initialResponseFormat: t,
|
|
541
540
|
initialSystemPrompt: n,
|
|
@@ -543,31 +542,31 @@ var Ce = (e, t) => {
|
|
|
543
542
|
onSave: i,
|
|
544
543
|
onClose: a
|
|
545
544
|
});
|
|
546
|
-
return /* @__PURE__ */ U(
|
|
545
|
+
return /* @__PURE__ */ U(w, {
|
|
547
546
|
open: !0,
|
|
548
547
|
header: o,
|
|
549
|
-
size:
|
|
548
|
+
size: T.Sm,
|
|
550
549
|
onClose: a,
|
|
551
550
|
className: y,
|
|
552
551
|
footer: /* @__PURE__ */ U("div", {
|
|
553
552
|
className: "flex justify-end px-6 py-4",
|
|
554
|
-
children: /* @__PURE__ */ U(
|
|
553
|
+
children: /* @__PURE__ */ U(g, {
|
|
555
554
|
tooltip: v,
|
|
556
|
-
hideTooltip:
|
|
557
|
-
children: /* @__PURE__ */ U(
|
|
555
|
+
hideTooltip: C || !v,
|
|
556
|
+
children: /* @__PURE__ */ U(E, {
|
|
558
557
|
label: _,
|
|
559
558
|
onClick: A,
|
|
560
|
-
disabled: !
|
|
559
|
+
disabled: !C
|
|
561
560
|
})
|
|
562
561
|
})
|
|
563
562
|
}),
|
|
564
563
|
children: /* @__PURE__ */ U(Ve, {
|
|
565
564
|
features: e,
|
|
566
565
|
responseFormat: b,
|
|
567
|
-
systemPrompt:
|
|
568
|
-
temperature:
|
|
569
|
-
onResponseFormatChange:
|
|
570
|
-
onSystemPromptChange:
|
|
566
|
+
systemPrompt: x,
|
|
567
|
+
temperature: S,
|
|
568
|
+
onResponseFormatChange: D,
|
|
569
|
+
onSystemPromptChange: O,
|
|
571
570
|
onTemperatureChange: k,
|
|
572
571
|
responseFormatLabel: s,
|
|
573
572
|
responseFormatHint: c,
|
|
@@ -577,11 +576,11 @@ var Ce = (e, t) => {
|
|
|
577
576
|
systemPromptTooltip: f,
|
|
578
577
|
temperatureLabel: p,
|
|
579
578
|
temperatureLabels: m,
|
|
580
|
-
temperatureHint:
|
|
579
|
+
temperatureHint: h
|
|
581
580
|
})
|
|
582
581
|
});
|
|
583
582
|
};
|
|
584
|
-
|
|
583
|
+
de(We);
|
|
585
584
|
var Ge = {
|
|
586
585
|
icon: "_icon_1fv6z_1",
|
|
587
586
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
@@ -630,16 +629,16 @@ var Ge = {
|
|
|
630
629
|
selectedToolIcon: "_selectedToolIcon_r268y_1",
|
|
631
630
|
toolIcon: "_toolIcon_r268y_5",
|
|
632
631
|
chevronIcon: "_chevronIcon_r268y_9"
|
|
633
|
-
}, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style:
|
|
632
|
+
}, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: h, toolsMenuItems: g = [], onToolToggle: y, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", colors: C }) => {
|
|
634
633
|
let w = s(), [T, E] = V(!1), [D, O] = V(!1), [k, A] = V(!1), j = z(() => a({
|
|
635
|
-
"--aab-selected-tool-icon":
|
|
636
|
-
"--aab-tool-icon":
|
|
637
|
-
"--aab-chevron-icon":
|
|
634
|
+
"--aab-selected-tool-icon": C?.selectedToolIcon,
|
|
635
|
+
"--aab-tool-icon": C?.toolIcon,
|
|
636
|
+
"--aab-chevron-icon": C?.chevronIcon
|
|
638
637
|
}), [
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
]), M =
|
|
638
|
+
C?.selectedToolIcon,
|
|
639
|
+
C?.toolIcon,
|
|
640
|
+
C?.chevronIcon
|
|
641
|
+
]), M = g.length > 0 && y != null, N = z(() => g.map((e) => ({
|
|
643
642
|
key: e.id,
|
|
644
643
|
label: /* @__PURE__ */ W("span", {
|
|
645
644
|
className: "flex flex-1 items-center gap-2",
|
|
@@ -658,33 +657,33 @@ var Ge = {
|
|
|
658
657
|
className: o("flex items-center", K.toolIcon),
|
|
659
658
|
children: e.icon
|
|
660
659
|
}),
|
|
661
|
-
onClick: () =>
|
|
660
|
+
onClick: () => y?.(e.id)
|
|
662
661
|
})), [
|
|
663
|
-
|
|
664
|
-
|
|
662
|
+
g,
|
|
663
|
+
y,
|
|
665
664
|
j
|
|
666
|
-
]),
|
|
665
|
+
]), F = z(() => [
|
|
667
666
|
...e == null ? [] : [{
|
|
668
667
|
key: "attach",
|
|
669
668
|
label: t,
|
|
670
|
-
icon: /* @__PURE__ */ U(
|
|
669
|
+
icon: /* @__PURE__ */ U(ne, {
|
|
671
670
|
size: c,
|
|
672
671
|
"aria-hidden": !0
|
|
673
672
|
}),
|
|
674
673
|
onClick: e
|
|
675
674
|
}],
|
|
676
|
-
...
|
|
675
|
+
...h ?? [],
|
|
677
676
|
...M ? [{
|
|
678
677
|
key: "tools",
|
|
679
|
-
label:
|
|
680
|
-
icon: /* @__PURE__ */ U(
|
|
678
|
+
label: x,
|
|
679
|
+
icon: /* @__PURE__ */ U(se, {
|
|
681
680
|
size: c,
|
|
682
681
|
"aria-hidden": !0
|
|
683
682
|
}),
|
|
684
683
|
onClick: w ? () => {
|
|
685
684
|
A(!0), E(!1);
|
|
686
685
|
} : () => void 0,
|
|
687
|
-
...w ? { iconAfter: /* @__PURE__ */ U(
|
|
686
|
+
...w ? { iconAfter: /* @__PURE__ */ U(I, {
|
|
688
687
|
size: c,
|
|
689
688
|
stroke: 1.5,
|
|
690
689
|
style: j,
|
|
@@ -692,14 +691,14 @@ var Ge = {
|
|
|
692
691
|
"aria-hidden": !0
|
|
693
692
|
}) } : { children: N }
|
|
694
693
|
}] : [],
|
|
695
|
-
...
|
|
694
|
+
...m == null ? [] : [{
|
|
696
695
|
key: "chat-settings",
|
|
697
|
-
label:
|
|
698
|
-
icon: /* @__PURE__ */ U(
|
|
696
|
+
label: m.menuItemLabel ?? "Chat settings",
|
|
697
|
+
icon: /* @__PURE__ */ U(oe, {
|
|
699
698
|
size: c,
|
|
700
699
|
"aria-hidden": !0
|
|
701
700
|
}),
|
|
702
|
-
iconAfter: w ? /* @__PURE__ */ U(
|
|
701
|
+
iconAfter: w ? /* @__PURE__ */ U(I, {
|
|
703
702
|
size: c,
|
|
704
703
|
stroke: 1.5,
|
|
705
704
|
style: j,
|
|
@@ -711,24 +710,24 @@ var Ge = {
|
|
|
711
710
|
], [
|
|
712
711
|
t,
|
|
713
712
|
e,
|
|
713
|
+
m,
|
|
714
714
|
h,
|
|
715
|
-
g,
|
|
716
715
|
w,
|
|
717
716
|
M,
|
|
718
|
-
|
|
717
|
+
x,
|
|
719
718
|
N,
|
|
720
719
|
j
|
|
721
720
|
]);
|
|
722
|
-
return
|
|
723
|
-
/* @__PURE__ */ U(
|
|
724
|
-
icon: /* @__PURE__ */ U(
|
|
725
|
-
size:
|
|
721
|
+
return F.length === 0 ? null : /* @__PURE__ */ U(H, { children: w ? /* @__PURE__ */ W(H, { children: [
|
|
722
|
+
/* @__PURE__ */ U(b, {
|
|
723
|
+
icon: /* @__PURE__ */ U(ae, {
|
|
724
|
+
size: d.LG,
|
|
726
725
|
"aria-hidden": !0
|
|
727
726
|
}),
|
|
728
727
|
"aria-label": n,
|
|
729
|
-
size:
|
|
728
|
+
size: v.Large,
|
|
730
729
|
tooltipProps: { tooltip: n },
|
|
731
|
-
disabled:
|
|
730
|
+
disabled: p,
|
|
732
731
|
onClick: () => E(!0)
|
|
733
732
|
}),
|
|
734
733
|
/* @__PURE__ */ U(Re, {
|
|
@@ -736,8 +735,8 @@ var Ge = {
|
|
|
736
735
|
title: r,
|
|
737
736
|
closeLabel: l,
|
|
738
737
|
onClose: () => E(!1),
|
|
739
|
-
style:
|
|
740
|
-
items:
|
|
738
|
+
style: u,
|
|
739
|
+
items: F,
|
|
741
740
|
className: "pb-4",
|
|
742
741
|
btnTextClassName: "flex-1"
|
|
743
742
|
}),
|
|
@@ -746,74 +745,74 @@ var Ge = {
|
|
|
746
745
|
onBack: () => {
|
|
747
746
|
A(!1), E(!0);
|
|
748
747
|
},
|
|
749
|
-
backLabel:
|
|
748
|
+
backLabel: S,
|
|
750
749
|
onClose: () => A(!1),
|
|
751
750
|
closeLabel: l,
|
|
752
|
-
style:
|
|
753
|
-
title:
|
|
754
|
-
items:
|
|
755
|
-
onToolToggle:
|
|
751
|
+
style: u,
|
|
752
|
+
title: x,
|
|
753
|
+
items: g,
|
|
754
|
+
onToolToggle: y
|
|
756
755
|
}),
|
|
757
|
-
|
|
756
|
+
m != null && /* @__PURE__ */ U(He, {
|
|
758
757
|
isOpen: D,
|
|
759
758
|
onBack: () => {
|
|
760
759
|
O(!1), E(!0);
|
|
761
760
|
},
|
|
762
|
-
backLabel:
|
|
761
|
+
backLabel: m.backLabel ?? "Back",
|
|
763
762
|
onClose: () => O(!1),
|
|
764
763
|
closeLabel: l,
|
|
765
|
-
style:
|
|
766
|
-
features:
|
|
767
|
-
initialResponseFormat:
|
|
768
|
-
initialSystemPrompt:
|
|
769
|
-
initialTemperature:
|
|
770
|
-
onSave:
|
|
771
|
-
title:
|
|
772
|
-
responseFormatLabel:
|
|
773
|
-
responseFormatHint:
|
|
774
|
-
responseFormatMarkdownLabel:
|
|
775
|
-
responseFormatPlainTextLabel:
|
|
776
|
-
systemPromptLabel:
|
|
777
|
-
systemPromptTooltip:
|
|
778
|
-
temperatureLabel:
|
|
779
|
-
temperatureLabels:
|
|
780
|
-
temperatureHint:
|
|
781
|
-
saveLabel:
|
|
782
|
-
saveDisabledTooltip:
|
|
764
|
+
style: u,
|
|
765
|
+
features: m.features,
|
|
766
|
+
initialResponseFormat: m.responseFormat ?? i.Markdown,
|
|
767
|
+
initialSystemPrompt: m.systemPrompt,
|
|
768
|
+
initialTemperature: m.temperature,
|
|
769
|
+
onSave: m.onSave,
|
|
770
|
+
title: m.title,
|
|
771
|
+
responseFormatLabel: m.responseFormatLabel,
|
|
772
|
+
responseFormatHint: m.responseFormatHint,
|
|
773
|
+
responseFormatMarkdownLabel: m.responseFormatMarkdownLabel,
|
|
774
|
+
responseFormatPlainTextLabel: m.responseFormatPlainTextLabel,
|
|
775
|
+
systemPromptLabel: m.systemPromptLabel,
|
|
776
|
+
systemPromptTooltip: m.systemPromptTooltip,
|
|
777
|
+
temperatureLabel: m.temperatureLabel,
|
|
778
|
+
temperatureLabels: m.temperatureLabels,
|
|
779
|
+
temperatureHint: m.temperatureHint,
|
|
780
|
+
saveLabel: m.saveLabel,
|
|
781
|
+
saveDisabledTooltip: m.saveDisabledTooltip
|
|
783
782
|
})
|
|
784
|
-
] }) : /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
783
|
+
] }) : /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(_, {
|
|
785
784
|
matchReferenceWidth: !1,
|
|
786
785
|
placement: "bottom-start",
|
|
787
|
-
listClassName:
|
|
788
|
-
items:
|
|
789
|
-
children: /* @__PURE__ */ U(
|
|
790
|
-
icon: /* @__PURE__ */ U(
|
|
791
|
-
size:
|
|
786
|
+
listClassName: f,
|
|
787
|
+
items: F,
|
|
788
|
+
children: /* @__PURE__ */ U(b, {
|
|
789
|
+
icon: /* @__PURE__ */ U(ae, {
|
|
790
|
+
size: d.LG,
|
|
792
791
|
"aria-hidden": !0
|
|
793
792
|
}),
|
|
794
793
|
"aria-label": n,
|
|
795
794
|
tooltipProps: { tooltip: n },
|
|
796
|
-
disabled:
|
|
795
|
+
disabled: p
|
|
797
796
|
})
|
|
798
|
-
}),
|
|
799
|
-
features:
|
|
800
|
-
initialResponseFormat:
|
|
801
|
-
initialSystemPrompt:
|
|
802
|
-
initialTemperature:
|
|
803
|
-
onSave:
|
|
797
|
+
}), m != null && D && /* @__PURE__ */ U(We, {
|
|
798
|
+
features: m.features,
|
|
799
|
+
initialResponseFormat: m.responseFormat ?? i.Markdown,
|
|
800
|
+
initialSystemPrompt: m.systemPrompt,
|
|
801
|
+
initialTemperature: m.temperature,
|
|
802
|
+
onSave: m.onSave,
|
|
804
803
|
onClose: () => O(!1),
|
|
805
|
-
title:
|
|
806
|
-
responseFormatLabel:
|
|
807
|
-
responseFormatHint:
|
|
808
|
-
responseFormatMarkdownLabel:
|
|
809
|
-
responseFormatPlainTextLabel:
|
|
810
|
-
systemPromptLabel:
|
|
811
|
-
systemPromptTooltip:
|
|
812
|
-
temperatureLabel:
|
|
813
|
-
temperatureLabels:
|
|
814
|
-
temperatureHint:
|
|
815
|
-
saveLabel:
|
|
816
|
-
saveDisabledTooltip:
|
|
804
|
+
title: m.title,
|
|
805
|
+
responseFormatLabel: m.responseFormatLabel,
|
|
806
|
+
responseFormatHint: m.responseFormatHint,
|
|
807
|
+
responseFormatMarkdownLabel: m.responseFormatMarkdownLabel,
|
|
808
|
+
responseFormatPlainTextLabel: m.responseFormatPlainTextLabel,
|
|
809
|
+
systemPromptLabel: m.systemPromptLabel,
|
|
810
|
+
systemPromptTooltip: m.systemPromptTooltip,
|
|
811
|
+
temperatureLabel: m.temperatureLabel,
|
|
812
|
+
temperatureLabels: m.temperatureLabels,
|
|
813
|
+
temperatureHint: m.temperatureHint,
|
|
814
|
+
saveLabel: m.saveLabel,
|
|
815
|
+
saveDisabledTooltip: m.saveDisabledTooltip
|
|
817
816
|
})] }) });
|
|
818
817
|
}, q = {
|
|
819
818
|
chip: "_chip_1gu87_1",
|
|
@@ -832,7 +831,7 @@ var Ge = {
|
|
|
832
831
|
"--ci-chip-close-hover": l?.chipCloseHover
|
|
833
832
|
});
|
|
834
833
|
if (n) {
|
|
835
|
-
let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ U(
|
|
834
|
+
let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ U(se, {
|
|
836
835
|
size: c,
|
|
837
836
|
"aria-hidden": !0
|
|
838
837
|
}), n = e ? u[0].label : r(u.length);
|
|
@@ -872,7 +871,7 @@ var Ge = {
|
|
|
872
871
|
onClick: () => t(e.id),
|
|
873
872
|
className: o(q.chipClose, "flex items-center rounded p-0.5 transition-colors"),
|
|
874
873
|
"aria-label": i(e.label),
|
|
875
|
-
children: /* @__PURE__ */ U(
|
|
874
|
+
children: /* @__PURE__ */ U(ce, {
|
|
876
875
|
size: 12,
|
|
877
876
|
"aria-hidden": !0
|
|
878
877
|
})
|
|
@@ -893,29 +892,29 @@ var Ge = {
|
|
|
893
892
|
timer: "_timer_fbvnl_9",
|
|
894
893
|
recordingDot: "_recordingDot_fbvnl_25",
|
|
895
894
|
"recording-pulse": "_recording-pulse_fbvnl_1"
|
|
896
|
-
}, Ze = 3, X = 4, Z = 200, Qe = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`, $e = ({ state: e, analyserNodeRef: t, elapsedSeconds: n, errorMessage: r, onStop: i, onDiscard: a, stopLabel: s = "Stop recording", discardLabel: c = "Discard recording", timerLabel: l = "Recording time", style:
|
|
897
|
-
let p = B(null),
|
|
895
|
+
}, Ze = 3, X = 4, Z = 200, Qe = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`, $e = ({ state: e, analyserNodeRef: t, elapsedSeconds: n, errorMessage: r, onStop: i, onDiscard: a, stopLabel: s = "Stop recording", discardLabel: c = "Discard recording", timerLabel: l = "Recording time", style: u, className: f }) => {
|
|
896
|
+
let p = B(null), m = B(new Float32Array(Z)), h = B(0), g = B(0), _ = e === Me.Recording, v = e === Me.Error, x = L((e) => {
|
|
898
897
|
let t = e.getContext("2d");
|
|
899
898
|
if (!t) return;
|
|
900
899
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
901
900
|
let { width: n, height: r } = e;
|
|
902
901
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
903
|
-
let i = Math.min(Math.max(1, Math.floor(n / X)), Z - 1), a =
|
|
902
|
+
let i = Math.min(Math.max(1, Math.floor(n / X)), Z - 1), a = h.current, o = g.current;
|
|
904
903
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
905
904
|
for (let e = 0; e <= i; e++) {
|
|
906
|
-
let n = ((a - i + e) % Z + Z) % Z, o =
|
|
905
|
+
let n = ((a - i + e) % Z + Z) % Z, o = m.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
907
906
|
t.fillRect(e * X, (r - c) / 2, Ze, c);
|
|
908
907
|
}
|
|
909
908
|
t.restore();
|
|
910
909
|
}, []);
|
|
911
|
-
|
|
912
|
-
if (!
|
|
910
|
+
R(() => {
|
|
911
|
+
if (!_) return;
|
|
913
912
|
let e = p.current;
|
|
914
913
|
if (!e) return;
|
|
915
|
-
|
|
914
|
+
m.current.fill(0), h.current = 0, g.current = 0;
|
|
916
915
|
let n, r = () => {
|
|
917
|
-
if (
|
|
918
|
-
|
|
916
|
+
if (g.current += 1, g.current >= X) {
|
|
917
|
+
g.current -= X;
|
|
919
918
|
let e = t.current;
|
|
920
919
|
if (e) {
|
|
921
920
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -925,38 +924,38 @@ var Ge = {
|
|
|
925
924
|
let r = (t[e] - 128) / 128;
|
|
926
925
|
n += r * r;
|
|
927
926
|
}
|
|
928
|
-
|
|
927
|
+
m.current[h.current % Z] = Math.sqrt(n / t.length), h.current++;
|
|
929
928
|
}
|
|
930
929
|
}
|
|
931
|
-
|
|
930
|
+
x(e), n = requestAnimationFrame(r);
|
|
932
931
|
};
|
|
933
932
|
return n = requestAnimationFrame(r), () => {
|
|
934
933
|
cancelAnimationFrame(n);
|
|
935
934
|
};
|
|
936
935
|
}, [
|
|
937
|
-
|
|
936
|
+
_,
|
|
938
937
|
t,
|
|
939
|
-
|
|
940
|
-
]),
|
|
938
|
+
x
|
|
939
|
+
]), R(() => {
|
|
941
940
|
let e = p.current;
|
|
942
941
|
if (!e) return;
|
|
943
942
|
let t = new ResizeObserver(() => {
|
|
944
|
-
|
|
943
|
+
x(e);
|
|
945
944
|
});
|
|
946
945
|
return t.observe(e), () => t.disconnect();
|
|
947
|
-
}, [
|
|
948
|
-
let
|
|
946
|
+
}, [x]);
|
|
947
|
+
let S = /* @__PURE__ */ W("div", {
|
|
949
948
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
950
|
-
children: [/* @__PURE__ */ U(
|
|
951
|
-
icon: /* @__PURE__ */ U(
|
|
952
|
-
size:
|
|
949
|
+
children: [/* @__PURE__ */ U(b, {
|
|
950
|
+
icon: /* @__PURE__ */ U(ce, {
|
|
951
|
+
size: d.LG,
|
|
953
952
|
"aria-hidden": !0
|
|
954
953
|
}),
|
|
955
954
|
"aria-label": c,
|
|
956
955
|
onClick: a
|
|
957
|
-
}),
|
|
958
|
-
icon: /* @__PURE__ */ U(
|
|
959
|
-
size:
|
|
956
|
+
}), _ && /* @__PURE__ */ U(D, {
|
|
957
|
+
icon: /* @__PURE__ */ U(re, {
|
|
958
|
+
size: d.LG,
|
|
960
959
|
"aria-hidden": !0
|
|
961
960
|
}),
|
|
962
961
|
onClick: () => i?.(),
|
|
@@ -966,11 +965,11 @@ var Ge = {
|
|
|
966
965
|
return /* @__PURE__ */ W("div", {
|
|
967
966
|
className: f,
|
|
968
967
|
children: [/* @__PURE__ */ W("div", {
|
|
969
|
-
style:
|
|
970
|
-
className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2",
|
|
968
|
+
style: u,
|
|
969
|
+
className: o(Y.wrapper, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 shadow-md desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", v && Xe.wrapperError),
|
|
971
970
|
children: [/* @__PURE__ */ W("div", {
|
|
972
971
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
973
|
-
children: [
|
|
972
|
+
children: [_ && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("span", {
|
|
974
973
|
className: o(Xe.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
975
974
|
"aria-hidden": !0
|
|
976
975
|
}), /* @__PURE__ */ U("span", {
|
|
@@ -982,34 +981,34 @@ var Ge = {
|
|
|
982
981
|
height: 32,
|
|
983
982
|
className: o(Xe.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
984
983
|
})]
|
|
985
|
-
}),
|
|
986
|
-
}),
|
|
984
|
+
}), S]
|
|
985
|
+
}), v && r && /* @__PURE__ */ U(y, {
|
|
987
986
|
text: r,
|
|
988
987
|
className: "mt-1 px-1"
|
|
989
988
|
})]
|
|
990
989
|
});
|
|
991
|
-
}, et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(
|
|
990
|
+
}, et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(D, {
|
|
992
991
|
"aria-label": n,
|
|
993
992
|
onClick: () => e?.(),
|
|
994
993
|
disabled: t,
|
|
995
994
|
"aria-hidden": r,
|
|
996
995
|
icon: /* @__PURE__ */ U(N, {
|
|
997
|
-
size:
|
|
996
|
+
size: d.LG,
|
|
998
997
|
className: "rtl:scale-x-[-1]"
|
|
999
998
|
})
|
|
1000
999
|
}), tt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(j, {
|
|
1001
|
-
icon: /* @__PURE__ */ U(
|
|
1000
|
+
icon: /* @__PURE__ */ U(ie, { size: d.LG }),
|
|
1002
1001
|
onClick: () => e?.(),
|
|
1003
1002
|
"aria-label": t
|
|
1004
|
-
}), nt = ({ size: e = 20 }) => /* @__PURE__ */ U(
|
|
1005
|
-
variant:
|
|
1003
|
+
}), nt = ({ size: e = 20 }) => /* @__PURE__ */ U(k, {
|
|
1004
|
+
variant: A.Circular,
|
|
1006
1005
|
width: e,
|
|
1007
1006
|
height: e,
|
|
1008
1007
|
active: !0
|
|
1009
1008
|
}), rt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
|
|
1010
1009
|
className: "flex min-w-0 flex-1 items-center",
|
|
1011
|
-
children: [/* @__PURE__ */ U(
|
|
1012
|
-
variant:
|
|
1010
|
+
children: [/* @__PURE__ */ U(k, {
|
|
1011
|
+
variant: A.Text,
|
|
1013
1012
|
width: "100%",
|
|
1014
1013
|
height: 16,
|
|
1015
1014
|
active: !0
|
|
@@ -1038,13 +1037,13 @@ var Ge = {
|
|
|
1038
1037
|
selectedItem: "_selectedItem_ibyso_5",
|
|
1039
1038
|
selectedItemCheck: "_selectedItemCheck_ibyso_9"
|
|
1040
1039
|
}, lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = ct.searchHeader, selectedItemClassName: s = ct.selectedItem, selectedItemCheckClassName: c = ct.selectedItemCheck, colors: l }) => {
|
|
1041
|
-
let [
|
|
1040
|
+
let [u, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = z(() => h ? /* @__PURE__ */ U(nt, { size: d.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG), [h, p]), _ = p?.displayName ?? p?.id;
|
|
1042
1041
|
return {
|
|
1043
|
-
selectorIcon:
|
|
1044
|
-
selectorAriaLabel:
|
|
1045
|
-
selectedLabel:
|
|
1042
|
+
selectorIcon: g,
|
|
1043
|
+
selectorAriaLabel: _ ? `${r?.ariaLabel ?? "Select model"}: ${_}` : r?.ariaLabel ?? "Select model",
|
|
1044
|
+
selectedLabel: _,
|
|
1046
1045
|
menuItems: z(() => {
|
|
1047
|
-
if (
|
|
1046
|
+
if (h) return Array.from({ length: 7 }, (e, t) => ({
|
|
1048
1047
|
key: `__loading-${t}`,
|
|
1049
1048
|
icon: /* @__PURE__ */ U(nt, {}),
|
|
1050
1049
|
label: /* @__PURE__ */ U(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
@@ -1058,19 +1057,19 @@ var Ge = {
|
|
|
1058
1057
|
disabled: !0
|
|
1059
1058
|
}] : [];
|
|
1060
1059
|
}
|
|
1061
|
-
return ot(e,
|
|
1060
|
+
return ot(e, u).map((e) => {
|
|
1062
1061
|
let r = e.id === t;
|
|
1063
1062
|
return {
|
|
1064
1063
|
key: e.id,
|
|
1065
1064
|
label: /* @__PURE__ */ W("span", {
|
|
1066
1065
|
className: "flex w-full items-center justify-between gap-2",
|
|
1067
1066
|
style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
|
|
1068
|
-
children: [/* @__PURE__ */ U(
|
|
1067
|
+
children: [/* @__PURE__ */ U(x, {
|
|
1069
1068
|
text: at(e),
|
|
1070
|
-
query:
|
|
1069
|
+
query: u,
|
|
1071
1070
|
maxLines: 1
|
|
1072
1071
|
}), r && /* @__PURE__ */ U(P, {
|
|
1073
|
-
size:
|
|
1072
|
+
size: d.SM,
|
|
1074
1073
|
stroke: 2,
|
|
1075
1074
|
className: c,
|
|
1076
1075
|
"aria-hidden": !0
|
|
@@ -1083,8 +1082,8 @@ var Ge = {
|
|
|
1083
1082
|
});
|
|
1084
1083
|
}, [
|
|
1085
1084
|
e,
|
|
1086
|
-
|
|
1087
|
-
|
|
1085
|
+
h,
|
|
1086
|
+
u,
|
|
1088
1087
|
t,
|
|
1089
1088
|
r,
|
|
1090
1089
|
n,
|
|
@@ -1092,20 +1091,20 @@ var Ge = {
|
|
|
1092
1091
|
c,
|
|
1093
1092
|
l?.selectedItemCheck
|
|
1094
1093
|
]),
|
|
1095
|
-
menuHeader: z(() => !
|
|
1094
|
+
menuHeader: z(() => !h && e && e.length > 0 ? /* @__PURE__ */ U("div", {
|
|
1096
1095
|
style: a({ "--ms-search-header-bg": l?.searchHeaderBackground }),
|
|
1097
1096
|
className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1098
|
-
children: /* @__PURE__ */ U(
|
|
1099
|
-
value:
|
|
1097
|
+
children: /* @__PURE__ */ U(m, {
|
|
1098
|
+
value: u,
|
|
1100
1099
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1101
|
-
size:
|
|
1100
|
+
size: v.Small,
|
|
1102
1101
|
wrapperClassName: "border-0",
|
|
1103
1102
|
onChange: f
|
|
1104
1103
|
})
|
|
1105
1104
|
}) : void 0, [
|
|
1106
1105
|
e,
|
|
1107
|
-
|
|
1108
|
-
|
|
1106
|
+
h,
|
|
1107
|
+
u,
|
|
1109
1108
|
r,
|
|
1110
1109
|
i,
|
|
1111
1110
|
l?.searchHeaderBackground
|
|
@@ -1114,7 +1113,7 @@ var Ge = {
|
|
|
1114
1113
|
e || f("");
|
|
1115
1114
|
}
|
|
1116
1115
|
};
|
|
1117
|
-
}, ut = typeof window < "u" ?
|
|
1116
|
+
}, ut = typeof window < "u" ? pe : R;
|
|
1118
1117
|
function dt(e) {
|
|
1119
1118
|
if (e !== void 0) switch (typeof e) {
|
|
1120
1119
|
case "number": return e;
|
|
@@ -1166,7 +1165,7 @@ function pt(e) {
|
|
|
1166
1165
|
});
|
|
1167
1166
|
return ut(() => {
|
|
1168
1167
|
t.current = e;
|
|
1169
|
-
}, [e]),
|
|
1168
|
+
}, [e]), L((e) => t.current?.(e), [t]);
|
|
1170
1169
|
}
|
|
1171
1170
|
var mt = null;
|
|
1172
1171
|
function ht(e = !1) {
|
|
@@ -1314,7 +1313,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1314
1313
|
containerSize: p,
|
|
1315
1314
|
itemSize: s
|
|
1316
1315
|
});
|
|
1317
|
-
|
|
1316
|
+
pe(() => {
|
|
1318
1317
|
if (typeof c == "function") {
|
|
1319
1318
|
let e = f.current;
|
|
1320
1319
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1331,7 +1330,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1331
1330
|
itemCount: a,
|
|
1332
1331
|
itemProps: o,
|
|
1333
1332
|
itemSize: m
|
|
1334
|
-
}), g =
|
|
1333
|
+
}), g = L((e) => h.get(e), [h]), [_, v] = V(() => bt({
|
|
1335
1334
|
cachedBounds: h,
|
|
1336
1335
|
containerScrollOffset: 0,
|
|
1337
1336
|
containerSize: p,
|
|
@@ -1342,7 +1341,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1342
1341
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1343
1342
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1344
1343
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1345
|
-
}, C =
|
|
1344
|
+
}, C = L(() => vt({
|
|
1346
1345
|
cachedBounds: h,
|
|
1347
1346
|
itemCount: a,
|
|
1348
1347
|
itemSize: m
|
|
@@ -1350,7 +1349,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1350
1349
|
h,
|
|
1351
1350
|
a,
|
|
1352
1351
|
m
|
|
1353
|
-
]), w =
|
|
1352
|
+
]), w = L((t) => bt({
|
|
1354
1353
|
cachedBounds: h,
|
|
1355
1354
|
containerScrollOffset: gt({
|
|
1356
1355
|
containerElement: e,
|
|
@@ -1449,7 +1448,7 @@ function Et(e) {
|
|
|
1449
1448
|
}
|
|
1450
1449
|
var Dt = "data-react-window-index";
|
|
1451
1450
|
function Ot({ 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 }) {
|
|
1452
|
-
let m = wt(u), h = z(() =>
|
|
1451
|
+
let m = wt(u), h = z(() => de(s, Tt), [s]), [g, _] = V(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Ct({
|
|
1453
1452
|
containerElement: g,
|
|
1454
1453
|
containerStyle: f,
|
|
1455
1454
|
defaultContainerSize: n,
|
|
@@ -1460,7 +1459,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1460
1459
|
onResize: i,
|
|
1461
1460
|
overscanCount: o
|
|
1462
1461
|
});
|
|
1463
|
-
|
|
1462
|
+
fe(r, () => ({
|
|
1464
1463
|
get element() {
|
|
1465
1464
|
return g;
|
|
1466
1465
|
},
|
|
@@ -1489,7 +1488,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1489
1488
|
l,
|
|
1490
1489
|
S,
|
|
1491
1490
|
w
|
|
1492
|
-
]),
|
|
1491
|
+
]), R(() => {
|
|
1493
1492
|
S >= 0 && w >= 0 && a && a({
|
|
1494
1493
|
startIndex: C,
|
|
1495
1494
|
stopIndex: T
|
|
@@ -1508,7 +1507,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1508
1507
|
let e = [];
|
|
1509
1508
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1510
1509
|
let n = y(t);
|
|
1511
|
-
e.push(/* @__PURE__ */
|
|
1510
|
+
e.push(/* @__PURE__ */ ue(h, {
|
|
1512
1511
|
...m,
|
|
1513
1512
|
ariaAttributes: {
|
|
1514
1513
|
"aria-posinset": t + 1,
|
|
@@ -1543,7 +1542,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1543
1542
|
zIndex: -1
|
|
1544
1543
|
}
|
|
1545
1544
|
});
|
|
1546
|
-
return
|
|
1545
|
+
return ue(d, {
|
|
1547
1546
|
role: "list",
|
|
1548
1547
|
...p,
|
|
1549
1548
|
className: t,
|
|
@@ -1564,7 +1563,7 @@ var kt = {
|
|
|
1564
1563
|
checkIcon: "_checkIcon_s5khb_19",
|
|
1565
1564
|
stateLabel: "_stateLabel_s5khb_23"
|
|
1566
1565
|
}, At = 44, jt = 8, Mt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1567
|
-
let
|
|
1566
|
+
let u = r[e], f = st(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
|
|
1568
1567
|
return /* @__PURE__ */ U("div", {
|
|
1569
1568
|
style: t,
|
|
1570
1569
|
...n,
|
|
@@ -1577,34 +1576,34 @@ var kt = {
|
|
|
1577
1576
|
}),
|
|
1578
1577
|
label: /* @__PURE__ */ W("span", {
|
|
1579
1578
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1580
|
-
children: [/* @__PURE__ */ U(
|
|
1581
|
-
text:
|
|
1579
|
+
children: [/* @__PURE__ */ U(x, {
|
|
1580
|
+
text: u.displayName ?? u.id,
|
|
1582
1581
|
query: s,
|
|
1583
1582
|
maxLines: 1,
|
|
1584
1583
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1585
1584
|
}), p && /* @__PURE__ */ U(P, {
|
|
1586
|
-
size:
|
|
1585
|
+
size: d.SM,
|
|
1587
1586
|
className: kt.checkIcon,
|
|
1588
1587
|
"aria-hidden": !0
|
|
1589
1588
|
})]
|
|
1590
1589
|
}),
|
|
1591
|
-
onClick: () => c(
|
|
1590
|
+
onClick: () => c(u.id)
|
|
1592
1591
|
})
|
|
1593
1592
|
});
|
|
1594
|
-
}, Nt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName:
|
|
1595
|
-
let [
|
|
1596
|
-
|
|
1597
|
-
e ||
|
|
1593
|
+
}, Nt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
|
|
1594
|
+
let [y, b] = V("");
|
|
1595
|
+
R(() => {
|
|
1596
|
+
e || b("");
|
|
1598
1597
|
}, [e]);
|
|
1599
|
-
let
|
|
1598
|
+
let x = s && s.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? ot(s, y) : [], T = (e) => {
|
|
1600
1599
|
l(e), i();
|
|
1601
1600
|
}, E = a({
|
|
1602
|
-
"--ci-sheet-divider":
|
|
1603
|
-
"--ci-sheet-text":
|
|
1604
|
-
"--ci-sheet-item-hover":
|
|
1605
|
-
"--ci-sheet-item-active":
|
|
1606
|
-
"--ci-sheet-icon":
|
|
1607
|
-
"--ci-check-icon":
|
|
1601
|
+
"--ci-sheet-divider": _?.divider,
|
|
1602
|
+
"--ci-sheet-text": _?.itemText,
|
|
1603
|
+
"--ci-sheet-item-hover": _?.itemHoverBg,
|
|
1604
|
+
"--ci-sheet-item-active": _?.itemActiveBg,
|
|
1605
|
+
"--ci-sheet-icon": _?.itemIcon,
|
|
1606
|
+
"--ci-check-icon": _?.checkIcon
|
|
1608
1607
|
});
|
|
1609
1608
|
return /* @__PURE__ */ U(G, {
|
|
1610
1609
|
isOpen: e,
|
|
@@ -1612,23 +1611,23 @@ var kt = {
|
|
|
1612
1611
|
closeLabel: n,
|
|
1613
1612
|
onClose: i,
|
|
1614
1613
|
style: p,
|
|
1615
|
-
titleClassName:
|
|
1614
|
+
titleClassName: h,
|
|
1616
1615
|
className: "max-h-[80dvh]",
|
|
1617
|
-
colors:
|
|
1616
|
+
colors: _?.shell,
|
|
1618
1617
|
children: /* @__PURE__ */ W("div", {
|
|
1619
1618
|
className: "contents",
|
|
1620
1619
|
style: E,
|
|
1621
|
-
children: [
|
|
1620
|
+
children: [x && !S && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
1622
1621
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1623
|
-
children: /* @__PURE__ */ U(
|
|
1624
|
-
value:
|
|
1622
|
+
children: /* @__PURE__ */ U(m, {
|
|
1623
|
+
value: y,
|
|
1625
1624
|
placeholder: r,
|
|
1626
|
-
size:
|
|
1627
|
-
onChange:
|
|
1625
|
+
size: v.Standard,
|
|
1626
|
+
onChange: b
|
|
1628
1627
|
})
|
|
1629
|
-
}), /* @__PURE__ */ U("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }),
|
|
1628
|
+
}), /* @__PURE__ */ U("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ U(it, { loadingLabel: u }) : C ? /* @__PURE__ */ U("div", {
|
|
1630
1629
|
role: "list",
|
|
1631
|
-
className: o(kt.stateLabel,
|
|
1630
|
+
className: o(kt.stateLabel, g, "px-4 py-4"),
|
|
1632
1631
|
children: C
|
|
1633
1632
|
}) : /* @__PURE__ */ U(Ot, {
|
|
1634
1633
|
role: "list",
|
|
@@ -1640,52 +1639,52 @@ var kt = {
|
|
|
1640
1639
|
rowProps: {
|
|
1641
1640
|
items: w,
|
|
1642
1641
|
selectedDeploymentId: c,
|
|
1643
|
-
labelClassName:
|
|
1644
|
-
query:
|
|
1642
|
+
labelClassName: g,
|
|
1643
|
+
query: y,
|
|
1645
1644
|
onSelect: T
|
|
1646
1645
|
}
|
|
1647
1646
|
})]
|
|
1648
1647
|
})
|
|
1649
1648
|
});
|
|
1650
|
-
}, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: s = !1, isDisabled: c = !1, style: l, modelPickerOverlay:
|
|
1651
|
-
let [
|
|
1649
|
+
}, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: s = !1, isDisabled: c = !1, style: l, modelPickerOverlay: u, isPickerOpen: p, onPickerToggle: m, onPickerOpenChange: h }) => {
|
|
1650
|
+
let [y, x] = V(!1), { selectorIcon: S, selectorAriaLabel: C, selectedLabel: w, menuItems: T, menuHeader: E, onOpenChange: D } = lt({
|
|
1652
1651
|
deployments: e,
|
|
1653
1652
|
selectedDeploymentId: t,
|
|
1654
1653
|
onDeploymentChange: n,
|
|
1655
1654
|
modelSelectorLabels: r
|
|
1656
1655
|
});
|
|
1657
1656
|
if (!e) return null;
|
|
1658
|
-
let O = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, k = /* @__PURE__ */ U(
|
|
1659
|
-
size:
|
|
1657
|
+
let O = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, k = /* @__PURE__ */ U(F, {
|
|
1658
|
+
size: d.SM,
|
|
1660
1659
|
className: Y.modelSelectorCaret,
|
|
1661
1660
|
"aria-hidden": !0
|
|
1662
1661
|
});
|
|
1663
|
-
return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(
|
|
1662
|
+
return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(g, {
|
|
1664
1663
|
tooltip: w,
|
|
1665
|
-
children: /* @__PURE__ */ U(
|
|
1664
|
+
children: /* @__PURE__ */ U(b, {
|
|
1666
1665
|
icon: /* @__PURE__ */ W("div", {
|
|
1667
1666
|
className: "flex items-center gap-1",
|
|
1668
|
-
children: [
|
|
1667
|
+
children: [S, k]
|
|
1669
1668
|
}),
|
|
1670
|
-
"aria-label":
|
|
1669
|
+
"aria-label": C,
|
|
1671
1670
|
onClick: () => {
|
|
1672
|
-
c ||
|
|
1671
|
+
c || x(!0);
|
|
1673
1672
|
},
|
|
1674
1673
|
className: o(Y.modelSelectorButton, O)
|
|
1675
1674
|
})
|
|
1676
|
-
}),
|
|
1677
|
-
isOpen:
|
|
1675
|
+
}), u ? /* @__PURE__ */ U(G, {
|
|
1676
|
+
isOpen: y,
|
|
1678
1677
|
title: r?.ariaLabel ?? "Select model",
|
|
1679
1678
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1680
|
-
onClose: () =>
|
|
1679
|
+
onClose: () => x(!1),
|
|
1681
1680
|
style: l,
|
|
1682
|
-
children:
|
|
1681
|
+
children: u(() => x(!1))
|
|
1683
1682
|
}) : /* @__PURE__ */ U(Nt, {
|
|
1684
|
-
isOpen:
|
|
1683
|
+
isOpen: y,
|
|
1685
1684
|
title: r?.ariaLabel ?? "Select model",
|
|
1686
1685
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1687
1686
|
searchPlaceholder: r?.searchPlaceholder ?? "Search",
|
|
1688
|
-
onClose: () =>
|
|
1687
|
+
onClose: () => x(!1),
|
|
1689
1688
|
deployments: e,
|
|
1690
1689
|
selectedDeploymentId: t,
|
|
1691
1690
|
onSelect: (e) => n?.(e),
|
|
@@ -1693,49 +1692,49 @@ var kt = {
|
|
|
1693
1692
|
errorLabel: r?.error,
|
|
1694
1693
|
emptyLabel: r?.empty,
|
|
1695
1694
|
style: l
|
|
1696
|
-
})] }) :
|
|
1695
|
+
})] }) : u ? /* @__PURE__ */ U(_, {
|
|
1697
1696
|
placement: "top-end",
|
|
1698
1697
|
matchReferenceWidth: !1,
|
|
1699
|
-
open:
|
|
1700
|
-
onOpenChange:
|
|
1698
|
+
open: p,
|
|
1699
|
+
onOpenChange: h,
|
|
1701
1700
|
trigger: [],
|
|
1702
1701
|
outsideClosable: !0,
|
|
1703
|
-
renderOverlay: () =>
|
|
1702
|
+
renderOverlay: () => u(() => h?.(!1)),
|
|
1704
1703
|
listClassName: "cp-dropdown-overlay !w-[320px]",
|
|
1705
|
-
children: /* @__PURE__ */ U(
|
|
1704
|
+
children: /* @__PURE__ */ U(g, {
|
|
1706
1705
|
tooltip: w,
|
|
1707
1706
|
children: /* @__PURE__ */ W("button", {
|
|
1708
1707
|
type: "button",
|
|
1709
|
-
"aria-label":
|
|
1708
|
+
"aria-label": C,
|
|
1710
1709
|
className: o("flex items-center justify-center gap-1 rounded-full p-2", Y.modelSelectorButton, s || i || c ? O : void 0, (s || c) && Y.modelSelectorButtonDisabled),
|
|
1711
1710
|
onClick: () => {
|
|
1712
|
-
!s && !i && !c &&
|
|
1711
|
+
!s && !i && !c && m?.();
|
|
1713
1712
|
},
|
|
1714
|
-
children: [
|
|
1713
|
+
children: [S, k]
|
|
1715
1714
|
})
|
|
1716
1715
|
})
|
|
1717
1716
|
}) : /* @__PURE__ */ U("div", {
|
|
1718
1717
|
className: o(c && O),
|
|
1719
1718
|
"aria-disabled": c || void 0,
|
|
1720
|
-
children: /* @__PURE__ */ U(
|
|
1719
|
+
children: /* @__PURE__ */ U(g, {
|
|
1721
1720
|
tooltip: w,
|
|
1722
|
-
children: /* @__PURE__ */ U(
|
|
1723
|
-
icon:
|
|
1724
|
-
ariaLabel:
|
|
1721
|
+
children: /* @__PURE__ */ U(f, {
|
|
1722
|
+
icon: S,
|
|
1723
|
+
ariaLabel: C,
|
|
1725
1724
|
items: T,
|
|
1726
1725
|
menuHeader: E,
|
|
1727
1726
|
placement: "bottom-end",
|
|
1728
1727
|
matchReferenceWidth: !1,
|
|
1729
1728
|
listClassName: "cp-dropdown-overlay !w-[240px] !max-h-80",
|
|
1730
1729
|
onOpenChange: c ? void 0 : D,
|
|
1731
|
-
size:
|
|
1730
|
+
size: v.Standard,
|
|
1732
1731
|
caretIcon: k,
|
|
1733
1732
|
iconClassName: s || c ? O : void 0,
|
|
1734
1733
|
buttonClassName: o("bg-transparent", Y.modelSelectorButton, (s || c) && O && Y.modelSelectorButtonDisabled)
|
|
1735
1734
|
})
|
|
1736
1735
|
})
|
|
1737
1736
|
});
|
|
1738
|
-
}, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange:
|
|
1737
|
+
}, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, timerAriaLabel: D, colors: O, typography: k, className: A, pendingDropFiles: M = [], onDropFilesConsumed: N, pendingAttachments: P = [], onPendingAttachmentsConsumed: F, pasteTextThreshold: I = 4e3, deployments: ne, selectedDeploymentId: re, onDeploymentChange: ie, modelSelectorLabels: ae, initialAttachments: oe = [], isStacked: se = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: de, isInputDisabled: R = !1, isModelSelectorDisabled: fe = !1, isSendDisabled: pe = !1, isAudioMessageSupported: me = !1, sendOnEnter: he = Ie.Enter, prefixAttachments: ge = [], onRemovePrefixAttachment: ve, chatSettings: ye, toolsMenuItems: be, onToolToggle: xe, toolsMenuTitle: Ce, toolsBackLabel: we, toolsChipLabels: G, autoFocus: Te = !1, messageHistory: Oe, onDialFileSystemClick: ke, dialFileSystemLabel: Me, validateAttachment: Ne, onAttachmentClick: Pe, modelPickerOverlay: Le, maximumAttachmentsAmount: Re, onAttachmentsLimitExceeded: ze, isAttachmentsEnabled: Be = !0, usageLimitsSlot: Ve, onMessageTooLong: He }) => {
|
|
1739
1738
|
let Ue = s(), [We, Ge] = V(!1), Ke = Ae(Oe), K = z(() => a({
|
|
1740
1739
|
"--ci-bg": O?.background,
|
|
1741
1740
|
"--ci-text": O?.text,
|
|
@@ -1752,7 +1751,7 @@ var kt = {
|
|
|
1752
1751
|
}), [O]), q = z(() => ke ? [{
|
|
1753
1752
|
key: "dial-fs",
|
|
1754
1753
|
label: Me ?? "DIAL file system",
|
|
1755
|
-
icon: /* @__PURE__ */ U(
|
|
1754
|
+
icon: /* @__PURE__ */ U(ee, {
|
|
1756
1755
|
size: c,
|
|
1757
1756
|
"aria-hidden": !0
|
|
1758
1757
|
}),
|
|
@@ -1761,41 +1760,41 @@ var kt = {
|
|
|
1761
1760
|
messageProp: e,
|
|
1762
1761
|
messageRevision: t
|
|
1763
1762
|
}), { attachments: X, buildAttachments: Z, addAttachments: Qe, resetAttachments: nt, handleRemove: rt, handleRetry: it, handleExpand: at, hasBlockedAttachments: ot } = Ee({
|
|
1764
|
-
initialAttachments:
|
|
1763
|
+
initialAttachments: oe,
|
|
1765
1764
|
onUploadAttachment: r,
|
|
1766
1765
|
onAttachmentsChange: f,
|
|
1767
1766
|
validateAttachment: Ne,
|
|
1768
1767
|
pendingDropFiles: M,
|
|
1769
1768
|
onDropFilesConsumed: N,
|
|
1770
1769
|
pendingAttachments: P,
|
|
1771
|
-
onPendingAttachmentsConsumed:
|
|
1772
|
-
onExpandPastedText:
|
|
1770
|
+
onPendingAttachmentsConsumed: F,
|
|
1771
|
+
onExpandPastedText: L((e) => {
|
|
1773
1772
|
Je((t) => t ? `${t}\n${e}` : e);
|
|
1774
1773
|
}, [Je]),
|
|
1775
1774
|
maximumAttachmentsAmount: Re,
|
|
1776
1775
|
baseAttachmentsAmount: ge.length,
|
|
1777
1776
|
onAttachmentsLimitExceeded: ze
|
|
1778
|
-
}), { state: st, analyserNodeRef: ct, elapsedSeconds: lt, errorMessage: ut, startRecording: dt, stopRecording: ft, discardRecording: pt } = Fe({ onAttachAudio:
|
|
1777
|
+
}), { state: st, analyserNodeRef: ct, elapsedSeconds: lt, errorMessage: ut, startRecording: dt, stopRecording: ft, discardRecording: pt } = Fe({ onAttachAudio: L((e) => {
|
|
1779
1778
|
Qe(Z([e]));
|
|
1780
|
-
}, [Qe, Z]) }), mt = B(null), ht = B(null), { handlePaste: gt } = Se(Qe, Be ?
|
|
1779
|
+
}, [Qe, Z]) }), mt = B(null), ht = B(null), { handlePaste: gt } = Se(Qe, Be ? I : Infinity), Q = L((e) => {
|
|
1781
1780
|
if (!Be) {
|
|
1782
1781
|
let t = e.clipboardData.getData("text/plain");
|
|
1783
|
-
t.length >=
|
|
1782
|
+
t.length >= I && He?.(t.length, I);
|
|
1784
1783
|
}
|
|
1785
1784
|
gt(e);
|
|
1786
1785
|
}, [
|
|
1787
1786
|
Be,
|
|
1788
|
-
|
|
1787
|
+
I,
|
|
1789
1788
|
He,
|
|
1790
1789
|
gt
|
|
1791
|
-
]), _t = J.trim().length > 0 || X.length > 0, vt = _t && !ot && !
|
|
1790
|
+
]), _t = J.trim().length > 0 || X.length > 0, vt = _t && !ot && !pe, { shouldRender: yt, isExiting: bt, instanceKey: xt } = De(!l && _t, Ft), St = (be?.some((e) => e.isSelected) ?? !1) && xe != null, $ = se || J.includes("\n") || Ze || St, Ct = ne === void 0 || re != null, wt = z(() => me && !bt && !l, [
|
|
1792
1791
|
me,
|
|
1793
1792
|
bt,
|
|
1794
1793
|
l
|
|
1795
1794
|
]), Tt = async () => {
|
|
1796
|
-
if (
|
|
1797
|
-
if (!Be && J.length >=
|
|
1798
|
-
He?.(J.length,
|
|
1795
|
+
if (pe) return;
|
|
1796
|
+
if (!Be && J.length >= I) {
|
|
1797
|
+
He?.(J.length, I);
|
|
1799
1798
|
return;
|
|
1800
1799
|
}
|
|
1801
1800
|
let e = J, t = X;
|
|
@@ -1808,14 +1807,14 @@ var kt = {
|
|
|
1808
1807
|
Je(e), nt(t);
|
|
1809
1808
|
}
|
|
1810
1809
|
}, Et = (e) => {
|
|
1811
|
-
if (!e.nativeEvent.isComposing && !
|
|
1810
|
+
if (!e.nativeEvent.isComposing && !R && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1812
1811
|
let t = e.currentTarget.selectionStart ?? 0, n = Ke.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
|
|
1813
1812
|
if (n !== null) {
|
|
1814
1813
|
e.preventDefault(), Je(n);
|
|
1815
1814
|
return;
|
|
1816
1815
|
}
|
|
1817
1816
|
}
|
|
1818
|
-
e.key === "Enter" && (he === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && vt && Ct && !
|
|
1817
|
+
e.key === "Enter" && (he === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && vt && Ct && !R && Tt());
|
|
1819
1818
|
}, Dt = (e) => {
|
|
1820
1819
|
let t = Array.from(e.target.files ?? []);
|
|
1821
1820
|
if (t.length === 0) return;
|
|
@@ -1841,19 +1840,19 @@ var kt = {
|
|
|
1841
1840
|
autoFocus: Te,
|
|
1842
1841
|
value: J,
|
|
1843
1842
|
onChange: (e) => {
|
|
1844
|
-
Je(e.target.value), Ke.notifyChange(),
|
|
1843
|
+
Je(e.target.value), Ke.notifyChange(), u?.(e.target.value);
|
|
1845
1844
|
},
|
|
1846
1845
|
onKeyDown: Et,
|
|
1847
1846
|
onPaste: Q,
|
|
1848
1847
|
placeholder: p,
|
|
1849
1848
|
"aria-label": m,
|
|
1850
|
-
disabled:
|
|
1849
|
+
disabled: R,
|
|
1851
1850
|
rows: 1
|
|
1852
1851
|
});
|
|
1853
1852
|
return /* @__PURE__ */ W("div", {
|
|
1854
1853
|
ref: ht,
|
|
1855
1854
|
style: K,
|
|
1856
|
-
className: o(Y.wrapper,
|
|
1855
|
+
className: o(Y.wrapper, R && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", X.length > 6 ? "py-3 ps-3" : "p-3", A),
|
|
1857
1856
|
children: [(ge.length > 0 || X.length > 0) && /* @__PURE__ */ U(_e, {
|
|
1858
1857
|
attachments: [...ge, ...X],
|
|
1859
1858
|
onRemove: (e) => {
|
|
@@ -1869,10 +1868,10 @@ var kt = {
|
|
|
1869
1868
|
let t = [...ge, ...X].find((t) => t.id === e);
|
|
1870
1869
|
t != null && Pe(t);
|
|
1871
1870
|
}
|
|
1872
|
-
}),
|
|
1871
|
+
}), ue ? $ && Ot : /* @__PURE__ */ W("div", {
|
|
1873
1872
|
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1874
1873
|
children: [
|
|
1875
|
-
!
|
|
1874
|
+
!ce && /* @__PURE__ */ W("div", {
|
|
1876
1875
|
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1877
1876
|
children: [/* @__PURE__ */ U("input", {
|
|
1878
1877
|
ref: mt,
|
|
@@ -1884,13 +1883,13 @@ var kt = {
|
|
|
1884
1883
|
tabIndex: -1,
|
|
1885
1884
|
onChange: Dt
|
|
1886
1885
|
}), /* @__PURE__ */ U(qe, {
|
|
1887
|
-
onAttachClick:
|
|
1886
|
+
onAttachClick: le ? void 0 : () => mt.current?.click(),
|
|
1888
1887
|
attachLabel: h,
|
|
1889
1888
|
addMenuTitle: _,
|
|
1890
1889
|
menuTitle: v,
|
|
1891
1890
|
menuCloseLabel: y,
|
|
1892
1891
|
style: K,
|
|
1893
|
-
isDisabled:
|
|
1892
|
+
isDisabled: R,
|
|
1894
1893
|
chatSettings: ye,
|
|
1895
1894
|
extraMenuItems: q,
|
|
1896
1895
|
toolsMenuItems: be,
|
|
@@ -1915,20 +1914,20 @@ var kt = {
|
|
|
1915
1914
|
}),
|
|
1916
1915
|
/* @__PURE__ */ W("div", {
|
|
1917
1916
|
className: o("flex flex-shrink-0 items-center gap-2", $ && St ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1918
|
-
children: [
|
|
1917
|
+
children: [de ? de({
|
|
1919
1918
|
canSend: vt,
|
|
1920
1919
|
onSend: Tt
|
|
1921
1920
|
}) : /* @__PURE__ */ W(H, { children: [
|
|
1922
1921
|
Ve,
|
|
1923
1922
|
/* @__PURE__ */ U(Pt, {
|
|
1924
|
-
deployments:
|
|
1925
|
-
selectedDeploymentId:
|
|
1926
|
-
onDeploymentChange:
|
|
1927
|
-
modelSelectorLabels:
|
|
1923
|
+
deployments: ne,
|
|
1924
|
+
selectedDeploymentId: re,
|
|
1925
|
+
onDeploymentChange: ie,
|
|
1926
|
+
modelSelectorLabels: ae,
|
|
1928
1927
|
isStreaming: l,
|
|
1929
1928
|
isMobile: Ue,
|
|
1930
|
-
isInputDisabled:
|
|
1931
|
-
isDisabled:
|
|
1929
|
+
isInputDisabled: R,
|
|
1930
|
+
isDisabled: fe,
|
|
1932
1931
|
style: K,
|
|
1933
1932
|
modelPickerOverlay: Le,
|
|
1934
1933
|
isPickerOpen: We,
|
|
@@ -1940,19 +1939,19 @@ var kt = {
|
|
|
1940
1939
|
ariaLabel: C
|
|
1941
1940
|
}) : !l && yt && /* @__PURE__ */ U(et, {
|
|
1942
1941
|
onSend: Tt,
|
|
1943
|
-
isDisabled: !Ct || ot ||
|
|
1942
|
+
isDisabled: !Ct || ot || pe,
|
|
1944
1943
|
ariaLabel: S,
|
|
1945
1944
|
isExiting: bt
|
|
1946
1945
|
}, xt)
|
|
1947
1946
|
] }), wt && /* @__PURE__ */ U(j, {
|
|
1948
|
-
icon: /* @__PURE__ */ U(
|
|
1949
|
-
size:
|
|
1947
|
+
icon: /* @__PURE__ */ U(te, {
|
|
1948
|
+
size: d.LG,
|
|
1950
1949
|
"aria-hidden": !0
|
|
1951
1950
|
}),
|
|
1952
1951
|
"aria-label": w,
|
|
1953
1952
|
className: "size-8 flex-shrink-0",
|
|
1954
1953
|
onClick: dt,
|
|
1955
|
-
disabled:
|
|
1954
|
+
disabled: R || l
|
|
1956
1955
|
})]
|
|
1957
1956
|
})
|
|
1958
1957
|
]
|
|
@@ -1979,35 +1978,35 @@ var kt = {
|
|
|
1979
1978
|
})
|
|
1980
1979
|
})]
|
|
1981
1980
|
});
|
|
1982
|
-
}, zt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "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, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept:
|
|
1983
|
-
let
|
|
1984
|
-
|
|
1985
|
-
v?.length && (
|
|
1981
|
+
}, zt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "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, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: M, pasteTextThreshold: N, onMessageTooLong: P }) => {
|
|
1982
|
+
let F = B(null), [I, te] = V([]);
|
|
1983
|
+
R(() => {
|
|
1984
|
+
v?.length && (te(v), y?.());
|
|
1986
1985
|
}, [v, y]);
|
|
1987
|
-
let [
|
|
1988
|
-
|
|
1989
|
-
},
|
|
1990
|
-
i(e,
|
|
1991
|
-
}, [
|
|
1992
|
-
if (
|
|
1993
|
-
if (!x &&
|
|
1994
|
-
P?.(
|
|
1986
|
+
let [ne, re] = V(e ?? ""), [ie, ae] = V([]), [oe, se] = V(t), ce = ie.some((e) => e.status === r.Loading || e.status === r.Error), le = (ne.trim().length > 0 || ie.length > 0 || oe.length > 0) && !ce, ue = (e) => {
|
|
1987
|
+
se((t) => t.filter((t) => t.id !== e));
|
|
1988
|
+
}, de = L((e, t) => {
|
|
1989
|
+
i(e, oe, t);
|
|
1990
|
+
}, [oe, i]), fe = () => {
|
|
1991
|
+
if (le) {
|
|
1992
|
+
if (!x && ne.length >= (N ?? 4e3)) {
|
|
1993
|
+
P?.(ne.length, N ?? 4e3);
|
|
1995
1994
|
return;
|
|
1996
1995
|
}
|
|
1997
|
-
|
|
1996
|
+
de(ne, ie);
|
|
1998
1997
|
}
|
|
1999
|
-
},
|
|
1998
|
+
}, pe = L(() => te([]), []), me = L((e) => {
|
|
2000
1999
|
let t = Array.from(e.target.files ?? []);
|
|
2001
|
-
t.length !== 0 && (e.target.value = "",
|
|
2002
|
-
}, []), he = z(() =>
|
|
2000
|
+
t.length !== 0 && (e.target.value = "", te(t));
|
|
2001
|
+
}, []), he = z(() => O ? [{
|
|
2003
2002
|
key: "dial-fs",
|
|
2004
2003
|
label: k ?? "DIAL file system",
|
|
2005
|
-
icon: /* @__PURE__ */ U(
|
|
2004
|
+
icon: /* @__PURE__ */ U(ee, {
|
|
2006
2005
|
size: c,
|
|
2007
2006
|
"aria-hidden": !0
|
|
2008
2007
|
}),
|
|
2009
|
-
onClick:
|
|
2010
|
-
}] : [], [
|
|
2008
|
+
onClick: O
|
|
2009
|
+
}] : [], [O, k]);
|
|
2011
2010
|
return /* @__PURE__ */ W("div", {
|
|
2012
2011
|
className: o("flex w-full flex-col gap-2", _),
|
|
2013
2012
|
children: [/* @__PURE__ */ U(It, {
|
|
@@ -2015,21 +2014,21 @@ var kt = {
|
|
|
2015
2014
|
ariaLabel: u,
|
|
2016
2015
|
isStacked: !0,
|
|
2017
2016
|
hideActionBar: !0,
|
|
2018
|
-
pendingDropFiles:
|
|
2019
|
-
onDropFilesConsumed:
|
|
2020
|
-
onSend:
|
|
2017
|
+
pendingDropFiles: I,
|
|
2018
|
+
onDropFilesConsumed: pe,
|
|
2019
|
+
onSend: de,
|
|
2021
2020
|
onUploadAttachment: a,
|
|
2022
|
-
onChange:
|
|
2023
|
-
onAttachmentsChange:
|
|
2021
|
+
onChange: re,
|
|
2022
|
+
onAttachmentsChange: ae,
|
|
2024
2023
|
removeLabel: d,
|
|
2025
2024
|
retryLabel: f,
|
|
2026
2025
|
className: "max-w-full",
|
|
2027
|
-
prefixAttachments:
|
|
2028
|
-
onRemovePrefixAttachment:
|
|
2026
|
+
prefixAttachments: oe,
|
|
2027
|
+
onRemovePrefixAttachment: ue,
|
|
2029
2028
|
validateAttachment: b,
|
|
2030
2029
|
isAttachmentsEnabled: x,
|
|
2031
|
-
maximumAttachmentsAmount:
|
|
2032
|
-
onAttachmentsLimitExceeded:
|
|
2030
|
+
maximumAttachmentsAmount: T,
|
|
2031
|
+
onAttachmentsLimitExceeded: D,
|
|
2033
2032
|
pendingAttachments: A,
|
|
2034
2033
|
onPendingAttachmentsConsumed: j,
|
|
2035
2034
|
onAttachmentClick: M,
|
|
@@ -2040,16 +2039,16 @@ var kt = {
|
|
|
2040
2039
|
children: [/* @__PURE__ */ U("div", {
|
|
2041
2040
|
className: "flex",
|
|
2042
2041
|
children: !S && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
|
|
2043
|
-
ref:
|
|
2042
|
+
ref: F,
|
|
2044
2043
|
type: "file",
|
|
2045
2044
|
multiple: !0,
|
|
2046
|
-
accept:
|
|
2045
|
+
accept: w,
|
|
2047
2046
|
className: "sr-only",
|
|
2048
2047
|
"aria-hidden": !0,
|
|
2049
2048
|
tabIndex: -1,
|
|
2050
2049
|
onChange: me
|
|
2051
2050
|
}), /* @__PURE__ */ U(qe, {
|
|
2052
|
-
onAttachClick: () =>
|
|
2051
|
+
onAttachClick: () => F.current?.click(),
|
|
2053
2052
|
attachLabel: m,
|
|
2054
2053
|
addMenuTitle: p,
|
|
2055
2054
|
menuTitle: h,
|
|
@@ -2058,13 +2057,13 @@ var kt = {
|
|
|
2058
2057
|
})] })
|
|
2059
2058
|
}), /* @__PURE__ */ W("div", {
|
|
2060
2059
|
className: "flex gap-2",
|
|
2061
|
-
children: [/* @__PURE__ */ U(
|
|
2060
|
+
children: [/* @__PURE__ */ U(C, {
|
|
2062
2061
|
label: s,
|
|
2063
2062
|
onClick: n
|
|
2064
|
-
}), /* @__PURE__ */ U(
|
|
2063
|
+
}), /* @__PURE__ */ U(E, {
|
|
2065
2064
|
label: l,
|
|
2066
|
-
onClick:
|
|
2067
|
-
disabled: !
|
|
2065
|
+
onClick: fe,
|
|
2066
|
+
disabled: !le
|
|
2068
2067
|
})]
|
|
2069
2068
|
})]
|
|
2070
2069
|
})]
|