@epam/ai-dial-conversation-input 1.1.0-dev.113 → 1.1.0-dev.114
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/ChatSettingsModal/ChatSettingsModal.d.ts +6 -1
- package/components/ChatSettingsModal/ChatSettingsModal.d.ts.map +1 -1
- package/hooks/useModelSelector.d.ts +19 -2
- package/hooks/useModelSelector.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +502 -541
- package/package.json +3 -4
- package/utils/concurrency.d.ts +0 -2
- package/utils/concurrency.d.ts.map +1 -1
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, DIAL_ICON_SIZE as u, DialCloseButton as d, DialDropdown as f, DialDropdownIcon as p, DialErrorText as m, DialInput as h, DialPopup as g, DialRadioGroup as _, DialSearch as v, DialSkeleton as y, DialSkeletonVariant as b, DialSlider as x,
|
|
3
|
-
import { IconArrowLeft as
|
|
2
|
+
import { BASE_ICON_SIZE as c, Button as l, DIAL_ICON_SIZE as u, DialCloseButton as d, DialDropdown as f, DialDropdownIcon as p, DialErrorText as m, DialInput as h, DialPopup as g, DialRadioGroup as _, DialSearch as v, DialSkeleton as y, DialSkeletonVariant as b, DialSlider as x, DialTooltip as S, ElementSize as C, GhostIconButton as w, Highlight as T, NeutralButton as E, PopupSize as D, PrimaryButton as O, PrimaryIconButton as k, RadioGroupOrientation as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as M, IconArrowNarrowRight as N, IconCheck as P, IconChevronDown as ee, IconChevronRight as F, IconFile as te, IconMicrophone as ne, IconPaperclip as re, IconPlayerStopFilled as ie, IconPlaystationSquare as ae, IconPlus as oe, IconSettings as se, IconTool as ce, IconX as le } from "@tabler/icons-react";
|
|
4
4
|
import { createPortal as ue } from "react-dom";
|
|
5
|
-
import { createElement as de, memo as
|
|
6
|
-
import { Fragment as
|
|
5
|
+
import { createElement as de, memo as fe, useCallback as I, useEffect as L, useImperativeHandle as pe, useLayoutEffect as R, useMemo as z, useRef as B, useState as V } from "react";
|
|
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
|
+
L(() => {
|
|
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]), L(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
@@ -24,7 +24,7 @@ var Ce = (e, t) => {
|
|
|
24
24
|
"slide-up": "_slide-up_1yh0r_1",
|
|
25
25
|
title: "_title_1yh0r_18",
|
|
26
26
|
divider: "_divider_1yh0r_22"
|
|
27
|
-
},
|
|
27
|
+
}, G = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: s, "aria-label": c, style: l, titleClassName: f = "dial-body-semi-text", className: p, colors: m, children: h }) => {
|
|
28
28
|
if (Ce(e, r), !e || typeof document > "u") return null;
|
|
29
29
|
let g = a({
|
|
30
30
|
"--ci-backdrop": m?.backdrop,
|
|
@@ -32,12 +32,12 @@ var Ce = (e, t) => {
|
|
|
32
32
|
"--ci-sheet-text": m?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": m?.divider
|
|
34
34
|
});
|
|
35
|
-
return ue(/* @__PURE__ */
|
|
35
|
+
return ue(/* @__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,
|
|
39
39
|
"aria-hidden": !0
|
|
40
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ W("div", {
|
|
41
41
|
role: "dialog",
|
|
42
42
|
"aria-modal": !0,
|
|
43
43
|
"aria-label": t ?? c,
|
|
@@ -46,13 +46,13 @@ var Ce = (e, t) => {
|
|
|
46
46
|
...l
|
|
47
47
|
},
|
|
48
48
|
className: o(we.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", p),
|
|
49
|
-
children: [t != null && /* @__PURE__ */
|
|
49
|
+
children: [t != null && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ W("div", {
|
|
50
50
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
51
51
|
children: [
|
|
52
|
-
i && /* @__PURE__ */
|
|
52
|
+
i && /* @__PURE__ */ U("div", {
|
|
53
53
|
className: "absolute start-4",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
icon: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ U(w, {
|
|
55
|
+
icon: /* @__PURE__ */ U(M, {
|
|
56
56
|
size: u.LG,
|
|
57
57
|
stroke: 1.5,
|
|
58
58
|
className: "rtl:scale-x-[-1]"
|
|
@@ -61,20 +61,20 @@ var Ce = (e, t) => {
|
|
|
61
61
|
onClick: i
|
|
62
62
|
})
|
|
63
63
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
64
|
+
/* @__PURE__ */ U("span", {
|
|
65
65
|
className: o(we.title, f),
|
|
66
66
|
children: t
|
|
67
67
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ U("div", {
|
|
69
69
|
className: "absolute end-4 m-2",
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ U(d, {
|
|
71
71
|
ariaLabel: n,
|
|
72
72
|
size: u.LG,
|
|
73
73
|
onClose: r
|
|
74
74
|
})
|
|
75
75
|
})
|
|
76
76
|
]
|
|
77
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ U("div", { className: o(we.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ U("div", {
|
|
78
78
|
className: "overflow-y-auto",
|
|
79
79
|
children: h
|
|
80
80
|
})]
|
|
@@ -84,15 +84,15 @@ var Ce = (e, t) => {
|
|
|
84
84
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
85
85
|
await Promise.allSettled(i);
|
|
86
86
|
}, 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
|
-
let [h, g] =
|
|
88
|
-
|
|
87
|
+
let [h, g] = V(n), _ = B(h);
|
|
88
|
+
L(() => {
|
|
89
89
|
_.current = h;
|
|
90
|
-
}, [h]),
|
|
90
|
+
}, [h]), L(() => () => {
|
|
91
91
|
_.current.forEach((e) => {
|
|
92
92
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
93
93
|
});
|
|
94
94
|
}, []);
|
|
95
|
-
let v =
|
|
95
|
+
let v = I((e) => e.map((e) => {
|
|
96
96
|
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
97
|
return {
|
|
98
98
|
id: be(),
|
|
@@ -104,26 +104,26 @@ var Ce = (e, t) => {
|
|
|
104
104
|
previewUrl: a,
|
|
105
105
|
playUrl: o
|
|
106
106
|
};
|
|
107
|
-
}), []), y =
|
|
108
|
-
|
|
107
|
+
}), []), y = B(a);
|
|
108
|
+
L(() => {
|
|
109
109
|
y.current = a;
|
|
110
110
|
}, [a]);
|
|
111
|
-
let b =
|
|
111
|
+
let b = B(!0), x = I((e) => {
|
|
112
112
|
g((t) => {
|
|
113
113
|
let n = e(t);
|
|
114
114
|
return n === t ? t : n;
|
|
115
115
|
});
|
|
116
116
|
}, []);
|
|
117
|
-
|
|
117
|
+
L(() => {
|
|
118
118
|
if (b.current) {
|
|
119
119
|
b.current = !1;
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
122
|
y.current?.(h);
|
|
123
123
|
}, [h]);
|
|
124
|
-
let S =
|
|
124
|
+
let S = I((e) => {
|
|
125
125
|
g(e);
|
|
126
|
-
}, []), C =
|
|
126
|
+
}, []), C = I(async (t) => {
|
|
127
127
|
if (i) {
|
|
128
128
|
x((e) => e.map((e) => e.id === t.id ? {
|
|
129
129
|
...e,
|
|
@@ -145,7 +145,7 @@ var Ce = (e, t) => {
|
|
|
145
145
|
} : e));
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}, [i, x]), w =
|
|
148
|
+
}, [i, x]), w = I((e, t = !0) => {
|
|
149
149
|
let n = new Set(_.current.map((e) => e.id)), i = e.filter((e) => !n.has(e.id));
|
|
150
150
|
if (i.length !== 0) {
|
|
151
151
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -177,20 +177,20 @@ var Ce = (e, t) => {
|
|
|
177
177
|
C,
|
|
178
178
|
o
|
|
179
179
|
]);
|
|
180
|
-
|
|
180
|
+
L(() => {
|
|
181
181
|
s.length !== 0 && (w(v(s)), c?.());
|
|
182
182
|
}, [
|
|
183
183
|
w,
|
|
184
184
|
v,
|
|
185
185
|
c,
|
|
186
186
|
s
|
|
187
|
-
]),
|
|
187
|
+
]), L(() => {
|
|
188
188
|
l.length !== 0 && (w(l, !1), u?.());
|
|
189
189
|
}, [
|
|
190
190
|
w,
|
|
191
191
|
u,
|
|
192
192
|
l
|
|
193
|
-
]),
|
|
193
|
+
]), L(() => {
|
|
194
194
|
if (!o) return;
|
|
195
195
|
let t = !1, n = [], i = _.current.map((i) => {
|
|
196
196
|
if (i.status === r.Loading) return i;
|
|
@@ -217,7 +217,7 @@ var Ce = (e, t) => {
|
|
|
217
217
|
x,
|
|
218
218
|
C
|
|
219
219
|
]);
|
|
220
|
-
let T =
|
|
220
|
+
let T = I((e) => {
|
|
221
221
|
x((t) => {
|
|
222
222
|
let n = t.find((t) => t.id === e);
|
|
223
223
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
@@ -229,11 +229,11 @@ var Ce = (e, t) => {
|
|
|
229
229
|
addAttachments: w,
|
|
230
230
|
resetAttachments: S,
|
|
231
231
|
handleRemove: T,
|
|
232
|
-
handleRetry:
|
|
232
|
+
handleRetry: I((e) => {
|
|
233
233
|
let t = h.find((t) => t.id === e);
|
|
234
234
|
t && C(t);
|
|
235
235
|
}, [h, C]),
|
|
236
|
-
handleExpand:
|
|
236
|
+
handleExpand: I(async (e) => {
|
|
237
237
|
let n = h.find((t) => t.id === e);
|
|
238
238
|
if (!n || n.type !== t.Pasted) return;
|
|
239
239
|
let r = await n.file.text();
|
|
@@ -246,8 +246,8 @@ var Ce = (e, t) => {
|
|
|
246
246
|
hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
|
|
247
247
|
};
|
|
248
248
|
}, De = (e, t) => {
|
|
249
|
-
let [n, r] =
|
|
250
|
-
return
|
|
249
|
+
let [n, r] = V(e), [i, a] = V(!1), [o, s] = V(0);
|
|
250
|
+
return L(() => {
|
|
251
251
|
if (e) {
|
|
252
252
|
r(!0), a(!1), s((e) => e + 1);
|
|
253
253
|
return;
|
|
@@ -264,17 +264,17 @@ var Ce = (e, t) => {
|
|
|
264
264
|
instanceKey: o
|
|
265
265
|
};
|
|
266
266
|
}, Oe = (e, t) => !e.slice(0, t).includes("\n"), ke = (e, t) => !e.slice(t).includes("\n"), Ae = (e) => {
|
|
267
|
-
let t =
|
|
267
|
+
let t = B(e);
|
|
268
268
|
t.current = e;
|
|
269
|
-
let n =
|
|
269
|
+
let n = B(-1), r = B(""), i = I((e, i, a) => {
|
|
270
270
|
let o = t.current;
|
|
271
271
|
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 =
|
|
272
|
+
}, []), a = I(() => {
|
|
273
273
|
n.current = -1, r.current = "";
|
|
274
|
-
}, []), o =
|
|
274
|
+
}, []), o = I(() => {
|
|
275
275
|
n.current = -1, r.current = "";
|
|
276
276
|
}, []);
|
|
277
|
-
return
|
|
277
|
+
return z(() => ({
|
|
278
278
|
navigate: i,
|
|
279
279
|
notifyChange: a,
|
|
280
280
|
reset: o
|
|
@@ -284,12 +284,12 @@ var Ce = (e, t) => {
|
|
|
284
284
|
o
|
|
285
285
|
]);
|
|
286
286
|
}, je = ({ messageProp: e, messageRevision: t }) => {
|
|
287
|
-
let [n, r] =
|
|
288
|
-
return
|
|
287
|
+
let [n, r] = V(e), i = B(null), a = B(0), [o, s] = V(!1);
|
|
288
|
+
return L(() => {
|
|
289
289
|
r(e);
|
|
290
|
-
}, [e, t]),
|
|
290
|
+
}, [e, t]), L(() => {
|
|
291
291
|
i.current && (a.current = i.current.offsetHeight);
|
|
292
|
-
}, []),
|
|
292
|
+
}, []), R(() => {
|
|
293
293
|
if (!i.current || a.current === 0) return;
|
|
294
294
|
let e = i.current.offsetHeight > a.current;
|
|
295
295
|
s((t) => e ? !0 : n === "" ? !1 : t);
|
|
@@ -306,13 +306,13 @@ var Ce = (e, t) => {
|
|
|
306
306
|
"audio/ogg;codecs=opus",
|
|
307
307
|
"audio/webm"
|
|
308
308
|
], Pe = () => Ne.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Fe = ({ onAttachAudio: e }) => {
|
|
309
|
-
let [t, n] =
|
|
309
|
+
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
310
|
m.current = e;
|
|
311
|
-
let h =
|
|
311
|
+
let h = I(() => {
|
|
312
312
|
p.current != null && (clearInterval(p.current), p.current = null);
|
|
313
|
-
}, []), g =
|
|
313
|
+
}, []), g = I(() => {
|
|
314
314
|
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]), _ =
|
|
315
|
+
}, [h]), _ = I(() => {
|
|
316
316
|
(async () => {
|
|
317
317
|
try {
|
|
318
318
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -333,17 +333,17 @@ var Ce = (e, t) => {
|
|
|
333
333
|
i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
|
|
334
334
|
}
|
|
335
335
|
})();
|
|
336
|
-
}, []), v =
|
|
336
|
+
}, []), v = I(() => {
|
|
337
337
|
let e = u.current;
|
|
338
338
|
!e || e.state !== "recording" || (h(), e.onstop = () => {
|
|
339
339
|
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
340
|
m.current(c), g(), o(0), i(null), n("idle");
|
|
341
341
|
}, e.stop());
|
|
342
|
-
}, [h, g]), y =
|
|
342
|
+
}, [h, g]), y = I(() => {
|
|
343
343
|
let e = u.current;
|
|
344
344
|
e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), g(), o(0), i(null), n("idle");
|
|
345
345
|
}, [g]);
|
|
346
|
-
return
|
|
346
|
+
return L(() => () => {
|
|
347
347
|
g();
|
|
348
348
|
}, [g]), {
|
|
349
349
|
state: t,
|
|
@@ -368,7 +368,7 @@ var Ce = (e, t) => {
|
|
|
368
368
|
"--ci-sheet-item-active": p?.itemActiveBg,
|
|
369
369
|
"--ci-sheet-icon": p?.itemIcon
|
|
370
370
|
});
|
|
371
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ U(G, {
|
|
372
372
|
isOpen: e,
|
|
373
373
|
title: t,
|
|
374
374
|
closeLabel: n,
|
|
@@ -377,23 +377,23 @@ var Ce = (e, t) => {
|
|
|
377
377
|
className: c,
|
|
378
378
|
titleClassName: u,
|
|
379
379
|
colors: p?.shell,
|
|
380
|
-
children: /* @__PURE__ */
|
|
380
|
+
children: /* @__PURE__ */ U("ul", {
|
|
381
381
|
role: "list",
|
|
382
382
|
className: "flex flex-col",
|
|
383
383
|
style: h,
|
|
384
|
-
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
384
|
+
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(l, {
|
|
385
385
|
type: "button",
|
|
386
386
|
className: o(Le.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
387
|
-
iconBefore: /* @__PURE__ */
|
|
387
|
+
iconBefore: /* @__PURE__ */ U("span", {
|
|
388
388
|
className: Le.itemIcon,
|
|
389
389
|
children: n
|
|
390
390
|
}),
|
|
391
|
-
iconAfter: r ? /* @__PURE__ */
|
|
391
|
+
iconAfter: r ? /* @__PURE__ */ U("span", {
|
|
392
392
|
className: "ms-auto",
|
|
393
393
|
children: r
|
|
394
394
|
}) : null,
|
|
395
395
|
textClassName: f,
|
|
396
|
-
label: /* @__PURE__ */
|
|
396
|
+
label: /* @__PURE__ */ U("span", {
|
|
397
397
|
className: d,
|
|
398
398
|
children: t
|
|
399
399
|
}),
|
|
@@ -402,8 +402,8 @@ var Ce = (e, t) => {
|
|
|
402
402
|
})
|
|
403
403
|
});
|
|
404
404
|
}, ze = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
405
|
-
let [s, c] =
|
|
406
|
-
|
|
405
|
+
let [s, c] = V(t), [l, u] = V(n), [d, f] = V(r), p = B(o);
|
|
406
|
+
L(() => {
|
|
407
407
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
408
408
|
}, [
|
|
409
409
|
o,
|
|
@@ -420,7 +420,7 @@ var Ce = (e, t) => {
|
|
|
420
420
|
setResponseFormat: c,
|
|
421
421
|
setSystemPrompt: u,
|
|
422
422
|
setTemperature: f,
|
|
423
|
-
handleSubmit:
|
|
423
|
+
handleSubmit: I(() => {
|
|
424
424
|
if (!m) return;
|
|
425
425
|
let t = {};
|
|
426
426
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -440,15 +440,15 @@ var Ce = (e, t) => {
|
|
|
440
440
|
"Creative"
|
|
441
441
|
], temperatureHint: b, labelClassName: S = "!dial-small-semi-text", colors: C }) => {
|
|
442
442
|
let w = a({ "--csf-label-text": C?.labelText }), T = o(S, Be.label, "gap-1");
|
|
443
|
-
return /* @__PURE__ */
|
|
443
|
+
return /* @__PURE__ */ W("div", {
|
|
444
444
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
445
445
|
style: w,
|
|
446
446
|
children: [
|
|
447
|
-
e.responseFormat && /* @__PURE__ */
|
|
447
|
+
e.responseFormat && /* @__PURE__ */ U(_, {
|
|
448
448
|
fieldTitle: u,
|
|
449
449
|
labelClassName: T,
|
|
450
450
|
elementId: "response-format",
|
|
451
|
-
orientation:
|
|
451
|
+
orientation: A.Column,
|
|
452
452
|
activeRadioButton: t ?? i.Markdown,
|
|
453
453
|
labelDescription: d,
|
|
454
454
|
radioButtons: [{
|
|
@@ -460,7 +460,7 @@ var Ce = (e, t) => {
|
|
|
460
460
|
}],
|
|
461
461
|
onChange: (e) => s(e)
|
|
462
462
|
}),
|
|
463
|
-
e.systemPrompt && /* @__PURE__ */
|
|
463
|
+
e.systemPrompt && /* @__PURE__ */ U(h, {
|
|
464
464
|
value: n,
|
|
465
465
|
placeholder: g,
|
|
466
466
|
labelProps: {
|
|
@@ -469,7 +469,7 @@ var Ce = (e, t) => {
|
|
|
469
469
|
},
|
|
470
470
|
onChange: (e) => c(e ?? "")
|
|
471
471
|
}),
|
|
472
|
-
e.temperature && /* @__PURE__ */
|
|
472
|
+
e.temperature && /* @__PURE__ */ U(x, {
|
|
473
473
|
labelProps: {
|
|
474
474
|
label: v,
|
|
475
475
|
className: T,
|
|
@@ -484,8 +484,8 @@ var Ce = (e, t) => {
|
|
|
484
484
|
})
|
|
485
485
|
]
|
|
486
486
|
});
|
|
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: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel:
|
|
488
|
-
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit:
|
|
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: g, systemPromptLabel: _, systemPromptTooltip: v, temperatureLabel: y, temperatureLabels: b, temperatureHint: x, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
|
|
488
|
+
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: M, handleSubmit: N } = ze({
|
|
489
489
|
isOpen: e,
|
|
490
490
|
features: s,
|
|
491
491
|
initialResponseFormat: c,
|
|
@@ -494,7 +494,7 @@ var Ce = (e, t) => {
|
|
|
494
494
|
onSave: d,
|
|
495
495
|
onClose: r
|
|
496
496
|
});
|
|
497
|
-
return /* @__PURE__ */ G
|
|
497
|
+
return /* @__PURE__ */ W(G, {
|
|
498
498
|
isOpen: e,
|
|
499
499
|
title: f,
|
|
500
500
|
closeLabel: i,
|
|
@@ -502,7 +502,7 @@ var Ce = (e, t) => {
|
|
|
502
502
|
onBack: t,
|
|
503
503
|
backLabel: n,
|
|
504
504
|
style: a,
|
|
505
|
-
children: [/* @__PURE__ */
|
|
505
|
+
children: [/* @__PURE__ */ U(Ve, {
|
|
506
506
|
features: s,
|
|
507
507
|
responseFormat: T,
|
|
508
508
|
systemPrompt: E,
|
|
@@ -519,23 +519,23 @@ var Ce = (e, t) => {
|
|
|
519
519
|
temperatureLabel: y,
|
|
520
520
|
temperatureLabels: b,
|
|
521
521
|
temperatureHint: x
|
|
522
|
-
}), /* @__PURE__ */
|
|
522
|
+
}), /* @__PURE__ */ U("div", {
|
|
523
523
|
className: o("px-6 py-4 mobile:pb-8"),
|
|
524
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ U(S, {
|
|
525
525
|
tooltip: w,
|
|
526
|
-
hideTooltip:
|
|
526
|
+
hideTooltip: k || !w,
|
|
527
527
|
triggerClassName: "w-full",
|
|
528
|
-
children: /* @__PURE__ */
|
|
529
|
-
label:
|
|
528
|
+
children: /* @__PURE__ */ U(O, {
|
|
529
|
+
label: C,
|
|
530
530
|
onClick: N,
|
|
531
|
-
disabled: !
|
|
531
|
+
disabled: !k,
|
|
532
532
|
className: "w-full"
|
|
533
533
|
})
|
|
534
534
|
})
|
|
535
535
|
})]
|
|
536
536
|
});
|
|
537
|
-
}, Ue = { modal: "
|
|
538
|
-
let { responseFormat: b, systemPrompt: x, temperature:
|
|
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: h, saveLabel: _ = "Apply changes", saveDisabledTooltip: v, backgroundClassName: y = Ue.modal }) => {
|
|
538
|
+
let { responseFormat: b, systemPrompt: x, temperature: C, canSubmit: w, setResponseFormat: T, setSystemPrompt: E, setTemperature: k, handleSubmit: A } = ze({
|
|
539
539
|
features: e,
|
|
540
540
|
initialResponseFormat: t,
|
|
541
541
|
initialSystemPrompt: n,
|
|
@@ -543,32 +543,32 @@ var Ce = (e, t) => {
|
|
|
543
543
|
onSave: i,
|
|
544
544
|
onClose: a
|
|
545
545
|
});
|
|
546
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ U(g, {
|
|
547
547
|
open: !0,
|
|
548
548
|
header: o,
|
|
549
|
-
size:
|
|
549
|
+
size: D.Sm,
|
|
550
550
|
onClose: a,
|
|
551
551
|
className: y,
|
|
552
|
-
footer: /* @__PURE__ */
|
|
552
|
+
footer: /* @__PURE__ */ U("div", {
|
|
553
553
|
className: "flex justify-end px-6 py-4",
|
|
554
|
-
children: /* @__PURE__ */
|
|
554
|
+
children: /* @__PURE__ */ U(S, {
|
|
555
555
|
tooltip: v,
|
|
556
556
|
hideTooltip: w || !v,
|
|
557
|
-
children: /* @__PURE__ */
|
|
557
|
+
children: /* @__PURE__ */ U(O, {
|
|
558
558
|
label: _,
|
|
559
559
|
onClick: A,
|
|
560
560
|
disabled: !w
|
|
561
561
|
})
|
|
562
562
|
})
|
|
563
563
|
}),
|
|
564
|
-
children: /* @__PURE__ */
|
|
564
|
+
children: /* @__PURE__ */ U(Ve, {
|
|
565
565
|
features: e,
|
|
566
566
|
responseFormat: b,
|
|
567
567
|
systemPrompt: x,
|
|
568
|
-
temperature:
|
|
568
|
+
temperature: C,
|
|
569
569
|
onResponseFormatChange: T,
|
|
570
570
|
onSystemPromptChange: E,
|
|
571
|
-
onTemperatureChange:
|
|
571
|
+
onTemperatureChange: k,
|
|
572
572
|
responseFormatLabel: s,
|
|
573
573
|
responseFormatHint: c,
|
|
574
574
|
responseFormatMarkdownLabel: l,
|
|
@@ -581,11 +581,11 @@ var Ce = (e, t) => {
|
|
|
581
581
|
})
|
|
582
582
|
});
|
|
583
583
|
};
|
|
584
|
-
|
|
584
|
+
fe(We);
|
|
585
585
|
var Ge = {
|
|
586
586
|
icon: "_icon_1oz9i_1",
|
|
587
587
|
selectedIcon: "_selectedIcon_1oz9i_5"
|
|
588
|
-
}, Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, colors: p }) => /* @__PURE__ */
|
|
588
|
+
}, Ke = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, colors: p }) => /* @__PURE__ */ U(G, {
|
|
589
589
|
isOpen: e,
|
|
590
590
|
title: u,
|
|
591
591
|
closeLabel: i,
|
|
@@ -593,32 +593,32 @@ var Ge = {
|
|
|
593
593
|
onBack: t,
|
|
594
594
|
backLabel: n,
|
|
595
595
|
style: s,
|
|
596
|
-
children: /* @__PURE__ */
|
|
596
|
+
children: /* @__PURE__ */ U("ul", {
|
|
597
597
|
role: "menu",
|
|
598
598
|
className: "flex flex-col pb-4",
|
|
599
599
|
style: a({
|
|
600
600
|
"--tbs-icon-text": p?.iconText,
|
|
601
601
|
"--tbs-selected-icon-text": p?.selectedIconText
|
|
602
602
|
}),
|
|
603
|
-
children: d.map((e) => /* @__PURE__ */
|
|
603
|
+
children: d.map((e) => /* @__PURE__ */ U("li", {
|
|
604
604
|
role: "none",
|
|
605
|
-
children: /* @__PURE__ */
|
|
605
|
+
children: /* @__PURE__ */ U(l, {
|
|
606
606
|
type: "button",
|
|
607
607
|
role: "menuitemcheckbox",
|
|
608
608
|
"aria-checked": e.isSelected,
|
|
609
609
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
610
|
-
iconBefore: /* @__PURE__ */
|
|
610
|
+
iconBefore: /* @__PURE__ */ U("span", {
|
|
611
611
|
className: o("flex items-center", Ge.icon),
|
|
612
612
|
children: e.icon
|
|
613
613
|
}),
|
|
614
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
614
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ U("span", {
|
|
615
615
|
className: o("ms-auto", Ge.selectedIcon),
|
|
616
|
-
children: /* @__PURE__ */
|
|
616
|
+
children: /* @__PURE__ */ U(P, {
|
|
617
617
|
size: c,
|
|
618
618
|
"aria-hidden": !0
|
|
619
619
|
})
|
|
620
620
|
}) : null,
|
|
621
|
-
label: /* @__PURE__ */
|
|
621
|
+
label: /* @__PURE__ */ U("span", {
|
|
622
622
|
className: "dial-small-text",
|
|
623
623
|
children: e.label
|
|
624
624
|
}),
|
|
@@ -626,12 +626,12 @@ var Ge = {
|
|
|
626
626
|
})
|
|
627
627
|
}, e.id))
|
|
628
628
|
})
|
|
629
|
-
}),
|
|
629
|
+
}), K = {
|
|
630
630
|
selectedToolIcon: "_selectedToolIcon_1lz31_1",
|
|
631
631
|
toolIcon: "_toolIcon_1lz31_5",
|
|
632
632
|
chevronIcon: "_chevronIcon_1lz31_9"
|
|
633
|
-
},
|
|
634
|
-
let S = s(), [
|
|
633
|
+
}, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: d, listClassName: p = "cp-dropdown-overlay !w-[240px]", isDisabled: m = !1, chatSettings: h, extraMenuItems: g, toolsMenuItems: _ = [], onToolToggle: v, toolsMenuTitle: y = "Tools", toolsBackLabel: b = "Back", colors: x }) => {
|
|
634
|
+
let S = s(), [T, E] = V(!1), [D, O] = V(!1), [k, A] = V(!1), j = z(() => a({
|
|
635
635
|
"--aab-selected-tool-icon": x?.selectedToolIcon,
|
|
636
636
|
"--aab-tool-icon": x?.toolIcon,
|
|
637
637
|
"--aab-chevron-icon": x?.chevronIcon
|
|
@@ -639,23 +639,23 @@ var Ge = {
|
|
|
639
639
|
x?.selectedToolIcon,
|
|
640
640
|
x?.toolIcon,
|
|
641
641
|
x?.chevronIcon
|
|
642
|
-
]), M = _.length > 0 && v != null, N =
|
|
642
|
+
]), M = _.length > 0 && v != null, N = z(() => _.map((e) => ({
|
|
643
643
|
key: e.id,
|
|
644
|
-
label: /* @__PURE__ */
|
|
644
|
+
label: /* @__PURE__ */ W("span", {
|
|
645
645
|
className: "flex flex-1 items-center gap-2",
|
|
646
|
-
children: [/* @__PURE__ */
|
|
646
|
+
children: [/* @__PURE__ */ U("span", {
|
|
647
647
|
className: "flex-1",
|
|
648
648
|
children: e.label
|
|
649
|
-
}), e.isSelected && /* @__PURE__ */
|
|
649
|
+
}), e.isSelected && /* @__PURE__ */ U(P, {
|
|
650
650
|
size: c,
|
|
651
651
|
style: j,
|
|
652
|
-
className:
|
|
652
|
+
className: K.selectedToolIcon,
|
|
653
653
|
"aria-hidden": !0
|
|
654
654
|
})]
|
|
655
655
|
}),
|
|
656
|
-
icon: /* @__PURE__ */
|
|
656
|
+
icon: /* @__PURE__ */ U("span", {
|
|
657
657
|
style: j,
|
|
658
|
-
className: o("flex items-center",
|
|
658
|
+
className: o("flex items-center", K.toolIcon),
|
|
659
659
|
children: e.icon
|
|
660
660
|
}),
|
|
661
661
|
onClick: () => v?.(e.id)
|
|
@@ -663,11 +663,11 @@ var Ge = {
|
|
|
663
663
|
_,
|
|
664
664
|
v,
|
|
665
665
|
j
|
|
666
|
-
]), ee =
|
|
666
|
+
]), ee = z(() => [
|
|
667
667
|
...e == null ? [] : [{
|
|
668
668
|
key: "attach",
|
|
669
669
|
label: t,
|
|
670
|
-
icon: /* @__PURE__ */
|
|
670
|
+
icon: /* @__PURE__ */ U(re, {
|
|
671
671
|
size: c,
|
|
672
672
|
"aria-hidden": !0
|
|
673
673
|
}),
|
|
@@ -677,33 +677,33 @@ var Ge = {
|
|
|
677
677
|
...M ? [{
|
|
678
678
|
key: "tools",
|
|
679
679
|
label: y,
|
|
680
|
-
icon: /* @__PURE__ */
|
|
680
|
+
icon: /* @__PURE__ */ U(ce, {
|
|
681
681
|
size: c,
|
|
682
682
|
"aria-hidden": !0
|
|
683
683
|
}),
|
|
684
684
|
onClick: S ? () => {
|
|
685
685
|
A(!0), E(!1);
|
|
686
686
|
} : () => void 0,
|
|
687
|
-
...S ? { iconAfter: /* @__PURE__ */
|
|
687
|
+
...S ? { iconAfter: /* @__PURE__ */ U(F, {
|
|
688
688
|
size: c,
|
|
689
689
|
stroke: 1.5,
|
|
690
690
|
style: j,
|
|
691
|
-
className: o("rtl:scale-x-[-1]",
|
|
691
|
+
className: o("rtl:scale-x-[-1]", K.chevronIcon),
|
|
692
692
|
"aria-hidden": !0
|
|
693
693
|
}) } : { children: N }
|
|
694
694
|
}] : [],
|
|
695
695
|
...h == null ? [] : [{
|
|
696
696
|
key: "chat-settings",
|
|
697
697
|
label: h.menuItemLabel ?? "Chat settings",
|
|
698
|
-
icon: /* @__PURE__ */
|
|
698
|
+
icon: /* @__PURE__ */ U(se, {
|
|
699
699
|
size: c,
|
|
700
700
|
"aria-hidden": !0
|
|
701
701
|
}),
|
|
702
|
-
iconAfter: S ? /* @__PURE__ */
|
|
702
|
+
iconAfter: S ? /* @__PURE__ */ U(F, {
|
|
703
703
|
size: c,
|
|
704
704
|
stroke: 1.5,
|
|
705
705
|
style: j,
|
|
706
|
-
className: o("rtl:scale-x-[-1]",
|
|
706
|
+
className: o("rtl:scale-x-[-1]", K.chevronIcon),
|
|
707
707
|
"aria-hidden": !0
|
|
708
708
|
}) : null,
|
|
709
709
|
onClick: () => O(!0)
|
|
@@ -719,20 +719,20 @@ var Ge = {
|
|
|
719
719
|
N,
|
|
720
720
|
j
|
|
721
721
|
]);
|
|
722
|
-
return ee.length === 0 ? null : /* @__PURE__ */
|
|
723
|
-
/* @__PURE__ */
|
|
724
|
-
icon: /* @__PURE__ */
|
|
722
|
+
return ee.length === 0 ? null : /* @__PURE__ */ U(H, { children: S ? /* @__PURE__ */ W(H, { children: [
|
|
723
|
+
/* @__PURE__ */ U(w, {
|
|
724
|
+
icon: /* @__PURE__ */ U(oe, {
|
|
725
725
|
size: u.LG,
|
|
726
726
|
"aria-hidden": !0
|
|
727
727
|
}),
|
|
728
728
|
"aria-label": n,
|
|
729
|
-
size:
|
|
729
|
+
size: C.Large,
|
|
730
730
|
tooltipProps: { tooltip: n },
|
|
731
731
|
disabled: m,
|
|
732
732
|
onClick: () => E(!0)
|
|
733
733
|
}),
|
|
734
|
-
/* @__PURE__ */
|
|
735
|
-
isOpen:
|
|
734
|
+
/* @__PURE__ */ U(Re, {
|
|
735
|
+
isOpen: T,
|
|
736
736
|
title: r,
|
|
737
737
|
closeLabel: l,
|
|
738
738
|
onClose: () => E(!1),
|
|
@@ -741,7 +741,7 @@ var Ge = {
|
|
|
741
741
|
className: "pb-4",
|
|
742
742
|
btnTextClassName: "flex-1"
|
|
743
743
|
}),
|
|
744
|
-
M && /* @__PURE__ */
|
|
744
|
+
M && /* @__PURE__ */ U(Ke, {
|
|
745
745
|
isOpen: k,
|
|
746
746
|
onBack: () => {
|
|
747
747
|
A(!1), E(!0);
|
|
@@ -754,7 +754,7 @@ var Ge = {
|
|
|
754
754
|
items: _,
|
|
755
755
|
onToolToggle: v
|
|
756
756
|
}),
|
|
757
|
-
h != null && /* @__PURE__ */
|
|
757
|
+
h != null && /* @__PURE__ */ U(He, {
|
|
758
758
|
isOpen: D,
|
|
759
759
|
onBack: () => {
|
|
760
760
|
O(!1), E(!0);
|
|
@@ -781,13 +781,13 @@ var Ge = {
|
|
|
781
781
|
saveLabel: h.saveLabel,
|
|
782
782
|
saveDisabledTooltip: h.saveDisabledTooltip
|
|
783
783
|
})
|
|
784
|
-
] }) : /* @__PURE__ */
|
|
784
|
+
] }) : /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(f, {
|
|
785
785
|
matchReferenceWidth: !1,
|
|
786
786
|
placement: "bottom-start",
|
|
787
787
|
listClassName: p,
|
|
788
788
|
items: ee,
|
|
789
|
-
children: /* @__PURE__ */
|
|
790
|
-
icon: /* @__PURE__ */
|
|
789
|
+
children: /* @__PURE__ */ U(w, {
|
|
790
|
+
icon: /* @__PURE__ */ U(oe, {
|
|
791
791
|
size: u.LG,
|
|
792
792
|
"aria-hidden": !0
|
|
793
793
|
}),
|
|
@@ -795,7 +795,7 @@ var Ge = {
|
|
|
795
795
|
tooltipProps: { tooltip: n },
|
|
796
796
|
disabled: m
|
|
797
797
|
})
|
|
798
|
-
}), h != null && D && /* @__PURE__ */
|
|
798
|
+
}), h != null && D && /* @__PURE__ */ U(We, {
|
|
799
799
|
features: h.features,
|
|
800
800
|
initialResponseFormat: h.responseFormat ?? i.Markdown,
|
|
801
801
|
initialSystemPrompt: h.systemPrompt,
|
|
@@ -820,7 +820,7 @@ var Ge = {
|
|
|
820
820
|
chipIcon: "_chipIcon_16mrh_6",
|
|
821
821
|
chipText: "_chipText_16mrh_10",
|
|
822
822
|
chipClose: "_chipClose_16mrh_14"
|
|
823
|
-
}, J = (e) => `${e} tool${e === 1 ? "" : "s"}`,
|
|
823
|
+
}, J = (e) => `${e} tool${e === 1 ? "" : "s"}`, Je = (e) => `Remove ${e}`, Ye = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = J, removeLabel: i = Je, typography: s, colors: l }) => {
|
|
824
824
|
let u = e.filter((e) => e.isSelected);
|
|
825
825
|
if (u.length === 0) return null;
|
|
826
826
|
let d = a({
|
|
@@ -832,47 +832,47 @@ var Ge = {
|
|
|
832
832
|
"--ci-chip-close-hover": l?.chipCloseHover
|
|
833
833
|
});
|
|
834
834
|
if (n) {
|
|
835
|
-
let e = u.length === 1 ? u[0].icon : /* @__PURE__ */
|
|
835
|
+
let e = u.length === 1 ? u[0].icon : /* @__PURE__ */ U(ce, {
|
|
836
836
|
size: c,
|
|
837
837
|
"aria-hidden": !0
|
|
838
838
|
});
|
|
839
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ U("div", {
|
|
840
840
|
className: "flex flex-wrap items-center gap-2",
|
|
841
841
|
style: d,
|
|
842
|
-
children: /* @__PURE__ */
|
|
842
|
+
children: /* @__PURE__ */ W("div", {
|
|
843
843
|
className: o(q.chip, "flex items-center gap-1.5 rounded-full border px-2 py-1"),
|
|
844
|
-
children: [/* @__PURE__ */
|
|
844
|
+
children: [/* @__PURE__ */ U("span", {
|
|
845
845
|
className: q.chipIcon,
|
|
846
846
|
"aria-hidden": !0,
|
|
847
847
|
children: e
|
|
848
|
-
}), /* @__PURE__ */
|
|
848
|
+
}), /* @__PURE__ */ U("span", {
|
|
849
849
|
className: o(q.chipText, s?.fontClassName || "dial-small-paragraph-text"),
|
|
850
850
|
children: r(u.length)
|
|
851
851
|
})]
|
|
852
852
|
})
|
|
853
853
|
});
|
|
854
854
|
}
|
|
855
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ U("div", {
|
|
856
856
|
className: "flex flex-wrap items-center gap-2",
|
|
857
857
|
style: d,
|
|
858
|
-
children: u.map((e) => /* @__PURE__ */
|
|
858
|
+
children: u.map((e) => /* @__PURE__ */ W("div", {
|
|
859
859
|
className: o(q.chip, "flex items-center gap-1.5 rounded-full border py-1 pe-1 ps-2"),
|
|
860
860
|
children: [
|
|
861
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ U("span", {
|
|
862
862
|
className: q.chipIcon,
|
|
863
863
|
"aria-hidden": !0,
|
|
864
864
|
children: e.icon
|
|
865
865
|
}),
|
|
866
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ U("span", {
|
|
867
867
|
className: o(q.chipText, s?.fontClassName || "dial-small-paragraph-text"),
|
|
868
868
|
children: e.label
|
|
869
869
|
}),
|
|
870
|
-
/* @__PURE__ */
|
|
870
|
+
/* @__PURE__ */ U("button", {
|
|
871
871
|
type: "button",
|
|
872
872
|
onClick: () => t(e.id),
|
|
873
873
|
className: o(q.chipClose, "flex items-center rounded p-0.5 transition-colors"),
|
|
874
874
|
"aria-label": i(e.label),
|
|
875
|
-
children: /* @__PURE__ */
|
|
875
|
+
children: /* @__PURE__ */ U(le, {
|
|
876
876
|
size: 12,
|
|
877
877
|
"aria-hidden": !0
|
|
878
878
|
})
|
|
@@ -887,36 +887,35 @@ var Ge = {
|
|
|
887
887
|
modelSelectorButton: "_modelSelectorButton_4e8i8_24",
|
|
888
888
|
modelSelectorCaret: "_modelSelectorCaret_4e8i8_24",
|
|
889
889
|
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_4e8i8_33"
|
|
890
|
-
},
|
|
891
|
-
wrapperError: "
|
|
892
|
-
waveformCanvas: "
|
|
893
|
-
timer: "
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
let p = V(null), h = V(new Float32Array(X)), g = V(0), _ = V(0), v = e === Me.Recording, y = e === Me.Error, b = R((e) => {
|
|
890
|
+
}, Xe = {
|
|
891
|
+
wrapperError: "_wrapperError_fbvnl_1",
|
|
892
|
+
waveformCanvas: "_waveformCanvas_fbvnl_5",
|
|
893
|
+
timer: "_timer_fbvnl_9",
|
|
894
|
+
recordingDot: "_recordingDot_fbvnl_25",
|
|
895
|
+
"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: d, className: f }) => {
|
|
897
|
+
let p = B(null), h = B(new Float32Array(Z)), g = B(0), _ = B(0), v = e === Me.Recording, y = e === Me.Error, b = I((e) => {
|
|
899
898
|
let t = e.getContext("2d");
|
|
900
899
|
if (!t) return;
|
|
901
900
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
902
901
|
let { width: n, height: r } = e;
|
|
903
902
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
904
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
903
|
+
let i = Math.min(Math.max(1, Math.floor(n / X)), Z - 1), a = g.current, o = _.current;
|
|
905
904
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
906
905
|
for (let e = 0; e <= i; e++) {
|
|
907
|
-
let n = ((a - i + e) %
|
|
908
|
-
t.fillRect(e *
|
|
906
|
+
let n = ((a - i + e) % Z + Z) % Z, o = h.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
907
|
+
t.fillRect(e * X, (r - c) / 2, Ze, c);
|
|
909
908
|
}
|
|
910
909
|
t.restore();
|
|
911
910
|
}, []);
|
|
912
|
-
|
|
911
|
+
L(() => {
|
|
913
912
|
if (!v) return;
|
|
914
913
|
let e = p.current;
|
|
915
914
|
if (!e) return;
|
|
916
915
|
h.current.fill(0), g.current = 0, _.current = 0;
|
|
917
916
|
let n, r = () => {
|
|
918
|
-
if (_.current += 1, _.current >=
|
|
919
|
-
_.current -=
|
|
917
|
+
if (_.current += 1, _.current >= X) {
|
|
918
|
+
_.current -= X;
|
|
920
919
|
let e = t.current;
|
|
921
920
|
if (e) {
|
|
922
921
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -926,7 +925,7 @@ var Ge = {
|
|
|
926
925
|
let r = (t[e] - 128) / 128;
|
|
927
926
|
n += r * r;
|
|
928
927
|
}
|
|
929
|
-
h.current[g.current %
|
|
928
|
+
h.current[g.current % Z] = Math.sqrt(n / t.length), g.current++;
|
|
930
929
|
}
|
|
931
930
|
}
|
|
932
931
|
b(e), n = requestAnimationFrame(r);
|
|
@@ -938,7 +937,7 @@ var Ge = {
|
|
|
938
937
|
v,
|
|
939
938
|
t,
|
|
940
939
|
b
|
|
941
|
-
]),
|
|
940
|
+
]), L(() => {
|
|
942
941
|
let e = p.current;
|
|
943
942
|
if (!e) return;
|
|
944
943
|
let t = new ResizeObserver(() => {
|
|
@@ -946,157 +945,109 @@ var Ge = {
|
|
|
946
945
|
});
|
|
947
946
|
return t.observe(e), () => t.disconnect();
|
|
948
947
|
}, [b]);
|
|
949
|
-
let x = /* @__PURE__ */
|
|
948
|
+
let x = /* @__PURE__ */ W("div", {
|
|
950
949
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
951
|
-
children: [/* @__PURE__ */
|
|
952
|
-
icon: /* @__PURE__ */
|
|
950
|
+
children: [/* @__PURE__ */ U(w, {
|
|
951
|
+
icon: /* @__PURE__ */ U(le, {
|
|
953
952
|
size: u.LG,
|
|
954
953
|
"aria-hidden": !0
|
|
955
954
|
}),
|
|
956
955
|
"aria-label": c,
|
|
957
956
|
onClick: a
|
|
958
|
-
}), v && /* @__PURE__ */
|
|
959
|
-
icon: /* @__PURE__ */
|
|
957
|
+
}), v && /* @__PURE__ */ U(k, {
|
|
958
|
+
icon: /* @__PURE__ */ U(ie, {
|
|
959
|
+
size: u.LG,
|
|
960
|
+
"aria-hidden": !0
|
|
961
|
+
}),
|
|
960
962
|
onClick: () => i?.(),
|
|
961
963
|
"aria-label": s
|
|
962
964
|
})]
|
|
963
965
|
});
|
|
964
|
-
return /* @__PURE__ */
|
|
966
|
+
return /* @__PURE__ */ W("div", {
|
|
965
967
|
className: f,
|
|
966
|
-
children: [/* @__PURE__ */
|
|
968
|
+
children: [/* @__PURE__ */ W("div", {
|
|
967
969
|
style: d,
|
|
968
|
-
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", y &&
|
|
969
|
-
children: [/* @__PURE__ */
|
|
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", y && Xe.wrapperError),
|
|
971
|
+
children: [/* @__PURE__ */ W("div", {
|
|
970
972
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
971
|
-
children: [v && /* @__PURE__ */
|
|
972
|
-
className: o(
|
|
973
|
+
children: [v && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("span", {
|
|
974
|
+
className: o(Xe.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
973
975
|
"aria-hidden": !0
|
|
974
|
-
}), /* @__PURE__ */
|
|
975
|
-
className: o(
|
|
976
|
+
}), /* @__PURE__ */ U("span", {
|
|
977
|
+
className: o(Xe.timer, "flex-shrink-0"),
|
|
976
978
|
"aria-label": l,
|
|
977
|
-
children:
|
|
978
|
-
})] }), /* @__PURE__ */
|
|
979
|
+
children: Qe(n)
|
|
980
|
+
})] }), /* @__PURE__ */ U("canvas", {
|
|
979
981
|
ref: p,
|
|
980
982
|
height: 32,
|
|
981
|
-
className: o(
|
|
983
|
+
className: o(Xe.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
982
984
|
})]
|
|
983
985
|
}), x]
|
|
984
|
-
}), y && r && /* @__PURE__ */
|
|
986
|
+
}), y && r && /* @__PURE__ */ U(m, {
|
|
985
987
|
text: r,
|
|
986
988
|
className: "mt-1 px-1"
|
|
987
989
|
})]
|
|
988
990
|
});
|
|
989
|
-
},
|
|
991
|
+
}, et = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ U(k, {
|
|
990
992
|
"aria-label": n,
|
|
991
993
|
onClick: () => e?.(),
|
|
992
994
|
disabled: t,
|
|
993
995
|
"aria-hidden": r,
|
|
994
|
-
icon: /* @__PURE__ */
|
|
996
|
+
icon: /* @__PURE__ */ U(N, {
|
|
995
997
|
size: u.LG,
|
|
996
998
|
className: "rtl:scale-x-[-1]"
|
|
997
999
|
})
|
|
998
|
-
}),
|
|
999
|
-
icon: /* @__PURE__ */
|
|
1000
|
+
}), tt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ U(j, {
|
|
1001
|
+
icon: /* @__PURE__ */ U(ae, { size: u.LG }),
|
|
1000
1002
|
onClick: () => e?.(),
|
|
1001
1003
|
"aria-label": t
|
|
1002
|
-
}),
|
|
1003
|
-
width: u.SM,
|
|
1004
|
-
height: u.SM,
|
|
1005
|
-
viewBox: "0 0 24 24",
|
|
1006
|
-
fill: "none",
|
|
1007
|
-
"aria-hidden": !0,
|
|
1008
|
-
children: [/* @__PURE__ */ W("defs", { children: /* @__PURE__ */ G("linearGradient", {
|
|
1009
|
-
id: e,
|
|
1010
|
-
x1: "0",
|
|
1011
|
-
y1: "0",
|
|
1012
|
-
x2: "24",
|
|
1013
|
-
y2: "24",
|
|
1014
|
-
gradientUnits: "userSpaceOnUse",
|
|
1015
|
-
children: [/* @__PURE__ */ W("stop", {
|
|
1016
|
-
offset: "0%",
|
|
1017
|
-
stopColor: "#4b7be6"
|
|
1018
|
-
}), /* @__PURE__ */ W("stop", {
|
|
1019
|
-
offset: "100%",
|
|
1020
|
-
stopColor: "#9355f4"
|
|
1021
|
-
})]
|
|
1022
|
-
}) }), /* @__PURE__ */ W("path", {
|
|
1023
|
-
d: "M5 12l5 5L20 7",
|
|
1024
|
-
stroke: `url(#${e})`,
|
|
1025
|
-
strokeWidth: "2",
|
|
1026
|
-
strokeLinecap: "round",
|
|
1027
|
-
strokeLinejoin: "round"
|
|
1028
|
-
})]
|
|
1029
|
-
}), at = {
|
|
1030
|
-
tabContainer: "_tabContainer_153ct_1",
|
|
1031
|
-
tabActive: "_tabActive_153ct_13"
|
|
1032
|
-
};
|
|
1033
|
-
L(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
1034
|
-
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
1035
|
-
return /* @__PURE__ */ W("div", {
|
|
1036
|
-
className: "flex flex-nowrap gap-1",
|
|
1037
|
-
role: "tablist",
|
|
1038
|
-
children: e.map((e) => {
|
|
1039
|
-
let r = t === e.id;
|
|
1040
|
-
return /* @__PURE__ */ W("div", {
|
|
1041
|
-
role: "tab",
|
|
1042
|
-
"aria-selected": r,
|
|
1043
|
-
className: "contents",
|
|
1044
|
-
children: /* @__PURE__ */ W(S, {
|
|
1045
|
-
label: e.label,
|
|
1046
|
-
selected: r,
|
|
1047
|
-
onClick: () => n(e.id),
|
|
1048
|
-
className: o("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, at.tabContainer, r && at.tabActive)
|
|
1049
|
-
})
|
|
1050
|
-
}, e.id);
|
|
1051
|
-
})
|
|
1052
|
-
});
|
|
1053
|
-
});
|
|
1054
|
-
var ot = ({ size: e = 20 }) => /* @__PURE__ */ W(y, {
|
|
1004
|
+
}), nt = ({ size: e = 20 }) => /* @__PURE__ */ U(y, {
|
|
1055
1005
|
variant: b.Circular,
|
|
1056
1006
|
width: e,
|
|
1057
1007
|
height: e,
|
|
1058
1008
|
active: !0
|
|
1059
|
-
}),
|
|
1009
|
+
}), rt = ({ loadingLabel: e }) => /* @__PURE__ */ W("span", {
|
|
1060
1010
|
className: "flex min-w-0 flex-1 items-center",
|
|
1061
|
-
children: [/* @__PURE__ */
|
|
1011
|
+
children: [/* @__PURE__ */ U(y, {
|
|
1062
1012
|
variant: b.Text,
|
|
1063
1013
|
width: "100%",
|
|
1064
1014
|
height: 16,
|
|
1065
1015
|
active: !0
|
|
1066
|
-
}), e && /* @__PURE__ */
|
|
1016
|
+
}), e && /* @__PURE__ */ U("span", {
|
|
1067
1017
|
className: "sr-only",
|
|
1068
1018
|
children: e
|
|
1069
1019
|
})]
|
|
1070
|
-
}),
|
|
1020
|
+
}), it = ({ loadingLabel: e }) => /* @__PURE__ */ U("div", {
|
|
1071
1021
|
role: "status",
|
|
1072
1022
|
"aria-label": e,
|
|
1073
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1023
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ W("div", {
|
|
1074
1024
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1075
1025
|
"aria-hidden": "true",
|
|
1076
|
-
children: [/* @__PURE__ */
|
|
1026
|
+
children: [/* @__PURE__ */ U(nt, {}), /* @__PURE__ */ U(rt, {})]
|
|
1077
1027
|
}, t))
|
|
1078
|
-
}),
|
|
1028
|
+
}), at = (e) => e.displayName ?? e.id, ot = (e, t) => {
|
|
1079
1029
|
let n = t.trim().toLowerCase();
|
|
1080
|
-
return n ? e.filter((e) =>
|
|
1081
|
-
},
|
|
1030
|
+
return n ? e.filter((e) => at(e).toLowerCase().includes(n)) : e;
|
|
1031
|
+
}, st = (e, t, r, i = 18, a) => /* @__PURE__ */ U(n, {
|
|
1082
1032
|
src: e,
|
|
1083
1033
|
size: i,
|
|
1084
1034
|
labels: { tooltip: a },
|
|
1085
1035
|
initialsName: r
|
|
1086
|
-
}),
|
|
1087
|
-
searchHeader: "
|
|
1088
|
-
selectedItem: "
|
|
1089
|
-
|
|
1090
|
-
|
|
1036
|
+
}), ct = {
|
|
1037
|
+
searchHeader: "_searchHeader_ibyso_1",
|
|
1038
|
+
selectedItem: "_selectedItem_ibyso_5",
|
|
1039
|
+
selectedItemCheck: "_selectedItemCheck_ibyso_9"
|
|
1040
|
+
}, 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 [d, f] = V(""), p = z(() => e?.find((e) => e.id === t), [e, t]), m = r?.loading !== void 0, h = z(() => m ? /* @__PURE__ */ U(nt, { size: u.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", u.LG), [m, p]), g = p?.displayName ?? p?.id;
|
|
1091
1042
|
return {
|
|
1092
|
-
selectorIcon:
|
|
1093
|
-
selectorAriaLabel:
|
|
1094
|
-
selectedLabel:
|
|
1095
|
-
menuItems:
|
|
1096
|
-
if (
|
|
1043
|
+
selectorIcon: h,
|
|
1044
|
+
selectorAriaLabel: g ? `${r?.ariaLabel ?? "Select model"}: ${g}` : r?.ariaLabel ?? "Select model",
|
|
1045
|
+
selectedLabel: g,
|
|
1046
|
+
menuItems: z(() => {
|
|
1047
|
+
if (m) return Array.from({ length: 7 }, (e, t) => ({
|
|
1097
1048
|
key: `__loading-${t}`,
|
|
1098
|
-
icon: /* @__PURE__ */
|
|
1099
|
-
label: /* @__PURE__ */
|
|
1049
|
+
icon: /* @__PURE__ */ U(nt, {}),
|
|
1050
|
+
label: /* @__PURE__ */ U(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1100
1051
|
disabled: !0
|
|
1101
1052
|
}));
|
|
1102
1053
|
if (!e || e.length === 0) {
|
|
@@ -1107,54 +1058,64 @@ var ot = ({ size: e = 20 }) => /* @__PURE__ */ W(y, {
|
|
|
1107
1058
|
disabled: !0
|
|
1108
1059
|
}] : [];
|
|
1109
1060
|
}
|
|
1110
|
-
return
|
|
1061
|
+
return ot(e, d).map((e) => {
|
|
1111
1062
|
let r = e.id === t;
|
|
1112
1063
|
return {
|
|
1113
1064
|
key: e.id,
|
|
1114
|
-
label: /* @__PURE__ */
|
|
1065
|
+
label: /* @__PURE__ */ W("span", {
|
|
1115
1066
|
className: "flex w-full items-center justify-between gap-2",
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1067
|
+
style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
|
|
1068
|
+
children: [/* @__PURE__ */ U(T, {
|
|
1069
|
+
text: at(e),
|
|
1070
|
+
query: d,
|
|
1119
1071
|
maxLines: 1
|
|
1120
|
-
}), r && /* @__PURE__ */
|
|
1072
|
+
}), r && /* @__PURE__ */ U(P, {
|
|
1073
|
+
size: u.SM,
|
|
1074
|
+
stroke: 2,
|
|
1075
|
+
className: c,
|
|
1076
|
+
"aria-hidden": !0
|
|
1077
|
+
})]
|
|
1121
1078
|
}),
|
|
1122
|
-
icon:
|
|
1079
|
+
icon: st(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1123
1080
|
onClick: () => n?.(e.id),
|
|
1124
|
-
className: r ?
|
|
1081
|
+
className: r ? s : void 0
|
|
1125
1082
|
};
|
|
1126
1083
|
});
|
|
1127
1084
|
}, [
|
|
1128
1085
|
e,
|
|
1086
|
+
m,
|
|
1129
1087
|
d,
|
|
1130
|
-
s,
|
|
1131
1088
|
t,
|
|
1132
1089
|
r,
|
|
1133
1090
|
n,
|
|
1134
|
-
|
|
1091
|
+
s,
|
|
1092
|
+
c,
|
|
1093
|
+
l?.selectedItemCheck
|
|
1135
1094
|
]),
|
|
1136
|
-
menuHeader:
|
|
1095
|
+
menuHeader: z(() => !m && e && e.length > 0 ? /* @__PURE__ */ U("div", {
|
|
1096
|
+
style: a({ "--ms-search-header-bg": l?.searchHeaderBackground }),
|
|
1137
1097
|
className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1138
|
-
children: /* @__PURE__ */
|
|
1139
|
-
value:
|
|
1098
|
+
children: /* @__PURE__ */ U(v, {
|
|
1099
|
+
value: d,
|
|
1140
1100
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1141
|
-
size:
|
|
1101
|
+
size: C.Small,
|
|
1142
1102
|
wrapperClassName: "border-0",
|
|
1143
|
-
onChange:
|
|
1103
|
+
onChange: f
|
|
1144
1104
|
})
|
|
1145
1105
|
}) : void 0, [
|
|
1146
1106
|
e,
|
|
1107
|
+
m,
|
|
1147
1108
|
d,
|
|
1148
|
-
s,
|
|
1149
1109
|
r,
|
|
1150
|
-
i
|
|
1110
|
+
i,
|
|
1111
|
+
l?.searchHeaderBackground
|
|
1151
1112
|
]),
|
|
1152
1113
|
onOpenChange: (e) => {
|
|
1153
|
-
e ||
|
|
1114
|
+
e || f("");
|
|
1154
1115
|
}
|
|
1155
1116
|
};
|
|
1156
|
-
},
|
|
1157
|
-
function
|
|
1117
|
+
}, ut = typeof window < "u" ? R : L;
|
|
1118
|
+
function dt(e) {
|
|
1158
1119
|
if (e !== void 0) switch (typeof e) {
|
|
1159
1120
|
case "number": return e;
|
|
1160
1121
|
case "string":
|
|
@@ -1162,15 +1123,15 @@ function ht(e) {
|
|
|
1162
1123
|
break;
|
|
1163
1124
|
}
|
|
1164
1125
|
}
|
|
1165
|
-
function
|
|
1166
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1167
|
-
styleHeight:
|
|
1168
|
-
styleWidth:
|
|
1169
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1126
|
+
function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1127
|
+
let { styleHeight: s, styleWidth: c } = z(() => ({
|
|
1128
|
+
styleHeight: dt(o?.height),
|
|
1129
|
+
styleWidth: dt(o?.width)
|
|
1130
|
+
}), [o?.height, o?.width]), [l, u] = V({
|
|
1170
1131
|
height: t,
|
|
1171
1132
|
width: n
|
|
1172
1133
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1173
|
-
return
|
|
1134
|
+
return ut(() => {
|
|
1174
1135
|
if (i === null || d) return;
|
|
1175
1136
|
let t = new ResizeObserver((e) => {
|
|
1176
1137
|
for (let t of e) {
|
|
@@ -1190,7 +1151,7 @@ function gt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1190
1151
|
i,
|
|
1191
1152
|
s,
|
|
1192
1153
|
c
|
|
1193
|
-
]),
|
|
1154
|
+
]), z(() => ({
|
|
1194
1155
|
height: s ?? l.height,
|
|
1195
1156
|
width: c ?? l.width
|
|
1196
1157
|
}), [
|
|
@@ -1199,26 +1160,26 @@ function gt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1199
1160
|
c
|
|
1200
1161
|
]);
|
|
1201
1162
|
}
|
|
1202
|
-
function
|
|
1203
|
-
let t =
|
|
1163
|
+
function pt(e) {
|
|
1164
|
+
let t = B(() => {
|
|
1204
1165
|
throw Error("Cannot call during render.");
|
|
1205
1166
|
});
|
|
1206
|
-
return
|
|
1167
|
+
return ut(() => {
|
|
1207
1168
|
t.current = e;
|
|
1208
|
-
}, [e]),
|
|
1169
|
+
}, [e]), I((e) => t.current?.(e), [t]);
|
|
1209
1170
|
}
|
|
1210
|
-
var
|
|
1211
|
-
function
|
|
1212
|
-
if (
|
|
1171
|
+
var mt = null;
|
|
1172
|
+
function ht(e = !1) {
|
|
1173
|
+
if (mt === null || e) {
|
|
1213
1174
|
let e = document.createElement("div"), t = e.style;
|
|
1214
1175
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1215
1176
|
let n = document.createElement("div"), r = n.style;
|
|
1216
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1177
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? mt = "positive-descending" : (e.scrollLeft = 1, mt = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), mt;
|
|
1217
1178
|
}
|
|
1218
|
-
return
|
|
1179
|
+
return mt;
|
|
1219
1180
|
}
|
|
1220
|
-
function
|
|
1221
|
-
if (t === "horizontal" && n) switch (
|
|
1181
|
+
function gt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1182
|
+
if (t === "horizontal" && n) switch (ht()) {
|
|
1222
1183
|
case "negative": return -r;
|
|
1223
1184
|
case "positive-descending":
|
|
1224
1185
|
if (e) {
|
|
@@ -1229,26 +1190,26 @@ function bt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1229
1190
|
}
|
|
1230
1191
|
return r;
|
|
1231
1192
|
}
|
|
1232
|
-
function
|
|
1193
|
+
function Q(e, t = "Assertion error") {
|
|
1233
1194
|
if (!e) throw console.error(t), Error(t);
|
|
1234
1195
|
}
|
|
1235
|
-
function
|
|
1196
|
+
function _t(e, t) {
|
|
1236
1197
|
if (e === t) return !0;
|
|
1237
|
-
if (!!e != !!t || (
|
|
1198
|
+
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1238
1199
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1239
1200
|
return !0;
|
|
1240
1201
|
}
|
|
1241
|
-
function
|
|
1202
|
+
function vt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1242
1203
|
if (t === 0) return 0;
|
|
1243
1204
|
if (typeof n == "number") return t * n;
|
|
1244
1205
|
{
|
|
1245
1206
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1246
|
-
return
|
|
1207
|
+
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1247
1208
|
}
|
|
1248
1209
|
}
|
|
1249
|
-
function
|
|
1210
|
+
function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1250
1211
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1251
|
-
let s =
|
|
1212
|
+
let s = vt({
|
|
1252
1213
|
cachedBounds: t,
|
|
1253
1214
|
itemCount: r,
|
|
1254
1215
|
itemSize: i
|
|
@@ -1260,7 +1221,7 @@ function St({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1260
1221
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1261
1222
|
}
|
|
1262
1223
|
}
|
|
1263
|
-
function
|
|
1224
|
+
function bt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1264
1225
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1265
1226
|
for (; u < a;) {
|
|
1266
1227
|
let n = e.get(u);
|
|
@@ -1279,11 +1240,11 @@ function $({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
|
|
|
1279
1240
|
stopIndexOverscan: l
|
|
1280
1241
|
};
|
|
1281
1242
|
}
|
|
1282
|
-
function
|
|
1243
|
+
function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1283
1244
|
let r = /* @__PURE__ */ new Map();
|
|
1284
1245
|
return {
|
|
1285
1246
|
get(i) {
|
|
1286
|
-
for (
|
|
1247
|
+
for (Q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1287
1248
|
let e = r.size, a;
|
|
1288
1249
|
switch (typeof n) {
|
|
1289
1250
|
case "function":
|
|
@@ -1299,14 +1260,14 @@ function Ct({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1299
1260
|
});
|
|
1300
1261
|
else {
|
|
1301
1262
|
let t = r.get(e - 1);
|
|
1302
|
-
|
|
1263
|
+
Q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1303
1264
|
scrollOffset: t.scrollOffset + t.size,
|
|
1304
1265
|
size: a
|
|
1305
1266
|
});
|
|
1306
1267
|
}
|
|
1307
1268
|
}
|
|
1308
1269
|
let a = r.get(i);
|
|
1309
|
-
return
|
|
1270
|
+
return Q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1310
1271
|
},
|
|
1311
1272
|
set(e, t) {
|
|
1312
1273
|
r.set(e, t);
|
|
@@ -1316,8 +1277,8 @@ function Ct({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1316
1277
|
}
|
|
1317
1278
|
};
|
|
1318
1279
|
}
|
|
1319
|
-
function
|
|
1320
|
-
return
|
|
1280
|
+
function St({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1281
|
+
return z(() => xt({
|
|
1321
1282
|
itemCount: e,
|
|
1322
1283
|
itemProps: t,
|
|
1323
1284
|
itemSize: n
|
|
@@ -1327,11 +1288,11 @@ function wt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1327
1288
|
n
|
|
1328
1289
|
]);
|
|
1329
1290
|
}
|
|
1330
|
-
function
|
|
1291
|
+
function $({ containerSize: e, itemSize: t }) {
|
|
1331
1292
|
let n;
|
|
1332
1293
|
switch (typeof t) {
|
|
1333
1294
|
case "string":
|
|
1334
|
-
|
|
1295
|
+
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;
|
|
1335
1296
|
break;
|
|
1336
1297
|
default:
|
|
1337
1298
|
n = t;
|
|
@@ -1339,21 +1300,21 @@ function Tt({ containerSize: e, itemSize: t }) {
|
|
|
1339
1300
|
}
|
|
1340
1301
|
return n;
|
|
1341
1302
|
}
|
|
1342
|
-
function
|
|
1343
|
-
let { height: u = n, width: d = n } =
|
|
1303
|
+
function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1304
|
+
let { height: u = n, width: d = n } = ft({
|
|
1344
1305
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1345
1306
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1346
1307
|
element: e,
|
|
1347
1308
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1348
1309
|
style: t
|
|
1349
|
-
}), f =
|
|
1310
|
+
}), f = B({
|
|
1350
1311
|
height: 0,
|
|
1351
1312
|
width: 0
|
|
1352
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1313
|
+
}), p = r === "vertical" ? u : d, m = $({
|
|
1353
1314
|
containerSize: p,
|
|
1354
1315
|
itemSize: s
|
|
1355
1316
|
});
|
|
1356
|
-
|
|
1317
|
+
R(() => {
|
|
1357
1318
|
if (typeof c == "function") {
|
|
1358
1319
|
let e = f.current;
|
|
1359
1320
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1366,11 +1327,11 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1366
1327
|
c,
|
|
1367
1328
|
d
|
|
1368
1329
|
]);
|
|
1369
|
-
let h =
|
|
1330
|
+
let h = St({
|
|
1370
1331
|
itemCount: a,
|
|
1371
1332
|
itemProps: o,
|
|
1372
1333
|
itemSize: m
|
|
1373
|
-
}), g =
|
|
1334
|
+
}), g = I((e) => h.get(e), [h]), [_, v] = V(() => bt({
|
|
1374
1335
|
cachedBounds: h,
|
|
1375
1336
|
containerScrollOffset: 0,
|
|
1376
1337
|
containerSize: p,
|
|
@@ -1381,7 +1342,7 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1381
1342
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1382
1343
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1383
1344
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1384
|
-
}, C =
|
|
1345
|
+
}, C = I(() => vt({
|
|
1385
1346
|
cachedBounds: h,
|
|
1386
1347
|
itemCount: a,
|
|
1387
1348
|
itemSize: m
|
|
@@ -1389,9 +1350,9 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1389
1350
|
h,
|
|
1390
1351
|
a,
|
|
1391
1352
|
m
|
|
1392
|
-
]), w =
|
|
1353
|
+
]), w = I((t) => bt({
|
|
1393
1354
|
cachedBounds: h,
|
|
1394
|
-
containerScrollOffset:
|
|
1355
|
+
containerScrollOffset: gt({
|
|
1395
1356
|
containerElement: e,
|
|
1396
1357
|
direction: r,
|
|
1397
1358
|
isRtl: i,
|
|
@@ -1409,19 +1370,19 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1409
1370
|
a,
|
|
1410
1371
|
l
|
|
1411
1372
|
]);
|
|
1412
|
-
return
|
|
1373
|
+
return ut(() => {
|
|
1413
1374
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1414
1375
|
}, [
|
|
1415
1376
|
e,
|
|
1416
1377
|
r,
|
|
1417
1378
|
w
|
|
1418
|
-
]),
|
|
1379
|
+
]), ut(() => {
|
|
1419
1380
|
if (!e) return;
|
|
1420
1381
|
let t = () => {
|
|
1421
1382
|
v((t) => {
|
|
1422
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1383
|
+
let { scrollLeft: n, scrollTop: o } = e, s = bt({
|
|
1423
1384
|
cachedBounds: h,
|
|
1424
|
-
containerScrollOffset:
|
|
1385
|
+
containerScrollOffset: gt({
|
|
1425
1386
|
containerElement: e,
|
|
1426
1387
|
direction: r,
|
|
1427
1388
|
isRtl: i,
|
|
@@ -1431,7 +1392,7 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1431
1392
|
itemCount: a,
|
|
1432
1393
|
overscanCount: l
|
|
1433
1394
|
});
|
|
1434
|
-
return
|
|
1395
|
+
return _t(s, t) ? t : s;
|
|
1435
1396
|
});
|
|
1436
1397
|
};
|
|
1437
1398
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1447,8 +1408,8 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1447
1408
|
]), {
|
|
1448
1409
|
getCellBounds: g,
|
|
1449
1410
|
getEstimatedSize: C,
|
|
1450
|
-
scrollToIndex:
|
|
1451
|
-
let s =
|
|
1411
|
+
scrollToIndex: pt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1412
|
+
let s = yt({
|
|
1452
1413
|
align: t,
|
|
1453
1414
|
cachedBounds: h,
|
|
1454
1415
|
containerScrollOffset: n,
|
|
@@ -1458,14 +1419,14 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1458
1419
|
itemSize: m
|
|
1459
1420
|
});
|
|
1460
1421
|
if (e) {
|
|
1461
|
-
if (s =
|
|
1422
|
+
if (s = gt({
|
|
1462
1423
|
containerElement: e,
|
|
1463
1424
|
direction: r,
|
|
1464
1425
|
isRtl: i,
|
|
1465
1426
|
scrollOffset: s
|
|
1466
1427
|
}), typeof e.scrollTo != "function") {
|
|
1467
1428
|
let e = w(s);
|
|
1468
|
-
|
|
1429
|
+
_t(_, e) || v(e);
|
|
1469
1430
|
}
|
|
1470
1431
|
return s;
|
|
1471
1432
|
}
|
|
@@ -1476,30 +1437,30 @@ function Et({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1476
1437
|
stopIndexVisible: x
|
|
1477
1438
|
};
|
|
1478
1439
|
}
|
|
1479
|
-
function
|
|
1480
|
-
return
|
|
1440
|
+
function wt(e) {
|
|
1441
|
+
return z(() => e, Object.values(e));
|
|
1481
1442
|
}
|
|
1482
|
-
function
|
|
1443
|
+
function Tt(e, t) {
|
|
1483
1444
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1484
|
-
return
|
|
1445
|
+
return _t(n, a) && _t(r, o) && _t(i, s);
|
|
1485
1446
|
}
|
|
1486
|
-
function
|
|
1447
|
+
function Et(e) {
|
|
1487
1448
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1488
1449
|
}
|
|
1489
|
-
var
|
|
1490
|
-
function
|
|
1491
|
-
let m =
|
|
1450
|
+
var Dt = "data-react-window-index";
|
|
1451
|
+
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(() => fe(s, Tt), [s]), [g, _] = V(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Ct({
|
|
1492
1453
|
containerElement: g,
|
|
1493
1454
|
containerStyle: f,
|
|
1494
1455
|
defaultContainerSize: n,
|
|
1495
1456
|
direction: "vertical",
|
|
1496
1457
|
itemCount: c,
|
|
1497
1458
|
itemProps: m,
|
|
1498
|
-
itemSize:
|
|
1459
|
+
itemSize: z(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1499
1460
|
onResize: i,
|
|
1500
1461
|
overscanCount: o
|
|
1501
1462
|
});
|
|
1502
|
-
|
|
1463
|
+
pe(r, () => ({
|
|
1503
1464
|
get element() {
|
|
1504
1465
|
return g;
|
|
1505
1466
|
},
|
|
@@ -1514,12 +1475,12 @@ function jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1514
1475
|
top: r
|
|
1515
1476
|
});
|
|
1516
1477
|
}
|
|
1517
|
-
}), [g, x]),
|
|
1478
|
+
}), [g, x]), ut(() => {
|
|
1518
1479
|
if (!g) return;
|
|
1519
1480
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1520
1481
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1521
1482
|
let n = `${S + t}`;
|
|
1522
|
-
return e.setAttribute(
|
|
1483
|
+
return e.setAttribute(Dt, n), !0;
|
|
1523
1484
|
});
|
|
1524
1485
|
if (v) return l.observeRowElements(e);
|
|
1525
1486
|
}, [
|
|
@@ -1528,7 +1489,7 @@ function jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1528
1489
|
l,
|
|
1529
1490
|
S,
|
|
1530
1491
|
w
|
|
1531
|
-
]),
|
|
1492
|
+
]), L(() => {
|
|
1532
1493
|
S >= 0 && w >= 0 && a && a({
|
|
1533
1494
|
startIndex: C,
|
|
1534
1495
|
stopIndex: T
|
|
@@ -1543,7 +1504,7 @@ function jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1543
1504
|
w,
|
|
1544
1505
|
T
|
|
1545
1506
|
]);
|
|
1546
|
-
let E =
|
|
1507
|
+
let E = z(() => {
|
|
1547
1508
|
let e = [];
|
|
1548
1509
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1549
1510
|
let n = y(t);
|
|
@@ -1574,7 +1535,7 @@ function jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1574
1535
|
m,
|
|
1575
1536
|
S,
|
|
1576
1537
|
w
|
|
1577
|
-
]), D = /* @__PURE__ */
|
|
1538
|
+
]), D = /* @__PURE__ */ U("div", {
|
|
1578
1539
|
"aria-hidden": !0,
|
|
1579
1540
|
style: {
|
|
1580
1541
|
height: b(),
|
|
@@ -1596,46 +1557,46 @@ function jt({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1596
1557
|
}
|
|
1597
1558
|
}, E, e, D);
|
|
1598
1559
|
}
|
|
1599
|
-
var
|
|
1560
|
+
var kt = {
|
|
1600
1561
|
divider: "_divider_f1dq4_1",
|
|
1601
1562
|
item: "_item_f1dq4_5",
|
|
1602
1563
|
itemIcon: "_itemIcon_f1dq4_15",
|
|
1603
1564
|
checkIcon: "_checkIcon_f1dq4_19",
|
|
1604
1565
|
stateLabel: "_stateLabel_f1dq4_23"
|
|
1605
|
-
},
|
|
1606
|
-
let d = r[e], f =
|
|
1607
|
-
return /* @__PURE__ */
|
|
1566
|
+
}, At = 44, jt = 8, Mt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1567
|
+
let d = r[e], f = st(d.iconUrl, d.type, d.displayName ?? d.id, u.SM), p = d.id === i;
|
|
1568
|
+
return /* @__PURE__ */ U("div", {
|
|
1608
1569
|
style: t,
|
|
1609
1570
|
...n,
|
|
1610
|
-
children: /* @__PURE__ */
|
|
1571
|
+
children: /* @__PURE__ */ U(l, {
|
|
1611
1572
|
type: "button",
|
|
1612
|
-
className: o(
|
|
1613
|
-
iconBefore: /* @__PURE__ */
|
|
1614
|
-
className:
|
|
1573
|
+
className: o(kt.item, "h-full w-full gap-3 px-4"),
|
|
1574
|
+
iconBefore: /* @__PURE__ */ U("span", {
|
|
1575
|
+
className: kt.itemIcon,
|
|
1615
1576
|
children: f
|
|
1616
1577
|
}),
|
|
1617
|
-
label: /* @__PURE__ */
|
|
1578
|
+
label: /* @__PURE__ */ W("span", {
|
|
1618
1579
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1619
|
-
children: [/* @__PURE__ */
|
|
1580
|
+
children: [/* @__PURE__ */ U(T, {
|
|
1620
1581
|
text: d.displayName ?? d.id,
|
|
1621
1582
|
query: s,
|
|
1622
1583
|
maxLines: 1,
|
|
1623
1584
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1624
|
-
}), p && /* @__PURE__ */
|
|
1585
|
+
}), p && /* @__PURE__ */ U(P, {
|
|
1625
1586
|
size: u.SM,
|
|
1626
|
-
className:
|
|
1587
|
+
className: kt.checkIcon,
|
|
1627
1588
|
"aria-hidden": !0
|
|
1628
1589
|
})]
|
|
1629
1590
|
}),
|
|
1630
1591
|
onClick: () => c(d.id)
|
|
1631
1592
|
})
|
|
1632
1593
|
});
|
|
1633
|
-
},
|
|
1634
|
-
let [_, y] =
|
|
1635
|
-
|
|
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: m = "dial-body-semi-text", labelClassName: h = "dial-small-text", colors: g }) => {
|
|
1595
|
+
let [_, y] = V("");
|
|
1596
|
+
L(() => {
|
|
1636
1597
|
e || y("");
|
|
1637
1598
|
}, [e]);
|
|
1638
|
-
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0,
|
|
1599
|
+
let b = s && s.length > 0, x = u !== void 0, S = !b && !x ? d ?? f : void 0, w = b ? ot(s, _) : [], T = (e) => {
|
|
1639
1600
|
l(e), i();
|
|
1640
1601
|
}, E = a({
|
|
1641
1602
|
"--ci-sheet-divider": g?.divider,
|
|
@@ -1645,7 +1606,7 @@ var Mt = {
|
|
|
1645
1606
|
"--ci-sheet-icon": g?.itemIcon,
|
|
1646
1607
|
"--ci-check-icon": g?.checkIcon
|
|
1647
1608
|
});
|
|
1648
|
-
return /* @__PURE__ */
|
|
1609
|
+
return /* @__PURE__ */ U(G, {
|
|
1649
1610
|
isOpen: e,
|
|
1650
1611
|
title: t,
|
|
1651
1612
|
closeLabel: n,
|
|
@@ -1654,30 +1615,30 @@ var Mt = {
|
|
|
1654
1615
|
titleClassName: m,
|
|
1655
1616
|
className: "max-h-[80dvh]",
|
|
1656
1617
|
colors: g?.shell,
|
|
1657
|
-
children: /* @__PURE__ */
|
|
1618
|
+
children: /* @__PURE__ */ W("div", {
|
|
1658
1619
|
className: "contents",
|
|
1659
1620
|
style: E,
|
|
1660
|
-
children: [b && !x && /* @__PURE__ */
|
|
1621
|
+
children: [b && !x && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("div", {
|
|
1661
1622
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1662
|
-
children: /* @__PURE__ */
|
|
1623
|
+
children: /* @__PURE__ */ U(v, {
|
|
1663
1624
|
value: _,
|
|
1664
1625
|
placeholder: r,
|
|
1665
|
-
size:
|
|
1626
|
+
size: C.Standard,
|
|
1666
1627
|
onChange: y
|
|
1667
1628
|
})
|
|
1668
|
-
}), /* @__PURE__ */
|
|
1629
|
+
}), /* @__PURE__ */ U("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), x ? /* @__PURE__ */ U(it, { loadingLabel: u }) : S ? /* @__PURE__ */ U("div", {
|
|
1669
1630
|
role: "list",
|
|
1670
|
-
className: o(
|
|
1631
|
+
className: o(kt.stateLabel, h, "px-4 py-4"),
|
|
1671
1632
|
children: S
|
|
1672
|
-
}) : /* @__PURE__ */
|
|
1633
|
+
}) : /* @__PURE__ */ U(Ot, {
|
|
1673
1634
|
role: "list",
|
|
1674
1635
|
className: "overflow-y-auto",
|
|
1675
|
-
style: { height: Math.min(
|
|
1676
|
-
rowComponent:
|
|
1677
|
-
rowCount:
|
|
1678
|
-
rowHeight:
|
|
1636
|
+
style: { height: Math.min(w.length, jt) * At },
|
|
1637
|
+
rowComponent: Mt,
|
|
1638
|
+
rowCount: w.length,
|
|
1639
|
+
rowHeight: At,
|
|
1679
1640
|
rowProps: {
|
|
1680
|
-
items:
|
|
1641
|
+
items: w,
|
|
1681
1642
|
selectedDeploymentId: c,
|
|
1682
1643
|
labelClassName: h,
|
|
1683
1644
|
query: _,
|
|
@@ -1686,23 +1647,23 @@ var Mt = {
|
|
|
1686
1647
|
})]
|
|
1687
1648
|
})
|
|
1688
1649
|
});
|
|
1689
|
-
},
|
|
1690
|
-
let [_, v] =
|
|
1650
|
+
}, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isInputDisabled: s = !1, isDisabled: c = !1, style: l, modelPickerOverlay: d, isPickerOpen: m, onPickerToggle: h, onPickerOpenChange: g }) => {
|
|
1651
|
+
let [_, v] = V(!1), { selectorIcon: y, selectorAriaLabel: b, selectedLabel: x, menuItems: T, menuHeader: E, onOpenChange: D } = lt({
|
|
1691
1652
|
deployments: e,
|
|
1692
1653
|
selectedDeploymentId: t,
|
|
1693
1654
|
onDeploymentChange: n,
|
|
1694
1655
|
modelSelectorLabels: r
|
|
1695
1656
|
});
|
|
1696
1657
|
if (!e) return null;
|
|
1697
|
-
let O = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, k = /* @__PURE__ */
|
|
1658
|
+
let O = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, k = /* @__PURE__ */ U(ee, {
|
|
1698
1659
|
size: u.SM,
|
|
1699
1660
|
className: Y.modelSelectorCaret,
|
|
1700
1661
|
"aria-hidden": !0
|
|
1701
1662
|
});
|
|
1702
|
-
return a ? /* @__PURE__ */
|
|
1663
|
+
return a ? /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U(S, {
|
|
1703
1664
|
tooltip: x,
|
|
1704
|
-
children: /* @__PURE__ */
|
|
1705
|
-
icon: /* @__PURE__ */
|
|
1665
|
+
children: /* @__PURE__ */ U(w, {
|
|
1666
|
+
icon: /* @__PURE__ */ W("div", {
|
|
1706
1667
|
className: "flex items-center gap-1",
|
|
1707
1668
|
children: [y, k]
|
|
1708
1669
|
}),
|
|
@@ -1712,14 +1673,14 @@ var Mt = {
|
|
|
1712
1673
|
},
|
|
1713
1674
|
className: o(Y.modelSelectorButton, O)
|
|
1714
1675
|
})
|
|
1715
|
-
}), d ? /* @__PURE__ */
|
|
1676
|
+
}), d ? /* @__PURE__ */ U(G, {
|
|
1716
1677
|
isOpen: _,
|
|
1717
1678
|
title: r?.ariaLabel ?? "Select model",
|
|
1718
1679
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1719
1680
|
onClose: () => v(!1),
|
|
1720
1681
|
style: l,
|
|
1721
1682
|
children: d(() => v(!1))
|
|
1722
|
-
}) : /* @__PURE__ */
|
|
1683
|
+
}) : /* @__PURE__ */ U(Nt, {
|
|
1723
1684
|
isOpen: _,
|
|
1724
1685
|
title: r?.ariaLabel ?? "Select model",
|
|
1725
1686
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1732,7 +1693,7 @@ var Mt = {
|
|
|
1732
1693
|
errorLabel: r?.error,
|
|
1733
1694
|
emptyLabel: r?.empty,
|
|
1734
1695
|
style: l
|
|
1735
|
-
})] }) : d ? /* @__PURE__ */
|
|
1696
|
+
})] }) : d ? /* @__PURE__ */ U(f, {
|
|
1736
1697
|
placement: "top-end",
|
|
1737
1698
|
matchReferenceWidth: !1,
|
|
1738
1699
|
open: m,
|
|
@@ -1741,9 +1702,9 @@ var Mt = {
|
|
|
1741
1702
|
outsideClosable: !0,
|
|
1742
1703
|
renderOverlay: () => d(() => g?.(!1)),
|
|
1743
1704
|
listClassName: "cp-dropdown-overlay !w-[320px]",
|
|
1744
|
-
children: /* @__PURE__ */
|
|
1705
|
+
children: /* @__PURE__ */ U(S, {
|
|
1745
1706
|
tooltip: x,
|
|
1746
|
-
children: /* @__PURE__ */
|
|
1707
|
+
children: /* @__PURE__ */ W("button", {
|
|
1747
1708
|
type: "button",
|
|
1748
1709
|
"aria-label": b,
|
|
1749
1710
|
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),
|
|
@@ -1753,29 +1714,29 @@ var Mt = {
|
|
|
1753
1714
|
children: [y, k]
|
|
1754
1715
|
})
|
|
1755
1716
|
})
|
|
1756
|
-
}) : /* @__PURE__ */
|
|
1717
|
+
}) : /* @__PURE__ */ U("div", {
|
|
1757
1718
|
className: o(c && O),
|
|
1758
1719
|
"aria-disabled": c || void 0,
|
|
1759
|
-
children: /* @__PURE__ */
|
|
1720
|
+
children: /* @__PURE__ */ U(S, {
|
|
1760
1721
|
tooltip: x,
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1722
|
+
children: /* @__PURE__ */ U(p, {
|
|
1762
1723
|
icon: y,
|
|
1763
1724
|
ariaLabel: b,
|
|
1764
|
-
items:
|
|
1725
|
+
items: T,
|
|
1765
1726
|
menuHeader: E,
|
|
1766
1727
|
placement: "bottom-end",
|
|
1767
1728
|
matchReferenceWidth: !1,
|
|
1768
1729
|
listClassName: "cp-dropdown-overlay !w-[240px] !max-h-80",
|
|
1769
1730
|
onOpenChange: c ? void 0 : D,
|
|
1770
|
-
size:
|
|
1731
|
+
size: C.Standard,
|
|
1771
1732
|
caretIcon: k,
|
|
1772
1733
|
iconClassName: s || c ? O : void 0,
|
|
1773
1734
|
buttonClassName: o("bg-transparent", Y.modelSelectorButton, (s || c) && O && Y.modelSelectorButtonDisabled)
|
|
1774
1735
|
})
|
|
1775
1736
|
})
|
|
1776
1737
|
});
|
|
1777
|
-
},
|
|
1778
|
-
let
|
|
1738
|
+
}, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: d, 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: ee, pasteTextThreshold: F = 4e3, deployments: re, selectedDeploymentId: ie, onDeploymentChange: ae, modelSelectorLabels: oe, initialAttachments: se = [], isStacked: ce = !1, hideAddButton: le = !1, hideAttachFile: ue = !1, hideActionBar: de = !1, renderFooterActions: fe, isInputDisabled: L = !1, isModelSelectorDisabled: pe = !1, isSendDisabled: R = !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
|
+
let Ue = s(), [We, Ge] = V(!1), Ke = Ae(Oe), K = z(() => a({
|
|
1779
1740
|
"--ci-bg": O?.background,
|
|
1780
1741
|
"--ci-text": O?.text,
|
|
1781
1742
|
"--ci-border": O?.border,
|
|
@@ -1788,133 +1749,133 @@ var Mt = {
|
|
|
1788
1749
|
"--ci-voice-error": O?.voiceError,
|
|
1789
1750
|
"--ci-voice-waveform": O?.voiceWaveform,
|
|
1790
1751
|
"--ci-voice-accent": O?.voiceAccent
|
|
1791
|
-
}), [O]),
|
|
1752
|
+
}), [O]), q = z(() => ke ? [{
|
|
1792
1753
|
key: "dial-fs",
|
|
1793
|
-
label:
|
|
1794
|
-
icon: /* @__PURE__ */
|
|
1754
|
+
label: Me ?? "DIAL file system",
|
|
1755
|
+
icon: /* @__PURE__ */ U(te, {
|
|
1795
1756
|
size: c,
|
|
1796
1757
|
"aria-hidden": !0
|
|
1797
1758
|
}),
|
|
1798
|
-
onClick:
|
|
1799
|
-
}] : [], [
|
|
1759
|
+
onClick: ke
|
|
1760
|
+
}] : [], [ke, Me]), { message: J, setMessage: Je, textareaRef: Xe, isMultiLine: Ze } = je({
|
|
1800
1761
|
messageProp: e,
|
|
1801
1762
|
messageRevision: t
|
|
1802
|
-
}), { attachments:
|
|
1803
|
-
initialAttachments:
|
|
1763
|
+
}), { attachments: X, buildAttachments: Z, addAttachments: Qe, resetAttachments: nt, handleRemove: rt, handleRetry: it, handleExpand: at, hasBlockedAttachments: ot } = Ee({
|
|
1764
|
+
initialAttachments: se,
|
|
1804
1765
|
onUploadAttachment: r,
|
|
1805
1766
|
onAttachmentsChange: f,
|
|
1806
|
-
validateAttachment:
|
|
1807
|
-
pendingDropFiles:
|
|
1767
|
+
validateAttachment: Ne,
|
|
1768
|
+
pendingDropFiles: M,
|
|
1808
1769
|
onDropFilesConsumed: N,
|
|
1809
|
-
pendingAttachments:
|
|
1810
|
-
onPendingAttachmentsConsumed:
|
|
1811
|
-
onExpandPastedText:
|
|
1812
|
-
|
|
1813
|
-
}, [
|
|
1814
|
-
maximumAttachmentsAmount:
|
|
1815
|
-
baseAttachmentsAmount:
|
|
1816
|
-
onAttachmentsLimitExceeded:
|
|
1817
|
-
}), { state:
|
|
1818
|
-
|
|
1819
|
-
}, [
|
|
1820
|
-
if (!
|
|
1770
|
+
pendingAttachments: P,
|
|
1771
|
+
onPendingAttachmentsConsumed: ee,
|
|
1772
|
+
onExpandPastedText: I((e) => {
|
|
1773
|
+
Je((t) => t ? `${t}\n${e}` : e);
|
|
1774
|
+
}, [Je]),
|
|
1775
|
+
maximumAttachmentsAmount: Re,
|
|
1776
|
+
baseAttachmentsAmount: ge.length,
|
|
1777
|
+
onAttachmentsLimitExceeded: ze
|
|
1778
|
+
}), { state: st, analyserNodeRef: ct, elapsedSeconds: lt, errorMessage: ut, startRecording: dt, stopRecording: ft, discardRecording: pt } = Fe({ onAttachAudio: I((e) => {
|
|
1779
|
+
Qe(Z([e]));
|
|
1780
|
+
}, [Qe, Z]) }), mt = B(null), ht = B(null), { handlePaste: gt } = Se(Qe, Be ? F : Infinity), Q = I((e) => {
|
|
1781
|
+
if (!Be) {
|
|
1821
1782
|
let t = e.clipboardData.getData("text/plain");
|
|
1822
|
-
t.length >=
|
|
1783
|
+
t.length >= F && He?.(t.length, F);
|
|
1823
1784
|
}
|
|
1824
|
-
|
|
1785
|
+
gt(e);
|
|
1825
1786
|
}, [
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
]),
|
|
1831
|
-
|
|
1832
|
-
|
|
1787
|
+
Be,
|
|
1788
|
+
F,
|
|
1789
|
+
He,
|
|
1790
|
+
gt
|
|
1791
|
+
]), _t = J.trim().length > 0 || X.length > 0, vt = _t && !ot && !R, { shouldRender: yt, isExiting: bt, instanceKey: xt } = De(!l && _t, Ft), St = (be?.some((e) => e.isSelected) ?? !1) && xe != null, $ = ce || J.includes("\n") || Ze || St, Ct = re === void 0 || ie != null, wt = z(() => me && !bt && !l, [
|
|
1792
|
+
me,
|
|
1793
|
+
bt,
|
|
1833
1794
|
l
|
|
1834
1795
|
]), Tt = async () => {
|
|
1835
|
-
if (
|
|
1836
|
-
if (!
|
|
1837
|
-
|
|
1796
|
+
if (R) return;
|
|
1797
|
+
if (!Be && J.length >= F) {
|
|
1798
|
+
He?.(J.length, F);
|
|
1838
1799
|
return;
|
|
1839
1800
|
}
|
|
1840
|
-
let e =
|
|
1841
|
-
|
|
1801
|
+
let e = J, t = X;
|
|
1802
|
+
Je(""), Ke.reset();
|
|
1842
1803
|
try {
|
|
1843
1804
|
await n?.(e, t), t.forEach((e) => {
|
|
1844
1805
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
1845
|
-
}),
|
|
1806
|
+
}), nt([]);
|
|
1846
1807
|
} catch {
|
|
1847
|
-
|
|
1808
|
+
Je(e), nt(t);
|
|
1848
1809
|
}
|
|
1849
1810
|
}, Et = (e) => {
|
|
1850
1811
|
if (!e.nativeEvent.isComposing && !L && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1851
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1812
|
+
let t = e.currentTarget.selectionStart ?? 0, n = Ke.navigate(e.key === "ArrowUp" ? "up" : "down", J, t);
|
|
1852
1813
|
if (n !== null) {
|
|
1853
|
-
e.preventDefault(),
|
|
1814
|
+
e.preventDefault(), Je(n);
|
|
1854
1815
|
return;
|
|
1855
1816
|
}
|
|
1856
1817
|
}
|
|
1857
|
-
e.key === "Enter" && (
|
|
1818
|
+
e.key === "Enter" && (he === Ie.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && vt && Ct && !L && Tt());
|
|
1858
1819
|
}, Dt = (e) => {
|
|
1859
1820
|
let t = Array.from(e.target.files ?? []);
|
|
1860
1821
|
if (t.length === 0) return;
|
|
1861
|
-
let n =
|
|
1862
|
-
e.target.value = "",
|
|
1822
|
+
let n = Z(t);
|
|
1823
|
+
e.target.value = "", Qe(n);
|
|
1863
1824
|
};
|
|
1864
|
-
if (
|
|
1865
|
-
state:
|
|
1866
|
-
analyserNodeRef:
|
|
1867
|
-
elapsedSeconds:
|
|
1868
|
-
errorMessage:
|
|
1869
|
-
onStop:
|
|
1870
|
-
onDiscard:
|
|
1825
|
+
if (st !== "idle") return /* @__PURE__ */ U($e, {
|
|
1826
|
+
state: st,
|
|
1827
|
+
analyserNodeRef: ct,
|
|
1828
|
+
elapsedSeconds: lt,
|
|
1829
|
+
errorMessage: ut,
|
|
1830
|
+
onStop: ft,
|
|
1831
|
+
onDiscard: pt,
|
|
1871
1832
|
stopLabel: T,
|
|
1872
1833
|
discardLabel: E,
|
|
1873
1834
|
timerLabel: D,
|
|
1874
|
-
style:
|
|
1835
|
+
style: K,
|
|
1875
1836
|
className: A
|
|
1876
1837
|
});
|
|
1877
|
-
let Ot = /* @__PURE__ */
|
|
1838
|
+
let Ot = /* @__PURE__ */ U("textarea", {
|
|
1878
1839
|
className: o(Y.textarea, k?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1879
|
-
ref:
|
|
1880
|
-
autoFocus:
|
|
1881
|
-
value:
|
|
1840
|
+
ref: Xe,
|
|
1841
|
+
autoFocus: Te,
|
|
1842
|
+
value: J,
|
|
1882
1843
|
onChange: (e) => {
|
|
1883
|
-
|
|
1844
|
+
Je(e.target.value), Ke.notifyChange(), d?.(e.target.value);
|
|
1884
1845
|
},
|
|
1885
1846
|
onKeyDown: Et,
|
|
1886
|
-
onPaste:
|
|
1847
|
+
onPaste: Q,
|
|
1887
1848
|
placeholder: p,
|
|
1888
1849
|
"aria-label": m,
|
|
1889
1850
|
disabled: L,
|
|
1890
1851
|
rows: 1
|
|
1891
1852
|
});
|
|
1892
|
-
return /* @__PURE__ */
|
|
1893
|
-
ref:
|
|
1894
|
-
style:
|
|
1895
|
-
className: o(Y.wrapper, L && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md",
|
|
1896
|
-
children: [(
|
|
1897
|
-
attachments: [...
|
|
1853
|
+
return /* @__PURE__ */ W("div", {
|
|
1854
|
+
ref: ht,
|
|
1855
|
+
style: K,
|
|
1856
|
+
className: o(Y.wrapper, L && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", X.length > 6 ? "py-3 ps-3" : "p-3", A),
|
|
1857
|
+
children: [(ge.length > 0 || X.length > 0) && /* @__PURE__ */ U(_e, {
|
|
1858
|
+
attachments: [...ge, ...X],
|
|
1898
1859
|
onRemove: (e) => {
|
|
1899
|
-
|
|
1860
|
+
ge.some((t) => t.id === e) ? ve?.(e) : rt(e);
|
|
1900
1861
|
},
|
|
1901
|
-
onRetry:
|
|
1902
|
-
onExpand:
|
|
1862
|
+
onRetry: it,
|
|
1863
|
+
onExpand: at,
|
|
1903
1864
|
labels: {
|
|
1904
1865
|
removeLabel: b,
|
|
1905
1866
|
retryLabel: x
|
|
1906
1867
|
},
|
|
1907
|
-
onAttachmentClick:
|
|
1908
|
-
let t = [...
|
|
1909
|
-
t != null &&
|
|
1868
|
+
onAttachmentClick: Pe == null ? void 0 : (e) => {
|
|
1869
|
+
let t = [...ge, ...X].find((t) => t.id === e);
|
|
1870
|
+
t != null && Pe(t);
|
|
1910
1871
|
}
|
|
1911
|
-
}),
|
|
1872
|
+
}), de ? $ && Ot : /* @__PURE__ */ W("div", {
|
|
1912
1873
|
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1913
1874
|
children: [
|
|
1914
|
-
!
|
|
1875
|
+
!le && /* @__PURE__ */ W("div", {
|
|
1915
1876
|
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1916
|
-
children: [/* @__PURE__ */
|
|
1917
|
-
ref:
|
|
1877
|
+
children: [/* @__PURE__ */ U("input", {
|
|
1878
|
+
ref: mt,
|
|
1918
1879
|
type: "file",
|
|
1919
1880
|
multiple: !0,
|
|
1920
1881
|
accept: g,
|
|
@@ -1922,92 +1883,92 @@ var Mt = {
|
|
|
1922
1883
|
"aria-hidden": !0,
|
|
1923
1884
|
tabIndex: -1,
|
|
1924
1885
|
onChange: Dt
|
|
1925
|
-
}), /* @__PURE__ */
|
|
1926
|
-
onAttachClick:
|
|
1886
|
+
}), /* @__PURE__ */ U(qe, {
|
|
1887
|
+
onAttachClick: ue ? void 0 : () => mt.current?.click(),
|
|
1927
1888
|
attachLabel: h,
|
|
1928
1889
|
addMenuTitle: _,
|
|
1929
1890
|
menuTitle: v,
|
|
1930
1891
|
menuCloseLabel: y,
|
|
1931
|
-
style:
|
|
1892
|
+
style: K,
|
|
1932
1893
|
isDisabled: L,
|
|
1933
|
-
chatSettings:
|
|
1934
|
-
extraMenuItems:
|
|
1935
|
-
toolsMenuItems:
|
|
1936
|
-
onToolToggle:
|
|
1937
|
-
toolsMenuTitle:
|
|
1938
|
-
toolsBackLabel:
|
|
1894
|
+
chatSettings: ye,
|
|
1895
|
+
extraMenuItems: q,
|
|
1896
|
+
toolsMenuItems: be,
|
|
1897
|
+
onToolToggle: xe,
|
|
1898
|
+
toolsMenuTitle: Ce,
|
|
1899
|
+
toolsBackLabel: we
|
|
1939
1900
|
})]
|
|
1940
1901
|
}),
|
|
1941
|
-
$ && St && /* @__PURE__ */
|
|
1902
|
+
$ && St && /* @__PURE__ */ U("div", {
|
|
1942
1903
|
className: "order-3 min-w-0 flex-1",
|
|
1943
|
-
children: /* @__PURE__ */
|
|
1944
|
-
items:
|
|
1945
|
-
onToolToggle:
|
|
1946
|
-
isMobile:
|
|
1947
|
-
countLabel:
|
|
1948
|
-
removeLabel:
|
|
1904
|
+
children: /* @__PURE__ */ U(Ye, {
|
|
1905
|
+
items: be ?? [],
|
|
1906
|
+
onToolToggle: xe,
|
|
1907
|
+
isMobile: Ue,
|
|
1908
|
+
countLabel: G?.countLabel,
|
|
1909
|
+
removeLabel: G?.removeLabel
|
|
1949
1910
|
})
|
|
1950
1911
|
}),
|
|
1951
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ U("div", {
|
|
1952
1913
|
className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1953
1914
|
children: Ot
|
|
1954
1915
|
}),
|
|
1955
|
-
/* @__PURE__ */
|
|
1916
|
+
/* @__PURE__ */ W("div", {
|
|
1956
1917
|
className: o("flex flex-shrink-0 items-center gap-2", $ && St ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1957
|
-
children: [
|
|
1958
|
-
canSend:
|
|
1918
|
+
children: [fe ? fe({
|
|
1919
|
+
canSend: vt,
|
|
1959
1920
|
onSend: Tt
|
|
1960
|
-
}) : /* @__PURE__ */
|
|
1961
|
-
|
|
1962
|
-
/* @__PURE__ */
|
|
1963
|
-
deployments:
|
|
1921
|
+
}) : /* @__PURE__ */ W(H, { children: [
|
|
1922
|
+
Ve,
|
|
1923
|
+
/* @__PURE__ */ U(Pt, {
|
|
1924
|
+
deployments: re,
|
|
1964
1925
|
selectedDeploymentId: ie,
|
|
1965
1926
|
onDeploymentChange: ae,
|
|
1966
1927
|
modelSelectorLabels: oe,
|
|
1967
1928
|
isStreaming: l,
|
|
1968
|
-
isMobile:
|
|
1929
|
+
isMobile: Ue,
|
|
1969
1930
|
isInputDisabled: L,
|
|
1970
|
-
isDisabled:
|
|
1971
|
-
style:
|
|
1972
|
-
modelPickerOverlay:
|
|
1973
|
-
isPickerOpen:
|
|
1974
|
-
onPickerToggle: () =>
|
|
1975
|
-
onPickerOpenChange:
|
|
1931
|
+
isDisabled: pe,
|
|
1932
|
+
style: K,
|
|
1933
|
+
modelPickerOverlay: Le,
|
|
1934
|
+
isPickerOpen: We,
|
|
1935
|
+
onPickerToggle: () => Ge((e) => !e),
|
|
1936
|
+
onPickerOpenChange: Ge
|
|
1976
1937
|
}),
|
|
1977
|
-
l && i ? /* @__PURE__ */
|
|
1938
|
+
l && i ? /* @__PURE__ */ U(tt, {
|
|
1978
1939
|
onStop: i,
|
|
1979
1940
|
ariaLabel: C
|
|
1980
|
-
}) : !l &&
|
|
1941
|
+
}) : !l && yt && /* @__PURE__ */ U(et, {
|
|
1981
1942
|
onSend: Tt,
|
|
1982
|
-
isDisabled: !Ct ||
|
|
1943
|
+
isDisabled: !Ct || ot || R,
|
|
1983
1944
|
ariaLabel: S,
|
|
1984
|
-
isExiting:
|
|
1945
|
+
isExiting: bt
|
|
1985
1946
|
}, xt)
|
|
1986
|
-
] }), wt && /* @__PURE__ */
|
|
1987
|
-
icon: /* @__PURE__ */
|
|
1947
|
+
] }), wt && /* @__PURE__ */ U(j, {
|
|
1948
|
+
icon: /* @__PURE__ */ U(ne, {
|
|
1988
1949
|
size: u.LG,
|
|
1989
1950
|
"aria-hidden": !0
|
|
1990
1951
|
}),
|
|
1991
1952
|
"aria-label": w,
|
|
1992
1953
|
className: "size-8 flex-shrink-0",
|
|
1993
|
-
onClick:
|
|
1954
|
+
onClick: dt,
|
|
1994
1955
|
disabled: L || l
|
|
1995
1956
|
})]
|
|
1996
1957
|
})
|
|
1997
1958
|
]
|
|
1998
1959
|
})]
|
|
1999
1960
|
});
|
|
2000
|
-
},
|
|
1961
|
+
}, Lt = { welcome: "_welcome_n2ph8_1" }, Rt = ({ isStreaming: e = !1, placeholder: t = "Type a prompt or use \"/\" to select one", welcomeText: n, styles: r, className: i, inputClassName: s, isInputDisabled: c = !1, ...l }) => {
|
|
2001
1962
|
let { colors: u, typography: d } = r ?? {};
|
|
2002
|
-
return /* @__PURE__ */
|
|
1963
|
+
return /* @__PURE__ */ W("div", {
|
|
2003
1964
|
style: a({ "--ci-welcome-color": u?.welcomeText }),
|
|
2004
1965
|
className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
2005
|
-
children: [n && /* @__PURE__ */
|
|
2006
|
-
className: o(
|
|
1966
|
+
children: [n && /* @__PURE__ */ U("h1", {
|
|
1967
|
+
className: o(Lt.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
|
|
2007
1968
|
children: n
|
|
2008
|
-
}), /* @__PURE__ */
|
|
1969
|
+
}), /* @__PURE__ */ U("div", {
|
|
2009
1970
|
className: "relative w-full max-w-[748px]",
|
|
2010
|
-
children: /* @__PURE__ */
|
|
1971
|
+
children: /* @__PURE__ */ U(It, {
|
|
2011
1972
|
placeholder: t,
|
|
2012
1973
|
isStreaming: e,
|
|
2013
1974
|
isInputDisabled: c,
|
|
@@ -2018,53 +1979,53 @@ var Mt = {
|
|
|
2018
1979
|
})
|
|
2019
1980
|
})]
|
|
2020
1981
|
});
|
|
2021
|
-
},
|
|
2022
|
-
let
|
|
2023
|
-
|
|
2024
|
-
v?.length && (
|
|
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: C, maximumAttachmentsAmount: w, onAttachmentsLimitExceeded: T, onDialFileSystemClick: D, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: M, pasteTextThreshold: N, onMessageTooLong: P }) => {
|
|
1983
|
+
let ee = B(null), [F, ne] = V([]);
|
|
1984
|
+
L(() => {
|
|
1985
|
+
v?.length && (ne(v), y?.());
|
|
2025
1986
|
}, [v, y]);
|
|
2026
|
-
let [re, ie] =
|
|
2027
|
-
|
|
2028
|
-
},
|
|
2029
|
-
i(e,
|
|
2030
|
-
}, [
|
|
2031
|
-
if (
|
|
1987
|
+
let [re, ie] = V(e ?? ""), [ae, oe] = V([]), [se, ce] = V(t), le = ae.some((e) => e.status === r.Loading || e.status === r.Error), ue = (re.trim().length > 0 || ae.length > 0 || se.length > 0) && !le, de = (e) => {
|
|
1988
|
+
ce((t) => t.filter((t) => t.id !== e));
|
|
1989
|
+
}, fe = I((e, t) => {
|
|
1990
|
+
i(e, se, t);
|
|
1991
|
+
}, [se, i]), pe = () => {
|
|
1992
|
+
if (ue) {
|
|
2032
1993
|
if (!x && re.length >= (N ?? 4e3)) {
|
|
2033
|
-
|
|
1994
|
+
P?.(re.length, N ?? 4e3);
|
|
2034
1995
|
return;
|
|
2035
1996
|
}
|
|
2036
|
-
|
|
1997
|
+
fe(re, ae);
|
|
2037
1998
|
}
|
|
2038
|
-
},
|
|
1999
|
+
}, R = I(() => ne([]), []), me = I((e) => {
|
|
2039
2000
|
let t = Array.from(e.target.files ?? []);
|
|
2040
|
-
t.length !== 0 && (e.target.value = "",
|
|
2041
|
-
}, []),
|
|
2001
|
+
t.length !== 0 && (e.target.value = "", ne(t));
|
|
2002
|
+
}, []), he = z(() => D ? [{
|
|
2042
2003
|
key: "dial-fs",
|
|
2043
|
-
label:
|
|
2044
|
-
icon: /* @__PURE__ */
|
|
2004
|
+
label: k ?? "DIAL file system",
|
|
2005
|
+
icon: /* @__PURE__ */ U(te, {
|
|
2045
2006
|
size: c,
|
|
2046
2007
|
"aria-hidden": !0
|
|
2047
2008
|
}),
|
|
2048
|
-
onClick:
|
|
2049
|
-
}] : [], [
|
|
2050
|
-
return /* @__PURE__ */
|
|
2009
|
+
onClick: D
|
|
2010
|
+
}] : [], [D, k]);
|
|
2011
|
+
return /* @__PURE__ */ W("div", {
|
|
2051
2012
|
className: o("flex w-full flex-col gap-2", _),
|
|
2052
|
-
children: [/* @__PURE__ */
|
|
2013
|
+
children: [/* @__PURE__ */ U(It, {
|
|
2053
2014
|
message: e,
|
|
2054
2015
|
ariaLabel: u,
|
|
2055
2016
|
isStacked: !0,
|
|
2056
2017
|
hideActionBar: !0,
|
|
2057
|
-
pendingDropFiles:
|
|
2058
|
-
onDropFilesConsumed:
|
|
2059
|
-
onSend:
|
|
2018
|
+
pendingDropFiles: F,
|
|
2019
|
+
onDropFilesConsumed: R,
|
|
2020
|
+
onSend: fe,
|
|
2060
2021
|
onUploadAttachment: a,
|
|
2061
2022
|
onChange: ie,
|
|
2062
2023
|
onAttachmentsChange: oe,
|
|
2063
2024
|
removeLabel: d,
|
|
2064
2025
|
retryLabel: f,
|
|
2065
2026
|
className: "max-w-full",
|
|
2066
|
-
prefixAttachments:
|
|
2067
|
-
onRemovePrefixAttachment:
|
|
2027
|
+
prefixAttachments: se,
|
|
2028
|
+
onRemovePrefixAttachment: de,
|
|
2068
2029
|
validateAttachment: b,
|
|
2069
2030
|
isAttachmentsEnabled: x,
|
|
2070
2031
|
maximumAttachmentsAmount: w,
|
|
@@ -2073,41 +2034,41 @@ var Mt = {
|
|
|
2073
2034
|
onPendingAttachmentsConsumed: j,
|
|
2074
2035
|
onAttachmentClick: M,
|
|
2075
2036
|
pasteTextThreshold: N,
|
|
2076
|
-
onMessageTooLong:
|
|
2077
|
-
}), /* @__PURE__ */
|
|
2037
|
+
onMessageTooLong: P
|
|
2038
|
+
}), /* @__PURE__ */ W("div", {
|
|
2078
2039
|
className: "flex items-center justify-between",
|
|
2079
|
-
children: [/* @__PURE__ */
|
|
2040
|
+
children: [/* @__PURE__ */ U("div", {
|
|
2080
2041
|
className: "flex",
|
|
2081
|
-
children: !S && /* @__PURE__ */
|
|
2082
|
-
ref:
|
|
2042
|
+
children: !S && /* @__PURE__ */ W(H, { children: [/* @__PURE__ */ U("input", {
|
|
2043
|
+
ref: ee,
|
|
2083
2044
|
type: "file",
|
|
2084
2045
|
multiple: !0,
|
|
2085
2046
|
accept: C,
|
|
2086
2047
|
className: "sr-only",
|
|
2087
2048
|
"aria-hidden": !0,
|
|
2088
2049
|
tabIndex: -1,
|
|
2089
|
-
onChange:
|
|
2090
|
-
}), /* @__PURE__ */
|
|
2091
|
-
onAttachClick: () =>
|
|
2050
|
+
onChange: me
|
|
2051
|
+
}), /* @__PURE__ */ U(qe, {
|
|
2052
|
+
onAttachClick: () => ee.current?.click(),
|
|
2092
2053
|
attachLabel: m,
|
|
2093
2054
|
addMenuTitle: p,
|
|
2094
2055
|
menuTitle: h,
|
|
2095
2056
|
menuCloseLabel: g,
|
|
2096
|
-
extraMenuItems:
|
|
2057
|
+
extraMenuItems: he
|
|
2097
2058
|
})] })
|
|
2098
|
-
}), /* @__PURE__ */
|
|
2059
|
+
}), /* @__PURE__ */ W("div", {
|
|
2099
2060
|
className: "flex gap-2",
|
|
2100
|
-
children: [/* @__PURE__ */
|
|
2061
|
+
children: [/* @__PURE__ */ U(E, {
|
|
2101
2062
|
label: s,
|
|
2102
2063
|
onClick: n
|
|
2103
|
-
}), /* @__PURE__ */
|
|
2064
|
+
}), /* @__PURE__ */ U(O, {
|
|
2104
2065
|
label: l,
|
|
2105
|
-
onClick:
|
|
2106
|
-
disabled: !
|
|
2066
|
+
onClick: pe,
|
|
2067
|
+
disabled: !ue
|
|
2107
2068
|
})]
|
|
2108
2069
|
})]
|
|
2109
2070
|
})]
|
|
2110
2071
|
});
|
|
2111
2072
|
};
|
|
2112
2073
|
//#endregion
|
|
2113
|
-
export { me as AttachmentCard, he as AttachmentGroup, ge as AttachmentTray,
|
|
2074
|
+
export { me as AttachmentCard, he as AttachmentGroup, ge as AttachmentTray, G as BottomSheetShell, We as ChatSettingsModal, Rt as ConversationInput, zt as EditMessageInput, ve as FileDndOverlay, It as Input, Ie as SendOnEnter, xe as getAttachmentIcon };
|