@epam/ai-dial-conversation-input 1.1.0-dev.179 → 1.1.0-dev.182
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/AddAttachmentButton/AddAttachmentButton.d.ts +5 -4
- package/components/AddAttachmentButton/AddAttachmentButton.d.ts.map +1 -1
- package/components/EditMessageInput/EditMessageInput.d.ts.map +1 -1
- package/components/Input/Input.d.ts.map +1 -1
- package/index.js +453 -458
- package/models/ConversationInput.d.ts +19 -9
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +10 -6
- package/models/Input.d.ts.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
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
2
|
import { BASE_ICON_SIZE as c, Button as l, CloseButton as u, DIAL_ICON_SIZE as d, DialDropdownIcon as f, DialRadioGroup as p, DialSearch as m, DialSlider as h, DialTooltip as g, Dropdown as _, ElementSize as v, ErrorText as y, GhostIconButton as b, Highlight as x, Input as S, NeutralButton as C, Popup as w, PopupSize as T, PrimaryButton as E, PrimaryIconButton as D, RadioGroupOrientation as O, Skeleton as k, SkeletonVariant as A, StaticIconButton as j } from "@epam/ai-dial-ui-kit";
|
|
3
|
-
import { IconArrowLeft as ee, IconArrowNarrowRight as M, IconCheck as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { AttachmentCard as
|
|
3
|
+
import { IconArrowLeft as ee, IconArrowNarrowRight as M, IconCheck as N, IconChevronDown as te, IconChevronRight as P, IconFile as ne, IconMicrophone as re, IconPaperclip as ie, IconPlayerStopFilled as F, IconPlaystationSquare as I, IconPlus as ae, IconPrompt as oe, IconSettings as se, IconTool as ce, IconX as le } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as ue } from "react-dom";
|
|
5
|
+
import { createElement as L, memo as R, useCallback as z, useEffect as B, useImperativeHandle as de, useLayoutEffect as fe, useMemo as V, useRef as H, useState as U } from "react";
|
|
6
|
+
import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
7
|
+
import { AttachmentCard as pe, AttachmentGroup as me, AttachmentTray as he, AttachmentTray as ge, FileDndOverlay as _e, MAX_UPLOADS_PER_MINUTE as ve, generateAttachmentId as ye, getAttachmentIcon as be, useClipboardPaste as xe } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var Se = (e, t) => {
|
|
10
|
+
B(() => {
|
|
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]), B(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
20
|
}, [e]);
|
|
21
|
-
},
|
|
21
|
+
}, Ce = {
|
|
22
22
|
backdrop: "_backdrop_1d50f_9",
|
|
23
23
|
sheet: "_sheet_1d50f_13",
|
|
24
24
|
"slide-up": "_slide-up_1d50f_1",
|
|
25
25
|
title: "_title_1d50f_18",
|
|
26
26
|
divider: "_divider_1d50f_22"
|
|
27
|
-
},
|
|
28
|
-
if (
|
|
27
|
+
}, q = ({ 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
|
+
if (Se(e, r), !e || typeof document > "u") return null;
|
|
29
29
|
let g = a({
|
|
30
30
|
"--ci-backdrop": m?.backdrop,
|
|
31
31
|
"--ci-sheet-bg": m?.sheetBg,
|
|
32
32
|
"--ci-sheet-text": m?.sheetText,
|
|
33
33
|
"--ci-sheet-divider": m?.divider
|
|
34
34
|
});
|
|
35
|
-
return
|
|
36
|
-
className: o(
|
|
35
|
+
return ue(/* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
|
|
36
|
+
className: o(Ce.backdrop, "fixed inset-0 z-[55]"),
|
|
37
37
|
style: g,
|
|
38
38
|
onPointerDown: r,
|
|
39
39
|
"aria-hidden": !0
|
|
40
|
-
}), /* @__PURE__ */
|
|
40
|
+
}), /* @__PURE__ */ K("div", {
|
|
41
41
|
role: "dialog",
|
|
42
42
|
"aria-modal": !0,
|
|
43
43
|
"aria-label": t ?? c,
|
|
@@ -45,14 +45,14 @@ var we = (e, t) => {
|
|
|
45
45
|
...g,
|
|
46
46
|
...l
|
|
47
47
|
},
|
|
48
|
-
className: o(
|
|
49
|
-
children: [t != null && /* @__PURE__ */ W
|
|
48
|
+
className: o(Ce.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col rounded-t-lg", p),
|
|
49
|
+
children: [t != null && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ K("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__ */ G("div", {
|
|
53
53
|
className: "absolute start-4",
|
|
54
|
-
children: /* @__PURE__ */
|
|
55
|
-
icon: /* @__PURE__ */
|
|
54
|
+
children: /* @__PURE__ */ G(b, {
|
|
55
|
+
icon: /* @__PURE__ */ G(ee, {
|
|
56
56
|
size: d.LG,
|
|
57
57
|
stroke: 1.5,
|
|
58
58
|
className: "rtl:scale-x-[-1]"
|
|
@@ -61,41 +61,41 @@ var we = (e, t) => {
|
|
|
61
61
|
onClick: i
|
|
62
62
|
})
|
|
63
63
|
}),
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
className: o(
|
|
64
|
+
/* @__PURE__ */ G("span", {
|
|
65
|
+
className: o(Ce.title, f),
|
|
66
66
|
children: t
|
|
67
67
|
}),
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ G("div", {
|
|
69
69
|
className: "absolute end-4 m-2",
|
|
70
|
-
children: /* @__PURE__ */
|
|
70
|
+
children: /* @__PURE__ */ G(u, {
|
|
71
71
|
ariaLabel: n,
|
|
72
72
|
onClose: r,
|
|
73
73
|
size: v.Standard
|
|
74
74
|
})
|
|
75
75
|
})
|
|
76
76
|
]
|
|
77
|
-
}), /* @__PURE__ */
|
|
77
|
+
}), /* @__PURE__ */ G("div", { className: o(Ce.divider, "h-px flex-shrink-0") })] }), /* @__PURE__ */ G("div", {
|
|
78
78
|
className: "overflow-y-auto",
|
|
79
79
|
children: h
|
|
80
80
|
})]
|
|
81
81
|
})] }), document.body);
|
|
82
|
-
},
|
|
82
|
+
}, we = async (e, t, n) => {
|
|
83
83
|
let r = 6e4 / t, i = [];
|
|
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
|
-
},
|
|
87
|
-
let [h, g] =
|
|
88
|
-
|
|
86
|
+
}, Te = ({ 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] = U(n), _ = H(h);
|
|
88
|
+
B(() => {
|
|
89
89
|
_.current = h;
|
|
90
|
-
}, [h]),
|
|
90
|
+
}, [h]), B(() => () => {
|
|
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 = z((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
|
-
id:
|
|
98
|
+
id: ye(),
|
|
99
99
|
name: e.name,
|
|
100
100
|
contentType: e.type,
|
|
101
101
|
file: e,
|
|
@@ -104,26 +104,26 @@ var we = (e, t) => {
|
|
|
104
104
|
previewUrl: a,
|
|
105
105
|
playUrl: o
|
|
106
106
|
};
|
|
107
|
-
}), []), y =
|
|
108
|
-
|
|
107
|
+
}), []), y = H(a);
|
|
108
|
+
B(() => {
|
|
109
109
|
y.current = a;
|
|
110
110
|
}, [a]);
|
|
111
|
-
let b =
|
|
111
|
+
let b = H(!0), x = z((e) => {
|
|
112
112
|
g((t) => {
|
|
113
113
|
let n = e(t);
|
|
114
114
|
return n === t ? t : n;
|
|
115
115
|
});
|
|
116
116
|
}, []);
|
|
117
|
-
|
|
117
|
+
B(() => {
|
|
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 = z((e) => {
|
|
125
125
|
g(e);
|
|
126
|
-
}, []), C =
|
|
126
|
+
}, []), C = z(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 we = (e, t) => {
|
|
|
145
145
|
} : e));
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}, [i, x]), w =
|
|
148
|
+
}, [i, x]), w = z((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)) {
|
|
@@ -166,7 +166,7 @@ var we = (e, t) => {
|
|
|
166
166
|
status: r.Error,
|
|
167
167
|
errorReason: n
|
|
168
168
|
} : e));
|
|
169
|
-
}),
|
|
169
|
+
}), we(e, ve, C);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
}, [
|
|
@@ -177,20 +177,20 @@ var we = (e, t) => {
|
|
|
177
177
|
C,
|
|
178
178
|
o
|
|
179
179
|
]);
|
|
180
|
-
|
|
180
|
+
B(() => {
|
|
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
|
+
]), B(() => {
|
|
188
188
|
l.length !== 0 && (w(l, !1), u?.());
|
|
189
189
|
}, [
|
|
190
190
|
w,
|
|
191
191
|
u,
|
|
192
192
|
l
|
|
193
|
-
]),
|
|
193
|
+
]), B(() => {
|
|
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 we = (e, t) => {
|
|
|
217
217
|
x,
|
|
218
218
|
C
|
|
219
219
|
]);
|
|
220
|
-
let T =
|
|
220
|
+
let T = z((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 we = (e, t) => {
|
|
|
229
229
|
addAttachments: w,
|
|
230
230
|
resetAttachments: S,
|
|
231
231
|
handleRemove: T,
|
|
232
|
-
handleRetry:
|
|
232
|
+
handleRetry: z((e) => {
|
|
233
233
|
let t = h.find((t) => t.id === e);
|
|
234
234
|
t && C(t);
|
|
235
235
|
}, [h, C]),
|
|
236
|
-
handleExpand:
|
|
236
|
+
handleExpand: z(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();
|
|
@@ -245,9 +245,9 @@ var we = (e, t) => {
|
|
|
245
245
|
]),
|
|
246
246
|
hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
|
|
247
247
|
};
|
|
248
|
-
},
|
|
249
|
-
let [n, r] =
|
|
250
|
-
return
|
|
248
|
+
}, Ee = (e, t) => {
|
|
249
|
+
let [n, r] = U(e), [i, a] = U(!1), [o, s] = U(0);
|
|
250
|
+
return B(() => {
|
|
251
251
|
if (e) {
|
|
252
252
|
r(!0), a(!1), s((e) => e + 1);
|
|
253
253
|
return;
|
|
@@ -263,18 +263,18 @@ var we = (e, t) => {
|
|
|
263
263
|
isExiting: i,
|
|
264
264
|
instanceKey: o
|
|
265
265
|
};
|
|
266
|
-
},
|
|
267
|
-
let t =
|
|
266
|
+
}, De = (e, t) => !e.slice(0, t).includes("\n"), Oe = (e, t) => !e.slice(t).includes("\n"), ke = (e) => {
|
|
267
|
+
let t = H(e);
|
|
268
268
|
t.current = e;
|
|
269
|
-
let n =
|
|
269
|
+
let n = H(-1), r = H(""), i = z((e, i, a) => {
|
|
270
270
|
let o = t.current;
|
|
271
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
272
|
-
}, []), a =
|
|
271
|
+
return !o || o.length === 0 ? null : e === "up" ? !De(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 || !Oe(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
272
|
+
}, []), a = z(() => {
|
|
273
273
|
n.current = -1, r.current = "";
|
|
274
|
-
}, []), o =
|
|
274
|
+
}, []), o = z(() => {
|
|
275
275
|
n.current = -1, r.current = "";
|
|
276
276
|
}, []);
|
|
277
|
-
return
|
|
277
|
+
return V(() => ({
|
|
278
278
|
navigate: i,
|
|
279
279
|
notifyChange: a,
|
|
280
280
|
reset: o
|
|
@@ -283,13 +283,13 @@ var we = (e, t) => {
|
|
|
283
283
|
a,
|
|
284
284
|
o
|
|
285
285
|
]);
|
|
286
|
-
},
|
|
287
|
-
let [n, r] =
|
|
288
|
-
return
|
|
286
|
+
}, Ae = ({ messageProp: e, messageRevision: t }) => {
|
|
287
|
+
let [n, r] = U(e), i = H(null), a = H(0), [o, s] = U(!1);
|
|
288
|
+
return B(() => {
|
|
289
289
|
r(e);
|
|
290
|
-
}, [e, t]),
|
|
290
|
+
}, [e, t]), B(() => {
|
|
291
291
|
i.current && (a.current = i.current.offsetHeight);
|
|
292
|
-
}, []),
|
|
292
|
+
}, []), fe(() => {
|
|
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);
|
|
@@ -299,18 +299,18 @@ var we = (e, t) => {
|
|
|
299
299
|
textareaRef: i,
|
|
300
300
|
isMultiLine: o
|
|
301
301
|
};
|
|
302
|
-
},
|
|
302
|
+
}, je = /* @__PURE__ */ function(e) {
|
|
303
303
|
return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
|
|
304
|
-
}({}),
|
|
304
|
+
}({}), Me = [
|
|
305
305
|
"audio/webm;codecs=opus",
|
|
306
306
|
"audio/ogg;codecs=opus",
|
|
307
307
|
"audio/webm"
|
|
308
|
-
],
|
|
309
|
-
let [t, n] =
|
|
308
|
+
], Ne = () => Me.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Pe = ({ onAttachAudio: e }) => {
|
|
309
|
+
let [t, n] = U("idle"), [r, i] = U(null), a = H(null), o = H(null), s = H(null), c = H(null), l = H([]), u = H(""), d = H(e);
|
|
310
310
|
d.current = e;
|
|
311
|
-
let f =
|
|
311
|
+
let f = z(() => {
|
|
312
312
|
a.current &&= (a.current.getTracks().forEach((e) => e.stop()), null), o.current &&= (o.current.close(), null), s.current = null, c.current = null;
|
|
313
|
-
}, []), p =
|
|
313
|
+
}, []), p = z(() => {
|
|
314
314
|
(async () => {
|
|
315
315
|
try {
|
|
316
316
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -319,7 +319,7 @@ var we = (e, t) => {
|
|
|
319
319
|
o.current = t;
|
|
320
320
|
let r = t.createAnalyser();
|
|
321
321
|
r.fftSize = 256, s.current = r, t.createMediaStreamSource(e).connect(r);
|
|
322
|
-
let i =
|
|
322
|
+
let i = Ne();
|
|
323
323
|
u.current = i, l.current = [];
|
|
324
324
|
let d = new MediaRecorder(e, i ? { mimeType: i } : void 0);
|
|
325
325
|
c.current = d, d.ondataavailable = (e) => {
|
|
@@ -329,17 +329,17 @@ var we = (e, t) => {
|
|
|
329
329
|
i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
|
|
330
330
|
}
|
|
331
331
|
})();
|
|
332
|
-
}, []), m =
|
|
332
|
+
}, []), m = z(() => {
|
|
333
333
|
let e = c.current;
|
|
334
334
|
!e || e.state !== "recording" || (e.onstop = () => {
|
|
335
335
|
let e = u.current || "audio/webm", t = new Blob(l.current, { type: e }), r = e.split(";")[0], a = r.split("/")[1] ?? "webm", o = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-").slice(0, -1), s = new File([t], `voice-${o}.${a}`, { type: r });
|
|
336
336
|
d.current(s), f(), i(null), n("idle");
|
|
337
337
|
}, e.stop());
|
|
338
|
-
}, [f]), h =
|
|
338
|
+
}, [f]), h = z(() => {
|
|
339
339
|
let e = c.current;
|
|
340
340
|
e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), f(), i(null), n("idle");
|
|
341
341
|
}, [f]);
|
|
342
|
-
return
|
|
342
|
+
return B(() => () => {
|
|
343
343
|
f();
|
|
344
344
|
}, [f]), {
|
|
345
345
|
state: t,
|
|
@@ -349,12 +349,12 @@ var we = (e, t) => {
|
|
|
349
349
|
stopRecording: m,
|
|
350
350
|
discardRecording: h
|
|
351
351
|
};
|
|
352
|
-
},
|
|
352
|
+
}, Fe = /* @__PURE__ */ function(e) {
|
|
353
353
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
354
|
-
}({}),
|
|
354
|
+
}({}), Ie = {
|
|
355
355
|
item: "_item_5iycw_1",
|
|
356
356
|
itemIcon: "_itemIcon_5iycw_11"
|
|
357
|
-
},
|
|
357
|
+
}, Le = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: s, className: c, titleClassName: u = "dial-body-semi-text", itemLabelClassName: d = "dial-small-text", btnTextClassName: f = "", colors: p }) => {
|
|
358
358
|
let m = (e) => {
|
|
359
359
|
e(), r();
|
|
360
360
|
}, h = a({
|
|
@@ -363,7 +363,7 @@ var we = (e, t) => {
|
|
|
363
363
|
"--ci-sheet-item-active": p?.itemActiveBg,
|
|
364
364
|
"--ci-sheet-icon": p?.itemIcon
|
|
365
365
|
});
|
|
366
|
-
return /* @__PURE__ */
|
|
366
|
+
return /* @__PURE__ */ G(q, {
|
|
367
367
|
isOpen: e,
|
|
368
368
|
title: t,
|
|
369
369
|
closeLabel: n,
|
|
@@ -372,23 +372,23 @@ var we = (e, t) => {
|
|
|
372
372
|
className: c,
|
|
373
373
|
titleClassName: u,
|
|
374
374
|
colors: p?.shell,
|
|
375
|
-
children: /* @__PURE__ */
|
|
375
|
+
children: /* @__PURE__ */ G("ul", {
|
|
376
376
|
role: "list",
|
|
377
377
|
className: "flex flex-col",
|
|
378
378
|
style: h,
|
|
379
|
-
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
379
|
+
children: s.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(l, {
|
|
380
380
|
type: "button",
|
|
381
|
-
className: o(
|
|
382
|
-
iconBefore: /* @__PURE__ */
|
|
383
|
-
className:
|
|
381
|
+
className: o(Ie.item, "w-full gap-3 px-4 py-[10px] text-start"),
|
|
382
|
+
iconBefore: /* @__PURE__ */ G("span", {
|
|
383
|
+
className: Ie.itemIcon,
|
|
384
384
|
children: n
|
|
385
385
|
}),
|
|
386
|
-
iconAfter: r ? /* @__PURE__ */
|
|
386
|
+
iconAfter: r ? /* @__PURE__ */ G("span", {
|
|
387
387
|
className: "ms-auto",
|
|
388
388
|
children: r
|
|
389
389
|
}) : null,
|
|
390
390
|
textClassName: f,
|
|
391
|
-
label: /* @__PURE__ */
|
|
391
|
+
label: /* @__PURE__ */ G("span", {
|
|
392
392
|
className: d,
|
|
393
393
|
children: t
|
|
394
394
|
}),
|
|
@@ -396,9 +396,9 @@ var we = (e, t) => {
|
|
|
396
396
|
}) }, e))
|
|
397
397
|
})
|
|
398
398
|
});
|
|
399
|
-
},
|
|
400
|
-
let [s, c] =
|
|
401
|
-
|
|
399
|
+
}, Re = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
400
|
+
let [s, c] = U(t), [l, u] = U(n), [d, f] = U(r), p = H(o);
|
|
401
|
+
B(() => {
|
|
402
402
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
403
403
|
}, [
|
|
404
404
|
o,
|
|
@@ -415,7 +415,7 @@ var we = (e, t) => {
|
|
|
415
415
|
setResponseFormat: c,
|
|
416
416
|
setSystemPrompt: u,
|
|
417
417
|
setTemperature: f,
|
|
418
|
-
handleSubmit:
|
|
418
|
+
handleSubmit: z(() => {
|
|
419
419
|
if (!m) return;
|
|
420
420
|
let t = {};
|
|
421
421
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -429,17 +429,17 @@ var we = (e, t) => {
|
|
|
429
429
|
a
|
|
430
430
|
])
|
|
431
431
|
};
|
|
432
|
-
},
|
|
432
|
+
}, ze = { label: "_label_14i7c_1" }, Be = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: s, onSystemPromptChange: c, onTemperatureChange: l, responseFormatLabel: u = "Response format", responseFormatHint: d = "Applies to new and existing messages", responseFormatMarkdownLabel: f = "Markdown", responseFormatPlainTextLabel: m = "Plain text", systemPromptLabel: g = "System prompt", systemPromptTooltip: _ = "Enter a prompt", temperatureLabel: v = "Temperature", temperatureLabels: y = [
|
|
433
433
|
"Precise",
|
|
434
434
|
"Neutral",
|
|
435
435
|
"Creative"
|
|
436
436
|
], temperatureHint: b, labelClassName: x = "!dial-small-semi-text", colors: C }) => {
|
|
437
|
-
let w = a({ "--csf-label-text": C?.labelText }), T = o(x,
|
|
438
|
-
return /* @__PURE__ */
|
|
437
|
+
let w = a({ "--csf-label-text": C?.labelText }), T = o(x, ze.label, "gap-1");
|
|
438
|
+
return /* @__PURE__ */ K("div", {
|
|
439
439
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
440
440
|
style: w,
|
|
441
441
|
children: [
|
|
442
|
-
e.responseFormat && /* @__PURE__ */
|
|
442
|
+
e.responseFormat && /* @__PURE__ */ G(p, {
|
|
443
443
|
fieldTitle: u,
|
|
444
444
|
labelClassName: T,
|
|
445
445
|
elementId: "response-format",
|
|
@@ -455,7 +455,7 @@ var we = (e, t) => {
|
|
|
455
455
|
}],
|
|
456
456
|
onChange: (e) => s(e)
|
|
457
457
|
}),
|
|
458
|
-
e.systemPrompt && /* @__PURE__ */
|
|
458
|
+
e.systemPrompt && /* @__PURE__ */ G(S, {
|
|
459
459
|
value: n,
|
|
460
460
|
placeholder: _,
|
|
461
461
|
labelProps: {
|
|
@@ -464,7 +464,7 @@ var we = (e, t) => {
|
|
|
464
464
|
},
|
|
465
465
|
onChange: (e) => c(e ?? "")
|
|
466
466
|
}),
|
|
467
|
-
e.temperature && /* @__PURE__ */
|
|
467
|
+
e.temperature && /* @__PURE__ */ G(h, {
|
|
468
468
|
labelProps: {
|
|
469
469
|
label: v,
|
|
470
470
|
className: T,
|
|
@@ -479,8 +479,8 @@ var we = (e, t) => {
|
|
|
479
479
|
})
|
|
480
480
|
]
|
|
481
481
|
});
|
|
482
|
-
},
|
|
483
|
-
let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: ee, handleSubmit: M } =
|
|
482
|
+
}, Ve = ({ isOpen: e, onBack: t, backLabel: n, onClose: r, closeLabel: i, style: a, features: s, initialResponseFormat: c, initialSystemPrompt: l, initialTemperature: u, onSave: d, title: f = "Chat settings", responseFormatLabel: p, responseFormatHint: m, responseFormatMarkdownLabel: h, responseFormatPlainTextLabel: _, systemPromptLabel: v, systemPromptTooltip: y, temperatureLabel: b, temperatureLabels: x, temperatureHint: S, saveLabel: C = "Apply changes", saveDisabledTooltip: w }) => {
|
|
483
|
+
let { responseFormat: T, systemPrompt: D, temperature: O, canSubmit: k, setResponseFormat: A, setSystemPrompt: j, setTemperature: ee, handleSubmit: M } = Re({
|
|
484
484
|
isOpen: e,
|
|
485
485
|
features: s,
|
|
486
486
|
initialResponseFormat: c,
|
|
@@ -489,7 +489,7 @@ var we = (e, t) => {
|
|
|
489
489
|
onSave: d,
|
|
490
490
|
onClose: r
|
|
491
491
|
});
|
|
492
|
-
return /* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ K(q, {
|
|
493
493
|
isOpen: e,
|
|
494
494
|
title: f,
|
|
495
495
|
closeLabel: i,
|
|
@@ -497,7 +497,7 @@ var we = (e, t) => {
|
|
|
497
497
|
onBack: t,
|
|
498
498
|
backLabel: n,
|
|
499
499
|
style: a,
|
|
500
|
-
children: [/* @__PURE__ */
|
|
500
|
+
children: [/* @__PURE__ */ G(Be, {
|
|
501
501
|
features: s,
|
|
502
502
|
responseFormat: T,
|
|
503
503
|
systemPrompt: D,
|
|
@@ -514,13 +514,13 @@ var we = (e, t) => {
|
|
|
514
514
|
temperatureLabel: b,
|
|
515
515
|
temperatureLabels: x,
|
|
516
516
|
temperatureHint: S
|
|
517
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ G("div", {
|
|
518
518
|
className: o("px-6 py-4 mobile:pb-8"),
|
|
519
|
-
children: /* @__PURE__ */
|
|
519
|
+
children: /* @__PURE__ */ G(g, {
|
|
520
520
|
tooltip: w,
|
|
521
521
|
hideTooltip: k || !w,
|
|
522
522
|
triggerClassName: "w-full",
|
|
523
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ G(E, {
|
|
524
524
|
label: C,
|
|
525
525
|
onClick: M,
|
|
526
526
|
disabled: !k,
|
|
@@ -529,8 +529,8 @@ var we = (e, t) => {
|
|
|
529
529
|
})
|
|
530
530
|
})]
|
|
531
531
|
});
|
|
532
|
-
},
|
|
533
|
-
let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } =
|
|
532
|
+
}, He = { modal: "_modal_od073_1" }, Ue = ({ 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 = He.modal }) => {
|
|
533
|
+
let { responseFormat: b, systemPrompt: x, temperature: S, canSubmit: C, setResponseFormat: D, setSystemPrompt: O, setTemperature: k, handleSubmit: A } = Re({
|
|
534
534
|
features: e,
|
|
535
535
|
initialResponseFormat: t,
|
|
536
536
|
initialSystemPrompt: n,
|
|
@@ -538,25 +538,25 @@ var we = (e, t) => {
|
|
|
538
538
|
onSave: i,
|
|
539
539
|
onClose: a
|
|
540
540
|
});
|
|
541
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ G(w, {
|
|
542
542
|
open: !0,
|
|
543
543
|
header: o,
|
|
544
544
|
size: T.Sm,
|
|
545
545
|
onClose: a,
|
|
546
546
|
className: y,
|
|
547
|
-
footer: /* @__PURE__ */
|
|
547
|
+
footer: /* @__PURE__ */ G("div", {
|
|
548
548
|
className: "flex justify-end px-6 py-4",
|
|
549
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ G(g, {
|
|
550
550
|
tooltip: v,
|
|
551
551
|
hideTooltip: C || !v,
|
|
552
|
-
children: /* @__PURE__ */
|
|
552
|
+
children: /* @__PURE__ */ G(E, {
|
|
553
553
|
label: _,
|
|
554
554
|
onClick: A,
|
|
555
555
|
disabled: !C
|
|
556
556
|
})
|
|
557
557
|
})
|
|
558
558
|
}),
|
|
559
|
-
children: /* @__PURE__ */
|
|
559
|
+
children: /* @__PURE__ */ G(Be, {
|
|
560
560
|
features: e,
|
|
561
561
|
responseFormat: b,
|
|
562
562
|
systemPrompt: x,
|
|
@@ -576,11 +576,11 @@ var we = (e, t) => {
|
|
|
576
576
|
})
|
|
577
577
|
});
|
|
578
578
|
};
|
|
579
|
-
|
|
580
|
-
var
|
|
579
|
+
R(Ue);
|
|
580
|
+
var We = {
|
|
581
581
|
icon: "_icon_1fv6z_1",
|
|
582
582
|
selectedIcon: "_selectedIcon_1fv6z_5"
|
|
583
|
-
},
|
|
583
|
+
}, Ge = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: s, title: u = "Tools", items: d, onToolToggle: f, itemLabelClassName: p = "dial-small-text", colors: m }) => /* @__PURE__ */ G(q, {
|
|
584
584
|
isOpen: e,
|
|
585
585
|
title: u,
|
|
586
586
|
closeLabel: i,
|
|
@@ -588,32 +588,32 @@ var Ke = {
|
|
|
588
588
|
onBack: t,
|
|
589
589
|
backLabel: n,
|
|
590
590
|
style: s,
|
|
591
|
-
children: /* @__PURE__ */
|
|
591
|
+
children: /* @__PURE__ */ G("ul", {
|
|
592
592
|
role: "menu",
|
|
593
593
|
className: "flex flex-col pb-4",
|
|
594
594
|
style: a({
|
|
595
595
|
"--tbs-icon-text": m?.iconText,
|
|
596
596
|
"--tbs-selected-icon-text": m?.selectedIconText
|
|
597
597
|
}),
|
|
598
|
-
children: d.map((e) => /* @__PURE__ */
|
|
598
|
+
children: d.map((e) => /* @__PURE__ */ G("li", {
|
|
599
599
|
role: "none",
|
|
600
|
-
children: /* @__PURE__ */
|
|
600
|
+
children: /* @__PURE__ */ G(l, {
|
|
601
601
|
type: "button",
|
|
602
602
|
role: "menuitemcheckbox",
|
|
603
603
|
"aria-checked": e.isSelected,
|
|
604
604
|
className: "w-full gap-3 px-4 py-[10px] text-start",
|
|
605
|
-
iconBefore: /* @__PURE__ */
|
|
606
|
-
className: o("flex items-center",
|
|
605
|
+
iconBefore: /* @__PURE__ */ G("span", {
|
|
606
|
+
className: o("flex items-center", We.icon),
|
|
607
607
|
children: e.icon
|
|
608
608
|
}),
|
|
609
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
610
|
-
className: o("ms-auto",
|
|
611
|
-
children: /* @__PURE__ */
|
|
609
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ G("span", {
|
|
610
|
+
className: o("ms-auto", We.selectedIcon),
|
|
611
|
+
children: /* @__PURE__ */ G(N, {
|
|
612
612
|
size: c,
|
|
613
613
|
"aria-hidden": !0
|
|
614
614
|
})
|
|
615
615
|
}) : null,
|
|
616
|
-
label: /* @__PURE__ */
|
|
616
|
+
label: /* @__PURE__ */ G("span", {
|
|
617
617
|
className: p,
|
|
618
618
|
children: e.label
|
|
619
619
|
}),
|
|
@@ -621,12 +621,12 @@ var Ke = {
|
|
|
621
621
|
})
|
|
622
622
|
}, e.id))
|
|
623
623
|
})
|
|
624
|
-
}),
|
|
624
|
+
}), Ke = {
|
|
625
625
|
selectedToolIcon: "_selectedToolIcon_r268y_1",
|
|
626
626
|
toolIcon: "_toolIcon_r268y_5",
|
|
627
627
|
chevronIcon: "_chevronIcon_r268y_9"
|
|
628
|
-
},
|
|
629
|
-
let D = s(), [O, k] =
|
|
628
|
+
}, qe = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: l, style: u, listClassName: f = "w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: h, toolsMenuItems: g = [], onToolToggle: y, toolsMenuTitle: x = "Tools", toolsBackLabel: S = "Back", promptsMenuOverlay: C, promptsMenuTitle: w = "Prompts", promptsBackLabel: T = "Back", colors: E }) => {
|
|
629
|
+
let D = s(), [O, k] = U(!1), [A, j] = U(!1), [ee, M] = U(!1), [te, ne] = U(!1), [re, F] = U(!1), I = V(() => a({
|
|
630
630
|
"--aab-selected-tool-icon": E?.selectedToolIcon,
|
|
631
631
|
"--aab-tool-icon": E?.toolIcon,
|
|
632
632
|
"--aab-chevron-icon": E?.chevronIcon
|
|
@@ -634,91 +634,95 @@ var Ke = {
|
|
|
634
634
|
E?.selectedToolIcon,
|
|
635
635
|
E?.toolIcon,
|
|
636
636
|
E?.chevronIcon
|
|
637
|
-
]),
|
|
637
|
+
]), le = g.length > 0 && y != null, ue = V(() => g.map((e) => ({
|
|
638
638
|
key: e.id,
|
|
639
|
-
label: /* @__PURE__ */
|
|
639
|
+
label: /* @__PURE__ */ K("span", {
|
|
640
640
|
className: "flex flex-1 items-center gap-2",
|
|
641
|
-
children: [/* @__PURE__ */
|
|
641
|
+
children: [/* @__PURE__ */ G("span", {
|
|
642
642
|
className: "flex-1",
|
|
643
643
|
children: e.label
|
|
644
|
-
}), e.isSelected && /* @__PURE__ */
|
|
644
|
+
}), e.isSelected && /* @__PURE__ */ G(N, {
|
|
645
645
|
size: c,
|
|
646
|
-
style:
|
|
647
|
-
className:
|
|
646
|
+
style: I,
|
|
647
|
+
className: Ke.selectedToolIcon,
|
|
648
648
|
"aria-hidden": !0
|
|
649
649
|
})]
|
|
650
650
|
}),
|
|
651
|
-
icon: /* @__PURE__ */
|
|
652
|
-
style:
|
|
653
|
-
className: o("flex items-center",
|
|
651
|
+
icon: /* @__PURE__ */ G("span", {
|
|
652
|
+
style: I,
|
|
653
|
+
className: o("flex items-center", Ke.toolIcon),
|
|
654
654
|
children: e.icon
|
|
655
655
|
}),
|
|
656
656
|
onClick: () => y?.(e.id)
|
|
657
657
|
})), [
|
|
658
658
|
g,
|
|
659
659
|
y,
|
|
660
|
-
|
|
661
|
-
]), L =
|
|
660
|
+
I
|
|
661
|
+
]), L = V(() => [
|
|
662
662
|
...e == null ? [] : [{
|
|
663
663
|
key: "attach",
|
|
664
664
|
label: t,
|
|
665
|
-
icon: /* @__PURE__ */
|
|
665
|
+
icon: /* @__PURE__ */ G(ie, {
|
|
666
666
|
size: c,
|
|
667
667
|
"aria-hidden": !0
|
|
668
668
|
}),
|
|
669
669
|
onClick: e
|
|
670
670
|
}],
|
|
671
671
|
...h ?? [],
|
|
672
|
-
...
|
|
672
|
+
...le ? [{
|
|
673
673
|
key: "tools",
|
|
674
674
|
label: x,
|
|
675
|
-
icon: /* @__PURE__ */
|
|
675
|
+
icon: /* @__PURE__ */ G(ce, {
|
|
676
676
|
size: c,
|
|
677
677
|
"aria-hidden": !0
|
|
678
678
|
}),
|
|
679
679
|
onClick: D ? () => {
|
|
680
680
|
M(!0), k(!1);
|
|
681
681
|
} : () => void 0,
|
|
682
|
-
...D ? { iconAfter: /* @__PURE__ */
|
|
682
|
+
...D ? { iconAfter: /* @__PURE__ */ G(P, {
|
|
683
683
|
size: c,
|
|
684
684
|
stroke: 1.5,
|
|
685
|
-
style:
|
|
686
|
-
className: o("rtl:scale-x-[-1]",
|
|
685
|
+
style: I,
|
|
686
|
+
className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
|
|
687
687
|
"aria-hidden": !0
|
|
688
|
-
}) } : { children:
|
|
688
|
+
}) } : { children: ue }
|
|
689
689
|
}] : [],
|
|
690
690
|
...C == null ? [] : [{
|
|
691
691
|
key: "prompts",
|
|
692
692
|
label: w,
|
|
693
|
-
icon: /* @__PURE__ */
|
|
693
|
+
icon: /* @__PURE__ */ G(oe, {
|
|
694
694
|
size: c,
|
|
695
695
|
"aria-hidden": !0
|
|
696
696
|
}),
|
|
697
697
|
onClick: D ? () => {
|
|
698
|
-
|
|
699
|
-
} : () =>
|
|
700
|
-
|
|
701
|
-
},
|
|
702
|
-
iconAfter: D ? /* @__PURE__ */ U(ne, {
|
|
698
|
+
ne(!0), k(!1);
|
|
699
|
+
} : () => void 0,
|
|
700
|
+
...D ? { iconAfter: /* @__PURE__ */ G(P, {
|
|
703
701
|
size: c,
|
|
704
702
|
stroke: 1.5,
|
|
705
|
-
style:
|
|
706
|
-
className: o("rtl:scale-x-[-1]",
|
|
703
|
+
style: I,
|
|
704
|
+
className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
|
|
707
705
|
"aria-hidden": !0
|
|
708
|
-
}) :
|
|
706
|
+
}) } : {
|
|
707
|
+
children: [{
|
|
708
|
+
key: "prompts-panel",
|
|
709
|
+
label: ""
|
|
710
|
+
}],
|
|
711
|
+
renderSubMenu: () => C(() => F(!1))
|
|
712
|
+
}
|
|
709
713
|
}],
|
|
710
714
|
...m == null ? [] : [{
|
|
711
715
|
key: "chat-settings",
|
|
712
716
|
label: m.menuItemLabel ?? "Chat settings",
|
|
713
|
-
icon: /* @__PURE__ */
|
|
717
|
+
icon: /* @__PURE__ */ G(se, {
|
|
714
718
|
size: c,
|
|
715
719
|
"aria-hidden": !0
|
|
716
720
|
}),
|
|
717
|
-
iconAfter: D ? /* @__PURE__ */
|
|
721
|
+
iconAfter: D ? /* @__PURE__ */ G(P, {
|
|
718
722
|
size: c,
|
|
719
723
|
stroke: 1.5,
|
|
720
|
-
style:
|
|
721
|
-
className: o("rtl:scale-x-[-1]",
|
|
724
|
+
style: I,
|
|
725
|
+
className: o("rtl:scale-x-[-1]", Ke.chevronIcon),
|
|
722
726
|
"aria-hidden": !0
|
|
723
727
|
}) : null,
|
|
724
728
|
onClick: () => j(!0)
|
|
@@ -729,23 +733,23 @@ var Ke = {
|
|
|
729
733
|
m,
|
|
730
734
|
h,
|
|
731
735
|
D,
|
|
732
|
-
|
|
736
|
+
le,
|
|
733
737
|
x,
|
|
734
|
-
|
|
738
|
+
ue,
|
|
735
739
|
C,
|
|
736
740
|
w,
|
|
737
|
-
|
|
741
|
+
I
|
|
738
742
|
]);
|
|
739
743
|
if (L.length === 0) return null;
|
|
740
|
-
let R = /* @__PURE__ */
|
|
744
|
+
let R = /* @__PURE__ */ G(_, {
|
|
741
745
|
matchReferenceWidth: !1,
|
|
742
746
|
placement: "bottom-start",
|
|
743
747
|
listClassName: f,
|
|
744
748
|
items: L,
|
|
745
|
-
open: C == null ? void 0 :
|
|
746
|
-
onOpenChange: C == null ? void 0 :
|
|
747
|
-
children: /* @__PURE__ */
|
|
748
|
-
icon: /* @__PURE__ */
|
|
749
|
+
open: C == null ? void 0 : re,
|
|
750
|
+
onOpenChange: C == null ? void 0 : F,
|
|
751
|
+
children: /* @__PURE__ */ G(b, {
|
|
752
|
+
icon: /* @__PURE__ */ G(ae, {
|
|
749
753
|
size: d.LG,
|
|
750
754
|
"aria-hidden": !0
|
|
751
755
|
}),
|
|
@@ -754,9 +758,9 @@ var Ke = {
|
|
|
754
758
|
disabled: p
|
|
755
759
|
})
|
|
756
760
|
});
|
|
757
|
-
return /* @__PURE__ */
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
icon: /* @__PURE__ */
|
|
761
|
+
return /* @__PURE__ */ G(W, { children: D ? /* @__PURE__ */ K(W, { children: [
|
|
762
|
+
/* @__PURE__ */ G(b, {
|
|
763
|
+
icon: /* @__PURE__ */ G(ae, {
|
|
760
764
|
size: d.LG,
|
|
761
765
|
"aria-hidden": !0
|
|
762
766
|
}),
|
|
@@ -766,7 +770,7 @@ var Ke = {
|
|
|
766
770
|
disabled: p,
|
|
767
771
|
onClick: () => k(!0)
|
|
768
772
|
}),
|
|
769
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ G(Le, {
|
|
770
774
|
isOpen: O,
|
|
771
775
|
title: r,
|
|
772
776
|
closeLabel: l,
|
|
@@ -776,7 +780,7 @@ var Ke = {
|
|
|
776
780
|
className: "pb-4",
|
|
777
781
|
btnTextClassName: "flex-1"
|
|
778
782
|
}),
|
|
779
|
-
|
|
783
|
+
le && /* @__PURE__ */ G(Ge, {
|
|
780
784
|
isOpen: ee,
|
|
781
785
|
onBack: () => {
|
|
782
786
|
M(!1), k(!0);
|
|
@@ -789,19 +793,19 @@ var Ke = {
|
|
|
789
793
|
items: g,
|
|
790
794
|
onToolToggle: y
|
|
791
795
|
}),
|
|
792
|
-
C != null && /* @__PURE__ */
|
|
793
|
-
isOpen:
|
|
796
|
+
C != null && /* @__PURE__ */ G(q, {
|
|
797
|
+
isOpen: te,
|
|
794
798
|
title: w,
|
|
795
799
|
closeLabel: l,
|
|
796
800
|
onBack: () => {
|
|
797
|
-
|
|
801
|
+
ne(!1), k(!0);
|
|
798
802
|
},
|
|
799
803
|
backLabel: T,
|
|
800
|
-
onClose: () =>
|
|
804
|
+
onClose: () => ne(!1),
|
|
801
805
|
style: u,
|
|
802
|
-
children: C(() =>
|
|
806
|
+
children: C(() => ne(!1))
|
|
803
807
|
}),
|
|
804
|
-
m != null && /* @__PURE__ */
|
|
808
|
+
m != null && /* @__PURE__ */ G(Ve, {
|
|
805
809
|
isOpen: A,
|
|
806
810
|
onBack: () => {
|
|
807
811
|
j(!1), k(!0);
|
|
@@ -828,17 +832,7 @@ var Ke = {
|
|
|
828
832
|
saveLabel: m.saveLabel,
|
|
829
833
|
saveDisabledTooltip: m.saveDisabledTooltip
|
|
830
834
|
})
|
|
831
|
-
] }) : /* @__PURE__ */ W
|
|
832
|
-
matchReferenceWidth: !1,
|
|
833
|
-
placement: "bottom-start",
|
|
834
|
-
trigger: [],
|
|
835
|
-
open: se,
|
|
836
|
-
onOpenChange: P,
|
|
837
|
-
renderOverlay: () => C(() => P(!1), () => {
|
|
838
|
-
P(!1), oe(!0);
|
|
839
|
-
}),
|
|
840
|
-
children: R
|
|
841
|
-
}), m != null && A && /* @__PURE__ */ U(Ge, {
|
|
835
|
+
] }) : /* @__PURE__ */ K(W, { children: [R, m != null && A && /* @__PURE__ */ G(Ue, {
|
|
842
836
|
features: m.features,
|
|
843
837
|
initialResponseFormat: m.responseFormat ?? i.Markdown,
|
|
844
838
|
initialSystemPrompt: m.systemPrompt,
|
|
@@ -858,12 +852,12 @@ var Ke = {
|
|
|
858
852
|
saveLabel: m.saveLabel,
|
|
859
853
|
saveDisabledTooltip: m.saveDisabledTooltip
|
|
860
854
|
})] }) });
|
|
861
|
-
},
|
|
855
|
+
}, J = {
|
|
862
856
|
chip: "_chip_1gu87_1",
|
|
863
857
|
chipIcon: "_chipIcon_1gu87_6",
|
|
864
858
|
chipText: "_chipText_1gu87_10",
|
|
865
859
|
chipClose: "_chipClose_1gu87_14"
|
|
866
|
-
},
|
|
860
|
+
}, Je = (e) => `${e} tool${e === 1 ? "" : "s"}`, Ye = (e) => `Remove ${e}`, Xe = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = Je, removeLabel: i = Ye, typography: s, colors: l }) => {
|
|
867
861
|
let u = e.filter((e) => e.isSelected);
|
|
868
862
|
if (u.length === 0) return null;
|
|
869
863
|
let d = a({
|
|
@@ -875,47 +869,47 @@ var Ke = {
|
|
|
875
869
|
"--ci-chip-close-hover": l?.chipCloseHover
|
|
876
870
|
});
|
|
877
871
|
if (n) {
|
|
878
|
-
let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */
|
|
872
|
+
let e = u.length === 1, t = e ? u[0].icon : /* @__PURE__ */ G(ce, {
|
|
879
873
|
size: c,
|
|
880
874
|
"aria-hidden": !0
|
|
881
875
|
}), n = e ? u[0].label : r(u.length);
|
|
882
|
-
return /* @__PURE__ */
|
|
876
|
+
return /* @__PURE__ */ G("div", {
|
|
883
877
|
className: "flex flex-wrap items-center gap-2",
|
|
884
878
|
style: d,
|
|
885
|
-
children: /* @__PURE__ */
|
|
886
|
-
className: o(
|
|
887
|
-
children: [/* @__PURE__ */
|
|
888
|
-
className: o(
|
|
879
|
+
children: /* @__PURE__ */ K("div", {
|
|
880
|
+
className: o(J.chip, "flex min-w-0 items-center gap-1.5 rounded-full border px-2 py-1"),
|
|
881
|
+
children: [/* @__PURE__ */ G("span", {
|
|
882
|
+
className: o(J.chipIcon, "shrink-0"),
|
|
889
883
|
"aria-hidden": !0,
|
|
890
884
|
children: t
|
|
891
|
-
}), /* @__PURE__ */
|
|
892
|
-
className: o(
|
|
885
|
+
}), /* @__PURE__ */ G("span", {
|
|
886
|
+
className: o(J.chipText, s?.fontClassName || "dial-small-paragraph-text", "truncate"),
|
|
893
887
|
children: n
|
|
894
888
|
})]
|
|
895
889
|
})
|
|
896
890
|
});
|
|
897
891
|
}
|
|
898
|
-
return /* @__PURE__ */
|
|
892
|
+
return /* @__PURE__ */ G("div", {
|
|
899
893
|
className: "flex flex-wrap items-center gap-2",
|
|
900
894
|
style: d,
|
|
901
|
-
children: u.map((e) => /* @__PURE__ */
|
|
902
|
-
className: o(
|
|
895
|
+
children: u.map((e) => /* @__PURE__ */ K("div", {
|
|
896
|
+
className: o(J.chip, "flex items-center gap-1.5 rounded-full border py-1 pe-1 ps-2"),
|
|
903
897
|
children: [
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
-
className:
|
|
898
|
+
/* @__PURE__ */ G("span", {
|
|
899
|
+
className: J.chipIcon,
|
|
906
900
|
"aria-hidden": !0,
|
|
907
901
|
children: e.icon
|
|
908
902
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
className: o(
|
|
903
|
+
/* @__PURE__ */ G("span", {
|
|
904
|
+
className: o(J.chipText, s?.fontClassName || "dial-small-paragraph-text"),
|
|
911
905
|
children: e.label
|
|
912
906
|
}),
|
|
913
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ G("button", {
|
|
914
908
|
type: "button",
|
|
915
909
|
onClick: () => t(e.id),
|
|
916
|
-
className: o(
|
|
910
|
+
className: o(J.chipClose, "flex items-center rounded p-0.5 transition-colors"),
|
|
917
911
|
"aria-label": i(e.label),
|
|
918
|
-
children: /* @__PURE__ */
|
|
912
|
+
children: /* @__PURE__ */ G(le, {
|
|
919
913
|
size: 12,
|
|
920
914
|
"aria-hidden": !0
|
|
921
915
|
})
|
|
@@ -935,22 +929,22 @@ var Ke = {
|
|
|
935
929
|
waveformCanvas: "_waveformCanvas_129ri_5",
|
|
936
930
|
recordingDot: "_recordingDot_129ri_19",
|
|
937
931
|
"recording-pulse": "_recording-pulse_129ri_1"
|
|
938
|
-
}, Ze = 3, Qe = 4,
|
|
939
|
-
let u =
|
|
932
|
+
}, Ze = 3, Qe = 4, $e = 200, et = ({ state: e, analyserNodeRef: t, errorMessage: n, onStop: r, onDiscard: i, stopLabel: a = "Stop recording", discardLabel: s = "Discard recording", style: c, className: l }) => {
|
|
933
|
+
let u = H(null), f = H(new Float32Array($e)), p = H(0), m = H(0), h = e === je.Recording, g = e === je.Error, _ = z((e) => {
|
|
940
934
|
let t = e.getContext("2d");
|
|
941
935
|
if (!t) return;
|
|
942
936
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
943
937
|
let { width: n, height: r } = e;
|
|
944
938
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
945
|
-
let i = Math.min(Math.max(1, Math.floor(n / Qe)),
|
|
939
|
+
let i = Math.min(Math.max(1, Math.floor(n / Qe)), $e - 1), a = p.current, o = m.current;
|
|
946
940
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
947
941
|
for (let e = 0; e <= i; e++) {
|
|
948
|
-
let n = ((a - i + e) %
|
|
942
|
+
let n = ((a - i + e) % $e + $e) % $e, o = f.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
949
943
|
t.fillRect(e * Qe, (r - c) / 2, Ze, c);
|
|
950
944
|
}
|
|
951
945
|
t.restore();
|
|
952
946
|
}, []);
|
|
953
|
-
|
|
947
|
+
B(() => {
|
|
954
948
|
if (!h) return;
|
|
955
949
|
let e = u.current;
|
|
956
950
|
if (!e) return;
|
|
@@ -967,7 +961,7 @@ var Ke = {
|
|
|
967
961
|
let r = (t[e] - 128) / 128;
|
|
968
962
|
n += r * r;
|
|
969
963
|
}
|
|
970
|
-
f.current[p.current %
|
|
964
|
+
f.current[p.current % $e] = Math.sqrt(n / t.length), p.current++;
|
|
971
965
|
}
|
|
972
966
|
}
|
|
973
967
|
_(e), n = requestAnimationFrame(r);
|
|
@@ -979,7 +973,7 @@ var Ke = {
|
|
|
979
973
|
h,
|
|
980
974
|
t,
|
|
981
975
|
_
|
|
982
|
-
]),
|
|
976
|
+
]), B(() => {
|
|
983
977
|
let e = u.current;
|
|
984
978
|
if (!e) return;
|
|
985
979
|
let t = new ResizeObserver(() => {
|
|
@@ -987,17 +981,17 @@ var Ke = {
|
|
|
987
981
|
});
|
|
988
982
|
return t.observe(e), () => t.disconnect();
|
|
989
983
|
}, [_]);
|
|
990
|
-
let v = /* @__PURE__ */
|
|
984
|
+
let v = /* @__PURE__ */ K("div", {
|
|
991
985
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
992
|
-
children: [/* @__PURE__ */
|
|
993
|
-
icon: /* @__PURE__ */
|
|
986
|
+
children: [/* @__PURE__ */ G(b, {
|
|
987
|
+
icon: /* @__PURE__ */ G(le, {
|
|
994
988
|
size: d.LG,
|
|
995
989
|
"aria-hidden": !0
|
|
996
990
|
}),
|
|
997
991
|
"aria-label": s,
|
|
998
992
|
onClick: i
|
|
999
|
-
}), h && /* @__PURE__ */
|
|
1000
|
-
icon: /* @__PURE__ */
|
|
993
|
+
}), h && /* @__PURE__ */ G(D, {
|
|
994
|
+
icon: /* @__PURE__ */ G(F, {
|
|
1001
995
|
size: d.LG,
|
|
1002
996
|
"aria-hidden": !0
|
|
1003
997
|
}),
|
|
@@ -1005,68 +999,68 @@ var Ke = {
|
|
|
1005
999
|
"aria-label": a
|
|
1006
1000
|
})]
|
|
1007
1001
|
});
|
|
1008
|
-
return /* @__PURE__ */
|
|
1002
|
+
return /* @__PURE__ */ K("div", {
|
|
1009
1003
|
className: l,
|
|
1010
|
-
children: [/* @__PURE__ */
|
|
1004
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1011
1005
|
style: c,
|
|
1012
1006
|
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", g && X.wrapperError),
|
|
1013
|
-
children: [/* @__PURE__ */
|
|
1007
|
+
children: [/* @__PURE__ */ K("div", {
|
|
1014
1008
|
className: "flex min-w-0 flex-1 items-center gap-3",
|
|
1015
|
-
children: [h && /* @__PURE__ */
|
|
1009
|
+
children: [h && /* @__PURE__ */ G("span", {
|
|
1016
1010
|
className: o(X.recordingDot, "pointer-events-none block size-[8px] rounded-3xl"),
|
|
1017
1011
|
"aria-hidden": !0
|
|
1018
|
-
}), /* @__PURE__ */
|
|
1012
|
+
}), /* @__PURE__ */ G("canvas", {
|
|
1019
1013
|
ref: u,
|
|
1020
1014
|
height: 32,
|
|
1021
1015
|
className: o(X.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
1022
1016
|
})]
|
|
1023
1017
|
}), v]
|
|
1024
|
-
}), g && n && /* @__PURE__ */
|
|
1018
|
+
}), g && n && /* @__PURE__ */ G(y, {
|
|
1025
1019
|
text: n,
|
|
1026
1020
|
className: "mt-1 px-1"
|
|
1027
1021
|
})]
|
|
1028
1022
|
});
|
|
1029
|
-
},
|
|
1023
|
+
}, tt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ G(D, {
|
|
1030
1024
|
"aria-label": n,
|
|
1031
1025
|
onClick: () => e?.(),
|
|
1032
1026
|
disabled: t,
|
|
1033
1027
|
"aria-hidden": r,
|
|
1034
|
-
icon: /* @__PURE__ */
|
|
1028
|
+
icon: /* @__PURE__ */ G(M, {
|
|
1035
1029
|
size: d.LG,
|
|
1036
1030
|
className: "rtl:scale-x-[-1]"
|
|
1037
1031
|
})
|
|
1038
|
-
}),
|
|
1039
|
-
icon: /* @__PURE__ */
|
|
1032
|
+
}), nt = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ G(j, {
|
|
1033
|
+
icon: /* @__PURE__ */ G(I, { size: d.LG }),
|
|
1040
1034
|
onClick: () => e?.(),
|
|
1041
1035
|
"aria-label": t
|
|
1042
|
-
}),
|
|
1036
|
+
}), Z = ({ size: e = 20 }) => /* @__PURE__ */ G(k, {
|
|
1043
1037
|
variant: A.Circular,
|
|
1044
1038
|
width: e,
|
|
1045
1039
|
height: e,
|
|
1046
1040
|
active: !0
|
|
1047
|
-
}), rt = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1041
|
+
}), rt = ({ loadingLabel: e }) => /* @__PURE__ */ K("span", {
|
|
1048
1042
|
className: "flex min-w-0 flex-1 items-center",
|
|
1049
|
-
children: [/* @__PURE__ */
|
|
1043
|
+
children: [/* @__PURE__ */ G(k, {
|
|
1050
1044
|
variant: A.Text,
|
|
1051
1045
|
width: "100%",
|
|
1052
1046
|
height: 16,
|
|
1053
1047
|
active: !0
|
|
1054
|
-
}), e && /* @__PURE__ */
|
|
1048
|
+
}), e && /* @__PURE__ */ G("span", {
|
|
1055
1049
|
className: "sr-only",
|
|
1056
1050
|
children: e
|
|
1057
1051
|
})]
|
|
1058
|
-
}), it = ({ loadingLabel: e }) => /* @__PURE__ */
|
|
1052
|
+
}), it = ({ loadingLabel: e }) => /* @__PURE__ */ G("div", {
|
|
1059
1053
|
role: "status",
|
|
1060
1054
|
"aria-label": e,
|
|
1061
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1055
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ K("div", {
|
|
1062
1056
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1063
1057
|
"aria-hidden": "true",
|
|
1064
|
-
children: [/* @__PURE__ */
|
|
1058
|
+
children: [/* @__PURE__ */ G(Z, {}), /* @__PURE__ */ G(rt, {})]
|
|
1065
1059
|
}, t))
|
|
1066
1060
|
}), at = (e) => e.displayName ?? e.id, ot = (e, t) => {
|
|
1067
1061
|
let n = t.trim().toLowerCase();
|
|
1068
1062
|
return n ? e.filter((e) => at(e).toLowerCase().includes(n)) : e;
|
|
1069
|
-
}, st = (e, t, r, i = 18, a) => /* @__PURE__ */
|
|
1063
|
+
}, st = (e, t, r, i = 18, a) => /* @__PURE__ */ G(n, {
|
|
1070
1064
|
src: e,
|
|
1071
1065
|
size: i,
|
|
1072
1066
|
labels: { tooltip: a },
|
|
@@ -1076,16 +1070,16 @@ var Ke = {
|
|
|
1076
1070
|
selectedItem: "_selectedItem_ibyso_5",
|
|
1077
1071
|
selectedItemCheck: "_selectedItemCheck_ibyso_9"
|
|
1078
1072
|
}, lt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = ct.searchHeader, selectedItemClassName: s = ct.selectedItem, selectedItemCheckClassName: c = ct.selectedItemCheck, colors: l }) => {
|
|
1079
|
-
let [u, f] =
|
|
1073
|
+
let [u, f] = U(""), p = V(() => e?.find((e) => e.id === t), [e, t]), h = r?.loading !== void 0, g = V(() => h ? /* @__PURE__ */ G(Z, { size: d.LG }) : st(p?.iconUrl, p?.type, p?.displayName ?? p?.id ?? "", d.LG), [h, p]), _ = p?.displayName ?? p?.id;
|
|
1080
1074
|
return {
|
|
1081
1075
|
selectorIcon: g,
|
|
1082
1076
|
selectorAriaLabel: _ ? `${r?.ariaLabel ?? "Select model"}: ${_}` : r?.ariaLabel ?? "Select model",
|
|
1083
1077
|
selectedLabel: _,
|
|
1084
|
-
menuItems:
|
|
1078
|
+
menuItems: V(() => {
|
|
1085
1079
|
if (h) return Array.from({ length: 7 }, (e, t) => ({
|
|
1086
1080
|
key: `__loading-${t}`,
|
|
1087
|
-
icon: /* @__PURE__ */
|
|
1088
|
-
label: /* @__PURE__ */
|
|
1081
|
+
icon: /* @__PURE__ */ G(Z, {}),
|
|
1082
|
+
label: /* @__PURE__ */ G(rt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1089
1083
|
disabled: !0
|
|
1090
1084
|
}));
|
|
1091
1085
|
if (!e || e.length === 0) {
|
|
@@ -1100,14 +1094,14 @@ var Ke = {
|
|
|
1100
1094
|
let r = e.id === t;
|
|
1101
1095
|
return {
|
|
1102
1096
|
key: e.id,
|
|
1103
|
-
label: /* @__PURE__ */
|
|
1097
|
+
label: /* @__PURE__ */ K("span", {
|
|
1104
1098
|
className: "flex w-full items-center justify-between gap-2",
|
|
1105
1099
|
style: a({ "--ms-selected-item-check": l?.selectedItemCheck }),
|
|
1106
|
-
children: [/* @__PURE__ */
|
|
1100
|
+
children: [/* @__PURE__ */ G(x, {
|
|
1107
1101
|
text: at(e),
|
|
1108
1102
|
query: u,
|
|
1109
1103
|
maxLines: 1
|
|
1110
|
-
}), r && /* @__PURE__ */
|
|
1104
|
+
}), r && /* @__PURE__ */ G(N, {
|
|
1111
1105
|
size: d.SM,
|
|
1112
1106
|
stroke: 2,
|
|
1113
1107
|
className: c,
|
|
@@ -1130,10 +1124,10 @@ var Ke = {
|
|
|
1130
1124
|
c,
|
|
1131
1125
|
l?.selectedItemCheck
|
|
1132
1126
|
]),
|
|
1133
|
-
menuHeader:
|
|
1127
|
+
menuHeader: V(() => !h && e && e.length > 0 ? /* @__PURE__ */ G("div", {
|
|
1134
1128
|
style: a({ "--ms-search-header-bg": l?.searchHeaderBackground }),
|
|
1135
1129
|
className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1136
|
-
children: /* @__PURE__ */
|
|
1130
|
+
children: /* @__PURE__ */ G(m, {
|
|
1137
1131
|
value: u,
|
|
1138
1132
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1139
1133
|
size: v.Small,
|
|
@@ -1152,7 +1146,7 @@ var Ke = {
|
|
|
1152
1146
|
e || f("");
|
|
1153
1147
|
}
|
|
1154
1148
|
};
|
|
1155
|
-
}, ut = typeof window < "u" ?
|
|
1149
|
+
}, ut = typeof window < "u" ? fe : B;
|
|
1156
1150
|
function dt(e) {
|
|
1157
1151
|
if (e !== void 0) switch (typeof e) {
|
|
1158
1152
|
case "number": return e;
|
|
@@ -1162,10 +1156,10 @@ function dt(e) {
|
|
|
1162
1156
|
}
|
|
1163
1157
|
}
|
|
1164
1158
|
function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1165
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1159
|
+
let { styleHeight: s, styleWidth: c } = V(() => ({
|
|
1166
1160
|
styleHeight: dt(o?.height),
|
|
1167
1161
|
styleWidth: dt(o?.width)
|
|
1168
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1162
|
+
}), [o?.height, o?.width]), [l, u] = U({
|
|
1169
1163
|
height: t,
|
|
1170
1164
|
width: n
|
|
1171
1165
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
@@ -1189,7 +1183,7 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1189
1183
|
i,
|
|
1190
1184
|
s,
|
|
1191
1185
|
c
|
|
1192
|
-
]),
|
|
1186
|
+
]), V(() => ({
|
|
1193
1187
|
height: s ?? l.height,
|
|
1194
1188
|
width: c ?? l.width
|
|
1195
1189
|
}), [
|
|
@@ -1199,12 +1193,12 @@ function ft({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1199
1193
|
]);
|
|
1200
1194
|
}
|
|
1201
1195
|
function pt(e) {
|
|
1202
|
-
let t =
|
|
1196
|
+
let t = H(() => {
|
|
1203
1197
|
throw Error("Cannot call during render.");
|
|
1204
1198
|
});
|
|
1205
1199
|
return ut(() => {
|
|
1206
1200
|
t.current = e;
|
|
1207
|
-
}, [e]),
|
|
1201
|
+
}, [e]), z((e) => t.current?.(e), [t]);
|
|
1208
1202
|
}
|
|
1209
1203
|
var mt = null;
|
|
1210
1204
|
function ht(e = !1) {
|
|
@@ -1316,7 +1310,7 @@ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1316
1310
|
};
|
|
1317
1311
|
}
|
|
1318
1312
|
function St({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1319
|
-
return
|
|
1313
|
+
return V(() => xt({
|
|
1320
1314
|
itemCount: e,
|
|
1321
1315
|
itemProps: t,
|
|
1322
1316
|
itemSize: n
|
|
@@ -1338,21 +1332,21 @@ function Ct({ containerSize: e, itemSize: t }) {
|
|
|
1338
1332
|
}
|
|
1339
1333
|
return n;
|
|
1340
1334
|
}
|
|
1341
|
-
function
|
|
1335
|
+
function wt({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1342
1336
|
let { height: u = n, width: d = n } = ft({
|
|
1343
1337
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1344
1338
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1345
1339
|
element: e,
|
|
1346
1340
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1347
1341
|
style: t
|
|
1348
|
-
}), f =
|
|
1342
|
+
}), f = H({
|
|
1349
1343
|
height: 0,
|
|
1350
1344
|
width: 0
|
|
1351
1345
|
}), p = r === "vertical" ? u : d, m = Ct({
|
|
1352
1346
|
containerSize: p,
|
|
1353
1347
|
itemSize: s
|
|
1354
1348
|
});
|
|
1355
|
-
|
|
1349
|
+
fe(() => {
|
|
1356
1350
|
if (typeof c == "function") {
|
|
1357
1351
|
let e = f.current;
|
|
1358
1352
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1369,7 +1363,7 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1369
1363
|
itemCount: a,
|
|
1370
1364
|
itemProps: o,
|
|
1371
1365
|
itemSize: m
|
|
1372
|
-
}), g =
|
|
1366
|
+
}), g = z((e) => h.get(e), [h]), [_, v] = U(() => bt({
|
|
1373
1367
|
cachedBounds: h,
|
|
1374
1368
|
containerScrollOffset: 0,
|
|
1375
1369
|
containerSize: p,
|
|
@@ -1380,7 +1374,7 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1380
1374
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1381
1375
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1382
1376
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1383
|
-
}, C =
|
|
1377
|
+
}, C = z(() => vt({
|
|
1384
1378
|
cachedBounds: h,
|
|
1385
1379
|
itemCount: a,
|
|
1386
1380
|
itemSize: m
|
|
@@ -1388,7 +1382,7 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1388
1382
|
h,
|
|
1389
1383
|
a,
|
|
1390
1384
|
m
|
|
1391
|
-
]), w =
|
|
1385
|
+
]), w = z((t) => bt({
|
|
1392
1386
|
cachedBounds: h,
|
|
1393
1387
|
containerScrollOffset: gt({
|
|
1394
1388
|
containerElement: e,
|
|
@@ -1475,8 +1469,8 @@ function $({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0
|
|
|
1475
1469
|
stopIndexVisible: x
|
|
1476
1470
|
};
|
|
1477
1471
|
}
|
|
1478
|
-
function
|
|
1479
|
-
return
|
|
1472
|
+
function $(e) {
|
|
1473
|
+
return V(() => e, Object.values(e));
|
|
1480
1474
|
}
|
|
1481
1475
|
function Tt(e, t) {
|
|
1482
1476
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
@@ -1487,18 +1481,18 @@ function Et(e) {
|
|
|
1487
1481
|
}
|
|
1488
1482
|
var Dt = "data-react-window-index";
|
|
1489
1483
|
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 }) {
|
|
1490
|
-
let m =
|
|
1484
|
+
let m = $(u), h = V(() => R(s, Tt), [s]), [g, _] = U(null), v = Et(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = wt({
|
|
1491
1485
|
containerElement: g,
|
|
1492
1486
|
containerStyle: f,
|
|
1493
1487
|
defaultContainerSize: n,
|
|
1494
1488
|
direction: "vertical",
|
|
1495
1489
|
itemCount: c,
|
|
1496
1490
|
itemProps: m,
|
|
1497
|
-
itemSize:
|
|
1491
|
+
itemSize: V(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1498
1492
|
onResize: i,
|
|
1499
1493
|
overscanCount: o
|
|
1500
1494
|
});
|
|
1501
|
-
|
|
1495
|
+
de(r, () => ({
|
|
1502
1496
|
get element() {
|
|
1503
1497
|
return g;
|
|
1504
1498
|
},
|
|
@@ -1527,7 +1521,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1527
1521
|
l,
|
|
1528
1522
|
S,
|
|
1529
1523
|
w
|
|
1530
|
-
]),
|
|
1524
|
+
]), B(() => {
|
|
1531
1525
|
S >= 0 && w >= 0 && a && a({
|
|
1532
1526
|
startIndex: C,
|
|
1533
1527
|
stopIndex: T
|
|
@@ -1542,11 +1536,11 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1542
1536
|
w,
|
|
1543
1537
|
T
|
|
1544
1538
|
]);
|
|
1545
|
-
let E =
|
|
1539
|
+
let E = V(() => {
|
|
1546
1540
|
let e = [];
|
|
1547
1541
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1548
1542
|
let n = y(t);
|
|
1549
|
-
e.push(/* @__PURE__ */
|
|
1543
|
+
e.push(/* @__PURE__ */ L(h, {
|
|
1550
1544
|
...m,
|
|
1551
1545
|
ariaAttributes: {
|
|
1552
1546
|
"aria-posinset": t + 1,
|
|
@@ -1573,7 +1567,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1573
1567
|
m,
|
|
1574
1568
|
S,
|
|
1575
1569
|
w
|
|
1576
|
-
]), D = /* @__PURE__ */
|
|
1570
|
+
]), D = /* @__PURE__ */ G("div", {
|
|
1577
1571
|
"aria-hidden": !0,
|
|
1578
1572
|
style: {
|
|
1579
1573
|
height: b(),
|
|
@@ -1581,7 +1575,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1581
1575
|
zIndex: -1
|
|
1582
1576
|
}
|
|
1583
1577
|
});
|
|
1584
|
-
return
|
|
1578
|
+
return L(d, {
|
|
1585
1579
|
role: "list",
|
|
1586
1580
|
...p,
|
|
1587
1581
|
className: t,
|
|
@@ -1603,24 +1597,24 @@ var kt = {
|
|
|
1603
1597
|
stateLabel: "_stateLabel_s5khb_23"
|
|
1604
1598
|
}, At = 44, jt = 8, Mt = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1605
1599
|
let u = r[e], f = st(u.iconUrl, u.type, u.displayName ?? u.id, d.SM), p = u.id === i;
|
|
1606
|
-
return /* @__PURE__ */
|
|
1600
|
+
return /* @__PURE__ */ G("div", {
|
|
1607
1601
|
style: t,
|
|
1608
1602
|
...n,
|
|
1609
|
-
children: /* @__PURE__ */
|
|
1603
|
+
children: /* @__PURE__ */ G(l, {
|
|
1610
1604
|
type: "button",
|
|
1611
1605
|
className: o(kt.item, "h-full w-full gap-3 px-4"),
|
|
1612
|
-
iconBefore: /* @__PURE__ */
|
|
1606
|
+
iconBefore: /* @__PURE__ */ G("span", {
|
|
1613
1607
|
className: kt.itemIcon,
|
|
1614
1608
|
children: f
|
|
1615
1609
|
}),
|
|
1616
|
-
label: /* @__PURE__ */
|
|
1610
|
+
label: /* @__PURE__ */ K("span", {
|
|
1617
1611
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1618
|
-
children: [/* @__PURE__ */
|
|
1612
|
+
children: [/* @__PURE__ */ G(x, {
|
|
1619
1613
|
text: u.displayName ?? u.id,
|
|
1620
1614
|
query: s,
|
|
1621
1615
|
maxLines: 1,
|
|
1622
1616
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1623
|
-
}), p && /* @__PURE__ */
|
|
1617
|
+
}), p && /* @__PURE__ */ G(N, {
|
|
1624
1618
|
size: d.SM,
|
|
1625
1619
|
className: kt.checkIcon,
|
|
1626
1620
|
"aria-hidden": !0
|
|
@@ -1630,8 +1624,8 @@ var kt = {
|
|
|
1630
1624
|
})
|
|
1631
1625
|
});
|
|
1632
1626
|
}, Nt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: s, selectedDeploymentId: c, onSelect: l, loadingLabel: u, errorLabel: d, emptyLabel: f, style: p, titleClassName: h = "dial-body-semi-text", labelClassName: g = "dial-small-text", colors: _ }) => {
|
|
1633
|
-
let [y, b] =
|
|
1634
|
-
|
|
1627
|
+
let [y, b] = U("");
|
|
1628
|
+
B(() => {
|
|
1635
1629
|
e || b("");
|
|
1636
1630
|
}, [e]);
|
|
1637
1631
|
let x = s && s.length > 0, S = u !== void 0, C = !x && !S ? d ?? f : void 0, w = x ? ot(s, y) : [], T = (e) => {
|
|
@@ -1644,7 +1638,7 @@ var kt = {
|
|
|
1644
1638
|
"--ci-sheet-icon": _?.itemIcon,
|
|
1645
1639
|
"--ci-check-icon": _?.checkIcon
|
|
1646
1640
|
});
|
|
1647
|
-
return /* @__PURE__ */
|
|
1641
|
+
return /* @__PURE__ */ G(q, {
|
|
1648
1642
|
isOpen: e,
|
|
1649
1643
|
title: t,
|
|
1650
1644
|
closeLabel: n,
|
|
@@ -1653,22 +1647,22 @@ var kt = {
|
|
|
1653
1647
|
titleClassName: h,
|
|
1654
1648
|
className: "max-h-[80dvh]",
|
|
1655
1649
|
colors: _?.shell,
|
|
1656
|
-
children: /* @__PURE__ */
|
|
1650
|
+
children: /* @__PURE__ */ K("div", {
|
|
1657
1651
|
className: "contents",
|
|
1658
1652
|
style: E,
|
|
1659
|
-
children: [x && !S && /* @__PURE__ */ W
|
|
1653
|
+
children: [x && !S && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("div", {
|
|
1660
1654
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1661
|
-
children: /* @__PURE__ */
|
|
1655
|
+
children: /* @__PURE__ */ G(m, {
|
|
1662
1656
|
value: y,
|
|
1663
1657
|
placeholder: r,
|
|
1664
1658
|
size: v.Standard,
|
|
1665
1659
|
onChange: b
|
|
1666
1660
|
})
|
|
1667
|
-
}), /* @__PURE__ */
|
|
1661
|
+
}), /* @__PURE__ */ G("div", { className: o(kt.divider, "h-px flex-shrink-0") })] }), S ? /* @__PURE__ */ G(it, { loadingLabel: u }) : C ? /* @__PURE__ */ G("div", {
|
|
1668
1662
|
role: "list",
|
|
1669
1663
|
className: o(kt.stateLabel, g, "px-4 py-4"),
|
|
1670
1664
|
children: C
|
|
1671
|
-
}) : /* @__PURE__ */
|
|
1665
|
+
}) : /* @__PURE__ */ G(Ot, {
|
|
1672
1666
|
role: "list",
|
|
1673
1667
|
className: "overflow-y-auto",
|
|
1674
1668
|
style: { height: Math.min(w.length, jt) * At },
|
|
@@ -1686,22 +1680,22 @@ var kt = {
|
|
|
1686
1680
|
})
|
|
1687
1681
|
});
|
|
1688
1682
|
}, Pt = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, isStreaming: i, isMobile: a, isDisabled: s = !1, style: c, modelPickerOverlay: l, isPickerOpen: u, onPickerToggle: p, onPickerOpenChange: m }) => {
|
|
1689
|
-
let [h, y] =
|
|
1683
|
+
let [h, y] = U(!1), { selectorIcon: x, selectorAriaLabel: S, selectedLabel: C, menuItems: w, menuHeader: T, onOpenChange: E } = lt({
|
|
1690
1684
|
deployments: e,
|
|
1691
1685
|
selectedDeploymentId: t,
|
|
1692
1686
|
onDeploymentChange: n,
|
|
1693
1687
|
modelSelectorLabels: r
|
|
1694
1688
|
});
|
|
1695
1689
|
if (!e) return null;
|
|
1696
|
-
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */
|
|
1690
|
+
let D = i || s ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, O = /* @__PURE__ */ G(te, {
|
|
1697
1691
|
size: d.SM,
|
|
1698
1692
|
className: Y.modelSelectorCaret,
|
|
1699
1693
|
"aria-hidden": !0
|
|
1700
1694
|
});
|
|
1701
|
-
return a ? /* @__PURE__ */ W
|
|
1695
|
+
return a ? /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G(g, {
|
|
1702
1696
|
tooltip: C,
|
|
1703
|
-
children: /* @__PURE__ */
|
|
1704
|
-
icon: /* @__PURE__ */
|
|
1697
|
+
children: /* @__PURE__ */ G(b, {
|
|
1698
|
+
icon: /* @__PURE__ */ K("div", {
|
|
1705
1699
|
className: "flex items-center gap-1",
|
|
1706
1700
|
children: [x, O]
|
|
1707
1701
|
}),
|
|
@@ -1711,14 +1705,14 @@ var kt = {
|
|
|
1711
1705
|
},
|
|
1712
1706
|
className: o("w-[50px]", Y.modelSelectorButton, D)
|
|
1713
1707
|
})
|
|
1714
|
-
}), l ? /* @__PURE__ */
|
|
1708
|
+
}), l ? /* @__PURE__ */ G(q, {
|
|
1715
1709
|
isOpen: h,
|
|
1716
1710
|
title: r?.ariaLabel ?? "Select model",
|
|
1717
1711
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1718
1712
|
onClose: () => y(!1),
|
|
1719
1713
|
style: c,
|
|
1720
1714
|
children: l(() => y(!1))
|
|
1721
|
-
}) : /* @__PURE__ */
|
|
1715
|
+
}) : /* @__PURE__ */ G(Nt, {
|
|
1722
1716
|
isOpen: h,
|
|
1723
1717
|
title: r?.ariaLabel ?? "Select model",
|
|
1724
1718
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1731,7 +1725,7 @@ var kt = {
|
|
|
1731
1725
|
errorLabel: r?.error,
|
|
1732
1726
|
emptyLabel: r?.empty,
|
|
1733
1727
|
style: c
|
|
1734
|
-
})] }) : l ? /* @__PURE__ */
|
|
1728
|
+
})] }) : l ? /* @__PURE__ */ G(_, {
|
|
1735
1729
|
placement: "top-end",
|
|
1736
1730
|
matchReferenceWidth: !1,
|
|
1737
1731
|
open: u,
|
|
@@ -1740,9 +1734,9 @@ var kt = {
|
|
|
1740
1734
|
outsideClosable: !0,
|
|
1741
1735
|
renderOverlay: () => l(() => m?.(!1)),
|
|
1742
1736
|
listClassName: "cp-dropdown-overlay !w-[320px]",
|
|
1743
|
-
children: /* @__PURE__ */
|
|
1737
|
+
children: /* @__PURE__ */ G(g, {
|
|
1744
1738
|
tooltip: C,
|
|
1745
|
-
children: /* @__PURE__ */
|
|
1739
|
+
children: /* @__PURE__ */ K("button", {
|
|
1746
1740
|
type: "button",
|
|
1747
1741
|
"aria-label": S,
|
|
1748
1742
|
"aria-disabled": s || void 0,
|
|
@@ -1753,12 +1747,12 @@ var kt = {
|
|
|
1753
1747
|
children: [x, O]
|
|
1754
1748
|
})
|
|
1755
1749
|
})
|
|
1756
|
-
}) : /* @__PURE__ */
|
|
1750
|
+
}) : /* @__PURE__ */ G("div", {
|
|
1757
1751
|
className: o(s && D),
|
|
1758
1752
|
"aria-disabled": s || void 0,
|
|
1759
|
-
children: /* @__PURE__ */
|
|
1753
|
+
children: /* @__PURE__ */ G(g, {
|
|
1760
1754
|
tooltip: C,
|
|
1761
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ G(f, {
|
|
1762
1756
|
icon: x,
|
|
1763
1757
|
ariaLabel: S,
|
|
1764
1758
|
items: w,
|
|
@@ -1774,8 +1768,8 @@ var kt = {
|
|
|
1774
1768
|
})
|
|
1775
1769
|
})
|
|
1776
1770
|
});
|
|
1777
|
-
}, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: k, pendingDropFiles: A = [], onDropFilesConsumed: ee, pendingAttachments: M = [], onPendingAttachmentsConsumed:
|
|
1778
|
-
let
|
|
1771
|
+
}, Ft = 160, It = ({ message: e = "", messageRevision: t, onSend: n, onUploadAttachment: r, onStop: i, isStreaming: l = !1, onChange: u, onAttachmentsChange: f, placeholder: p = "Type a message...", ariaLabel: m, attachLabel: h = "Attach file", fileAccept: g, addMenuTitle: _ = "Add", menuTitle: v = "Menu", menuCloseLabel: y = "Close", removeLabel: b, retryLabel: x, sendLabel: S, stopLabel: C, micLabel: w = "Record voice message", stopRecordingLabel: T, discardRecordingLabel: E, colors: D, typography: O, className: k, pendingDropFiles: A = [], onDropFilesConsumed: ee, pendingAttachments: M = [], onPendingAttachmentsConsumed: N, pasteTextThreshold: te = 4e3, maxMessageLength: P = 5e4, deployments: ie, selectedDeploymentId: F, onDeploymentChange: I, modelSelectorLabels: ae, initialAttachments: oe = [], isStacked: se = !1, hideAddButton: ce = !1, hideAttachFile: le = !1, hideActionBar: ue = !1, renderFooterActions: L, isInputDisabled: R = !1, isModelSelectorDisabled: B = !1, isSendDisabled: de = !1, isAudioMessageSupported: fe = !1, sendOnEnter: pe = Fe.Enter, prefixAttachments: me = [], onRemovePrefixAttachment: he, chatSettings: _e, toolsMenuItems: ve, onToolToggle: ye, toolsMenuTitle: be, toolsBackLabel: Se, toolsChipLabels: Ce, promptsMenuOverlay: q, promptsMenuTitle: we, promptsBackLabel: De, autoFocus: Oe = !1, messageHistory: je, onDialFileSystemClick: Me, dialFileSystemLabel: Ne, validateAttachment: Ie, onAttachmentClick: Le, modelPickerOverlay: Re, maximumAttachmentsAmount: ze, onAttachmentsLimitExceeded: Be, isAttachmentsEnabled: Ve = !0, usageLimitsSlot: He, onMessageTooLong: Ue }) => {
|
|
1772
|
+
let We = s(), [Ge, Ke] = U(!1), J = ke(je), Je = V(() => a({
|
|
1779
1773
|
"--ci-bg": D?.background,
|
|
1780
1774
|
"--ci-text": D?.text,
|
|
1781
1775
|
"--ci-border": D?.border,
|
|
@@ -1788,210 +1782,210 @@ var kt = {
|
|
|
1788
1782
|
"--ci-voice-error": D?.voiceError,
|
|
1789
1783
|
"--ci-voice-waveform": D?.voiceWaveform,
|
|
1790
1784
|
"--ci-voice-accent": D?.voiceAccent
|
|
1791
|
-
}), [D]), Ye =
|
|
1785
|
+
}), [D]), Ye = V(() => Me ? [{
|
|
1792
1786
|
key: "dial-fs",
|
|
1793
|
-
label:
|
|
1794
|
-
icon: /* @__PURE__ */
|
|
1787
|
+
label: Ne ?? "DIAL file system",
|
|
1788
|
+
icon: /* @__PURE__ */ G(ne, {
|
|
1795
1789
|
size: c,
|
|
1796
1790
|
"aria-hidden": !0
|
|
1797
1791
|
}),
|
|
1798
|
-
onClick:
|
|
1799
|
-
}] : [], [
|
|
1792
|
+
onClick: Me
|
|
1793
|
+
}] : [], [Me, Ne]), { message: X, setMessage: Ze, textareaRef: Qe, isMultiLine: $e } = Ae({
|
|
1800
1794
|
messageProp: e,
|
|
1801
1795
|
messageRevision: t
|
|
1802
|
-
}), { attachments: Z, buildAttachments:
|
|
1803
|
-
initialAttachments:
|
|
1796
|
+
}), { attachments: Z, buildAttachments: rt, addAttachments: it, resetAttachments: at, handleRemove: ot, handleRetry: st, handleExpand: ct, hasBlockedAttachments: lt } = Te({
|
|
1797
|
+
initialAttachments: oe,
|
|
1804
1798
|
onUploadAttachment: r,
|
|
1805
1799
|
onAttachmentsChange: f,
|
|
1806
|
-
validateAttachment:
|
|
1800
|
+
validateAttachment: Ie,
|
|
1807
1801
|
pendingDropFiles: A,
|
|
1808
1802
|
onDropFilesConsumed: ee,
|
|
1809
1803
|
pendingAttachments: M,
|
|
1810
|
-
onPendingAttachmentsConsumed:
|
|
1811
|
-
onExpandPastedText:
|
|
1812
|
-
|
|
1813
|
-
}, [
|
|
1814
|
-
maximumAttachmentsAmount:
|
|
1815
|
-
baseAttachmentsAmount:
|
|
1816
|
-
onAttachmentsLimitExceeded:
|
|
1817
|
-
}), { state:
|
|
1818
|
-
rt(
|
|
1819
|
-
}, [
|
|
1820
|
-
if (!
|
|
1804
|
+
onPendingAttachmentsConsumed: N,
|
|
1805
|
+
onExpandPastedText: z((e) => {
|
|
1806
|
+
Ze((t) => t ? `${t}\n${e}` : e);
|
|
1807
|
+
}, [Ze]),
|
|
1808
|
+
maximumAttachmentsAmount: ze,
|
|
1809
|
+
baseAttachmentsAmount: me.length,
|
|
1810
|
+
onAttachmentsLimitExceeded: Be
|
|
1811
|
+
}), { state: ut, analyserNodeRef: dt, errorMessage: ft, startRecording: pt, stopRecording: mt, discardRecording: ht } = Pe({ onAttachAudio: z((e) => {
|
|
1812
|
+
it(rt([e]));
|
|
1813
|
+
}, [it, rt]) }), gt = H(null), Q = H(null), { handlePaste: _t } = xe(it, Ve ? te : Infinity), vt = z((e) => {
|
|
1814
|
+
if (!Ve) {
|
|
1821
1815
|
let t = e.clipboardData.getData("text/plain");
|
|
1822
|
-
t.length >=
|
|
1816
|
+
t.length >= P && Ue?.(t.length, P);
|
|
1823
1817
|
}
|
|
1824
|
-
|
|
1818
|
+
_t(e);
|
|
1825
1819
|
}, [
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
]),
|
|
1831
|
-
|
|
1832
|
-
|
|
1820
|
+
Ve,
|
|
1821
|
+
P,
|
|
1822
|
+
Ue,
|
|
1823
|
+
_t
|
|
1824
|
+
]), yt = X.trim().length > 0 || Z.length > 0, bt = yt && !lt && !de, { shouldRender: xt, isExiting: St, instanceKey: Ct } = Ee(!l && yt, Ft), wt = (ve?.some((e) => e.isSelected) ?? !1) && ye != null, $ = se || X.includes("\n") || $e || wt, Tt = ie === void 0 || F != null, Et = V(() => fe && !St && !l, [
|
|
1825
|
+
fe,
|
|
1826
|
+
St,
|
|
1833
1827
|
l
|
|
1834
|
-
]),
|
|
1835
|
-
if (
|
|
1836
|
-
if (!
|
|
1837
|
-
|
|
1828
|
+
]), Dt = async () => {
|
|
1829
|
+
if (de) return;
|
|
1830
|
+
if (!Ve && X.length >= P) {
|
|
1831
|
+
Ue?.(X.length, P);
|
|
1838
1832
|
return;
|
|
1839
1833
|
}
|
|
1840
|
-
let e =
|
|
1841
|
-
|
|
1834
|
+
let e = X, t = Z;
|
|
1835
|
+
Ze(""), J.reset();
|
|
1842
1836
|
try {
|
|
1843
1837
|
await n?.(e, t), t.forEach((e) => {
|
|
1844
1838
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
1845
|
-
}),
|
|
1839
|
+
}), at([]);
|
|
1846
1840
|
} catch {
|
|
1847
|
-
|
|
1841
|
+
Ze(e), at(t);
|
|
1848
1842
|
}
|
|
1849
|
-
},
|
|
1850
|
-
if (!e.nativeEvent.isComposing && !
|
|
1851
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1843
|
+
}, Ot = (e) => {
|
|
1844
|
+
if (!e.nativeEvent.isComposing && !R && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1845
|
+
let t = e.currentTarget.selectionStart ?? 0, n = J.navigate(e.key === "ArrowUp" ? "up" : "down", X, t);
|
|
1852
1846
|
if (n !== null) {
|
|
1853
|
-
e.preventDefault(),
|
|
1847
|
+
e.preventDefault(), Ze(n);
|
|
1854
1848
|
return;
|
|
1855
1849
|
}
|
|
1856
1850
|
}
|
|
1857
|
-
e.key === "Enter" && (
|
|
1858
|
-
},
|
|
1851
|
+
e.key === "Enter" && (pe === Fe.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && bt && Tt && !R && Dt());
|
|
1852
|
+
}, kt = (e) => {
|
|
1859
1853
|
let t = Array.from(e.target.files ?? []);
|
|
1860
1854
|
if (t.length === 0) return;
|
|
1861
|
-
let n =
|
|
1862
|
-
e.target.value = "",
|
|
1855
|
+
let n = rt(t);
|
|
1856
|
+
e.target.value = "", it(n);
|
|
1863
1857
|
};
|
|
1864
|
-
if (
|
|
1865
|
-
state:
|
|
1866
|
-
analyserNodeRef:
|
|
1867
|
-
errorMessage:
|
|
1868
|
-
onStop:
|
|
1869
|
-
onDiscard:
|
|
1858
|
+
if (ut !== "idle") return /* @__PURE__ */ G(et, {
|
|
1859
|
+
state: ut,
|
|
1860
|
+
analyserNodeRef: dt,
|
|
1861
|
+
errorMessage: ft,
|
|
1862
|
+
onStop: mt,
|
|
1863
|
+
onDiscard: ht,
|
|
1870
1864
|
stopLabel: T,
|
|
1871
1865
|
discardLabel: E,
|
|
1872
|
-
style:
|
|
1866
|
+
style: Je,
|
|
1873
1867
|
className: k
|
|
1874
1868
|
});
|
|
1875
|
-
let
|
|
1869
|
+
let At = /* @__PURE__ */ G("textarea", {
|
|
1876
1870
|
className: o(Y.textarea, O?.fontClassName || "dial-body-paragraph-text", "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1877
|
-
ref:
|
|
1878
|
-
autoFocus:
|
|
1879
|
-
value:
|
|
1871
|
+
ref: Qe,
|
|
1872
|
+
autoFocus: Oe,
|
|
1873
|
+
value: X,
|
|
1880
1874
|
onChange: (e) => {
|
|
1881
|
-
|
|
1875
|
+
Ze(e.target.value), J.notifyChange(), u?.(e.target.value);
|
|
1882
1876
|
},
|
|
1883
|
-
onKeyDown:
|
|
1884
|
-
onPaste:
|
|
1877
|
+
onKeyDown: Ot,
|
|
1878
|
+
onPaste: vt,
|
|
1885
1879
|
placeholder: p,
|
|
1886
1880
|
"aria-label": m,
|
|
1887
|
-
disabled:
|
|
1881
|
+
disabled: R,
|
|
1888
1882
|
rows: 1
|
|
1889
1883
|
});
|
|
1890
|
-
return /* @__PURE__ */
|
|
1891
|
-
ref:
|
|
1892
|
-
style:
|
|
1893
|
-
className: o(Y.wrapper,
|
|
1894
|
-
children: [(
|
|
1895
|
-
attachments: [...
|
|
1884
|
+
return /* @__PURE__ */ K("div", {
|
|
1885
|
+
ref: Q,
|
|
1886
|
+
style: Je,
|
|
1887
|
+
className: o(Y.wrapper, R && Y.wrapperDisabled, "flex min-h-[64px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border shadow-md", "focus-within:outline focus-within:-outline-offset-1 active:outline active:-outline-offset-1", Z.length > 6 ? "py-3 ps-3" : "p-3", k),
|
|
1888
|
+
children: [(me.length > 0 || Z.length > 0) && /* @__PURE__ */ G(ge, {
|
|
1889
|
+
attachments: [...me, ...Z],
|
|
1896
1890
|
onRemove: (e) => {
|
|
1897
|
-
|
|
1891
|
+
me.some((t) => t.id === e) ? he?.(e) : ot(e);
|
|
1898
1892
|
},
|
|
1899
|
-
onRetry:
|
|
1900
|
-
onExpand:
|
|
1893
|
+
onRetry: st,
|
|
1894
|
+
onExpand: ct,
|
|
1901
1895
|
labels: {
|
|
1902
1896
|
removeLabel: b,
|
|
1903
1897
|
retryLabel: x
|
|
1904
1898
|
},
|
|
1905
|
-
onAttachmentClick:
|
|
1906
|
-
let t = [...
|
|
1907
|
-
t != null &&
|
|
1899
|
+
onAttachmentClick: Le == null ? void 0 : (e) => {
|
|
1900
|
+
let t = [...me, ...Z].find((t) => t.id === e);
|
|
1901
|
+
t != null && Le(t);
|
|
1908
1902
|
}
|
|
1909
|
-
}),
|
|
1903
|
+
}), ue ? $ && At : /* @__PURE__ */ K("div", {
|
|
1910
1904
|
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1911
1905
|
children: [
|
|
1912
|
-
!
|
|
1906
|
+
!ce && /* @__PURE__ */ K("div", {
|
|
1913
1907
|
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1914
|
-
children: [/* @__PURE__ */
|
|
1915
|
-
ref:
|
|
1908
|
+
children: [/* @__PURE__ */ G("input", {
|
|
1909
|
+
ref: gt,
|
|
1916
1910
|
type: "file",
|
|
1917
1911
|
multiple: !0,
|
|
1918
1912
|
accept: g,
|
|
1919
1913
|
className: "sr-only",
|
|
1920
1914
|
"aria-hidden": !0,
|
|
1921
1915
|
tabIndex: -1,
|
|
1922
|
-
onChange:
|
|
1923
|
-
}), /* @__PURE__ */
|
|
1924
|
-
onAttachClick:
|
|
1916
|
+
onChange: kt
|
|
1917
|
+
}), /* @__PURE__ */ G(qe, {
|
|
1918
|
+
onAttachClick: le ? void 0 : () => gt.current?.click(),
|
|
1925
1919
|
attachLabel: h,
|
|
1926
1920
|
addMenuTitle: _,
|
|
1927
1921
|
menuTitle: v,
|
|
1928
1922
|
menuCloseLabel: y,
|
|
1929
|
-
style:
|
|
1930
|
-
isDisabled:
|
|
1923
|
+
style: Je,
|
|
1924
|
+
isDisabled: R,
|
|
1931
1925
|
chatSettings: _e,
|
|
1932
1926
|
extraMenuItems: Ye,
|
|
1933
|
-
toolsMenuItems:
|
|
1934
|
-
onToolToggle:
|
|
1935
|
-
toolsMenuTitle:
|
|
1927
|
+
toolsMenuItems: ve,
|
|
1928
|
+
onToolToggle: ye,
|
|
1929
|
+
toolsMenuTitle: be,
|
|
1936
1930
|
toolsBackLabel: Se,
|
|
1937
|
-
promptsMenuOverlay:
|
|
1938
|
-
promptsMenuTitle:
|
|
1939
|
-
promptsBackLabel:
|
|
1931
|
+
promptsMenuOverlay: q,
|
|
1932
|
+
promptsMenuTitle: we,
|
|
1933
|
+
promptsBackLabel: De
|
|
1940
1934
|
})]
|
|
1941
1935
|
}),
|
|
1942
|
-
$ &&
|
|
1936
|
+
$ && wt && /* @__PURE__ */ G("div", {
|
|
1943
1937
|
className: "order-3 min-w-0 flex-1",
|
|
1944
|
-
children: /* @__PURE__ */
|
|
1945
|
-
items:
|
|
1946
|
-
onToolToggle:
|
|
1947
|
-
isMobile:
|
|
1948
|
-
countLabel:
|
|
1949
|
-
removeLabel:
|
|
1938
|
+
children: /* @__PURE__ */ G(Xe, {
|
|
1939
|
+
items: ve ?? [],
|
|
1940
|
+
onToolToggle: ye,
|
|
1941
|
+
isMobile: We,
|
|
1942
|
+
countLabel: Ce?.countLabel,
|
|
1943
|
+
removeLabel: Ce?.removeLabel
|
|
1950
1944
|
})
|
|
1951
1945
|
}),
|
|
1952
|
-
/* @__PURE__ */
|
|
1946
|
+
/* @__PURE__ */ G("div", {
|
|
1953
1947
|
className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1954
|
-
children:
|
|
1948
|
+
children: At
|
|
1955
1949
|
}),
|
|
1956
|
-
/* @__PURE__ */
|
|
1957
|
-
className: o("flex flex-shrink-0 items-center gap-2", $ &&
|
|
1958
|
-
children: [
|
|
1959
|
-
canSend:
|
|
1960
|
-
onSend:
|
|
1961
|
-
}) : /* @__PURE__ */ W
|
|
1962
|
-
|
|
1963
|
-
/* @__PURE__ */
|
|
1964
|
-
deployments:
|
|
1965
|
-
selectedDeploymentId:
|
|
1966
|
-
onDeploymentChange:
|
|
1967
|
-
modelSelectorLabels:
|
|
1950
|
+
/* @__PURE__ */ K("div", {
|
|
1951
|
+
className: o("flex flex-shrink-0 items-center gap-2", $ && wt ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1952
|
+
children: [L ? L({
|
|
1953
|
+
canSend: bt,
|
|
1954
|
+
onSend: Dt
|
|
1955
|
+
}) : /* @__PURE__ */ K(W, { children: [
|
|
1956
|
+
He,
|
|
1957
|
+
/* @__PURE__ */ G(Pt, {
|
|
1958
|
+
deployments: ie,
|
|
1959
|
+
selectedDeploymentId: F,
|
|
1960
|
+
onDeploymentChange: I,
|
|
1961
|
+
modelSelectorLabels: ae,
|
|
1968
1962
|
isStreaming: l,
|
|
1969
|
-
isMobile:
|
|
1970
|
-
isDisabled:
|
|
1971
|
-
style:
|
|
1972
|
-
modelPickerOverlay:
|
|
1973
|
-
isPickerOpen:
|
|
1974
|
-
onPickerToggle: () =>
|
|
1975
|
-
onPickerOpenChange:
|
|
1963
|
+
isMobile: We,
|
|
1964
|
+
isDisabled: B,
|
|
1965
|
+
style: Je,
|
|
1966
|
+
modelPickerOverlay: Re,
|
|
1967
|
+
isPickerOpen: Ge,
|
|
1968
|
+
onPickerToggle: () => Ke((e) => !e),
|
|
1969
|
+
onPickerOpenChange: Ke
|
|
1976
1970
|
}),
|
|
1977
|
-
l && i ? /* @__PURE__ */
|
|
1971
|
+
l && i ? /* @__PURE__ */ G(nt, {
|
|
1978
1972
|
onStop: i,
|
|
1979
1973
|
ariaLabel: C
|
|
1980
|
-
}) : !l &&
|
|
1981
|
-
onSend:
|
|
1982
|
-
isDisabled: !
|
|
1974
|
+
}) : !l && xt && /* @__PURE__ */ G(tt, {
|
|
1975
|
+
onSend: Dt,
|
|
1976
|
+
isDisabled: !Tt || lt || de,
|
|
1983
1977
|
ariaLabel: S,
|
|
1984
|
-
isExiting:
|
|
1985
|
-
},
|
|
1986
|
-
] }),
|
|
1987
|
-
icon: /* @__PURE__ */
|
|
1978
|
+
isExiting: St
|
|
1979
|
+
}, Ct)
|
|
1980
|
+
] }), Et && /* @__PURE__ */ G(j, {
|
|
1981
|
+
icon: /* @__PURE__ */ G(re, {
|
|
1988
1982
|
size: d.LG,
|
|
1989
1983
|
"aria-hidden": !0
|
|
1990
1984
|
}),
|
|
1991
1985
|
"aria-label": w,
|
|
1992
1986
|
className: "size-8 flex-shrink-0",
|
|
1993
|
-
onClick:
|
|
1994
|
-
disabled:
|
|
1987
|
+
onClick: pt,
|
|
1988
|
+
disabled: R || l
|
|
1995
1989
|
})]
|
|
1996
1990
|
})
|
|
1997
1991
|
]
|
|
@@ -1999,15 +1993,15 @@ var kt = {
|
|
|
1999
1993
|
});
|
|
2000
1994
|
}, 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
1995
|
let { colors: u, typography: d } = r ?? {};
|
|
2002
|
-
return /* @__PURE__ */
|
|
1996
|
+
return /* @__PURE__ */ K("div", {
|
|
2003
1997
|
style: a({ "--ci-welcome-color": u?.welcomeText }),
|
|
2004
1998
|
className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
2005
|
-
children: [n && /* @__PURE__ */
|
|
1999
|
+
children: [n && /* @__PURE__ */ G("h1", {
|
|
2006
2000
|
className: o(Lt.welcome, "m-0 text-center", d?.welcomeClassName || "dial-display2-text"),
|
|
2007
2001
|
children: n
|
|
2008
|
-
}), /* @__PURE__ */
|
|
2002
|
+
}), /* @__PURE__ */ G("div", {
|
|
2009
2003
|
className: "relative w-full max-w-[748px]",
|
|
2010
|
-
children: /* @__PURE__ */
|
|
2004
|
+
children: /* @__PURE__ */ G(It, {
|
|
2011
2005
|
placeholder: t,
|
|
2012
2006
|
isStreaming: e,
|
|
2013
2007
|
isInputDisabled: c,
|
|
@@ -2018,53 +2012,53 @@ var kt = {
|
|
|
2018
2012
|
})
|
|
2019
2013
|
})]
|
|
2020
2014
|
});
|
|
2021
|
-
}, zt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: M, onMessageTooLong: te }) => {
|
|
2022
|
-
let
|
|
2023
|
-
|
|
2015
|
+
}, zt = ({ message: e, initialAttachments: t = [], onCancel: n, onSave: i, onUploadAttachment: a, cancelLabel: s = "Cancel", saveLabel: l = "Save & Submit", ariaLabel: u, removeLabel: d, retryLabel: f, addMenuTitle: p = "Add", attachLabel: m = "Attach file", menuTitle: h = "Menu", menuCloseLabel: g = "Close", className: _, pendingDropFiles: v, onDropFilesConsumed: y, validateAttachment: b, isAttachmentsEnabled: x, hideAttachFile: S = !1, fileAccept: w, maximumAttachmentsAmount: T, onAttachmentsLimitExceeded: D, onDialFileSystemClick: O, dialFileSystemLabel: k, pendingAttachments: A, onPendingAttachmentsConsumed: j, onAttachmentClick: ee, pasteTextThreshold: M, maxMessageLength: N = 5e4, onMessageTooLong: te }) => {
|
|
2016
|
+
let P = H(null), [re, ie] = U([]);
|
|
2017
|
+
B(() => {
|
|
2024
2018
|
v?.length && (ie(v), y?.());
|
|
2025
2019
|
}, [v, y]);
|
|
2026
|
-
let [
|
|
2027
|
-
|
|
2028
|
-
},
|
|
2029
|
-
i(e,
|
|
2030
|
-
}, [
|
|
2031
|
-
if (
|
|
2032
|
-
if (!x &&
|
|
2033
|
-
te?.(
|
|
2020
|
+
let [F, I] = U(e ?? ""), [ae, oe] = U([]), [se, ce] = U(t), le = ae.some((e) => e.status === r.Loading || e.status === r.Error), ue = (F.trim().length > 0 || ae.length > 0 || se.length > 0) && !le, L = (e) => {
|
|
2021
|
+
ce((t) => t.filter((t) => t.id !== e));
|
|
2022
|
+
}, R = z((e, t) => {
|
|
2023
|
+
i(e, se, t);
|
|
2024
|
+
}, [se, i]), de = () => {
|
|
2025
|
+
if (ue) {
|
|
2026
|
+
if (!x && F.length >= N) {
|
|
2027
|
+
te?.(F.length, N);
|
|
2034
2028
|
return;
|
|
2035
2029
|
}
|
|
2036
|
-
|
|
2030
|
+
R(F, ae);
|
|
2037
2031
|
}
|
|
2038
|
-
},
|
|
2032
|
+
}, fe = z(() => ie([]), []), pe = z((e) => {
|
|
2039
2033
|
let t = Array.from(e.target.files ?? []);
|
|
2040
2034
|
t.length !== 0 && (e.target.value = "", ie(t));
|
|
2041
|
-
}, []),
|
|
2035
|
+
}, []), me = V(() => O ? [{
|
|
2042
2036
|
key: "dial-fs",
|
|
2043
2037
|
label: k ?? "DIAL file system",
|
|
2044
|
-
icon: /* @__PURE__ */
|
|
2038
|
+
icon: /* @__PURE__ */ G(ne, {
|
|
2045
2039
|
size: c,
|
|
2046
2040
|
"aria-hidden": !0
|
|
2047
2041
|
}),
|
|
2048
2042
|
onClick: O
|
|
2049
2043
|
}] : [], [O, k]);
|
|
2050
|
-
return /* @__PURE__ */
|
|
2044
|
+
return /* @__PURE__ */ K("div", {
|
|
2051
2045
|
className: o("flex w-full flex-col gap-2", _),
|
|
2052
|
-
children: [/* @__PURE__ */
|
|
2046
|
+
children: [/* @__PURE__ */ G(It, {
|
|
2053
2047
|
message: e,
|
|
2054
2048
|
ariaLabel: u,
|
|
2055
2049
|
isStacked: !0,
|
|
2056
2050
|
hideActionBar: !0,
|
|
2057
|
-
pendingDropFiles:
|
|
2058
|
-
onDropFilesConsumed:
|
|
2059
|
-
onSend:
|
|
2051
|
+
pendingDropFiles: re,
|
|
2052
|
+
onDropFilesConsumed: fe,
|
|
2053
|
+
onSend: R,
|
|
2060
2054
|
onUploadAttachment: a,
|
|
2061
|
-
onChange:
|
|
2062
|
-
onAttachmentsChange:
|
|
2055
|
+
onChange: I,
|
|
2056
|
+
onAttachmentsChange: oe,
|
|
2063
2057
|
removeLabel: d,
|
|
2064
2058
|
retryLabel: f,
|
|
2065
2059
|
className: "max-w-full",
|
|
2066
|
-
prefixAttachments:
|
|
2067
|
-
onRemovePrefixAttachment:
|
|
2060
|
+
prefixAttachments: se,
|
|
2061
|
+
onRemovePrefixAttachment: L,
|
|
2068
2062
|
validateAttachment: b,
|
|
2069
2063
|
isAttachmentsEnabled: x,
|
|
2070
2064
|
maximumAttachmentsAmount: T,
|
|
@@ -2073,41 +2067,42 @@ var kt = {
|
|
|
2073
2067
|
onPendingAttachmentsConsumed: j,
|
|
2074
2068
|
onAttachmentClick: ee,
|
|
2075
2069
|
pasteTextThreshold: M,
|
|
2070
|
+
maxMessageLength: N,
|
|
2076
2071
|
onMessageTooLong: te
|
|
2077
|
-
}), /* @__PURE__ */
|
|
2072
|
+
}), /* @__PURE__ */ K("div", {
|
|
2078
2073
|
className: "flex items-center justify-between",
|
|
2079
|
-
children: [/* @__PURE__ */
|
|
2074
|
+
children: [/* @__PURE__ */ G("div", {
|
|
2080
2075
|
className: "flex",
|
|
2081
|
-
children: !S && /* @__PURE__ */ W
|
|
2082
|
-
ref:
|
|
2076
|
+
children: !S && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("input", {
|
|
2077
|
+
ref: P,
|
|
2083
2078
|
type: "file",
|
|
2084
2079
|
multiple: !0,
|
|
2085
2080
|
accept: w,
|
|
2086
2081
|
className: "sr-only",
|
|
2087
2082
|
"aria-hidden": !0,
|
|
2088
2083
|
tabIndex: -1,
|
|
2089
|
-
onChange:
|
|
2090
|
-
}), /* @__PURE__ */
|
|
2091
|
-
onAttachClick: () =>
|
|
2084
|
+
onChange: pe
|
|
2085
|
+
}), /* @__PURE__ */ G(qe, {
|
|
2086
|
+
onAttachClick: () => P.current?.click(),
|
|
2092
2087
|
attachLabel: m,
|
|
2093
2088
|
addMenuTitle: p,
|
|
2094
2089
|
menuTitle: h,
|
|
2095
2090
|
menuCloseLabel: g,
|
|
2096
|
-
extraMenuItems:
|
|
2091
|
+
extraMenuItems: me
|
|
2097
2092
|
})] })
|
|
2098
|
-
}), /* @__PURE__ */
|
|
2093
|
+
}), /* @__PURE__ */ K("div", {
|
|
2099
2094
|
className: "flex gap-2",
|
|
2100
|
-
children: [/* @__PURE__ */
|
|
2095
|
+
children: [/* @__PURE__ */ G(C, {
|
|
2101
2096
|
label: s,
|
|
2102
2097
|
onClick: n
|
|
2103
|
-
}), /* @__PURE__ */
|
|
2098
|
+
}), /* @__PURE__ */ G(E, {
|
|
2104
2099
|
label: l,
|
|
2105
|
-
onClick:
|
|
2106
|
-
disabled: !
|
|
2100
|
+
onClick: de,
|
|
2101
|
+
disabled: !ue
|
|
2107
2102
|
})]
|
|
2108
2103
|
})]
|
|
2109
2104
|
})]
|
|
2110
2105
|
});
|
|
2111
2106
|
};
|
|
2112
2107
|
//#endregion
|
|
2113
|
-
export {
|
|
2108
|
+
export { pe as AttachmentCard, me as AttachmentGroup, he as AttachmentTray, q as BottomSheetShell, Ue as ChatSettingsModal, Rt as ConversationInput, zt as EditMessageInput, _e as FileDndOverlay, It as Input, Fe as SendOnEnter, be as getAttachmentIcon };
|