@elevenlabs/convai-widget-core 0.5.0 → 0.5.2
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/dist/contexts/widget-config.d.ts +1 -1
- package/dist/index.js +1108 -1093
- package/dist/mocks/browser.d.ts +2 -2
- package/dist/types/config.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
var ra = Object.defineProperty;
|
|
2
2
|
var oa = (e, t, n) => t in e ? ra(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var ae = (e, t, n) => oa(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
4
|
import aa from "preact-custom-element";
|
|
5
|
-
import { jsx as u, jsxs as
|
|
5
|
+
import { jsx as u, jsxs as A, Fragment as rt } from "preact/jsx-runtime";
|
|
6
6
|
import * as h from "preact/compat";
|
|
7
|
-
import De, { useContext as ia, createContext as de, useMemo as Ae, useRef as
|
|
8
|
-
import { signal as he, computed as Ce, useSignal as
|
|
7
|
+
import De, { useContext as ia, createContext as de, useMemo as Ae, useRef as ee, useEffect as Ue, memo as vr, useState as Ie, useCallback as te, forwardRef as sa, useLayoutEffect as la } from "preact/compat";
|
|
8
|
+
import { signal as he, computed as Ce, useSignal as J, useComputed as Y, useSignalEffect as Ee } from "@preact/signals";
|
|
9
9
|
import { Conversation as ca, postOverallFeedback as Vn } from "@elevenlabs/client";
|
|
10
10
|
import { clsx as V } from "clsx";
|
|
11
|
-
import { jsx as
|
|
11
|
+
import { jsx as T, jsxs as Nt, Fragment as mn } from "preact/compat/jsx-runtime";
|
|
12
12
|
import { useMemo as ua, useCallback as Be } from "preact/hooks";
|
|
13
13
|
function Re(e) {
|
|
14
14
|
return e ? e === "true" ? !0 : e === "false" ? !1 : null : null;
|
|
@@ -56,7 +56,7 @@ const pa = [
|
|
|
56
56
|
function ha(e) {
|
|
57
57
|
return pa.includes(e) ? e : "bottom-right";
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const gr = {
|
|
60
60
|
main_label: "Need help?",
|
|
61
61
|
start_call: "Start a call",
|
|
62
62
|
start_chat: "Start a chat",
|
|
@@ -91,8 +91,8 @@ const mr = {
|
|
|
91
91
|
submit: "Submit",
|
|
92
92
|
go_back: "Go back"
|
|
93
93
|
}, va = Object.keys(
|
|
94
|
-
|
|
95
|
-
),
|
|
94
|
+
gr
|
|
95
|
+
), mr = {
|
|
96
96
|
base: "#ffffff",
|
|
97
97
|
base_hover: "#f9fafb",
|
|
98
98
|
base_active: "#f3f4f6",
|
|
@@ -113,10 +113,10 @@ const mr = {
|
|
|
113
113
|
sheet_radius: "calc(var(--el-button-radius) + 6px)",
|
|
114
114
|
compact_sheet_radius: "calc(var(--el-button-radius) + 12px)",
|
|
115
115
|
dropdown_sheet_radius: "calc(var(--el-input-radius) + 6px)"
|
|
116
|
-
},
|
|
117
|
-
|
|
116
|
+
}, ga = Object.keys(
|
|
117
|
+
mr
|
|
118
118
|
);
|
|
119
|
-
function
|
|
119
|
+
function ma(e = "us") {
|
|
120
120
|
switch (e) {
|
|
121
121
|
case "eu-residency":
|
|
122
122
|
case "in-residency":
|
|
@@ -155,15 +155,15 @@ function wa({
|
|
|
155
155
|
function ba() {
|
|
156
156
|
return fe(wr);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
158
|
+
function B(e) {
|
|
159
159
|
return ba()[e];
|
|
160
160
|
}
|
|
161
161
|
const br = de(null);
|
|
162
162
|
function xa({
|
|
163
163
|
children: e
|
|
164
164
|
}) {
|
|
165
|
-
const t =
|
|
166
|
-
const r = Ce(() =>
|
|
165
|
+
const t = B("server-location"), n = Ae(() => {
|
|
166
|
+
const r = Ce(() => ma(t.value)), o = {
|
|
167
167
|
us: "https://api.us.elevenlabs.io",
|
|
168
168
|
"eu-residency": "https://api.eu.residency.elevenlabs.io",
|
|
169
169
|
"in-residency": "https://api.in.residency.elevenlabs.io",
|
|
@@ -231,7 +231,7 @@ const xr = de(null);
|
|
|
231
231
|
function ya({
|
|
232
232
|
children: e
|
|
233
233
|
}) {
|
|
234
|
-
const t = q(), n =
|
|
234
|
+
const t = q(), n = B("language"), r = B("override-language"), o = J(
|
|
235
235
|
n.peek() ?? t.peek().language
|
|
236
236
|
), a = Y(
|
|
237
237
|
() => (t.value.supported_language_overrides ?? []).filter(
|
|
@@ -257,11 +257,11 @@ function ya({
|
|
|
257
257
|
function at() {
|
|
258
258
|
return fe(xr);
|
|
259
259
|
}
|
|
260
|
-
const Ca = "0.5.
|
|
260
|
+
const Ca = "0.5.2", yr = de(null);
|
|
261
261
|
function Sa({ children: e }) {
|
|
262
262
|
const t = q(), n = Y(
|
|
263
263
|
() => t.value.mic_muting_enabled ?? !1
|
|
264
|
-
), r =
|
|
264
|
+
), r = J(!1), o = Ae(
|
|
265
265
|
() => ({
|
|
266
266
|
isMuted: Ce(
|
|
267
267
|
() => n.value ? r.value : (
|
|
@@ -286,7 +286,7 @@ const Sr = de(null);
|
|
|
286
286
|
function ka({
|
|
287
287
|
children: e
|
|
288
288
|
}) {
|
|
289
|
-
const { language: t } = at(), n =
|
|
289
|
+
const { language: t } = at(), n = B("override-prompt"), r = B("override-first-message"), o = B("override-voice-id"), a = B("override-text-only"), i = B("user-id"), s = Y(() => ({
|
|
290
290
|
agent: {
|
|
291
291
|
prompt: {
|
|
292
292
|
prompt: n.value
|
|
@@ -300,31 +300,31 @@ function ka({
|
|
|
300
300
|
conversation: {
|
|
301
301
|
textOnly: Re(a.value) ?? void 0
|
|
302
302
|
}
|
|
303
|
-
})), l =
|
|
303
|
+
})), l = B("dynamic-variables"), c = Y(() => {
|
|
304
304
|
if (l.value)
|
|
305
305
|
try {
|
|
306
306
|
return JSON.parse(l.value);
|
|
307
|
-
} catch (
|
|
307
|
+
} catch (g) {
|
|
308
308
|
console.error(
|
|
309
|
-
`[ConversationalAI] Cannot parse dynamic-variables: ${
|
|
309
|
+
`[ConversationalAI] Cannot parse dynamic-variables: ${g == null ? void 0 : g.message}`
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
-
}), { webSocketUrl:
|
|
313
|
-
const
|
|
312
|
+
}), { webSocketUrl: d } = wn(), p = B("agent-id"), v = B("signed-url"), m = bn(), x = Ia(), f = Y(() => {
|
|
313
|
+
const g = x.value, w = {
|
|
314
314
|
dynamicVariables: c.value,
|
|
315
315
|
overrides: s.value,
|
|
316
316
|
connectionDelay: { default: 300 },
|
|
317
|
-
textOnly:
|
|
317
|
+
textOnly: m.value,
|
|
318
318
|
userId: i.value || void 0
|
|
319
319
|
};
|
|
320
|
-
return p.value ?
|
|
320
|
+
return p.value ? g ? {
|
|
321
321
|
agentId: p.value,
|
|
322
|
-
origin:
|
|
322
|
+
origin: d.value,
|
|
323
323
|
connectionType: "webrtc",
|
|
324
324
|
...w
|
|
325
325
|
} : {
|
|
326
326
|
agentId: p.value,
|
|
327
|
-
origin:
|
|
327
|
+
origin: d.value,
|
|
328
328
|
connectionType: "websocket",
|
|
329
329
|
...w
|
|
330
330
|
} : v.value ? {
|
|
@@ -335,10 +335,10 @@ function ka({
|
|
|
335
335
|
"[ConversationalAI] Either agent-id or signed-url is required"
|
|
336
336
|
), null);
|
|
337
337
|
});
|
|
338
|
-
return
|
|
338
|
+
return f.value ? /* @__PURE__ */ u(
|
|
339
339
|
Sr.Provider,
|
|
340
340
|
{
|
|
341
|
-
value:
|
|
341
|
+
value: f,
|
|
342
342
|
children: e
|
|
343
343
|
}
|
|
344
344
|
) : null;
|
|
@@ -362,11 +362,11 @@ function Ta({ children: e }) {
|
|
|
362
362
|
acceptTerms: () => {
|
|
363
363
|
i.value = !0, a.value = !1;
|
|
364
364
|
const c = t.peek().terms_key;
|
|
365
|
-
c && localStorage.setItem(c, "true"), l.forEach((
|
|
365
|
+
c && localStorage.setItem(c, "true"), l.forEach((d) => d.resolve()), l = [];
|
|
366
366
|
},
|
|
367
367
|
requestTerms: async () => {
|
|
368
|
-
s.peek() || (a.value = !0, await new Promise((c,
|
|
369
|
-
l.push({ resolve: c, reject:
|
|
368
|
+
s.peek() || (a.value = !0, await new Promise((c, d) => {
|
|
369
|
+
l.push({ resolve: c, reject: d });
|
|
370
370
|
}));
|
|
371
371
|
}
|
|
372
372
|
};
|
|
@@ -395,153 +395,153 @@ function Aa({ children: e }) {
|
|
|
395
395
|
}
|
|
396
396
|
}), /* @__PURE__ */ u(Er.Provider, { value: t, children: e });
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function oe() {
|
|
399
399
|
return fe(Er);
|
|
400
400
|
}
|
|
401
401
|
function _a() {
|
|
402
|
-
const e =
|
|
403
|
-
Ar();
|
|
404
|
-
const i = Bt(), s = Ea(), { isMuted: l } = Cr();
|
|
402
|
+
const e = ee(null), t = ee(null), n = ee(!1), r = ee(null), o = ee(!1), a = q(), i = Ar(), s = Bt(), l = Ea(), { isMuted: c } = Cr();
|
|
405
403
|
return Ee(() => {
|
|
406
|
-
var
|
|
407
|
-
const
|
|
408
|
-
(
|
|
404
|
+
var p;
|
|
405
|
+
const d = c.value;
|
|
406
|
+
(p = e == null ? void 0 : e.current) == null || p.setMicMuted(d);
|
|
409
407
|
}), Ue(() => () => {
|
|
410
|
-
var
|
|
411
|
-
(
|
|
408
|
+
var d;
|
|
409
|
+
(d = e.current) == null || d.endSession();
|
|
412
410
|
}, []), Ae(() => {
|
|
413
|
-
const
|
|
411
|
+
const d = he("disconnected"), p = Ce(() => d.value === "disconnected"), v = he("listening"), m = Ce(() => v.value === "speaking"), x = he(null), f = he(null), g = he(!1), w = he([]), b = he(0), y = he(null);
|
|
414
412
|
return {
|
|
415
|
-
status:
|
|
416
|
-
isSpeaking:
|
|
417
|
-
mode:
|
|
418
|
-
isDisconnected:
|
|
419
|
-
lastId:
|
|
420
|
-
error:
|
|
421
|
-
canSendFeedback:
|
|
422
|
-
conversationIndex:
|
|
413
|
+
status: d,
|
|
414
|
+
isSpeaking: m,
|
|
415
|
+
mode: v,
|
|
416
|
+
isDisconnected: p,
|
|
417
|
+
lastId: f,
|
|
418
|
+
error: x,
|
|
419
|
+
canSendFeedback: g,
|
|
420
|
+
conversationIndex: b,
|
|
423
421
|
conversationTextOnly: y,
|
|
424
|
-
transcript:
|
|
425
|
-
startSession: async (
|
|
426
|
-
var
|
|
427
|
-
if (await
|
|
422
|
+
transcript: w,
|
|
423
|
+
startSession: async (C, S) => {
|
|
424
|
+
var k, I, D, L, $, W, F;
|
|
425
|
+
if (await s.requestTerms(), (k = e.current) != null && k.isOpen())
|
|
428
426
|
return e.current.getId();
|
|
429
427
|
if (t.current)
|
|
430
428
|
return (await t.current).getId();
|
|
431
|
-
let
|
|
432
|
-
|
|
429
|
+
let E = structuredClone(l.peek());
|
|
430
|
+
S && a.value.supports_text_only && (E.textOnly = !0, a.value.text_only || (E.overrides ?? (E.overrides = {}), (I = E.overrides).conversation ?? (I.conversation = {}), E.overrides.conversation.textOnly = !0));
|
|
433
431
|
try {
|
|
434
|
-
|
|
432
|
+
E = Pa(C, E);
|
|
435
433
|
} catch (N) {
|
|
436
434
|
console.error(
|
|
437
435
|
"[ConversationalAI] Error triggering call event:",
|
|
438
436
|
N
|
|
439
437
|
);
|
|
440
438
|
}
|
|
441
|
-
y.value =
|
|
439
|
+
y.value = E.textOnly ?? !1, w.value = S ? [
|
|
442
440
|
{
|
|
443
441
|
type: "message",
|
|
444
442
|
role: "user",
|
|
445
|
-
message:
|
|
443
|
+
message: S,
|
|
446
444
|
isText: !0,
|
|
447
|
-
conversationIndex:
|
|
445
|
+
conversationIndex: b.peek()
|
|
448
446
|
}
|
|
449
447
|
] : [];
|
|
450
448
|
try {
|
|
451
449
|
if (t.current = ca.startSession({
|
|
452
|
-
...
|
|
450
|
+
...E,
|
|
453
451
|
overrides: {
|
|
454
|
-
...
|
|
452
|
+
...E.overrides,
|
|
455
453
|
client: {
|
|
456
|
-
...(
|
|
457
|
-
source: ((
|
|
458
|
-
version: ((
|
|
454
|
+
...(D = E.overrides) == null ? void 0 : D.client,
|
|
455
|
+
source: (($ = (L = E.overrides) == null ? void 0 : L.client) == null ? void 0 : $.source) || "widget",
|
|
456
|
+
version: ((F = (W = E.overrides) == null ? void 0 : W.client) == null ? void 0 : F.version) || Ca
|
|
459
457
|
}
|
|
460
458
|
},
|
|
461
|
-
onModeChange: (
|
|
462
|
-
|
|
459
|
+
onModeChange: (_) => {
|
|
460
|
+
v.value = _.mode;
|
|
463
461
|
},
|
|
464
|
-
onStatusChange: (
|
|
465
|
-
|
|
462
|
+
onStatusChange: (_) => {
|
|
463
|
+
d.value = _.status;
|
|
466
464
|
},
|
|
467
|
-
onCanSendFeedbackChange: (
|
|
468
|
-
|
|
465
|
+
onCanSendFeedbackChange: (_) => {
|
|
466
|
+
g.value = _.canSendFeedback;
|
|
469
467
|
},
|
|
470
|
-
onMessage: ({ source:
|
|
471
|
-
if (y.peek() === !0 &&
|
|
468
|
+
onMessage: ({ source: _, message: O }) => {
|
|
469
|
+
if (i.peek() && y.peek() === !0 && _ === "ai" && !n.current) {
|
|
472
470
|
n.current = !0;
|
|
473
471
|
return;
|
|
474
|
-
} else
|
|
475
|
-
if (
|
|
472
|
+
} else _ === "ai" && (n.current = !0);
|
|
473
|
+
if (_ === "ai" && o.current) {
|
|
476
474
|
o.current = !1;
|
|
477
475
|
return;
|
|
478
476
|
}
|
|
479
|
-
|
|
480
|
-
...
|
|
477
|
+
w.value = [
|
|
478
|
+
...w.value,
|
|
481
479
|
{
|
|
482
480
|
type: "message",
|
|
483
|
-
role:
|
|
484
|
-
message:
|
|
481
|
+
role: _,
|
|
482
|
+
message: O,
|
|
485
483
|
isText: !1,
|
|
486
|
-
conversationIndex:
|
|
484
|
+
conversationIndex: b.peek()
|
|
487
485
|
}
|
|
488
486
|
];
|
|
489
487
|
},
|
|
490
|
-
onAgentChatResponsePart: ({ text:
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
488
|
+
onAgentChatResponsePart: ({ text: _, type: O }) => {
|
|
489
|
+
if (i.peek() && y.peek() === !0 && !n.current)
|
|
490
|
+
return;
|
|
491
|
+
const M = w.peek();
|
|
492
|
+
if (O === "start")
|
|
493
|
+
o.current = !0, r.current = M.length, w.value = [
|
|
494
|
+
...M,
|
|
495
495
|
{
|
|
496
496
|
type: "message",
|
|
497
497
|
role: "ai",
|
|
498
498
|
message: "",
|
|
499
499
|
isText: !0,
|
|
500
|
-
conversationIndex:
|
|
500
|
+
conversationIndex: b.peek()
|
|
501
501
|
}
|
|
502
502
|
];
|
|
503
|
-
else if (
|
|
504
|
-
const
|
|
505
|
-
if (
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
...
|
|
509
|
-
message:
|
|
510
|
-
},
|
|
503
|
+
else if (O === "delta") {
|
|
504
|
+
const P = r.current;
|
|
505
|
+
if (P !== null && M[P]) {
|
|
506
|
+
const z = [...M], Q = z[P];
|
|
507
|
+
Q.type === "message" && (z[P] = {
|
|
508
|
+
...Q,
|
|
509
|
+
message: Q.message + _
|
|
510
|
+
}, w.value = z);
|
|
511
511
|
}
|
|
512
|
-
} else
|
|
512
|
+
} else O === "stop" && (r.current = null);
|
|
513
513
|
},
|
|
514
|
-
onDisconnect: (
|
|
515
|
-
n.current = !1, y.value = null, r.current = null, o.current = !1,
|
|
516
|
-
...
|
|
517
|
-
|
|
514
|
+
onDisconnect: (_) => {
|
|
515
|
+
n.current = !1, y.value = null, r.current = null, o.current = !1, w.value = [
|
|
516
|
+
...w.value,
|
|
517
|
+
_.reason === "error" ? {
|
|
518
518
|
type: "error",
|
|
519
|
-
message:
|
|
520
|
-
conversationIndex:
|
|
519
|
+
message: _.message,
|
|
520
|
+
conversationIndex: b.peek()
|
|
521
521
|
} : {
|
|
522
522
|
type: "disconnection",
|
|
523
|
-
role:
|
|
524
|
-
conversationIndex:
|
|
523
|
+
role: _.reason === "user" ? "user" : "ai",
|
|
524
|
+
conversationIndex: b.peek()
|
|
525
525
|
}
|
|
526
|
-
],
|
|
526
|
+
], b.value++, _.reason === "error" && (x.value = _.message, console.error(
|
|
527
527
|
"[ConversationalAI] Disconnected due to an error:",
|
|
528
|
-
|
|
528
|
+
_.message
|
|
529
529
|
));
|
|
530
530
|
}
|
|
531
|
-
}), e.current = await t.current, e.current.setMicMuted(
|
|
532
|
-
const
|
|
533
|
-
setTimeout(() =>
|
|
531
|
+
}), e.current = await t.current, e.current.setMicMuted(c.peek()), S) {
|
|
532
|
+
const _ = e.current;
|
|
533
|
+
setTimeout(() => _.sendUserMessage(S), 100);
|
|
534
534
|
}
|
|
535
535
|
const N = e.current.getId();
|
|
536
|
-
return
|
|
536
|
+
return f.value = N, x.value = null, N;
|
|
537
537
|
} catch (N) {
|
|
538
|
-
let
|
|
539
|
-
N instanceof CloseEvent ?
|
|
540
|
-
...
|
|
538
|
+
let _ = "Could not start a conversation.";
|
|
539
|
+
N instanceof CloseEvent ? _ = N.reason || _ : N instanceof Error && (_ = N.message || _), x.value = _, w.value = [
|
|
540
|
+
...w.value,
|
|
541
541
|
{
|
|
542
542
|
type: "error",
|
|
543
|
-
message:
|
|
544
|
-
conversationIndex:
|
|
543
|
+
message: _,
|
|
544
|
+
conversationIndex: b.peek()
|
|
545
545
|
}
|
|
546
546
|
];
|
|
547
547
|
} finally {
|
|
@@ -549,40 +549,40 @@ function _a() {
|
|
|
549
549
|
}
|
|
550
550
|
},
|
|
551
551
|
endSession: async () => {
|
|
552
|
-
const
|
|
553
|
-
e.current = null, await (
|
|
552
|
+
const C = e.current;
|
|
553
|
+
e.current = null, await (C == null ? void 0 : C.endSession());
|
|
554
554
|
},
|
|
555
555
|
getInputVolume: () => {
|
|
556
|
-
var
|
|
557
|
-
return ((
|
|
556
|
+
var C;
|
|
557
|
+
return ((C = e.current) == null ? void 0 : C.getInputVolume()) ?? 0;
|
|
558
558
|
},
|
|
559
559
|
getOutputVolume: () => {
|
|
560
|
-
var x;
|
|
561
|
-
return ((x = e.current) == null ? void 0 : x.getOutputVolume()) ?? 0;
|
|
562
|
-
},
|
|
563
|
-
sendFeedback: (x) => {
|
|
564
560
|
var C;
|
|
565
|
-
(C = e.current) == null
|
|
561
|
+
return ((C = e.current) == null ? void 0 : C.getOutputVolume()) ?? 0;
|
|
566
562
|
},
|
|
567
|
-
|
|
568
|
-
var
|
|
569
|
-
(
|
|
570
|
-
|
|
563
|
+
sendFeedback: (C) => {
|
|
564
|
+
var S;
|
|
565
|
+
(S = e.current) == null || S.sendFeedback(C);
|
|
566
|
+
},
|
|
567
|
+
sendUserMessage: (C) => {
|
|
568
|
+
var S;
|
|
569
|
+
(S = e.current) == null || S.sendUserMessage(C), w.value = [
|
|
570
|
+
...w.value,
|
|
571
571
|
{
|
|
572
572
|
type: "message",
|
|
573
573
|
role: "user",
|
|
574
|
-
message:
|
|
574
|
+
message: C,
|
|
575
575
|
isText: !0,
|
|
576
|
-
conversationIndex:
|
|
576
|
+
conversationIndex: b.peek()
|
|
577
577
|
}
|
|
578
578
|
];
|
|
579
579
|
},
|
|
580
580
|
sendUserActivity: () => {
|
|
581
|
-
var
|
|
582
|
-
(
|
|
581
|
+
var C;
|
|
582
|
+
(C = e.current) == null || C.sendUserActivity();
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
|
-
}, [
|
|
585
|
+
}, [l, c]);
|
|
586
586
|
}
|
|
587
587
|
function Pa(e, t) {
|
|
588
588
|
try {
|
|
@@ -600,7 +600,7 @@ const Tr = de(
|
|
|
600
600
|
null
|
|
601
601
|
);
|
|
602
602
|
function Ra({ children: e }) {
|
|
603
|
-
const { serverUrl: t } = wn(), n =
|
|
603
|
+
const { serverUrl: t } = wn(), n = B("agent-id"), r = B("override-config"), o = B("signed-url"), a = J(null);
|
|
604
604
|
Ee(() => {
|
|
605
605
|
if (r.value)
|
|
606
606
|
try {
|
|
@@ -614,65 +614,65 @@ function Ra({ children: e }) {
|
|
|
614
614
|
`[ConversationalAI] Cannot parse override-config: ${C == null ? void 0 : C.message}`
|
|
615
615
|
);
|
|
616
616
|
}
|
|
617
|
-
let w = n.value,
|
|
617
|
+
let w = n.value, b;
|
|
618
618
|
if (o.value) {
|
|
619
619
|
const C = new URL(o.value).searchParams;
|
|
620
|
-
w = C.get("agent_id") ?? n.value,
|
|
620
|
+
w = C.get("agent_id") ?? n.value, b = C.get("conversation_signature") ?? void 0;
|
|
621
621
|
}
|
|
622
622
|
if (!w) {
|
|
623
623
|
a.value = null;
|
|
624
624
|
return;
|
|
625
625
|
}
|
|
626
|
-
const
|
|
626
|
+
const y = new AbortController();
|
|
627
627
|
return Oa(
|
|
628
628
|
w,
|
|
629
629
|
t.value,
|
|
630
|
-
|
|
631
|
-
|
|
630
|
+
y.signal,
|
|
631
|
+
b
|
|
632
632
|
).then((C) => {
|
|
633
|
-
|
|
633
|
+
y.signal.aborted || (a.value = C);
|
|
634
634
|
}).catch((C) => {
|
|
635
635
|
console.error(
|
|
636
636
|
`[ConversationalAI] Cannot fetch config for agent ${n.value}: ${C == null ? void 0 : C.message}`
|
|
637
|
-
),
|
|
637
|
+
), y.signal.aborted || (a.value = null);
|
|
638
638
|
}), () => {
|
|
639
|
-
|
|
639
|
+
y.abort();
|
|
640
640
|
};
|
|
641
641
|
});
|
|
642
|
-
const i =
|
|
642
|
+
const i = B("variant"), s = B("placement"), l = B("terms-key"), c = B("mic-muting"), d = B("transcript"), p = B("text-input"), v = B("default-expanded"), m = B("always-expanded"), x = B("override-text-only"), f = B("use-rtc"), g = Y(() => {
|
|
643
643
|
if (!a.value)
|
|
644
644
|
return null;
|
|
645
|
-
const w = i.value ?? a.value.variant,
|
|
645
|
+
const w = i.value ?? a.value.variant, b = s.value ?? a.value.placement, y = l.value ?? a.value.terms_key, C = Re(x.value) ?? a.value.text_only ?? !1, S = Re(c.value) ?? a.value.mic_muting_enabled, E = Re(d.value) ?? a.value.transcript_enabled, k = Re(p.value) ?? a.value.text_input_enabled, I = Re(m.value) ?? a.value.always_expanded ?? !1, D = Re(v.value) ?? a.value.default_expanded ?? !1, L = Re(f.value) ?? a.value.use_rtc ?? !1;
|
|
646
646
|
return {
|
|
647
647
|
...a.value,
|
|
648
648
|
variant: fa(w),
|
|
649
|
-
placement: ha(
|
|
650
|
-
terms_key:
|
|
649
|
+
placement: ha(b),
|
|
650
|
+
terms_key: y,
|
|
651
651
|
mic_muting_enabled: !C && S,
|
|
652
|
-
transcript_enabled: C ||
|
|
652
|
+
transcript_enabled: C || E,
|
|
653
653
|
text_input_enabled: C || k,
|
|
654
654
|
always_expanded: I,
|
|
655
655
|
default_expanded: D,
|
|
656
656
|
use_rtc: L
|
|
657
657
|
};
|
|
658
658
|
});
|
|
659
|
-
return
|
|
659
|
+
return g.value ? /* @__PURE__ */ u(Tr.Provider, { value: g, children: e }) : null;
|
|
660
660
|
}
|
|
661
661
|
function q() {
|
|
662
662
|
return fe(Tr);
|
|
663
663
|
}
|
|
664
664
|
function bn() {
|
|
665
|
-
const e =
|
|
665
|
+
const e = B("override-text-only"), t = q();
|
|
666
666
|
return Y(
|
|
667
667
|
() => Re(e.value) ?? t.value.text_only ?? !1
|
|
668
668
|
);
|
|
669
669
|
}
|
|
670
670
|
function zt() {
|
|
671
|
-
const e = bn(), { conversationTextOnly: t } =
|
|
671
|
+
const e = bn(), { conversationTextOnly: t } = oe();
|
|
672
672
|
return Y(() => t.value ?? e.value);
|
|
673
673
|
}
|
|
674
674
|
function Ar() {
|
|
675
|
-
const e =
|
|
675
|
+
const e = B("override-first-message"), t = q(), { language: n } = at();
|
|
676
676
|
return Y(
|
|
677
677
|
() => {
|
|
678
678
|
var r, o;
|
|
@@ -686,7 +686,10 @@ function Ia() {
|
|
|
686
686
|
}
|
|
687
687
|
function Na() {
|
|
688
688
|
const e = q();
|
|
689
|
-
return Y(() =>
|
|
689
|
+
return Y(() => {
|
|
690
|
+
var t;
|
|
691
|
+
return ((t = e.value.end_feedback) == null ? void 0 : t.type) ?? null;
|
|
692
|
+
});
|
|
690
693
|
}
|
|
691
694
|
async function Oa(e, t, n, r) {
|
|
692
695
|
const a = await (await fetch(
|
|
@@ -703,13 +706,13 @@ const La = vr(function() {
|
|
|
703
706
|
const t = q(), n = Y(() => {
|
|
704
707
|
const r = t.value.styles;
|
|
705
708
|
return `:host, :root {
|
|
706
|
-
${
|
|
707
|
-
(o) => `${Ma(o)}: ${Da((r == null ? void 0 : r[o]) ??
|
|
709
|
+
${ga.map(
|
|
710
|
+
(o) => `${Ma(o)}: ${Da((r == null ? void 0 : r[o]) ?? mr[o])};`
|
|
708
711
|
).join(`
|
|
709
712
|
`)}
|
|
710
713
|
}`;
|
|
711
714
|
});
|
|
712
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ A("style", { children: [
|
|
713
716
|
n,
|
|
714
717
|
da
|
|
715
718
|
] });
|
|
@@ -722,7 +725,7 @@ function Da(e) {
|
|
|
722
725
|
}
|
|
723
726
|
const _r = de(null);
|
|
724
727
|
function Fa({ children: e }) {
|
|
725
|
-
const t = q(), { language: n } = at(), r =
|
|
728
|
+
const t = q(), { language: n } = at(), r = B("text-contents"), o = Y(() => {
|
|
726
729
|
try {
|
|
727
730
|
if (r.value) {
|
|
728
731
|
const i = JSON.parse(r.value);
|
|
@@ -738,8 +741,8 @@ function Fa({ children: e }) {
|
|
|
738
741
|
i,
|
|
739
742
|
Ce(
|
|
740
743
|
() => {
|
|
741
|
-
var s, l, c,
|
|
742
|
-
return o.value[i] ?? ((c = (l = (s = t.value.language_presets) == null ? void 0 : s[n.value.languageCode]) == null ? void 0 : l.text_contents) == null ? void 0 : c[i]) ?? ((
|
|
744
|
+
var s, l, c, d;
|
|
745
|
+
return o.value[i] ?? ((c = (l = (s = t.value.language_presets) == null ? void 0 : s[n.value.languageCode]) == null ? void 0 : l.text_contents) == null ? void 0 : c[i]) ?? ((d = t.value.text_contents) == null ? void 0 : d[i]) ?? gr[i];
|
|
743
746
|
}
|
|
744
747
|
)
|
|
745
748
|
])
|
|
@@ -751,7 +754,7 @@ function G() {
|
|
|
751
754
|
}
|
|
752
755
|
const Pr = de(null);
|
|
753
756
|
function Ba({ children: e }) {
|
|
754
|
-
const t = q(), n =
|
|
757
|
+
const t = q(), n = B("avatar-image-url"), r = B("avatar-orb-color-1"), o = B("avatar-orb-color-2"), a = J(""), i = Y(() => n.value ? {
|
|
755
758
|
type: "image",
|
|
756
759
|
url: n.value
|
|
757
760
|
} : r.value && o.value ? {
|
|
@@ -785,7 +788,7 @@ function yn(e) {
|
|
|
785
788
|
return e && typeof e == "object" && "peek" in e;
|
|
786
789
|
}
|
|
787
790
|
function Va(e) {
|
|
788
|
-
const t = yn(e), n =
|
|
791
|
+
const t = yn(e), n = J(t ? e.peek() : e);
|
|
789
792
|
return t ? e : (n.value = e, n);
|
|
790
793
|
}
|
|
791
794
|
function Ir(e) {
|
|
@@ -815,22 +818,22 @@ function Nr(...e) {
|
|
|
815
818
|
};
|
|
816
819
|
};
|
|
817
820
|
}
|
|
818
|
-
function
|
|
821
|
+
function ne(...e) {
|
|
819
822
|
return h.useCallback(Nr(...e), e);
|
|
820
823
|
}
|
|
821
824
|
// @__NO_SIDE_EFFECTS__
|
|
822
|
-
function
|
|
825
|
+
function mt(e) {
|
|
823
826
|
const t = /* @__PURE__ */ Wa(e), n = h.forwardRef((r, o) => {
|
|
824
827
|
const { children: a, ...i } = r, s = h.Children.toArray(a), l = s.find(Ua);
|
|
825
828
|
if (l) {
|
|
826
|
-
const c = l.props.children,
|
|
827
|
-
return /* @__PURE__ */
|
|
829
|
+
const c = l.props.children, d = s.map((p) => p === l ? h.Children.count(c) > 1 ? h.Children.only(null) : h.isValidElement(c) ? c.props.children : null : p);
|
|
830
|
+
return /* @__PURE__ */ T(t, { ...i, ref: o, children: h.isValidElement(c) ? h.cloneElement(c, void 0, d) : null });
|
|
828
831
|
}
|
|
829
|
-
return /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ T(t, { ...i, ref: o, children: a });
|
|
830
833
|
});
|
|
831
834
|
return n.displayName = `${e}.Slot`, n;
|
|
832
835
|
}
|
|
833
|
-
var Or = /* @__PURE__ */
|
|
836
|
+
var Or = /* @__PURE__ */ mt("Slot");
|
|
834
837
|
// @__NO_SIDE_EFFECTS__
|
|
835
838
|
function Wa(e) {
|
|
836
839
|
const t = h.forwardRef((n, r) => {
|
|
@@ -865,7 +868,7 @@ function Ya(e) {
|
|
|
865
868
|
}
|
|
866
869
|
const Xt = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
867
870
|
function Lr() {
|
|
868
|
-
const e =
|
|
871
|
+
const e = J(Xt.matches);
|
|
869
872
|
return Ue(() => {
|
|
870
873
|
const t = (n) => {
|
|
871
874
|
e.value = n.matches;
|
|
@@ -874,21 +877,21 @@ function Lr() {
|
|
|
874
877
|
}, []), e;
|
|
875
878
|
}
|
|
876
879
|
function Mr({ onStart: e, onEnd: t }) {
|
|
877
|
-
const n =
|
|
880
|
+
const n = ee();
|
|
878
881
|
n.current ?? (n.current = /* @__PURE__ */ new Set());
|
|
879
|
-
const r =
|
|
882
|
+
const r = ee(e);
|
|
880
883
|
r.current = e;
|
|
881
|
-
const o =
|
|
884
|
+
const o = ee(t);
|
|
882
885
|
o.current = t;
|
|
883
|
-
const a =
|
|
886
|
+
const a = J(!1), i = te(
|
|
884
887
|
(l) => {
|
|
885
|
-
var c,
|
|
886
|
-
l.target === l.currentTarget && ((c = n.current) == null || c.add(l.propertyName), a.peek() || (a.value = !0, (
|
|
888
|
+
var c, d;
|
|
889
|
+
l.target === l.currentTarget && ((c = n.current) == null || c.add(l.propertyName), a.peek() || (a.value = !0, (d = r.current) == null || d.call(r)));
|
|
887
890
|
},
|
|
888
891
|
[]
|
|
889
|
-
), s =
|
|
890
|
-
var c,
|
|
891
|
-
l.target === l.currentTarget && ((c = n.current) == null || c.delete(l.propertyName), (
|
|
892
|
+
), s = te((l) => {
|
|
893
|
+
var c, d, p;
|
|
894
|
+
l.target === l.currentTarget && ((c = n.current) == null || c.delete(l.propertyName), (d = n.current) != null && d.size || (a.value = !1, (p = o.current) == null || p.call(o)));
|
|
892
895
|
}, []);
|
|
893
896
|
return {
|
|
894
897
|
transitioning: a,
|
|
@@ -898,7 +901,7 @@ function Mr({ onStart: e, onEnd: t }) {
|
|
|
898
901
|
}
|
|
899
902
|
};
|
|
900
903
|
}
|
|
901
|
-
function
|
|
904
|
+
function ie(e) {
|
|
902
905
|
const t = Lr().value ? Ka : Xa;
|
|
903
906
|
return /* @__PURE__ */ u(t, { ...e });
|
|
904
907
|
}
|
|
@@ -910,7 +913,7 @@ function Xa({
|
|
|
910
913
|
initial: t = e,
|
|
911
914
|
...n
|
|
912
915
|
}) {
|
|
913
|
-
const r = Va(e), o =
|
|
916
|
+
const r = Va(e), o = J($a(t));
|
|
914
917
|
Ee(() => {
|
|
915
918
|
r.value && (o.value = r.value);
|
|
916
919
|
});
|
|
@@ -1107,17 +1110,17 @@ void main() {
|
|
|
1107
1110
|
-1
|
|
1108
1111
|
]), Qa = "https://storage.googleapis.com/eleven-public-cdn/images/perlin-noise.png", be = class be {
|
|
1109
1112
|
constructor(t) {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1113
|
+
ae(this, "gl");
|
|
1114
|
+
ae(this, "program");
|
|
1115
|
+
ae(this, "startTime");
|
|
1116
|
+
ae(this, "targetSpeed", 0);
|
|
1117
|
+
ae(this, "speed", 0.5);
|
|
1118
|
+
ae(this, "rafId", null);
|
|
1119
|
+
ae(this, "resizeObserver");
|
|
1120
|
+
ae(this, "colorA", [0, 0, 0]);
|
|
1121
|
+
ae(this, "colorB", [0, 0, 0]);
|
|
1122
|
+
ae(this, "offsets", new Float32Array(7).map(() => Math.random() * Math.PI * 2));
|
|
1123
|
+
ae(this, "copyNoiseImage", () => {
|
|
1121
1124
|
this.gl && (this.gl.texImage2D(
|
|
1122
1125
|
this.gl.TEXTURE_2D,
|
|
1123
1126
|
0,
|
|
@@ -1127,8 +1130,8 @@ void main() {
|
|
|
1127
1130
|
be.noiseImage
|
|
1128
1131
|
), this.gl.generateMipmap(this.gl.TEXTURE_2D));
|
|
1129
1132
|
});
|
|
1130
|
-
|
|
1131
|
-
|
|
1133
|
+
ae(this, "toDataURL", () => this.gl.canvas.toDataURL("image/png"));
|
|
1134
|
+
ae(this, "render", () => {
|
|
1132
1135
|
if (!this.gl) {
|
|
1133
1136
|
this.rafId = null;
|
|
1134
1137
|
return;
|
|
@@ -1221,32 +1224,32 @@ void main() {
|
|
|
1221
1224
|
return this.gl.shaderSource(r, n), this.gl.compileShader(r), this.gl.getShaderParameter(r, this.gl.COMPILE_STATUS) ? r : (this.gl.deleteShader(r), null);
|
|
1222
1225
|
}
|
|
1223
1226
|
};
|
|
1224
|
-
|
|
1227
|
+
ae(be, "noiseImage");
|
|
1225
1228
|
let an = be;
|
|
1226
1229
|
const Ja = {
|
|
1227
1230
|
sm: "w-9 h-9",
|
|
1228
1231
|
lg: "w-48 h-48"
|
|
1229
1232
|
};
|
|
1230
1233
|
function it({ size: e = "sm", className: t }) {
|
|
1231
|
-
const { getInputVolume: n, getOutputVolume: r, isSpeaking: o, isDisconnected: a } =
|
|
1234
|
+
const { getInputVolume: n, getOutputVolume: r, isSpeaking: o, isDisconnected: a } = oe(), { config: i } = xn(), s = ee(null), l = ee(null);
|
|
1232
1235
|
Ee(() => {
|
|
1233
1236
|
if (a.value) {
|
|
1234
1237
|
s.current.style.transform = "", l.current.style.transform = "";
|
|
1235
1238
|
return;
|
|
1236
1239
|
}
|
|
1237
|
-
let
|
|
1240
|
+
let d;
|
|
1238
1241
|
function p() {
|
|
1239
|
-
const v = n(),
|
|
1240
|
-
s.current.style.transform = `scale(${
|
|
1242
|
+
const v = n(), m = r(), x = o.peek() ? 1 : 1 - v * 0.4, f = o.peek() ? 1 + m * 0.4 : 1;
|
|
1243
|
+
s.current.style.transform = `scale(${f})`, l.current.style.transform = `scale(${x})`, d = requestAnimationFrame(p);
|
|
1241
1244
|
}
|
|
1242
1245
|
return p(), () => {
|
|
1243
|
-
cancelAnimationFrame(
|
|
1246
|
+
cancelAnimationFrame(d);
|
|
1244
1247
|
};
|
|
1245
1248
|
});
|
|
1246
1249
|
const c = Y(() => ({
|
|
1247
1250
|
backgroundImage: i.value.type === "image" ? `url(${i.value.url})` : i.value.type === "url" ? `url(${i.value.custom_url})` : void 0
|
|
1248
1251
|
}));
|
|
1249
|
-
return /* @__PURE__ */
|
|
1252
|
+
return /* @__PURE__ */ A("div", { className: V("relative shrink-0", Ja[e], t), children: [
|
|
1250
1253
|
/* @__PURE__ */ u(
|
|
1251
1254
|
"div",
|
|
1252
1255
|
{
|
|
@@ -1276,7 +1279,7 @@ function ei({ color1: e, color2: t }) {
|
|
|
1276
1279
|
Ue(() => {
|
|
1277
1280
|
r && (r.updateColors(e, t), r.render(), n.value = r.toDataURL());
|
|
1278
1281
|
}, [r, e, t]);
|
|
1279
|
-
const a =
|
|
1282
|
+
const a = te(
|
|
1280
1283
|
(i) => {
|
|
1281
1284
|
if (i) {
|
|
1282
1285
|
const s = new an(i);
|
|
@@ -1331,7 +1334,7 @@ function ri(e) {
|
|
|
1331
1334
|
);
|
|
1332
1335
|
}
|
|
1333
1336
|
function oi(e) {
|
|
1334
|
-
return /* @__PURE__ */
|
|
1337
|
+
return /* @__PURE__ */ A(
|
|
1335
1338
|
"svg",
|
|
1336
1339
|
{
|
|
1337
1340
|
height: "1em",
|
|
@@ -1369,7 +1372,7 @@ function ai(e) {
|
|
|
1369
1372
|
);
|
|
1370
1373
|
}
|
|
1371
1374
|
function ii(e) {
|
|
1372
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ A(
|
|
1373
1376
|
"svg",
|
|
1374
1377
|
{
|
|
1375
1378
|
height: "1em",
|
|
@@ -1386,7 +1389,7 @@ function ii(e) {
|
|
|
1386
1389
|
);
|
|
1387
1390
|
}
|
|
1388
1391
|
function si(e) {
|
|
1389
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ A(
|
|
1390
1393
|
"svg",
|
|
1391
1394
|
{
|
|
1392
1395
|
height: "1em",
|
|
@@ -1466,13 +1469,7 @@ function di(e) {
|
|
|
1466
1469
|
viewBox: "0 0 20 20",
|
|
1467
1470
|
fill: "currentColor",
|
|
1468
1471
|
...e,
|
|
1469
|
-
children: /* @__PURE__ */ u(
|
|
1470
|
-
"path",
|
|
1471
|
-
{
|
|
1472
|
-
d: "M2.59413 5.1485C2.04 3.39377 3.86657 1.83482 5.51245 2.65776L16.47 8.13653C18.0055 8.90429 18.0055 11.0955 16.47 11.8633L5.51245 17.3421C3.86656 18.165 2.04 16.6061 2.59413 14.8513L3.86297 10.8333H7.50006C7.9603 10.8333 8.33339 10.4602 8.33339 10C8.33339 9.53976 7.9603 9.16667 7.50006 9.16667H3.86302L2.59413 5.1485Z",
|
|
1473
|
-
fill: "black"
|
|
1474
|
-
}
|
|
1475
|
-
)
|
|
1472
|
+
children: /* @__PURE__ */ u("path", { d: "M2.59413 5.1485C2.04 3.39377 3.86657 1.83482 5.51245 2.65776L16.47 8.13653C18.0055 8.90429 18.0055 11.0955 16.47 11.8633L5.51245 17.3421C3.86656 18.165 2.04 16.6061 2.59413 14.8513L3.86297 10.8333H7.50006C7.9603 10.8333 8.33339 10.4602 8.33339 10C8.33339 9.53976 7.9603 9.16667 7.50006 9.16667H3.86302L2.59413 5.1485Z" })
|
|
1476
1473
|
}
|
|
1477
1474
|
);
|
|
1478
1475
|
}
|
|
@@ -1496,125 +1493,143 @@ function pi({
|
|
|
1496
1493
|
starColor: n,
|
|
1497
1494
|
className: r
|
|
1498
1495
|
}) {
|
|
1499
|
-
return /* @__PURE__ */ u(
|
|
1500
|
-
"
|
|
1496
|
+
return /* @__PURE__ */ u(
|
|
1497
|
+
"slot",
|
|
1501
1498
|
{
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
"
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1499
|
+
name: "icon-feedback",
|
|
1500
|
+
className: V("flex", r),
|
|
1501
|
+
"aria-hidden": !0,
|
|
1502
|
+
children: /* @__PURE__ */ A(
|
|
1503
|
+
"svg",
|
|
1504
|
+
{
|
|
1505
|
+
width: "100%",
|
|
1506
|
+
height: "100%",
|
|
1507
|
+
viewBox: "0 0 82 88",
|
|
1508
|
+
fill: "none",
|
|
1509
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1510
|
+
children: [
|
|
1511
|
+
/* @__PURE__ */ u(
|
|
1512
|
+
"path",
|
|
1513
|
+
{
|
|
1514
|
+
"fill-rule": "evenodd",
|
|
1515
|
+
"clip-rule": "evenodd",
|
|
1516
|
+
d: "M9 42C9 59.6731 23.3269 74 41 74C58.6731 74 73 59.6731 73 42C73 24.3269 58.6731 10 41 10C23.3269 10 9 24.3269 9 42ZM29.4529 18.5973C31.1347 18.0574 32.8641 17.5023 34.9844 16.6005C42.2533 13.5091 48.3526 11.9217 51.7782 14.094C53.5063 15.1899 54.4051 16.7749 55.6117 18.9024C56.7969 20.9922 58.279 23.6057 61.1358 26.7937C62.2737 28.0636 63.3886 29.2195 64.4371 30.3064C68.7007 34.7263 71.8645 38.0061 70.9949 43.1697C70.2965 47.316 67.9794 49.4559 65.6038 51.65C63.4317 53.656 61.2107 55.7073 60.1332 59.3786C57.8774 67.0653 53.5327 71.9113 48.3526 72.7468C43.1725 73.5823 36.6555 75.1698 29.8043 70.1567C26.1949 67.5157 25.229 64.3182 24.1947 60.894C23.2657 57.8184 22.2814 54.56 19.2768 51.3577C14.1619 45.9062 10.2533 29.6345 19.2768 23.0339C23.736 20.4327 26.5223 19.5382 29.4529 18.5973Z",
|
|
1517
|
+
fill: e,
|
|
1518
|
+
"fill-opacity": "0.15",
|
|
1519
|
+
stroke: e,
|
|
1520
|
+
"stroke-opacity": "0.35"
|
|
1521
|
+
}
|
|
1522
|
+
),
|
|
1523
|
+
/* @__PURE__ */ u(
|
|
1524
|
+
"path",
|
|
1525
|
+
{
|
|
1526
|
+
d: "M43.5 73.4212C40.4387 73.4212 35.0039 71.1025 37.556 56.4696C40.143 41.6365 42.6582 40.577 44.6991 25.744C46.3318 13.8775 41.1635 8.87964 33 10.9988",
|
|
1527
|
+
stroke: e,
|
|
1528
|
+
"stroke-opacity": "0.35"
|
|
1529
|
+
}
|
|
1530
|
+
),
|
|
1531
|
+
/* @__PURE__ */ u(
|
|
1532
|
+
"path",
|
|
1533
|
+
{
|
|
1534
|
+
d: "M43.5 73.4212C40.4387 73.4212 35.0039 71.1025 37.556 56.4696C40.143 41.6365 42.6582 40.577 44.6991 25.744C46.3318 13.8775 41.1635 8.87964 33 10.9988",
|
|
1535
|
+
stroke: e,
|
|
1536
|
+
"stroke-opacity": "0.35"
|
|
1537
|
+
}
|
|
1538
|
+
),
|
|
1539
|
+
/* @__PURE__ */ u(
|
|
1540
|
+
"path",
|
|
1541
|
+
{
|
|
1542
|
+
d: "M21.9366 68.1987C21.3549 66.5119 21.0386 60.9231 28.1376 53.3448C37.0114 43.8719 40.5 43.9579 51.4911 31.7482C59.5691 22.7747 59.1723 17.0524 58.0993 15.4626",
|
|
1543
|
+
stroke: e,
|
|
1544
|
+
"stroke-opacity": "0.35"
|
|
1545
|
+
}
|
|
1546
|
+
),
|
|
1547
|
+
/* @__PURE__ */ u(
|
|
1548
|
+
"path",
|
|
1549
|
+
{
|
|
1550
|
+
d: "M9.26819 42.161C10.4003 43.5337 15.6951 46.3853 25.7661 44.3926C38.3548 41.9018 52.434 40.307 57.694 41.0287C70.352 42.7655 71.4138 51.3035 71.4138 51.3035",
|
|
1551
|
+
stroke: e,
|
|
1552
|
+
"stroke-opacity": "0.35"
|
|
1553
|
+
}
|
|
1554
|
+
),
|
|
1555
|
+
/* @__PURE__ */ u(
|
|
1556
|
+
"path",
|
|
1557
|
+
{
|
|
1558
|
+
d: "M22 16.4916C18.815 21.85 19.6451 26.0591 27.9943 32.0828C38.4307 39.6124 50.2985 48.8304 53.5024 53.1027C58.6684 59.9914 59.5 67.928 59.5 67.928",
|
|
1559
|
+
stroke: e,
|
|
1560
|
+
"stroke-opacity": "0.35"
|
|
1561
|
+
}
|
|
1562
|
+
),
|
|
1563
|
+
/* @__PURE__ */ u(
|
|
1564
|
+
"rect",
|
|
1565
|
+
{
|
|
1566
|
+
x: "9.26099",
|
|
1567
|
+
y: "10",
|
|
1568
|
+
width: "63.7129",
|
|
1569
|
+
height: "63.7129",
|
|
1570
|
+
rx: "31.8565",
|
|
1571
|
+
stroke: e,
|
|
1572
|
+
"stroke-opacity": "0.43",
|
|
1573
|
+
"stroke-width": "1.5"
|
|
1574
|
+
}
|
|
1575
|
+
),
|
|
1576
|
+
/* @__PURE__ */ A("g", { "clip-path": "url(#clip0_7006_42127)", children: [
|
|
1577
|
+
/* @__PURE__ */ u(
|
|
1578
|
+
"circle",
|
|
1579
|
+
{
|
|
1580
|
+
cx: "62.4996",
|
|
1581
|
+
cy: "18.2032",
|
|
1582
|
+
r: "15.0195",
|
|
1583
|
+
transform: "rotate(6.27205 62.4996 18.2032)",
|
|
1584
|
+
fill: t
|
|
1585
|
+
}
|
|
1586
|
+
),
|
|
1587
|
+
/* @__PURE__ */ u(
|
|
1588
|
+
"path",
|
|
1589
|
+
{
|
|
1590
|
+
d: "M60.7142 12.1753C62.057 10.0714 65.2294 10.4202 66.0833 12.7654L66.6158 14.2308L68.1251 14.6217C70.5415 15.2484 71.1908 18.3742 69.2237 19.911L67.9944 20.8704L68.0896 22.4262C68.2403 24.9178 65.4681 26.5011 63.3987 25.1056L62.1065 24.2326L60.6555 24.8041C58.3322 25.7172 55.9702 23.5694 56.6585 21.1698L57.0884 19.6717L56.0977 18.4684C54.5112 16.541 55.8231 13.6307 58.318 13.5438L59.8751 13.4899L60.7142 12.1753Z",
|
|
1591
|
+
fill: n,
|
|
1592
|
+
stroke: t,
|
|
1593
|
+
"stroke-width": "3.27381"
|
|
1594
|
+
}
|
|
1595
|
+
),
|
|
1596
|
+
/* @__PURE__ */ u(
|
|
1597
|
+
"path",
|
|
1598
|
+
{
|
|
1599
|
+
d: "M63.925 5.23719C71.0867 6.02431 76.2545 12.4676 75.4676 19.6293C74.6805 26.7911 68.2364 31.959 61.0746 31.1718C53.9129 30.3845 48.7459 23.9406 49.533 16.7789C50.3203 9.61739 56.7634 4.45029 63.925 5.23719ZM63.6957 7.32326C57.6866 6.66302 52.2797 10.9991 51.6191 17.0082C50.9586 23.0174 55.2946 28.4251 61.3038 29.0858C67.3132 29.7462 72.7211 25.4094 73.3816 19.4C74.0418 13.3908 69.705 7.98372 63.6957 7.32326Z",
|
|
1600
|
+
fill: n,
|
|
1601
|
+
stroke: t,
|
|
1602
|
+
"stroke-width": "0.3",
|
|
1603
|
+
"stroke-linecap": "round",
|
|
1604
|
+
"stroke-linejoin": "round"
|
|
1605
|
+
}
|
|
1606
|
+
)
|
|
1607
|
+
] }),
|
|
1608
|
+
/* @__PURE__ */ u(
|
|
1609
|
+
"ellipse",
|
|
1610
|
+
{
|
|
1611
|
+
cx: "41",
|
|
1612
|
+
cy: "85",
|
|
1613
|
+
rx: "15",
|
|
1614
|
+
ry: "3",
|
|
1615
|
+
fill: e,
|
|
1616
|
+
"fill-opacity": "0.35"
|
|
1617
|
+
}
|
|
1618
|
+
),
|
|
1619
|
+
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", { id: "clip0_7006_42127", children: /* @__PURE__ */ u(
|
|
1620
|
+
"rect",
|
|
1621
|
+
{
|
|
1622
|
+
width: "33",
|
|
1623
|
+
height: "33",
|
|
1624
|
+
fill: "white",
|
|
1625
|
+
transform: "translate(47.9012) rotate(6.27205)"
|
|
1626
|
+
}
|
|
1627
|
+
) }) })
|
|
1628
|
+
]
|
|
1629
|
+
}
|
|
1630
|
+
)
|
|
1616
1631
|
}
|
|
1617
|
-
)
|
|
1632
|
+
);
|
|
1618
1633
|
}
|
|
1619
1634
|
function Ne(e) {
|
|
1620
1635
|
const t = Lr().value ? hi : vi;
|
|
@@ -1637,13 +1652,13 @@ function vi({
|
|
|
1637
1652
|
dep: o,
|
|
1638
1653
|
...a
|
|
1639
1654
|
}) {
|
|
1640
|
-
const [i, s] = Ie(e), [l, c] = Ie(null), [
|
|
1655
|
+
const [i, s] = Ie(e), [l, c] = Ie(null), [d, p] = Ie(null), v = ee(t);
|
|
1641
1656
|
e && (v.current = t);
|
|
1642
|
-
const
|
|
1643
|
-
c(
|
|
1657
|
+
const m = te((g) => {
|
|
1658
|
+
c(g), g && !e && (g.style.width = "0px", g.style.height = "0px");
|
|
1644
1659
|
}, []);
|
|
1645
1660
|
Ue(() => {
|
|
1646
|
-
|
|
1661
|
+
d && (d.style.transition = "none", d.style.opacity = "0", d.offsetWidth, d.style.transition = "", d.style.opacity = "");
|
|
1647
1662
|
}, [o]), Ae(() => {
|
|
1648
1663
|
l && (l.style.width = `${l.offsetWidth}px`, l.style.height = `${l.offsetHeight}px`);
|
|
1649
1664
|
}, [
|
|
@@ -1653,19 +1668,19 @@ function vi({
|
|
|
1653
1668
|
o
|
|
1654
1669
|
// node's content changed
|
|
1655
1670
|
]), Ue(() => {
|
|
1656
|
-
if (!l || !
|
|
1671
|
+
if (!l || !d) return;
|
|
1657
1672
|
e && s(!0);
|
|
1658
|
-
const
|
|
1659
|
-
l.style.width = !e || l.offsetWidth !==
|
|
1673
|
+
const g = e ? d.offsetWidth : 0, w = e ? d.offsetHeight : 0;
|
|
1674
|
+
l.style.width = !e || l.offsetWidth !== g ? `${g}px` : "", l.style.height = !e || l.offsetHeight !== w ? `${w}px` : "";
|
|
1660
1675
|
}, [
|
|
1661
1676
|
l,
|
|
1662
|
-
|
|
1677
|
+
d,
|
|
1663
1678
|
e,
|
|
1664
1679
|
// node's visibility changed
|
|
1665
1680
|
o
|
|
1666
1681
|
// node's content changed
|
|
1667
1682
|
]);
|
|
1668
|
-
const { transitioning:
|
|
1683
|
+
const { transitioning: x, handlers: f } = Mr({
|
|
1669
1684
|
onEnd: () => {
|
|
1670
1685
|
e ? (l.style.width = "", l.style.height = "") : s(!1);
|
|
1671
1686
|
}
|
|
@@ -1673,14 +1688,14 @@ function vi({
|
|
|
1673
1688
|
return /* @__PURE__ */ u(
|
|
1674
1689
|
"div",
|
|
1675
1690
|
{
|
|
1676
|
-
ref:
|
|
1691
|
+
ref: m,
|
|
1677
1692
|
className: V(
|
|
1678
1693
|
"relative inline-flex shrink-0 justify-center items-center transition-[opacity,width,height,transform,flex-grow] duration-200 min-w-0",
|
|
1679
1694
|
!e && "opacity-0 scale-75",
|
|
1680
1695
|
e && r && "grow",
|
|
1681
|
-
e && i && !
|
|
1696
|
+
e && i && !x.value && "z-1"
|
|
1682
1697
|
),
|
|
1683
|
-
...
|
|
1698
|
+
...f,
|
|
1684
1699
|
children: /* @__PURE__ */ u(
|
|
1685
1700
|
"div",
|
|
1686
1701
|
{
|
|
@@ -1697,7 +1712,7 @@ function vi({
|
|
|
1697
1712
|
}
|
|
1698
1713
|
);
|
|
1699
1714
|
}
|
|
1700
|
-
const
|
|
1715
|
+
const gi = {
|
|
1701
1716
|
primary: "text-accent-primary border border-accent bg-accent hover:border-accent-hover hover:bg-accent-hover active:border-accent-active active:bg-accent-active",
|
|
1702
1717
|
secondary: "text-base-primary border border-base-border bg-base hover:bg-base-hover active:bg-base-active",
|
|
1703
1718
|
ghost: "text-base-primary border border-base bg-base hover:bg-base-hover hover:border-base-hover active:bg-base-active active:border-base-active"
|
|
@@ -1712,13 +1727,13 @@ const mi = {
|
|
|
1712
1727
|
...s
|
|
1713
1728
|
}, l) {
|
|
1714
1729
|
const c = !!r && !n;
|
|
1715
|
-
return /* @__PURE__ */
|
|
1730
|
+
return /* @__PURE__ */ A(
|
|
1716
1731
|
"button",
|
|
1717
1732
|
{
|
|
1718
1733
|
ref: l,
|
|
1719
1734
|
className: V(
|
|
1720
1735
|
"h-9 flex px-2.5 text-sm items-center transition-colors justify-center rounded-button duration-200 focus-ring overflow-hidden select-none",
|
|
1721
|
-
|
|
1736
|
+
gi[t],
|
|
1722
1737
|
c && "min-w-9",
|
|
1723
1738
|
o
|
|
1724
1739
|
),
|
|
@@ -1746,7 +1761,7 @@ function Cn({
|
|
|
1746
1761
|
className: e,
|
|
1747
1762
|
...t
|
|
1748
1763
|
}) {
|
|
1749
|
-
const { status: n, isSpeaking: r } =
|
|
1764
|
+
const { status: n, isSpeaking: r } = oe(), o = zt(), a = G(), i = Y(
|
|
1750
1765
|
() => n.value !== "connected" ? a.connecting_status.value : o.value ? a.chatting_status.value : r.value ? a.speaking_status.value : a.listening_status.value
|
|
1751
1766
|
), [s, l] = Ie(i.peek());
|
|
1752
1767
|
return Ee(() => {
|
|
@@ -1754,10 +1769,10 @@ function Cn({
|
|
|
1754
1769
|
if (n.value === "connected" && r.value)
|
|
1755
1770
|
l(c);
|
|
1756
1771
|
else {
|
|
1757
|
-
const
|
|
1772
|
+
const d = setTimeout(() => {
|
|
1758
1773
|
l(c);
|
|
1759
1774
|
}, 500);
|
|
1760
|
-
return () => clearTimeout(
|
|
1775
|
+
return () => clearTimeout(d);
|
|
1761
1776
|
}
|
|
1762
1777
|
}), /* @__PURE__ */ u(
|
|
1763
1778
|
"div",
|
|
@@ -1767,17 +1782,17 @@ function Cn({
|
|
|
1767
1782
|
e
|
|
1768
1783
|
),
|
|
1769
1784
|
...t,
|
|
1770
|
-
children: /* @__PURE__ */ u(
|
|
1785
|
+
children: /* @__PURE__ */ u(ie, { initial: !1, active: !0, children: /* @__PURE__ */ u("div", { className: "animate-text whitespace-nowrap transition-[opacity,transform] ease-out duration-200 data-hidden:opacity-0 transform data-hidden:translate-y-2", children: s }) }, s)
|
|
1771
1786
|
}
|
|
1772
1787
|
);
|
|
1773
1788
|
}
|
|
1774
1789
|
const Dr = de(null);
|
|
1775
|
-
function
|
|
1790
|
+
function mi({
|
|
1776
1791
|
children: e
|
|
1777
1792
|
}) {
|
|
1778
|
-
const t =
|
|
1779
|
-
const v = o.value,
|
|
1780
|
-
if (!v || !
|
|
1793
|
+
const t = J(null), n = J(""), r = J("initial"), { lastId: o } = oe(), a = B("agent-id"), { serverUrl: i } = wn(), s = te(async (p) => {
|
|
1794
|
+
const v = o.value, m = a.value;
|
|
1795
|
+
if (!v || !m) {
|
|
1781
1796
|
console.warn(
|
|
1782
1797
|
"[ConversationalAI] Cannot submit rating: missing agent_id or conversation_id"
|
|
1783
1798
|
);
|
|
@@ -1791,10 +1806,10 @@ function gi({
|
|
|
1791
1806
|
},
|
|
1792
1807
|
i.value
|
|
1793
1808
|
);
|
|
1794
|
-
} catch (
|
|
1795
|
-
console.error("[ConversationalAI] Failed to submit rating:",
|
|
1809
|
+
} catch (x) {
|
|
1810
|
+
console.error("[ConversationalAI] Failed to submit rating:", x);
|
|
1796
1811
|
}
|
|
1797
|
-
}, []), l =
|
|
1812
|
+
}, []), l = te(async () => {
|
|
1798
1813
|
const p = o.value, v = a.value;
|
|
1799
1814
|
if (!p || !v) {
|
|
1800
1815
|
console.warn(
|
|
@@ -1816,16 +1831,16 @@ function gi({
|
|
|
1816
1831
|
},
|
|
1817
1832
|
i.value
|
|
1818
1833
|
);
|
|
1819
|
-
} catch (
|
|
1820
|
-
console.error("[ConversationalAI] Failed to submit feedback:",
|
|
1834
|
+
} catch (m) {
|
|
1835
|
+
console.error("[ConversationalAI] Failed to submit feedback:", m);
|
|
1821
1836
|
}
|
|
1822
|
-
}, []), c =
|
|
1837
|
+
}, []), c = te(() => {
|
|
1823
1838
|
t.value = null, n.value = "", r.value = "initial";
|
|
1824
1839
|
}, []);
|
|
1825
1840
|
Ee(() => {
|
|
1826
1841
|
o.value !== null && c();
|
|
1827
1842
|
});
|
|
1828
|
-
const
|
|
1843
|
+
const d = Ae(
|
|
1829
1844
|
() => ({
|
|
1830
1845
|
rating: t,
|
|
1831
1846
|
feedbackText: n,
|
|
@@ -1836,7 +1851,7 @@ function gi({
|
|
|
1836
1851
|
}),
|
|
1837
1852
|
[s, l, c]
|
|
1838
1853
|
);
|
|
1839
|
-
return /* @__PURE__ */ u(Dr.Provider, { value:
|
|
1854
|
+
return /* @__PURE__ */ u(Dr.Provider, { value: d, children: e });
|
|
1840
1855
|
}
|
|
1841
1856
|
function Sn() {
|
|
1842
1857
|
return fe(Dr);
|
|
@@ -1846,7 +1861,7 @@ function wi({
|
|
|
1846
1861
|
defaultContent: e = "transcript",
|
|
1847
1862
|
children: t
|
|
1848
1863
|
}) {
|
|
1849
|
-
const n =
|
|
1864
|
+
const n = J(e), r = ua(() => {
|
|
1850
1865
|
const a = n.value === "feedback" ? {
|
|
1851
1866
|
showHeaderBack: !0,
|
|
1852
1867
|
onHeaderBack: () => {
|
|
@@ -1888,7 +1903,7 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1888
1903
|
p.stopPropagation(), r(e);
|
|
1889
1904
|
},
|
|
1890
1905
|
[r, e]
|
|
1891
|
-
),
|
|
1906
|
+
), d = Be(
|
|
1892
1907
|
(p) => {
|
|
1893
1908
|
a(p, e);
|
|
1894
1909
|
},
|
|
@@ -1905,7 +1920,7 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1905
1920
|
"aria-label": e.toString(),
|
|
1906
1921
|
onMouseEnter: () => o(e),
|
|
1907
1922
|
onClick: c,
|
|
1908
|
-
onKeyDown:
|
|
1923
|
+
onKeyDown: d,
|
|
1909
1924
|
className: V(
|
|
1910
1925
|
"w-8 h-8 grid place-content-center rounded-full focus-ring transition-colors cursor-pointer",
|
|
1911
1926
|
s || l ? "text-base-primary" : "text-base-border"
|
|
@@ -1921,30 +1936,30 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1921
1936
|
ariaLabel: r,
|
|
1922
1937
|
icon: o = "star"
|
|
1923
1938
|
}) => {
|
|
1924
|
-
const a =
|
|
1939
|
+
const a = J(null), i = J(null), s = Br(t, n), l = Be(
|
|
1925
1940
|
(v) => {
|
|
1926
1941
|
i.value = v;
|
|
1927
1942
|
},
|
|
1928
1943
|
[i]
|
|
1929
1944
|
), c = Be(() => {
|
|
1930
1945
|
i.value = null;
|
|
1931
|
-
}, [i]),
|
|
1946
|
+
}, [i]), d = Be(
|
|
1932
1947
|
(v) => {
|
|
1933
1948
|
a.value = v, e(v);
|
|
1934
1949
|
},
|
|
1935
1950
|
[a, e]
|
|
1936
1951
|
), p = Be(
|
|
1937
|
-
(v,
|
|
1952
|
+
(v, m) => {
|
|
1938
1953
|
if (v.key === "Enter" || v.key === " ")
|
|
1939
|
-
v.preventDefault(), a.value =
|
|
1954
|
+
v.preventDefault(), a.value = m, e(m);
|
|
1940
1955
|
else if (v.key === "ArrowLeft" || v.key === "ArrowDown") {
|
|
1941
|
-
if (v.preventDefault(),
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1956
|
+
if (v.preventDefault(), m - 1 >= t) {
|
|
1957
|
+
const f = v.currentTarget, g = f == null ? void 0 : f.previousElementSibling;
|
|
1958
|
+
g == null || g.focus();
|
|
1944
1959
|
}
|
|
1945
|
-
} else if ((v.key === "ArrowRight" || v.key === "ArrowUp") && (v.preventDefault(),
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1960
|
+
} else if ((v.key === "ArrowRight" || v.key === "ArrowUp") && (v.preventDefault(), m + 1 <= n)) {
|
|
1961
|
+
const f = v.currentTarget, g = f == null ? void 0 : f.nextElementSibling;
|
|
1962
|
+
g == null || g.focus();
|
|
1948
1963
|
}
|
|
1949
1964
|
},
|
|
1950
1965
|
[a, e, t, n]
|
|
@@ -1962,7 +1977,7 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1962
1977
|
value: v,
|
|
1963
1978
|
rating: a,
|
|
1964
1979
|
hoverRating: i,
|
|
1965
|
-
onClick:
|
|
1980
|
+
onClick: d,
|
|
1966
1981
|
onHover: l,
|
|
1967
1982
|
onKeyDown: p,
|
|
1968
1983
|
iconName: o
|
|
@@ -1994,7 +2009,7 @@ function Ci({
|
|
|
1994
2009
|
onRate: t
|
|
1995
2010
|
}) {
|
|
1996
2011
|
const n = G();
|
|
1997
|
-
return /* @__PURE__ */
|
|
2012
|
+
return /* @__PURE__ */ A("div", { className: "flex flex-col items-center", children: [
|
|
1998
2013
|
/* @__PURE__ */ u("div", { className: "text-sm text-base-primary font-medium", children: n.initiate_feedback }),
|
|
1999
2014
|
/* @__PURE__ */ u("div", { className: "py-4", children: /* @__PURE__ */ u(
|
|
2000
2015
|
yi,
|
|
@@ -2013,7 +2028,7 @@ function Si({
|
|
|
2013
2028
|
onFollowUpClick: r
|
|
2014
2029
|
}) {
|
|
2015
2030
|
const o = G();
|
|
2016
|
-
return /* @__PURE__ */
|
|
2031
|
+
return /* @__PURE__ */ A("div", { className: "flex flex-col items-center gap-3 mb-4", children: [
|
|
2017
2032
|
/* @__PURE__ */ u("div", { className: "text-sm text-base-primary font-medium", children: o.thanks_for_feedback }),
|
|
2018
2033
|
/* @__PURE__ */ u(zr, { rating: t, min: 1, max: 5, icon: e }),
|
|
2019
2034
|
n && /* @__PURE__ */ u(ve, { variant: "secondary", onClick: r, children: o.request_follow_up_feedback })
|
|
@@ -2040,7 +2055,7 @@ function ki({ icon: e = "star" }) {
|
|
|
2040
2055
|
}
|
|
2041
2056
|
function Ei({ entry: e }) {
|
|
2042
2057
|
const { previewUrl: t } = xn();
|
|
2043
|
-
return /* @__PURE__ */
|
|
2058
|
+
return /* @__PURE__ */ A(
|
|
2044
2059
|
"div",
|
|
2045
2060
|
{
|
|
2046
2061
|
className: V(
|
|
@@ -2072,13 +2087,13 @@ function Ei({ entry: e }) {
|
|
|
2072
2087
|
);
|
|
2073
2088
|
}
|
|
2074
2089
|
function Ti({ entry: e }) {
|
|
2075
|
-
const t = G(), { lastId: n } =
|
|
2076
|
-
return /* @__PURE__ */
|
|
2077
|
-
r && /* @__PURE__ */ u(ki, {}),
|
|
2078
|
-
/* @__PURE__ */
|
|
2090
|
+
const t = G(), { lastId: n } = oe(), r = Na();
|
|
2091
|
+
return /* @__PURE__ */ A("div", { className: "mt-3 px-8 flex flex-col", children: [
|
|
2092
|
+
r.value === "rating" && /* @__PURE__ */ u(ki, {}),
|
|
2093
|
+
/* @__PURE__ */ A("div", { className: "text-xs text-base-subtle text-center transition-opacity duration-200 data-hidden:opacity-0", children: [
|
|
2079
2094
|
e.role === "user" ? t.user_ended_conversation : t.agent_ended_conversation,
|
|
2080
2095
|
/* @__PURE__ */ u("br", {}),
|
|
2081
|
-
n.value && /* @__PURE__ */
|
|
2096
|
+
n.value && /* @__PURE__ */ A("span", { className: "break-all", children: [
|
|
2082
2097
|
t.conversation_id,
|
|
2083
2098
|
": ",
|
|
2084
2099
|
n.value
|
|
@@ -2087,14 +2102,14 @@ function Ti({ entry: e }) {
|
|
|
2087
2102
|
] });
|
|
2088
2103
|
}
|
|
2089
2104
|
function Ai({ entry: e }) {
|
|
2090
|
-
const t = G(), { lastId: n } =
|
|
2091
|
-
return /* @__PURE__ */
|
|
2105
|
+
const t = G(), { lastId: n } = oe();
|
|
2106
|
+
return /* @__PURE__ */ A("div", { className: "mt-2 px-8 text-xs text-base-error text-center transition-opacity duration-200 data-hidden:opacity-0", children: [
|
|
2092
2107
|
t.error_occurred,
|
|
2093
2108
|
/* @__PURE__ */ u("br", {}),
|
|
2094
2109
|
e.message,
|
|
2095
|
-
n.value && /* @__PURE__ */
|
|
2110
|
+
n.value && /* @__PURE__ */ A(rt, { children: [
|
|
2096
2111
|
/* @__PURE__ */ u("br", {}),
|
|
2097
|
-
/* @__PURE__ */
|
|
2112
|
+
/* @__PURE__ */ A("span", { className: "text-base-subtle break-all", children: [
|
|
2098
2113
|
t.conversation_id,
|
|
2099
2114
|
": ",
|
|
2100
2115
|
n.value
|
|
@@ -2106,11 +2121,11 @@ function _i({
|
|
|
2106
2121
|
entry: e,
|
|
2107
2122
|
animateIn: t
|
|
2108
2123
|
}) {
|
|
2109
|
-
return /* @__PURE__ */ u(
|
|
2124
|
+
return /* @__PURE__ */ u(ie, { initial: !t, active: !0, children: e.type === "message" ? /* @__PURE__ */ u(Ei, { entry: e }) : e.type === "disconnection" ? /* @__PURE__ */ u(Ti, { entry: e }) : /* @__PURE__ */ u(Ai, { entry: e }) });
|
|
2110
2125
|
}
|
|
2111
2126
|
const Pi = 16;
|
|
2112
2127
|
function Ri({ scrollPinned: e, transcript: t }) {
|
|
2113
|
-
const n =
|
|
2128
|
+
const n = ee(null), r = ee(0), o = ee(null), a = ee(!1), i = ee(!1), s = (p) => {
|
|
2114
2129
|
var v;
|
|
2115
2130
|
(v = n.current) == null || v.scrollTo({
|
|
2116
2131
|
top: n.current.scrollHeight,
|
|
@@ -2119,30 +2134,30 @@ function Ri({ scrollPinned: e, transcript: t }) {
|
|
|
2119
2134
|
}, l = () => {
|
|
2120
2135
|
const p = n.current;
|
|
2121
2136
|
if (!p || !a.current || i.current) return;
|
|
2122
|
-
const v = p.scrollTop,
|
|
2123
|
-
if (Math.abs(
|
|
2124
|
-
p.scrollTop =
|
|
2137
|
+
const v = p.scrollTop, m = p.scrollHeight - p.clientHeight, x = m - v;
|
|
2138
|
+
if (Math.abs(x) < 1) {
|
|
2139
|
+
p.scrollTop = m, o.current = requestAnimationFrame(l);
|
|
2125
2140
|
return;
|
|
2126
2141
|
}
|
|
2127
|
-
const
|
|
2128
|
-
p.scrollTop = v + Math.max(
|
|
2142
|
+
const f = x * 0.2, g = 2;
|
|
2143
|
+
p.scrollTop = v + Math.max(f, g), o.current = requestAnimationFrame(l);
|
|
2129
2144
|
}, c = () => {
|
|
2130
2145
|
!n.current || i.current || a.current || (a.current = !0, o.current = requestAnimationFrame(l));
|
|
2131
|
-
},
|
|
2132
|
-
return Ue(() => (
|
|
2146
|
+
}, d = ee(!0);
|
|
2147
|
+
return Ue(() => (d.current = !1, s(!1), () => {
|
|
2133
2148
|
o.current && cancelAnimationFrame(o.current);
|
|
2134
2149
|
}), []), Ee(() => {
|
|
2135
|
-
var
|
|
2150
|
+
var x;
|
|
2136
2151
|
const p = t.value;
|
|
2137
2152
|
if (!e.peek()) return;
|
|
2138
2153
|
const v = p[p.length - 1];
|
|
2139
2154
|
if ((v == null ? void 0 : v.type) === "message" && (v == null ? void 0 : v.role) === "ai" && (v == null ? void 0 : v.isText) === !0) {
|
|
2140
|
-
const
|
|
2141
|
-
r.current === 0 &&
|
|
2155
|
+
const f = ((x = v.message) == null ? void 0 : x.length) || 0;
|
|
2156
|
+
r.current === 0 && f > 0 ? (r.current = f, i.current = !1, requestAnimationFrame(() => {
|
|
2142
2157
|
requestAnimationFrame(() => {
|
|
2143
2158
|
!i.current && e.peek() && (s(!1), c());
|
|
2144
2159
|
});
|
|
2145
|
-
})) :
|
|
2160
|
+
})) : f > r.current && (r.current = f, c());
|
|
2146
2161
|
} else
|
|
2147
2162
|
r.current = 0, a.current = !1, i.current = !1, o.current && (cancelAnimationFrame(o.current), o.current = null), s(!0);
|
|
2148
2163
|
}), /* @__PURE__ */ u(
|
|
@@ -2158,7 +2173,7 @@ function Ri({ scrollPinned: e, transcript: t }) {
|
|
|
2158
2173
|
_i,
|
|
2159
2174
|
{
|
|
2160
2175
|
entry: p,
|
|
2161
|
-
animateIn: !
|
|
2176
|
+
animateIn: !d.current
|
|
2162
2177
|
},
|
|
2163
2178
|
`${v}-${p.conversationIndex}`
|
|
2164
2179
|
))
|
|
@@ -2184,7 +2199,7 @@ function En({
|
|
|
2184
2199
|
visible: e,
|
|
2185
2200
|
...t
|
|
2186
2201
|
}) {
|
|
2187
|
-
const n = G(), { isMuted: r, isMutingEnabled: o, setIsMuted: a } = Cr(), i =
|
|
2202
|
+
const n = G(), { isMuted: r, isMutingEnabled: o, setIsMuted: a } = Cr(), i = te(() => {
|
|
2188
2203
|
a(!r.peek());
|
|
2189
2204
|
}, [a]);
|
|
2190
2205
|
return o.value ? /* @__PURE__ */ u(Ne, { visible: e, className: "p-1", children: /* @__PURE__ */ u(
|
|
@@ -2204,7 +2219,7 @@ function Tn({
|
|
|
2204
2219
|
children: n,
|
|
2205
2220
|
...r
|
|
2206
2221
|
}) {
|
|
2207
|
-
const { endSession: o, startSession: a } =
|
|
2222
|
+
const { endSession: o, startSession: a } = oe(), i = G();
|
|
2208
2223
|
return /* @__PURE__ */ u(
|
|
2209
2224
|
ve,
|
|
2210
2225
|
{
|
|
@@ -2221,47 +2236,47 @@ function Ii({
|
|
|
2221
2236
|
showTranscript: e,
|
|
2222
2237
|
scrollPinned: t
|
|
2223
2238
|
}) {
|
|
2224
|
-
const n =
|
|
2239
|
+
const n = J(""), r = zt(), { text_input_enabled: o } = q().value, a = G(), {
|
|
2225
2240
|
isDisconnected: i,
|
|
2226
2241
|
status: s,
|
|
2227
2242
|
startSession: l,
|
|
2228
2243
|
sendUserMessage: c,
|
|
2229
|
-
sendUserActivity:
|
|
2244
|
+
sendUserActivity: d,
|
|
2230
2245
|
conversationIndex: p
|
|
2231
|
-
} =
|
|
2232
|
-
async (
|
|
2233
|
-
|
|
2246
|
+
} = oe(), v = te(
|
|
2247
|
+
async (g) => {
|
|
2248
|
+
g.preventDefault();
|
|
2234
2249
|
const w = n.value.trim();
|
|
2235
|
-
w && (t.value = !0, n.value = "", i.value ? await l(
|
|
2250
|
+
w && (t.value = !0, n.value = "", i.value ? await l(g.currentTarget, w) : c(w));
|
|
2236
2251
|
},
|
|
2237
2252
|
[n, t, i, l, c]
|
|
2238
|
-
),
|
|
2239
|
-
async (
|
|
2240
|
-
|
|
2253
|
+
), m = te(
|
|
2254
|
+
async (g) => {
|
|
2255
|
+
g.key === "Enter" && !g.shiftKey && await v(g);
|
|
2241
2256
|
},
|
|
2242
2257
|
[v]
|
|
2243
|
-
),
|
|
2244
|
-
(
|
|
2245
|
-
n.value =
|
|
2258
|
+
), x = te(
|
|
2259
|
+
(g) => {
|
|
2260
|
+
n.value = g.currentTarget.value;
|
|
2246
2261
|
},
|
|
2247
2262
|
[n]
|
|
2248
|
-
),
|
|
2249
|
-
return /* @__PURE__ */
|
|
2250
|
-
o && /* @__PURE__ */
|
|
2263
|
+
), f = Y(() => !!n.value.trim());
|
|
2264
|
+
return /* @__PURE__ */ A("div", { className: "shrink-0 overflow-hidden flex p-3 items-end justify-end", children: [
|
|
2265
|
+
o && /* @__PURE__ */ A("div", { className: "relative grow min-w-0 flex z-1 m-1", children: [
|
|
2251
2266
|
/* @__PURE__ */ u(
|
|
2252
2267
|
Vr,
|
|
2253
2268
|
{
|
|
2254
2269
|
rows: 1,
|
|
2255
2270
|
"aria-label": a.input_label,
|
|
2256
2271
|
value: n,
|
|
2257
|
-
onInput:
|
|
2258
|
-
onChange:
|
|
2259
|
-
onKeyDown:
|
|
2272
|
+
onInput: d,
|
|
2273
|
+
onChange: x,
|
|
2274
|
+
onKeyDown: m,
|
|
2260
2275
|
className: "min-w-0 w-full max-h-[8lh] pr-9",
|
|
2261
2276
|
placeholder: r.value ? i.value && p.value > 0 ? a.input_placeholder_new_conversation : a.input_placeholder_text_only : a.input_placeholder
|
|
2262
2277
|
}
|
|
2263
2278
|
),
|
|
2264
|
-
/* @__PURE__ */ u(
|
|
2279
|
+
/* @__PURE__ */ u(ie, { active: f, children: /* @__PURE__ */ u(
|
|
2265
2280
|
"button",
|
|
2266
2281
|
{
|
|
2267
2282
|
"aria-label": a.send_message,
|
|
@@ -2271,7 +2286,7 @@ function Ii({
|
|
|
2271
2286
|
}
|
|
2272
2287
|
) })
|
|
2273
2288
|
] }),
|
|
2274
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ A("div", { className: "flex h-11 items-center", children: [
|
|
2275
2290
|
/* @__PURE__ */ u(En, { visible: !r.value && !i.value }),
|
|
2276
2291
|
/* @__PURE__ */ u(
|
|
2277
2292
|
Ne,
|
|
@@ -2293,14 +2308,14 @@ function Ii({
|
|
|
2293
2308
|
] });
|
|
2294
2309
|
}
|
|
2295
2310
|
function Ni() {
|
|
2296
|
-
const e = G(), { rating: t, feedbackText: n } = Sn(), r =
|
|
2311
|
+
const e = G(), { rating: t, feedbackText: n } = Sn(), r = te(
|
|
2297
2312
|
(o) => {
|
|
2298
2313
|
n.value = o.currentTarget.value;
|
|
2299
2314
|
},
|
|
2300
2315
|
[]
|
|
2301
2316
|
);
|
|
2302
|
-
return /* @__PURE__ */ u("div", { className: "grow flex flex-col overflow-y-auto overflow-x-hidden px-4", children: /* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2317
|
+
return /* @__PURE__ */ u("div", { className: "grow flex flex-col overflow-y-auto overflow-x-hidden px-4", children: /* @__PURE__ */ A("div", { className: "flex flex-col gap-8 min-h-full pt-4 pb-2", children: [
|
|
2318
|
+
/* @__PURE__ */ A("div", { className: "flex flex-col items-center justify-center gap-3", children: [
|
|
2304
2319
|
/* @__PURE__ */ u(
|
|
2305
2320
|
pi,
|
|
2306
2321
|
{
|
|
@@ -2311,7 +2326,7 @@ function Ni() {
|
|
|
2311
2326
|
}
|
|
2312
2327
|
),
|
|
2313
2328
|
t.value !== null && /* @__PURE__ */ u(zr, { rating: t.value, min: 1, max: 5 }),
|
|
2314
|
-
/* @__PURE__ */
|
|
2329
|
+
/* @__PURE__ */ A("div", { className: "text-center", children: [
|
|
2315
2330
|
/* @__PURE__ */ u("p", { className: "text-sm text-base-primary font-medium", children: e.thanks_for_feedback }),
|
|
2316
2331
|
/* @__PURE__ */ u("p", { className: "text-sm text-base-subtle", children: e.thanks_for_feedback_details })
|
|
2317
2332
|
] })
|
|
@@ -2329,7 +2344,7 @@ function Ni() {
|
|
|
2329
2344
|
] }) });
|
|
2330
2345
|
}
|
|
2331
2346
|
function Oi() {
|
|
2332
|
-
const e = G(), { currentContent: t } = kn(), { submitFeedback: n } = Sn(), r =
|
|
2347
|
+
const e = G(), { currentContent: t } = kn(), { submitFeedback: n } = Sn(), r = te(() => {
|
|
2333
2348
|
n(), t.value = "transcript";
|
|
2334
2349
|
}, [n]);
|
|
2335
2350
|
return /* @__PURE__ */ u("div", { className: "shrink-0 overflow-hidden flex p-3 items-end justify-end", children: /* @__PURE__ */ u(ve, { variant: "primary", onClick: r, children: e.submit }) });
|
|
@@ -2350,18 +2365,18 @@ function An(e, t = []) {
|
|
|
2350
2365
|
n = [...n, i];
|
|
2351
2366
|
const c = (p) => {
|
|
2352
2367
|
var w;
|
|
2353
|
-
const { scope: v, children:
|
|
2354
|
-
return /* @__PURE__ */
|
|
2368
|
+
const { scope: v, children: m, ...x } = p, f = ((w = v == null ? void 0 : v[e]) == null ? void 0 : w[l]) || s, g = h.useMemo(() => x, Object.values(x));
|
|
2369
|
+
return /* @__PURE__ */ T(f.Provider, { value: g, children: m });
|
|
2355
2370
|
};
|
|
2356
2371
|
c.displayName = a + "Provider";
|
|
2357
|
-
function
|
|
2358
|
-
var
|
|
2359
|
-
const
|
|
2360
|
-
if (
|
|
2372
|
+
function d(p, v) {
|
|
2373
|
+
var f;
|
|
2374
|
+
const m = ((f = v == null ? void 0 : v[e]) == null ? void 0 : f[l]) || s, x = h.useContext(m);
|
|
2375
|
+
if (x) return x;
|
|
2361
2376
|
if (i !== void 0) return i;
|
|
2362
2377
|
throw new Error(`\`${p}\` must be used within \`${a}\``);
|
|
2363
2378
|
}
|
|
2364
|
-
return [c,
|
|
2379
|
+
return [c, d];
|
|
2365
2380
|
}
|
|
2366
2381
|
const o = () => {
|
|
2367
2382
|
const a = n.map((i) => h.createContext(i));
|
|
@@ -2397,39 +2412,39 @@ function Mi(e) {
|
|
|
2397
2412
|
const t = e + "CollectionProvider", [n, r] = An(t), [o, a] = n(
|
|
2398
2413
|
t,
|
|
2399
2414
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
2400
|
-
), i = (
|
|
2401
|
-
const { scope:
|
|
2402
|
-
return /* @__PURE__ */
|
|
2415
|
+
), i = (f) => {
|
|
2416
|
+
const { scope: g, children: w } = f, b = De.useRef(null), y = De.useRef(/* @__PURE__ */ new Map()).current;
|
|
2417
|
+
return /* @__PURE__ */ T(o, { scope: g, itemMap: y, collectionRef: b, children: w });
|
|
2403
2418
|
};
|
|
2404
2419
|
i.displayName = t;
|
|
2405
|
-
const s = e + "CollectionSlot", l = /* @__PURE__ */
|
|
2406
|
-
(
|
|
2407
|
-
const { scope: w, children:
|
|
2408
|
-
return /* @__PURE__ */
|
|
2420
|
+
const s = e + "CollectionSlot", l = /* @__PURE__ */ mt(s), c = De.forwardRef(
|
|
2421
|
+
(f, g) => {
|
|
2422
|
+
const { scope: w, children: b } = f, y = a(s, w), C = ne(g, y.collectionRef);
|
|
2423
|
+
return /* @__PURE__ */ T(l, { ref: C, children: b });
|
|
2409
2424
|
}
|
|
2410
2425
|
);
|
|
2411
2426
|
c.displayName = s;
|
|
2412
|
-
const
|
|
2413
|
-
(
|
|
2414
|
-
const { scope: w, children:
|
|
2415
|
-
return De.useEffect(() => (
|
|
2427
|
+
const d = e + "CollectionItemSlot", p = "data-radix-collection-item", v = /* @__PURE__ */ mt(d), m = De.forwardRef(
|
|
2428
|
+
(f, g) => {
|
|
2429
|
+
const { scope: w, children: b, ...y } = f, C = De.useRef(null), S = ne(g, C), E = a(d, w);
|
|
2430
|
+
return De.useEffect(() => (E.itemMap.set(C, { ref: C, ...y }), () => void E.itemMap.delete(C))), /* @__PURE__ */ T(v, { [p]: "", ref: S, children: b });
|
|
2416
2431
|
}
|
|
2417
2432
|
);
|
|
2418
|
-
|
|
2419
|
-
function
|
|
2420
|
-
const
|
|
2433
|
+
m.displayName = d;
|
|
2434
|
+
function x(f) {
|
|
2435
|
+
const g = a(e + "CollectionConsumer", f);
|
|
2421
2436
|
return De.useCallback(() => {
|
|
2422
|
-
const
|
|
2423
|
-
if (!
|
|
2424
|
-
const
|
|
2425
|
-
return Array.from(
|
|
2426
|
-
(
|
|
2437
|
+
const b = g.collectionRef.current;
|
|
2438
|
+
if (!b) return [];
|
|
2439
|
+
const y = Array.from(b.querySelectorAll(`[${p}]`));
|
|
2440
|
+
return Array.from(g.itemMap.values()).sort(
|
|
2441
|
+
(E, k) => y.indexOf(E.ref.current) - y.indexOf(k.ref.current)
|
|
2427
2442
|
);
|
|
2428
|
-
}, [
|
|
2443
|
+
}, [g.collectionRef, g.itemMap]);
|
|
2429
2444
|
}
|
|
2430
2445
|
return [
|
|
2431
|
-
{ Provider: i, Slot: c, ItemSlot:
|
|
2432
|
-
|
|
2446
|
+
{ Provider: i, Slot: c, ItemSlot: m },
|
|
2447
|
+
x,
|
|
2433
2448
|
r
|
|
2434
2449
|
];
|
|
2435
2450
|
}
|
|
@@ -2457,9 +2472,9 @@ var Bi = [
|
|
|
2457
2472
|
"svg",
|
|
2458
2473
|
"ul"
|
|
2459
2474
|
], X = Bi.reduce((e, t) => {
|
|
2460
|
-
const n = /* @__PURE__ */
|
|
2475
|
+
const n = /* @__PURE__ */ mt(`Primitive.${t}`), r = h.forwardRef((o, a) => {
|
|
2461
2476
|
const { asChild: i, ...s } = o, l = i ? n : t;
|
|
2462
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
2477
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ T(l, { ...s, ref: a });
|
|
2463
2478
|
});
|
|
2464
2479
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
2465
2480
|
}, {});
|
|
@@ -2498,36 +2513,36 @@ var $i = "DismissableLayer", sn = "dismissableLayer.update", Wi = "dismissableLa
|
|
|
2498
2513
|
onInteractOutside: i,
|
|
2499
2514
|
onDismiss: s,
|
|
2500
2515
|
...l
|
|
2501
|
-
} = e, c = h.useContext($r), [
|
|
2516
|
+
} = e, c = h.useContext($r), [d, p] = h.useState(null), v = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, m] = h.useState({}), x = ne(t, (k) => p(k)), f = Array.from(c.layers), [g] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), w = f.indexOf(g), b = d ? f.indexOf(d) : -1, y = c.layersWithOutsidePointerEventsDisabled.size > 0, C = b >= w, S = Yi((k) => {
|
|
2502
2517
|
const I = k.target, D = [...c.branches].some((L) => L.contains(I));
|
|
2503
2518
|
!C || D || (o == null || o(k), i == null || i(k), k.defaultPrevented || s == null || s());
|
|
2504
|
-
}, v),
|
|
2519
|
+
}, v), E = Ki((k) => {
|
|
2505
2520
|
const I = k.target;
|
|
2506
2521
|
[...c.branches].some((L) => L.contains(I)) || (a == null || a(k), i == null || i(k), k.defaultPrevented || s == null || s());
|
|
2507
2522
|
}, v);
|
|
2508
2523
|
return Vi((k) => {
|
|
2509
|
-
|
|
2524
|
+
b === c.layers.size - 1 && (r == null || r(k), !k.defaultPrevented && s && (k.preventDefault(), s()));
|
|
2510
2525
|
}, v), h.useEffect(() => {
|
|
2511
|
-
if (
|
|
2512
|
-
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (jn = v.body.style.pointerEvents, v.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(
|
|
2526
|
+
if (d)
|
|
2527
|
+
return n && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (jn = v.body.style.pointerEvents, v.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(d)), c.layers.add(d), Yn(), () => {
|
|
2513
2528
|
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents = jn);
|
|
2514
2529
|
};
|
|
2515
|
-
}, [
|
|
2516
|
-
|
|
2517
|
-
}, [
|
|
2518
|
-
const k = () =>
|
|
2530
|
+
}, [d, v, n, c]), h.useEffect(() => () => {
|
|
2531
|
+
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Yn());
|
|
2532
|
+
}, [d, c]), h.useEffect(() => {
|
|
2533
|
+
const k = () => m({});
|
|
2519
2534
|
return document.addEventListener(sn, k), () => document.removeEventListener(sn, k);
|
|
2520
|
-
}, []), /* @__PURE__ */
|
|
2535
|
+
}, []), /* @__PURE__ */ T(
|
|
2521
2536
|
X.div,
|
|
2522
2537
|
{
|
|
2523
2538
|
...l,
|
|
2524
|
-
ref:
|
|
2539
|
+
ref: x,
|
|
2525
2540
|
style: {
|
|
2526
|
-
pointerEvents:
|
|
2541
|
+
pointerEvents: y ? C ? "auto" : "none" : void 0,
|
|
2527
2542
|
...e.style
|
|
2528
2543
|
},
|
|
2529
|
-
onFocusCapture: Z(e.onFocusCapture,
|
|
2530
|
-
onBlurCapture: Z(e.onBlurCapture,
|
|
2544
|
+
onFocusCapture: Z(e.onFocusCapture, E.onFocusCapture),
|
|
2545
|
+
onBlurCapture: Z(e.onBlurCapture, E.onBlurCapture),
|
|
2531
2546
|
onPointerDownCapture: Z(
|
|
2532
2547
|
e.onPointerDownCapture,
|
|
2533
2548
|
S.onPointerDownCapture
|
|
@@ -2538,14 +2553,14 @@ var $i = "DismissableLayer", sn = "dismissableLayer.update", Wi = "dismissableLa
|
|
|
2538
2553
|
);
|
|
2539
2554
|
Wr.displayName = $i;
|
|
2540
2555
|
var Ui = "DismissableLayerBranch", ji = h.forwardRef((e, t) => {
|
|
2541
|
-
const n = h.useContext($r), r = h.useRef(null), o =
|
|
2556
|
+
const n = h.useContext($r), r = h.useRef(null), o = ne(t, r);
|
|
2542
2557
|
return h.useEffect(() => {
|
|
2543
2558
|
const a = r.current;
|
|
2544
2559
|
if (a)
|
|
2545
2560
|
return n.branches.add(a), () => {
|
|
2546
2561
|
n.branches.delete(a);
|
|
2547
2562
|
};
|
|
2548
|
-
}, [n.branches]), /* @__PURE__ */
|
|
2563
|
+
}, [n.branches]), /* @__PURE__ */ T(X.div, { ...e, ref: o });
|
|
2549
2564
|
});
|
|
2550
2565
|
ji.displayName = Ui;
|
|
2551
2566
|
function Yi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
@@ -2620,7 +2635,7 @@ var Gt = "focusScope.autoFocusOnMount", qt = "focusScope.autoFocusOnUnmount", Xn
|
|
|
2620
2635
|
onMountAutoFocus: o,
|
|
2621
2636
|
onUnmountAutoFocus: a,
|
|
2622
2637
|
...i
|
|
2623
|
-
} = e, [s, l] = h.useState(null), c = je(o),
|
|
2638
|
+
} = e, [s, l] = h.useState(null), c = je(o), d = je(a), p = h.useRef(null), v = ne(t, (f) => l(f)), m = h.useRef({
|
|
2624
2639
|
paused: !1,
|
|
2625
2640
|
pause() {
|
|
2626
2641
|
this.paused = !0;
|
|
@@ -2631,53 +2646,53 @@ var Gt = "focusScope.autoFocusOnMount", qt = "focusScope.autoFocusOnUnmount", Xn
|
|
|
2631
2646
|
}).current;
|
|
2632
2647
|
h.useEffect(() => {
|
|
2633
2648
|
if (r) {
|
|
2634
|
-
let
|
|
2635
|
-
if (
|
|
2636
|
-
const C =
|
|
2649
|
+
let f = function(y) {
|
|
2650
|
+
if (m.paused || !s) return;
|
|
2651
|
+
const C = y.target;
|
|
2637
2652
|
s.contains(C) ? p.current = C : Fe(p.current, { select: !0 });
|
|
2638
|
-
},
|
|
2639
|
-
if (
|
|
2640
|
-
const C =
|
|
2653
|
+
}, g = function(y) {
|
|
2654
|
+
if (m.paused || !s) return;
|
|
2655
|
+
const C = y.relatedTarget;
|
|
2641
2656
|
C !== null && (s.contains(C) || Fe(p.current, { select: !0 }));
|
|
2642
|
-
}, w = function(
|
|
2657
|
+
}, w = function(y) {
|
|
2643
2658
|
if (document.activeElement === document.body)
|
|
2644
|
-
for (const S of
|
|
2659
|
+
for (const S of y)
|
|
2645
2660
|
S.removedNodes.length > 0 && Fe(s);
|
|
2646
2661
|
};
|
|
2647
|
-
document.addEventListener("focusin",
|
|
2648
|
-
const
|
|
2649
|
-
return s &&
|
|
2650
|
-
document.removeEventListener("focusin",
|
|
2662
|
+
document.addEventListener("focusin", f), document.addEventListener("focusout", g);
|
|
2663
|
+
const b = new MutationObserver(w);
|
|
2664
|
+
return s && b.observe(s, { childList: !0, subtree: !0 }), () => {
|
|
2665
|
+
document.removeEventListener("focusin", f), document.removeEventListener("focusout", g), b.disconnect();
|
|
2651
2666
|
};
|
|
2652
2667
|
}
|
|
2653
|
-
}, [r, s,
|
|
2668
|
+
}, [r, s, m.paused]), h.useEffect(() => {
|
|
2654
2669
|
if (s) {
|
|
2655
|
-
Gn.add(
|
|
2656
|
-
const
|
|
2657
|
-
if (!s.contains(
|
|
2670
|
+
Gn.add(m);
|
|
2671
|
+
const f = document.activeElement;
|
|
2672
|
+
if (!s.contains(f)) {
|
|
2658
2673
|
const w = new CustomEvent(Gt, Xn);
|
|
2659
|
-
s.addEventListener(Gt, c), s.dispatchEvent(w), w.defaultPrevented || (Gi(ts(jr(s)), { select: !0 }), document.activeElement ===
|
|
2674
|
+
s.addEventListener(Gt, c), s.dispatchEvent(w), w.defaultPrevented || (Gi(ts(jr(s)), { select: !0 }), document.activeElement === f && Fe(s));
|
|
2660
2675
|
}
|
|
2661
2676
|
return () => {
|
|
2662
2677
|
s.removeEventListener(Gt, c), setTimeout(() => {
|
|
2663
2678
|
const w = new CustomEvent(qt, Xn);
|
|
2664
|
-
s.addEventListener(qt,
|
|
2679
|
+
s.addEventListener(qt, d), s.dispatchEvent(w), w.defaultPrevented || Fe(f ?? document.body, { select: !0 }), s.removeEventListener(qt, d), Gn.remove(m);
|
|
2665
2680
|
}, 0);
|
|
2666
2681
|
};
|
|
2667
2682
|
}
|
|
2668
|
-
}, [s, c,
|
|
2669
|
-
const
|
|
2670
|
-
(
|
|
2671
|
-
if (!n && !r ||
|
|
2672
|
-
const
|
|
2673
|
-
if (
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2683
|
+
}, [s, c, d, m]);
|
|
2684
|
+
const x = h.useCallback(
|
|
2685
|
+
(f) => {
|
|
2686
|
+
if (!n && !r || m.paused) return;
|
|
2687
|
+
const g = f.key === "Tab" && !f.altKey && !f.ctrlKey && !f.metaKey, w = document.activeElement;
|
|
2688
|
+
if (g && w) {
|
|
2689
|
+
const b = f.currentTarget, [y, C] = qi(b);
|
|
2690
|
+
y && C ? !f.shiftKey && w === C ? (f.preventDefault(), n && Fe(y, { select: !0 })) : f.shiftKey && w === y && (f.preventDefault(), n && Fe(C, { select: !0 })) : w === b && f.preventDefault();
|
|
2676
2691
|
}
|
|
2677
2692
|
},
|
|
2678
|
-
[n, r,
|
|
2693
|
+
[n, r, m.paused]
|
|
2679
2694
|
);
|
|
2680
|
-
return /* @__PURE__ */
|
|
2695
|
+
return /* @__PURE__ */ T(X.div, { tabIndex: -1, ...i, ref: v, onKeyDown: x });
|
|
2681
2696
|
});
|
|
2682
2697
|
Ur.displayName = Zi;
|
|
2683
2698
|
function Gi(e, { select: t = !1 } = {}) {
|
|
@@ -2862,48 +2877,48 @@ function er(e, t, n) {
|
|
|
2862
2877
|
reference: r,
|
|
2863
2878
|
floating: o
|
|
2864
2879
|
} = e;
|
|
2865
|
-
const a = ye(t), i = In(t), s = Rn(i), l = Le(t), c = a === "y",
|
|
2866
|
-
let
|
|
2880
|
+
const a = ye(t), i = In(t), s = Rn(i), l = Le(t), c = a === "y", d = r.x + r.width / 2 - o.width / 2, p = r.y + r.height / 2 - o.height / 2, v = r[s] / 2 - o[s] / 2;
|
|
2881
|
+
let m;
|
|
2867
2882
|
switch (l) {
|
|
2868
2883
|
case "top":
|
|
2869
|
-
|
|
2870
|
-
x:
|
|
2884
|
+
m = {
|
|
2885
|
+
x: d,
|
|
2871
2886
|
y: r.y - o.height
|
|
2872
2887
|
};
|
|
2873
2888
|
break;
|
|
2874
2889
|
case "bottom":
|
|
2875
|
-
|
|
2876
|
-
x:
|
|
2890
|
+
m = {
|
|
2891
|
+
x: d,
|
|
2877
2892
|
y: r.y + r.height
|
|
2878
2893
|
};
|
|
2879
2894
|
break;
|
|
2880
2895
|
case "right":
|
|
2881
|
-
|
|
2896
|
+
m = {
|
|
2882
2897
|
x: r.x + r.width,
|
|
2883
2898
|
y: p
|
|
2884
2899
|
};
|
|
2885
2900
|
break;
|
|
2886
2901
|
case "left":
|
|
2887
|
-
|
|
2902
|
+
m = {
|
|
2888
2903
|
x: r.x - o.width,
|
|
2889
2904
|
y: p
|
|
2890
2905
|
};
|
|
2891
2906
|
break;
|
|
2892
2907
|
default:
|
|
2893
|
-
|
|
2908
|
+
m = {
|
|
2894
2909
|
x: r.x,
|
|
2895
2910
|
y: r.y
|
|
2896
2911
|
};
|
|
2897
2912
|
}
|
|
2898
2913
|
switch (st(t)) {
|
|
2899
2914
|
case "start":
|
|
2900
|
-
|
|
2915
|
+
m[i] -= v * (n && c ? -1 : 1);
|
|
2901
2916
|
break;
|
|
2902
2917
|
case "end":
|
|
2903
|
-
|
|
2918
|
+
m[i] += v * (n && c ? -1 : 1);
|
|
2904
2919
|
break;
|
|
2905
2920
|
}
|
|
2906
|
-
return
|
|
2921
|
+
return m;
|
|
2907
2922
|
}
|
|
2908
2923
|
const vs = async (e, t, n) => {
|
|
2909
2924
|
const {
|
|
@@ -2917,25 +2932,25 @@ const vs = async (e, t, n) => {
|
|
|
2917
2932
|
floating: t,
|
|
2918
2933
|
strategy: o
|
|
2919
2934
|
}), {
|
|
2920
|
-
x:
|
|
2935
|
+
x: d,
|
|
2921
2936
|
y: p
|
|
2922
|
-
} = er(c, r, l), v = r,
|
|
2923
|
-
for (let
|
|
2937
|
+
} = er(c, r, l), v = r, m = {}, x = 0;
|
|
2938
|
+
for (let f = 0; f < s.length; f++) {
|
|
2924
2939
|
const {
|
|
2925
|
-
name:
|
|
2940
|
+
name: g,
|
|
2926
2941
|
fn: w
|
|
2927
|
-
} = s[
|
|
2928
|
-
x:
|
|
2929
|
-
y
|
|
2942
|
+
} = s[f], {
|
|
2943
|
+
x: b,
|
|
2944
|
+
y,
|
|
2930
2945
|
data: C,
|
|
2931
2946
|
reset: S
|
|
2932
2947
|
} = await w({
|
|
2933
|
-
x:
|
|
2948
|
+
x: d,
|
|
2934
2949
|
y: p,
|
|
2935
2950
|
initialPlacement: r,
|
|
2936
2951
|
placement: v,
|
|
2937
2952
|
strategy: o,
|
|
2938
|
-
middlewareData:
|
|
2953
|
+
middlewareData: m,
|
|
2939
2954
|
rects: c,
|
|
2940
2955
|
platform: i,
|
|
2941
2956
|
elements: {
|
|
@@ -2943,27 +2958,27 @@ const vs = async (e, t, n) => {
|
|
|
2943
2958
|
floating: t
|
|
2944
2959
|
}
|
|
2945
2960
|
});
|
|
2946
|
-
|
|
2947
|
-
...
|
|
2948
|
-
[
|
|
2949
|
-
...g
|
|
2961
|
+
d = b ?? d, p = y ?? p, m = {
|
|
2962
|
+
...m,
|
|
2963
|
+
[g]: {
|
|
2964
|
+
...m[g],
|
|
2950
2965
|
...C
|
|
2951
2966
|
}
|
|
2952
|
-
}, S &&
|
|
2967
|
+
}, S && x <= 50 && (x++, typeof S == "object" && (S.placement && (v = S.placement), S.rects && (c = S.rects === !0 ? await i.getElementRects({
|
|
2953
2968
|
reference: e,
|
|
2954
2969
|
floating: t,
|
|
2955
2970
|
strategy: o
|
|
2956
2971
|
}) : S.rects), {
|
|
2957
|
-
x:
|
|
2972
|
+
x: d,
|
|
2958
2973
|
y: p
|
|
2959
|
-
} = er(c, v, l)),
|
|
2974
|
+
} = er(c, v, l)), f = -1);
|
|
2960
2975
|
}
|
|
2961
2976
|
return {
|
|
2962
|
-
x:
|
|
2977
|
+
x: d,
|
|
2963
2978
|
y: p,
|
|
2964
2979
|
placement: v,
|
|
2965
2980
|
strategy: o,
|
|
2966
|
-
middlewareData:
|
|
2981
|
+
middlewareData: m
|
|
2967
2982
|
};
|
|
2968
2983
|
};
|
|
2969
2984
|
async function wt(e, t) {
|
|
@@ -2978,21 +2993,21 @@ async function wt(e, t) {
|
|
|
2978
2993
|
strategy: l
|
|
2979
2994
|
} = e, {
|
|
2980
2995
|
boundary: c = "clippingAncestors",
|
|
2981
|
-
rootBoundary:
|
|
2996
|
+
rootBoundary: d = "viewport",
|
|
2982
2997
|
elementContext: p = "floating",
|
|
2983
2998
|
altBoundary: v = !1,
|
|
2984
|
-
padding:
|
|
2985
|
-
} = Oe(t, e),
|
|
2986
|
-
element: (n = await (a.isElement == null ? void 0 : a.isElement(
|
|
2999
|
+
padding: m = 0
|
|
3000
|
+
} = Oe(t, e), x = Yr(m), g = s[v ? p === "floating" ? "reference" : "floating" : p], w = Mt(await a.getClippingRect({
|
|
3001
|
+
element: (n = await (a.isElement == null ? void 0 : a.isElement(g))) == null || n ? g : g.contextElement || await (a.getDocumentElement == null ? void 0 : a.getDocumentElement(s.floating)),
|
|
2987
3002
|
boundary: c,
|
|
2988
|
-
rootBoundary:
|
|
3003
|
+
rootBoundary: d,
|
|
2989
3004
|
strategy: l
|
|
2990
|
-
})),
|
|
3005
|
+
})), b = p === "floating" ? {
|
|
2991
3006
|
x: r,
|
|
2992
3007
|
y: o,
|
|
2993
3008
|
width: i.floating.width,
|
|
2994
3009
|
height: i.floating.height
|
|
2995
|
-
} : i.reference,
|
|
3010
|
+
} : i.reference, y = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(s.floating)), C = await (a.isElement == null ? void 0 : a.isElement(y)) ? await (a.getScale == null ? void 0 : a.getScale(y)) || {
|
|
2996
3011
|
x: 1,
|
|
2997
3012
|
y: 1
|
|
2998
3013
|
} : {
|
|
@@ -3000,18 +3015,18 @@ async function wt(e, t) {
|
|
|
3000
3015
|
y: 1
|
|
3001
3016
|
}, S = Mt(a.convertOffsetParentRelativeRectToViewportRelativeRect ? await a.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
3002
3017
|
elements: s,
|
|
3003
|
-
rect:
|
|
3004
|
-
offsetParent:
|
|
3018
|
+
rect: b,
|
|
3019
|
+
offsetParent: y,
|
|
3005
3020
|
strategy: l
|
|
3006
|
-
}) :
|
|
3021
|
+
}) : b);
|
|
3007
3022
|
return {
|
|
3008
|
-
top: (w.top - S.top +
|
|
3009
|
-
bottom: (S.bottom - w.bottom +
|
|
3010
|
-
left: (w.left - S.left +
|
|
3011
|
-
right: (S.right - w.right +
|
|
3023
|
+
top: (w.top - S.top + x.top) / C.y,
|
|
3024
|
+
bottom: (S.bottom - w.bottom + x.bottom) / C.y,
|
|
3025
|
+
left: (w.left - S.left + x.left) / C.x,
|
|
3026
|
+
right: (S.right - w.right + x.right) / C.x
|
|
3012
3027
|
};
|
|
3013
3028
|
}
|
|
3014
|
-
const
|
|
3029
|
+
const gs = (e) => ({
|
|
3015
3030
|
name: "arrow",
|
|
3016
3031
|
options: e,
|
|
3017
3032
|
async fn(t) {
|
|
@@ -3025,22 +3040,22 @@ const ms = (e) => ({
|
|
|
3025
3040
|
middlewareData: l
|
|
3026
3041
|
} = t, {
|
|
3027
3042
|
element: c,
|
|
3028
|
-
padding:
|
|
3043
|
+
padding: d = 0
|
|
3029
3044
|
} = Oe(e, t) || {};
|
|
3030
3045
|
if (c == null)
|
|
3031
3046
|
return {};
|
|
3032
|
-
const p = Yr(
|
|
3047
|
+
const p = Yr(d), v = {
|
|
3033
3048
|
x: n,
|
|
3034
3049
|
y: r
|
|
3035
|
-
},
|
|
3036
|
-
let k =
|
|
3037
|
-
(!k || !await (i.isElement == null ? void 0 : i.isElement(
|
|
3038
|
-
const I = C / 2 - S / 2, D = k / 2 -
|
|
3050
|
+
}, m = In(o), x = Rn(m), f = await i.getDimensions(c), g = m === "y", w = g ? "top" : "left", b = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", C = a.reference[x] + a.reference[m] - v[m] - a.floating[x], S = v[m] - a.reference[m], E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c));
|
|
3051
|
+
let k = E ? E[y] : 0;
|
|
3052
|
+
(!k || !await (i.isElement == null ? void 0 : i.isElement(E))) && (k = s.floating[y] || a.floating[x]);
|
|
3053
|
+
const I = C / 2 - S / 2, D = k / 2 - f[x] / 2 - 1, L = ze(p[w], D), $ = ze(p[b], D), W = L, F = k - f[x] - $, N = k / 2 - f[x] / 2 + I, _ = ln(W, N, F), O = !l.arrow && st(o) != null && N !== _ && a.reference[x] / 2 - (N < W ? L : $) - f[x] / 2 < 0, M = O ? N < W ? N - W : N - F : 0;
|
|
3039
3054
|
return {
|
|
3040
|
-
[
|
|
3055
|
+
[m]: v[m] + M,
|
|
3041
3056
|
data: {
|
|
3042
|
-
[
|
|
3043
|
-
centerOffset:
|
|
3057
|
+
[m]: _,
|
|
3058
|
+
centerOffset: N - _ - M,
|
|
3044
3059
|
...O && {
|
|
3045
3060
|
alignmentOffset: M
|
|
3046
3061
|
}
|
|
@@ -3048,7 +3063,7 @@ const ms = (e) => ({
|
|
|
3048
3063
|
reset: O
|
|
3049
3064
|
};
|
|
3050
3065
|
}
|
|
3051
|
-
}),
|
|
3066
|
+
}), ms = function(e) {
|
|
3052
3067
|
return e === void 0 && (e = {}), {
|
|
3053
3068
|
name: "flip",
|
|
3054
3069
|
options: e,
|
|
@@ -3062,56 +3077,56 @@ const ms = (e) => ({
|
|
|
3062
3077
|
platform: l,
|
|
3063
3078
|
elements: c
|
|
3064
3079
|
} = t, {
|
|
3065
|
-
mainAxis:
|
|
3080
|
+
mainAxis: d = !0,
|
|
3066
3081
|
crossAxis: p = !0,
|
|
3067
3082
|
fallbackPlacements: v,
|
|
3068
|
-
fallbackStrategy:
|
|
3069
|
-
fallbackAxisSideDirection:
|
|
3070
|
-
flipAlignment:
|
|
3071
|
-
...
|
|
3083
|
+
fallbackStrategy: m = "bestFit",
|
|
3084
|
+
fallbackAxisSideDirection: x = "none",
|
|
3085
|
+
flipAlignment: f = !0,
|
|
3086
|
+
...g
|
|
3072
3087
|
} = Oe(e, t);
|
|
3073
3088
|
if ((n = a.arrow) != null && n.alignmentOffset)
|
|
3074
3089
|
return {};
|
|
3075
|
-
const w = Le(o),
|
|
3076
|
-
!v &&
|
|
3077
|
-
const k = [s, ...S], I = await wt(t,
|
|
3090
|
+
const w = Le(o), b = ye(s), y = Le(s) === s, C = await (l.isRTL == null ? void 0 : l.isRTL(c.floating)), S = v || (y || !f ? [Lt(s)] : cs(s)), E = x !== "none";
|
|
3091
|
+
!v && E && S.push(...ps(s, f, x, C));
|
|
3092
|
+
const k = [s, ...S], I = await wt(t, g), D = [];
|
|
3078
3093
|
let L = ((r = a.flip) == null ? void 0 : r.overflows) || [];
|
|
3079
|
-
if (
|
|
3080
|
-
const
|
|
3081
|
-
D.push(I[
|
|
3094
|
+
if (d && D.push(I[w]), p) {
|
|
3095
|
+
const N = ls(o, i, C);
|
|
3096
|
+
D.push(I[N[0]], I[N[1]]);
|
|
3082
3097
|
}
|
|
3083
3098
|
if (L = [...L, {
|
|
3084
3099
|
placement: o,
|
|
3085
3100
|
overflows: D
|
|
3086
|
-
}], !D.every((
|
|
3101
|
+
}], !D.every((N) => N <= 0)) {
|
|
3087
3102
|
var $, W;
|
|
3088
|
-
const
|
|
3089
|
-
if (
|
|
3103
|
+
const N = ((($ = a.flip) == null ? void 0 : $.index) || 0) + 1, _ = k[N];
|
|
3104
|
+
if (_ && (!(p === "alignment" ? b !== ye(_) : !1) || // We leave the current main axis only if every placement on that axis
|
|
3090
3105
|
// overflows the main axis.
|
|
3091
|
-
L.every((P) => ye(P.placement) ===
|
|
3106
|
+
L.every((P) => ye(P.placement) === b ? P.overflows[0] > 0 : !0)))
|
|
3092
3107
|
return {
|
|
3093
3108
|
data: {
|
|
3094
|
-
index:
|
|
3109
|
+
index: N,
|
|
3095
3110
|
overflows: L
|
|
3096
3111
|
},
|
|
3097
3112
|
reset: {
|
|
3098
|
-
placement:
|
|
3113
|
+
placement: _
|
|
3099
3114
|
}
|
|
3100
3115
|
};
|
|
3101
3116
|
let O = (W = L.filter((M) => M.overflows[0] <= 0).sort((M, P) => M.overflows[1] - P.overflows[1])[0]) == null ? void 0 : W.placement;
|
|
3102
3117
|
if (!O)
|
|
3103
|
-
switch (
|
|
3118
|
+
switch (m) {
|
|
3104
3119
|
case "bestFit": {
|
|
3105
|
-
var
|
|
3106
|
-
const M = (
|
|
3107
|
-
if (
|
|
3120
|
+
var F;
|
|
3121
|
+
const M = (F = L.filter((P) => {
|
|
3122
|
+
if (E) {
|
|
3108
3123
|
const z = ye(P.placement);
|
|
3109
|
-
return z ===
|
|
3124
|
+
return z === b || // Create a bias to the `y` side axis due to horizontal
|
|
3110
3125
|
// reading directions favoring greater width.
|
|
3111
3126
|
z === "y";
|
|
3112
3127
|
}
|
|
3113
3128
|
return !0;
|
|
3114
|
-
}).map((P) => [P.placement, P.overflows.filter((z) => z > 0).reduce((z,
|
|
3129
|
+
}).map((P) => [P.placement, P.overflows.filter((z) => z > 0).reduce((z, Q) => z + Q, 0)]).sort((P, z) => P[1] - z[1])[0]) == null ? void 0 : F[0];
|
|
3115
3130
|
M && (O = M);
|
|
3116
3131
|
break;
|
|
3117
3132
|
}
|
|
@@ -3188,11 +3203,11 @@ async function bs(e, t) {
|
|
|
3188
3203
|
placement: n,
|
|
3189
3204
|
platform: r,
|
|
3190
3205
|
elements: o
|
|
3191
|
-
} = e, a = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Le(n), s = st(n), l = ye(n) === "y", c = Kr.has(i) ? -1 : 1,
|
|
3206
|
+
} = e, a = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), i = Le(n), s = st(n), l = ye(n) === "y", c = Kr.has(i) ? -1 : 1, d = a && l ? -1 : 1, p = Oe(t, e);
|
|
3192
3207
|
let {
|
|
3193
3208
|
mainAxis: v,
|
|
3194
|
-
crossAxis:
|
|
3195
|
-
alignmentAxis:
|
|
3209
|
+
crossAxis: m,
|
|
3210
|
+
alignmentAxis: x
|
|
3196
3211
|
} = typeof p == "number" ? {
|
|
3197
3212
|
mainAxis: p,
|
|
3198
3213
|
crossAxis: 0,
|
|
@@ -3202,12 +3217,12 @@ async function bs(e, t) {
|
|
|
3202
3217
|
crossAxis: p.crossAxis || 0,
|
|
3203
3218
|
alignmentAxis: p.alignmentAxis
|
|
3204
3219
|
};
|
|
3205
|
-
return s && typeof
|
|
3206
|
-
x:
|
|
3220
|
+
return s && typeof x == "number" && (m = s === "end" ? x * -1 : x), l ? {
|
|
3221
|
+
x: m * d,
|
|
3207
3222
|
y: v * c
|
|
3208
3223
|
} : {
|
|
3209
3224
|
x: v * c,
|
|
3210
|
-
y:
|
|
3225
|
+
y: m * d
|
|
3211
3226
|
};
|
|
3212
3227
|
}
|
|
3213
3228
|
const xs = function(e) {
|
|
@@ -3245,14 +3260,14 @@ const xs = function(e) {
|
|
|
3245
3260
|
mainAxis: a = !0,
|
|
3246
3261
|
crossAxis: i = !1,
|
|
3247
3262
|
limiter: s = {
|
|
3248
|
-
fn: (
|
|
3263
|
+
fn: (g) => {
|
|
3249
3264
|
let {
|
|
3250
3265
|
x: w,
|
|
3251
|
-
y
|
|
3252
|
-
} =
|
|
3266
|
+
y: b
|
|
3267
|
+
} = g;
|
|
3253
3268
|
return {
|
|
3254
3269
|
x: w,
|
|
3255
|
-
y
|
|
3270
|
+
y: b
|
|
3256
3271
|
};
|
|
3257
3272
|
}
|
|
3258
3273
|
},
|
|
@@ -3260,26 +3275,26 @@ const xs = function(e) {
|
|
|
3260
3275
|
} = Oe(e, t), c = {
|
|
3261
3276
|
x: n,
|
|
3262
3277
|
y: r
|
|
3263
|
-
},
|
|
3264
|
-
let
|
|
3278
|
+
}, d = await wt(t, l), p = ye(Le(o)), v = Pn(p);
|
|
3279
|
+
let m = c[v], x = c[p];
|
|
3265
3280
|
if (a) {
|
|
3266
|
-
const
|
|
3267
|
-
|
|
3281
|
+
const g = v === "y" ? "top" : "left", w = v === "y" ? "bottom" : "right", b = m + d[g], y = m - d[w];
|
|
3282
|
+
m = ln(b, m, y);
|
|
3268
3283
|
}
|
|
3269
3284
|
if (i) {
|
|
3270
|
-
const
|
|
3271
|
-
|
|
3285
|
+
const g = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", b = x + d[g], y = x - d[w];
|
|
3286
|
+
x = ln(b, x, y);
|
|
3272
3287
|
}
|
|
3273
|
-
const
|
|
3288
|
+
const f = s.fn({
|
|
3274
3289
|
...t,
|
|
3275
|
-
[v]:
|
|
3276
|
-
[p]:
|
|
3290
|
+
[v]: m,
|
|
3291
|
+
[p]: x
|
|
3277
3292
|
});
|
|
3278
3293
|
return {
|
|
3279
|
-
...
|
|
3294
|
+
...f,
|
|
3280
3295
|
data: {
|
|
3281
|
-
x:
|
|
3282
|
-
y:
|
|
3296
|
+
x: f.x - n,
|
|
3297
|
+
y: f.y - r,
|
|
3283
3298
|
enabled: {
|
|
3284
3299
|
[v]: a,
|
|
3285
3300
|
[p]: i
|
|
@@ -3302,31 +3317,31 @@ const xs = function(e) {
|
|
|
3302
3317
|
offset: s = 0,
|
|
3303
3318
|
mainAxis: l = !0,
|
|
3304
3319
|
crossAxis: c = !0
|
|
3305
|
-
} = Oe(e, t),
|
|
3320
|
+
} = Oe(e, t), d = {
|
|
3306
3321
|
x: n,
|
|
3307
3322
|
y: r
|
|
3308
3323
|
}, p = ye(o), v = Pn(p);
|
|
3309
|
-
let
|
|
3310
|
-
const
|
|
3311
|
-
mainAxis:
|
|
3324
|
+
let m = d[v], x = d[p];
|
|
3325
|
+
const f = Oe(s, t), g = typeof f == "number" ? {
|
|
3326
|
+
mainAxis: f,
|
|
3312
3327
|
crossAxis: 0
|
|
3313
3328
|
} : {
|
|
3314
3329
|
mainAxis: 0,
|
|
3315
3330
|
crossAxis: 0,
|
|
3316
|
-
...
|
|
3331
|
+
...f
|
|
3317
3332
|
};
|
|
3318
3333
|
if (l) {
|
|
3319
|
-
const
|
|
3320
|
-
|
|
3334
|
+
const y = v === "y" ? "height" : "width", C = a.reference[v] - a.floating[y] + g.mainAxis, S = a.reference[v] + a.reference[y] - g.mainAxis;
|
|
3335
|
+
m < C ? m = C : m > S && (m = S);
|
|
3321
3336
|
}
|
|
3322
3337
|
if (c) {
|
|
3323
|
-
var w,
|
|
3324
|
-
const
|
|
3325
|
-
|
|
3338
|
+
var w, b;
|
|
3339
|
+
const y = v === "y" ? "width" : "height", C = Kr.has(Le(o)), S = a.reference[p] - a.floating[y] + (C && ((w = i.offset) == null ? void 0 : w[p]) || 0) + (C ? 0 : g.crossAxis), E = a.reference[p] + a.reference[y] + (C ? 0 : ((b = i.offset) == null ? void 0 : b[p]) || 0) - (C ? g.crossAxis : 0);
|
|
3340
|
+
x < S ? x = S : x > E && (x = E);
|
|
3326
3341
|
}
|
|
3327
3342
|
return {
|
|
3328
|
-
[v]:
|
|
3329
|
-
[p]:
|
|
3343
|
+
[v]: m,
|
|
3344
|
+
[p]: x
|
|
3330
3345
|
};
|
|
3331
3346
|
}
|
|
3332
3347
|
};
|
|
@@ -3345,17 +3360,17 @@ const xs = function(e) {
|
|
|
3345
3360
|
apply: l = () => {
|
|
3346
3361
|
},
|
|
3347
3362
|
...c
|
|
3348
|
-
} = Oe(e, t),
|
|
3349
|
-
width:
|
|
3350
|
-
height:
|
|
3363
|
+
} = Oe(e, t), d = await wt(t, c), p = Le(o), v = st(o), m = ye(o) === "y", {
|
|
3364
|
+
width: x,
|
|
3365
|
+
height: f
|
|
3351
3366
|
} = a.floating;
|
|
3352
|
-
let
|
|
3353
|
-
p === "top" || p === "bottom" ? (
|
|
3354
|
-
const
|
|
3367
|
+
let g, w;
|
|
3368
|
+
p === "top" || p === "bottom" ? (g = p, w = v === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (w = p, g = v === "end" ? "top" : "bottom");
|
|
3369
|
+
const b = f - d.top - d.bottom, y = x - d.left - d.right, C = ze(f - d[g], b), S = ze(x - d[w], y), E = !t.middlewareData.shift;
|
|
3355
3370
|
let k = C, I = S;
|
|
3356
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I =
|
|
3357
|
-
const L = ce(
|
|
3358
|
-
|
|
3371
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = y), (r = t.middlewareData.shift) != null && r.enabled.y && (k = b), E && !v) {
|
|
3372
|
+
const L = ce(d.left, 0), $ = ce(d.right, 0), W = ce(d.top, 0), F = ce(d.bottom, 0);
|
|
3373
|
+
m ? I = x - 2 * (L !== 0 || $ !== 0 ? L + $ : ce(d.left, d.right)) : k = f - 2 * (W !== 0 || F !== 0 ? W + F : ce(d.top, d.bottom));
|
|
3359
3374
|
}
|
|
3360
3375
|
await l({
|
|
3361
3376
|
...t,
|
|
@@ -3363,7 +3378,7 @@ const xs = function(e) {
|
|
|
3363
3378
|
availableHeight: k
|
|
3364
3379
|
});
|
|
3365
3380
|
const D = await i.getDimensions(s.floating);
|
|
3366
|
-
return
|
|
3381
|
+
return x !== D.width || f !== D.height ? {
|
|
3367
3382
|
reset: {
|
|
3368
3383
|
rects: !0
|
|
3369
3384
|
}
|
|
@@ -3388,7 +3403,7 @@ function _e(e) {
|
|
|
3388
3403
|
function Xr(e) {
|
|
3389
3404
|
return Vt() ? e instanceof Node || e instanceof ue(e).Node : !1;
|
|
3390
3405
|
}
|
|
3391
|
-
function
|
|
3406
|
+
function ge(e) {
|
|
3392
3407
|
return Vt() ? e instanceof Element || e instanceof ue(e).Element : !1;
|
|
3393
3408
|
}
|
|
3394
3409
|
function Te(e) {
|
|
@@ -3404,7 +3419,7 @@ function xt(e) {
|
|
|
3404
3419
|
overflowX: n,
|
|
3405
3420
|
overflowY: r,
|
|
3406
3421
|
display: o
|
|
3407
|
-
} =
|
|
3422
|
+
} = me(e);
|
|
3408
3423
|
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !ks.has(o);
|
|
3409
3424
|
}
|
|
3410
3425
|
const Es = /* @__PURE__ */ new Set(["table", "td", "th"]);
|
|
@@ -3423,7 +3438,7 @@ function $t(e) {
|
|
|
3423
3438
|
}
|
|
3424
3439
|
const _s = ["transform", "translate", "scale", "rotate", "perspective"], Ps = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Rs = ["paint", "layout", "strict", "content"];
|
|
3425
3440
|
function Nn(e) {
|
|
3426
|
-
const t = On(), n =
|
|
3441
|
+
const t = On(), n = ge(e) ? me(e) : e;
|
|
3427
3442
|
return _s.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || Ps.some((r) => (n.willChange || "").includes(r)) || Rs.some((r) => (n.contain || "").includes(r));
|
|
3428
3443
|
}
|
|
3429
3444
|
function Is(e) {
|
|
@@ -3444,11 +3459,11 @@ const Ns = /* @__PURE__ */ new Set(["html", "body", "#document"]);
|
|
|
3444
3459
|
function ot(e) {
|
|
3445
3460
|
return Ns.has(lt(e));
|
|
3446
3461
|
}
|
|
3447
|
-
function
|
|
3462
|
+
function me(e) {
|
|
3448
3463
|
return ue(e).getComputedStyle(e);
|
|
3449
3464
|
}
|
|
3450
3465
|
function Wt(e) {
|
|
3451
|
-
return
|
|
3466
|
+
return ge(e) ? {
|
|
3452
3467
|
scrollLeft: e.scrollLeft,
|
|
3453
3468
|
scrollTop: e.scrollTop
|
|
3454
3469
|
} : {
|
|
@@ -3486,7 +3501,7 @@ function un(e) {
|
|
|
3486
3501
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
3487
3502
|
}
|
|
3488
3503
|
function Gr(e) {
|
|
3489
|
-
const t =
|
|
3504
|
+
const t = me(e);
|
|
3490
3505
|
let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
|
|
3491
3506
|
const o = Te(e), a = o ? e.offsetWidth : n, i = o ? e.offsetHeight : r, s = Ot(n) !== a || Ot(r) !== i;
|
|
3492
3507
|
return s && (n = a, r = i), {
|
|
@@ -3496,7 +3511,7 @@ function Gr(e) {
|
|
|
3496
3511
|
};
|
|
3497
3512
|
}
|
|
3498
3513
|
function Ln(e) {
|
|
3499
|
-
return
|
|
3514
|
+
return ge(e) ? e : e.contextElement;
|
|
3500
3515
|
}
|
|
3501
3516
|
function tt(e) {
|
|
3502
3517
|
const t = Ln(e);
|
|
@@ -3528,19 +3543,19 @@ function Ye(e, t, n, r) {
|
|
|
3528
3543
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
3529
3544
|
const o = e.getBoundingClientRect(), a = Ln(e);
|
|
3530
3545
|
let i = ke(1);
|
|
3531
|
-
t && (r ?
|
|
3546
|
+
t && (r ? ge(r) && (i = tt(r)) : i = tt(e));
|
|
3532
3547
|
const s = Ls(a, n, r) ? qr(a) : ke(0);
|
|
3533
|
-
let l = (o.left + s.x) / i.x, c = (o.top + s.y) / i.y,
|
|
3548
|
+
let l = (o.left + s.x) / i.x, c = (o.top + s.y) / i.y, d = o.width / i.x, p = o.height / i.y;
|
|
3534
3549
|
if (a) {
|
|
3535
|
-
const v = ue(a),
|
|
3536
|
-
let
|
|
3537
|
-
for (;
|
|
3538
|
-
const
|
|
3539
|
-
l *=
|
|
3550
|
+
const v = ue(a), m = r && ge(r) ? ue(r) : r;
|
|
3551
|
+
let x = v, f = un(x);
|
|
3552
|
+
for (; f && r && m !== x; ) {
|
|
3553
|
+
const g = tt(f), w = f.getBoundingClientRect(), b = me(f), y = w.left + (f.clientLeft + parseFloat(b.paddingLeft)) * g.x, C = w.top + (f.clientTop + parseFloat(b.paddingTop)) * g.y;
|
|
3554
|
+
l *= g.x, c *= g.y, d *= g.x, p *= g.y, l += y, c += C, x = ue(f), f = un(x);
|
|
3540
3555
|
}
|
|
3541
3556
|
}
|
|
3542
3557
|
return Mt({
|
|
3543
|
-
width:
|
|
3558
|
+
width: d,
|
|
3544
3559
|
height: p,
|
|
3545
3560
|
x: l,
|
|
3546
3561
|
y: c
|
|
@@ -3575,17 +3590,17 @@ function Ms(e) {
|
|
|
3575
3590
|
scrollLeft: 0,
|
|
3576
3591
|
scrollTop: 0
|
|
3577
3592
|
}, c = ke(1);
|
|
3578
|
-
const
|
|
3593
|
+
const d = ke(0), p = Te(r);
|
|
3579
3594
|
if ((p || !p && !a) && ((lt(r) !== "body" || xt(i)) && (l = Wt(r)), Te(r))) {
|
|
3580
|
-
const
|
|
3581
|
-
c = tt(r),
|
|
3595
|
+
const m = Ye(r);
|
|
3596
|
+
c = tt(r), d.x = m.x + r.clientLeft, d.y = m.y + r.clientTop;
|
|
3582
3597
|
}
|
|
3583
3598
|
const v = i && !p && !a ? Qr(i, l, !0) : ke(0);
|
|
3584
3599
|
return {
|
|
3585
3600
|
width: n.width * c.x,
|
|
3586
3601
|
height: n.height * c.y,
|
|
3587
|
-
x: n.x * c.x - l.scrollLeft * c.x +
|
|
3588
|
-
y: n.y * c.y - l.scrollTop * c.y +
|
|
3602
|
+
x: n.x * c.x - l.scrollLeft * c.x + d.x + v.x,
|
|
3603
|
+
y: n.y * c.y - l.scrollTop * c.y + d.y + v.y
|
|
3589
3604
|
};
|
|
3590
3605
|
}
|
|
3591
3606
|
function Ds(e) {
|
|
@@ -3595,7 +3610,7 @@ function Fs(e) {
|
|
|
3595
3610
|
const t = _e(e), n = Wt(e), r = e.ownerDocument.body, o = ce(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), a = ce(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
|
|
3596
3611
|
let i = -n.scrollLeft + Mn(e);
|
|
3597
3612
|
const s = -n.scrollTop;
|
|
3598
|
-
return
|
|
3613
|
+
return me(r).direction === "rtl" && (i += ce(t.clientWidth, r.clientWidth) - o), {
|
|
3599
3614
|
width: o,
|
|
3600
3615
|
height: a,
|
|
3601
3616
|
x: i,
|
|
@@ -3633,7 +3648,7 @@ function or(e, t, n) {
|
|
|
3633
3648
|
r = Bs(e, n);
|
|
3634
3649
|
else if (t === "document")
|
|
3635
3650
|
r = Fs(_e(e));
|
|
3636
|
-
else if (
|
|
3651
|
+
else if (ge(t))
|
|
3637
3652
|
r = Vs(t, n);
|
|
3638
3653
|
else {
|
|
3639
3654
|
const o = qr(e);
|
|
@@ -3648,18 +3663,18 @@ function or(e, t, n) {
|
|
|
3648
3663
|
}
|
|
3649
3664
|
function Jr(e, t) {
|
|
3650
3665
|
const n = Ve(e);
|
|
3651
|
-
return n === t || !
|
|
3666
|
+
return n === t || !ge(n) || ot(n) ? !1 : me(n).position === "fixed" || Jr(n, t);
|
|
3652
3667
|
}
|
|
3653
3668
|
function $s(e, t) {
|
|
3654
3669
|
const n = t.get(e);
|
|
3655
3670
|
if (n)
|
|
3656
3671
|
return n;
|
|
3657
|
-
let r = bt(e, [], !1).filter((s) =>
|
|
3658
|
-
const a =
|
|
3672
|
+
let r = bt(e, [], !1).filter((s) => ge(s) && lt(s) !== "body"), o = null;
|
|
3673
|
+
const a = me(e).position === "fixed";
|
|
3659
3674
|
let i = a ? Ve(e) : e;
|
|
3660
|
-
for (;
|
|
3661
|
-
const s =
|
|
3662
|
-
!l && s.position === "fixed" && (o = null), (a ? !l && !o : !l && s.position === "static" && !!o && zs.has(o.position) || xt(i) && !l && Jr(e, i)) ? r = r.filter((
|
|
3675
|
+
for (; ge(i) && !ot(i); ) {
|
|
3676
|
+
const s = me(i), l = Nn(i);
|
|
3677
|
+
!l && s.position === "fixed" && (o = null), (a ? !l && !o : !l && s.position === "static" && !!o && zs.has(o.position) || xt(i) && !l && Jr(e, i)) ? r = r.filter((d) => d !== i) : o = s, i = Ve(i);
|
|
3663
3678
|
}
|
|
3664
3679
|
return t.set(e, r), r;
|
|
3665
3680
|
}
|
|
@@ -3670,8 +3685,8 @@ function Ws(e) {
|
|
|
3670
3685
|
rootBoundary: r,
|
|
3671
3686
|
strategy: o
|
|
3672
3687
|
} = e;
|
|
3673
|
-
const i = [...n === "clippingAncestors" ? $t(t) ? [] : $s(t, this._c) : [].concat(n), r], s = i[0], l = i.reduce((c,
|
|
3674
|
-
const p = or(t,
|
|
3688
|
+
const i = [...n === "clippingAncestors" ? $t(t) ? [] : $s(t, this._c) : [].concat(n), r], s = i[0], l = i.reduce((c, d) => {
|
|
3689
|
+
const p = or(t, d, o);
|
|
3675
3690
|
return c.top = ce(p.top, c.top), c.right = ze(p.right, c.right), c.bottom = ze(p.bottom, c.bottom), c.left = ce(p.left, c.left), c;
|
|
3676
3691
|
}, or(t, s, o));
|
|
3677
3692
|
return {
|
|
@@ -3703,11 +3718,11 @@ function Us(e, t, n) {
|
|
|
3703
3718
|
}
|
|
3704
3719
|
if (r || !r && !a)
|
|
3705
3720
|
if ((lt(t) !== "body" || xt(o)) && (s = Wt(t)), r) {
|
|
3706
|
-
const
|
|
3707
|
-
l.x =
|
|
3721
|
+
const m = Ye(t, !0, a, t);
|
|
3722
|
+
l.x = m.x + t.clientLeft, l.y = m.y + t.clientTop;
|
|
3708
3723
|
} else o && c();
|
|
3709
3724
|
a && !r && o && c();
|
|
3710
|
-
const
|
|
3725
|
+
const d = o && !r && !a ? Qr(o, s) : ke(0), p = i.left + s.scrollLeft - l.x - d.x, v = i.top + s.scrollTop - l.y - d.y;
|
|
3711
3726
|
return {
|
|
3712
3727
|
x: p,
|
|
3713
3728
|
y: v,
|
|
@@ -3716,10 +3731,10 @@ function Us(e, t, n) {
|
|
|
3716
3731
|
};
|
|
3717
3732
|
}
|
|
3718
3733
|
function Qt(e) {
|
|
3719
|
-
return
|
|
3734
|
+
return me(e).position === "static";
|
|
3720
3735
|
}
|
|
3721
3736
|
function ar(e, t) {
|
|
3722
|
-
if (!Te(e) ||
|
|
3737
|
+
if (!Te(e) || me(e).position === "fixed")
|
|
3723
3738
|
return null;
|
|
3724
3739
|
if (t)
|
|
3725
3740
|
return t(e);
|
|
@@ -3733,7 +3748,7 @@ function eo(e, t) {
|
|
|
3733
3748
|
if (!Te(e)) {
|
|
3734
3749
|
let o = Ve(e);
|
|
3735
3750
|
for (; o && !ot(o); ) {
|
|
3736
|
-
if (
|
|
3751
|
+
if (ge(o) && !Qt(o))
|
|
3737
3752
|
return o;
|
|
3738
3753
|
o = Ve(o);
|
|
3739
3754
|
}
|
|
@@ -3757,7 +3772,7 @@ const js = async function(e) {
|
|
|
3757
3772
|
};
|
|
3758
3773
|
};
|
|
3759
3774
|
function Ys(e) {
|
|
3760
|
-
return
|
|
3775
|
+
return me(e).direction === "rtl";
|
|
3761
3776
|
}
|
|
3762
3777
|
const Ks = {
|
|
3763
3778
|
convertOffsetParentRelativeRectToViewportRelativeRect: Ms,
|
|
@@ -3768,7 +3783,7 @@ const Ks = {
|
|
|
3768
3783
|
getClientRects: Ds,
|
|
3769
3784
|
getDimensions: Hs,
|
|
3770
3785
|
getScale: tt,
|
|
3771
|
-
isElement:
|
|
3786
|
+
isElement: ge,
|
|
3772
3787
|
isRTL: Ys
|
|
3773
3788
|
};
|
|
3774
3789
|
function to(e, t) {
|
|
@@ -3784,20 +3799,20 @@ function Xs(e, t) {
|
|
|
3784
3799
|
function i(s, l) {
|
|
3785
3800
|
s === void 0 && (s = !1), l === void 0 && (l = 1), a();
|
|
3786
3801
|
const c = e.getBoundingClientRect(), {
|
|
3787
|
-
left:
|
|
3802
|
+
left: d,
|
|
3788
3803
|
top: p,
|
|
3789
3804
|
width: v,
|
|
3790
|
-
height:
|
|
3805
|
+
height: m
|
|
3791
3806
|
} = c;
|
|
3792
|
-
if (s || t(), !v || !
|
|
3807
|
+
if (s || t(), !v || !m)
|
|
3793
3808
|
return;
|
|
3794
|
-
const
|
|
3795
|
-
rootMargin: -
|
|
3809
|
+
const x = St(p), f = St(o.clientWidth - (d + v)), g = St(o.clientHeight - (p + m)), w = St(d), y = {
|
|
3810
|
+
rootMargin: -x + "px " + -f + "px " + -g + "px " + -w + "px",
|
|
3796
3811
|
threshold: ce(0, ze(1, l)) || 1
|
|
3797
3812
|
};
|
|
3798
3813
|
let C = !0;
|
|
3799
|
-
function S(
|
|
3800
|
-
const k =
|
|
3814
|
+
function S(E) {
|
|
3815
|
+
const k = E[0].intersectionRatio;
|
|
3801
3816
|
if (k !== l) {
|
|
3802
3817
|
if (!C)
|
|
3803
3818
|
return i();
|
|
@@ -3809,12 +3824,12 @@ function Xs(e, t) {
|
|
|
3809
3824
|
}
|
|
3810
3825
|
try {
|
|
3811
3826
|
n = new IntersectionObserver(S, {
|
|
3812
|
-
...
|
|
3827
|
+
...y,
|
|
3813
3828
|
// Handle <iframe>s
|
|
3814
3829
|
root: o.ownerDocument
|
|
3815
3830
|
});
|
|
3816
3831
|
} catch {
|
|
3817
|
-
n = new IntersectionObserver(S,
|
|
3832
|
+
n = new IntersectionObserver(S, y);
|
|
3818
3833
|
}
|
|
3819
3834
|
n.observe(e);
|
|
3820
3835
|
}
|
|
@@ -3828,35 +3843,35 @@ function Zs(e, t, n, r) {
|
|
|
3828
3843
|
elementResize: i = typeof ResizeObserver == "function",
|
|
3829
3844
|
layoutShift: s = typeof IntersectionObserver == "function",
|
|
3830
3845
|
animationFrame: l = !1
|
|
3831
|
-
} = r, c = Ln(e),
|
|
3832
|
-
|
|
3846
|
+
} = r, c = Ln(e), d = o || a ? [...c ? bt(c) : [], ...bt(t)] : [];
|
|
3847
|
+
d.forEach((w) => {
|
|
3833
3848
|
o && w.addEventListener("scroll", n, {
|
|
3834
3849
|
passive: !0
|
|
3835
3850
|
}), a && w.addEventListener("resize", n);
|
|
3836
3851
|
});
|
|
3837
3852
|
const p = c && s ? Xs(c, n) : null;
|
|
3838
|
-
let v = -1,
|
|
3839
|
-
i && (
|
|
3840
|
-
let [
|
|
3841
|
-
|
|
3842
|
-
var
|
|
3843
|
-
(
|
|
3853
|
+
let v = -1, m = null;
|
|
3854
|
+
i && (m = new ResizeObserver((w) => {
|
|
3855
|
+
let [b] = w;
|
|
3856
|
+
b && b.target === c && m && (m.unobserve(t), cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
3857
|
+
var y;
|
|
3858
|
+
(y = m) == null || y.observe(t);
|
|
3844
3859
|
})), n();
|
|
3845
|
-
}), c && !l &&
|
|
3846
|
-
let
|
|
3847
|
-
l &&
|
|
3848
|
-
function
|
|
3860
|
+
}), c && !l && m.observe(c), m.observe(t));
|
|
3861
|
+
let x, f = l ? Ye(e) : null;
|
|
3862
|
+
l && g();
|
|
3863
|
+
function g() {
|
|
3849
3864
|
const w = Ye(e);
|
|
3850
|
-
|
|
3865
|
+
f && !to(f, w) && n(), f = w, x = requestAnimationFrame(g);
|
|
3851
3866
|
}
|
|
3852
3867
|
return n(), () => {
|
|
3853
3868
|
var w;
|
|
3854
|
-
|
|
3855
|
-
o &&
|
|
3856
|
-
}), p == null || p(), (w =
|
|
3869
|
+
d.forEach((b) => {
|
|
3870
|
+
o && b.removeEventListener("scroll", n), a && b.removeEventListener("resize", n);
|
|
3871
|
+
}), p == null || p(), (w = m) == null || w.disconnect(), m = null, l && cancelAnimationFrame(x);
|
|
3857
3872
|
};
|
|
3858
3873
|
}
|
|
3859
|
-
const Gs = xs, qs = ys, Qs =
|
|
3874
|
+
const Gs = xs, qs = ys, Qs = ms, Js = Ss, el = ws, ir = gs, tl = Cs, nl = (e, t, n) => {
|
|
3860
3875
|
const r = /* @__PURE__ */ new Map(), o = {
|
|
3861
3876
|
platform: Ks,
|
|
3862
3877
|
...n
|
|
@@ -3928,29 +3943,29 @@ function al(e) {
|
|
|
3928
3943
|
transform: s = !0,
|
|
3929
3944
|
whileElementsMounted: l,
|
|
3930
3945
|
open: c
|
|
3931
|
-
} = e, [
|
|
3946
|
+
} = e, [d, p] = h.useState({
|
|
3932
3947
|
x: 0,
|
|
3933
3948
|
y: 0,
|
|
3934
3949
|
strategy: n,
|
|
3935
3950
|
placement: t,
|
|
3936
3951
|
middlewareData: {},
|
|
3937
3952
|
isPositioned: !1
|
|
3938
|
-
}), [v,
|
|
3939
|
-
Dt(v, r) ||
|
|
3940
|
-
const [
|
|
3941
|
-
P !==
|
|
3942
|
-
}, []),
|
|
3953
|
+
}), [v, m] = h.useState(r);
|
|
3954
|
+
Dt(v, r) || m(r);
|
|
3955
|
+
const [x, f] = h.useState(null), [g, w] = h.useState(null), b = h.useCallback((P) => {
|
|
3956
|
+
P !== E.current && (E.current = P, f(P));
|
|
3957
|
+
}, []), y = h.useCallback((P) => {
|
|
3943
3958
|
P !== k.current && (k.current = P, w(P));
|
|
3944
|
-
}, []), C = a ||
|
|
3945
|
-
if (!
|
|
3959
|
+
}, []), C = a || x, S = i || g, E = h.useRef(null), k = h.useRef(null), I = h.useRef(d), D = l != null, L = Jt(l), $ = Jt(o), W = Jt(c), F = h.useCallback(() => {
|
|
3960
|
+
if (!E.current || !k.current)
|
|
3946
3961
|
return;
|
|
3947
3962
|
const P = {
|
|
3948
3963
|
placement: t,
|
|
3949
3964
|
strategy: n,
|
|
3950
3965
|
middleware: v
|
|
3951
3966
|
};
|
|
3952
|
-
$.current && (P.platform = $.current), nl(
|
|
3953
|
-
const
|
|
3967
|
+
$.current && (P.platform = $.current), nl(E.current, k.current, P).then((z) => {
|
|
3968
|
+
const Q = {
|
|
3954
3969
|
...z,
|
|
3955
3970
|
// The floating element's position may be recomputed while it's closed
|
|
3956
3971
|
// but still mounted (such as when transitioning out). To ensure
|
|
@@ -3958,8 +3973,8 @@ function al(e) {
|
|
|
3958
3973
|
// setting it to `true` when `open === false` (must be specified).
|
|
3959
3974
|
isPositioned: W.current !== !1
|
|
3960
3975
|
};
|
|
3961
|
-
|
|
3962
|
-
p(
|
|
3976
|
+
N.current && !Dt(I.current, Q) && (I.current = Q, h.flushSync(() => {
|
|
3977
|
+
p(Q);
|
|
3963
3978
|
}));
|
|
3964
3979
|
});
|
|
3965
3980
|
}, [v, t, n, $, W]);
|
|
@@ -3969,22 +3984,22 @@ function al(e) {
|
|
|
3969
3984
|
isPositioned: !1
|
|
3970
3985
|
})));
|
|
3971
3986
|
}, [c]);
|
|
3972
|
-
const
|
|
3973
|
-
Pt(() => (
|
|
3974
|
-
|
|
3987
|
+
const N = h.useRef(!1);
|
|
3988
|
+
Pt(() => (N.current = !0, () => {
|
|
3989
|
+
N.current = !1;
|
|
3975
3990
|
}), []), Pt(() => {
|
|
3976
|
-
if (C && (
|
|
3991
|
+
if (C && (E.current = C), S && (k.current = S), C && S) {
|
|
3977
3992
|
if (L.current)
|
|
3978
|
-
return L.current(C, S,
|
|
3979
|
-
|
|
3993
|
+
return L.current(C, S, F);
|
|
3994
|
+
F();
|
|
3980
3995
|
}
|
|
3981
|
-
}, [C, S,
|
|
3982
|
-
const
|
|
3983
|
-
reference:
|
|
3996
|
+
}, [C, S, F, L, D]);
|
|
3997
|
+
const _ = h.useMemo(() => ({
|
|
3998
|
+
reference: E,
|
|
3984
3999
|
floating: k,
|
|
3985
|
-
setReference:
|
|
3986
|
-
setFloating:
|
|
3987
|
-
}), [
|
|
4000
|
+
setReference: b,
|
|
4001
|
+
setFloating: y
|
|
4002
|
+
}), [b, y]), O = h.useMemo(() => ({
|
|
3988
4003
|
reference: C,
|
|
3989
4004
|
floating: S
|
|
3990
4005
|
}), [C, S]), M = h.useMemo(() => {
|
|
@@ -3995,26 +4010,26 @@ function al(e) {
|
|
|
3995
4010
|
};
|
|
3996
4011
|
if (!O.floating)
|
|
3997
4012
|
return P;
|
|
3998
|
-
const z = sr(O.floating,
|
|
4013
|
+
const z = sr(O.floating, d.x), Q = sr(O.floating, d.y);
|
|
3999
4014
|
return s ? {
|
|
4000
4015
|
...P,
|
|
4001
|
-
transform: "translate(" + z + "px, " +
|
|
4016
|
+
transform: "translate(" + z + "px, " + Q + "px)",
|
|
4002
4017
|
...no(O.floating) >= 1.5 && {
|
|
4003
4018
|
willChange: "transform"
|
|
4004
4019
|
}
|
|
4005
4020
|
} : {
|
|
4006
4021
|
position: n,
|
|
4007
4022
|
left: z,
|
|
4008
|
-
top:
|
|
4023
|
+
top: Q
|
|
4009
4024
|
};
|
|
4010
|
-
}, [n, s, O.floating,
|
|
4025
|
+
}, [n, s, O.floating, d.x, d.y]);
|
|
4011
4026
|
return h.useMemo(() => ({
|
|
4012
|
-
...
|
|
4013
|
-
update:
|
|
4014
|
-
refs:
|
|
4027
|
+
...d,
|
|
4028
|
+
update: F,
|
|
4029
|
+
refs: _,
|
|
4015
4030
|
elements: O,
|
|
4016
4031
|
floatingStyles: M
|
|
4017
|
-
}), [
|
|
4032
|
+
}), [d, F, _, O, M]);
|
|
4018
4033
|
}
|
|
4019
4034
|
const il = (e) => {
|
|
4020
4035
|
function t(n) {
|
|
@@ -4061,7 +4076,7 @@ const il = (e) => {
|
|
|
4061
4076
|
});
|
|
4062
4077
|
var hl = "Arrow", ro = h.forwardRef((e, t) => {
|
|
4063
4078
|
const { children: n, width: r = 10, height: o = 5, ...a } = e;
|
|
4064
|
-
return /* @__PURE__ */
|
|
4079
|
+
return /* @__PURE__ */ T(
|
|
4065
4080
|
X.svg,
|
|
4066
4081
|
{
|
|
4067
4082
|
...a,
|
|
@@ -4070,13 +4085,13 @@ var hl = "Arrow", ro = h.forwardRef((e, t) => {
|
|
|
4070
4085
|
height: o,
|
|
4071
4086
|
viewBox: "0 0 30 10",
|
|
4072
4087
|
preserveAspectRatio: "none",
|
|
4073
|
-
children: e.asChild ? n : /* @__PURE__ */
|
|
4088
|
+
children: e.asChild ? n : /* @__PURE__ */ T("polygon", { points: "0,0 30,0 15,10" })
|
|
4074
4089
|
}
|
|
4075
4090
|
);
|
|
4076
4091
|
});
|
|
4077
4092
|
ro.displayName = hl;
|
|
4078
4093
|
var vl = ro;
|
|
4079
|
-
function
|
|
4094
|
+
function gl(e) {
|
|
4080
4095
|
const [t, n] = h.useState(void 0);
|
|
4081
4096
|
return se(() => {
|
|
4082
4097
|
if (e) {
|
|
@@ -4098,24 +4113,24 @@ function ml(e) {
|
|
|
4098
4113
|
n(void 0);
|
|
4099
4114
|
}, [e]), t;
|
|
4100
4115
|
}
|
|
4101
|
-
var Dn = "Popper", [oo, ao] = An(Dn), [
|
|
4116
|
+
var Dn = "Popper", [oo, ao] = An(Dn), [ml, io] = oo(Dn), so = (e) => {
|
|
4102
4117
|
const { __scopePopper: t, children: n } = e, [r, o] = h.useState(null);
|
|
4103
|
-
return /* @__PURE__ */
|
|
4118
|
+
return /* @__PURE__ */ T(ml, { scope: t, anchor: r, onAnchorChange: o, children: n });
|
|
4104
4119
|
};
|
|
4105
4120
|
so.displayName = Dn;
|
|
4106
4121
|
var lo = "PopperAnchor", co = h.forwardRef(
|
|
4107
4122
|
(e, t) => {
|
|
4108
|
-
const { __scopePopper: n, virtualRef: r, ...o } = e, a = io(lo, n), i = h.useRef(null), s =
|
|
4123
|
+
const { __scopePopper: n, virtualRef: r, ...o } = e, a = io(lo, n), i = h.useRef(null), s = ne(t, i), l = h.useRef(null);
|
|
4109
4124
|
return h.useEffect(() => {
|
|
4110
4125
|
const c = l.current;
|
|
4111
4126
|
l.current = (r == null ? void 0 : r.current) || i.current, c !== l.current && a.onAnchorChange(l.current);
|
|
4112
|
-
}), r ? null : /* @__PURE__ */
|
|
4127
|
+
}), r ? null : /* @__PURE__ */ T(X.div, { ...o, ref: s });
|
|
4113
4128
|
}
|
|
4114
4129
|
);
|
|
4115
4130
|
co.displayName = lo;
|
|
4116
4131
|
var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
4117
4132
|
(e, t) => {
|
|
4118
|
-
var R, K,
|
|
4133
|
+
var R, K, re, j, H, U;
|
|
4119
4134
|
const {
|
|
4120
4135
|
__scopePopper: n,
|
|
4121
4136
|
side: r = "bottom",
|
|
@@ -4125,26 +4140,26 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4125
4140
|
arrowPadding: s = 0,
|
|
4126
4141
|
avoidCollisions: l = !0,
|
|
4127
4142
|
collisionBoundary: c = [],
|
|
4128
|
-
collisionPadding:
|
|
4143
|
+
collisionPadding: d = 0,
|
|
4129
4144
|
sticky: p = "partial",
|
|
4130
4145
|
hideWhenDetached: v = !1,
|
|
4131
|
-
updatePositionStrategy:
|
|
4132
|
-
onPlaced:
|
|
4133
|
-
...
|
|
4134
|
-
} = e,
|
|
4146
|
+
updatePositionStrategy: m = "optimized",
|
|
4147
|
+
onPlaced: x,
|
|
4148
|
+
...f
|
|
4149
|
+
} = e, g = io(Fn, n), [w, b] = h.useState(null), y = ne(t, (le) => b(le)), [C, S] = h.useState(null), E = gl(C), k = (E == null ? void 0 : E.width) ?? 0, I = (E == null ? void 0 : E.height) ?? 0, D = r + (a !== "center" ? "-" + a : ""), L = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, $ = Array.isArray(c) ? c : [c], W = $.length > 0, F = {
|
|
4135
4150
|
padding: L,
|
|
4136
4151
|
boundary: $.filter(yl),
|
|
4137
4152
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
4138
4153
|
altBoundary: W
|
|
4139
|
-
}, { refs:
|
|
4154
|
+
}, { refs: N, floatingStyles: _, placement: O, isPositioned: M, middlewareData: P } = al({
|
|
4140
4155
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
4141
4156
|
strategy: "fixed",
|
|
4142
4157
|
placement: D,
|
|
4143
4158
|
whileElementsMounted: (...le) => Zs(...le, {
|
|
4144
|
-
animationFrame:
|
|
4159
|
+
animationFrame: m === "always"
|
|
4145
4160
|
}),
|
|
4146
4161
|
elements: {
|
|
4147
|
-
reference:
|
|
4162
|
+
reference: g.anchor
|
|
4148
4163
|
},
|
|
4149
4164
|
middleware: [
|
|
4150
4165
|
sl({ mainAxis: o + I, alignmentAxis: i }),
|
|
@@ -4152,11 +4167,11 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4152
4167
|
mainAxis: !0,
|
|
4153
4168
|
crossAxis: !1,
|
|
4154
4169
|
limiter: p === "partial" ? cl() : void 0,
|
|
4155
|
-
...
|
|
4170
|
+
...F
|
|
4156
4171
|
}),
|
|
4157
|
-
l && ul({ ...
|
|
4172
|
+
l && ul({ ...F }),
|
|
4158
4173
|
dl({
|
|
4159
|
-
...
|
|
4174
|
+
...F,
|
|
4160
4175
|
apply: ({ elements: le, rects: we, availableWidth: ft, availableHeight: pt }) => {
|
|
4161
4176
|
const { width: ht, height: na } = we.reference, yt = le.floating.style;
|
|
4162
4177
|
yt.setProperty("--radix-popper-available-width", `${ft}px`), yt.setProperty("--radix-popper-available-height", `${pt}px`), yt.setProperty("--radix-popper-anchor-width", `${ht}px`), yt.setProperty("--radix-popper-anchor-height", `${na}px`);
|
|
@@ -4164,23 +4179,23 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4164
4179
|
}),
|
|
4165
4180
|
C && pl({ element: C, padding: s }),
|
|
4166
4181
|
Cl({ arrowWidth: k, arrowHeight: I }),
|
|
4167
|
-
v && fl({ strategy: "referenceHidden", ...
|
|
4182
|
+
v && fl({ strategy: "referenceHidden", ...F })
|
|
4168
4183
|
]
|
|
4169
|
-
}), [z,
|
|
4184
|
+
}), [z, Q] = ho(O), Pe = je(x);
|
|
4170
4185
|
se(() => {
|
|
4171
4186
|
M && (Pe == null || Pe());
|
|
4172
4187
|
}, [M, Pe]);
|
|
4173
|
-
const ut = (R = P.arrow) == null ? void 0 : R.x, dt = (K = P.arrow) == null ? void 0 : K.y, Me = ((
|
|
4188
|
+
const ut = (R = P.arrow) == null ? void 0 : R.x, dt = (K = P.arrow) == null ? void 0 : K.y, Me = ((re = P.arrow) == null ? void 0 : re.centerOffset) !== 0, [Ze, He] = h.useState();
|
|
4174
4189
|
return se(() => {
|
|
4175
4190
|
w && He(window.getComputedStyle(w).zIndex);
|
|
4176
|
-
}, [w]), /* @__PURE__ */
|
|
4191
|
+
}, [w]), /* @__PURE__ */ T(
|
|
4177
4192
|
"div",
|
|
4178
4193
|
{
|
|
4179
|
-
ref:
|
|
4194
|
+
ref: N.setFloating,
|
|
4180
4195
|
"data-radix-popper-content-wrapper": "",
|
|
4181
4196
|
style: {
|
|
4182
|
-
...
|
|
4183
|
-
transform: M ?
|
|
4197
|
+
..._,
|
|
4198
|
+
transform: M ? _.transform : "translate(0, -200%)",
|
|
4184
4199
|
// keep off the page when measuring
|
|
4185
4200
|
minWidth: "max-content",
|
|
4186
4201
|
zIndex: Ze,
|
|
@@ -4197,7 +4212,7 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4197
4212
|
}
|
|
4198
4213
|
},
|
|
4199
4214
|
dir: e.dir,
|
|
4200
|
-
children: /* @__PURE__ */
|
|
4215
|
+
children: /* @__PURE__ */ T(
|
|
4201
4216
|
wl,
|
|
4202
4217
|
{
|
|
4203
4218
|
scope: n,
|
|
@@ -4206,15 +4221,15 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4206
4221
|
arrowX: ut,
|
|
4207
4222
|
arrowY: dt,
|
|
4208
4223
|
shouldHideArrow: Me,
|
|
4209
|
-
children: /* @__PURE__ */
|
|
4224
|
+
children: /* @__PURE__ */ T(
|
|
4210
4225
|
X.div,
|
|
4211
4226
|
{
|
|
4212
4227
|
"data-side": z,
|
|
4213
|
-
"data-align":
|
|
4214
|
-
...
|
|
4215
|
-
ref:
|
|
4228
|
+
"data-align": Q,
|
|
4229
|
+
...f,
|
|
4230
|
+
ref: y,
|
|
4216
4231
|
style: {
|
|
4217
|
-
...
|
|
4232
|
+
...f.style,
|
|
4218
4233
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
4219
4234
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
4220
4235
|
animation: M ? void 0 : "none"
|
|
@@ -4239,7 +4254,7 @@ var fo = "PopperArrow", xl = {
|
|
|
4239
4254
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
4240
4255
|
// doesn't report size as we'd expect on SVG elements.
|
|
4241
4256
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
4242
|
-
/* @__PURE__ */
|
|
4257
|
+
/* @__PURE__ */ T(
|
|
4243
4258
|
"span",
|
|
4244
4259
|
{
|
|
4245
4260
|
ref: a.onArrowChange,
|
|
@@ -4262,7 +4277,7 @@ var fo = "PopperArrow", xl = {
|
|
|
4262
4277
|
}[a.placedSide],
|
|
4263
4278
|
visibility: a.shouldHideArrow ? "hidden" : void 0
|
|
4264
4279
|
},
|
|
4265
|
-
children: /* @__PURE__ */
|
|
4280
|
+
children: /* @__PURE__ */ T(
|
|
4266
4281
|
vl,
|
|
4267
4282
|
{
|
|
4268
4283
|
...o,
|
|
@@ -4286,10 +4301,10 @@ var Cl = (e) => ({
|
|
|
4286
4301
|
name: "transformOrigin",
|
|
4287
4302
|
options: e,
|
|
4288
4303
|
fn(t) {
|
|
4289
|
-
var
|
|
4290
|
-
const { placement: n, rects: r, middlewareData: o } = t, i = ((
|
|
4291
|
-
let
|
|
4292
|
-
return c === "bottom" ? (
|
|
4304
|
+
var g, w, b;
|
|
4305
|
+
const { placement: n, rects: r, middlewareData: o } = t, i = ((g = o.arrow) == null ? void 0 : g.centerOffset) !== 0, s = i ? 0 : e.arrowWidth, l = i ? 0 : e.arrowHeight, [c, d] = ho(n), p = { start: "0%", center: "50%", end: "100%" }[d], v = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + s / 2, m = (((b = o.arrow) == null ? void 0 : b.y) ?? 0) + l / 2;
|
|
4306
|
+
let x = "", f = "";
|
|
4307
|
+
return c === "bottom" ? (x = i ? p : `${v}px`, f = `${-l}px`) : c === "top" ? (x = i ? p : `${v}px`, f = `${r.floating.height + l}px`) : c === "right" ? (x = `${-l}px`, f = i ? p : `${m}px`) : c === "left" && (x = `${r.floating.width + l}px`, f = i ? p : `${m}px`), { data: { x, y: f } };
|
|
4293
4308
|
}
|
|
4294
4309
|
});
|
|
4295
4310
|
function ho(e) {
|
|
@@ -4301,7 +4316,7 @@ var Sl = so, kl = co, El = uo, Tl = po, Al = "Portal", vo = h.forwardRef((e, t)
|
|
|
4301
4316
|
const { container: n, ...r } = e, [o, a] = h.useState(!1);
|
|
4302
4317
|
se(() => a(!0), []);
|
|
4303
4318
|
const i = n || o && ((s = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : s.body);
|
|
4304
|
-
return i ? De.createPortal(/* @__PURE__ */
|
|
4319
|
+
return i ? De.createPortal(/* @__PURE__ */ T(X.div, { ...r, ref: t }), i) : null;
|
|
4305
4320
|
});
|
|
4306
4321
|
vo.displayName = Al;
|
|
4307
4322
|
var _l = h[" useInsertionEffect ".trim().toString()] || se;
|
|
@@ -4317,22 +4332,22 @@ function lr({
|
|
|
4317
4332
|
onChange: n
|
|
4318
4333
|
}), s = e !== void 0, l = s ? e : o;
|
|
4319
4334
|
{
|
|
4320
|
-
const
|
|
4335
|
+
const d = h.useRef(e !== void 0);
|
|
4321
4336
|
h.useEffect(() => {
|
|
4322
|
-
const p =
|
|
4337
|
+
const p = d.current;
|
|
4323
4338
|
p !== s && console.warn(
|
|
4324
4339
|
`${r} is changing from ${p ? "controlled" : "uncontrolled"} to ${s ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
4325
|
-
),
|
|
4340
|
+
), d.current = s;
|
|
4326
4341
|
}, [s, r]);
|
|
4327
4342
|
}
|
|
4328
4343
|
const c = h.useCallback(
|
|
4329
|
-
(
|
|
4344
|
+
(d) => {
|
|
4330
4345
|
var p;
|
|
4331
4346
|
if (s) {
|
|
4332
|
-
const v = Rl(
|
|
4347
|
+
const v = Rl(d) ? d(e) : d;
|
|
4333
4348
|
v !== e && ((p = i.current) == null || p.call(i, v));
|
|
4334
4349
|
} else
|
|
4335
|
-
a(
|
|
4350
|
+
a(d);
|
|
4336
4351
|
},
|
|
4337
4352
|
[s, e, a, i]
|
|
4338
4353
|
);
|
|
@@ -4357,7 +4372,7 @@ function Il(e) {
|
|
|
4357
4372
|
const t = h.useRef({ value: e, previous: e });
|
|
4358
4373
|
return h.useMemo(() => (t.current.value !== e && (t.current.previous = t.current.value, t.current.value = e), t.current.previous), [e]);
|
|
4359
4374
|
}
|
|
4360
|
-
var
|
|
4375
|
+
var go = Object.freeze({
|
|
4361
4376
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
4362
4377
|
position: "absolute",
|
|
4363
4378
|
border: 0,
|
|
@@ -4370,12 +4385,12 @@ var mo = Object.freeze({
|
|
|
4370
4385
|
whiteSpace: "nowrap",
|
|
4371
4386
|
wordWrap: "normal"
|
|
4372
4387
|
}), Nl = "VisuallyHidden", Ol = h.forwardRef(
|
|
4373
|
-
(e, t) => /* @__PURE__ */
|
|
4388
|
+
(e, t) => /* @__PURE__ */ T(
|
|
4374
4389
|
X.span,
|
|
4375
4390
|
{
|
|
4376
4391
|
...e,
|
|
4377
4392
|
ref: t,
|
|
4378
|
-
style: { ...
|
|
4393
|
+
style: { ...go, ...e.style }
|
|
4379
4394
|
}
|
|
4380
4395
|
)
|
|
4381
4396
|
);
|
|
@@ -4385,13 +4400,13 @@ var Ll = function(e) {
|
|
|
4385
4400
|
return null;
|
|
4386
4401
|
var t = Array.isArray(e) ? e[0] : e;
|
|
4387
4402
|
return t.ownerDocument.body;
|
|
4388
|
-
}, Ge = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Et = {}, en = 0,
|
|
4389
|
-
return e && (e.host ||
|
|
4403
|
+
}, Ge = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Et = {}, en = 0, mo = function(e) {
|
|
4404
|
+
return e && (e.host || mo(e.parentNode));
|
|
4390
4405
|
}, Ml = function(e, t) {
|
|
4391
4406
|
return t.map(function(n) {
|
|
4392
4407
|
if (e.contains(n))
|
|
4393
4408
|
return n;
|
|
4394
|
-
var r =
|
|
4409
|
+
var r = mo(n);
|
|
4395
4410
|
return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
|
|
4396
4411
|
}).filter(function(n) {
|
|
4397
4412
|
return !!n;
|
|
@@ -4403,23 +4418,23 @@ var Ll = function(e) {
|
|
|
4403
4418
|
!p || s.has(p) || (s.add(p), c(p.parentNode));
|
|
4404
4419
|
};
|
|
4405
4420
|
o.forEach(c);
|
|
4406
|
-
var
|
|
4421
|
+
var d = function(p) {
|
|
4407
4422
|
!p || l.has(p) || Array.prototype.forEach.call(p.children, function(v) {
|
|
4408
4423
|
if (s.has(v))
|
|
4409
|
-
|
|
4424
|
+
d(v);
|
|
4410
4425
|
else
|
|
4411
4426
|
try {
|
|
4412
|
-
var
|
|
4413
|
-
Ge.set(v,
|
|
4427
|
+
var m = v.getAttribute(r), x = m !== null && m !== "false", f = (Ge.get(v) || 0) + 1, g = (a.get(v) || 0) + 1;
|
|
4428
|
+
Ge.set(v, f), a.set(v, g), i.push(v), f === 1 && x && kt.set(v, !0), g === 1 && v.setAttribute(n, "true"), x || v.setAttribute(r, "true");
|
|
4414
4429
|
} catch (w) {
|
|
4415
4430
|
console.error("aria-hidden: cannot operate on ", v, w);
|
|
4416
4431
|
}
|
|
4417
4432
|
});
|
|
4418
4433
|
};
|
|
4419
|
-
return
|
|
4434
|
+
return d(t), s.clear(), en++, function() {
|
|
4420
4435
|
i.forEach(function(p) {
|
|
4421
|
-
var v = Ge.get(p) - 1,
|
|
4422
|
-
Ge.set(p, v), a.set(p,
|
|
4436
|
+
var v = Ge.get(p) - 1, m = a.get(p) - 1;
|
|
4437
|
+
Ge.set(p, v), a.set(p, m), v || (kt.has(p) || p.removeAttribute(r), kt.delete(p)), m || p.removeAttribute(n);
|
|
4423
4438
|
}), en--, en || (Ge = /* @__PURE__ */ new WeakMap(), Ge = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), Et = {});
|
|
4424
4439
|
};
|
|
4425
4440
|
}, Fl = function(e, t, n) {
|
|
@@ -4536,17 +4551,17 @@ function jl(e, t) {
|
|
|
4536
4551
|
n = [], s.forEach(a), i = n;
|
|
4537
4552
|
}
|
|
4538
4553
|
var l = function() {
|
|
4539
|
-
var
|
|
4540
|
-
i = [],
|
|
4554
|
+
var d = i;
|
|
4555
|
+
i = [], d.forEach(a);
|
|
4541
4556
|
}, c = function() {
|
|
4542
4557
|
return Promise.resolve().then(l);
|
|
4543
4558
|
};
|
|
4544
4559
|
c(), n = {
|
|
4545
|
-
push: function(
|
|
4546
|
-
i.push(
|
|
4560
|
+
push: function(d) {
|
|
4561
|
+
i.push(d), c();
|
|
4547
4562
|
},
|
|
4548
|
-
filter: function(
|
|
4549
|
-
return i = i.filter(
|
|
4563
|
+
filter: function(d) {
|
|
4564
|
+
return i = i.filter(d), n;
|
|
4550
4565
|
}
|
|
4551
4566
|
};
|
|
4552
4567
|
}
|
|
@@ -4577,12 +4592,12 @@ var xo = Yl(), nn = function() {
|
|
|
4577
4592
|
onScrollCapture: nn,
|
|
4578
4593
|
onWheelCapture: nn,
|
|
4579
4594
|
onTouchMoveCapture: nn
|
|
4580
|
-
}), o = r[0], a = r[1], i = e.forwardProps, s = e.children, l = e.className, c = e.removeScrollBar,
|
|
4595
|
+
}), o = r[0], a = r[1], i = e.forwardProps, s = e.children, l = e.className, c = e.removeScrollBar, d = e.enabled, p = e.shards, v = e.sideCar, m = e.noRelative, x = e.noIsolation, f = e.inert, g = e.allowPinchZoom, w = e.as, b = w === void 0 ? "div" : w, y = e.gapMode, C = wo(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = v, E = Hl([n, t]), k = xe(xe({}, C), o);
|
|
4581
4596
|
return h.createElement(
|
|
4582
4597
|
h.Fragment,
|
|
4583
4598
|
null,
|
|
4584
|
-
|
|
4585
|
-
i ? h.cloneElement(h.Children.only(s), xe(xe({}, k), { ref:
|
|
4599
|
+
d && h.createElement(S, { sideCar: xo, removeScrollBar: c, shards: p, noRelative: m, noIsolation: x, inert: f, setCallbacks: a, allowPinchZoom: !!g, lockRef: n, gapMode: y }),
|
|
4600
|
+
i ? h.cloneElement(h.Children.only(s), xe(xe({}, k), { ref: E })) : h.createElement(b, xe({}, k, { className: l, ref: E }), s)
|
|
4586
4601
|
);
|
|
4587
4602
|
});
|
|
4588
4603
|
Ht.defaultProps = {
|
|
@@ -4780,20 +4795,20 @@ var qe = dn ? { passive: !1 } : !1, sc = function(e) {
|
|
|
4780
4795
|
}, fc = function(e, t) {
|
|
4781
4796
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
4782
4797
|
}, pc = function(e, t, n, r, o) {
|
|
4783
|
-
var a = fc(e, window.getComputedStyle(t).direction), i = a * r, s = n.target, l = t.contains(s), c = !1,
|
|
4798
|
+
var a = fc(e, window.getComputedStyle(t).direction), i = a * r, s = n.target, l = t.contains(s), c = !1, d = i > 0, p = 0, v = 0;
|
|
4784
4799
|
do {
|
|
4785
4800
|
if (!s)
|
|
4786
4801
|
break;
|
|
4787
|
-
var
|
|
4788
|
-
(
|
|
4789
|
-
var
|
|
4790
|
-
s =
|
|
4802
|
+
var m = ko(e, s), x = m[0], f = m[1], g = m[2], w = f - g - a * x;
|
|
4803
|
+
(x || w) && So(e, s) && (p += w, v += x);
|
|
4804
|
+
var b = s.parentNode;
|
|
4805
|
+
s = b && b.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? b.host : b;
|
|
4791
4806
|
} while (
|
|
4792
4807
|
// portaled content
|
|
4793
4808
|
!l && s !== document.body || // self content
|
|
4794
4809
|
l && (t.contains(s) || t === s)
|
|
4795
4810
|
);
|
|
4796
|
-
return (
|
|
4811
|
+
return (d && Math.abs(p) < 1 || !d && Math.abs(v) < 1) && (c = !0), c;
|
|
4797
4812
|
}, At = function(e) {
|
|
4798
4813
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
4799
4814
|
}, fr = function(e) {
|
|
@@ -4807,87 +4822,87 @@ var qe = dn ? { passive: !1 } : !1, sc = function(e) {
|
|
|
4807
4822
|
.block-interactivity-`.concat(e, ` {pointer-events: none;}
|
|
4808
4823
|
.allow-interactivity-`).concat(e, ` {pointer-events: all;}
|
|
4809
4824
|
`);
|
|
4810
|
-
},
|
|
4811
|
-
function
|
|
4812
|
-
var t = h.useRef([]), n = h.useRef([0, 0]), r = h.useRef(), o = h.useState(
|
|
4825
|
+
}, gc = 0, Qe = [];
|
|
4826
|
+
function mc(e) {
|
|
4827
|
+
var t = h.useRef([]), n = h.useRef([0, 0]), r = h.useRef(), o = h.useState(gc++)[0], a = h.useState(yo)[0], i = h.useRef(e);
|
|
4813
4828
|
h.useEffect(function() {
|
|
4814
4829
|
i.current = e;
|
|
4815
4830
|
}, [e]), h.useEffect(function() {
|
|
4816
4831
|
if (e.inert) {
|
|
4817
4832
|
document.body.classList.add("block-interactivity-".concat(o));
|
|
4818
|
-
var
|
|
4819
|
-
return
|
|
4820
|
-
return
|
|
4833
|
+
var f = Bl([e.lockRef.current], (e.shards || []).map(pr), !0).filter(Boolean);
|
|
4834
|
+
return f.forEach(function(g) {
|
|
4835
|
+
return g.classList.add("allow-interactivity-".concat(o));
|
|
4821
4836
|
}), function() {
|
|
4822
|
-
document.body.classList.remove("block-interactivity-".concat(o)),
|
|
4823
|
-
return
|
|
4837
|
+
document.body.classList.remove("block-interactivity-".concat(o)), f.forEach(function(g) {
|
|
4838
|
+
return g.classList.remove("allow-interactivity-".concat(o));
|
|
4824
4839
|
});
|
|
4825
4840
|
};
|
|
4826
4841
|
}
|
|
4827
4842
|
}, [e.inert, e.lockRef.current, e.shards]);
|
|
4828
|
-
var s = h.useCallback(function(
|
|
4829
|
-
if ("touches" in
|
|
4843
|
+
var s = h.useCallback(function(f, g) {
|
|
4844
|
+
if ("touches" in f && f.touches.length === 2 || f.type === "wheel" && f.ctrlKey)
|
|
4830
4845
|
return !i.current.allowPinchZoom;
|
|
4831
|
-
var w = At(
|
|
4832
|
-
if ("touches" in
|
|
4846
|
+
var w = At(f), b = n.current, y = "deltaX" in f ? f.deltaX : b[0] - w[0], C = "deltaY" in f ? f.deltaY : b[1] - w[1], S, E = f.target, k = Math.abs(y) > Math.abs(C) ? "h" : "v";
|
|
4847
|
+
if ("touches" in f && k === "h" && E.type === "range")
|
|
4833
4848
|
return !1;
|
|
4834
|
-
var I = dr(k,
|
|
4849
|
+
var I = dr(k, E);
|
|
4835
4850
|
if (!I)
|
|
4836
4851
|
return !0;
|
|
4837
|
-
if (I ? S = k : (S = k === "v" ? "h" : "v", I = dr(k,
|
|
4852
|
+
if (I ? S = k : (S = k === "v" ? "h" : "v", I = dr(k, E)), !I)
|
|
4838
4853
|
return !1;
|
|
4839
|
-
if (!r.current && "changedTouches" in
|
|
4854
|
+
if (!r.current && "changedTouches" in f && (y || C) && (r.current = S), !S)
|
|
4840
4855
|
return !0;
|
|
4841
4856
|
var D = r.current || S;
|
|
4842
|
-
return pc(D,
|
|
4843
|
-
}, []), l = h.useCallback(function(
|
|
4844
|
-
var
|
|
4857
|
+
return pc(D, g, f, D === "h" ? y : C);
|
|
4858
|
+
}, []), l = h.useCallback(function(f) {
|
|
4859
|
+
var g = f;
|
|
4845
4860
|
if (!(!Qe.length || Qe[Qe.length - 1] !== a)) {
|
|
4846
|
-
var w = "deltaY" in
|
|
4847
|
-
return S.name ===
|
|
4861
|
+
var w = "deltaY" in g ? fr(g) : At(g), b = t.current.filter(function(S) {
|
|
4862
|
+
return S.name === g.type && (S.target === g.target || g.target === S.shadowParent) && hc(S.delta, w);
|
|
4848
4863
|
})[0];
|
|
4849
|
-
if (
|
|
4850
|
-
|
|
4864
|
+
if (b && b.should) {
|
|
4865
|
+
g.cancelable && g.preventDefault();
|
|
4851
4866
|
return;
|
|
4852
4867
|
}
|
|
4853
|
-
if (!
|
|
4854
|
-
var
|
|
4855
|
-
return S.contains(
|
|
4856
|
-
}), C =
|
|
4857
|
-
C &&
|
|
4868
|
+
if (!b) {
|
|
4869
|
+
var y = (i.current.shards || []).map(pr).filter(Boolean).filter(function(S) {
|
|
4870
|
+
return S.contains(g.target);
|
|
4871
|
+
}), C = y.length > 0 ? s(g, y[0]) : !i.current.noIsolation;
|
|
4872
|
+
C && g.cancelable && g.preventDefault();
|
|
4858
4873
|
}
|
|
4859
4874
|
}
|
|
4860
|
-
}, []), c = h.useCallback(function(
|
|
4861
|
-
var
|
|
4862
|
-
t.current.push(
|
|
4875
|
+
}, []), c = h.useCallback(function(f, g, w, b) {
|
|
4876
|
+
var y = { name: f, delta: g, target: w, should: b, shadowParent: wc(w) };
|
|
4877
|
+
t.current.push(y), setTimeout(function() {
|
|
4863
4878
|
t.current = t.current.filter(function(C) {
|
|
4864
|
-
return C !==
|
|
4879
|
+
return C !== y;
|
|
4865
4880
|
});
|
|
4866
4881
|
}, 1);
|
|
4867
|
-
}, []),
|
|
4868
|
-
n.current = At(
|
|
4869
|
-
}, []), p = h.useCallback(function(
|
|
4870
|
-
c(
|
|
4871
|
-
}, []), v = h.useCallback(function(
|
|
4872
|
-
c(
|
|
4882
|
+
}, []), d = h.useCallback(function(f) {
|
|
4883
|
+
n.current = At(f), r.current = void 0;
|
|
4884
|
+
}, []), p = h.useCallback(function(f) {
|
|
4885
|
+
c(f.type, fr(f), f.target, s(f, e.lockRef.current));
|
|
4886
|
+
}, []), v = h.useCallback(function(f) {
|
|
4887
|
+
c(f.type, At(f), f.target, s(f, e.lockRef.current));
|
|
4873
4888
|
}, []);
|
|
4874
4889
|
h.useEffect(function() {
|
|
4875
4890
|
return Qe.push(a), e.setCallbacks({
|
|
4876
4891
|
onScrollCapture: p,
|
|
4877
4892
|
onWheelCapture: p,
|
|
4878
4893
|
onTouchMoveCapture: v
|
|
4879
|
-
}), document.addEventListener("wheel", l, qe), document.addEventListener("touchmove", l, qe), document.addEventListener("touchstart",
|
|
4880
|
-
Qe = Qe.filter(function(
|
|
4881
|
-
return
|
|
4882
|
-
}), document.removeEventListener("wheel", l, qe), document.removeEventListener("touchmove", l, qe), document.removeEventListener("touchstart",
|
|
4894
|
+
}), document.addEventListener("wheel", l, qe), document.addEventListener("touchmove", l, qe), document.addEventListener("touchstart", d, qe), function() {
|
|
4895
|
+
Qe = Qe.filter(function(f) {
|
|
4896
|
+
return f !== a;
|
|
4897
|
+
}), document.removeEventListener("wheel", l, qe), document.removeEventListener("touchmove", l, qe), document.removeEventListener("touchstart", d, qe);
|
|
4883
4898
|
};
|
|
4884
4899
|
}, []);
|
|
4885
|
-
var
|
|
4900
|
+
var m = e.removeScrollBar, x = e.inert;
|
|
4886
4901
|
return h.createElement(
|
|
4887
4902
|
h.Fragment,
|
|
4888
4903
|
null,
|
|
4889
|
-
|
|
4890
|
-
|
|
4904
|
+
x ? h.createElement(a, { styles: vc(o) }) : null,
|
|
4905
|
+
m ? h.createElement(ic, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
4891
4906
|
);
|
|
4892
4907
|
}
|
|
4893
4908
|
function wc(e) {
|
|
@@ -4895,7 +4910,7 @@ function wc(e) {
|
|
|
4895
4910
|
e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
|
|
4896
4911
|
return t;
|
|
4897
4912
|
}
|
|
4898
|
-
const bc = Kl(xo,
|
|
4913
|
+
const bc = Kl(xo, mc);
|
|
4899
4914
|
var Eo = h.forwardRef(function(e, t) {
|
|
4900
4915
|
return h.createElement(Ht, xe({}, e, { ref: t, sideCar: bc }));
|
|
4901
4916
|
});
|
|
@@ -4914,12 +4929,12 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4914
4929
|
defaultValue: s,
|
|
4915
4930
|
onValueChange: l,
|
|
4916
4931
|
dir: c,
|
|
4917
|
-
name:
|
|
4932
|
+
name: d,
|
|
4918
4933
|
autoComplete: p,
|
|
4919
4934
|
disabled: v,
|
|
4920
|
-
required:
|
|
4921
|
-
form:
|
|
4922
|
-
} = e,
|
|
4935
|
+
required: m,
|
|
4936
|
+
form: x
|
|
4937
|
+
} = e, f = Yt(t), [g, w] = h.useState(null), [b, y] = h.useState(null), [C, S] = h.useState(!1), E = Fi(c), [k, I] = lr({
|
|
4923
4938
|
prop: r,
|
|
4924
4939
|
defaultProp: o ?? !1,
|
|
4925
4940
|
onChange: a,
|
|
@@ -4929,16 +4944,16 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4929
4944
|
defaultProp: s,
|
|
4930
4945
|
onChange: l,
|
|
4931
4946
|
caller: Ke
|
|
4932
|
-
}), $ = h.useRef(null), W =
|
|
4933
|
-
return /* @__PURE__ */
|
|
4947
|
+
}), $ = h.useRef(null), W = g ? x || !!g.closest("form") : !0, [F, N] = h.useState(/* @__PURE__ */ new Set()), _ = Array.from(F).map((O) => O.props.value).join(";");
|
|
4948
|
+
return /* @__PURE__ */ T(Sl, { ...f, children: /* @__PURE__ */ Nt(
|
|
4934
4949
|
Sc,
|
|
4935
4950
|
{
|
|
4936
|
-
required:
|
|
4951
|
+
required: m,
|
|
4937
4952
|
scope: t,
|
|
4938
|
-
trigger:
|
|
4953
|
+
trigger: g,
|
|
4939
4954
|
onTriggerChange: w,
|
|
4940
|
-
valueNode:
|
|
4941
|
-
onValueNodeChange:
|
|
4955
|
+
valueNode: b,
|
|
4956
|
+
onValueNodeChange: y,
|
|
4942
4957
|
valueNodeHasChildren: C,
|
|
4943
4958
|
onValueNodeHasChildrenChange: S,
|
|
4944
4959
|
contentId: _n(),
|
|
@@ -4946,19 +4961,19 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4946
4961
|
onValueChange: L,
|
|
4947
4962
|
open: k,
|
|
4948
4963
|
onOpenChange: I,
|
|
4949
|
-
dir:
|
|
4964
|
+
dir: E,
|
|
4950
4965
|
triggerPointerDownPosRef: $,
|
|
4951
4966
|
disabled: v,
|
|
4952
4967
|
children: [
|
|
4953
|
-
/* @__PURE__ */
|
|
4968
|
+
/* @__PURE__ */ T(Ut.Provider, { scope: t, children: /* @__PURE__ */ T(
|
|
4954
4969
|
kc,
|
|
4955
4970
|
{
|
|
4956
4971
|
scope: e.__scopeSelect,
|
|
4957
4972
|
onNativeOptionAdd: h.useCallback((O) => {
|
|
4958
|
-
|
|
4973
|
+
N((M) => new Set(M).add(O));
|
|
4959
4974
|
}, []),
|
|
4960
4975
|
onNativeOptionRemove: h.useCallback((O) => {
|
|
4961
|
-
|
|
4976
|
+
N((M) => {
|
|
4962
4977
|
const P = new Set(M);
|
|
4963
4978
|
return P.delete(O), P;
|
|
4964
4979
|
});
|
|
@@ -4970,20 +4985,20 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4970
4985
|
Ko,
|
|
4971
4986
|
{
|
|
4972
4987
|
"aria-hidden": !0,
|
|
4973
|
-
required:
|
|
4988
|
+
required: m,
|
|
4974
4989
|
tabIndex: -1,
|
|
4975
|
-
name:
|
|
4990
|
+
name: d,
|
|
4976
4991
|
autoComplete: p,
|
|
4977
4992
|
value: D,
|
|
4978
4993
|
onChange: (O) => L(O.target.value),
|
|
4979
4994
|
disabled: v,
|
|
4980
|
-
form:
|
|
4995
|
+
form: x,
|
|
4981
4996
|
children: [
|
|
4982
|
-
D === void 0 ? /* @__PURE__ */
|
|
4983
|
-
Array.from(
|
|
4997
|
+
D === void 0 ? /* @__PURE__ */ T("option", { value: "" }) : null,
|
|
4998
|
+
Array.from(F)
|
|
4984
4999
|
]
|
|
4985
5000
|
},
|
|
4986
|
-
|
|
5001
|
+
_
|
|
4987
5002
|
) : null
|
|
4988
5003
|
]
|
|
4989
5004
|
}
|
|
@@ -4992,16 +5007,16 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4992
5007
|
To.displayName = Ke;
|
|
4993
5008
|
var Ao = "SelectTrigger", _o = h.forwardRef(
|
|
4994
5009
|
(e, t) => {
|
|
4995
|
-
const { __scopeSelect: n, disabled: r = !1, ...o } = e, a = Yt(n), i = $e(Ao, n), s = i.disabled || r, l =
|
|
4996
|
-
const
|
|
4997
|
-
|
|
4998
|
-
}),
|
|
4999
|
-
s || (i.onOpenChange(!0),
|
|
5000
|
-
x: Math.round(
|
|
5001
|
-
y: Math.round(
|
|
5010
|
+
const { __scopeSelect: n, disabled: r = !1, ...o } = e, a = Yt(n), i = $e(Ao, n), s = i.disabled || r, l = ne(t, i.onTriggerChange), c = jt(n), d = h.useRef("touch"), [p, v, m] = Zo((f) => {
|
|
5011
|
+
const g = c().filter((y) => !y.disabled), w = g.find((y) => y.value === i.value), b = Go(g, f, w);
|
|
5012
|
+
b !== void 0 && i.onValueChange(b.value);
|
|
5013
|
+
}), x = (f) => {
|
|
5014
|
+
s || (i.onOpenChange(!0), m()), f && (i.triggerPointerDownPosRef.current = {
|
|
5015
|
+
x: Math.round(f.pageX),
|
|
5016
|
+
y: Math.round(f.pageY)
|
|
5002
5017
|
});
|
|
5003
5018
|
};
|
|
5004
|
-
return /* @__PURE__ */
|
|
5019
|
+
return /* @__PURE__ */ T(kl, { asChild: !0, ...a, children: /* @__PURE__ */ T(
|
|
5005
5020
|
X.button,
|
|
5006
5021
|
{
|
|
5007
5022
|
type: "button",
|
|
@@ -5017,17 +5032,17 @@ var Ao = "SelectTrigger", _o = h.forwardRef(
|
|
|
5017
5032
|
"data-placeholder": Xo(i.value) ? "" : void 0,
|
|
5018
5033
|
...o,
|
|
5019
5034
|
ref: l,
|
|
5020
|
-
onClick: Z(o.onClick, (
|
|
5021
|
-
|
|
5035
|
+
onClick: Z(o.onClick, (f) => {
|
|
5036
|
+
f.currentTarget.focus(), d.current !== "mouse" && x(f);
|
|
5022
5037
|
}),
|
|
5023
|
-
onPointerDown: Z(o.onPointerDown, (
|
|
5024
|
-
|
|
5025
|
-
const
|
|
5026
|
-
|
|
5038
|
+
onPointerDown: Z(o.onPointerDown, (f) => {
|
|
5039
|
+
d.current = f.pointerType;
|
|
5040
|
+
const g = f.target;
|
|
5041
|
+
g.hasPointerCapture(f.pointerId) && g.releasePointerCapture(f.pointerId), f.button === 0 && f.ctrlKey === !1 && f.pointerType === "mouse" && (x(f), f.preventDefault());
|
|
5027
5042
|
}),
|
|
5028
|
-
onKeyDown: Z(o.onKeyDown, (
|
|
5029
|
-
const
|
|
5030
|
-
!(
|
|
5043
|
+
onKeyDown: Z(o.onKeyDown, (f) => {
|
|
5044
|
+
const g = p.current !== "";
|
|
5045
|
+
!(f.ctrlKey || f.altKey || f.metaKey) && f.key.length === 1 && v(f.key), !(g && f.key === " ") && xc.includes(f.key) && (x(), f.preventDefault());
|
|
5031
5046
|
})
|
|
5032
5047
|
}
|
|
5033
5048
|
) });
|
|
@@ -5036,16 +5051,16 @@ var Ao = "SelectTrigger", _o = h.forwardRef(
|
|
|
5036
5051
|
_o.displayName = Ao;
|
|
5037
5052
|
var Po = "SelectValue", Tc = h.forwardRef(
|
|
5038
5053
|
(e, t) => {
|
|
5039
|
-
const { __scopeSelect: n, className: r, style: o, children: a, placeholder: i = "", ...s } = e, l = $e(Po, n), { onValueNodeHasChildrenChange: c } = l,
|
|
5054
|
+
const { __scopeSelect: n, className: r, style: o, children: a, placeholder: i = "", ...s } = e, l = $e(Po, n), { onValueNodeHasChildrenChange: c } = l, d = a !== void 0, p = ne(t, l.onValueNodeChange);
|
|
5040
5055
|
return se(() => {
|
|
5041
|
-
c(
|
|
5042
|
-
}, [c,
|
|
5056
|
+
c(d);
|
|
5057
|
+
}, [c, d]), /* @__PURE__ */ T(
|
|
5043
5058
|
X.span,
|
|
5044
5059
|
{
|
|
5045
5060
|
...s,
|
|
5046
5061
|
ref: p,
|
|
5047
5062
|
style: { pointerEvents: "none" },
|
|
5048
|
-
children: Xo(l.value) ? /* @__PURE__ */
|
|
5063
|
+
children: Xo(l.value) ? /* @__PURE__ */ T(mn, { children: i }) : a
|
|
5049
5064
|
}
|
|
5050
5065
|
);
|
|
5051
5066
|
}
|
|
@@ -5054,11 +5069,11 @@ Tc.displayName = Po;
|
|
|
5054
5069
|
var Ac = "SelectIcon", Ro = h.forwardRef(
|
|
5055
5070
|
(e, t) => {
|
|
5056
5071
|
const { __scopeSelect: n, children: r, ...o } = e;
|
|
5057
|
-
return /* @__PURE__ */
|
|
5072
|
+
return /* @__PURE__ */ T(X.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
|
|
5058
5073
|
}
|
|
5059
5074
|
);
|
|
5060
5075
|
Ro.displayName = Ac;
|
|
5061
|
-
var _c = "SelectPortal", Io = (e) => /* @__PURE__ */
|
|
5076
|
+
var _c = "SelectPortal", Io = (e) => /* @__PURE__ */ T(vo, { asChild: !0, ...e });
|
|
5062
5077
|
Io.displayName = _c;
|
|
5063
5078
|
var Xe = "SelectContent", No = h.forwardRef(
|
|
5064
5079
|
(e, t) => {
|
|
@@ -5068,15 +5083,15 @@ var Xe = "SelectContent", No = h.forwardRef(
|
|
|
5068
5083
|
}, []), !n.open) {
|
|
5069
5084
|
const a = r;
|
|
5070
5085
|
return a ? h.createPortal(
|
|
5071
|
-
/* @__PURE__ */
|
|
5086
|
+
/* @__PURE__ */ T(Oo, { scope: e.__scopeSelect, children: /* @__PURE__ */ T(Ut.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ T("div", { children: e.children }) }) }),
|
|
5072
5087
|
a
|
|
5073
5088
|
) : null;
|
|
5074
5089
|
}
|
|
5075
|
-
return /* @__PURE__ */
|
|
5090
|
+
return /* @__PURE__ */ T(Lo, { ...e, ref: t });
|
|
5076
5091
|
}
|
|
5077
5092
|
);
|
|
5078
5093
|
No.displayName = Xe;
|
|
5079
|
-
var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */
|
|
5094
|
+
var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ mt("SelectContent.RemoveScroll"), Lo = h.forwardRef(
|
|
5080
5095
|
(e, t) => {
|
|
5081
5096
|
const {
|
|
5082
5097
|
__scopeSelect: n,
|
|
@@ -5089,38 +5104,38 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5089
5104
|
side: s,
|
|
5090
5105
|
sideOffset: l,
|
|
5091
5106
|
align: c,
|
|
5092
|
-
alignOffset:
|
|
5107
|
+
alignOffset: d,
|
|
5093
5108
|
arrowPadding: p,
|
|
5094
5109
|
collisionBoundary: v,
|
|
5095
|
-
collisionPadding:
|
|
5096
|
-
sticky:
|
|
5097
|
-
hideWhenDetached:
|
|
5098
|
-
avoidCollisions:
|
|
5110
|
+
collisionPadding: m,
|
|
5111
|
+
sticky: x,
|
|
5112
|
+
hideWhenDetached: f,
|
|
5113
|
+
avoidCollisions: g,
|
|
5099
5114
|
//
|
|
5100
5115
|
...w
|
|
5101
|
-
} = e,
|
|
5116
|
+
} = e, b = $e(Xe, n), [y, C] = h.useState(null), [S, E] = h.useState(null), k = ne(t, (R) => C(R)), [I, D] = h.useState(null), [L, $] = h.useState(
|
|
5102
5117
|
null
|
|
5103
|
-
), W = jt(n), [
|
|
5118
|
+
), W = jt(n), [F, N] = h.useState(!1), _ = h.useRef(!1);
|
|
5104
5119
|
h.useEffect(() => {
|
|
5105
|
-
if (
|
|
5106
|
-
}, [
|
|
5120
|
+
if (y) return Fl(y);
|
|
5121
|
+
}, [y]), Xi();
|
|
5107
5122
|
const O = h.useCallback(
|
|
5108
5123
|
(R) => {
|
|
5109
|
-
const [K, ...
|
|
5124
|
+
const [K, ...re] = W().map((U) => U.ref.current), [j] = re.slice(-1), H = document.activeElement;
|
|
5110
5125
|
for (const U of R)
|
|
5111
5126
|
if (U === H || (U == null || U.scrollIntoView({ block: "nearest" }), U === K && S && (S.scrollTop = 0), U === j && S && (S.scrollTop = S.scrollHeight), U == null || U.focus(), document.activeElement !== H)) return;
|
|
5112
5127
|
},
|
|
5113
5128
|
[W, S]
|
|
5114
5129
|
), M = h.useCallback(
|
|
5115
|
-
() => O([I,
|
|
5116
|
-
[O, I,
|
|
5130
|
+
() => O([I, y]),
|
|
5131
|
+
[O, I, y]
|
|
5117
5132
|
);
|
|
5118
5133
|
h.useEffect(() => {
|
|
5119
|
-
|
|
5120
|
-
}, [
|
|
5121
|
-
const { onOpenChange: P, triggerPointerDownPosRef: z } =
|
|
5134
|
+
F && M();
|
|
5135
|
+
}, [F, M]);
|
|
5136
|
+
const { onOpenChange: P, triggerPointerDownPosRef: z } = b;
|
|
5122
5137
|
h.useEffect(() => {
|
|
5123
|
-
if (
|
|
5138
|
+
if (y) {
|
|
5124
5139
|
let R = { x: 0, y: 0 };
|
|
5125
5140
|
const K = (j) => {
|
|
5126
5141
|
var H, U;
|
|
@@ -5128,53 +5143,53 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5128
5143
|
x: Math.abs(Math.round(j.pageX) - (((H = z.current) == null ? void 0 : H.x) ?? 0)),
|
|
5129
5144
|
y: Math.abs(Math.round(j.pageY) - (((U = z.current) == null ? void 0 : U.y) ?? 0))
|
|
5130
5145
|
};
|
|
5131
|
-
},
|
|
5132
|
-
R.x <= 10 && R.y <= 10 ? j.preventDefault() :
|
|
5146
|
+
}, re = (j) => {
|
|
5147
|
+
R.x <= 10 && R.y <= 10 ? j.preventDefault() : y.contains(j.target) || P(!1), document.removeEventListener("pointermove", K), z.current = null;
|
|
5133
5148
|
};
|
|
5134
|
-
return z.current !== null && (document.addEventListener("pointermove", K), document.addEventListener("pointerup",
|
|
5135
|
-
document.removeEventListener("pointermove", K), document.removeEventListener("pointerup",
|
|
5149
|
+
return z.current !== null && (document.addEventListener("pointermove", K), document.addEventListener("pointerup", re, { capture: !0, once: !0 })), () => {
|
|
5150
|
+
document.removeEventListener("pointermove", K), document.removeEventListener("pointerup", re, { capture: !0 });
|
|
5136
5151
|
};
|
|
5137
5152
|
}
|
|
5138
|
-
}, [
|
|
5153
|
+
}, [y, P, z]), h.useEffect(() => {
|
|
5139
5154
|
const R = () => P(!1);
|
|
5140
5155
|
return window.addEventListener("blur", R), window.addEventListener("resize", R), () => {
|
|
5141
5156
|
window.removeEventListener("blur", R), window.removeEventListener("resize", R);
|
|
5142
5157
|
};
|
|
5143
5158
|
}, [P]);
|
|
5144
|
-
const [
|
|
5145
|
-
const K = W().filter((H) => !H.disabled),
|
|
5159
|
+
const [Q, Pe] = Zo((R) => {
|
|
5160
|
+
const K = W().filter((H) => !H.disabled), re = K.find((H) => H.ref.current === document.activeElement), j = Go(K, R, re);
|
|
5146
5161
|
j && setTimeout(() => j.ref.current.focus());
|
|
5147
5162
|
}), ut = h.useCallback(
|
|
5148
|
-
(R, K,
|
|
5149
|
-
const j = !
|
|
5150
|
-
(
|
|
5163
|
+
(R, K, re) => {
|
|
5164
|
+
const j = !_.current && !re;
|
|
5165
|
+
(b.value !== void 0 && b.value === K || j) && (D(R), j && (_.current = !0));
|
|
5151
5166
|
},
|
|
5152
|
-
[
|
|
5153
|
-
), dt = h.useCallback(() =>
|
|
5154
|
-
(R, K,
|
|
5155
|
-
const j = !
|
|
5156
|
-
(
|
|
5167
|
+
[b.value]
|
|
5168
|
+
), dt = h.useCallback(() => y == null ? void 0 : y.focus(), [y]), Me = h.useCallback(
|
|
5169
|
+
(R, K, re) => {
|
|
5170
|
+
const j = !_.current && !re;
|
|
5171
|
+
(b.value !== void 0 && b.value === K || j) && $(R);
|
|
5157
5172
|
},
|
|
5158
|
-
[
|
|
5173
|
+
[b.value]
|
|
5159
5174
|
), Ze = r === "popper" ? fn : Mo, He = Ze === fn ? {
|
|
5160
5175
|
side: s,
|
|
5161
5176
|
sideOffset: l,
|
|
5162
5177
|
align: c,
|
|
5163
|
-
alignOffset:
|
|
5178
|
+
alignOffset: d,
|
|
5164
5179
|
arrowPadding: p,
|
|
5165
5180
|
collisionBoundary: v,
|
|
5166
|
-
collisionPadding:
|
|
5167
|
-
sticky:
|
|
5168
|
-
hideWhenDetached:
|
|
5169
|
-
avoidCollisions:
|
|
5181
|
+
collisionPadding: m,
|
|
5182
|
+
sticky: x,
|
|
5183
|
+
hideWhenDetached: f,
|
|
5184
|
+
avoidCollisions: g
|
|
5170
5185
|
} : {};
|
|
5171
|
-
return /* @__PURE__ */
|
|
5186
|
+
return /* @__PURE__ */ T(
|
|
5172
5187
|
Oo,
|
|
5173
5188
|
{
|
|
5174
5189
|
scope: n,
|
|
5175
|
-
content:
|
|
5190
|
+
content: y,
|
|
5176
5191
|
viewport: S,
|
|
5177
|
-
onViewportChange:
|
|
5192
|
+
onViewportChange: E,
|
|
5178
5193
|
itemRefCallback: ut,
|
|
5179
5194
|
selectedItem: I,
|
|
5180
5195
|
onItemLeave: dt,
|
|
@@ -5182,21 +5197,21 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5182
5197
|
focusSelectedItem: M,
|
|
5183
5198
|
selectedItemText: L,
|
|
5184
5199
|
position: r,
|
|
5185
|
-
isPositioned:
|
|
5186
|
-
searchRef:
|
|
5187
|
-
children: /* @__PURE__ */
|
|
5200
|
+
isPositioned: F,
|
|
5201
|
+
searchRef: Q,
|
|
5202
|
+
children: /* @__PURE__ */ T(Eo, { as: Rc, allowPinchZoom: !0, children: /* @__PURE__ */ T(
|
|
5188
5203
|
Ur,
|
|
5189
5204
|
{
|
|
5190
5205
|
asChild: !0,
|
|
5191
|
-
trapped:
|
|
5206
|
+
trapped: b.open,
|
|
5192
5207
|
onMountAutoFocus: (R) => {
|
|
5193
5208
|
R.preventDefault();
|
|
5194
5209
|
},
|
|
5195
5210
|
onUnmountAutoFocus: Z(o, (R) => {
|
|
5196
5211
|
var K;
|
|
5197
|
-
(K =
|
|
5212
|
+
(K = b.trigger) == null || K.focus({ preventScroll: !0 }), R.preventDefault();
|
|
5198
5213
|
}),
|
|
5199
|
-
children: /* @__PURE__ */
|
|
5214
|
+
children: /* @__PURE__ */ T(
|
|
5200
5215
|
Wr,
|
|
5201
5216
|
{
|
|
5202
5217
|
asChild: !0,
|
|
@@ -5204,18 +5219,18 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5204
5219
|
onEscapeKeyDown: a,
|
|
5205
5220
|
onPointerDownOutside: i,
|
|
5206
5221
|
onFocusOutside: (R) => R.preventDefault(),
|
|
5207
|
-
onDismiss: () =>
|
|
5208
|
-
children: /* @__PURE__ */
|
|
5222
|
+
onDismiss: () => b.onOpenChange(!1),
|
|
5223
|
+
children: /* @__PURE__ */ T(
|
|
5209
5224
|
Ze,
|
|
5210
5225
|
{
|
|
5211
5226
|
role: "listbox",
|
|
5212
|
-
id:
|
|
5213
|
-
"data-state":
|
|
5214
|
-
dir:
|
|
5227
|
+
id: b.contentId,
|
|
5228
|
+
"data-state": b.open ? "open" : "closed",
|
|
5229
|
+
dir: b.dir,
|
|
5215
5230
|
onContextMenu: (R) => R.preventDefault(),
|
|
5216
5231
|
...w,
|
|
5217
5232
|
...He,
|
|
5218
|
-
onPlaced: () =>
|
|
5233
|
+
onPlaced: () => N(!0),
|
|
5219
5234
|
ref: k,
|
|
5220
5235
|
style: {
|
|
5221
5236
|
// flex layout so we can place the scroll buttons properly
|
|
@@ -5248,8 +5263,8 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5248
5263
|
);
|
|
5249
5264
|
Lo.displayName = Pc;
|
|
5250
5265
|
var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
5251
|
-
const { __scopeSelect: n, onPlaced: r, ...o } = e, a = $e(Xe, n), i = We(Xe, n), [s, l] = h.useState(null), [c,
|
|
5252
|
-
if (a.trigger && a.valueNode && s && c &&
|
|
5266
|
+
const { __scopeSelect: n, onPlaced: r, ...o } = e, a = $e(Xe, n), i = We(Xe, n), [s, l] = h.useState(null), [c, d] = h.useState(null), p = ne(t, (k) => d(k)), v = jt(n), m = h.useRef(!1), x = h.useRef(!0), { viewport: f, selectedItem: g, selectedItemText: w, focusSelectedItem: b } = i, y = h.useCallback(() => {
|
|
5267
|
+
if (a.trigger && a.valueNode && s && c && f && g && w) {
|
|
5253
5268
|
const k = a.trigger.getBoundingClientRect(), I = c.getBoundingClientRect(), D = a.valueNode.getBoundingClientRect(), L = w.getBoundingClientRect();
|
|
5254
5269
|
if (a.dir !== "rtl") {
|
|
5255
5270
|
const H = L.left - I.left, U = D.left - H, le = k.left - U, we = k.width + le, ft = Math.max(we, I.width), pt = window.innerWidth - pe, ht = Un(U, [
|
|
@@ -5269,27 +5284,27 @@ var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
|
5269
5284
|
]);
|
|
5270
5285
|
s.style.minWidth = we + "px", s.style.right = ht + "px";
|
|
5271
5286
|
}
|
|
5272
|
-
const $ = v(), W = window.innerHeight - pe * 2,
|
|
5287
|
+
const $ = v(), W = window.innerHeight - pe * 2, F = f.scrollHeight, N = window.getComputedStyle(c), _ = parseInt(N.borderTopWidth, 10), O = parseInt(N.paddingTop, 10), M = parseInt(N.borderBottomWidth, 10), P = parseInt(N.paddingBottom, 10), z = _ + O + F + P + M, Q = Math.min(g.offsetHeight * 5, z), Pe = window.getComputedStyle(f), ut = parseInt(Pe.paddingTop, 10), dt = parseInt(Pe.paddingBottom, 10), Me = k.top + k.height / 2 - pe, Ze = W - Me, He = g.offsetHeight / 2, R = g.offsetTop + He, K = _ + O + R, re = z - K;
|
|
5273
5288
|
if (K <= Me) {
|
|
5274
|
-
const H = $.length > 0 &&
|
|
5289
|
+
const H = $.length > 0 && g === $[$.length - 1].ref.current;
|
|
5275
5290
|
s.style.bottom = "0px";
|
|
5276
|
-
const U = c.clientHeight -
|
|
5291
|
+
const U = c.clientHeight - f.offsetTop - f.offsetHeight, le = Math.max(
|
|
5277
5292
|
Ze,
|
|
5278
5293
|
He + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
5279
5294
|
(H ? dt : 0) + U + M
|
|
5280
5295
|
), we = K + le;
|
|
5281
5296
|
s.style.height = we + "px";
|
|
5282
5297
|
} else {
|
|
5283
|
-
const H = $.length > 0 &&
|
|
5298
|
+
const H = $.length > 0 && g === $[0].ref.current;
|
|
5284
5299
|
s.style.top = "0px";
|
|
5285
5300
|
const le = Math.max(
|
|
5286
5301
|
Me,
|
|
5287
|
-
|
|
5302
|
+
_ + f.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
5288
5303
|
(H ? ut : 0) + He
|
|
5289
|
-
) +
|
|
5290
|
-
s.style.height = le + "px",
|
|
5304
|
+
) + re;
|
|
5305
|
+
s.style.height = le + "px", f.scrollTop = K - Me + f.offsetTop;
|
|
5291
5306
|
}
|
|
5292
|
-
s.style.margin = `${pe}px 0`, s.style.minHeight =
|
|
5307
|
+
s.style.margin = `${pe}px 0`, s.style.minHeight = Q + "px", s.style.maxHeight = W + "px", r == null || r(), requestAnimationFrame(() => m.current = !0);
|
|
5293
5308
|
}
|
|
5294
5309
|
}, [
|
|
5295
5310
|
v,
|
|
@@ -5297,31 +5312,31 @@ var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
|
5297
5312
|
a.valueNode,
|
|
5298
5313
|
s,
|
|
5299
5314
|
c,
|
|
5300
|
-
|
|
5301
|
-
|
|
5315
|
+
f,
|
|
5316
|
+
g,
|
|
5302
5317
|
w,
|
|
5303
5318
|
a.dir,
|
|
5304
5319
|
r
|
|
5305
5320
|
]);
|
|
5306
|
-
se(() =>
|
|
5321
|
+
se(() => y(), [y]);
|
|
5307
5322
|
const [C, S] = h.useState();
|
|
5308
5323
|
se(() => {
|
|
5309
5324
|
c && S(window.getComputedStyle(c).zIndex);
|
|
5310
5325
|
}, [c]);
|
|
5311
|
-
const
|
|
5326
|
+
const E = h.useCallback(
|
|
5312
5327
|
(k) => {
|
|
5313
|
-
k &&
|
|
5328
|
+
k && x.current === !0 && (y(), b == null || b(), x.current = !1);
|
|
5314
5329
|
},
|
|
5315
|
-
[
|
|
5330
|
+
[y, b]
|
|
5316
5331
|
);
|
|
5317
|
-
return /* @__PURE__ */
|
|
5332
|
+
return /* @__PURE__ */ T(
|
|
5318
5333
|
Oc,
|
|
5319
5334
|
{
|
|
5320
5335
|
scope: n,
|
|
5321
5336
|
contentWrapper: s,
|
|
5322
|
-
shouldExpandOnScrollRef:
|
|
5323
|
-
onScrollButtonChange:
|
|
5324
|
-
children: /* @__PURE__ */
|
|
5337
|
+
shouldExpandOnScrollRef: m,
|
|
5338
|
+
onScrollButtonChange: E,
|
|
5339
|
+
children: /* @__PURE__ */ T(
|
|
5325
5340
|
"div",
|
|
5326
5341
|
{
|
|
5327
5342
|
ref: l,
|
|
@@ -5331,7 +5346,7 @@ var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
|
5331
5346
|
position: "fixed",
|
|
5332
5347
|
zIndex: C
|
|
5333
5348
|
},
|
|
5334
|
-
children: /* @__PURE__ */
|
|
5349
|
+
children: /* @__PURE__ */ T(
|
|
5335
5350
|
X.div,
|
|
5336
5351
|
{
|
|
5337
5352
|
...o,
|
|
@@ -5359,7 +5374,7 @@ var Nc = "SelectPopperPosition", fn = h.forwardRef((e, t) => {
|
|
|
5359
5374
|
collisionPadding: o = pe,
|
|
5360
5375
|
...a
|
|
5361
5376
|
} = e, i = Yt(n);
|
|
5362
|
-
return /* @__PURE__ */
|
|
5377
|
+
return /* @__PURE__ */ T(
|
|
5363
5378
|
El,
|
|
5364
5379
|
{
|
|
5365
5380
|
...i,
|
|
@@ -5383,9 +5398,9 @@ var Nc = "SelectPopperPosition", fn = h.forwardRef((e, t) => {
|
|
|
5383
5398
|
fn.displayName = Nc;
|
|
5384
5399
|
var [Oc, Bn] = ct(Xe, {}), pn = "SelectViewport", Do = h.forwardRef(
|
|
5385
5400
|
(e, t) => {
|
|
5386
|
-
const { __scopeSelect: n, nonce: r, ...o } = e, a = We(pn, n), i = Bn(pn, n), s =
|
|
5387
|
-
return /* @__PURE__ */ Nt(
|
|
5388
|
-
/* @__PURE__ */
|
|
5401
|
+
const { __scopeSelect: n, nonce: r, ...o } = e, a = We(pn, n), i = Bn(pn, n), s = ne(t, a.onViewportChange), l = h.useRef(0);
|
|
5402
|
+
return /* @__PURE__ */ Nt(mn, { children: [
|
|
5403
|
+
/* @__PURE__ */ T(
|
|
5389
5404
|
"style",
|
|
5390
5405
|
{
|
|
5391
5406
|
dangerouslySetInnerHTML: {
|
|
@@ -5394,7 +5409,7 @@ var [Oc, Bn] = ct(Xe, {}), pn = "SelectViewport", Do = h.forwardRef(
|
|
|
5394
5409
|
nonce: r
|
|
5395
5410
|
}
|
|
5396
5411
|
),
|
|
5397
|
-
/* @__PURE__ */
|
|
5412
|
+
/* @__PURE__ */ T(Ut.Slot, { scope: n, children: /* @__PURE__ */ T(
|
|
5398
5413
|
X.div,
|
|
5399
5414
|
{
|
|
5400
5415
|
"data-radix-select-viewport": "",
|
|
@@ -5415,18 +5430,18 @@ var [Oc, Bn] = ct(Xe, {}), pn = "SelectViewport", Do = h.forwardRef(
|
|
|
5415
5430
|
...o.style
|
|
5416
5431
|
},
|
|
5417
5432
|
onScroll: Z(o.onScroll, (c) => {
|
|
5418
|
-
const
|
|
5433
|
+
const d = c.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef: v } = i;
|
|
5419
5434
|
if (v != null && v.current && p) {
|
|
5420
|
-
const
|
|
5421
|
-
if (
|
|
5422
|
-
const
|
|
5423
|
-
if (w <
|
|
5424
|
-
const
|
|
5425
|
-
p.style.height =
|
|
5435
|
+
const m = Math.abs(l.current - d.scrollTop);
|
|
5436
|
+
if (m > 0) {
|
|
5437
|
+
const x = window.innerHeight - pe * 2, f = parseFloat(p.style.minHeight), g = parseFloat(p.style.height), w = Math.max(f, g);
|
|
5438
|
+
if (w < x) {
|
|
5439
|
+
const b = w + m, y = Math.min(x, b), C = b - y;
|
|
5440
|
+
p.style.height = y + "px", p.style.bottom === "0px" && (d.scrollTop = C > 0 ? C : 0, p.style.justifyContent = "flex-end");
|
|
5426
5441
|
}
|
|
5427
5442
|
}
|
|
5428
5443
|
}
|
|
5429
|
-
l.current =
|
|
5444
|
+
l.current = d.scrollTop;
|
|
5430
5445
|
})
|
|
5431
5446
|
}
|
|
5432
5447
|
) })
|
|
@@ -5437,14 +5452,14 @@ Do.displayName = pn;
|
|
|
5437
5452
|
var Fo = "SelectGroup", [Lc, Mc] = ct(Fo), Dc = h.forwardRef(
|
|
5438
5453
|
(e, t) => {
|
|
5439
5454
|
const { __scopeSelect: n, ...r } = e, o = _n();
|
|
5440
|
-
return /* @__PURE__ */
|
|
5455
|
+
return /* @__PURE__ */ T(Lc, { scope: n, id: o, children: /* @__PURE__ */ T(X.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
5441
5456
|
}
|
|
5442
5457
|
);
|
|
5443
5458
|
Dc.displayName = Fo;
|
|
5444
5459
|
var Bo = "SelectLabel", Fc = h.forwardRef(
|
|
5445
5460
|
(e, t) => {
|
|
5446
5461
|
const { __scopeSelect: n, ...r } = e, o = Mc(Bo, n);
|
|
5447
|
-
return /* @__PURE__ */
|
|
5462
|
+
return /* @__PURE__ */ T(X.div, { id: o.id, ...r, ref: t });
|
|
5448
5463
|
}
|
|
5449
5464
|
);
|
|
5450
5465
|
Fc.displayName = Bo;
|
|
@@ -5456,42 +5471,42 @@ var Ft = "SelectItem", [Bc, zo] = ct(Ft), Vo = h.forwardRef(
|
|
|
5456
5471
|
disabled: o = !1,
|
|
5457
5472
|
textValue: a,
|
|
5458
5473
|
...i
|
|
5459
|
-
} = e, s = $e(Ft, n), l = We(Ft, n), c = s.value === r, [
|
|
5474
|
+
} = e, s = $e(Ft, n), l = We(Ft, n), c = s.value === r, [d, p] = h.useState(a ?? ""), [v, m] = h.useState(!1), x = ne(
|
|
5460
5475
|
t,
|
|
5461
|
-
(
|
|
5462
|
-
var
|
|
5463
|
-
return (
|
|
5476
|
+
(b) => {
|
|
5477
|
+
var y;
|
|
5478
|
+
return (y = l.itemRefCallback) == null ? void 0 : y.call(l, b, r, o);
|
|
5464
5479
|
}
|
|
5465
|
-
),
|
|
5480
|
+
), f = _n(), g = h.useRef("touch"), w = () => {
|
|
5466
5481
|
o || (s.onValueChange(r), s.onOpenChange(!1));
|
|
5467
5482
|
};
|
|
5468
5483
|
if (r === "")
|
|
5469
5484
|
throw new Error(
|
|
5470
5485
|
"A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder."
|
|
5471
5486
|
);
|
|
5472
|
-
return /* @__PURE__ */
|
|
5487
|
+
return /* @__PURE__ */ T(
|
|
5473
5488
|
Bc,
|
|
5474
5489
|
{
|
|
5475
5490
|
scope: n,
|
|
5476
5491
|
value: r,
|
|
5477
5492
|
disabled: o,
|
|
5478
|
-
textId:
|
|
5493
|
+
textId: f,
|
|
5479
5494
|
isSelected: c,
|
|
5480
|
-
onItemTextChange: h.useCallback((
|
|
5481
|
-
p((
|
|
5495
|
+
onItemTextChange: h.useCallback((b) => {
|
|
5496
|
+
p((y) => y || ((b == null ? void 0 : b.textContent) ?? "").trim());
|
|
5482
5497
|
}, []),
|
|
5483
|
-
children: /* @__PURE__ */
|
|
5498
|
+
children: /* @__PURE__ */ T(
|
|
5484
5499
|
Ut.ItemSlot,
|
|
5485
5500
|
{
|
|
5486
5501
|
scope: n,
|
|
5487
5502
|
value: r,
|
|
5488
5503
|
disabled: o,
|
|
5489
|
-
textValue:
|
|
5490
|
-
children: /* @__PURE__ */
|
|
5504
|
+
textValue: d,
|
|
5505
|
+
children: /* @__PURE__ */ T(
|
|
5491
5506
|
X.div,
|
|
5492
5507
|
{
|
|
5493
5508
|
role: "option",
|
|
5494
|
-
"aria-labelledby":
|
|
5509
|
+
"aria-labelledby": f,
|
|
5495
5510
|
"data-highlighted": v ? "" : void 0,
|
|
5496
5511
|
"aria-selected": c && v,
|
|
5497
5512
|
"data-state": c ? "checked" : "unchecked",
|
|
@@ -5499,29 +5514,29 @@ var Ft = "SelectItem", [Bc, zo] = ct(Ft), Vo = h.forwardRef(
|
|
|
5499
5514
|
"data-disabled": o ? "" : void 0,
|
|
5500
5515
|
tabIndex: o ? void 0 : -1,
|
|
5501
5516
|
...i,
|
|
5502
|
-
ref:
|
|
5503
|
-
onFocus: Z(i.onFocus, () =>
|
|
5504
|
-
onBlur: Z(i.onBlur, () =>
|
|
5517
|
+
ref: x,
|
|
5518
|
+
onFocus: Z(i.onFocus, () => m(!0)),
|
|
5519
|
+
onBlur: Z(i.onBlur, () => m(!1)),
|
|
5505
5520
|
onClick: Z(i.onClick, () => {
|
|
5506
|
-
|
|
5521
|
+
g.current !== "mouse" && w();
|
|
5507
5522
|
}),
|
|
5508
5523
|
onPointerUp: Z(i.onPointerUp, () => {
|
|
5509
|
-
|
|
5524
|
+
g.current === "mouse" && w();
|
|
5510
5525
|
}),
|
|
5511
|
-
onPointerDown: Z(i.onPointerDown, (
|
|
5512
|
-
|
|
5526
|
+
onPointerDown: Z(i.onPointerDown, (b) => {
|
|
5527
|
+
g.current = b.pointerType;
|
|
5513
5528
|
}),
|
|
5514
|
-
onPointerMove: Z(i.onPointerMove, (
|
|
5515
|
-
var
|
|
5516
|
-
|
|
5529
|
+
onPointerMove: Z(i.onPointerMove, (b) => {
|
|
5530
|
+
var y;
|
|
5531
|
+
g.current = b.pointerType, o ? (y = l.onItemLeave) == null || y.call(l) : g.current === "mouse" && b.currentTarget.focus({ preventScroll: !0 });
|
|
5517
5532
|
}),
|
|
5518
|
-
onPointerLeave: Z(i.onPointerLeave, (
|
|
5519
|
-
var
|
|
5520
|
-
|
|
5533
|
+
onPointerLeave: Z(i.onPointerLeave, (b) => {
|
|
5534
|
+
var y;
|
|
5535
|
+
b.currentTarget === document.activeElement && ((y = l.onItemLeave) == null || y.call(l));
|
|
5521
5536
|
}),
|
|
5522
|
-
onKeyDown: Z(i.onKeyDown, (
|
|
5537
|
+
onKeyDown: Z(i.onKeyDown, (b) => {
|
|
5523
5538
|
var C;
|
|
5524
|
-
((C = l.searchRef) == null ? void 0 : C.current) !== "" &&
|
|
5539
|
+
((C = l.searchRef) == null ? void 0 : C.current) !== "" && b.key === " " || (yc.includes(b.key) && w(), b.key === " " && b.preventDefault());
|
|
5525
5540
|
})
|
|
5526
5541
|
}
|
|
5527
5542
|
)
|
|
@@ -5532,36 +5547,36 @@ var Ft = "SelectItem", [Bc, zo] = ct(Ft), Vo = h.forwardRef(
|
|
|
5532
5547
|
}
|
|
5533
5548
|
);
|
|
5534
5549
|
Vo.displayName = Ft;
|
|
5535
|
-
var
|
|
5550
|
+
var gt = "SelectItemText", $o = h.forwardRef(
|
|
5536
5551
|
(e, t) => {
|
|
5537
|
-
const { __scopeSelect: n, className: r, style: o, ...a } = e, i = $e(
|
|
5552
|
+
const { __scopeSelect: n, className: r, style: o, ...a } = e, i = $e(gt, n), s = We(gt, n), l = zo(gt, n), c = Ec(gt, n), [d, p] = h.useState(null), v = ne(
|
|
5538
5553
|
t,
|
|
5539
5554
|
(w) => p(w),
|
|
5540
5555
|
l.onItemTextChange,
|
|
5541
5556
|
(w) => {
|
|
5542
|
-
var
|
|
5543
|
-
return (
|
|
5557
|
+
var b;
|
|
5558
|
+
return (b = s.itemTextRefCallback) == null ? void 0 : b.call(s, w, l.value, l.disabled);
|
|
5544
5559
|
}
|
|
5545
|
-
),
|
|
5546
|
-
() => /* @__PURE__ */
|
|
5547
|
-
[l.disabled, l.value,
|
|
5548
|
-
), { onNativeOptionAdd:
|
|
5549
|
-
return se(() => (
|
|
5550
|
-
/* @__PURE__ */
|
|
5560
|
+
), m = d == null ? void 0 : d.textContent, x = h.useMemo(
|
|
5561
|
+
() => /* @__PURE__ */ T("option", { value: l.value, disabled: l.disabled, children: m }, l.value),
|
|
5562
|
+
[l.disabled, l.value, m]
|
|
5563
|
+
), { onNativeOptionAdd: f, onNativeOptionRemove: g } = c;
|
|
5564
|
+
return se(() => (f(x), () => g(x)), [f, g, x]), /* @__PURE__ */ Nt(mn, { children: [
|
|
5565
|
+
/* @__PURE__ */ T(X.span, { id: l.textId, ...a, ref: v }),
|
|
5551
5566
|
l.isSelected && i.valueNode && !i.valueNodeHasChildren ? h.createPortal(a.children, i.valueNode) : null
|
|
5552
5567
|
] });
|
|
5553
5568
|
}
|
|
5554
5569
|
);
|
|
5555
|
-
$o.displayName =
|
|
5570
|
+
$o.displayName = gt;
|
|
5556
5571
|
var Wo = "SelectItemIndicator", Ho = h.forwardRef(
|
|
5557
5572
|
(e, t) => {
|
|
5558
5573
|
const { __scopeSelect: n, ...r } = e;
|
|
5559
|
-
return zo(Wo, n).isSelected ? /* @__PURE__ */
|
|
5574
|
+
return zo(Wo, n).isSelected ? /* @__PURE__ */ T(X.span, { "aria-hidden": !0, ...r, ref: t }) : null;
|
|
5560
5575
|
}
|
|
5561
5576
|
);
|
|
5562
5577
|
Ho.displayName = Wo;
|
|
5563
5578
|
var hn = "SelectScrollUpButton", Uo = h.forwardRef((e, t) => {
|
|
5564
|
-
const n = We(hn, e.__scopeSelect), r = Bn(hn, e.__scopeSelect), [o, a] = h.useState(!1), i =
|
|
5579
|
+
const n = We(hn, e.__scopeSelect), r = Bn(hn, e.__scopeSelect), [o, a] = h.useState(!1), i = ne(t, r.onScrollButtonChange);
|
|
5565
5580
|
return se(() => {
|
|
5566
5581
|
if (n.viewport && n.isPositioned) {
|
|
5567
5582
|
let s = function() {
|
|
@@ -5571,7 +5586,7 @@ var hn = "SelectScrollUpButton", Uo = h.forwardRef((e, t) => {
|
|
|
5571
5586
|
const l = n.viewport;
|
|
5572
5587
|
return s(), l.addEventListener("scroll", s), () => l.removeEventListener("scroll", s);
|
|
5573
5588
|
}
|
|
5574
|
-
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */
|
|
5589
|
+
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ T(
|
|
5575
5590
|
Yo,
|
|
5576
5591
|
{
|
|
5577
5592
|
...e,
|
|
@@ -5585,17 +5600,17 @@ var hn = "SelectScrollUpButton", Uo = h.forwardRef((e, t) => {
|
|
|
5585
5600
|
});
|
|
5586
5601
|
Uo.displayName = hn;
|
|
5587
5602
|
var vn = "SelectScrollDownButton", jo = h.forwardRef((e, t) => {
|
|
5588
|
-
const n = We(vn, e.__scopeSelect), r = Bn(vn, e.__scopeSelect), [o, a] = h.useState(!1), i =
|
|
5603
|
+
const n = We(vn, e.__scopeSelect), r = Bn(vn, e.__scopeSelect), [o, a] = h.useState(!1), i = ne(t, r.onScrollButtonChange);
|
|
5589
5604
|
return se(() => {
|
|
5590
5605
|
if (n.viewport && n.isPositioned) {
|
|
5591
5606
|
let s = function() {
|
|
5592
|
-
const c = l.scrollHeight - l.clientHeight,
|
|
5593
|
-
a(
|
|
5607
|
+
const c = l.scrollHeight - l.clientHeight, d = Math.ceil(l.scrollTop) < c;
|
|
5608
|
+
a(d);
|
|
5594
5609
|
};
|
|
5595
5610
|
const l = n.viewport;
|
|
5596
5611
|
return s(), l.addEventListener("scroll", s), () => l.removeEventListener("scroll", s);
|
|
5597
5612
|
}
|
|
5598
|
-
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */
|
|
5613
|
+
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ T(
|
|
5599
5614
|
Yo,
|
|
5600
5615
|
{
|
|
5601
5616
|
...e,
|
|
@@ -5613,10 +5628,10 @@ var Yo = h.forwardRef((e, t) => {
|
|
|
5613
5628
|
i.current !== null && (window.clearInterval(i.current), i.current = null);
|
|
5614
5629
|
}, []);
|
|
5615
5630
|
return h.useEffect(() => () => l(), [l]), se(() => {
|
|
5616
|
-
var
|
|
5631
|
+
var d;
|
|
5617
5632
|
const c = s().find((p) => p.ref.current === document.activeElement);
|
|
5618
|
-
(
|
|
5619
|
-
}, [s]), /* @__PURE__ */
|
|
5633
|
+
(d = c == null ? void 0 : c.ref.current) == null || d.scrollIntoView({ block: "nearest" });
|
|
5634
|
+
}, [s]), /* @__PURE__ */ T(
|
|
5620
5635
|
X.div,
|
|
5621
5636
|
{
|
|
5622
5637
|
"aria-hidden": !0,
|
|
@@ -5638,36 +5653,36 @@ var Yo = h.forwardRef((e, t) => {
|
|
|
5638
5653
|
}), zc = "SelectSeparator", Vc = h.forwardRef(
|
|
5639
5654
|
(e, t) => {
|
|
5640
5655
|
const { __scopeSelect: n, ...r } = e;
|
|
5641
|
-
return /* @__PURE__ */
|
|
5656
|
+
return /* @__PURE__ */ T(X.div, { "aria-hidden": !0, ...r, ref: t });
|
|
5642
5657
|
}
|
|
5643
5658
|
);
|
|
5644
5659
|
Vc.displayName = zc;
|
|
5645
|
-
var
|
|
5660
|
+
var gn = "SelectArrow", $c = h.forwardRef(
|
|
5646
5661
|
(e, t) => {
|
|
5647
|
-
const { __scopeSelect: n, ...r } = e, o = Yt(n), a = $e(
|
|
5648
|
-
return a.open && i.position === "popper" ? /* @__PURE__ */
|
|
5662
|
+
const { __scopeSelect: n, ...r } = e, o = Yt(n), a = $e(gn, n), i = We(gn, n);
|
|
5663
|
+
return a.open && i.position === "popper" ? /* @__PURE__ */ T(Tl, { ...o, ...r, ref: t }) : null;
|
|
5649
5664
|
}
|
|
5650
5665
|
);
|
|
5651
|
-
$c.displayName =
|
|
5666
|
+
$c.displayName = gn;
|
|
5652
5667
|
var Wc = "SelectBubbleInput", Ko = h.forwardRef(
|
|
5653
5668
|
({ __scopeSelect: e, value: t, ...n }, r) => {
|
|
5654
|
-
const o = h.useRef(null), a =
|
|
5669
|
+
const o = h.useRef(null), a = ne(r, o), i = Il(t);
|
|
5655
5670
|
return h.useEffect(() => {
|
|
5656
5671
|
const s = o.current;
|
|
5657
5672
|
if (!s) return;
|
|
5658
|
-
const l = window.HTMLSelectElement.prototype,
|
|
5673
|
+
const l = window.HTMLSelectElement.prototype, d = Object.getOwnPropertyDescriptor(
|
|
5659
5674
|
l,
|
|
5660
5675
|
"value"
|
|
5661
5676
|
).set;
|
|
5662
|
-
if (i !== t &&
|
|
5677
|
+
if (i !== t && d) {
|
|
5663
5678
|
const p = new Event("change", { bubbles: !0 });
|
|
5664
|
-
|
|
5679
|
+
d.call(s, t), s.dispatchEvent(p);
|
|
5665
5680
|
}
|
|
5666
|
-
}, [i, t]), /* @__PURE__ */
|
|
5681
|
+
}, [i, t]), /* @__PURE__ */ T(
|
|
5667
5682
|
X.select,
|
|
5668
5683
|
{
|
|
5669
5684
|
...n,
|
|
5670
|
-
style: { ...
|
|
5685
|
+
style: { ...go, ...n.style },
|
|
5671
5686
|
ref: a,
|
|
5672
5687
|
defaultValue: t
|
|
5673
5688
|
}
|
|
@@ -5731,7 +5746,7 @@ function zn({
|
|
|
5731
5746
|
}
|
|
5732
5747
|
function Jo({ children: e, ...t }) {
|
|
5733
5748
|
const [n, r] = Ie(!1), { language: o, setLanguage: a, options: i } = at(), s = za();
|
|
5734
|
-
return /* @__PURE__ */
|
|
5749
|
+
return /* @__PURE__ */ A(
|
|
5735
5750
|
Uc,
|
|
5736
5751
|
{
|
|
5737
5752
|
open: n,
|
|
@@ -5744,7 +5759,7 @@ function Jo({ children: e, ...t }) {
|
|
|
5744
5759
|
},
|
|
5745
5760
|
children: [
|
|
5746
5761
|
e,
|
|
5747
|
-
/* @__PURE__ */ u(jc, { container: s, children: /* @__PURE__ */
|
|
5762
|
+
/* @__PURE__ */ u(jc, { container: s, children: /* @__PURE__ */ A(
|
|
5748
5763
|
Yc,
|
|
5749
5764
|
{
|
|
5750
5765
|
className: "overflow-hidden bg-base border border-base-border rounded-dropdown-sheet max-h-[min(384px,var(--radix-select-content-available-height))] min-w-[var(--radix-select-trigger-width)] z-10",
|
|
@@ -5758,7 +5773,7 @@ function Jo({ children: e, ...t }) {
|
|
|
5758
5773
|
...t,
|
|
5759
5774
|
children: [
|
|
5760
5775
|
/* @__PURE__ */ u(qc, { className: "flex items-center justify-center h-6 bg-base text-base-subtle cursor-default", children: /* @__PURE__ */ u(Se, { size: "sm", name: "chevron-up" }) }),
|
|
5761
|
-
/* @__PURE__ */ u(Kc, { className: "p-1.5", children: i.value.map((l) => /* @__PURE__ */
|
|
5776
|
+
/* @__PURE__ */ u(Kc, { className: "p-1.5", children: i.value.map((l) => /* @__PURE__ */ A(
|
|
5762
5777
|
Xc,
|
|
5763
5778
|
{
|
|
5764
5779
|
value: l.languageCode,
|
|
@@ -5784,7 +5799,7 @@ function eu({
|
|
|
5784
5799
|
...t
|
|
5785
5800
|
}) {
|
|
5786
5801
|
const n = G(), { language: r, showPicker: o } = at();
|
|
5787
|
-
return o.value ? /* @__PURE__ */ u(Jo, { align: "center", children: /* @__PURE__ */
|
|
5802
|
+
return o.value ? /* @__PURE__ */ u(Jo, { align: "center", children: /* @__PURE__ */ A(
|
|
5788
5803
|
qo,
|
|
5789
5804
|
{
|
|
5790
5805
|
className: V(
|
|
@@ -5809,7 +5824,7 @@ function tu({
|
|
|
5809
5824
|
showLanguageSelector: o
|
|
5810
5825
|
}) {
|
|
5811
5826
|
const a = G();
|
|
5812
|
-
return /* @__PURE__ */
|
|
5827
|
+
return /* @__PURE__ */ A(
|
|
5813
5828
|
"div",
|
|
5814
5829
|
{
|
|
5815
5830
|
className: V(
|
|
@@ -5817,7 +5832,7 @@ function tu({
|
|
|
5817
5832
|
r && "shadow-header"
|
|
5818
5833
|
),
|
|
5819
5834
|
children: [
|
|
5820
|
-
/* @__PURE__ */
|
|
5835
|
+
/* @__PURE__ */ A("div", { className: "flex gap-2 p-4 items-start", children: [
|
|
5821
5836
|
e ? /* @__PURE__ */ u(
|
|
5822
5837
|
ve,
|
|
5823
5838
|
{
|
|
@@ -5828,9 +5843,9 @@ function tu({
|
|
|
5828
5843
|
children: /* @__PURE__ */ u(Se, { name: "chevron-up", className: "-rotate-90", size: "sm" })
|
|
5829
5844
|
}
|
|
5830
5845
|
) : /* @__PURE__ */ u("div", { className: "relative w-8 h-8" }),
|
|
5831
|
-
/* @__PURE__ */ u(
|
|
5846
|
+
/* @__PURE__ */ u(ie, { active: n, children: /* @__PURE__ */ u(Cn, { className: "transition-opacity data-hidden:opacity-0" }) })
|
|
5832
5847
|
] }),
|
|
5833
|
-
/* @__PURE__ */ u(
|
|
5848
|
+
/* @__PURE__ */ u(ie, { active: o, children: /* @__PURE__ */ u("div", { className: "absolute top-0 left-0 right-0 p-4 flex justify-center transition-[opacity,transform] duration-200 data-hidden:opacity-0 data-hidden:-translate-y-4", children: /* @__PURE__ */ u(eu, {}) }) })
|
|
5834
5849
|
]
|
|
5835
5850
|
}
|
|
5836
5851
|
);
|
|
@@ -5844,22 +5859,22 @@ const nu = {
|
|
|
5844
5859
|
bottom: "origin-bottom"
|
|
5845
5860
|
};
|
|
5846
5861
|
function hr({ open: e }) {
|
|
5847
|
-
const t = G(), n = bn(), r = zt(), o = q(), a = o.value.placement, { isDisconnected: i, startSession: s, transcript: l, conversationIndex: c } =
|
|
5862
|
+
const t = G(), n = bn(), r = zt(), o = q(), a = o.value.placement, { isDisconnected: i, startSession: s, transcript: l, conversationIndex: c } = oe(), d = Ar(), { currentContent: p, currentConfig: v } = kn(), m = Y(() => {
|
|
5848
5863
|
var w;
|
|
5849
|
-
return n.value || r.value ? !
|
|
5864
|
+
return n.value || r.value ? !d.value || !n.value ? l.value : [
|
|
5850
5865
|
{
|
|
5851
5866
|
type: "message",
|
|
5852
5867
|
role: "ai",
|
|
5853
|
-
message:
|
|
5868
|
+
message: d.value,
|
|
5854
5869
|
isText: !0,
|
|
5855
5870
|
conversationIndex: ((w = l.value[0]) == null ? void 0 : w.conversationIndex) ?? c.peek()
|
|
5856
5871
|
},
|
|
5857
5872
|
...l.value
|
|
5858
5873
|
] : o.value.transcript_enabled ? l.value : l.value.filter(
|
|
5859
|
-
(
|
|
5874
|
+
(b) => b.type !== "message" || b.isText
|
|
5860
5875
|
);
|
|
5861
|
-
}),
|
|
5862
|
-
return /* @__PURE__ */ u(
|
|
5876
|
+
}), x = m.value.length > 0 || !i.value && o.value.transcript_enabled, f = J(!0), g = p.value !== "feedback";
|
|
5877
|
+
return /* @__PURE__ */ u(ie, { initial: !1, active: e, children: /* @__PURE__ */ A(
|
|
5863
5878
|
"div",
|
|
5864
5879
|
{
|
|
5865
5880
|
className: V(
|
|
@@ -5874,45 +5889,45 @@ function hr({ open: e }) {
|
|
|
5874
5889
|
{
|
|
5875
5890
|
showBackButton: v.showHeaderBack,
|
|
5876
5891
|
onBackClick: v.onHeaderBack,
|
|
5877
|
-
showStatusLabel:
|
|
5878
|
-
showShadow:
|
|
5879
|
-
showLanguageSelector: p.value !== "feedback" && (!
|
|
5892
|
+
showStatusLabel: x && !i.value,
|
|
5893
|
+
showShadow: x,
|
|
5894
|
+
showLanguageSelector: p.value !== "feedback" && (!x || i.value)
|
|
5880
5895
|
}
|
|
5881
5896
|
),
|
|
5882
|
-
/* @__PURE__ */ u(
|
|
5897
|
+
/* @__PURE__ */ u(ie, { active: p.value === "transcript", children: /* @__PURE__ */ A("div", { className: "grow flex flex-col min-h-0 transition-opacity duration-300 ease-out data-hidden:opacity-0", children: [
|
|
5883
5898
|
/* @__PURE__ */ u(
|
|
5884
5899
|
Ri,
|
|
5885
5900
|
{
|
|
5886
|
-
transcript:
|
|
5887
|
-
scrollPinned:
|
|
5901
|
+
transcript: m,
|
|
5902
|
+
scrollPinned: f
|
|
5888
5903
|
}
|
|
5889
5904
|
),
|
|
5890
5905
|
/* @__PURE__ */ u(
|
|
5891
5906
|
Ii,
|
|
5892
5907
|
{
|
|
5893
|
-
scrollPinned:
|
|
5894
|
-
showTranscript:
|
|
5908
|
+
scrollPinned: f,
|
|
5909
|
+
showTranscript: x
|
|
5895
5910
|
}
|
|
5896
5911
|
)
|
|
5897
5912
|
] }) }),
|
|
5898
|
-
/* @__PURE__ */ u(
|
|
5913
|
+
/* @__PURE__ */ u(ie, { active: p.value === "feedback", children: /* @__PURE__ */ A("div", { className: "absolute inset-0 top-[88px] flex flex-col bg-base transition-transform duration-300 ease-out data-hidden:translate-x-full", children: [
|
|
5899
5914
|
/* @__PURE__ */ u(Ni, {}),
|
|
5900
5915
|
/* @__PURE__ */ u(Oi, {})
|
|
5901
5916
|
] }) }),
|
|
5902
|
-
/* @__PURE__ */ u(
|
|
5917
|
+
/* @__PURE__ */ u(ie, { active: g, children: /* @__PURE__ */ A(
|
|
5903
5918
|
"div",
|
|
5904
5919
|
{
|
|
5905
5920
|
className: V(
|
|
5906
5921
|
"absolute origin-top-left transition-[transform,left,top,opacity,scale] duration-200 z-1",
|
|
5907
5922
|
"data-hidden:opacity-0",
|
|
5908
|
-
|
|
5923
|
+
x ? "top-4 left-4 scale-[0.1667]" : "top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 scale-100"
|
|
5909
5924
|
),
|
|
5910
5925
|
children: [
|
|
5911
5926
|
/* @__PURE__ */ u(it, { size: "lg" }),
|
|
5912
5927
|
/* @__PURE__ */ u(
|
|
5913
|
-
|
|
5928
|
+
ie,
|
|
5914
5929
|
{
|
|
5915
|
-
active: !
|
|
5930
|
+
active: !x && i.value && !n.value,
|
|
5916
5931
|
children: /* @__PURE__ */ u("div", { className: "absolute bottom-0 p-1 rounded-[calc(var(--el-button-radius)+4px)] bg-base left-1/2 -translate-x-1/2 translate-y-1/2 transition-[opacity,transform] data-hidden:opacity-0 data-hidden:scale-100 scale-150", children: /* @__PURE__ */ u(
|
|
5917
5932
|
ve,
|
|
5918
5933
|
{
|
|
@@ -5924,7 +5939,7 @@ function hr({ open: e }) {
|
|
|
5924
5939
|
) })
|
|
5925
5940
|
}
|
|
5926
5941
|
),
|
|
5927
|
-
/* @__PURE__ */ u(
|
|
5942
|
+
/* @__PURE__ */ u(ie, { active: !x && !i.value, children: /* @__PURE__ */ u("div", { className: "absolute -bottom-3 left-1/2 -translate-x-1/2 translate-y-full transition-[opacity,transform] data-hidden:opacity-0 data-hidden:scale-75", children: /* @__PURE__ */ u(Cn, {}) }) })
|
|
5928
5943
|
]
|
|
5929
5944
|
}
|
|
5930
5945
|
) })
|
|
@@ -5933,10 +5948,10 @@ function hr({ open: e }) {
|
|
|
5933
5948
|
) });
|
|
5934
5949
|
}
|
|
5935
5950
|
function ea({ expanded: e }) {
|
|
5936
|
-
const t = zt(), n = q().value.variant, { isDisconnected: r } =
|
|
5951
|
+
const t = zt(), n = q().value.variant, { isDisconnected: r } = oe(), o = G(), a = te(() => {
|
|
5937
5952
|
e.value = !e.value;
|
|
5938
5953
|
}, [e]);
|
|
5939
|
-
return /* @__PURE__ */
|
|
5954
|
+
return /* @__PURE__ */ A(rt, { children: [
|
|
5940
5955
|
n === "full" && /* @__PURE__ */ u(
|
|
5941
5956
|
Ne,
|
|
5942
5957
|
{
|
|
@@ -5982,8 +5997,8 @@ function ru({
|
|
|
5982
5997
|
className: t,
|
|
5983
5998
|
...n
|
|
5984
5999
|
}) {
|
|
5985
|
-
const { isDisconnected: r } =
|
|
5986
|
-
return /* @__PURE__ */
|
|
6000
|
+
const { isDisconnected: r } = oe(), o = G();
|
|
6001
|
+
return /* @__PURE__ */ A(
|
|
5987
6002
|
"div",
|
|
5988
6003
|
{
|
|
5989
6004
|
className: V(
|
|
@@ -5998,7 +6013,7 @@ function ru({
|
|
|
5998
6013
|
{
|
|
5999
6014
|
visible: !e.value && r.value,
|
|
6000
6015
|
className: "p-1 !min-w-60",
|
|
6001
|
-
children: /* @__PURE__ */
|
|
6016
|
+
children: /* @__PURE__ */ A("div", { className: "flex items-center gap-2", children: [
|
|
6002
6017
|
/* @__PURE__ */ u(it, {}),
|
|
6003
6018
|
/* @__PURE__ */ u("div", { className: "text-sm max-w-64", children: o.main_label })
|
|
6004
6019
|
] })
|
|
@@ -6014,7 +6029,7 @@ function ou({
|
|
|
6014
6029
|
className: t,
|
|
6015
6030
|
...n
|
|
6016
6031
|
}) {
|
|
6017
|
-
return /* @__PURE__ */
|
|
6032
|
+
return /* @__PURE__ */ A(
|
|
6018
6033
|
"div",
|
|
6019
6034
|
{
|
|
6020
6035
|
className: V("rounded-compact-sheet flex items-center p-2", t),
|
|
@@ -6028,7 +6043,7 @@ function ou({
|
|
|
6028
6043
|
}
|
|
6029
6044
|
function au({ visible: e, className: t, ...n }) {
|
|
6030
6045
|
const r = G(), { language: o, showPicker: a } = at();
|
|
6031
|
-
return a.value ? /* @__PURE__ */ u(Ne, { visible: e, className: "p-1", children: /* @__PURE__ */ u(Jo, { children: /* @__PURE__ */
|
|
6046
|
+
return a.value ? /* @__PURE__ */ u(Ne, { visible: e, className: "p-1", children: /* @__PURE__ */ u(Jo, { children: /* @__PURE__ */ A(
|
|
6032
6047
|
qo,
|
|
6033
6048
|
{
|
|
6034
6049
|
className: V(
|
|
@@ -6045,8 +6060,8 @@ function au({ visible: e, className: t, ...n }) {
|
|
|
6045
6060
|
) }) }) : null;
|
|
6046
6061
|
}
|
|
6047
6062
|
function ta() {
|
|
6048
|
-
const e = q().value.variant, { isDisconnected: t, status: n } =
|
|
6049
|
-
return /* @__PURE__ */
|
|
6063
|
+
const e = q().value.variant, { isDisconnected: t, status: n } = oe();
|
|
6064
|
+
return /* @__PURE__ */ A(rt, { children: [
|
|
6050
6065
|
/* @__PURE__ */ u(
|
|
6051
6066
|
Tn,
|
|
6052
6067
|
{
|
|
@@ -6064,11 +6079,11 @@ function iu({
|
|
|
6064
6079
|
className: e,
|
|
6065
6080
|
...t
|
|
6066
6081
|
}) {
|
|
6067
|
-
const { isDisconnected: n } =
|
|
6068
|
-
return /* @__PURE__ */
|
|
6069
|
-
/* @__PURE__ */
|
|
6082
|
+
const { isDisconnected: n } = oe(), r = G();
|
|
6083
|
+
return /* @__PURE__ */ A("div", { className: V("flex flex-col p-2 rounded-sheet", e), ...t, children: [
|
|
6084
|
+
/* @__PURE__ */ A("div", { className: "flex items-center p-1 gap-2 min-w-60", children: [
|
|
6070
6085
|
/* @__PURE__ */ u(it, {}),
|
|
6071
|
-
/* @__PURE__ */
|
|
6086
|
+
/* @__PURE__ */ A("div", { className: "relative text-sm max-w-64", children: [
|
|
6072
6087
|
/* @__PURE__ */ u(
|
|
6073
6088
|
"span",
|
|
6074
6089
|
{
|
|
@@ -6079,7 +6094,7 @@ function iu({
|
|
|
6079
6094
|
children: r.main_label
|
|
6080
6095
|
}
|
|
6081
6096
|
),
|
|
6082
|
-
/* @__PURE__ */ u(
|
|
6097
|
+
/* @__PURE__ */ u(ie, { active: !n.value, children: /* @__PURE__ */ u(Cn, { className: "absolute top-1/2 -translate-y-1/2 transition-[transform,opacity] duration-200 data-hidden:opacity-0 data-hidden:scale-90" }) })
|
|
6083
6098
|
] })
|
|
6084
6099
|
] }),
|
|
6085
6100
|
/* @__PURE__ */ u("div", { className: "flex items-center", children: /* @__PURE__ */ u(ta, {}) })
|
|
@@ -6089,7 +6104,7 @@ function su({
|
|
|
6089
6104
|
className: e,
|
|
6090
6105
|
...t
|
|
6091
6106
|
}) {
|
|
6092
|
-
return /* @__PURE__ */
|
|
6107
|
+
return /* @__PURE__ */ A(
|
|
6093
6108
|
"div",
|
|
6094
6109
|
{
|
|
6095
6110
|
className: V("rounded-compact-sheet flex items-center p-2", e),
|
|
@@ -6102,7 +6117,7 @@ function su({
|
|
|
6102
6117
|
);
|
|
6103
6118
|
}
|
|
6104
6119
|
function lu({ expandable: e, expanded: t }) {
|
|
6105
|
-
const n = q().value.variant, r = Bt(), { isDisconnected: o } =
|
|
6120
|
+
const n = q().value.variant, r = Bt(), { isDisconnected: o } = oe(), a = te(async () => {
|
|
6106
6121
|
await r.requestTerms(), t.value = !t.peek();
|
|
6107
6122
|
}, [t]), i = n === "full";
|
|
6108
6123
|
return e ? /* @__PURE__ */ u(
|
|
@@ -6119,7 +6134,7 @@ function lu({ expandable: e, expanded: t }) {
|
|
|
6119
6134
|
}
|
|
6120
6135
|
function cu() {
|
|
6121
6136
|
const e = G(), t = q(), { dismissTerms: n, acceptTerms: r } = Bt();
|
|
6122
|
-
return /* @__PURE__ */
|
|
6137
|
+
return /* @__PURE__ */ A("div", { className: "max-w-[400px] flex flex-col gap-2 bg-base shadow-md pointer-events-auto rounded-sheet p-3 text-sm", children: [
|
|
6123
6138
|
/* @__PURE__ */ u(
|
|
6124
6139
|
"div",
|
|
6125
6140
|
{
|
|
@@ -6127,7 +6142,7 @@ function cu() {
|
|
|
6127
6142
|
dangerouslySetInnerHTML: { __html: t.value.terms_html ?? "" }
|
|
6128
6143
|
}
|
|
6129
6144
|
),
|
|
6130
|
-
/* @__PURE__ */
|
|
6145
|
+
/* @__PURE__ */ A("div", { className: "flex justify-end gap-2", children: [
|
|
6131
6146
|
/* @__PURE__ */ u(ve, { onClick: n, children: e.dismiss_terms }),
|
|
6132
6147
|
/* @__PURE__ */ u(ve, { onClick: r, variant: "primary", children: e.accept_terms })
|
|
6133
6148
|
] })
|
|
@@ -6145,30 +6160,30 @@ function uu({ copyText: e, children: t }) {
|
|
|
6145
6160
|
};
|
|
6146
6161
|
}
|
|
6147
6162
|
}, [r]);
|
|
6148
|
-
const a =
|
|
6163
|
+
const a = te(() => {
|
|
6149
6164
|
const i = Ir(e);
|
|
6150
6165
|
i && (navigator.clipboard.writeText(i), o(!0));
|
|
6151
6166
|
}, []);
|
|
6152
6167
|
return /* @__PURE__ */ u(ve, { onClick: a, children: r ? n.copied : t });
|
|
6153
6168
|
}
|
|
6154
6169
|
function du({ sawError: e }) {
|
|
6155
|
-
const t = G(), { error: n, lastId: r } =
|
|
6170
|
+
const t = G(), { error: n, lastId: r } = oe(), o = te(() => {
|
|
6156
6171
|
e.value = !0;
|
|
6157
6172
|
}, []);
|
|
6158
|
-
return /* @__PURE__ */
|
|
6159
|
-
/* @__PURE__ */
|
|
6173
|
+
return /* @__PURE__ */ A("div", { className: "max-w-[400px] flex flex-col gap-2 bg-base shadow-md pointer-events-auto rounded-sheet p-3 text-sm", children: [
|
|
6174
|
+
/* @__PURE__ */ A("div", { className: "p-2 pt-1", children: [
|
|
6160
6175
|
/* @__PURE__ */ u("h1", { className: "text-md font-medium pb-1", children: t.error_occurred }),
|
|
6161
6176
|
n.value,
|
|
6162
|
-
r.value && /* @__PURE__ */
|
|
6177
|
+
r.value && /* @__PURE__ */ A(rt, { children: [
|
|
6163
6178
|
/* @__PURE__ */ u("br", {}),
|
|
6164
|
-
/* @__PURE__ */
|
|
6179
|
+
/* @__PURE__ */ A("span", { className: "text-base-subtle", children: [
|
|
6165
6180
|
t.conversation_id,
|
|
6166
6181
|
": ",
|
|
6167
6182
|
r.value
|
|
6168
6183
|
] })
|
|
6169
6184
|
] })
|
|
6170
6185
|
] }),
|
|
6171
|
-
/* @__PURE__ */
|
|
6186
|
+
/* @__PURE__ */ A("div", { className: "flex justify-end gap-2", children: [
|
|
6172
6187
|
/* @__PURE__ */ u(uu, { copyText: r, children: t.copy_id }),
|
|
6173
6188
|
/* @__PURE__ */ u(ve, { variant: "primary", onClick: o, children: "Close" })
|
|
6174
6189
|
] })
|
|
@@ -6176,7 +6191,7 @@ function du({ sawError: e }) {
|
|
|
6176
6191
|
}
|
|
6177
6192
|
function fu() {
|
|
6178
6193
|
const e = q();
|
|
6179
|
-
return e.value.disable_banner ? null : /* @__PURE__ */
|
|
6194
|
+
return e.value.disable_banner ? null : /* @__PURE__ */ A(
|
|
6180
6195
|
"p",
|
|
6181
6196
|
{
|
|
6182
6197
|
className: V(
|
|
@@ -6216,7 +6231,7 @@ const Je = {
|
|
|
6216
6231
|
}, _t = {
|
|
6217
6232
|
display: "none"
|
|
6218
6233
|
}, hu = vr(function() {
|
|
6219
|
-
const t = q(), n =
|
|
6234
|
+
const t = q(), n = J(t.peek().default_expanded), r = J(!1), { error: o } = oe(), a = Bt(), i = Y(
|
|
6220
6235
|
() => t.value.transcript_enabled || t.value.text_input_enabled
|
|
6221
6236
|
), s = Y(
|
|
6222
6237
|
() => V(
|
|
@@ -6227,27 +6242,27 @@ const Je = {
|
|
|
6227
6242
|
Ee(() => {
|
|
6228
6243
|
o.value && (i.value ? (r.value = !0, n.value = !0) : r.value = !1);
|
|
6229
6244
|
}), Ee(() => {
|
|
6230
|
-
const v = (
|
|
6231
|
-
var
|
|
6232
|
-
((
|
|
6245
|
+
const v = (m) => {
|
|
6246
|
+
var x, f, g;
|
|
6247
|
+
((x = m.detail) == null ? void 0 : x.action) === "expand" ? n.value = !0 : ((f = m.detail) == null ? void 0 : f.action) === "collapse" ? n.value = !1 : ((g = m.detail) == null ? void 0 : g.action) === "toggle" && (n.value = !n.value);
|
|
6233
6248
|
};
|
|
6234
6249
|
return document.addEventListener("elevenlabs-agent:expand", v), () => {
|
|
6235
6250
|
document.removeEventListener("elevenlabs-agent:expand", v);
|
|
6236
6251
|
};
|
|
6237
6252
|
});
|
|
6238
|
-
const l = Y(() => !i.value && o.value && !r.value ? "error" : !a.termsAccepted.value && a.termsShown.value ? "terms" : "conversation"), c = Y(() => l.value === "error"),
|
|
6239
|
-
return /* @__PURE__ */
|
|
6240
|
-
/* @__PURE__ */ u(
|
|
6253
|
+
const l = Y(() => !i.value && o.value && !r.value ? "error" : !a.termsAccepted.value && a.termsShown.value ? "terms" : "conversation"), c = Y(() => l.value === "error"), d = Y(() => l.value === "terms"), p = Y(() => l.value === "conversation");
|
|
6254
|
+
return /* @__PURE__ */ A(rt, { children: [
|
|
6255
|
+
/* @__PURE__ */ u(ie, { initial: !1, active: p, children: /* @__PURE__ */ u(Ct, { className: s, style: _t, children: t.value.always_expanded ? /* @__PURE__ */ u(hr, { open: !0 }) : /* @__PURE__ */ A(rt, { children: [
|
|
6241
6256
|
i.value && /* @__PURE__ */ u(hr, { open: n }),
|
|
6242
6257
|
/* @__PURE__ */ u(lu, { expandable: i.value, expanded: n })
|
|
6243
6258
|
] }) }) }),
|
|
6244
|
-
/* @__PURE__ */ u(
|
|
6245
|
-
/* @__PURE__ */ u(
|
|
6259
|
+
/* @__PURE__ */ u(ie, { initial: !1, active: d, children: /* @__PURE__ */ u(Ct, { className: s, style: _t, children: /* @__PURE__ */ u(cu, {}) }) }),
|
|
6260
|
+
/* @__PURE__ */ u(ie, { initial: !1, active: c, children: /* @__PURE__ */ u(Ct, { className: s, style: _t, children: /* @__PURE__ */ u(du, { sawError: r }) }) }),
|
|
6246
6261
|
/* @__PURE__ */ u(Ct, { className: s, style: _t, children: /* @__PURE__ */ u(fu, {}) })
|
|
6247
6262
|
] });
|
|
6248
6263
|
});
|
|
6249
6264
|
function vu(e) {
|
|
6250
|
-
return /* @__PURE__ */ u(wa, { value: e, children: /* @__PURE__ */ u(xa, { children: /* @__PURE__ */ u(Ra, { children: /* @__PURE__ */ u(Ta, { children: /* @__PURE__ */ u(ya, { children: /* @__PURE__ */ u(Sa, { children: /* @__PURE__ */ u(ka, { children: /* @__PURE__ */ u(Aa, { children: /* @__PURE__ */ u(Fa, { children: /* @__PURE__ */ u(Ba, { children: /* @__PURE__ */ u(wi, { children: /* @__PURE__ */
|
|
6265
|
+
return /* @__PURE__ */ u(wa, { value: e, children: /* @__PURE__ */ u(xa, { children: /* @__PURE__ */ u(Ra, { children: /* @__PURE__ */ u(Ta, { children: /* @__PURE__ */ u(ya, { children: /* @__PURE__ */ u(Sa, { children: /* @__PURE__ */ u(ka, { children: /* @__PURE__ */ u(Aa, { children: /* @__PURE__ */ u(Fa, { children: /* @__PURE__ */ u(Ba, { children: /* @__PURE__ */ u(wi, { children: /* @__PURE__ */ A(mi, { children: [
|
|
6251
6266
|
/* @__PURE__ */ u(La, {}),
|
|
6252
6267
|
/* @__PURE__ */ u(hu, {})
|
|
6253
6268
|
] }) }) }) }) }) }) }) }) }) }) }) });
|