@epam/ai-dial-conversation-input 1.1.0-dev.62 → 1.1.0-dev.68
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/ChatSettingsBottomSheet/ChatSettingsBottomSheet.d.ts.map +1 -1
- package/components/ChatSettingsModal/ChatSettingsModal.d.ts.map +1 -1
- package/components/EditMessageInput/EditMessageInput.d.ts.map +1 -1
- package/components/Input/Buttons/SendButton.d.ts +0 -2
- package/components/Input/Buttons/SendButton.d.ts.map +1 -1
- package/components/Input/Input.d.ts.map +1 -1
- package/hooks/useAttachments.d.ts.map +1 -1
- package/index.css +1 -1
- package/index.js +724 -700
- package/models/ConversationInput.d.ts +16 -0
- package/models/ConversationInput.d.ts.map +1 -1
- package/models/Input.d.ts +9 -1
- package/models/Input.d.ts.map +1 -1
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
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,
|
|
3
|
-
import { IconArrowLeft as te, IconArrowNarrowRight as ne, IconCheck as re, IconChevronDown as ie, IconChevronRight as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import { createElement as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { AttachmentCard 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, DialGhostIconButton as h, DialInput as g, DialPopup as _, DialRadioGroup as v, DialSearch as y, DialSkeleton as b, DialSkeletonVariant as x, DialSlider as S, DialTag as C, DialTooltip as w, ElementSize as T, Highlight as E, NeutralButton as D, PopupSize as O, PrimaryButton as k, PrimaryIconButton as A, RadioGroupOrientation as ee } from "@epam/ai-dial-ui-kit";
|
|
3
|
+
import { IconArrowLeft as te, IconArrowNarrowRight as ne, IconCheck as re, IconChevronDown as ie, IconChevronRight as j, IconFile as ae, IconMicrophone as oe, IconPaperclip as M, IconPlayerStopFilled as se, IconPlaystationSquare as ce, IconPlus as le, IconSettings as ue, IconTool as de, IconX as fe } from "@tabler/icons-react";
|
|
4
|
+
import { createPortal as pe } from "react-dom";
|
|
5
|
+
import { createElement as me, memo as N, useCallback as P, useEffect as F, useImperativeHandle as he, useLayoutEffect as I, useMemo as L, useRef as R, useState as z } from "react";
|
|
6
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
7
|
+
import { AttachmentCard as ge, AttachmentGroup as _e, AttachmentTray as ve, AttachmentTray as ye, FileDndOverlay as be, MAX_UPLOADS_PER_MINUTE as xe, generateAttachmentId as Se, getAttachmentIcon as Ce, useClipboardPaste as we } from "@epam/ai-dial-attachment-input";
|
|
8
8
|
//#region src/hooks/useBottomSheet.ts
|
|
9
|
-
var
|
|
10
|
-
|
|
9
|
+
var Te = (e, t) => {
|
|
10
|
+
F(() => {
|
|
11
11
|
if (!e) return;
|
|
12
12
|
let n = (e) => {
|
|
13
13
|
e.key === "Escape" && t();
|
|
14
14
|
};
|
|
15
15
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
16
|
-
}, [e, t]),
|
|
16
|
+
}, [e, t]), F(() => {
|
|
17
17
|
if (e) return document.body.style.overflow = "hidden", () => {
|
|
18
18
|
document.body.style.overflow = "";
|
|
19
19
|
};
|
|
20
20
|
}, [e]);
|
|
21
|
-
},
|
|
21
|
+
}, Ee = {
|
|
22
22
|
backdrop: "_backdrop_3xrn0_9",
|
|
23
23
|
sheet: "_sheet_3xrn0_13",
|
|
24
24
|
"slide-up": "_slide-up_3xrn0_1",
|
|
25
25
|
title: "_title_3xrn0_18",
|
|
26
26
|
divider: "_divider_3xrn0_22"
|
|
27
|
-
},
|
|
28
|
-
className: o(
|
|
27
|
+
}, U = ({ isOpen: e, title: t, closeLabel: n, onClose: r, onBack: i, backLabel: a, "aria-label": s, style: c, titleClassName: l = "dial-body-semi-text", className: f, children: p }) => (Te(e, r), !e || typeof document > "u" ? null : pe(/* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
|
|
28
|
+
className: o(Ee.backdrop, "fixed inset-0 z-[55]"),
|
|
29
29
|
onPointerDown: r,
|
|
30
30
|
"aria-hidden": !0
|
|
31
|
-
}), /* @__PURE__ */
|
|
31
|
+
}), /* @__PURE__ */ H("div", {
|
|
32
32
|
role: "dialog",
|
|
33
33
|
"aria-modal": !0,
|
|
34
34
|
"aria-label": t ?? s,
|
|
35
35
|
style: c,
|
|
36
|
-
className: o(
|
|
37
|
-
children: [t != null && /* @__PURE__ */
|
|
36
|
+
className: o(Ee.sheet, "fixed inset-x-0 bottom-0 z-[60] flex max-h-[85dvh] flex-col", f),
|
|
37
|
+
children: [t != null && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ H("div", {
|
|
38
38
|
className: "relative flex h-[60px] flex-shrink-0 items-center justify-center px-4",
|
|
39
39
|
children: [
|
|
40
|
-
i && /* @__PURE__ */
|
|
40
|
+
i && /* @__PURE__ */ V("div", {
|
|
41
41
|
className: "absolute start-4",
|
|
42
|
-
children: /* @__PURE__ */
|
|
43
|
-
icon: /* @__PURE__ */
|
|
44
|
-
size:
|
|
42
|
+
children: /* @__PURE__ */ V(h, {
|
|
43
|
+
icon: /* @__PURE__ */ V(te, {
|
|
44
|
+
size: u.LG,
|
|
45
45
|
stroke: 1.5,
|
|
46
46
|
className: "rtl:scale-x-[-1]"
|
|
47
47
|
}),
|
|
@@ -49,40 +49,40 @@ var Ee = (e, t) => {
|
|
|
49
49
|
onClick: i
|
|
50
50
|
})
|
|
51
51
|
}),
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
className: o(
|
|
52
|
+
/* @__PURE__ */ V("span", {
|
|
53
|
+
className: o(Ee.title, l),
|
|
54
54
|
children: t
|
|
55
55
|
}),
|
|
56
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ V("div", {
|
|
57
57
|
className: "absolute end-4 m-2",
|
|
58
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ V(d, {
|
|
59
59
|
ariaLabel: n,
|
|
60
|
-
size:
|
|
60
|
+
size: u.LG,
|
|
61
61
|
onClose: r
|
|
62
62
|
})
|
|
63
63
|
})
|
|
64
64
|
]
|
|
65
|
-
}), /* @__PURE__ */
|
|
65
|
+
}), /* @__PURE__ */ V("div", { className: "h-px flex-shrink-0" })] }), /* @__PURE__ */ V("div", {
|
|
66
66
|
className: "overflow-y-auto",
|
|
67
|
-
children:
|
|
67
|
+
children: p
|
|
68
68
|
})]
|
|
69
|
-
})] }), document.body)),
|
|
69
|
+
})] }), document.body)), De = async (e, t, n) => {
|
|
70
70
|
let r = 6e4 / t, i = [];
|
|
71
71
|
for (let t = 0; t < e.length; t++) t > 0 && await new Promise((e) => setTimeout(e, r)), i.push(n(e[t]));
|
|
72
72
|
await Promise.allSettled(i);
|
|
73
|
-
},
|
|
74
|
-
let [h, g] =
|
|
75
|
-
|
|
73
|
+
}, Oe = ({ 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 }) => {
|
|
74
|
+
let [h, g] = z(n), _ = R(h);
|
|
75
|
+
F(() => {
|
|
76
76
|
_.current = h;
|
|
77
|
-
}, [h]),
|
|
77
|
+
}, [h]), F(() => () => {
|
|
78
78
|
_.current.forEach((e) => {
|
|
79
79
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
80
80
|
});
|
|
81
81
|
}, []);
|
|
82
|
-
let v =
|
|
82
|
+
let v = P((e) => e.map((e) => {
|
|
83
83
|
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;
|
|
84
84
|
return {
|
|
85
|
-
id:
|
|
85
|
+
id: Se(),
|
|
86
86
|
name: e.name,
|
|
87
87
|
contentType: e.type,
|
|
88
88
|
file: e,
|
|
@@ -91,36 +91,48 @@ var Ee = (e, t) => {
|
|
|
91
91
|
previewUrl: a,
|
|
92
92
|
playUrl: o
|
|
93
93
|
};
|
|
94
|
-
}), []), y =
|
|
94
|
+
}), []), y = R(a);
|
|
95
|
+
F(() => {
|
|
96
|
+
y.current = a;
|
|
97
|
+
}, [a]);
|
|
98
|
+
let b = R(!0), x = P((e) => {
|
|
95
99
|
g((t) => {
|
|
96
100
|
let n = e(t);
|
|
97
|
-
return n
|
|
101
|
+
return n === t ? t : n;
|
|
98
102
|
});
|
|
99
|
-
}, [
|
|
100
|
-
|
|
101
|
-
|
|
103
|
+
}, []);
|
|
104
|
+
F(() => {
|
|
105
|
+
if (b.current) {
|
|
106
|
+
b.current = !1;
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
y.current?.(h);
|
|
110
|
+
}, [h]);
|
|
111
|
+
let S = P((e) => {
|
|
112
|
+
g(e);
|
|
113
|
+
}, []), C = P(async (t) => {
|
|
102
114
|
if (i) {
|
|
103
|
-
|
|
115
|
+
x((e) => e.map((e) => e.id === t.id ? {
|
|
104
116
|
...e,
|
|
105
117
|
status: r.Loading
|
|
106
118
|
} : e));
|
|
107
119
|
try {
|
|
108
120
|
let e = await i(t);
|
|
109
|
-
|
|
121
|
+
x((n) => n.map((n) => n.id === t.id ? {
|
|
110
122
|
...n,
|
|
111
123
|
status: r.Idle,
|
|
112
124
|
url: e
|
|
113
125
|
} : n));
|
|
114
126
|
} catch (n) {
|
|
115
127
|
let i = typeof n == "object" && n && "errorReason" in n && Object.values(e).includes(n.errorReason) ? n.errorReason : void 0;
|
|
116
|
-
|
|
128
|
+
x((e) => e.map((e) => e.id === t.id ? {
|
|
117
129
|
...e,
|
|
118
130
|
status: r.Error,
|
|
119
131
|
...i != null && { errorReason: i }
|
|
120
132
|
} : e));
|
|
121
133
|
}
|
|
122
134
|
}
|
|
123
|
-
}, [i,
|
|
135
|
+
}, [i, x]), w = P((e, t = !0) => {
|
|
124
136
|
let n = new Set(_.current.map((e) => e.id)), i = e.filter((e) => !n.has(e.id));
|
|
125
137
|
if (i.length !== 0) {
|
|
126
138
|
if (f != null && f > 0 && Number.isFinite(f)) {
|
|
@@ -132,40 +144,40 @@ var Ee = (e, t) => {
|
|
|
132
144
|
return;
|
|
133
145
|
}
|
|
134
146
|
}
|
|
135
|
-
if (
|
|
147
|
+
if (x((e) => [...e, ...i]), t) {
|
|
136
148
|
let e = [];
|
|
137
149
|
i.forEach((t) => {
|
|
138
150
|
let n = o?.(t);
|
|
139
|
-
n == null ? e.push(t) :
|
|
151
|
+
n == null ? e.push(t) : x((e) => e.map((e) => e.id === t.id ? {
|
|
140
152
|
...e,
|
|
141
153
|
status: r.Error,
|
|
142
154
|
errorReason: n
|
|
143
155
|
} : e));
|
|
144
|
-
}),
|
|
156
|
+
}), De(e, xe, C);
|
|
145
157
|
}
|
|
146
158
|
}
|
|
147
159
|
}, [
|
|
148
160
|
p,
|
|
149
161
|
f,
|
|
150
162
|
m,
|
|
151
|
-
y,
|
|
152
163
|
x,
|
|
164
|
+
C,
|
|
153
165
|
o
|
|
154
166
|
]);
|
|
155
|
-
|
|
156
|
-
s.length !== 0 && (
|
|
167
|
+
F(() => {
|
|
168
|
+
s.length !== 0 && (w(v(s)), c?.());
|
|
157
169
|
}, [
|
|
158
|
-
|
|
170
|
+
w,
|
|
159
171
|
v,
|
|
160
172
|
c,
|
|
161
173
|
s
|
|
162
|
-
]),
|
|
163
|
-
l.length !== 0 && (
|
|
174
|
+
]), F(() => {
|
|
175
|
+
l.length !== 0 && (w(l, !1), u?.());
|
|
164
176
|
}, [
|
|
165
|
-
|
|
177
|
+
w,
|
|
166
178
|
u,
|
|
167
179
|
l
|
|
168
|
-
]),
|
|
180
|
+
]), F(() => {
|
|
169
181
|
if (!o) return;
|
|
170
182
|
let t = !1, n = [], i = _.current.map((i) => {
|
|
171
183
|
if (i.status === r.Loading) return i;
|
|
@@ -186,43 +198,43 @@ var Ee = (e, t) => {
|
|
|
186
198
|
}
|
|
187
199
|
return i;
|
|
188
200
|
});
|
|
189
|
-
t &&
|
|
201
|
+
t && x(() => i), n.forEach((e) => void C(e));
|
|
190
202
|
}, [
|
|
191
203
|
o,
|
|
192
|
-
|
|
193
|
-
|
|
204
|
+
x,
|
|
205
|
+
C
|
|
194
206
|
]);
|
|
195
|
-
let
|
|
196
|
-
|
|
207
|
+
let T = P((e) => {
|
|
208
|
+
x((t) => {
|
|
197
209
|
let n = t.find((t) => t.id === e);
|
|
198
210
|
return n?.previewUrl && URL.revokeObjectURL(n.previewUrl), n?.playUrl && URL.revokeObjectURL(n.playUrl), t.filter((t) => t.id !== e);
|
|
199
211
|
});
|
|
200
|
-
}, [
|
|
212
|
+
}, [x]);
|
|
201
213
|
return {
|
|
202
214
|
attachments: h,
|
|
203
215
|
buildAttachments: v,
|
|
204
|
-
addAttachments:
|
|
205
|
-
resetAttachments:
|
|
206
|
-
handleRemove:
|
|
207
|
-
handleRetry:
|
|
216
|
+
addAttachments: w,
|
|
217
|
+
resetAttachments: S,
|
|
218
|
+
handleRemove: T,
|
|
219
|
+
handleRetry: P((e) => {
|
|
208
220
|
let t = h.find((t) => t.id === e);
|
|
209
|
-
t &&
|
|
210
|
-
}, [h,
|
|
211
|
-
handleExpand:
|
|
221
|
+
t && C(t);
|
|
222
|
+
}, [h, C]),
|
|
223
|
+
handleExpand: P(async (e) => {
|
|
212
224
|
let n = h.find((t) => t.id === e);
|
|
213
225
|
if (!n || n.type !== t.Pasted) return;
|
|
214
226
|
let r = await n.file.text();
|
|
215
|
-
d?.(r),
|
|
227
|
+
d?.(r), T(e);
|
|
216
228
|
}, [
|
|
217
229
|
h,
|
|
218
|
-
|
|
230
|
+
T,
|
|
219
231
|
d
|
|
220
232
|
]),
|
|
221
233
|
hasBlockedAttachments: h.some((e) => e.status === r.Loading || e.status === r.Error)
|
|
222
234
|
};
|
|
223
|
-
},
|
|
224
|
-
let [n, r] =
|
|
225
|
-
return
|
|
235
|
+
}, ke = (e, t) => {
|
|
236
|
+
let [n, r] = z(e), [i, a] = z(!1), [o, s] = z(0);
|
|
237
|
+
return F(() => {
|
|
226
238
|
if (e) {
|
|
227
239
|
r(!0), a(!1), s((e) => e + 1);
|
|
228
240
|
return;
|
|
@@ -238,18 +250,18 @@ var Ee = (e, t) => {
|
|
|
238
250
|
isExiting: i,
|
|
239
251
|
instanceKey: o
|
|
240
252
|
};
|
|
241
|
-
},
|
|
242
|
-
let t =
|
|
253
|
+
}, Ae = (e, t) => !e.slice(0, t).includes("\n"), je = (e, t) => !e.slice(t).includes("\n"), Me = (e) => {
|
|
254
|
+
let t = R(e);
|
|
243
255
|
t.current = e;
|
|
244
|
-
let n =
|
|
256
|
+
let n = R(-1), r = R(""), i = P((e, i, a) => {
|
|
245
257
|
let o = t.current;
|
|
246
|
-
return !o || o.length === 0 ? null : e === "up" ? !
|
|
247
|
-
}, []), a =
|
|
258
|
+
return !o || o.length === 0 ? null : e === "up" ? !Ae(i, a) || n.current === 0 ? null : (n.current === -1 ? (r.current = i, n.current = o.length - 1) : --n.current, o[n.current]) : n.current === -1 || !je(i, a) ? null : n.current < o.length - 1 ? (n.current += 1, o[n.current]) : (n.current = -1, r.current);
|
|
259
|
+
}, []), a = P(() => {
|
|
248
260
|
n.current = -1, r.current = "";
|
|
249
|
-
}, []), o =
|
|
261
|
+
}, []), o = P(() => {
|
|
250
262
|
n.current = -1, r.current = "";
|
|
251
263
|
}, []);
|
|
252
|
-
return
|
|
264
|
+
return L(() => ({
|
|
253
265
|
navigate: i,
|
|
254
266
|
notifyChange: a,
|
|
255
267
|
reset: o
|
|
@@ -258,13 +270,13 @@ var Ee = (e, t) => {
|
|
|
258
270
|
a,
|
|
259
271
|
o
|
|
260
272
|
]);
|
|
261
|
-
},
|
|
262
|
-
let [n, r] =
|
|
263
|
-
return
|
|
273
|
+
}, Ne = ({ messageProp: e, messageRevision: t }) => {
|
|
274
|
+
let [n, r] = z(e), i = R(null), a = R(0), [o, s] = z(!1);
|
|
275
|
+
return F(() => {
|
|
264
276
|
r(e);
|
|
265
|
-
}, [e, t]),
|
|
277
|
+
}, [e, t]), F(() => {
|
|
266
278
|
i.current && (a.current = i.current.offsetHeight);
|
|
267
|
-
}, []),
|
|
279
|
+
}, []), I(() => {
|
|
268
280
|
if (!i.current || a.current === 0) return;
|
|
269
281
|
let e = i.current.offsetHeight > a.current;
|
|
270
282
|
s((t) => e ? !0 : n === "" ? !1 : t);
|
|
@@ -274,20 +286,20 @@ var Ee = (e, t) => {
|
|
|
274
286
|
textareaRef: i,
|
|
275
287
|
isMultiLine: o
|
|
276
288
|
};
|
|
277
|
-
},
|
|
289
|
+
}, Pe = /* @__PURE__ */ function(e) {
|
|
278
290
|
return e.Idle = "idle", e.Recording = "recording", e.Error = "error", e;
|
|
279
|
-
}({}),
|
|
291
|
+
}({}), Fe = [
|
|
280
292
|
"audio/webm;codecs=opus",
|
|
281
293
|
"audio/ogg;codecs=opus",
|
|
282
294
|
"audio/webm"
|
|
283
|
-
],
|
|
284
|
-
let [t, n] =
|
|
295
|
+
], Ie = () => Fe.find((e) => MediaRecorder.isTypeSupported(e)) ?? "", Le = ({ onAttachAudio: e }) => {
|
|
296
|
+
let [t, n] = z("idle"), [r, i] = z(null), [a, o] = z(0), s = R(null), c = R(null), l = R(null), u = R(null), d = R([]), f = R(""), p = R(null), m = R(e);
|
|
285
297
|
m.current = e;
|
|
286
|
-
let h =
|
|
298
|
+
let h = P(() => {
|
|
287
299
|
p.current != null && (clearInterval(p.current), p.current = null);
|
|
288
|
-
}, []), g =
|
|
300
|
+
}, []), g = P(() => {
|
|
289
301
|
h(), s.current &&= (s.current.getTracks().forEach((e) => e.stop()), null), c.current &&= (c.current.close(), null), l.current = null, u.current = null;
|
|
290
|
-
}, [h]), _ =
|
|
302
|
+
}, [h]), _ = P(() => {
|
|
291
303
|
(async () => {
|
|
292
304
|
try {
|
|
293
305
|
let e = await navigator.mediaDevices.getUserMedia({ audio: !0 });
|
|
@@ -296,7 +308,7 @@ var Ee = (e, t) => {
|
|
|
296
308
|
c.current = t;
|
|
297
309
|
let r = t.createAnalyser();
|
|
298
310
|
r.fftSize = 256, l.current = r, t.createMediaStreamSource(e).connect(r);
|
|
299
|
-
let i =
|
|
311
|
+
let i = Ie();
|
|
300
312
|
f.current = i, d.current = [];
|
|
301
313
|
let a = new MediaRecorder(e, i ? { mimeType: i } : void 0);
|
|
302
314
|
u.current = a, a.ondataavailable = (e) => {
|
|
@@ -308,17 +320,17 @@ var Ee = (e, t) => {
|
|
|
308
320
|
i(e instanceof Error ? e.message : "Microphone access denied"), n("error");
|
|
309
321
|
}
|
|
310
322
|
})();
|
|
311
|
-
}, []), v =
|
|
323
|
+
}, []), v = P(() => {
|
|
312
324
|
let e = u.current;
|
|
313
325
|
!e || e.state !== "recording" || (h(), e.onstop = () => {
|
|
314
326
|
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 });
|
|
315
327
|
m.current(c), g(), o(0), i(null), n("idle");
|
|
316
328
|
}, e.stop());
|
|
317
|
-
}, [h, g]), y =
|
|
329
|
+
}, [h, g]), y = P(() => {
|
|
318
330
|
let e = u.current;
|
|
319
331
|
e && e.state === "recording" && (e.ondataavailable = null, e.onstop = null, e.stop()), g(), o(0), i(null), n("idle");
|
|
320
332
|
}, [g]);
|
|
321
|
-
return
|
|
333
|
+
return F(() => () => {
|
|
322
334
|
g();
|
|
323
335
|
}, [g]), {
|
|
324
336
|
state: t,
|
|
@@ -329,16 +341,16 @@ var Ee = (e, t) => {
|
|
|
329
341
|
stopRecording: v,
|
|
330
342
|
discardRecording: y
|
|
331
343
|
};
|
|
332
|
-
},
|
|
344
|
+
}, Re = /* @__PURE__ */ function(e) {
|
|
333
345
|
return e.Enter = "enter", e.MetaEnter = "meta-enter", e;
|
|
334
|
-
}({}),
|
|
335
|
-
item: "
|
|
336
|
-
itemIcon: "
|
|
337
|
-
},
|
|
338
|
-
let
|
|
346
|
+
}({}), ze = {
|
|
347
|
+
item: "_item_l2r5m_1",
|
|
348
|
+
itemIcon: "_itemIcon_l2r5m_11"
|
|
349
|
+
}, Be = ({ isOpen: e, title: t, closeLabel: n, onClose: r, style: i, items: a, className: s, titleClassName: c = "dial-body-semi-text", itemLabelClassName: u = "dial-small-text", btnTextClassName: d = "" }) => {
|
|
350
|
+
let f = (e) => {
|
|
339
351
|
e(), r();
|
|
340
352
|
};
|
|
341
|
-
return /* @__PURE__ */
|
|
353
|
+
return /* @__PURE__ */ V(U, {
|
|
342
354
|
isOpen: e,
|
|
343
355
|
title: t,
|
|
344
356
|
closeLabel: n,
|
|
@@ -346,90 +358,32 @@ var Ee = (e, t) => {
|
|
|
346
358
|
style: i,
|
|
347
359
|
className: s,
|
|
348
360
|
titleClassName: c,
|
|
349
|
-
children: /* @__PURE__ */
|
|
361
|
+
children: /* @__PURE__ */ V("ul", {
|
|
350
362
|
role: "list",
|
|
351
363
|
className: "flex flex-col",
|
|
352
|
-
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */
|
|
364
|
+
children: a.map(({ key: e, label: t, icon: n, iconAfter: r, onClick: i }) => /* @__PURE__ */ V("li", { children: /* @__PURE__ */ V(l, {
|
|
353
365
|
type: "button",
|
|
354
|
-
className: o(
|
|
355
|
-
iconBefore: /* @__PURE__ */
|
|
356
|
-
className:
|
|
366
|
+
className: o(ze.item, "flex w-full items-center gap-3 px-4 py-[10px] text-start"),
|
|
367
|
+
iconBefore: /* @__PURE__ */ V("span", {
|
|
368
|
+
className: ze.itemIcon,
|
|
357
369
|
children: n
|
|
358
370
|
}),
|
|
359
|
-
iconAfter: r ? /* @__PURE__ */
|
|
371
|
+
iconAfter: r ? /* @__PURE__ */ V("span", {
|
|
360
372
|
className: "ms-auto",
|
|
361
373
|
children: r
|
|
362
374
|
}) : null,
|
|
363
|
-
textClassName:
|
|
364
|
-
label: /* @__PURE__ */
|
|
365
|
-
className:
|
|
375
|
+
textClassName: d,
|
|
376
|
+
label: /* @__PURE__ */ V("span", {
|
|
377
|
+
className: u,
|
|
366
378
|
children: t
|
|
367
379
|
}),
|
|
368
|
-
onClick: () =>
|
|
380
|
+
onClick: () => f(i)
|
|
369
381
|
}) }, e))
|
|
370
382
|
})
|
|
371
383
|
});
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
viewBox: "0 0 24 24",
|
|
376
|
-
fill: "none",
|
|
377
|
-
"aria-hidden": !0,
|
|
378
|
-
children: [/* @__PURE__ */ B("defs", { children: /* @__PURE__ */ V("linearGradient", {
|
|
379
|
-
id: e,
|
|
380
|
-
x1: "0",
|
|
381
|
-
y1: "0",
|
|
382
|
-
x2: "24",
|
|
383
|
-
y2: "24",
|
|
384
|
-
gradientUnits: "userSpaceOnUse",
|
|
385
|
-
children: [/* @__PURE__ */ B("stop", {
|
|
386
|
-
offset: "0%",
|
|
387
|
-
stopColor: "#4b7be6"
|
|
388
|
-
}), /* @__PURE__ */ B("stop", {
|
|
389
|
-
offset: "100%",
|
|
390
|
-
stopColor: "#9355f4"
|
|
391
|
-
})]
|
|
392
|
-
}) }), /* @__PURE__ */ B("path", {
|
|
393
|
-
d: "M5 12l5 5L20 7",
|
|
394
|
-
stroke: `url(#${e})`,
|
|
395
|
-
strokeWidth: "2",
|
|
396
|
-
strokeLinecap: "round",
|
|
397
|
-
strokeLinejoin: "round"
|
|
398
|
-
})]
|
|
399
|
-
}), Ue = {
|
|
400
|
-
tabContainer: "_tabContainer_rzv03_1",
|
|
401
|
-
tabActive: "_tabActive_rzv03_13"
|
|
402
|
-
};
|
|
403
|
-
M(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
404
|
-
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
405
|
-
return /* @__PURE__ */ B("div", {
|
|
406
|
-
className: "flex flex-nowrap gap-1",
|
|
407
|
-
role: "tablist",
|
|
408
|
-
children: e.map((e) => {
|
|
409
|
-
let r = t === e.id;
|
|
410
|
-
return /* @__PURE__ */ B("div", {
|
|
411
|
-
role: "tab",
|
|
412
|
-
"aria-selected": r,
|
|
413
|
-
className: "contents",
|
|
414
|
-
children: /* @__PURE__ */ B(E, {
|
|
415
|
-
label: e.label,
|
|
416
|
-
selected: r,
|
|
417
|
-
onClick: () => n(e.id),
|
|
418
|
-
className: o("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, Ue.tabContainer, r && Ue.tabActive)
|
|
419
|
-
})
|
|
420
|
-
}, e.id);
|
|
421
|
-
})
|
|
422
|
-
});
|
|
423
|
-
});
|
|
424
|
-
//#endregion
|
|
425
|
-
//#region ../ai-dial-kit/src/components/Button/Buttons.tsx
|
|
426
|
-
var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f, {
|
|
427
|
-
...e,
|
|
428
|
-
variant: u.Neutral,
|
|
429
|
-
appearance: l.Outlined
|
|
430
|
-
}), Ke = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
431
|
-
let [s, c] = R(t), [l, u] = R(n), [d, f] = R(r), p = L(o);
|
|
432
|
-
P(() => {
|
|
384
|
+
}, Ve = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, isOpen: o }) => {
|
|
385
|
+
let [s, c] = z(t), [l, u] = z(n), [d, f] = z(r), p = R(o);
|
|
386
|
+
F(() => {
|
|
433
387
|
o && !p.current && (c(t), u(n), f(r)), p.current = o;
|
|
434
388
|
}, [
|
|
435
389
|
o,
|
|
@@ -446,7 +400,7 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
446
400
|
setResponseFormat: c,
|
|
447
401
|
setSystemPrompt: u,
|
|
448
402
|
setTemperature: f,
|
|
449
|
-
handleSubmit:
|
|
403
|
+
handleSubmit: P(() => {
|
|
450
404
|
if (!m) return;
|
|
451
405
|
let t = {};
|
|
452
406
|
e.responseFormat && s != null && (t.responseFormat = s), e.systemPrompt && (t.systemPrompt = l), e.temperature && (t.temperature = d), i(t), a();
|
|
@@ -460,16 +414,16 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
460
414
|
a
|
|
461
415
|
])
|
|
462
416
|
};
|
|
463
|
-
},
|
|
417
|
+
}, W = "!dial-small-semi-text !text-primary gap-1", He = ({ features: e, responseFormat: t, systemPrompt: n, temperature: r, onResponseFormatChange: a, onSystemPromptChange: o, onTemperatureChange: s, responseFormatLabel: c = "Response format", responseFormatHint: l = "Applies to new and existing messages", responseFormatMarkdownLabel: u = "Markdown", responseFormatPlainTextLabel: d = "Plain text", systemPromptLabel: f = "System prompt", systemPromptTooltip: p = "Enter a prompt", temperatureLabel: m = "Temperature", temperatureLabels: h = [
|
|
464
418
|
"Precise",
|
|
465
419
|
"Neutral",
|
|
466
420
|
"Creative"
|
|
467
|
-
], temperatureHint:
|
|
421
|
+
], temperatureHint: _ }) => /* @__PURE__ */ H("div", {
|
|
468
422
|
className: "flex flex-col gap-4 px-6 py-3",
|
|
469
423
|
children: [
|
|
470
|
-
e.responseFormat && /* @__PURE__ */
|
|
424
|
+
e.responseFormat && /* @__PURE__ */ V(v, {
|
|
471
425
|
fieldTitle: c,
|
|
472
|
-
labelClassName:
|
|
426
|
+
labelClassName: W,
|
|
473
427
|
elementId: "response-format",
|
|
474
428
|
orientation: ee.Column,
|
|
475
429
|
activeRadioButton: t ?? i.Markdown,
|
|
@@ -483,20 +437,20 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
483
437
|
}],
|
|
484
438
|
onChange: (e) => a(e)
|
|
485
439
|
}),
|
|
486
|
-
e.systemPrompt && /* @__PURE__ */
|
|
440
|
+
e.systemPrompt && /* @__PURE__ */ V(g, {
|
|
487
441
|
value: n,
|
|
488
442
|
placeholder: p,
|
|
489
443
|
labelProps: {
|
|
490
|
-
className:
|
|
444
|
+
className: W,
|
|
491
445
|
label: f
|
|
492
446
|
},
|
|
493
447
|
onChange: (e) => o(e ?? "")
|
|
494
448
|
}),
|
|
495
|
-
e.temperature && /* @__PURE__ */
|
|
449
|
+
e.temperature && /* @__PURE__ */ V(S, {
|
|
496
450
|
labelProps: {
|
|
497
451
|
label: m,
|
|
498
|
-
className:
|
|
499
|
-
caption:
|
|
452
|
+
className: W,
|
|
453
|
+
caption: _
|
|
500
454
|
},
|
|
501
455
|
value: r,
|
|
502
456
|
min: 0,
|
|
@@ -506,8 +460,8 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
506
460
|
onChange: s
|
|
507
461
|
})
|
|
508
462
|
]
|
|
509
|
-
}),
|
|
510
|
-
let { responseFormat:
|
|
463
|
+
}), Ue = ({ 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: S = "Apply changes", saveDisabledTooltip: C }) => {
|
|
464
|
+
let { responseFormat: T, systemPrompt: E, temperature: D, canSubmit: O, setResponseFormat: A, setSystemPrompt: ee, setTemperature: te, handleSubmit: ne } = Ve({
|
|
511
465
|
isOpen: e,
|
|
512
466
|
features: s,
|
|
513
467
|
initialResponseFormat: c,
|
|
@@ -516,7 +470,7 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
516
470
|
onSave: d,
|
|
517
471
|
onClose: r
|
|
518
472
|
});
|
|
519
|
-
return /* @__PURE__ */
|
|
473
|
+
return /* @__PURE__ */ H(U, {
|
|
520
474
|
isOpen: e,
|
|
521
475
|
title: f,
|
|
522
476
|
closeLabel: i,
|
|
@@ -524,14 +478,14 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
524
478
|
onBack: t,
|
|
525
479
|
backLabel: n,
|
|
526
480
|
style: a,
|
|
527
|
-
children: [/* @__PURE__ */
|
|
481
|
+
children: [/* @__PURE__ */ V(He, {
|
|
528
482
|
features: s,
|
|
529
|
-
responseFormat:
|
|
530
|
-
systemPrompt:
|
|
531
|
-
temperature:
|
|
532
|
-
onResponseFormatChange:
|
|
533
|
-
onSystemPromptChange:
|
|
534
|
-
onTemperatureChange:
|
|
483
|
+
responseFormat: T,
|
|
484
|
+
systemPrompt: E,
|
|
485
|
+
temperature: D,
|
|
486
|
+
onResponseFormatChange: A,
|
|
487
|
+
onSystemPromptChange: ee,
|
|
488
|
+
onTemperatureChange: te,
|
|
535
489
|
responseFormatLabel: p,
|
|
536
490
|
responseFormatHint: m,
|
|
537
491
|
responseFormatMarkdownLabel: h,
|
|
@@ -541,23 +495,23 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
541
495
|
temperatureLabel: y,
|
|
542
496
|
temperatureLabels: b,
|
|
543
497
|
temperatureHint: x
|
|
544
|
-
}), /* @__PURE__ */
|
|
498
|
+
}), /* @__PURE__ */ V("div", {
|
|
545
499
|
className: o("px-6 py-4 mobile:pb-8"),
|
|
546
|
-
children: /* @__PURE__ */
|
|
500
|
+
children: /* @__PURE__ */ V(w, {
|
|
547
501
|
tooltip: C,
|
|
548
502
|
hideTooltip: O || !C,
|
|
549
503
|
triggerClassName: "w-full",
|
|
550
|
-
children: /* @__PURE__ */
|
|
504
|
+
children: /* @__PURE__ */ V(k, {
|
|
551
505
|
label: S,
|
|
552
|
-
onClick:
|
|
506
|
+
onClick: ne,
|
|
553
507
|
disabled: !O,
|
|
554
508
|
className: "w-full"
|
|
555
509
|
})
|
|
556
510
|
})
|
|
557
511
|
})]
|
|
558
512
|
});
|
|
559
|
-
},
|
|
560
|
-
let { responseFormat:
|
|
513
|
+
}, We = ({ features: e, initialResponseFormat: t, initialSystemPrompt: n, initialTemperature: r, onSave: i, onClose: a, title: o = "Chat settings", responseFormatLabel: s, responseFormatHint: c, responseFormatMarkdownLabel: l, responseFormatPlainTextLabel: u, systemPromptLabel: d, systemPromptTooltip: f, temperatureLabel: p, temperatureLabels: m, temperatureHint: h, saveLabel: g = "Apply changes", saveDisabledTooltip: v }) => {
|
|
514
|
+
let { responseFormat: y, systemPrompt: b, temperature: x, canSubmit: S, setResponseFormat: C, setSystemPrompt: T, setTemperature: E, handleSubmit: D } = Ve({
|
|
561
515
|
features: e,
|
|
562
516
|
initialResponseFormat: t,
|
|
563
517
|
initialSystemPrompt: n,
|
|
@@ -565,32 +519,32 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
565
519
|
onSave: i,
|
|
566
520
|
onClose: a
|
|
567
521
|
});
|
|
568
|
-
return /* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ V(_, {
|
|
569
523
|
open: !0,
|
|
570
524
|
header: o,
|
|
571
|
-
size:
|
|
525
|
+
size: O.Sm,
|
|
572
526
|
onClose: a,
|
|
573
527
|
className: "!bg-layer-2",
|
|
574
|
-
footer: /* @__PURE__ */
|
|
528
|
+
footer: /* @__PURE__ */ V("div", {
|
|
575
529
|
className: "flex justify-end px-6 py-4",
|
|
576
|
-
children: /* @__PURE__ */
|
|
577
|
-
tooltip:
|
|
578
|
-
hideTooltip: S || !
|
|
579
|
-
children: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ V(w, {
|
|
531
|
+
tooltip: v,
|
|
532
|
+
hideTooltip: S || !v,
|
|
533
|
+
children: /* @__PURE__ */ V(k, {
|
|
580
534
|
label: g,
|
|
581
|
-
onClick:
|
|
535
|
+
onClick: D,
|
|
582
536
|
disabled: !S
|
|
583
537
|
})
|
|
584
538
|
})
|
|
585
539
|
}),
|
|
586
|
-
children: /* @__PURE__ */
|
|
540
|
+
children: /* @__PURE__ */ V(He, {
|
|
587
541
|
features: e,
|
|
588
|
-
responseFormat:
|
|
542
|
+
responseFormat: y,
|
|
589
543
|
systemPrompt: b,
|
|
590
544
|
temperature: x,
|
|
591
545
|
onResponseFormatChange: C,
|
|
592
|
-
onSystemPromptChange:
|
|
593
|
-
onTemperatureChange:
|
|
546
|
+
onSystemPromptChange: T,
|
|
547
|
+
onTemperatureChange: E,
|
|
594
548
|
responseFormatLabel: s,
|
|
595
549
|
responseFormatHint: c,
|
|
596
550
|
responseFormatMarkdownLabel: l,
|
|
@@ -603,10 +557,10 @@ var We = (e) => /* @__PURE__ */ B(b, { ...e }), Ge = (e) => /* @__PURE__ */ B(f,
|
|
|
603
557
|
})
|
|
604
558
|
});
|
|
605
559
|
};
|
|
606
|
-
|
|
560
|
+
N(We);
|
|
607
561
|
//#endregion
|
|
608
562
|
//#region src/components/ToolsBottomSheet/ToolsBottomSheet.tsx
|
|
609
|
-
var
|
|
563
|
+
var Ge = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel: i = "Close", style: a, title: o = "Tools", items: s, onToolToggle: u }) => /* @__PURE__ */ V(U, {
|
|
610
564
|
isOpen: e,
|
|
611
565
|
title: o,
|
|
612
566
|
closeLabel: i,
|
|
@@ -614,90 +568,90 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
614
568
|
onBack: t,
|
|
615
569
|
backLabel: n,
|
|
616
570
|
style: a,
|
|
617
|
-
children: /* @__PURE__ */
|
|
571
|
+
children: /* @__PURE__ */ V("ul", {
|
|
618
572
|
role: "menu",
|
|
619
573
|
className: "flex flex-col pb-4",
|
|
620
|
-
children: s.map((e) => /* @__PURE__ */
|
|
574
|
+
children: s.map((e) => /* @__PURE__ */ V("li", {
|
|
621
575
|
role: "none",
|
|
622
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: /* @__PURE__ */ V(l, {
|
|
623
577
|
type: "button",
|
|
624
578
|
role: "menuitemcheckbox",
|
|
625
579
|
"aria-checked": e.isSelected,
|
|
626
580
|
className: "flex w-full items-center gap-3 px-4 py-[10px] text-start",
|
|
627
|
-
iconBefore: /* @__PURE__ */
|
|
581
|
+
iconBefore: /* @__PURE__ */ V("span", {
|
|
628
582
|
className: "flex items-center text-secondary",
|
|
629
583
|
children: e.icon
|
|
630
584
|
}),
|
|
631
|
-
iconAfter: e.isSelected ? /* @__PURE__ */
|
|
585
|
+
iconAfter: e.isSelected ? /* @__PURE__ */ V("span", {
|
|
632
586
|
className: "ms-auto text-accent-primary",
|
|
633
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ V(re, {
|
|
634
588
|
size: c,
|
|
635
589
|
"aria-hidden": !0
|
|
636
590
|
})
|
|
637
591
|
}) : null,
|
|
638
|
-
label: /* @__PURE__ */
|
|
592
|
+
label: /* @__PURE__ */ V("span", {
|
|
639
593
|
className: "dial-small-text",
|
|
640
594
|
children: e.label
|
|
641
595
|
}),
|
|
642
|
-
onClick: () =>
|
|
596
|
+
onClick: () => u(e.id)
|
|
643
597
|
})
|
|
644
598
|
}, e.id))
|
|
645
599
|
})
|
|
646
|
-
}),
|
|
647
|
-
let x = s(), [S, C] =
|
|
600
|
+
}), Ke = ({ onAttachClick: e, attachLabel: t, addMenuTitle: n, menuTitle: r, menuCloseLabel: a, style: l, listClassName: d = "cp-dropdown-overlay !w-[240px]", isDisabled: p = !1, chatSettings: m, extraMenuItems: g, toolsMenuItems: _ = [], onToolToggle: v, toolsMenuTitle: y = "Tools", toolsBackLabel: b = "Back" }) => {
|
|
601
|
+
let x = s(), [S, C] = z(!1), [w, T] = z(!1), [E, D] = z(!1), O = _.length > 0 && v != null, k = L(() => _.map((e) => ({
|
|
648
602
|
key: e.id,
|
|
649
|
-
label: /* @__PURE__ */
|
|
603
|
+
label: /* @__PURE__ */ H("span", {
|
|
650
604
|
className: "flex flex-1 items-center gap-2",
|
|
651
|
-
children: [/* @__PURE__ */
|
|
605
|
+
children: [/* @__PURE__ */ V("span", {
|
|
652
606
|
className: "flex-1",
|
|
653
607
|
children: e.label
|
|
654
|
-
}), e.isSelected && /* @__PURE__ */
|
|
608
|
+
}), e.isSelected && /* @__PURE__ */ V(re, {
|
|
655
609
|
size: c,
|
|
656
610
|
className: "text-accent-primary",
|
|
657
611
|
"aria-hidden": !0
|
|
658
612
|
})]
|
|
659
613
|
}),
|
|
660
|
-
icon: /* @__PURE__ */
|
|
614
|
+
icon: /* @__PURE__ */ V("span", {
|
|
661
615
|
className: "flex items-center text-secondary",
|
|
662
616
|
children: e.icon
|
|
663
617
|
}),
|
|
664
618
|
onClick: () => v?.(e.id)
|
|
665
|
-
})), [
|
|
619
|
+
})), [_, v]), A = L(() => [
|
|
666
620
|
...e == null ? [] : [{
|
|
667
621
|
key: "attach",
|
|
668
622
|
label: t,
|
|
669
|
-
icon: /* @__PURE__ */
|
|
623
|
+
icon: /* @__PURE__ */ V(M, {
|
|
670
624
|
size: c,
|
|
671
625
|
"aria-hidden": !0
|
|
672
626
|
}),
|
|
673
627
|
onClick: e
|
|
674
628
|
}],
|
|
675
|
-
...
|
|
629
|
+
...g ?? [],
|
|
676
630
|
...O ? [{
|
|
677
631
|
key: "tools",
|
|
678
632
|
label: y,
|
|
679
|
-
icon: /* @__PURE__ */
|
|
633
|
+
icon: /* @__PURE__ */ V(de, {
|
|
680
634
|
size: c,
|
|
681
635
|
"aria-hidden": !0
|
|
682
636
|
}),
|
|
683
637
|
onClick: x ? () => {
|
|
684
638
|
D(!0), C(!1);
|
|
685
639
|
} : () => void 0,
|
|
686
|
-
...x ? { iconAfter: /* @__PURE__ */
|
|
640
|
+
...x ? { iconAfter: /* @__PURE__ */ V(j, {
|
|
687
641
|
size: c,
|
|
688
642
|
stroke: 1.5,
|
|
689
643
|
className: "text-secondary rtl:scale-x-[-1]",
|
|
690
644
|
"aria-hidden": !0
|
|
691
645
|
}) } : { children: k }
|
|
692
646
|
}] : [],
|
|
693
|
-
...
|
|
647
|
+
...m == null ? [] : [{
|
|
694
648
|
key: "chat-settings",
|
|
695
|
-
label:
|
|
696
|
-
icon: /* @__PURE__ */
|
|
649
|
+
label: m.menuItemLabel ?? "Chat settings",
|
|
650
|
+
icon: /* @__PURE__ */ V(ue, {
|
|
697
651
|
size: c,
|
|
698
652
|
"aria-hidden": !0
|
|
699
653
|
}),
|
|
700
|
-
iconAfter: x ? /* @__PURE__ */
|
|
654
|
+
iconAfter: x ? /* @__PURE__ */ V(j, {
|
|
701
655
|
size: c,
|
|
702
656
|
stroke: 1.5,
|
|
703
657
|
className: "text-secondary rtl:scale-x-[-1]",
|
|
@@ -708,25 +662,25 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
708
662
|
], [
|
|
709
663
|
t,
|
|
710
664
|
e,
|
|
711
|
-
|
|
712
|
-
|
|
665
|
+
m,
|
|
666
|
+
g,
|
|
713
667
|
x,
|
|
714
668
|
O,
|
|
715
669
|
y,
|
|
716
670
|
k
|
|
717
671
|
]);
|
|
718
|
-
return A.length === 0 ? null : /* @__PURE__ */ B
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
icon: /* @__PURE__ */
|
|
721
|
-
size:
|
|
672
|
+
return A.length === 0 ? null : /* @__PURE__ */ V(B, { children: x ? /* @__PURE__ */ H(B, { children: [
|
|
673
|
+
/* @__PURE__ */ V(h, {
|
|
674
|
+
icon: /* @__PURE__ */ V(le, {
|
|
675
|
+
size: u.LG,
|
|
722
676
|
"aria-hidden": !0
|
|
723
677
|
}),
|
|
724
678
|
"aria-label": n,
|
|
725
679
|
tooltipProps: { tooltip: n },
|
|
726
|
-
className: o("size-10 flex-shrink-0",
|
|
680
|
+
className: o("size-10 flex-shrink-0", p && "pointer-events-none opacity-50"),
|
|
727
681
|
onClick: () => C(!0)
|
|
728
682
|
}),
|
|
729
|
-
/* @__PURE__ */
|
|
683
|
+
/* @__PURE__ */ V(Be, {
|
|
730
684
|
isOpen: S,
|
|
731
685
|
title: r,
|
|
732
686
|
closeLabel: a,
|
|
@@ -736,7 +690,7 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
736
690
|
className: "pb-4",
|
|
737
691
|
btnTextClassName: "flex-1"
|
|
738
692
|
}),
|
|
739
|
-
O && /* @__PURE__ */
|
|
693
|
+
O && /* @__PURE__ */ V(Ge, {
|
|
740
694
|
isOpen: E,
|
|
741
695
|
onBack: () => {
|
|
742
696
|
D(!1), C(!0);
|
|
@@ -746,119 +700,119 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
746
700
|
closeLabel: a,
|
|
747
701
|
style: l,
|
|
748
702
|
title: y,
|
|
749
|
-
items:
|
|
703
|
+
items: _,
|
|
750
704
|
onToolToggle: v
|
|
751
705
|
}),
|
|
752
|
-
|
|
706
|
+
m != null && /* @__PURE__ */ V(Ue, {
|
|
753
707
|
isOpen: w,
|
|
754
708
|
onBack: () => {
|
|
755
709
|
T(!1), C(!0);
|
|
756
710
|
},
|
|
757
|
-
backLabel:
|
|
711
|
+
backLabel: m.backLabel ?? "Back",
|
|
758
712
|
onClose: () => T(!1),
|
|
759
713
|
closeLabel: a,
|
|
760
714
|
style: l,
|
|
761
|
-
features:
|
|
762
|
-
initialResponseFormat:
|
|
763
|
-
initialSystemPrompt:
|
|
764
|
-
initialTemperature:
|
|
765
|
-
onSave:
|
|
766
|
-
title:
|
|
767
|
-
responseFormatLabel:
|
|
768
|
-
responseFormatHint:
|
|
769
|
-
responseFormatMarkdownLabel:
|
|
770
|
-
responseFormatPlainTextLabel:
|
|
771
|
-
systemPromptLabel:
|
|
772
|
-
systemPromptTooltip:
|
|
773
|
-
temperatureLabel:
|
|
774
|
-
temperatureLabels:
|
|
775
|
-
temperatureHint:
|
|
776
|
-
saveLabel:
|
|
777
|
-
saveDisabledTooltip:
|
|
715
|
+
features: m.features,
|
|
716
|
+
initialResponseFormat: m.responseFormat ?? i.Markdown,
|
|
717
|
+
initialSystemPrompt: m.systemPrompt,
|
|
718
|
+
initialTemperature: m.temperature,
|
|
719
|
+
onSave: m.onSave,
|
|
720
|
+
title: m.title,
|
|
721
|
+
responseFormatLabel: m.responseFormatLabel,
|
|
722
|
+
responseFormatHint: m.responseFormatHint,
|
|
723
|
+
responseFormatMarkdownLabel: m.responseFormatMarkdownLabel,
|
|
724
|
+
responseFormatPlainTextLabel: m.responseFormatPlainTextLabel,
|
|
725
|
+
systemPromptLabel: m.systemPromptLabel,
|
|
726
|
+
systemPromptTooltip: m.systemPromptTooltip,
|
|
727
|
+
temperatureLabel: m.temperatureLabel,
|
|
728
|
+
temperatureLabels: m.temperatureLabels,
|
|
729
|
+
temperatureHint: m.temperatureHint,
|
|
730
|
+
saveLabel: m.saveLabel,
|
|
731
|
+
saveDisabledTooltip: m.saveDisabledTooltip
|
|
778
732
|
})
|
|
779
|
-
] }) : /* @__PURE__ */
|
|
733
|
+
] }) : /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(f, {
|
|
780
734
|
matchReferenceWidth: !1,
|
|
781
735
|
placement: "bottom-start",
|
|
782
|
-
listClassName:
|
|
736
|
+
listClassName: d,
|
|
783
737
|
items: A,
|
|
784
|
-
children: /* @__PURE__ */
|
|
785
|
-
icon: /* @__PURE__ */
|
|
786
|
-
size:
|
|
738
|
+
children: /* @__PURE__ */ V(h, {
|
|
739
|
+
icon: /* @__PURE__ */ V(le, {
|
|
740
|
+
size: u.LG,
|
|
787
741
|
"aria-hidden": !0
|
|
788
742
|
}),
|
|
789
743
|
"aria-label": n,
|
|
790
744
|
tooltipProps: { tooltip: n },
|
|
791
745
|
className: "size-10 flex-shrink-0",
|
|
792
|
-
disabled:
|
|
746
|
+
disabled: p
|
|
793
747
|
})
|
|
794
|
-
}),
|
|
795
|
-
features:
|
|
796
|
-
initialResponseFormat:
|
|
797
|
-
initialSystemPrompt:
|
|
798
|
-
initialTemperature:
|
|
799
|
-
onSave:
|
|
748
|
+
}), m != null && w && /* @__PURE__ */ V(We, {
|
|
749
|
+
features: m.features,
|
|
750
|
+
initialResponseFormat: m.responseFormat ?? i.Markdown,
|
|
751
|
+
initialSystemPrompt: m.systemPrompt,
|
|
752
|
+
initialTemperature: m.temperature,
|
|
753
|
+
onSave: m.onSave,
|
|
800
754
|
onClose: () => T(!1),
|
|
801
|
-
title:
|
|
802
|
-
responseFormatLabel:
|
|
803
|
-
responseFormatHint:
|
|
804
|
-
responseFormatMarkdownLabel:
|
|
805
|
-
responseFormatPlainTextLabel:
|
|
806
|
-
systemPromptLabel:
|
|
807
|
-
systemPromptTooltip:
|
|
808
|
-
temperatureLabel:
|
|
809
|
-
temperatureLabels:
|
|
810
|
-
temperatureHint:
|
|
811
|
-
saveLabel:
|
|
812
|
-
saveDisabledTooltip:
|
|
755
|
+
title: m.title,
|
|
756
|
+
responseFormatLabel: m.responseFormatLabel,
|
|
757
|
+
responseFormatHint: m.responseFormatHint,
|
|
758
|
+
responseFormatMarkdownLabel: m.responseFormatMarkdownLabel,
|
|
759
|
+
responseFormatPlainTextLabel: m.responseFormatPlainTextLabel,
|
|
760
|
+
systemPromptLabel: m.systemPromptLabel,
|
|
761
|
+
systemPromptTooltip: m.systemPromptTooltip,
|
|
762
|
+
temperatureLabel: m.temperatureLabel,
|
|
763
|
+
temperatureLabels: m.temperatureLabels,
|
|
764
|
+
temperatureHint: m.temperatureHint,
|
|
765
|
+
saveLabel: m.saveLabel,
|
|
766
|
+
saveDisabledTooltip: m.saveDisabledTooltip
|
|
813
767
|
})] }) });
|
|
814
|
-
},
|
|
768
|
+
}, G = {
|
|
815
769
|
chip: "_chip_1y9qv_1",
|
|
816
770
|
chipIcon: "_chipIcon_1y9qv_6",
|
|
817
771
|
chipText: "_chipText_1y9qv_10",
|
|
818
772
|
chipClose: "_chipClose_1y9qv_14"
|
|
819
|
-
},
|
|
773
|
+
}, qe = (e) => `${e} tool${e === 1 ? "" : "s"}`, Je = (e) => `Remove ${e}`, Ye = ({ items: e, onToolToggle: t, isMobile: n, countLabel: r = qe, removeLabel: i = Je }) => {
|
|
820
774
|
let a = e.filter((e) => e.isSelected);
|
|
821
775
|
if (a.length === 0) return null;
|
|
822
776
|
if (n) {
|
|
823
|
-
let e = a.length === 1 ? a[0].icon : /* @__PURE__ */
|
|
777
|
+
let e = a.length === 1 ? a[0].icon : /* @__PURE__ */ V(de, {
|
|
824
778
|
size: c,
|
|
825
779
|
"aria-hidden": !0
|
|
826
780
|
});
|
|
827
|
-
return /* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ V("div", {
|
|
828
782
|
className: "flex flex-wrap items-center gap-2",
|
|
829
|
-
children: /* @__PURE__ */
|
|
830
|
-
className: o(
|
|
831
|
-
children: [/* @__PURE__ */
|
|
832
|
-
className:
|
|
783
|
+
children: /* @__PURE__ */ H("div", {
|
|
784
|
+
className: o(G.chip, "flex items-center gap-1.5 rounded border px-2 py-1"),
|
|
785
|
+
children: [/* @__PURE__ */ V("span", {
|
|
786
|
+
className: G.chipIcon,
|
|
833
787
|
"aria-hidden": !0,
|
|
834
788
|
children: e
|
|
835
|
-
}), /* @__PURE__ */
|
|
836
|
-
className: o(
|
|
789
|
+
}), /* @__PURE__ */ V("span", {
|
|
790
|
+
className: o(G.chipText, "dial-small-text"),
|
|
837
791
|
children: r(a.length)
|
|
838
792
|
})]
|
|
839
793
|
})
|
|
840
794
|
});
|
|
841
795
|
}
|
|
842
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ V("div", {
|
|
843
797
|
className: "flex flex-wrap items-center gap-2",
|
|
844
|
-
children: a.map((e) => /* @__PURE__ */
|
|
845
|
-
className: o(
|
|
798
|
+
children: a.map((e) => /* @__PURE__ */ H("div", {
|
|
799
|
+
className: o(G.chip, "flex items-center gap-1.5 rounded border py-1 pe-1 ps-2"),
|
|
846
800
|
children: [
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
className:
|
|
801
|
+
/* @__PURE__ */ V("span", {
|
|
802
|
+
className: G.chipIcon,
|
|
849
803
|
"aria-hidden": !0,
|
|
850
804
|
children: e.icon
|
|
851
805
|
}),
|
|
852
|
-
/* @__PURE__ */
|
|
853
|
-
className: o(
|
|
806
|
+
/* @__PURE__ */ V("span", {
|
|
807
|
+
className: o(G.chipText, "dial-small-text"),
|
|
854
808
|
children: e.label
|
|
855
809
|
}),
|
|
856
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ V("button", {
|
|
857
811
|
type: "button",
|
|
858
812
|
onClick: () => t(e.id),
|
|
859
|
-
className: o(
|
|
813
|
+
className: o(G.chipClose, "flex items-center rounded p-0.5 transition-colors"),
|
|
860
814
|
"aria-label": i(e.label),
|
|
861
|
-
children: /* @__PURE__ */
|
|
815
|
+
children: /* @__PURE__ */ V(fe, {
|
|
862
816
|
size: 12,
|
|
863
817
|
"aria-hidden": !0
|
|
864
818
|
})
|
|
@@ -866,7 +820,7 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
866
820
|
]
|
|
867
821
|
}, e.id))
|
|
868
822
|
});
|
|
869
|
-
},
|
|
823
|
+
}, K = {
|
|
870
824
|
container: "_container_8j81i_1",
|
|
871
825
|
containerError: "_containerError_8j81i_14",
|
|
872
826
|
waveformCanvas: "_waveformCanvas_8j81i_18",
|
|
@@ -874,29 +828,29 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
874
828
|
stopRecordingIcon: "_stopRecordingIcon_8j81i_28",
|
|
875
829
|
recordingDot: "_recordingDot_8j81i_42",
|
|
876
830
|
"recording-pulse": "_recording-pulse_8j81i_1"
|
|
877
|
-
},
|
|
878
|
-
let p =
|
|
831
|
+
}, q = 3, J = 4, Y = 200, Xe = (e) => `${String(Math.floor(e / 60)).padStart(2, "0")}:${String(e % 60).padStart(2, "0")}`, Ze = ({ 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 }) => {
|
|
832
|
+
let p = R(null), g = R(new Float32Array(Y)), _ = R(0), v = R(0), y = e === Pe.Recording, b = e === Pe.Error, x = P((e) => {
|
|
879
833
|
let t = e.getContext("2d");
|
|
880
834
|
if (!t) return;
|
|
881
835
|
e.width = e.clientWidth || 200, e.height = e.clientHeight || 32;
|
|
882
836
|
let { width: n, height: r } = e;
|
|
883
837
|
t.clearRect(0, 0, n, r), t.fillStyle = getComputedStyle(e).color;
|
|
884
|
-
let i = Math.min(Math.max(1, Math.floor(n /
|
|
838
|
+
let i = Math.min(Math.max(1, Math.floor(n / J)), Y - 1), a = _.current, o = v.current;
|
|
885
839
|
t.save(), t.beginPath(), t.rect(0, 0, n, r), t.clip(), t.translate(-o, 0);
|
|
886
840
|
for (let e = 0; e <= i; e++) {
|
|
887
|
-
let n = ((a - i + e) % Y + Y) % Y, o =
|
|
888
|
-
t.fillRect(e *
|
|
841
|
+
let n = ((a - i + e) % Y + Y) % Y, o = g.current[n] ?? 0, s = Math.min(1, o * 6), c = Math.max(3, s * r);
|
|
842
|
+
t.fillRect(e * J, (r - c) / 2, q, c);
|
|
889
843
|
}
|
|
890
844
|
t.restore();
|
|
891
845
|
}, []);
|
|
892
|
-
|
|
846
|
+
F(() => {
|
|
893
847
|
if (!y) return;
|
|
894
848
|
let e = p.current;
|
|
895
849
|
if (!e) return;
|
|
896
|
-
|
|
850
|
+
g.current.fill(0), _.current = 0, v.current = 0;
|
|
897
851
|
let n, r = () => {
|
|
898
|
-
if (v.current += 1, v.current >=
|
|
899
|
-
v.current -=
|
|
852
|
+
if (v.current += 1, v.current >= J) {
|
|
853
|
+
v.current -= J;
|
|
900
854
|
let e = t.current;
|
|
901
855
|
if (e) {
|
|
902
856
|
let t = new Uint8Array(e.frequencyBinCount);
|
|
@@ -906,7 +860,7 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
906
860
|
let r = (t[e] - 128) / 128;
|
|
907
861
|
n += r * r;
|
|
908
862
|
}
|
|
909
|
-
|
|
863
|
+
g.current[_.current % Y] = Math.sqrt(n / t.length), _.current++;
|
|
910
864
|
}
|
|
911
865
|
}
|
|
912
866
|
x(e), n = requestAnimationFrame(r);
|
|
@@ -918,7 +872,7 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
918
872
|
y,
|
|
919
873
|
t,
|
|
920
874
|
x
|
|
921
|
-
]),
|
|
875
|
+
]), F(() => {
|
|
922
876
|
let e = p.current;
|
|
923
877
|
if (!e) return;
|
|
924
878
|
let t = new ResizeObserver(() => {
|
|
@@ -926,20 +880,20 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
926
880
|
});
|
|
927
881
|
return t.observe(e), () => t.disconnect();
|
|
928
882
|
}, [x]);
|
|
929
|
-
let S = /* @__PURE__ */
|
|
883
|
+
let S = /* @__PURE__ */ H("div", {
|
|
930
884
|
className: "flex flex-shrink-0 items-center justify-end gap-1",
|
|
931
|
-
children: [/* @__PURE__ */
|
|
932
|
-
icon: /* @__PURE__ */
|
|
933
|
-
size:
|
|
885
|
+
children: [/* @__PURE__ */ V(h, {
|
|
886
|
+
icon: /* @__PURE__ */ V(fe, {
|
|
887
|
+
size: u.LG,
|
|
934
888
|
"aria-hidden": !0
|
|
935
889
|
}),
|
|
936
890
|
"aria-label": c,
|
|
937
891
|
className: "size-10 flex-shrink-0",
|
|
938
892
|
onClick: a
|
|
939
|
-
}), y && /* @__PURE__ */
|
|
940
|
-
icon: /* @__PURE__ */
|
|
941
|
-
size:
|
|
942
|
-
className:
|
|
893
|
+
}), y && /* @__PURE__ */ V(h, {
|
|
894
|
+
icon: /* @__PURE__ */ V(se, {
|
|
895
|
+
size: u.LG,
|
|
896
|
+
className: K.stopRecordingIcon,
|
|
943
897
|
"aria-hidden": !0
|
|
944
898
|
}),
|
|
945
899
|
"aria-label": s,
|
|
@@ -947,110 +901,153 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
947
901
|
onClick: i
|
|
948
902
|
})]
|
|
949
903
|
});
|
|
950
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ H("div", {
|
|
951
905
|
className: f,
|
|
952
|
-
children: [/* @__PURE__ */
|
|
953
|
-
style:
|
|
954
|
-
className: o(
|
|
955
|
-
children: [/* @__PURE__ */
|
|
906
|
+
children: [/* @__PURE__ */ H("div", {
|
|
907
|
+
style: d,
|
|
908
|
+
className: o(K.container, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border px-3 desktop:flex-row desktop:items-center desktop:gap-2 desktop:py-2", b && K.containerError),
|
|
909
|
+
children: [/* @__PURE__ */ H("div", {
|
|
956
910
|
className: "flex min-w-0 flex-1 items-center gap-2",
|
|
957
|
-
children: [y && /* @__PURE__ */
|
|
958
|
-
className:
|
|
911
|
+
children: [y && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("span", {
|
|
912
|
+
className: K.recordingDot,
|
|
959
913
|
"aria-hidden": !0
|
|
960
|
-
}), /* @__PURE__ */
|
|
961
|
-
className: o(
|
|
914
|
+
}), /* @__PURE__ */ V("span", {
|
|
915
|
+
className: o(K.timer, "flex-shrink-0"),
|
|
962
916
|
"aria-label": l,
|
|
963
|
-
children:
|
|
964
|
-
})] }), /* @__PURE__ */
|
|
917
|
+
children: Xe(n)
|
|
918
|
+
})] }), /* @__PURE__ */ V("canvas", {
|
|
965
919
|
ref: p,
|
|
966
920
|
height: 32,
|
|
967
|
-
className: o(
|
|
921
|
+
className: o(K.waveformCanvas, "h-8 min-w-0 flex-1 desktop:h-6")
|
|
968
922
|
})]
|
|
969
923
|
}), S]
|
|
970
|
-
}), b && r && /* @__PURE__ */
|
|
924
|
+
}), b && r && /* @__PURE__ */ V(m, {
|
|
971
925
|
text: r,
|
|
972
926
|
className: "mt-1 px-1"
|
|
973
927
|
})]
|
|
974
928
|
});
|
|
975
|
-
},
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
sendButtonEnter: "_sendButtonEnter_1q2nu_1",
|
|
985
|
-
sendButtonExiting: "_sendButtonExiting_1q2nu_55",
|
|
986
|
-
sendButtonExit: "_sendButtonExit_1q2nu_55"
|
|
987
|
-
}, nt = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", title: r, isExiting: i = !1 }) => /* @__PURE__ */ B(D, {
|
|
988
|
-
tooltip: r,
|
|
989
|
-
hideTooltip: !r,
|
|
990
|
-
children: /* @__PURE__ */ B("button", {
|
|
991
|
-
className: o("flex size-[32px] cursor-pointer items-center justify-center rounded-full disabled:cursor-not-allowed", X.sendButton, i && X.sendButtonExiting),
|
|
992
|
-
"aria-label": n,
|
|
993
|
-
onClick: () => e?.(),
|
|
994
|
-
type: "button",
|
|
995
|
-
disabled: t,
|
|
996
|
-
"aria-hidden": i,
|
|
997
|
-
children: /* @__PURE__ */ B(ne, {
|
|
998
|
-
size: d.LG,
|
|
999
|
-
className: "rtl:scale-x-[-1]"
|
|
1000
|
-
})
|
|
929
|
+
}, Qe = ({ onSend: e, isDisabled: t = !1, ariaLabel: n = "Send message", isExiting: r = !1 }) => /* @__PURE__ */ V(A, {
|
|
930
|
+
"aria-label": n,
|
|
931
|
+
onClick: () => e?.(),
|
|
932
|
+
type: "button",
|
|
933
|
+
disabled: t,
|
|
934
|
+
"aria-hidden": r,
|
|
935
|
+
icon: /* @__PURE__ */ V(ne, {
|
|
936
|
+
size: u.LG,
|
|
937
|
+
className: "rtl:scale-x-[-1]"
|
|
1001
938
|
})
|
|
1002
|
-
}),
|
|
939
|
+
}), X = {
|
|
940
|
+
wrapper: "_wrapper_1mg30_1",
|
|
941
|
+
wrapperDisabled: "_wrapperDisabled_1mg30_14",
|
|
942
|
+
textarea: "_textarea_1mg30_19",
|
|
943
|
+
stopIcon: "_stopIcon_1mg30_33",
|
|
944
|
+
modelSelectorButton: "_modelSelectorButton_1mg30_37",
|
|
945
|
+
modelSelectorCaret: "_modelSelectorCaret_1mg30_37",
|
|
946
|
+
modelSelectorButtonDisabled: "_modelSelectorButtonDisabled_1mg30_43"
|
|
947
|
+
}, $e = ({ onStop: e, ariaLabel: t = "Stop streaming" }) => /* @__PURE__ */ V("button", {
|
|
1003
948
|
className: o("flex cursor-pointer items-center justify-center disabled:cursor-not-allowed"),
|
|
1004
949
|
"aria-label": t,
|
|
1005
950
|
onClick: () => e?.(),
|
|
1006
951
|
type: "button",
|
|
1007
|
-
children: /* @__PURE__ */
|
|
1008
|
-
size:
|
|
952
|
+
children: /* @__PURE__ */ V(ce, {
|
|
953
|
+
size: u.LG,
|
|
1009
954
|
className: X.stopIcon
|
|
1010
955
|
})
|
|
1011
|
-
}),
|
|
1012
|
-
|
|
956
|
+
}), Z = ({ gradientId: e = "gradient-check-icon" }) => /* @__PURE__ */ H("svg", {
|
|
957
|
+
width: u.SM,
|
|
958
|
+
height: u.SM,
|
|
959
|
+
viewBox: "0 0 24 24",
|
|
960
|
+
fill: "none",
|
|
961
|
+
"aria-hidden": !0,
|
|
962
|
+
children: [/* @__PURE__ */ V("defs", { children: /* @__PURE__ */ H("linearGradient", {
|
|
963
|
+
id: e,
|
|
964
|
+
x1: "0",
|
|
965
|
+
y1: "0",
|
|
966
|
+
x2: "24",
|
|
967
|
+
y2: "24",
|
|
968
|
+
gradientUnits: "userSpaceOnUse",
|
|
969
|
+
children: [/* @__PURE__ */ V("stop", {
|
|
970
|
+
offset: "0%",
|
|
971
|
+
stopColor: "#4b7be6"
|
|
972
|
+
}), /* @__PURE__ */ V("stop", {
|
|
973
|
+
offset: "100%",
|
|
974
|
+
stopColor: "#9355f4"
|
|
975
|
+
})]
|
|
976
|
+
}) }), /* @__PURE__ */ V("path", {
|
|
977
|
+
d: "M5 12l5 5L20 7",
|
|
978
|
+
stroke: `url(#${e})`,
|
|
979
|
+
strokeWidth: "2",
|
|
980
|
+
strokeLinecap: "round",
|
|
981
|
+
strokeLinejoin: "round"
|
|
982
|
+
})]
|
|
983
|
+
}), et = {
|
|
984
|
+
tabContainer: "_tabContainer_153ct_1",
|
|
985
|
+
tabActive: "_tabActive_153ct_13"
|
|
986
|
+
};
|
|
987
|
+
N(({ tabs: e, activeTabId: t, onTabChange: n, styles: r }) => {
|
|
988
|
+
let { tabClassName: i = "dial-tiny-semi-text" } = r?.typography ?? {};
|
|
989
|
+
return /* @__PURE__ */ V("div", {
|
|
990
|
+
className: "flex flex-nowrap gap-1",
|
|
991
|
+
role: "tablist",
|
|
992
|
+
children: e.map((e) => {
|
|
993
|
+
let r = t === e.id;
|
|
994
|
+
return /* @__PURE__ */ V("div", {
|
|
995
|
+
role: "tab",
|
|
996
|
+
"aria-selected": r,
|
|
997
|
+
className: "contents",
|
|
998
|
+
children: /* @__PURE__ */ V(C, {
|
|
999
|
+
label: e.label,
|
|
1000
|
+
selected: r,
|
|
1001
|
+
onClick: () => n(e.id),
|
|
1002
|
+
className: o("box-border h-auto shrink-0 justify-center rounded-full p-2 text-center", i, et.tabContainer, r && et.tabActive)
|
|
1003
|
+
})
|
|
1004
|
+
}, e.id);
|
|
1005
|
+
})
|
|
1006
|
+
});
|
|
1007
|
+
});
|
|
1008
|
+
var tt = ({ size: e = 20 }) => /* @__PURE__ */ V(b, {
|
|
1009
|
+
variant: x.Circular,
|
|
1013
1010
|
width: e,
|
|
1014
1011
|
height: e,
|
|
1015
1012
|
active: !0
|
|
1016
|
-
}),
|
|
1013
|
+
}), nt = ({ loadingLabel: e }) => /* @__PURE__ */ H("span", {
|
|
1017
1014
|
className: "flex min-w-0 flex-1 items-center",
|
|
1018
|
-
children: [/* @__PURE__ */
|
|
1019
|
-
variant:
|
|
1015
|
+
children: [/* @__PURE__ */ V(b, {
|
|
1016
|
+
variant: x.Text,
|
|
1020
1017
|
width: "100%",
|
|
1021
1018
|
height: 16,
|
|
1022
1019
|
active: !0
|
|
1023
|
-
}), e && /* @__PURE__ */
|
|
1020
|
+
}), e && /* @__PURE__ */ V("span", {
|
|
1024
1021
|
className: "sr-only",
|
|
1025
1022
|
children: e
|
|
1026
1023
|
})]
|
|
1027
|
-
}),
|
|
1024
|
+
}), rt = ({ loadingLabel: e }) => /* @__PURE__ */ V("div", {
|
|
1028
1025
|
role: "status",
|
|
1029
1026
|
"aria-label": e,
|
|
1030
|
-
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */
|
|
1027
|
+
children: Array.from({ length: 7 }).map((e, t) => /* @__PURE__ */ H("div", {
|
|
1031
1028
|
className: "flex h-11 items-center gap-3 px-4",
|
|
1032
1029
|
"aria-hidden": "true",
|
|
1033
|
-
children: [/* @__PURE__ */
|
|
1030
|
+
children: [/* @__PURE__ */ V(tt, {}), /* @__PURE__ */ V(nt, {})]
|
|
1034
1031
|
}, t))
|
|
1035
|
-
}),
|
|
1032
|
+
}), it = (e) => e.displayName ?? e.id, at = (e, t) => {
|
|
1036
1033
|
let n = t.trim().toLowerCase();
|
|
1037
|
-
return n ? e.filter((e) =>
|
|
1038
|
-
},
|
|
1034
|
+
return n ? e.filter((e) => it(e).toLowerCase().includes(n)) : e;
|
|
1035
|
+
}, ot = (e, t, r, i = 18, a) => /* @__PURE__ */ V(n, {
|
|
1039
1036
|
src: e,
|
|
1040
1037
|
size: i,
|
|
1041
1038
|
labels: { tooltip: a },
|
|
1042
1039
|
initialsName: r
|
|
1043
|
-
}),
|
|
1044
|
-
let [a, s] =
|
|
1040
|
+
}), st = ({ deployments: e, selectedDeploymentId: t, onDeploymentChange: n, modelSelectorLabels: r, searchHeaderClassName: i = "bg-layer-0" }) => {
|
|
1041
|
+
let [a, s] = z(""), c = L(() => e?.find((e) => e.id === t), [e, t]), l = r?.loading !== void 0, d = L(() => l ? /* @__PURE__ */ V(tt, { size: u.LG }) : ot(c?.iconUrl, c?.type, c?.displayName ?? c?.id ?? "", u.LG), [l, c]), f = c?.displayName ?? c?.id;
|
|
1045
1042
|
return {
|
|
1046
|
-
selectorIcon:
|
|
1043
|
+
selectorIcon: d,
|
|
1047
1044
|
selectorAriaLabel: f ? `${r?.ariaLabel ?? "Select model"}: ${f}` : r?.ariaLabel ?? "Select model",
|
|
1048
1045
|
selectedLabel: f,
|
|
1049
|
-
menuItems:
|
|
1046
|
+
menuItems: L(() => {
|
|
1050
1047
|
if (l) return Array.from({ length: 7 }, (e, t) => ({
|
|
1051
1048
|
key: `__loading-${t}`,
|
|
1052
|
-
icon: /* @__PURE__ */
|
|
1053
|
-
label: /* @__PURE__ */
|
|
1049
|
+
icon: /* @__PURE__ */ V(tt, {}),
|
|
1050
|
+
label: /* @__PURE__ */ V(nt, { loadingLabel: t === 0 ? r?.loading : void 0 }),
|
|
1054
1051
|
disabled: !0
|
|
1055
1052
|
}));
|
|
1056
1053
|
if (!e || e.length === 0) {
|
|
@@ -1061,19 +1058,19 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
1061
1058
|
disabled: !0
|
|
1062
1059
|
}] : [];
|
|
1063
1060
|
}
|
|
1064
|
-
return
|
|
1061
|
+
return at(e, a).map((e) => {
|
|
1065
1062
|
let r = e.id === t;
|
|
1066
1063
|
return {
|
|
1067
1064
|
key: e.id,
|
|
1068
|
-
label: /* @__PURE__ */
|
|
1065
|
+
label: /* @__PURE__ */ H("span", {
|
|
1069
1066
|
className: "flex w-full items-center justify-between gap-2",
|
|
1070
|
-
children: [/* @__PURE__ */
|
|
1071
|
-
text:
|
|
1067
|
+
children: [/* @__PURE__ */ V(E, {
|
|
1068
|
+
text: it(e),
|
|
1072
1069
|
query: a,
|
|
1073
1070
|
maxLines: 1
|
|
1074
|
-
}), r && /* @__PURE__ */
|
|
1071
|
+
}), r && /* @__PURE__ */ V(Z, { gradientId: "ms-check-grad" })]
|
|
1075
1072
|
}),
|
|
1076
|
-
icon:
|
|
1073
|
+
icon: ot(e.iconUrl, e.type, e.displayName ?? e.id),
|
|
1077
1074
|
onClick: () => n?.(e.id),
|
|
1078
1075
|
className: r ? "bg-accent-primary-alpha" : void 0
|
|
1079
1076
|
};
|
|
@@ -1086,12 +1083,12 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
1086
1083
|
r,
|
|
1087
1084
|
n
|
|
1088
1085
|
]),
|
|
1089
|
-
menuHeader:
|
|
1086
|
+
menuHeader: L(() => !l && e && e.length > 0 ? /* @__PURE__ */ V("div", {
|
|
1090
1087
|
className: o("sticky top-0 z-10 pb-1 pe-2 pt-2", i),
|
|
1091
|
-
children: /* @__PURE__ */
|
|
1088
|
+
children: /* @__PURE__ */ V(y, {
|
|
1092
1089
|
value: a,
|
|
1093
1090
|
placeholder: r?.searchPlaceholder ?? "Search",
|
|
1094
|
-
size:
|
|
1091
|
+
size: T.Small,
|
|
1095
1092
|
wrapperClassName: "border-0",
|
|
1096
1093
|
onChange: s
|
|
1097
1094
|
})
|
|
@@ -1106,8 +1103,8 @@ var G = ({ isOpen: e, onBack: t, backLabel: n = "Back", onClose: r, closeLabel:
|
|
|
1106
1103
|
e || s("");
|
|
1107
1104
|
}
|
|
1108
1105
|
};
|
|
1109
|
-
},
|
|
1110
|
-
function
|
|
1106
|
+
}, ct = typeof window < "u" ? I : F;
|
|
1107
|
+
function lt(e) {
|
|
1111
1108
|
if (e !== void 0) switch (typeof e) {
|
|
1112
1109
|
case "number": return e;
|
|
1113
1110
|
case "string":
|
|
@@ -1115,15 +1112,15 @@ function ft(e) {
|
|
|
1115
1112
|
break;
|
|
1116
1113
|
}
|
|
1117
1114
|
}
|
|
1118
|
-
function
|
|
1119
|
-
let { styleHeight: s, styleWidth: c } =
|
|
1120
|
-
styleHeight:
|
|
1121
|
-
styleWidth:
|
|
1122
|
-
}), [o?.height, o?.width]), [l, u] =
|
|
1115
|
+
function ut({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
|
|
1116
|
+
let { styleHeight: s, styleWidth: c } = L(() => ({
|
|
1117
|
+
styleHeight: lt(o?.height),
|
|
1118
|
+
styleWidth: lt(o?.width)
|
|
1119
|
+
}), [o?.height, o?.width]), [l, u] = z({
|
|
1123
1120
|
height: t,
|
|
1124
1121
|
width: n
|
|
1125
1122
|
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
|
|
1126
|
-
return
|
|
1123
|
+
return ct(() => {
|
|
1127
1124
|
if (i === null || d) return;
|
|
1128
1125
|
let t = new ResizeObserver((e) => {
|
|
1129
1126
|
for (let t of e) {
|
|
@@ -1143,7 +1140,7 @@ function pt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1143
1140
|
i,
|
|
1144
1141
|
s,
|
|
1145
1142
|
c
|
|
1146
|
-
]),
|
|
1143
|
+
]), L(() => ({
|
|
1147
1144
|
height: s ?? l.height,
|
|
1148
1145
|
width: c ?? l.width
|
|
1149
1146
|
}), [
|
|
@@ -1152,26 +1149,26 @@ function pt({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i
|
|
|
1152
1149
|
c
|
|
1153
1150
|
]);
|
|
1154
1151
|
}
|
|
1155
|
-
function
|
|
1156
|
-
let t =
|
|
1152
|
+
function dt(e) {
|
|
1153
|
+
let t = R(() => {
|
|
1157
1154
|
throw Error("Cannot call during render.");
|
|
1158
1155
|
});
|
|
1159
|
-
return
|
|
1156
|
+
return ct(() => {
|
|
1160
1157
|
t.current = e;
|
|
1161
|
-
}, [e]),
|
|
1158
|
+
}, [e]), P((e) => t.current?.(e), [t]);
|
|
1162
1159
|
}
|
|
1163
|
-
var
|
|
1164
|
-
function
|
|
1165
|
-
if (
|
|
1160
|
+
var ft = null;
|
|
1161
|
+
function pt(e = !1) {
|
|
1162
|
+
if (ft === null || e) {
|
|
1166
1163
|
let e = document.createElement("div"), t = e.style;
|
|
1167
1164
|
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
|
|
1168
1165
|
let n = document.createElement("div"), r = n.style;
|
|
1169
|
-
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ?
|
|
1166
|
+
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? ft = "positive-descending" : (e.scrollLeft = 1, ft = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), ft;
|
|
1170
1167
|
}
|
|
1171
|
-
return
|
|
1168
|
+
return ft;
|
|
1172
1169
|
}
|
|
1173
|
-
function
|
|
1174
|
-
if (t === "horizontal" && n) switch (
|
|
1170
|
+
function mt({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
1171
|
+
if (t === "horizontal" && n) switch (pt()) {
|
|
1175
1172
|
case "negative": return -r;
|
|
1176
1173
|
case "positive-descending":
|
|
1177
1174
|
if (e) {
|
|
@@ -1182,26 +1179,26 @@ function _t({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
|
|
|
1182
1179
|
}
|
|
1183
1180
|
return r;
|
|
1184
1181
|
}
|
|
1185
|
-
function
|
|
1182
|
+
function Q(e, t = "Assertion error") {
|
|
1186
1183
|
if (!e) throw console.error(t), Error(t);
|
|
1187
1184
|
}
|
|
1188
|
-
function
|
|
1185
|
+
function ht(e, t) {
|
|
1189
1186
|
if (e === t) return !0;
|
|
1190
|
-
if (!!e != !!t || (
|
|
1187
|
+
if (!!e != !!t || (Q(e !== void 0), Q(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
|
|
1191
1188
|
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
|
|
1192
1189
|
return !0;
|
|
1193
1190
|
}
|
|
1194
|
-
function
|
|
1191
|
+
function gt({ cachedBounds: e, itemCount: t, itemSize: n }) {
|
|
1195
1192
|
if (t === 0) return 0;
|
|
1196
1193
|
if (typeof n == "number") return t * n;
|
|
1197
1194
|
{
|
|
1198
1195
|
let n = e.get(e.size === 0 ? 0 : e.size - 1);
|
|
1199
|
-
return
|
|
1196
|
+
return Q(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
|
|
1200
1197
|
}
|
|
1201
1198
|
}
|
|
1202
|
-
function
|
|
1199
|
+
function _t({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
|
|
1203
1200
|
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
|
|
1204
|
-
let s =
|
|
1201
|
+
let s = gt({
|
|
1205
1202
|
cachedBounds: t,
|
|
1206
1203
|
itemCount: r,
|
|
1207
1204
|
itemSize: i
|
|
@@ -1213,7 +1210,7 @@ function yt({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, co
|
|
|
1213
1210
|
default: return a >= u && a <= l ? a : a < u ? u : l;
|
|
1214
1211
|
}
|
|
1215
1212
|
}
|
|
1216
|
-
function
|
|
1213
|
+
function vt({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
|
|
1217
1214
|
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
|
|
1218
1215
|
for (; u < a;) {
|
|
1219
1216
|
let n = e.get(u);
|
|
@@ -1232,11 +1229,11 @@ function $({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCo
|
|
|
1232
1229
|
stopIndexOverscan: l
|
|
1233
1230
|
};
|
|
1234
1231
|
}
|
|
1235
|
-
function
|
|
1232
|
+
function yt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1236
1233
|
let r = /* @__PURE__ */ new Map();
|
|
1237
1234
|
return {
|
|
1238
1235
|
get(i) {
|
|
1239
|
-
for (
|
|
1236
|
+
for (Q(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
|
|
1240
1237
|
let e = r.size, a;
|
|
1241
1238
|
switch (typeof n) {
|
|
1242
1239
|
case "function":
|
|
@@ -1252,14 +1249,14 @@ function bt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1252
1249
|
});
|
|
1253
1250
|
else {
|
|
1254
1251
|
let t = r.get(e - 1);
|
|
1255
|
-
|
|
1252
|
+
Q(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
|
|
1256
1253
|
scrollOffset: t.scrollOffset + t.size,
|
|
1257
1254
|
size: a
|
|
1258
1255
|
});
|
|
1259
1256
|
}
|
|
1260
1257
|
}
|
|
1261
1258
|
let a = r.get(i);
|
|
1262
|
-
return
|
|
1259
|
+
return Q(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
|
|
1263
1260
|
},
|
|
1264
1261
|
set(e, t) {
|
|
1265
1262
|
r.set(e, t);
|
|
@@ -1269,8 +1266,8 @@ function bt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1269
1266
|
}
|
|
1270
1267
|
};
|
|
1271
1268
|
}
|
|
1272
|
-
function
|
|
1273
|
-
return
|
|
1269
|
+
function bt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
1270
|
+
return L(() => yt({
|
|
1274
1271
|
itemCount: e,
|
|
1275
1272
|
itemProps: t,
|
|
1276
1273
|
itemSize: n
|
|
@@ -1280,11 +1277,11 @@ function xt({ itemCount: e, itemProps: t, itemSize: n }) {
|
|
|
1280
1277
|
n
|
|
1281
1278
|
]);
|
|
1282
1279
|
}
|
|
1283
|
-
function
|
|
1280
|
+
function xt({ containerSize: e, itemSize: t }) {
|
|
1284
1281
|
let n;
|
|
1285
1282
|
switch (typeof t) {
|
|
1286
1283
|
case "string":
|
|
1287
|
-
|
|
1284
|
+
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;
|
|
1288
1285
|
break;
|
|
1289
1286
|
default:
|
|
1290
1287
|
n = t;
|
|
@@ -1292,21 +1289,21 @@ function St({ containerSize: e, itemSize: t }) {
|
|
|
1292
1289
|
}
|
|
1293
1290
|
return n;
|
|
1294
1291
|
}
|
|
1295
|
-
function
|
|
1296
|
-
let { height: u = n, width: d = n } =
|
|
1292
|
+
function St({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
|
|
1293
|
+
let { height: u = n, width: d = n } = ut({
|
|
1297
1294
|
defaultHeight: r === "vertical" ? n : void 0,
|
|
1298
1295
|
defaultWidth: r === "horizontal" ? n : void 0,
|
|
1299
1296
|
element: e,
|
|
1300
1297
|
mode: r === "vertical" ? "only-height" : "only-width",
|
|
1301
1298
|
style: t
|
|
1302
|
-
}), f =
|
|
1299
|
+
}), f = R({
|
|
1303
1300
|
height: 0,
|
|
1304
1301
|
width: 0
|
|
1305
|
-
}), p = r === "vertical" ? u : d, m =
|
|
1302
|
+
}), p = r === "vertical" ? u : d, m = xt({
|
|
1306
1303
|
containerSize: p,
|
|
1307
1304
|
itemSize: s
|
|
1308
1305
|
});
|
|
1309
|
-
|
|
1306
|
+
I(() => {
|
|
1310
1307
|
if (typeof c == "function") {
|
|
1311
1308
|
let e = f.current;
|
|
1312
1309
|
(e.height !== u || e.width !== d) && (c({
|
|
@@ -1319,11 +1316,11 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1319
1316
|
c,
|
|
1320
1317
|
d
|
|
1321
1318
|
]);
|
|
1322
|
-
let h =
|
|
1319
|
+
let h = bt({
|
|
1323
1320
|
itemCount: a,
|
|
1324
1321
|
itemProps: o,
|
|
1325
1322
|
itemSize: m
|
|
1326
|
-
}), g =
|
|
1323
|
+
}), g = P((e) => h.get(e), [h]), [_, v] = z(() => vt({
|
|
1327
1324
|
cachedBounds: h,
|
|
1328
1325
|
containerScrollOffset: 0,
|
|
1329
1326
|
containerSize: p,
|
|
@@ -1334,7 +1331,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1334
1331
|
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
|
|
1335
1332
|
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
|
|
1336
1333
|
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
|
|
1337
|
-
}, C =
|
|
1334
|
+
}, C = P(() => gt({
|
|
1338
1335
|
cachedBounds: h,
|
|
1339
1336
|
itemCount: a,
|
|
1340
1337
|
itemSize: m
|
|
@@ -1342,9 +1339,9 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1342
1339
|
h,
|
|
1343
1340
|
a,
|
|
1344
1341
|
m
|
|
1345
|
-
]), w =
|
|
1342
|
+
]), w = P((t) => vt({
|
|
1346
1343
|
cachedBounds: h,
|
|
1347
|
-
containerScrollOffset:
|
|
1344
|
+
containerScrollOffset: mt({
|
|
1348
1345
|
containerElement: e,
|
|
1349
1346
|
direction: r,
|
|
1350
1347
|
isRtl: i,
|
|
@@ -1362,19 +1359,19 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1362
1359
|
a,
|
|
1363
1360
|
l
|
|
1364
1361
|
]);
|
|
1365
|
-
return
|
|
1362
|
+
return ct(() => {
|
|
1366
1363
|
v(w((r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0));
|
|
1367
1364
|
}, [
|
|
1368
1365
|
e,
|
|
1369
1366
|
r,
|
|
1370
1367
|
w
|
|
1371
|
-
]),
|
|
1368
|
+
]), ct(() => {
|
|
1372
1369
|
if (!e) return;
|
|
1373
1370
|
let t = () => {
|
|
1374
1371
|
v((t) => {
|
|
1375
|
-
let { scrollLeft: n, scrollTop: o } = e, s =
|
|
1372
|
+
let { scrollLeft: n, scrollTop: o } = e, s = vt({
|
|
1376
1373
|
cachedBounds: h,
|
|
1377
|
-
containerScrollOffset:
|
|
1374
|
+
containerScrollOffset: mt({
|
|
1378
1375
|
containerElement: e,
|
|
1379
1376
|
direction: r,
|
|
1380
1377
|
isRtl: i,
|
|
@@ -1384,7 +1381,7 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1384
1381
|
itemCount: a,
|
|
1385
1382
|
overscanCount: l
|
|
1386
1383
|
});
|
|
1387
|
-
return
|
|
1384
|
+
return ht(s, t) ? t : s;
|
|
1388
1385
|
});
|
|
1389
1386
|
};
|
|
1390
1387
|
return e.addEventListener("scroll", t), () => {
|
|
@@ -1400,8 +1397,8 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1400
1397
|
]), {
|
|
1401
1398
|
getCellBounds: g,
|
|
1402
1399
|
getEstimatedSize: C,
|
|
1403
|
-
scrollToIndex:
|
|
1404
|
-
let s =
|
|
1400
|
+
scrollToIndex: dt(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
|
|
1401
|
+
let s = _t({
|
|
1405
1402
|
align: t,
|
|
1406
1403
|
cachedBounds: h,
|
|
1407
1404
|
containerScrollOffset: n,
|
|
@@ -1411,14 +1408,14 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1411
1408
|
itemSize: m
|
|
1412
1409
|
});
|
|
1413
1410
|
if (e) {
|
|
1414
|
-
if (s =
|
|
1411
|
+
if (s = mt({
|
|
1415
1412
|
containerElement: e,
|
|
1416
1413
|
direction: r,
|
|
1417
1414
|
isRtl: i,
|
|
1418
1415
|
scrollOffset: s
|
|
1419
1416
|
}), typeof e.scrollTo != "function") {
|
|
1420
1417
|
let e = w(s);
|
|
1421
|
-
|
|
1418
|
+
ht(_, e) || v(e);
|
|
1422
1419
|
}
|
|
1423
1420
|
return s;
|
|
1424
1421
|
}
|
|
@@ -1429,30 +1426,30 @@ function Ct({ containerElement: e, containerStyle: t, defaultContainerSize: n =
|
|
|
1429
1426
|
stopIndexVisible: x
|
|
1430
1427
|
};
|
|
1431
1428
|
}
|
|
1432
|
-
function
|
|
1433
|
-
return
|
|
1429
|
+
function $(e) {
|
|
1430
|
+
return L(() => e, Object.values(e));
|
|
1434
1431
|
}
|
|
1435
|
-
function
|
|
1432
|
+
function Ct(e, t) {
|
|
1436
1433
|
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
|
|
1437
|
-
return
|
|
1434
|
+
return ht(n, a) && ht(r, o) && ht(i, s);
|
|
1438
1435
|
}
|
|
1439
|
-
function
|
|
1436
|
+
function wt(e) {
|
|
1440
1437
|
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
|
|
1441
1438
|
}
|
|
1442
|
-
var
|
|
1443
|
-
function
|
|
1444
|
-
let m =
|
|
1439
|
+
var Tt = "data-react-window-index";
|
|
1440
|
+
function Et({ 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 }) {
|
|
1441
|
+
let m = $(u), h = L(() => N(s, Ct), [s]), [g, _] = z(null), v = wt(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = St({
|
|
1445
1442
|
containerElement: g,
|
|
1446
1443
|
containerStyle: f,
|
|
1447
1444
|
defaultContainerSize: n,
|
|
1448
1445
|
direction: "vertical",
|
|
1449
1446
|
itemCount: c,
|
|
1450
1447
|
itemProps: m,
|
|
1451
|
-
itemSize:
|
|
1448
|
+
itemSize: L(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
|
|
1452
1449
|
onResize: i,
|
|
1453
1450
|
overscanCount: o
|
|
1454
1451
|
});
|
|
1455
|
-
|
|
1452
|
+
he(r, () => ({
|
|
1456
1453
|
get element() {
|
|
1457
1454
|
return g;
|
|
1458
1455
|
},
|
|
@@ -1467,12 +1464,12 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1467
1464
|
top: r
|
|
1468
1465
|
});
|
|
1469
1466
|
}
|
|
1470
|
-
}), [g, x]),
|
|
1467
|
+
}), [g, x]), ct(() => {
|
|
1471
1468
|
if (!g) return;
|
|
1472
1469
|
let e = Array.from(g.children).filter((e, t) => {
|
|
1473
1470
|
if (e.hasAttribute("aria-hidden")) return !1;
|
|
1474
1471
|
let n = `${S + t}`;
|
|
1475
|
-
return e.setAttribute(
|
|
1472
|
+
return e.setAttribute(Tt, n), !0;
|
|
1476
1473
|
});
|
|
1477
1474
|
if (v) return l.observeRowElements(e);
|
|
1478
1475
|
}, [
|
|
@@ -1481,7 +1478,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1481
1478
|
l,
|
|
1482
1479
|
S,
|
|
1483
1480
|
w
|
|
1484
|
-
]),
|
|
1481
|
+
]), F(() => {
|
|
1485
1482
|
S >= 0 && w >= 0 && a && a({
|
|
1486
1483
|
startIndex: C,
|
|
1487
1484
|
stopIndex: T
|
|
@@ -1496,11 +1493,11 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1496
1493
|
w,
|
|
1497
1494
|
T
|
|
1498
1495
|
]);
|
|
1499
|
-
let E =
|
|
1496
|
+
let E = L(() => {
|
|
1500
1497
|
let e = [];
|
|
1501
1498
|
if (c > 0) for (let t = S; t <= w; t++) {
|
|
1502
1499
|
let n = y(t);
|
|
1503
|
-
e.push(/* @__PURE__ */
|
|
1500
|
+
e.push(/* @__PURE__ */ me(h, {
|
|
1504
1501
|
...m,
|
|
1505
1502
|
ariaAttributes: {
|
|
1506
1503
|
"aria-posinset": t + 1,
|
|
@@ -1527,7 +1524,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1527
1524
|
m,
|
|
1528
1525
|
S,
|
|
1529
1526
|
w
|
|
1530
|
-
]), D = /* @__PURE__ */
|
|
1527
|
+
]), D = /* @__PURE__ */ V("div", {
|
|
1531
1528
|
"aria-hidden": !0,
|
|
1532
1529
|
style: {
|
|
1533
1530
|
height: b(),
|
|
@@ -1535,7 +1532,7 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1535
1532
|
zIndex: -1
|
|
1536
1533
|
}
|
|
1537
1534
|
});
|
|
1538
|
-
return
|
|
1535
|
+
return me(d, {
|
|
1539
1536
|
role: "list",
|
|
1540
1537
|
...p,
|
|
1541
1538
|
className: t,
|
|
@@ -1549,47 +1546,47 @@ function Ot({ children: e, className: t, defaultHeight: n = 0, listRef: r, onRes
|
|
|
1549
1546
|
}
|
|
1550
1547
|
}, E, e, D);
|
|
1551
1548
|
}
|
|
1552
|
-
var
|
|
1553
|
-
divider: "
|
|
1554
|
-
item: "
|
|
1555
|
-
itemIcon: "
|
|
1556
|
-
checkIcon: "
|
|
1557
|
-
stateLabel: "
|
|
1558
|
-
},
|
|
1559
|
-
let
|
|
1560
|
-
return /* @__PURE__ */
|
|
1549
|
+
var Dt = {
|
|
1550
|
+
divider: "_divider_13nxz_1",
|
|
1551
|
+
item: "_item_13nxz_5",
|
|
1552
|
+
itemIcon: "_itemIcon_13nxz_15",
|
|
1553
|
+
checkIcon: "_checkIcon_13nxz_19",
|
|
1554
|
+
stateLabel: "_stateLabel_13nxz_23"
|
|
1555
|
+
}, Ot = 44, kt = 8, At = ({ index: e, style: t, ariaAttributes: n, items: r, selectedDeploymentId: i, labelClassName: a, query: s, onSelect: c }) => {
|
|
1556
|
+
let d = r[e], f = ot(d.iconUrl, d.type, d.displayName ?? d.id, u.SM), p = d.id === i;
|
|
1557
|
+
return /* @__PURE__ */ V("div", {
|
|
1561
1558
|
style: t,
|
|
1562
1559
|
...n,
|
|
1563
|
-
children: /* @__PURE__ */
|
|
1560
|
+
children: /* @__PURE__ */ V(l, {
|
|
1564
1561
|
type: "button",
|
|
1565
|
-
className: o(
|
|
1566
|
-
iconBefore: /* @__PURE__ */
|
|
1567
|
-
className:
|
|
1568
|
-
children:
|
|
1562
|
+
className: o(Dt.item, "flex h-full w-full items-center gap-3 px-4"),
|
|
1563
|
+
iconBefore: /* @__PURE__ */ V("span", {
|
|
1564
|
+
className: Dt.itemIcon,
|
|
1565
|
+
children: f
|
|
1569
1566
|
}),
|
|
1570
|
-
label: /* @__PURE__ */
|
|
1567
|
+
label: /* @__PURE__ */ H("span", {
|
|
1571
1568
|
className: "flex flex-1 items-center justify-between gap-2",
|
|
1572
|
-
children: [/* @__PURE__ */
|
|
1573
|
-
text:
|
|
1569
|
+
children: [/* @__PURE__ */ V(E, {
|
|
1570
|
+
text: d.displayName ?? d.id,
|
|
1574
1571
|
query: s,
|
|
1575
1572
|
maxLines: 1,
|
|
1576
1573
|
className: o(a, "min-w-0 flex-1 text-start")
|
|
1577
|
-
}), p && /* @__PURE__ */
|
|
1578
|
-
size:
|
|
1579
|
-
className:
|
|
1574
|
+
}), p && /* @__PURE__ */ V(re, {
|
|
1575
|
+
size: u.SM,
|
|
1576
|
+
className: Dt.checkIcon,
|
|
1580
1577
|
"aria-hidden": !0
|
|
1581
1578
|
})]
|
|
1582
1579
|
}),
|
|
1583
|
-
onClick: () => c(
|
|
1580
|
+
onClick: () => c(d.id)
|
|
1584
1581
|
})
|
|
1585
1582
|
});
|
|
1586
|
-
},
|
|
1587
|
-
let [h, g] =
|
|
1588
|
-
|
|
1583
|
+
}, jt = ({ isOpen: e, title: t, closeLabel: n, searchPlaceholder: r = "Search", onClose: i, deployments: a, selectedDeploymentId: s, onSelect: c, loadingLabel: l, errorLabel: u, emptyLabel: d, style: f, titleClassName: p = "dial-body-semi-text", labelClassName: m = "dial-small-text" }) => {
|
|
1584
|
+
let [h, g] = z("");
|
|
1585
|
+
F(() => {
|
|
1589
1586
|
e || g("");
|
|
1590
1587
|
}, [e]);
|
|
1591
|
-
let _ = a && a.length > 0, v = l !== void 0,
|
|
1592
|
-
return /* @__PURE__ */
|
|
1588
|
+
let _ = a && a.length > 0, v = l !== void 0, b = !_ && !v ? u ?? d : void 0, x = _ ? at(a, h) : [];
|
|
1589
|
+
return /* @__PURE__ */ H(U, {
|
|
1593
1590
|
isOpen: e,
|
|
1594
1591
|
title: t,
|
|
1595
1592
|
closeLabel: n,
|
|
@@ -1597,27 +1594,27 @@ var kt = {
|
|
|
1597
1594
|
style: f,
|
|
1598
1595
|
titleClassName: p,
|
|
1599
1596
|
className: "max-h-[80dvh]",
|
|
1600
|
-
children: [_ && !v && /* @__PURE__ */
|
|
1597
|
+
children: [_ && !v && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("div", {
|
|
1601
1598
|
className: "flex-shrink-0 px-4 py-[10px]",
|
|
1602
|
-
children: /* @__PURE__ */
|
|
1599
|
+
children: /* @__PURE__ */ V(y, {
|
|
1603
1600
|
value: h,
|
|
1604
1601
|
placeholder: r,
|
|
1605
|
-
size:
|
|
1602
|
+
size: T.Standard,
|
|
1606
1603
|
onChange: g
|
|
1607
1604
|
})
|
|
1608
|
-
}), /* @__PURE__ */
|
|
1605
|
+
}), /* @__PURE__ */ V("div", { className: o(Dt.divider, "h-px flex-shrink-0") })] }), v ? /* @__PURE__ */ V(rt, { loadingLabel: l }) : b ? /* @__PURE__ */ V("div", {
|
|
1609
1606
|
role: "list",
|
|
1610
|
-
className: o(
|
|
1611
|
-
children:
|
|
1612
|
-
}) : /* @__PURE__ */
|
|
1607
|
+
className: o(Dt.stateLabel, m, "px-4 py-4"),
|
|
1608
|
+
children: b
|
|
1609
|
+
}) : /* @__PURE__ */ V(Et, {
|
|
1613
1610
|
role: "list",
|
|
1614
1611
|
className: "overflow-y-auto",
|
|
1615
|
-
style: { height: Math.min(
|
|
1616
|
-
rowComponent:
|
|
1617
|
-
rowCount:
|
|
1618
|
-
rowHeight:
|
|
1612
|
+
style: { height: Math.min(x.length, kt) * Ot },
|
|
1613
|
+
rowComponent: At,
|
|
1614
|
+
rowCount: x.length,
|
|
1615
|
+
rowHeight: Ot,
|
|
1619
1616
|
rowProps: {
|
|
1620
|
-
items:
|
|
1617
|
+
items: x,
|
|
1621
1618
|
selectedDeploymentId: s,
|
|
1622
1619
|
labelClassName: m,
|
|
1623
1620
|
query: h,
|
|
@@ -1627,23 +1624,23 @@ var kt = {
|
|
|
1627
1624
|
}
|
|
1628
1625
|
})]
|
|
1629
1626
|
});
|
|
1630
|
-
},
|
|
1631
|
-
let [v, y] =
|
|
1627
|
+
}, Mt = ({ 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: g, onPickerOpenChange: _ }) => {
|
|
1628
|
+
let [v, y] = z(!1), { selectorIcon: b, selectorAriaLabel: x, selectedLabel: S, menuItems: C, menuHeader: E, onOpenChange: D } = st({
|
|
1632
1629
|
deployments: e,
|
|
1633
1630
|
selectedDeploymentId: t,
|
|
1634
1631
|
onDeploymentChange: n,
|
|
1635
1632
|
modelSelectorLabels: r
|
|
1636
1633
|
});
|
|
1637
1634
|
if (!e) return null;
|
|
1638
|
-
let
|
|
1639
|
-
size:
|
|
1635
|
+
let O = i || c ? "pointer-events-none opacity-50 cursor-not-allowed" : void 0, k = /* @__PURE__ */ V(ie, {
|
|
1636
|
+
size: u.SM,
|
|
1640
1637
|
className: X.modelSelectorCaret,
|
|
1641
1638
|
"aria-hidden": !0
|
|
1642
1639
|
});
|
|
1643
|
-
return a ? /* @__PURE__ */
|
|
1640
|
+
return a ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(w, {
|
|
1644
1641
|
tooltip: S,
|
|
1645
|
-
children: /* @__PURE__ */
|
|
1646
|
-
icon: /* @__PURE__ */
|
|
1642
|
+
children: /* @__PURE__ */ V(h, {
|
|
1643
|
+
icon: /* @__PURE__ */ H("div", {
|
|
1647
1644
|
className: "flex items-center gap-1",
|
|
1648
1645
|
children: [b, k]
|
|
1649
1646
|
}),
|
|
@@ -1651,16 +1648,16 @@ var kt = {
|
|
|
1651
1648
|
onClick: () => {
|
|
1652
1649
|
c || y(!0);
|
|
1653
1650
|
},
|
|
1654
|
-
className: o(X.modelSelectorButton,
|
|
1651
|
+
className: o(X.modelSelectorButton, O)
|
|
1655
1652
|
})
|
|
1656
|
-
}),
|
|
1653
|
+
}), d ? /* @__PURE__ */ V(U, {
|
|
1657
1654
|
isOpen: v,
|
|
1658
1655
|
title: r?.ariaLabel ?? "Select model",
|
|
1659
1656
|
closeLabel: r?.closeLabel ?? "Close",
|
|
1660
1657
|
onClose: () => y(!1),
|
|
1661
1658
|
style: l,
|
|
1662
|
-
children:
|
|
1663
|
-
}) : /* @__PURE__ */
|
|
1659
|
+
children: d(() => y(!1))
|
|
1660
|
+
}) : /* @__PURE__ */ V(jt, {
|
|
1664
1661
|
isOpen: v,
|
|
1665
1662
|
title: r?.ariaLabel ?? "Select model",
|
|
1666
1663
|
closeLabel: r?.closeLabel ?? "Close",
|
|
@@ -1673,50 +1670,50 @@ var kt = {
|
|
|
1673
1670
|
errorLabel: r?.error,
|
|
1674
1671
|
emptyLabel: r?.empty,
|
|
1675
1672
|
style: l
|
|
1676
|
-
})] }) :
|
|
1673
|
+
})] }) : d ? /* @__PURE__ */ V(f, {
|
|
1677
1674
|
placement: "top-end",
|
|
1678
1675
|
matchReferenceWidth: !1,
|
|
1679
|
-
open:
|
|
1680
|
-
onOpenChange:
|
|
1676
|
+
open: m,
|
|
1677
|
+
onOpenChange: _,
|
|
1681
1678
|
trigger: [],
|
|
1682
1679
|
outsideClosable: !0,
|
|
1683
|
-
renderOverlay: () =>
|
|
1680
|
+
renderOverlay: () => d(() => _?.(!1)),
|
|
1684
1681
|
listClassName: "cp-dropdown-overlay !w-[320px]",
|
|
1685
|
-
children: /* @__PURE__ */
|
|
1682
|
+
children: /* @__PURE__ */ V(w, {
|
|
1686
1683
|
tooltip: S,
|
|
1687
|
-
children: /* @__PURE__ */
|
|
1684
|
+
children: /* @__PURE__ */ H("button", {
|
|
1688
1685
|
type: "button",
|
|
1689
1686
|
"aria-label": x,
|
|
1690
|
-
className: o("flex items-center justify-center gap-1 rounded-md p-2", X.modelSelectorButton, s || i || c ?
|
|
1687
|
+
className: o("flex items-center justify-center gap-1 rounded-md p-2", X.modelSelectorButton, s || i || c ? O : void 0, (s || c) && X.modelSelectorButtonDisabled),
|
|
1691
1688
|
onClick: () => {
|
|
1692
|
-
!s && !i && !c &&
|
|
1689
|
+
!s && !i && !c && g?.();
|
|
1693
1690
|
},
|
|
1694
1691
|
children: [b, k]
|
|
1695
1692
|
})
|
|
1696
1693
|
})
|
|
1697
|
-
}) : /* @__PURE__ */
|
|
1698
|
-
className: o(c &&
|
|
1694
|
+
}) : /* @__PURE__ */ V("div", {
|
|
1695
|
+
className: o(c && O),
|
|
1699
1696
|
"aria-disabled": c || void 0,
|
|
1700
|
-
children: /* @__PURE__ */
|
|
1697
|
+
children: /* @__PURE__ */ V(w, {
|
|
1701
1698
|
tooltip: S,
|
|
1702
|
-
children: /* @__PURE__ */
|
|
1699
|
+
children: /* @__PURE__ */ V(p, {
|
|
1703
1700
|
icon: b,
|
|
1704
1701
|
ariaLabel: x,
|
|
1705
1702
|
items: C,
|
|
1706
|
-
menuHeader:
|
|
1703
|
+
menuHeader: E,
|
|
1707
1704
|
placement: "bottom-end",
|
|
1708
1705
|
matchReferenceWidth: !1,
|
|
1709
1706
|
listClassName: "cp-dropdown-overlay !w-[240px] !max-h-80",
|
|
1710
|
-
onOpenChange: c ? void 0 :
|
|
1711
|
-
size:
|
|
1707
|
+
onOpenChange: c ? void 0 : D,
|
|
1708
|
+
size: T.Standard,
|
|
1712
1709
|
caretIcon: k,
|
|
1713
|
-
iconClassName: s || c ?
|
|
1714
|
-
buttonClassName: o("bg-transparent", X.modelSelectorButton, (s || c) &&
|
|
1710
|
+
iconClassName: s || c ? O : void 0,
|
|
1711
|
+
buttonClassName: o("bg-transparent", X.modelSelectorButton, (s || c) && O && X.modelSelectorButtonDisabled)
|
|
1715
1712
|
})
|
|
1716
1713
|
})
|
|
1717
1714
|
});
|
|
1718
|
-
},
|
|
1719
|
-
let We = s(), [Ge,
|
|
1715
|
+
}, Nt = 160, Pt = ({ 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: g = "Attach file", fileAccept: _, addMenuTitle: v = "Add", menuTitle: y = "Menu", menuCloseLabel: b = "Close", removeLabel: x, retryLabel: S, sendLabel: C, stopLabel: w, micLabel: T = "Record voice message", stopRecordingLabel: E, discardRecordingLabel: D, timerAriaLabel: O, colors: k, typography: A, className: ee, pendingDropFiles: te = [], onDropFilesConsumed: ne, pendingAttachments: re = [], onPendingAttachmentsConsumed: ie, pasteTextThreshold: j = 4e3, deployments: M, selectedDeploymentId: se, onDeploymentChange: ce, modelSelectorLabels: le, initialAttachments: ue = [], isStacked: de = !1, hideAddButton: fe = !1, hideAttachFile: pe = !1, hideActionBar: me = !1, renderFooterActions: N, isInputDisabled: F = !1, isModelSelectorDisabled: he = !1, isSendDisabled: I = !1, isAudioMessageSupported: ge = !1, sendOnEnter: _e = Re.Enter, prefixAttachments: ve = [], onRemovePrefixAttachment: be, chatSettings: xe, toolsMenuItems: Se, onToolToggle: Ce, toolsMenuTitle: Te, toolsBackLabel: Ee, toolsChipLabels: U, autoFocus: De = !1, messageHistory: Ae, onDialFileSystemClick: je, dialFileSystemLabel: Pe, validateAttachment: Fe, onAttachmentClick: Ie, modelPickerOverlay: ze, maximumAttachmentsAmount: Be, onAttachmentsLimitExceeded: Ve, isAttachmentsEnabled: W = !0, usageLimitsSlot: He, onMessageTooLong: Ue }) => {
|
|
1716
|
+
let We = s(), [Ge, G] = z(!1), qe = Me(Ae), Je = L(() => a({
|
|
1720
1717
|
"--ci-bg": k?.background,
|
|
1721
1718
|
"--ci-text": k?.text,
|
|
1722
1719
|
"--ci-border": k?.border,
|
|
@@ -1728,206 +1725,225 @@ var kt = {
|
|
|
1728
1725
|
"--ci-send-bg": k?.sendBackground,
|
|
1729
1726
|
"--ci-send-text": k?.sendText,
|
|
1730
1727
|
"--ci-stop-color": k?.stopColor
|
|
1731
|
-
}), [k]),
|
|
1728
|
+
}), [k]), K = L(() => je ? [{
|
|
1732
1729
|
key: "dial-fs",
|
|
1733
|
-
label:
|
|
1734
|
-
icon: /* @__PURE__ */
|
|
1730
|
+
label: Pe ?? "DIAL file system",
|
|
1731
|
+
icon: /* @__PURE__ */ V(ae, {
|
|
1735
1732
|
size: c,
|
|
1736
1733
|
"aria-hidden": !0
|
|
1737
1734
|
}),
|
|
1738
|
-
onClick:
|
|
1739
|
-
}] : [], [
|
|
1735
|
+
onClick: je
|
|
1736
|
+
}] : [], [je, Pe]), { message: q, setMessage: J, textareaRef: Y, isMultiLine: Xe } = Ne({
|
|
1740
1737
|
messageProp: e,
|
|
1741
1738
|
messageRevision: t
|
|
1742
|
-
}), { attachments:
|
|
1743
|
-
initialAttachments:
|
|
1739
|
+
}), { attachments: Z, buildAttachments: et, addAttachments: tt, resetAttachments: nt, handleRemove: rt, handleRetry: it, handleExpand: at, hasBlockedAttachments: ot } = Oe({
|
|
1740
|
+
initialAttachments: ue,
|
|
1744
1741
|
onUploadAttachment: r,
|
|
1745
1742
|
onAttachmentsChange: f,
|
|
1746
|
-
validateAttachment:
|
|
1743
|
+
validateAttachment: Fe,
|
|
1747
1744
|
pendingDropFiles: te,
|
|
1748
1745
|
onDropFilesConsumed: ne,
|
|
1749
1746
|
pendingAttachments: re,
|
|
1750
1747
|
onPendingAttachmentsConsumed: ie,
|
|
1751
|
-
onExpandPastedText:
|
|
1752
|
-
|
|
1753
|
-
}, [
|
|
1754
|
-
maximumAttachmentsAmount:
|
|
1755
|
-
baseAttachmentsAmount:
|
|
1756
|
-
onAttachmentsLimitExceeded:
|
|
1757
|
-
}), { state:
|
|
1758
|
-
|
|
1759
|
-
}, [
|
|
1760
|
-
if (
|
|
1761
|
-
|
|
1762
|
-
|
|
1748
|
+
onExpandPastedText: P((e) => {
|
|
1749
|
+
J((t) => t ? `${t}\n${e}` : e);
|
|
1750
|
+
}, [J]),
|
|
1751
|
+
maximumAttachmentsAmount: Be,
|
|
1752
|
+
baseAttachmentsAmount: ve.length,
|
|
1753
|
+
onAttachmentsLimitExceeded: Ve
|
|
1754
|
+
}), { state: st, analyserNodeRef: ct, elapsedSeconds: lt, errorMessage: ut, startRecording: dt, stopRecording: ft, discardRecording: pt } = Le({ onAttachAudio: P((e) => {
|
|
1755
|
+
tt(et([e]));
|
|
1756
|
+
}, [tt, et]) }), mt = R(null), Q = R(null), { handlePaste: ht } = we(tt, W ? j : Infinity), gt = P((e) => {
|
|
1757
|
+
if (!W) {
|
|
1758
|
+
let t = e.clipboardData.getData("text/plain");
|
|
1759
|
+
t.length >= j && Ue?.(t.length, j);
|
|
1760
|
+
}
|
|
1761
|
+
ht(e);
|
|
1762
|
+
}, [
|
|
1763
|
+
W,
|
|
1764
|
+
j,
|
|
1765
|
+
Ue,
|
|
1766
|
+
ht
|
|
1767
|
+
]), _t = q.trim().length > 0 || Z.length > 0, vt = _t && !ot && !I, { shouldRender: yt, isExiting: bt, instanceKey: xt } = ke(!l && _t, Nt), St = (Se?.some((e) => e.isSelected) ?? !1) && Ce != null, $ = de || q.includes("\n") || Xe || St, Ct = M === void 0 || se != null, wt = async () => {
|
|
1768
|
+
if (I) return;
|
|
1769
|
+
if (!W && q.length >= j) {
|
|
1770
|
+
Ue?.(q.length, j);
|
|
1771
|
+
return;
|
|
1772
|
+
}
|
|
1773
|
+
let e = q, t = Z;
|
|
1774
|
+
J(""), qe.reset();
|
|
1763
1775
|
try {
|
|
1764
1776
|
await n?.(e, t), t.forEach((e) => {
|
|
1765
1777
|
e.previewUrl && URL.revokeObjectURL(e.previewUrl), e.playUrl && URL.revokeObjectURL(e.playUrl);
|
|
1766
|
-
}),
|
|
1778
|
+
}), nt([]);
|
|
1767
1779
|
} catch {
|
|
1768
|
-
|
|
1780
|
+
J(e), nt(t);
|
|
1769
1781
|
}
|
|
1770
|
-
},
|
|
1771
|
-
if (!e.nativeEvent.isComposing && !
|
|
1772
|
-
let t = e.currentTarget.selectionStart ?? 0, n =
|
|
1782
|
+
}, Tt = (e) => {
|
|
1783
|
+
if (!e.nativeEvent.isComposing && !F && !l && (e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
1784
|
+
let t = e.currentTarget.selectionStart ?? 0, n = qe.navigate(e.key === "ArrowUp" ? "up" : "down", q, t);
|
|
1773
1785
|
if (n !== null) {
|
|
1774
|
-
e.preventDefault(),
|
|
1786
|
+
e.preventDefault(), J(n);
|
|
1775
1787
|
return;
|
|
1776
1788
|
}
|
|
1777
1789
|
}
|
|
1778
|
-
e.key === "Enter" && (
|
|
1779
|
-
},
|
|
1790
|
+
e.key === "Enter" && (_e === Re.MetaEnter ? (e.metaKey || e.ctrlKey) && !e.shiftKey : !e.shiftKey && !e.metaKey && !e.ctrlKey) && (e.preventDefault(), !l && vt && Ct && !F && wt());
|
|
1791
|
+
}, Et = (e) => {
|
|
1780
1792
|
let t = Array.from(e.target.files ?? []);
|
|
1781
1793
|
if (t.length === 0) return;
|
|
1782
|
-
let n =
|
|
1783
|
-
e.target.value = "",
|
|
1794
|
+
let n = et(t);
|
|
1795
|
+
e.target.value = "", tt(n);
|
|
1784
1796
|
};
|
|
1785
|
-
if (
|
|
1786
|
-
state:
|
|
1787
|
-
analyserNodeRef:
|
|
1788
|
-
elapsedSeconds:
|
|
1789
|
-
errorMessage:
|
|
1790
|
-
onStop:
|
|
1791
|
-
onDiscard:
|
|
1797
|
+
if (st !== "idle") return /* @__PURE__ */ V(Ze, {
|
|
1798
|
+
state: st,
|
|
1799
|
+
analyserNodeRef: ct,
|
|
1800
|
+
elapsedSeconds: lt,
|
|
1801
|
+
errorMessage: ut,
|
|
1802
|
+
onStop: ft,
|
|
1803
|
+
onDiscard: pt,
|
|
1792
1804
|
stopLabel: E,
|
|
1793
1805
|
discardLabel: D,
|
|
1794
1806
|
timerLabel: O,
|
|
1795
|
-
style:
|
|
1807
|
+
style: Je,
|
|
1796
1808
|
className: ee
|
|
1797
1809
|
});
|
|
1798
|
-
let
|
|
1810
|
+
let Dt = /* @__PURE__ */ V("textarea", {
|
|
1799
1811
|
className: o(X.textarea, A?.fontClassName, "max-h-[272px] w-full resize-none overflow-y-auto border-0 bg-transparent outline-none [field-sizing:content]"),
|
|
1800
|
-
ref:
|
|
1801
|
-
autoFocus:
|
|
1802
|
-
value:
|
|
1812
|
+
ref: Y,
|
|
1813
|
+
autoFocus: De,
|
|
1814
|
+
value: q,
|
|
1803
1815
|
onChange: (e) => {
|
|
1804
|
-
|
|
1816
|
+
J(e.target.value), qe.notifyChange(), d?.(e.target.value);
|
|
1805
1817
|
},
|
|
1806
|
-
onKeyDown:
|
|
1807
|
-
onPaste:
|
|
1818
|
+
onKeyDown: Tt,
|
|
1819
|
+
onPaste: gt,
|
|
1808
1820
|
placeholder: p,
|
|
1809
1821
|
"aria-label": m,
|
|
1810
|
-
disabled:
|
|
1822
|
+
disabled: F,
|
|
1811
1823
|
rows: 1
|
|
1812
1824
|
});
|
|
1813
|
-
return /* @__PURE__ */
|
|
1814
|
-
ref:
|
|
1815
|
-
style:
|
|
1816
|
-
className: o(X.wrapper,
|
|
1817
|
-
children: [(
|
|
1818
|
-
attachments: [...
|
|
1825
|
+
return /* @__PURE__ */ H("div", {
|
|
1826
|
+
ref: Q,
|
|
1827
|
+
style: Je,
|
|
1828
|
+
className: o(X.wrapper, F && X.wrapperDisabled, "flex min-h-[56px] w-full max-w-[748px] flex-col justify-center gap-3 rounded-xl border", Z.length > 6 ? "py-3 ps-3" : "p-3", ee),
|
|
1829
|
+
children: [(ve.length > 0 || Z.length > 0) && /* @__PURE__ */ V(ye, {
|
|
1830
|
+
attachments: [...ve, ...Z],
|
|
1819
1831
|
onRemove: (e) => {
|
|
1820
|
-
|
|
1832
|
+
ve.some((t) => t.id === e) ? be?.(e) : rt(e);
|
|
1821
1833
|
},
|
|
1822
|
-
onRetry:
|
|
1823
|
-
onExpand:
|
|
1834
|
+
onRetry: it,
|
|
1835
|
+
onExpand: at,
|
|
1824
1836
|
labels: {
|
|
1825
1837
|
removeLabel: x,
|
|
1826
1838
|
retryLabel: S
|
|
1827
1839
|
},
|
|
1828
|
-
onAttachmentClick:
|
|
1829
|
-
let t = [...
|
|
1830
|
-
t != null &&
|
|
1840
|
+
onAttachmentClick: Ie == null ? void 0 : (e) => {
|
|
1841
|
+
let t = [...ve, ...Z].find((t) => t.id === e);
|
|
1842
|
+
t != null && Ie(t);
|
|
1831
1843
|
}
|
|
1832
|
-
}),
|
|
1844
|
+
}), me ? $ && Dt : /* @__PURE__ */ H("div", {
|
|
1833
1845
|
className: o("flex items-center gap-2", $ ? "flex-wrap" : "flex-wrap desktop:flex-nowrap"),
|
|
1834
1846
|
children: [
|
|
1835
|
-
!
|
|
1847
|
+
!fe && /* @__PURE__ */ H("div", {
|
|
1836
1848
|
className: o("flex", "order-2", !$ && "desktop:order-1"),
|
|
1837
|
-
children: [/* @__PURE__ */
|
|
1838
|
-
ref:
|
|
1849
|
+
children: [/* @__PURE__ */ V("input", {
|
|
1850
|
+
ref: mt,
|
|
1839
1851
|
type: "file",
|
|
1840
1852
|
multiple: !0,
|
|
1841
|
-
accept:
|
|
1853
|
+
accept: _,
|
|
1842
1854
|
className: "sr-only",
|
|
1843
1855
|
"aria-hidden": !0,
|
|
1844
1856
|
tabIndex: -1,
|
|
1845
|
-
onChange:
|
|
1846
|
-
}), /* @__PURE__ */
|
|
1847
|
-
onAttachClick:
|
|
1848
|
-
attachLabel:
|
|
1857
|
+
onChange: Et
|
|
1858
|
+
}), /* @__PURE__ */ V(Ke, {
|
|
1859
|
+
onAttachClick: pe ? void 0 : () => mt.current?.click(),
|
|
1860
|
+
attachLabel: g,
|
|
1849
1861
|
addMenuTitle: v,
|
|
1850
1862
|
menuTitle: y,
|
|
1851
1863
|
menuCloseLabel: b,
|
|
1852
|
-
style:
|
|
1853
|
-
isDisabled:
|
|
1854
|
-
chatSettings:
|
|
1855
|
-
extraMenuItems:
|
|
1856
|
-
toolsMenuItems:
|
|
1857
|
-
onToolToggle:
|
|
1858
|
-
toolsMenuTitle:
|
|
1859
|
-
toolsBackLabel:
|
|
1864
|
+
style: Je,
|
|
1865
|
+
isDisabled: F,
|
|
1866
|
+
chatSettings: xe,
|
|
1867
|
+
extraMenuItems: K,
|
|
1868
|
+
toolsMenuItems: Se,
|
|
1869
|
+
onToolToggle: Ce,
|
|
1870
|
+
toolsMenuTitle: Te,
|
|
1871
|
+
toolsBackLabel: Ee
|
|
1860
1872
|
})]
|
|
1861
1873
|
}),
|
|
1862
|
-
$ &&
|
|
1874
|
+
$ && St && /* @__PURE__ */ V("div", {
|
|
1863
1875
|
className: "order-3 min-w-0 flex-1",
|
|
1864
|
-
children: /* @__PURE__ */
|
|
1865
|
-
items:
|
|
1866
|
-
onToolToggle:
|
|
1876
|
+
children: /* @__PURE__ */ V(Ye, {
|
|
1877
|
+
items: Se ?? [],
|
|
1878
|
+
onToolToggle: Ce,
|
|
1867
1879
|
isMobile: We,
|
|
1868
|
-
countLabel:
|
|
1869
|
-
removeLabel:
|
|
1880
|
+
countLabel: U?.countLabel,
|
|
1881
|
+
removeLabel: U?.removeLabel
|
|
1870
1882
|
})
|
|
1871
1883
|
}),
|
|
1872
|
-
/* @__PURE__ */
|
|
1884
|
+
/* @__PURE__ */ V("div", {
|
|
1873
1885
|
className: o("order-1 flex w-full min-w-0 items-center self-stretch", !$ && "desktop:order-2 desktop:w-auto desktop:flex-1"),
|
|
1874
|
-
children:
|
|
1886
|
+
children: Dt
|
|
1875
1887
|
}),
|
|
1876
|
-
/* @__PURE__ */
|
|
1877
|
-
className: o("flex flex-shrink-0 items-center gap-2", $ &&
|
|
1878
|
-
children: [
|
|
1879
|
-
canSend:
|
|
1880
|
-
onSend:
|
|
1881
|
-
}) : /* @__PURE__ */
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1888
|
+
/* @__PURE__ */ H("div", {
|
|
1889
|
+
className: o("flex flex-shrink-0 items-center gap-2", $ && St ? "order-4" : "order-3", "ms-auto", !$ && "desktop:ms-0"),
|
|
1890
|
+
children: [N ? N({
|
|
1891
|
+
canSend: vt,
|
|
1892
|
+
onSend: wt
|
|
1893
|
+
}) : /* @__PURE__ */ H(B, { children: [
|
|
1894
|
+
He,
|
|
1895
|
+
/* @__PURE__ */ V(Mt, {
|
|
1896
|
+
deployments: M,
|
|
1897
|
+
selectedDeploymentId: se,
|
|
1898
|
+
onDeploymentChange: ce,
|
|
1899
|
+
modelSelectorLabels: le,
|
|
1900
|
+
isStreaming: l,
|
|
1901
|
+
isMobile: We,
|
|
1902
|
+
isInputDisabled: F,
|
|
1903
|
+
isDisabled: he,
|
|
1904
|
+
style: Je,
|
|
1905
|
+
modelPickerOverlay: ze,
|
|
1906
|
+
isPickerOpen: Ge,
|
|
1907
|
+
onPickerToggle: () => G((e) => !e),
|
|
1908
|
+
onPickerOpenChange: G
|
|
1909
|
+
}),
|
|
1910
|
+
l && i ? /* @__PURE__ */ V($e, {
|
|
1911
|
+
onStop: i,
|
|
1912
|
+
ariaLabel: w
|
|
1913
|
+
}) : !l && yt && /* @__PURE__ */ V(Qe, {
|
|
1914
|
+
onSend: wt,
|
|
1915
|
+
isDisabled: !Ct || ot || I,
|
|
1916
|
+
ariaLabel: C,
|
|
1917
|
+
isExiting: bt
|
|
1918
|
+
}, xt)
|
|
1919
|
+
] }), ge && !bt && /* @__PURE__ */ V(h, {
|
|
1920
|
+
icon: /* @__PURE__ */ V(oe, {
|
|
1921
|
+
size: u.LG,
|
|
1906
1922
|
"aria-hidden": !0
|
|
1907
1923
|
}),
|
|
1908
1924
|
"aria-label": T,
|
|
1909
1925
|
className: "size-8 flex-shrink-0",
|
|
1910
|
-
onClick:
|
|
1911
|
-
disabled:
|
|
1926
|
+
onClick: dt,
|
|
1927
|
+
disabled: F || l
|
|
1912
1928
|
})]
|
|
1913
1929
|
})
|
|
1914
1930
|
]
|
|
1915
1931
|
})]
|
|
1916
1932
|
});
|
|
1917
|
-
},
|
|
1933
|
+
}, Ft = { welcome: "_welcome_n2ph8_1" }, It = ({ 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 }) => {
|
|
1918
1934
|
let { colors: u, typography: d } = r ?? {};
|
|
1919
|
-
return /* @__PURE__ */
|
|
1935
|
+
return /* @__PURE__ */ H("div", {
|
|
1920
1936
|
style: a({
|
|
1921
1937
|
"--ci-root-bg": u?.background,
|
|
1922
1938
|
"--ci-welcome-color": u?.welcomeText
|
|
1923
1939
|
}),
|
|
1924
1940
|
className: o("relative flex w-full flex-col items-center gap-6 px-4 py-5 desktop:p-5", i),
|
|
1925
|
-
children: [n && /* @__PURE__ */
|
|
1926
|
-
className: o(
|
|
1941
|
+
children: [n && /* @__PURE__ */ V("h1", {
|
|
1942
|
+
className: o(Ft.welcome, "m-0 text-center", d?.welcomeClassName),
|
|
1927
1943
|
children: n
|
|
1928
|
-
}), /* @__PURE__ */
|
|
1944
|
+
}), /* @__PURE__ */ V("div", {
|
|
1929
1945
|
className: "relative w-full max-w-[748px]",
|
|
1930
|
-
children: /* @__PURE__ */
|
|
1946
|
+
children: /* @__PURE__ */ V(Pt, {
|
|
1931
1947
|
placeholder: t,
|
|
1932
1948
|
isStreaming: e,
|
|
1933
1949
|
isInputDisabled: c,
|
|
@@ -1938,88 +1954,96 @@ var kt = {
|
|
|
1938
1954
|
})
|
|
1939
1955
|
})]
|
|
1940
1956
|
});
|
|
1941
|
-
},
|
|
1942
|
-
let
|
|
1943
|
-
|
|
1944
|
-
v?.length && (
|
|
1957
|
+
}, Lt = ({ 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: E, dialFileSystemLabel: O, pendingAttachments: A, onPendingAttachmentsConsumed: ee, onAttachmentClick: te, pasteTextThreshold: ne, onMessageTooLong: re }) => {
|
|
1958
|
+
let ie = R(null), [j, oe] = z([]);
|
|
1959
|
+
F(() => {
|
|
1960
|
+
v?.length && (oe(v), y?.());
|
|
1945
1961
|
}, [v, y]);
|
|
1946
|
-
let [
|
|
1947
|
-
|
|
1948
|
-
},
|
|
1949
|
-
i(e,
|
|
1950
|
-
}, [
|
|
1951
|
-
|
|
1952
|
-
|
|
1962
|
+
let [M, se] = z(e ?? ""), [ce, le] = z([]), [ue, de] = z(t), fe = ce.some((e) => e.status === r.Loading || e.status === r.Error), pe = (M.trim().length > 0 || ce.length > 0 || ue.length > 0) && !fe, me = (e) => {
|
|
1963
|
+
de((t) => t.filter((t) => t.id !== e));
|
|
1964
|
+
}, N = P((e, t) => {
|
|
1965
|
+
i(e, ue, t);
|
|
1966
|
+
}, [ue, i]), he = () => {
|
|
1967
|
+
if (pe) {
|
|
1968
|
+
if (!x && M.length >= (ne ?? 4e3)) {
|
|
1969
|
+
re?.(M.length, ne ?? 4e3);
|
|
1970
|
+
return;
|
|
1971
|
+
}
|
|
1972
|
+
N(M, ce);
|
|
1973
|
+
}
|
|
1974
|
+
}, I = P(() => oe([]), []), ge = P((e) => {
|
|
1953
1975
|
let t = Array.from(e.target.files ?? []);
|
|
1954
|
-
t.length !== 0 && (e.target.value = "",
|
|
1955
|
-
}, []),
|
|
1976
|
+
t.length !== 0 && (e.target.value = "", oe(t));
|
|
1977
|
+
}, []), _e = L(() => E ? [{
|
|
1956
1978
|
key: "dial-fs",
|
|
1957
|
-
label:
|
|
1958
|
-
icon: /* @__PURE__ */
|
|
1979
|
+
label: O ?? "DIAL file system",
|
|
1980
|
+
icon: /* @__PURE__ */ V(ae, {
|
|
1959
1981
|
size: c,
|
|
1960
1982
|
"aria-hidden": !0
|
|
1961
1983
|
}),
|
|
1962
1984
|
onClick: E
|
|
1963
|
-
}] : [], [E,
|
|
1964
|
-
return /* @__PURE__ */
|
|
1985
|
+
}] : [], [E, O]);
|
|
1986
|
+
return /* @__PURE__ */ H("div", {
|
|
1965
1987
|
className: o("flex w-full flex-col gap-2", _),
|
|
1966
|
-
children: [/* @__PURE__ */
|
|
1988
|
+
children: [/* @__PURE__ */ V(Pt, {
|
|
1967
1989
|
message: e,
|
|
1968
1990
|
ariaLabel: u,
|
|
1969
1991
|
isStacked: !0,
|
|
1970
1992
|
hideActionBar: !0,
|
|
1971
|
-
pendingDropFiles:
|
|
1972
|
-
onDropFilesConsumed:
|
|
1973
|
-
onSend:
|
|
1993
|
+
pendingDropFiles: j,
|
|
1994
|
+
onDropFilesConsumed: I,
|
|
1995
|
+
onSend: N,
|
|
1974
1996
|
onUploadAttachment: a,
|
|
1975
|
-
onChange:
|
|
1976
|
-
onAttachmentsChange:
|
|
1997
|
+
onChange: se,
|
|
1998
|
+
onAttachmentsChange: le,
|
|
1977
1999
|
removeLabel: d,
|
|
1978
2000
|
retryLabel: f,
|
|
1979
2001
|
className: "max-w-full",
|
|
1980
|
-
prefixAttachments:
|
|
1981
|
-
onRemovePrefixAttachment:
|
|
2002
|
+
prefixAttachments: ue,
|
|
2003
|
+
onRemovePrefixAttachment: me,
|
|
1982
2004
|
validateAttachment: b,
|
|
1983
2005
|
isAttachmentsEnabled: x,
|
|
1984
2006
|
maximumAttachmentsAmount: w,
|
|
1985
2007
|
onAttachmentsLimitExceeded: T,
|
|
1986
|
-
pendingAttachments:
|
|
1987
|
-
onPendingAttachmentsConsumed:
|
|
1988
|
-
onAttachmentClick:
|
|
1989
|
-
|
|
2008
|
+
pendingAttachments: A,
|
|
2009
|
+
onPendingAttachmentsConsumed: ee,
|
|
2010
|
+
onAttachmentClick: te,
|
|
2011
|
+
pasteTextThreshold: ne,
|
|
2012
|
+
onMessageTooLong: re
|
|
2013
|
+
}), /* @__PURE__ */ H("div", {
|
|
1990
2014
|
className: "flex items-center justify-between",
|
|
1991
|
-
children: [/* @__PURE__ */
|
|
2015
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1992
2016
|
className: "flex",
|
|
1993
|
-
children: !S && /* @__PURE__ */
|
|
1994
|
-
ref:
|
|
2017
|
+
children: !S && /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("input", {
|
|
2018
|
+
ref: ie,
|
|
1995
2019
|
type: "file",
|
|
1996
2020
|
multiple: !0,
|
|
1997
2021
|
accept: C,
|
|
1998
2022
|
className: "sr-only",
|
|
1999
2023
|
"aria-hidden": !0,
|
|
2000
2024
|
tabIndex: -1,
|
|
2001
|
-
onChange:
|
|
2002
|
-
}), /* @__PURE__ */
|
|
2003
|
-
onAttachClick: () =>
|
|
2025
|
+
onChange: ge
|
|
2026
|
+
}), /* @__PURE__ */ V(Ke, {
|
|
2027
|
+
onAttachClick: () => ie.current?.click(),
|
|
2004
2028
|
attachLabel: m,
|
|
2005
2029
|
addMenuTitle: p,
|
|
2006
2030
|
menuTitle: h,
|
|
2007
2031
|
menuCloseLabel: g,
|
|
2008
|
-
extraMenuItems:
|
|
2032
|
+
extraMenuItems: _e
|
|
2009
2033
|
})] })
|
|
2010
|
-
}), /* @__PURE__ */
|
|
2034
|
+
}), /* @__PURE__ */ H("div", {
|
|
2011
2035
|
className: "flex gap-2",
|
|
2012
|
-
children: [/* @__PURE__ */
|
|
2036
|
+
children: [/* @__PURE__ */ V(D, {
|
|
2013
2037
|
label: s,
|
|
2014
2038
|
onClick: n
|
|
2015
|
-
}), /* @__PURE__ */
|
|
2039
|
+
}), /* @__PURE__ */ V(k, {
|
|
2016
2040
|
label: l,
|
|
2017
|
-
onClick:
|
|
2018
|
-
disabled: !
|
|
2041
|
+
onClick: he,
|
|
2042
|
+
disabled: !pe
|
|
2019
2043
|
})]
|
|
2020
2044
|
})]
|
|
2021
2045
|
})]
|
|
2022
2046
|
});
|
|
2023
2047
|
};
|
|
2024
2048
|
//#endregion
|
|
2025
|
-
export {
|
|
2049
|
+
export { ge as AttachmentCard, _e as AttachmentGroup, ve as AttachmentTray, U as BottomSheetShell, We as ChatSettingsModal, It as ConversationInput, Lt as EditMessageInput, be as FileDndOverlay, Pt as Input, Re as SendOnEnter, Ce as getAttachmentIcon };
|