@elevenlabs/convai-widget-core 0.5.0 → 0.5.1
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/index.js +931 -919
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
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 gn } 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;
|
|
@@ -155,14 +155,14 @@ 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 =
|
|
165
|
+
const t = B("server-location"), n = Ae(() => {
|
|
166
166
|
const r = Ce(() => ga(t.value)), o = {
|
|
167
167
|
us: "https://api.us.elevenlabs.io",
|
|
168
168
|
"eu-residency": "https://api.eu.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.1", 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,7 +300,7 @@ 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);
|
|
@@ -309,8 +309,8 @@ function ka({
|
|
|
309
309
|
`[ConversationalAI] Cannot parse dynamic-variables: ${m == null ? void 0 : m.message}`
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
-
}), { webSocketUrl:
|
|
313
|
-
const m =
|
|
312
|
+
}), { webSocketUrl: d } = wn(), p = B("agent-id"), v = B("signed-url"), g = bn(), x = Ia(), f = Y(() => {
|
|
313
|
+
const m = x.value, w = {
|
|
314
314
|
dynamicVariables: c.value,
|
|
315
315
|
overrides: s.value,
|
|
316
316
|
connectionDelay: { default: 300 },
|
|
@@ -319,12 +319,12 @@ function ka({
|
|
|
319
319
|
};
|
|
320
320
|
return p.value ? m ? {
|
|
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"), g = Ce(() => v.value === "speaking"), x = he(null), f = he(null), m = 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: g,
|
|
415
|
+
mode: v,
|
|
416
|
+
isDisconnected: p,
|
|
417
|
+
lastId: f,
|
|
418
|
+
error: x,
|
|
419
|
+
canSendFeedback: m,
|
|
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
|
+
m.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,42 +614,42 @@ 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"), g = B("always-expanded"), x = B("override-text-only"), f = B("use-rtc"), m = 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(g.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,
|
|
@@ -662,17 +662,17 @@ 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;
|
|
@@ -709,7 +709,7 @@ ${ma.map(
|
|
|
709
709
|
`)}
|
|
710
710
|
}`;
|
|
711
711
|
});
|
|
712
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ A("style", { children: [
|
|
713
713
|
n,
|
|
714
714
|
da
|
|
715
715
|
] });
|
|
@@ -722,7 +722,7 @@ function Da(e) {
|
|
|
722
722
|
}
|
|
723
723
|
const _r = de(null);
|
|
724
724
|
function Fa({ children: e }) {
|
|
725
|
-
const t = q(), { language: n } = at(), r =
|
|
725
|
+
const t = q(), { language: n } = at(), r = B("text-contents"), o = Y(() => {
|
|
726
726
|
try {
|
|
727
727
|
if (r.value) {
|
|
728
728
|
const i = JSON.parse(r.value);
|
|
@@ -738,8 +738,8 @@ function Fa({ children: e }) {
|
|
|
738
738
|
i,
|
|
739
739
|
Ce(
|
|
740
740
|
() => {
|
|
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]) ?? ((
|
|
741
|
+
var s, l, c, d;
|
|
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]) ?? ((d = t.value.text_contents) == null ? void 0 : d[i]) ?? mr[i];
|
|
743
743
|
}
|
|
744
744
|
)
|
|
745
745
|
])
|
|
@@ -751,7 +751,7 @@ function G() {
|
|
|
751
751
|
}
|
|
752
752
|
const Pr = de(null);
|
|
753
753
|
function Ba({ children: e }) {
|
|
754
|
-
const t = q(), n =
|
|
754
|
+
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
755
|
type: "image",
|
|
756
756
|
url: n.value
|
|
757
757
|
} : r.value && o.value ? {
|
|
@@ -785,7 +785,7 @@ function yn(e) {
|
|
|
785
785
|
return e && typeof e == "object" && "peek" in e;
|
|
786
786
|
}
|
|
787
787
|
function Va(e) {
|
|
788
|
-
const t = yn(e), n =
|
|
788
|
+
const t = yn(e), n = J(t ? e.peek() : e);
|
|
789
789
|
return t ? e : (n.value = e, n);
|
|
790
790
|
}
|
|
791
791
|
function Ir(e) {
|
|
@@ -815,7 +815,7 @@ function Nr(...e) {
|
|
|
815
815
|
};
|
|
816
816
|
};
|
|
817
817
|
}
|
|
818
|
-
function
|
|
818
|
+
function ne(...e) {
|
|
819
819
|
return h.useCallback(Nr(...e), e);
|
|
820
820
|
}
|
|
821
821
|
// @__NO_SIDE_EFFECTS__
|
|
@@ -823,10 +823,10 @@ function gt(e) {
|
|
|
823
823
|
const t = /* @__PURE__ */ Wa(e), n = h.forwardRef((r, o) => {
|
|
824
824
|
const { children: a, ...i } = r, s = h.Children.toArray(a), l = s.find(Ua);
|
|
825
825
|
if (l) {
|
|
826
|
-
const c = l.props.children,
|
|
827
|
-
return /* @__PURE__ */
|
|
826
|
+
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);
|
|
827
|
+
return /* @__PURE__ */ T(t, { ...i, ref: o, children: h.isValidElement(c) ? h.cloneElement(c, void 0, d) : null });
|
|
828
828
|
}
|
|
829
|
-
return /* @__PURE__ */
|
|
829
|
+
return /* @__PURE__ */ T(t, { ...i, ref: o, children: a });
|
|
830
830
|
});
|
|
831
831
|
return n.displayName = `${e}.Slot`, n;
|
|
832
832
|
}
|
|
@@ -865,7 +865,7 @@ function Ya(e) {
|
|
|
865
865
|
}
|
|
866
866
|
const Xt = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
867
867
|
function Lr() {
|
|
868
|
-
const e =
|
|
868
|
+
const e = J(Xt.matches);
|
|
869
869
|
return Ue(() => {
|
|
870
870
|
const t = (n) => {
|
|
871
871
|
e.value = n.matches;
|
|
@@ -874,21 +874,21 @@ function Lr() {
|
|
|
874
874
|
}, []), e;
|
|
875
875
|
}
|
|
876
876
|
function Mr({ onStart: e, onEnd: t }) {
|
|
877
|
-
const n =
|
|
877
|
+
const n = ee();
|
|
878
878
|
n.current ?? (n.current = /* @__PURE__ */ new Set());
|
|
879
|
-
const r =
|
|
879
|
+
const r = ee(e);
|
|
880
880
|
r.current = e;
|
|
881
|
-
const o =
|
|
881
|
+
const o = ee(t);
|
|
882
882
|
o.current = t;
|
|
883
|
-
const a =
|
|
883
|
+
const a = J(!1), i = te(
|
|
884
884
|
(l) => {
|
|
885
|
-
var c,
|
|
886
|
-
l.target === l.currentTarget && ((c = n.current) == null || c.add(l.propertyName), a.peek() || (a.value = !0, (
|
|
885
|
+
var c, d;
|
|
886
|
+
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
887
|
},
|
|
888
888
|
[]
|
|
889
|
-
), s =
|
|
890
|
-
var c,
|
|
891
|
-
l.target === l.currentTarget && ((c = n.current) == null || c.delete(l.propertyName), (
|
|
889
|
+
), s = te((l) => {
|
|
890
|
+
var c, d, p;
|
|
891
|
+
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
892
|
}, []);
|
|
893
893
|
return {
|
|
894
894
|
transitioning: a,
|
|
@@ -898,7 +898,7 @@ function Mr({ onStart: e, onEnd: t }) {
|
|
|
898
898
|
}
|
|
899
899
|
};
|
|
900
900
|
}
|
|
901
|
-
function
|
|
901
|
+
function ie(e) {
|
|
902
902
|
const t = Lr().value ? Ka : Xa;
|
|
903
903
|
return /* @__PURE__ */ u(t, { ...e });
|
|
904
904
|
}
|
|
@@ -910,7 +910,7 @@ function Xa({
|
|
|
910
910
|
initial: t = e,
|
|
911
911
|
...n
|
|
912
912
|
}) {
|
|
913
|
-
const r = Va(e), o =
|
|
913
|
+
const r = Va(e), o = J($a(t));
|
|
914
914
|
Ee(() => {
|
|
915
915
|
r.value && (o.value = r.value);
|
|
916
916
|
});
|
|
@@ -1107,17 +1107,17 @@ void main() {
|
|
|
1107
1107
|
-1
|
|
1108
1108
|
]), Qa = "https://storage.googleapis.com/eleven-public-cdn/images/perlin-noise.png", be = class be {
|
|
1109
1109
|
constructor(t) {
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1110
|
+
ae(this, "gl");
|
|
1111
|
+
ae(this, "program");
|
|
1112
|
+
ae(this, "startTime");
|
|
1113
|
+
ae(this, "targetSpeed", 0);
|
|
1114
|
+
ae(this, "speed", 0.5);
|
|
1115
|
+
ae(this, "rafId", null);
|
|
1116
|
+
ae(this, "resizeObserver");
|
|
1117
|
+
ae(this, "colorA", [0, 0, 0]);
|
|
1118
|
+
ae(this, "colorB", [0, 0, 0]);
|
|
1119
|
+
ae(this, "offsets", new Float32Array(7).map(() => Math.random() * Math.PI * 2));
|
|
1120
|
+
ae(this, "copyNoiseImage", () => {
|
|
1121
1121
|
this.gl && (this.gl.texImage2D(
|
|
1122
1122
|
this.gl.TEXTURE_2D,
|
|
1123
1123
|
0,
|
|
@@ -1127,8 +1127,8 @@ void main() {
|
|
|
1127
1127
|
be.noiseImage
|
|
1128
1128
|
), this.gl.generateMipmap(this.gl.TEXTURE_2D));
|
|
1129
1129
|
});
|
|
1130
|
-
|
|
1131
|
-
|
|
1130
|
+
ae(this, "toDataURL", () => this.gl.canvas.toDataURL("image/png"));
|
|
1131
|
+
ae(this, "render", () => {
|
|
1132
1132
|
if (!this.gl) {
|
|
1133
1133
|
this.rafId = null;
|
|
1134
1134
|
return;
|
|
@@ -1221,32 +1221,32 @@ void main() {
|
|
|
1221
1221
|
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
1222
|
}
|
|
1223
1223
|
};
|
|
1224
|
-
|
|
1224
|
+
ae(be, "noiseImage");
|
|
1225
1225
|
let an = be;
|
|
1226
1226
|
const Ja = {
|
|
1227
1227
|
sm: "w-9 h-9",
|
|
1228
1228
|
lg: "w-48 h-48"
|
|
1229
1229
|
};
|
|
1230
1230
|
function it({ size: e = "sm", className: t }) {
|
|
1231
|
-
const { getInputVolume: n, getOutputVolume: r, isSpeaking: o, isDisconnected: a } =
|
|
1231
|
+
const { getInputVolume: n, getOutputVolume: r, isSpeaking: o, isDisconnected: a } = oe(), { config: i } = xn(), s = ee(null), l = ee(null);
|
|
1232
1232
|
Ee(() => {
|
|
1233
1233
|
if (a.value) {
|
|
1234
1234
|
s.current.style.transform = "", l.current.style.transform = "";
|
|
1235
1235
|
return;
|
|
1236
1236
|
}
|
|
1237
|
-
let
|
|
1237
|
+
let d;
|
|
1238
1238
|
function p() {
|
|
1239
|
-
const v = n(), g = r(),
|
|
1240
|
-
s.current.style.transform = `scale(${
|
|
1239
|
+
const v = n(), g = r(), x = o.peek() ? 1 : 1 - v * 0.4, f = o.peek() ? 1 + g * 0.4 : 1;
|
|
1240
|
+
s.current.style.transform = `scale(${f})`, l.current.style.transform = `scale(${x})`, d = requestAnimationFrame(p);
|
|
1241
1241
|
}
|
|
1242
1242
|
return p(), () => {
|
|
1243
|
-
cancelAnimationFrame(
|
|
1243
|
+
cancelAnimationFrame(d);
|
|
1244
1244
|
};
|
|
1245
1245
|
});
|
|
1246
1246
|
const c = Y(() => ({
|
|
1247
1247
|
backgroundImage: i.value.type === "image" ? `url(${i.value.url})` : i.value.type === "url" ? `url(${i.value.custom_url})` : void 0
|
|
1248
1248
|
}));
|
|
1249
|
-
return /* @__PURE__ */
|
|
1249
|
+
return /* @__PURE__ */ A("div", { className: V("relative shrink-0", Ja[e], t), children: [
|
|
1250
1250
|
/* @__PURE__ */ u(
|
|
1251
1251
|
"div",
|
|
1252
1252
|
{
|
|
@@ -1276,7 +1276,7 @@ function ei({ color1: e, color2: t }) {
|
|
|
1276
1276
|
Ue(() => {
|
|
1277
1277
|
r && (r.updateColors(e, t), r.render(), n.value = r.toDataURL());
|
|
1278
1278
|
}, [r, e, t]);
|
|
1279
|
-
const a =
|
|
1279
|
+
const a = te(
|
|
1280
1280
|
(i) => {
|
|
1281
1281
|
if (i) {
|
|
1282
1282
|
const s = new an(i);
|
|
@@ -1331,7 +1331,7 @@ function ri(e) {
|
|
|
1331
1331
|
);
|
|
1332
1332
|
}
|
|
1333
1333
|
function oi(e) {
|
|
1334
|
-
return /* @__PURE__ */
|
|
1334
|
+
return /* @__PURE__ */ A(
|
|
1335
1335
|
"svg",
|
|
1336
1336
|
{
|
|
1337
1337
|
height: "1em",
|
|
@@ -1369,7 +1369,7 @@ function ai(e) {
|
|
|
1369
1369
|
);
|
|
1370
1370
|
}
|
|
1371
1371
|
function ii(e) {
|
|
1372
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ A(
|
|
1373
1373
|
"svg",
|
|
1374
1374
|
{
|
|
1375
1375
|
height: "1em",
|
|
@@ -1386,7 +1386,7 @@ function ii(e) {
|
|
|
1386
1386
|
);
|
|
1387
1387
|
}
|
|
1388
1388
|
function si(e) {
|
|
1389
|
-
return /* @__PURE__ */
|
|
1389
|
+
return /* @__PURE__ */ A(
|
|
1390
1390
|
"svg",
|
|
1391
1391
|
{
|
|
1392
1392
|
height: "1em",
|
|
@@ -1466,13 +1466,7 @@ function di(e) {
|
|
|
1466
1466
|
viewBox: "0 0 20 20",
|
|
1467
1467
|
fill: "currentColor",
|
|
1468
1468
|
...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
|
-
)
|
|
1469
|
+
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
1470
|
}
|
|
1477
1471
|
);
|
|
1478
1472
|
}
|
|
@@ -1496,125 +1490,143 @@ function pi({
|
|
|
1496
1490
|
starColor: n,
|
|
1497
1491
|
className: r
|
|
1498
1492
|
}) {
|
|
1499
|
-
return /* @__PURE__ */ u(
|
|
1500
|
-
"
|
|
1493
|
+
return /* @__PURE__ */ u(
|
|
1494
|
+
"slot",
|
|
1501
1495
|
{
|
|
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
|
-
|
|
1496
|
+
name: "icon-feedback",
|
|
1497
|
+
className: V("flex", r),
|
|
1498
|
+
"aria-hidden": !0,
|
|
1499
|
+
children: /* @__PURE__ */ A(
|
|
1500
|
+
"svg",
|
|
1501
|
+
{
|
|
1502
|
+
width: "100%",
|
|
1503
|
+
height: "100%",
|
|
1504
|
+
viewBox: "0 0 82 88",
|
|
1505
|
+
fill: "none",
|
|
1506
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1507
|
+
children: [
|
|
1508
|
+
/* @__PURE__ */ u(
|
|
1509
|
+
"path",
|
|
1510
|
+
{
|
|
1511
|
+
"fill-rule": "evenodd",
|
|
1512
|
+
"clip-rule": "evenodd",
|
|
1513
|
+
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",
|
|
1514
|
+
fill: e,
|
|
1515
|
+
"fill-opacity": "0.15",
|
|
1516
|
+
stroke: e,
|
|
1517
|
+
"stroke-opacity": "0.35"
|
|
1518
|
+
}
|
|
1519
|
+
),
|
|
1520
|
+
/* @__PURE__ */ u(
|
|
1521
|
+
"path",
|
|
1522
|
+
{
|
|
1523
|
+
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",
|
|
1524
|
+
stroke: e,
|
|
1525
|
+
"stroke-opacity": "0.35"
|
|
1526
|
+
}
|
|
1527
|
+
),
|
|
1528
|
+
/* @__PURE__ */ u(
|
|
1529
|
+
"path",
|
|
1530
|
+
{
|
|
1531
|
+
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",
|
|
1532
|
+
stroke: e,
|
|
1533
|
+
"stroke-opacity": "0.35"
|
|
1534
|
+
}
|
|
1535
|
+
),
|
|
1536
|
+
/* @__PURE__ */ u(
|
|
1537
|
+
"path",
|
|
1538
|
+
{
|
|
1539
|
+
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",
|
|
1540
|
+
stroke: e,
|
|
1541
|
+
"stroke-opacity": "0.35"
|
|
1542
|
+
}
|
|
1543
|
+
),
|
|
1544
|
+
/* @__PURE__ */ u(
|
|
1545
|
+
"path",
|
|
1546
|
+
{
|
|
1547
|
+
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",
|
|
1548
|
+
stroke: e,
|
|
1549
|
+
"stroke-opacity": "0.35"
|
|
1550
|
+
}
|
|
1551
|
+
),
|
|
1552
|
+
/* @__PURE__ */ u(
|
|
1553
|
+
"path",
|
|
1554
|
+
{
|
|
1555
|
+
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",
|
|
1556
|
+
stroke: e,
|
|
1557
|
+
"stroke-opacity": "0.35"
|
|
1558
|
+
}
|
|
1559
|
+
),
|
|
1560
|
+
/* @__PURE__ */ u(
|
|
1561
|
+
"rect",
|
|
1562
|
+
{
|
|
1563
|
+
x: "9.26099",
|
|
1564
|
+
y: "10",
|
|
1565
|
+
width: "63.7129",
|
|
1566
|
+
height: "63.7129",
|
|
1567
|
+
rx: "31.8565",
|
|
1568
|
+
stroke: e,
|
|
1569
|
+
"stroke-opacity": "0.43",
|
|
1570
|
+
"stroke-width": "1.5"
|
|
1571
|
+
}
|
|
1572
|
+
),
|
|
1573
|
+
/* @__PURE__ */ A("g", { "clip-path": "url(#clip0_7006_42127)", children: [
|
|
1574
|
+
/* @__PURE__ */ u(
|
|
1575
|
+
"circle",
|
|
1576
|
+
{
|
|
1577
|
+
cx: "62.4996",
|
|
1578
|
+
cy: "18.2032",
|
|
1579
|
+
r: "15.0195",
|
|
1580
|
+
transform: "rotate(6.27205 62.4996 18.2032)",
|
|
1581
|
+
fill: t
|
|
1582
|
+
}
|
|
1583
|
+
),
|
|
1584
|
+
/* @__PURE__ */ u(
|
|
1585
|
+
"path",
|
|
1586
|
+
{
|
|
1587
|
+
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",
|
|
1588
|
+
fill: n,
|
|
1589
|
+
stroke: t,
|
|
1590
|
+
"stroke-width": "3.27381"
|
|
1591
|
+
}
|
|
1592
|
+
),
|
|
1593
|
+
/* @__PURE__ */ u(
|
|
1594
|
+
"path",
|
|
1595
|
+
{
|
|
1596
|
+
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",
|
|
1597
|
+
fill: n,
|
|
1598
|
+
stroke: t,
|
|
1599
|
+
"stroke-width": "0.3",
|
|
1600
|
+
"stroke-linecap": "round",
|
|
1601
|
+
"stroke-linejoin": "round"
|
|
1602
|
+
}
|
|
1603
|
+
)
|
|
1604
|
+
] }),
|
|
1605
|
+
/* @__PURE__ */ u(
|
|
1606
|
+
"ellipse",
|
|
1607
|
+
{
|
|
1608
|
+
cx: "41",
|
|
1609
|
+
cy: "85",
|
|
1610
|
+
rx: "15",
|
|
1611
|
+
ry: "3",
|
|
1612
|
+
fill: e,
|
|
1613
|
+
"fill-opacity": "0.35"
|
|
1614
|
+
}
|
|
1615
|
+
),
|
|
1616
|
+
/* @__PURE__ */ u("defs", { children: /* @__PURE__ */ u("clipPath", { id: "clip0_7006_42127", children: /* @__PURE__ */ u(
|
|
1617
|
+
"rect",
|
|
1618
|
+
{
|
|
1619
|
+
width: "33",
|
|
1620
|
+
height: "33",
|
|
1621
|
+
fill: "white",
|
|
1622
|
+
transform: "translate(47.9012) rotate(6.27205)"
|
|
1623
|
+
}
|
|
1624
|
+
) }) })
|
|
1625
|
+
]
|
|
1626
|
+
}
|
|
1627
|
+
)
|
|
1616
1628
|
}
|
|
1617
|
-
)
|
|
1629
|
+
);
|
|
1618
1630
|
}
|
|
1619
1631
|
function Ne(e) {
|
|
1620
1632
|
const t = Lr().value ? hi : vi;
|
|
@@ -1637,13 +1649,13 @@ function vi({
|
|
|
1637
1649
|
dep: o,
|
|
1638
1650
|
...a
|
|
1639
1651
|
}) {
|
|
1640
|
-
const [i, s] = Ie(e), [l, c] = Ie(null), [
|
|
1652
|
+
const [i, s] = Ie(e), [l, c] = Ie(null), [d, p] = Ie(null), v = ee(t);
|
|
1641
1653
|
e && (v.current = t);
|
|
1642
|
-
const g =
|
|
1654
|
+
const g = te((m) => {
|
|
1643
1655
|
c(m), m && !e && (m.style.width = "0px", m.style.height = "0px");
|
|
1644
1656
|
}, []);
|
|
1645
1657
|
Ue(() => {
|
|
1646
|
-
|
|
1658
|
+
d && (d.style.transition = "none", d.style.opacity = "0", d.offsetWidth, d.style.transition = "", d.style.opacity = "");
|
|
1647
1659
|
}, [o]), Ae(() => {
|
|
1648
1660
|
l && (l.style.width = `${l.offsetWidth}px`, l.style.height = `${l.offsetHeight}px`);
|
|
1649
1661
|
}, [
|
|
@@ -1653,19 +1665,19 @@ function vi({
|
|
|
1653
1665
|
o
|
|
1654
1666
|
// node's content changed
|
|
1655
1667
|
]), Ue(() => {
|
|
1656
|
-
if (!l || !
|
|
1668
|
+
if (!l || !d) return;
|
|
1657
1669
|
e && s(!0);
|
|
1658
|
-
const m = e ?
|
|
1670
|
+
const m = e ? d.offsetWidth : 0, w = e ? d.offsetHeight : 0;
|
|
1659
1671
|
l.style.width = !e || l.offsetWidth !== m ? `${m}px` : "", l.style.height = !e || l.offsetHeight !== w ? `${w}px` : "";
|
|
1660
1672
|
}, [
|
|
1661
1673
|
l,
|
|
1662
|
-
|
|
1674
|
+
d,
|
|
1663
1675
|
e,
|
|
1664
1676
|
// node's visibility changed
|
|
1665
1677
|
o
|
|
1666
1678
|
// node's content changed
|
|
1667
1679
|
]);
|
|
1668
|
-
const { transitioning:
|
|
1680
|
+
const { transitioning: x, handlers: f } = Mr({
|
|
1669
1681
|
onEnd: () => {
|
|
1670
1682
|
e ? (l.style.width = "", l.style.height = "") : s(!1);
|
|
1671
1683
|
}
|
|
@@ -1678,9 +1690,9 @@ function vi({
|
|
|
1678
1690
|
"relative inline-flex shrink-0 justify-center items-center transition-[opacity,width,height,transform,flex-grow] duration-200 min-w-0",
|
|
1679
1691
|
!e && "opacity-0 scale-75",
|
|
1680
1692
|
e && r && "grow",
|
|
1681
|
-
e && i && !
|
|
1693
|
+
e && i && !x.value && "z-1"
|
|
1682
1694
|
),
|
|
1683
|
-
...
|
|
1695
|
+
...f,
|
|
1684
1696
|
children: /* @__PURE__ */ u(
|
|
1685
1697
|
"div",
|
|
1686
1698
|
{
|
|
@@ -1712,7 +1724,7 @@ const mi = {
|
|
|
1712
1724
|
...s
|
|
1713
1725
|
}, l) {
|
|
1714
1726
|
const c = !!r && !n;
|
|
1715
|
-
return /* @__PURE__ */
|
|
1727
|
+
return /* @__PURE__ */ A(
|
|
1716
1728
|
"button",
|
|
1717
1729
|
{
|
|
1718
1730
|
ref: l,
|
|
@@ -1746,7 +1758,7 @@ function Cn({
|
|
|
1746
1758
|
className: e,
|
|
1747
1759
|
...t
|
|
1748
1760
|
}) {
|
|
1749
|
-
const { status: n, isSpeaking: r } =
|
|
1761
|
+
const { status: n, isSpeaking: r } = oe(), o = zt(), a = G(), i = Y(
|
|
1750
1762
|
() => n.value !== "connected" ? a.connecting_status.value : o.value ? a.chatting_status.value : r.value ? a.speaking_status.value : a.listening_status.value
|
|
1751
1763
|
), [s, l] = Ie(i.peek());
|
|
1752
1764
|
return Ee(() => {
|
|
@@ -1754,10 +1766,10 @@ function Cn({
|
|
|
1754
1766
|
if (n.value === "connected" && r.value)
|
|
1755
1767
|
l(c);
|
|
1756
1768
|
else {
|
|
1757
|
-
const
|
|
1769
|
+
const d = setTimeout(() => {
|
|
1758
1770
|
l(c);
|
|
1759
1771
|
}, 500);
|
|
1760
|
-
return () => clearTimeout(
|
|
1772
|
+
return () => clearTimeout(d);
|
|
1761
1773
|
}
|
|
1762
1774
|
}), /* @__PURE__ */ u(
|
|
1763
1775
|
"div",
|
|
@@ -1767,7 +1779,7 @@ function Cn({
|
|
|
1767
1779
|
e
|
|
1768
1780
|
),
|
|
1769
1781
|
...t,
|
|
1770
|
-
children: /* @__PURE__ */ u(
|
|
1782
|
+
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
1783
|
}
|
|
1772
1784
|
);
|
|
1773
1785
|
}
|
|
@@ -1775,7 +1787,7 @@ const Dr = de(null);
|
|
|
1775
1787
|
function gi({
|
|
1776
1788
|
children: e
|
|
1777
1789
|
}) {
|
|
1778
|
-
const t =
|
|
1790
|
+
const t = J(null), n = J(""), r = J("initial"), { lastId: o } = oe(), a = B("agent-id"), { serverUrl: i } = wn(), s = te(async (p) => {
|
|
1779
1791
|
const v = o.value, g = a.value;
|
|
1780
1792
|
if (!v || !g) {
|
|
1781
1793
|
console.warn(
|
|
@@ -1791,10 +1803,10 @@ function gi({
|
|
|
1791
1803
|
},
|
|
1792
1804
|
i.value
|
|
1793
1805
|
);
|
|
1794
|
-
} catch (
|
|
1795
|
-
console.error("[ConversationalAI] Failed to submit rating:",
|
|
1806
|
+
} catch (x) {
|
|
1807
|
+
console.error("[ConversationalAI] Failed to submit rating:", x);
|
|
1796
1808
|
}
|
|
1797
|
-
}, []), l =
|
|
1809
|
+
}, []), l = te(async () => {
|
|
1798
1810
|
const p = o.value, v = a.value;
|
|
1799
1811
|
if (!p || !v) {
|
|
1800
1812
|
console.warn(
|
|
@@ -1819,13 +1831,13 @@ function gi({
|
|
|
1819
1831
|
} catch (g) {
|
|
1820
1832
|
console.error("[ConversationalAI] Failed to submit feedback:", g);
|
|
1821
1833
|
}
|
|
1822
|
-
}, []), c =
|
|
1834
|
+
}, []), c = te(() => {
|
|
1823
1835
|
t.value = null, n.value = "", r.value = "initial";
|
|
1824
1836
|
}, []);
|
|
1825
1837
|
Ee(() => {
|
|
1826
1838
|
o.value !== null && c();
|
|
1827
1839
|
});
|
|
1828
|
-
const
|
|
1840
|
+
const d = Ae(
|
|
1829
1841
|
() => ({
|
|
1830
1842
|
rating: t,
|
|
1831
1843
|
feedbackText: n,
|
|
@@ -1836,7 +1848,7 @@ function gi({
|
|
|
1836
1848
|
}),
|
|
1837
1849
|
[s, l, c]
|
|
1838
1850
|
);
|
|
1839
|
-
return /* @__PURE__ */ u(Dr.Provider, { value:
|
|
1851
|
+
return /* @__PURE__ */ u(Dr.Provider, { value: d, children: e });
|
|
1840
1852
|
}
|
|
1841
1853
|
function Sn() {
|
|
1842
1854
|
return fe(Dr);
|
|
@@ -1846,7 +1858,7 @@ function wi({
|
|
|
1846
1858
|
defaultContent: e = "transcript",
|
|
1847
1859
|
children: t
|
|
1848
1860
|
}) {
|
|
1849
|
-
const n =
|
|
1861
|
+
const n = J(e), r = ua(() => {
|
|
1850
1862
|
const a = n.value === "feedback" ? {
|
|
1851
1863
|
showHeaderBack: !0,
|
|
1852
1864
|
onHeaderBack: () => {
|
|
@@ -1888,7 +1900,7 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1888
1900
|
p.stopPropagation(), r(e);
|
|
1889
1901
|
},
|
|
1890
1902
|
[r, e]
|
|
1891
|
-
),
|
|
1903
|
+
), d = Be(
|
|
1892
1904
|
(p) => {
|
|
1893
1905
|
a(p, e);
|
|
1894
1906
|
},
|
|
@@ -1905,7 +1917,7 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1905
1917
|
"aria-label": e.toString(),
|
|
1906
1918
|
onMouseEnter: () => o(e),
|
|
1907
1919
|
onClick: c,
|
|
1908
|
-
onKeyDown:
|
|
1920
|
+
onKeyDown: d,
|
|
1909
1921
|
className: V(
|
|
1910
1922
|
"w-8 h-8 grid place-content-center rounded-full focus-ring transition-colors cursor-pointer",
|
|
1911
1923
|
s || l ? "text-base-primary" : "text-base-border"
|
|
@@ -1921,14 +1933,14 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1921
1933
|
ariaLabel: r,
|
|
1922
1934
|
icon: o = "star"
|
|
1923
1935
|
}) => {
|
|
1924
|
-
const a =
|
|
1936
|
+
const a = J(null), i = J(null), s = Br(t, n), l = Be(
|
|
1925
1937
|
(v) => {
|
|
1926
1938
|
i.value = v;
|
|
1927
1939
|
},
|
|
1928
1940
|
[i]
|
|
1929
1941
|
), c = Be(() => {
|
|
1930
1942
|
i.value = null;
|
|
1931
|
-
}, [i]),
|
|
1943
|
+
}, [i]), d = Be(
|
|
1932
1944
|
(v) => {
|
|
1933
1945
|
a.value = v, e(v);
|
|
1934
1946
|
},
|
|
@@ -1939,11 +1951,11 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1939
1951
|
v.preventDefault(), a.value = g, e(g);
|
|
1940
1952
|
else if (v.key === "ArrowLeft" || v.key === "ArrowDown") {
|
|
1941
1953
|
if (v.preventDefault(), g - 1 >= t) {
|
|
1942
|
-
const
|
|
1954
|
+
const f = v.currentTarget, m = f == null ? void 0 : f.previousElementSibling;
|
|
1943
1955
|
m == null || m.focus();
|
|
1944
1956
|
}
|
|
1945
1957
|
} else if ((v.key === "ArrowRight" || v.key === "ArrowUp") && (v.preventDefault(), g + 1 <= n)) {
|
|
1946
|
-
const
|
|
1958
|
+
const f = v.currentTarget, m = f == null ? void 0 : f.nextElementSibling;
|
|
1947
1959
|
m == null || m.focus();
|
|
1948
1960
|
}
|
|
1949
1961
|
},
|
|
@@ -1962,7 +1974,7 @@ const Br = (e, t) => Array.from({ length: t - e + 1 }, (n, r) => r + e), bi = ({
|
|
|
1962
1974
|
value: v,
|
|
1963
1975
|
rating: a,
|
|
1964
1976
|
hoverRating: i,
|
|
1965
|
-
onClick:
|
|
1977
|
+
onClick: d,
|
|
1966
1978
|
onHover: l,
|
|
1967
1979
|
onKeyDown: p,
|
|
1968
1980
|
iconName: o
|
|
@@ -1994,7 +2006,7 @@ function Ci({
|
|
|
1994
2006
|
onRate: t
|
|
1995
2007
|
}) {
|
|
1996
2008
|
const n = G();
|
|
1997
|
-
return /* @__PURE__ */
|
|
2009
|
+
return /* @__PURE__ */ A("div", { className: "flex flex-col items-center", children: [
|
|
1998
2010
|
/* @__PURE__ */ u("div", { className: "text-sm text-base-primary font-medium", children: n.initiate_feedback }),
|
|
1999
2011
|
/* @__PURE__ */ u("div", { className: "py-4", children: /* @__PURE__ */ u(
|
|
2000
2012
|
yi,
|
|
@@ -2013,7 +2025,7 @@ function Si({
|
|
|
2013
2025
|
onFollowUpClick: r
|
|
2014
2026
|
}) {
|
|
2015
2027
|
const o = G();
|
|
2016
|
-
return /* @__PURE__ */
|
|
2028
|
+
return /* @__PURE__ */ A("div", { className: "flex flex-col items-center gap-3 mb-4", children: [
|
|
2017
2029
|
/* @__PURE__ */ u("div", { className: "text-sm text-base-primary font-medium", children: o.thanks_for_feedback }),
|
|
2018
2030
|
/* @__PURE__ */ u(zr, { rating: t, min: 1, max: 5, icon: e }),
|
|
2019
2031
|
n && /* @__PURE__ */ u(ve, { variant: "secondary", onClick: r, children: o.request_follow_up_feedback })
|
|
@@ -2040,7 +2052,7 @@ function ki({ icon: e = "star" }) {
|
|
|
2040
2052
|
}
|
|
2041
2053
|
function Ei({ entry: e }) {
|
|
2042
2054
|
const { previewUrl: t } = xn();
|
|
2043
|
-
return /* @__PURE__ */
|
|
2055
|
+
return /* @__PURE__ */ A(
|
|
2044
2056
|
"div",
|
|
2045
2057
|
{
|
|
2046
2058
|
className: V(
|
|
@@ -2072,13 +2084,13 @@ function Ei({ entry: e }) {
|
|
|
2072
2084
|
);
|
|
2073
2085
|
}
|
|
2074
2086
|
function Ti({ entry: e }) {
|
|
2075
|
-
const t = G(), { lastId: n } =
|
|
2076
|
-
return /* @__PURE__ */
|
|
2087
|
+
const t = G(), { lastId: n } = oe(), r = Na();
|
|
2088
|
+
return /* @__PURE__ */ A("div", { className: "mt-3 px-8 flex flex-col", children: [
|
|
2077
2089
|
r && /* @__PURE__ */ u(ki, {}),
|
|
2078
|
-
/* @__PURE__ */
|
|
2090
|
+
/* @__PURE__ */ A("div", { className: "text-xs text-base-subtle text-center transition-opacity duration-200 data-hidden:opacity-0", children: [
|
|
2079
2091
|
e.role === "user" ? t.user_ended_conversation : t.agent_ended_conversation,
|
|
2080
2092
|
/* @__PURE__ */ u("br", {}),
|
|
2081
|
-
n.value && /* @__PURE__ */
|
|
2093
|
+
n.value && /* @__PURE__ */ A("span", { className: "break-all", children: [
|
|
2082
2094
|
t.conversation_id,
|
|
2083
2095
|
": ",
|
|
2084
2096
|
n.value
|
|
@@ -2087,14 +2099,14 @@ function Ti({ entry: e }) {
|
|
|
2087
2099
|
] });
|
|
2088
2100
|
}
|
|
2089
2101
|
function Ai({ entry: e }) {
|
|
2090
|
-
const t = G(), { lastId: n } =
|
|
2091
|
-
return /* @__PURE__ */
|
|
2102
|
+
const t = G(), { lastId: n } = oe();
|
|
2103
|
+
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
2104
|
t.error_occurred,
|
|
2093
2105
|
/* @__PURE__ */ u("br", {}),
|
|
2094
2106
|
e.message,
|
|
2095
|
-
n.value && /* @__PURE__ */
|
|
2107
|
+
n.value && /* @__PURE__ */ A(rt, { children: [
|
|
2096
2108
|
/* @__PURE__ */ u("br", {}),
|
|
2097
|
-
/* @__PURE__ */
|
|
2109
|
+
/* @__PURE__ */ A("span", { className: "text-base-subtle break-all", children: [
|
|
2098
2110
|
t.conversation_id,
|
|
2099
2111
|
": ",
|
|
2100
2112
|
n.value
|
|
@@ -2106,11 +2118,11 @@ function _i({
|
|
|
2106
2118
|
entry: e,
|
|
2107
2119
|
animateIn: t
|
|
2108
2120
|
}) {
|
|
2109
|
-
return /* @__PURE__ */ u(
|
|
2121
|
+
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
2122
|
}
|
|
2111
2123
|
const Pi = 16;
|
|
2112
2124
|
function Ri({ scrollPinned: e, transcript: t }) {
|
|
2113
|
-
const n =
|
|
2125
|
+
const n = ee(null), r = ee(0), o = ee(null), a = ee(!1), i = ee(!1), s = (p) => {
|
|
2114
2126
|
var v;
|
|
2115
2127
|
(v = n.current) == null || v.scrollTo({
|
|
2116
2128
|
top: n.current.scrollHeight,
|
|
@@ -2119,30 +2131,30 @@ function Ri({ scrollPinned: e, transcript: t }) {
|
|
|
2119
2131
|
}, l = () => {
|
|
2120
2132
|
const p = n.current;
|
|
2121
2133
|
if (!p || !a.current || i.current) return;
|
|
2122
|
-
const v = p.scrollTop, g = p.scrollHeight - p.clientHeight,
|
|
2123
|
-
if (Math.abs(
|
|
2134
|
+
const v = p.scrollTop, g = p.scrollHeight - p.clientHeight, x = g - v;
|
|
2135
|
+
if (Math.abs(x) < 1) {
|
|
2124
2136
|
p.scrollTop = g, o.current = requestAnimationFrame(l);
|
|
2125
2137
|
return;
|
|
2126
2138
|
}
|
|
2127
|
-
const
|
|
2128
|
-
p.scrollTop = v + Math.max(
|
|
2139
|
+
const f = x * 0.2, m = 2;
|
|
2140
|
+
p.scrollTop = v + Math.max(f, m), o.current = requestAnimationFrame(l);
|
|
2129
2141
|
}, c = () => {
|
|
2130
2142
|
!n.current || i.current || a.current || (a.current = !0, o.current = requestAnimationFrame(l));
|
|
2131
|
-
},
|
|
2132
|
-
return Ue(() => (
|
|
2143
|
+
}, d = ee(!0);
|
|
2144
|
+
return Ue(() => (d.current = !1, s(!1), () => {
|
|
2133
2145
|
o.current && cancelAnimationFrame(o.current);
|
|
2134
2146
|
}), []), Ee(() => {
|
|
2135
|
-
var
|
|
2147
|
+
var x;
|
|
2136
2148
|
const p = t.value;
|
|
2137
2149
|
if (!e.peek()) return;
|
|
2138
2150
|
const v = p[p.length - 1];
|
|
2139
2151
|
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 &&
|
|
2152
|
+
const f = ((x = v.message) == null ? void 0 : x.length) || 0;
|
|
2153
|
+
r.current === 0 && f > 0 ? (r.current = f, i.current = !1, requestAnimationFrame(() => {
|
|
2142
2154
|
requestAnimationFrame(() => {
|
|
2143
2155
|
!i.current && e.peek() && (s(!1), c());
|
|
2144
2156
|
});
|
|
2145
|
-
})) :
|
|
2157
|
+
})) : f > r.current && (r.current = f, c());
|
|
2146
2158
|
} else
|
|
2147
2159
|
r.current = 0, a.current = !1, i.current = !1, o.current && (cancelAnimationFrame(o.current), o.current = null), s(!0);
|
|
2148
2160
|
}), /* @__PURE__ */ u(
|
|
@@ -2158,7 +2170,7 @@ function Ri({ scrollPinned: e, transcript: t }) {
|
|
|
2158
2170
|
_i,
|
|
2159
2171
|
{
|
|
2160
2172
|
entry: p,
|
|
2161
|
-
animateIn: !
|
|
2173
|
+
animateIn: !d.current
|
|
2162
2174
|
},
|
|
2163
2175
|
`${v}-${p.conversationIndex}`
|
|
2164
2176
|
))
|
|
@@ -2184,7 +2196,7 @@ function En({
|
|
|
2184
2196
|
visible: e,
|
|
2185
2197
|
...t
|
|
2186
2198
|
}) {
|
|
2187
|
-
const n = G(), { isMuted: r, isMutingEnabled: o, setIsMuted: a } = Cr(), i =
|
|
2199
|
+
const n = G(), { isMuted: r, isMutingEnabled: o, setIsMuted: a } = Cr(), i = te(() => {
|
|
2188
2200
|
a(!r.peek());
|
|
2189
2201
|
}, [a]);
|
|
2190
2202
|
return o.value ? /* @__PURE__ */ u(Ne, { visible: e, className: "p-1", children: /* @__PURE__ */ u(
|
|
@@ -2204,7 +2216,7 @@ function Tn({
|
|
|
2204
2216
|
children: n,
|
|
2205
2217
|
...r
|
|
2206
2218
|
}) {
|
|
2207
|
-
const { endSession: o, startSession: a } =
|
|
2219
|
+
const { endSession: o, startSession: a } = oe(), i = G();
|
|
2208
2220
|
return /* @__PURE__ */ u(
|
|
2209
2221
|
ve,
|
|
2210
2222
|
{
|
|
@@ -2221,47 +2233,47 @@ function Ii({
|
|
|
2221
2233
|
showTranscript: e,
|
|
2222
2234
|
scrollPinned: t
|
|
2223
2235
|
}) {
|
|
2224
|
-
const n =
|
|
2236
|
+
const n = J(""), r = zt(), { text_input_enabled: o } = q().value, a = G(), {
|
|
2225
2237
|
isDisconnected: i,
|
|
2226
2238
|
status: s,
|
|
2227
2239
|
startSession: l,
|
|
2228
2240
|
sendUserMessage: c,
|
|
2229
|
-
sendUserActivity:
|
|
2241
|
+
sendUserActivity: d,
|
|
2230
2242
|
conversationIndex: p
|
|
2231
|
-
} =
|
|
2243
|
+
} = oe(), v = te(
|
|
2232
2244
|
async (m) => {
|
|
2233
2245
|
m.preventDefault();
|
|
2234
2246
|
const w = n.value.trim();
|
|
2235
2247
|
w && (t.value = !0, n.value = "", i.value ? await l(m.currentTarget, w) : c(w));
|
|
2236
2248
|
},
|
|
2237
2249
|
[n, t, i, l, c]
|
|
2238
|
-
), g =
|
|
2250
|
+
), g = te(
|
|
2239
2251
|
async (m) => {
|
|
2240
2252
|
m.key === "Enter" && !m.shiftKey && await v(m);
|
|
2241
2253
|
},
|
|
2242
2254
|
[v]
|
|
2243
|
-
),
|
|
2255
|
+
), x = te(
|
|
2244
2256
|
(m) => {
|
|
2245
2257
|
n.value = m.currentTarget.value;
|
|
2246
2258
|
},
|
|
2247
2259
|
[n]
|
|
2248
|
-
),
|
|
2249
|
-
return /* @__PURE__ */
|
|
2250
|
-
o && /* @__PURE__ */
|
|
2260
|
+
), f = Y(() => !!n.value.trim());
|
|
2261
|
+
return /* @__PURE__ */ A("div", { className: "shrink-0 overflow-hidden flex p-3 items-end justify-end", children: [
|
|
2262
|
+
o && /* @__PURE__ */ A("div", { className: "relative grow min-w-0 flex z-1 m-1", children: [
|
|
2251
2263
|
/* @__PURE__ */ u(
|
|
2252
2264
|
Vr,
|
|
2253
2265
|
{
|
|
2254
2266
|
rows: 1,
|
|
2255
2267
|
"aria-label": a.input_label,
|
|
2256
2268
|
value: n,
|
|
2257
|
-
onInput:
|
|
2258
|
-
onChange:
|
|
2269
|
+
onInput: d,
|
|
2270
|
+
onChange: x,
|
|
2259
2271
|
onKeyDown: g,
|
|
2260
2272
|
className: "min-w-0 w-full max-h-[8lh] pr-9",
|
|
2261
2273
|
placeholder: r.value ? i.value && p.value > 0 ? a.input_placeholder_new_conversation : a.input_placeholder_text_only : a.input_placeholder
|
|
2262
2274
|
}
|
|
2263
2275
|
),
|
|
2264
|
-
/* @__PURE__ */ u(
|
|
2276
|
+
/* @__PURE__ */ u(ie, { active: f, children: /* @__PURE__ */ u(
|
|
2265
2277
|
"button",
|
|
2266
2278
|
{
|
|
2267
2279
|
"aria-label": a.send_message,
|
|
@@ -2271,7 +2283,7 @@ function Ii({
|
|
|
2271
2283
|
}
|
|
2272
2284
|
) })
|
|
2273
2285
|
] }),
|
|
2274
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ A("div", { className: "flex h-11 items-center", children: [
|
|
2275
2287
|
/* @__PURE__ */ u(En, { visible: !r.value && !i.value }),
|
|
2276
2288
|
/* @__PURE__ */ u(
|
|
2277
2289
|
Ne,
|
|
@@ -2293,14 +2305,14 @@ function Ii({
|
|
|
2293
2305
|
] });
|
|
2294
2306
|
}
|
|
2295
2307
|
function Ni() {
|
|
2296
|
-
const e = G(), { rating: t, feedbackText: n } = Sn(), r =
|
|
2308
|
+
const e = G(), { rating: t, feedbackText: n } = Sn(), r = te(
|
|
2297
2309
|
(o) => {
|
|
2298
2310
|
n.value = o.currentTarget.value;
|
|
2299
2311
|
},
|
|
2300
2312
|
[]
|
|
2301
2313
|
);
|
|
2302
|
-
return /* @__PURE__ */ u("div", { className: "grow flex flex-col overflow-y-auto overflow-x-hidden px-4", children: /* @__PURE__ */
|
|
2303
|
-
/* @__PURE__ */
|
|
2314
|
+
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: [
|
|
2315
|
+
/* @__PURE__ */ A("div", { className: "flex flex-col items-center justify-center gap-3", children: [
|
|
2304
2316
|
/* @__PURE__ */ u(
|
|
2305
2317
|
pi,
|
|
2306
2318
|
{
|
|
@@ -2311,7 +2323,7 @@ function Ni() {
|
|
|
2311
2323
|
}
|
|
2312
2324
|
),
|
|
2313
2325
|
t.value !== null && /* @__PURE__ */ u(zr, { rating: t.value, min: 1, max: 5 }),
|
|
2314
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ A("div", { className: "text-center", children: [
|
|
2315
2327
|
/* @__PURE__ */ u("p", { className: "text-sm text-base-primary font-medium", children: e.thanks_for_feedback }),
|
|
2316
2328
|
/* @__PURE__ */ u("p", { className: "text-sm text-base-subtle", children: e.thanks_for_feedback_details })
|
|
2317
2329
|
] })
|
|
@@ -2329,7 +2341,7 @@ function Ni() {
|
|
|
2329
2341
|
] }) });
|
|
2330
2342
|
}
|
|
2331
2343
|
function Oi() {
|
|
2332
|
-
const e = G(), { currentContent: t } = kn(), { submitFeedback: n } = Sn(), r =
|
|
2344
|
+
const e = G(), { currentContent: t } = kn(), { submitFeedback: n } = Sn(), r = te(() => {
|
|
2333
2345
|
n(), t.value = "transcript";
|
|
2334
2346
|
}, [n]);
|
|
2335
2347
|
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 +2362,18 @@ function An(e, t = []) {
|
|
|
2350
2362
|
n = [...n, i];
|
|
2351
2363
|
const c = (p) => {
|
|
2352
2364
|
var w;
|
|
2353
|
-
const { scope: v, children: g, ...
|
|
2354
|
-
return /* @__PURE__ */
|
|
2365
|
+
const { scope: v, children: g, ...x } = p, f = ((w = v == null ? void 0 : v[e]) == null ? void 0 : w[l]) || s, m = h.useMemo(() => x, Object.values(x));
|
|
2366
|
+
return /* @__PURE__ */ T(f.Provider, { value: m, children: g });
|
|
2355
2367
|
};
|
|
2356
2368
|
c.displayName = a + "Provider";
|
|
2357
|
-
function
|
|
2358
|
-
var
|
|
2359
|
-
const g = ((
|
|
2360
|
-
if (
|
|
2369
|
+
function d(p, v) {
|
|
2370
|
+
var f;
|
|
2371
|
+
const g = ((f = v == null ? void 0 : v[e]) == null ? void 0 : f[l]) || s, x = h.useContext(g);
|
|
2372
|
+
if (x) return x;
|
|
2361
2373
|
if (i !== void 0) return i;
|
|
2362
2374
|
throw new Error(`\`${p}\` must be used within \`${a}\``);
|
|
2363
2375
|
}
|
|
2364
|
-
return [c,
|
|
2376
|
+
return [c, d];
|
|
2365
2377
|
}
|
|
2366
2378
|
const o = () => {
|
|
2367
2379
|
const a = n.map((i) => h.createContext(i));
|
|
@@ -2397,39 +2409,39 @@ function Mi(e) {
|
|
|
2397
2409
|
const t = e + "CollectionProvider", [n, r] = An(t), [o, a] = n(
|
|
2398
2410
|
t,
|
|
2399
2411
|
{ collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
|
|
2400
|
-
), i = (
|
|
2401
|
-
const { scope: m, children: w } =
|
|
2402
|
-
return /* @__PURE__ */
|
|
2412
|
+
), i = (f) => {
|
|
2413
|
+
const { scope: m, children: w } = f, b = De.useRef(null), y = De.useRef(/* @__PURE__ */ new Map()).current;
|
|
2414
|
+
return /* @__PURE__ */ T(o, { scope: m, itemMap: y, collectionRef: b, children: w });
|
|
2403
2415
|
};
|
|
2404
2416
|
i.displayName = t;
|
|
2405
2417
|
const s = e + "CollectionSlot", l = /* @__PURE__ */ gt(s), c = De.forwardRef(
|
|
2406
|
-
(
|
|
2407
|
-
const { scope: w, children:
|
|
2408
|
-
return /* @__PURE__ */
|
|
2418
|
+
(f, m) => {
|
|
2419
|
+
const { scope: w, children: b } = f, y = a(s, w), C = ne(m, y.collectionRef);
|
|
2420
|
+
return /* @__PURE__ */ T(l, { ref: C, children: b });
|
|
2409
2421
|
}
|
|
2410
2422
|
);
|
|
2411
2423
|
c.displayName = s;
|
|
2412
|
-
const
|
|
2413
|
-
(
|
|
2414
|
-
const { scope: w, children:
|
|
2415
|
-
return De.useEffect(() => (
|
|
2424
|
+
const d = e + "CollectionItemSlot", p = "data-radix-collection-item", v = /* @__PURE__ */ gt(d), g = De.forwardRef(
|
|
2425
|
+
(f, m) => {
|
|
2426
|
+
const { scope: w, children: b, ...y } = f, C = De.useRef(null), S = ne(m, C), E = a(d, w);
|
|
2427
|
+
return De.useEffect(() => (E.itemMap.set(C, { ref: C, ...y }), () => void E.itemMap.delete(C))), /* @__PURE__ */ T(v, { [p]: "", ref: S, children: b });
|
|
2416
2428
|
}
|
|
2417
2429
|
);
|
|
2418
|
-
g.displayName =
|
|
2419
|
-
function
|
|
2420
|
-
const m = a(e + "CollectionConsumer",
|
|
2430
|
+
g.displayName = d;
|
|
2431
|
+
function x(f) {
|
|
2432
|
+
const m = a(e + "CollectionConsumer", f);
|
|
2421
2433
|
return De.useCallback(() => {
|
|
2422
|
-
const
|
|
2423
|
-
if (!
|
|
2424
|
-
const
|
|
2434
|
+
const b = m.collectionRef.current;
|
|
2435
|
+
if (!b) return [];
|
|
2436
|
+
const y = Array.from(b.querySelectorAll(`[${p}]`));
|
|
2425
2437
|
return Array.from(m.itemMap.values()).sort(
|
|
2426
|
-
(
|
|
2438
|
+
(E, k) => y.indexOf(E.ref.current) - y.indexOf(k.ref.current)
|
|
2427
2439
|
);
|
|
2428
2440
|
}, [m.collectionRef, m.itemMap]);
|
|
2429
2441
|
}
|
|
2430
2442
|
return [
|
|
2431
2443
|
{ Provider: i, Slot: c, ItemSlot: g },
|
|
2432
|
-
|
|
2444
|
+
x,
|
|
2433
2445
|
r
|
|
2434
2446
|
];
|
|
2435
2447
|
}
|
|
@@ -2459,7 +2471,7 @@ var Bi = [
|
|
|
2459
2471
|
], X = Bi.reduce((e, t) => {
|
|
2460
2472
|
const n = /* @__PURE__ */ gt(`Primitive.${t}`), r = h.forwardRef((o, a) => {
|
|
2461
2473
|
const { asChild: i, ...s } = o, l = i ? n : t;
|
|
2462
|
-
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */
|
|
2474
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ T(l, { ...s, ref: a });
|
|
2463
2475
|
});
|
|
2464
2476
|
return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
|
|
2465
2477
|
}, {});
|
|
@@ -2498,36 +2510,36 @@ var $i = "DismissableLayer", sn = "dismissableLayer.update", Wi = "dismissableLa
|
|
|
2498
2510
|
onInteractOutside: i,
|
|
2499
2511
|
onDismiss: s,
|
|
2500
2512
|
...l
|
|
2501
|
-
} = e, c = h.useContext($r), [
|
|
2513
|
+
} = e, c = h.useContext($r), [d, p] = h.useState(null), v = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, g] = h.useState({}), x = ne(t, (k) => p(k)), f = Array.from(c.layers), [m] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), w = f.indexOf(m), b = d ? f.indexOf(d) : -1, y = c.layersWithOutsidePointerEventsDisabled.size > 0, C = b >= w, S = Yi((k) => {
|
|
2502
2514
|
const I = k.target, D = [...c.branches].some((L) => L.contains(I));
|
|
2503
2515
|
!C || D || (o == null || o(k), i == null || i(k), k.defaultPrevented || s == null || s());
|
|
2504
|
-
}, v),
|
|
2516
|
+
}, v), E = Ki((k) => {
|
|
2505
2517
|
const I = k.target;
|
|
2506
2518
|
[...c.branches].some((L) => L.contains(I)) || (a == null || a(k), i == null || i(k), k.defaultPrevented || s == null || s());
|
|
2507
2519
|
}, v);
|
|
2508
2520
|
return Vi((k) => {
|
|
2509
|
-
|
|
2521
|
+
b === c.layers.size - 1 && (r == null || r(k), !k.defaultPrevented && s && (k.preventDefault(), s()));
|
|
2510
2522
|
}, 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(
|
|
2523
|
+
if (d)
|
|
2524
|
+
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
2525
|
n && c.layersWithOutsidePointerEventsDisabled.size === 1 && (v.body.style.pointerEvents = jn);
|
|
2514
2526
|
};
|
|
2515
|
-
}, [
|
|
2516
|
-
|
|
2517
|
-
}, [
|
|
2527
|
+
}, [d, v, n, c]), h.useEffect(() => () => {
|
|
2528
|
+
d && (c.layers.delete(d), c.layersWithOutsidePointerEventsDisabled.delete(d), Yn());
|
|
2529
|
+
}, [d, c]), h.useEffect(() => {
|
|
2518
2530
|
const k = () => g({});
|
|
2519
2531
|
return document.addEventListener(sn, k), () => document.removeEventListener(sn, k);
|
|
2520
|
-
}, []), /* @__PURE__ */
|
|
2532
|
+
}, []), /* @__PURE__ */ T(
|
|
2521
2533
|
X.div,
|
|
2522
2534
|
{
|
|
2523
2535
|
...l,
|
|
2524
|
-
ref:
|
|
2536
|
+
ref: x,
|
|
2525
2537
|
style: {
|
|
2526
|
-
pointerEvents:
|
|
2538
|
+
pointerEvents: y ? C ? "auto" : "none" : void 0,
|
|
2527
2539
|
...e.style
|
|
2528
2540
|
},
|
|
2529
|
-
onFocusCapture: Z(e.onFocusCapture,
|
|
2530
|
-
onBlurCapture: Z(e.onBlurCapture,
|
|
2541
|
+
onFocusCapture: Z(e.onFocusCapture, E.onFocusCapture),
|
|
2542
|
+
onBlurCapture: Z(e.onBlurCapture, E.onBlurCapture),
|
|
2531
2543
|
onPointerDownCapture: Z(
|
|
2532
2544
|
e.onPointerDownCapture,
|
|
2533
2545
|
S.onPointerDownCapture
|
|
@@ -2538,14 +2550,14 @@ var $i = "DismissableLayer", sn = "dismissableLayer.update", Wi = "dismissableLa
|
|
|
2538
2550
|
);
|
|
2539
2551
|
Wr.displayName = $i;
|
|
2540
2552
|
var Ui = "DismissableLayerBranch", ji = h.forwardRef((e, t) => {
|
|
2541
|
-
const n = h.useContext($r), r = h.useRef(null), o =
|
|
2553
|
+
const n = h.useContext($r), r = h.useRef(null), o = ne(t, r);
|
|
2542
2554
|
return h.useEffect(() => {
|
|
2543
2555
|
const a = r.current;
|
|
2544
2556
|
if (a)
|
|
2545
2557
|
return n.branches.add(a), () => {
|
|
2546
2558
|
n.branches.delete(a);
|
|
2547
2559
|
};
|
|
2548
|
-
}, [n.branches]), /* @__PURE__ */
|
|
2560
|
+
}, [n.branches]), /* @__PURE__ */ T(X.div, { ...e, ref: o });
|
|
2549
2561
|
});
|
|
2550
2562
|
ji.displayName = Ui;
|
|
2551
2563
|
function Yi(e, t = globalThis == null ? void 0 : globalThis.document) {
|
|
@@ -2620,7 +2632,7 @@ var Gt = "focusScope.autoFocusOnMount", qt = "focusScope.autoFocusOnUnmount", Xn
|
|
|
2620
2632
|
onMountAutoFocus: o,
|
|
2621
2633
|
onUnmountAutoFocus: a,
|
|
2622
2634
|
...i
|
|
2623
|
-
} = e, [s, l] = h.useState(null), c = je(o),
|
|
2635
|
+
} = e, [s, l] = h.useState(null), c = je(o), d = je(a), p = h.useRef(null), v = ne(t, (f) => l(f)), g = h.useRef({
|
|
2624
2636
|
paused: !1,
|
|
2625
2637
|
pause() {
|
|
2626
2638
|
this.paused = !0;
|
|
@@ -2631,53 +2643,53 @@ var Gt = "focusScope.autoFocusOnMount", qt = "focusScope.autoFocusOnUnmount", Xn
|
|
|
2631
2643
|
}).current;
|
|
2632
2644
|
h.useEffect(() => {
|
|
2633
2645
|
if (r) {
|
|
2634
|
-
let
|
|
2646
|
+
let f = function(y) {
|
|
2635
2647
|
if (g.paused || !s) return;
|
|
2636
|
-
const C =
|
|
2648
|
+
const C = y.target;
|
|
2637
2649
|
s.contains(C) ? p.current = C : Fe(p.current, { select: !0 });
|
|
2638
|
-
}, m = function(
|
|
2650
|
+
}, m = function(y) {
|
|
2639
2651
|
if (g.paused || !s) return;
|
|
2640
|
-
const C =
|
|
2652
|
+
const C = y.relatedTarget;
|
|
2641
2653
|
C !== null && (s.contains(C) || Fe(p.current, { select: !0 }));
|
|
2642
|
-
}, w = function(
|
|
2654
|
+
}, w = function(y) {
|
|
2643
2655
|
if (document.activeElement === document.body)
|
|
2644
|
-
for (const S of
|
|
2656
|
+
for (const S of y)
|
|
2645
2657
|
S.removedNodes.length > 0 && Fe(s);
|
|
2646
2658
|
};
|
|
2647
|
-
document.addEventListener("focusin",
|
|
2648
|
-
const
|
|
2649
|
-
return s &&
|
|
2650
|
-
document.removeEventListener("focusin",
|
|
2659
|
+
document.addEventListener("focusin", f), document.addEventListener("focusout", m);
|
|
2660
|
+
const b = new MutationObserver(w);
|
|
2661
|
+
return s && b.observe(s, { childList: !0, subtree: !0 }), () => {
|
|
2662
|
+
document.removeEventListener("focusin", f), document.removeEventListener("focusout", m), b.disconnect();
|
|
2651
2663
|
};
|
|
2652
2664
|
}
|
|
2653
2665
|
}, [r, s, g.paused]), h.useEffect(() => {
|
|
2654
2666
|
if (s) {
|
|
2655
2667
|
Gn.add(g);
|
|
2656
|
-
const
|
|
2657
|
-
if (!s.contains(
|
|
2668
|
+
const f = document.activeElement;
|
|
2669
|
+
if (!s.contains(f)) {
|
|
2658
2670
|
const w = new CustomEvent(Gt, Xn);
|
|
2659
|
-
s.addEventListener(Gt, c), s.dispatchEvent(w), w.defaultPrevented || (Gi(ts(jr(s)), { select: !0 }), document.activeElement ===
|
|
2671
|
+
s.addEventListener(Gt, c), s.dispatchEvent(w), w.defaultPrevented || (Gi(ts(jr(s)), { select: !0 }), document.activeElement === f && Fe(s));
|
|
2660
2672
|
}
|
|
2661
2673
|
return () => {
|
|
2662
2674
|
s.removeEventListener(Gt, c), setTimeout(() => {
|
|
2663
2675
|
const w = new CustomEvent(qt, Xn);
|
|
2664
|
-
s.addEventListener(qt,
|
|
2676
|
+
s.addEventListener(qt, d), s.dispatchEvent(w), w.defaultPrevented || Fe(f ?? document.body, { select: !0 }), s.removeEventListener(qt, d), Gn.remove(g);
|
|
2665
2677
|
}, 0);
|
|
2666
2678
|
};
|
|
2667
2679
|
}
|
|
2668
|
-
}, [s, c,
|
|
2669
|
-
const
|
|
2670
|
-
(
|
|
2680
|
+
}, [s, c, d, g]);
|
|
2681
|
+
const x = h.useCallback(
|
|
2682
|
+
(f) => {
|
|
2671
2683
|
if (!n && !r || g.paused) return;
|
|
2672
|
-
const m =
|
|
2684
|
+
const m = f.key === "Tab" && !f.altKey && !f.ctrlKey && !f.metaKey, w = document.activeElement;
|
|
2673
2685
|
if (m && w) {
|
|
2674
|
-
const
|
|
2675
|
-
|
|
2686
|
+
const b = f.currentTarget, [y, C] = qi(b);
|
|
2687
|
+
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
2688
|
}
|
|
2677
2689
|
},
|
|
2678
2690
|
[n, r, g.paused]
|
|
2679
2691
|
);
|
|
2680
|
-
return /* @__PURE__ */
|
|
2692
|
+
return /* @__PURE__ */ T(X.div, { tabIndex: -1, ...i, ref: v, onKeyDown: x });
|
|
2681
2693
|
});
|
|
2682
2694
|
Ur.displayName = Zi;
|
|
2683
2695
|
function Gi(e, { select: t = !1 } = {}) {
|
|
@@ -2862,18 +2874,18 @@ function er(e, t, n) {
|
|
|
2862
2874
|
reference: r,
|
|
2863
2875
|
floating: o
|
|
2864
2876
|
} = e;
|
|
2865
|
-
const a = ye(t), i = In(t), s = Rn(i), l = Le(t), c = a === "y",
|
|
2877
|
+
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;
|
|
2866
2878
|
let g;
|
|
2867
2879
|
switch (l) {
|
|
2868
2880
|
case "top":
|
|
2869
2881
|
g = {
|
|
2870
|
-
x:
|
|
2882
|
+
x: d,
|
|
2871
2883
|
y: r.y - o.height
|
|
2872
2884
|
};
|
|
2873
2885
|
break;
|
|
2874
2886
|
case "bottom":
|
|
2875
2887
|
g = {
|
|
2876
|
-
x:
|
|
2888
|
+
x: d,
|
|
2877
2889
|
y: r.y + r.height
|
|
2878
2890
|
};
|
|
2879
2891
|
break;
|
|
@@ -2917,20 +2929,20 @@ const vs = async (e, t, n) => {
|
|
|
2917
2929
|
floating: t,
|
|
2918
2930
|
strategy: o
|
|
2919
2931
|
}), {
|
|
2920
|
-
x:
|
|
2932
|
+
x: d,
|
|
2921
2933
|
y: p
|
|
2922
|
-
} = er(c, r, l), v = r, g = {},
|
|
2923
|
-
for (let
|
|
2934
|
+
} = er(c, r, l), v = r, g = {}, x = 0;
|
|
2935
|
+
for (let f = 0; f < s.length; f++) {
|
|
2924
2936
|
const {
|
|
2925
2937
|
name: m,
|
|
2926
2938
|
fn: w
|
|
2927
|
-
} = s[
|
|
2928
|
-
x:
|
|
2929
|
-
y
|
|
2939
|
+
} = s[f], {
|
|
2940
|
+
x: b,
|
|
2941
|
+
y,
|
|
2930
2942
|
data: C,
|
|
2931
2943
|
reset: S
|
|
2932
2944
|
} = await w({
|
|
2933
|
-
x:
|
|
2945
|
+
x: d,
|
|
2934
2946
|
y: p,
|
|
2935
2947
|
initialPlacement: r,
|
|
2936
2948
|
placement: v,
|
|
@@ -2943,23 +2955,23 @@ const vs = async (e, t, n) => {
|
|
|
2943
2955
|
floating: t
|
|
2944
2956
|
}
|
|
2945
2957
|
});
|
|
2946
|
-
|
|
2958
|
+
d = b ?? d, p = y ?? p, g = {
|
|
2947
2959
|
...g,
|
|
2948
2960
|
[m]: {
|
|
2949
2961
|
...g[m],
|
|
2950
2962
|
...C
|
|
2951
2963
|
}
|
|
2952
|
-
}, S &&
|
|
2964
|
+
}, S && x <= 50 && (x++, typeof S == "object" && (S.placement && (v = S.placement), S.rects && (c = S.rects === !0 ? await i.getElementRects({
|
|
2953
2965
|
reference: e,
|
|
2954
2966
|
floating: t,
|
|
2955
2967
|
strategy: o
|
|
2956
2968
|
}) : S.rects), {
|
|
2957
|
-
x:
|
|
2969
|
+
x: d,
|
|
2958
2970
|
y: p
|
|
2959
|
-
} = er(c, v, l)),
|
|
2971
|
+
} = er(c, v, l)), f = -1);
|
|
2960
2972
|
}
|
|
2961
2973
|
return {
|
|
2962
|
-
x:
|
|
2974
|
+
x: d,
|
|
2963
2975
|
y: p,
|
|
2964
2976
|
placement: v,
|
|
2965
2977
|
strategy: o,
|
|
@@ -2978,21 +2990,21 @@ async function wt(e, t) {
|
|
|
2978
2990
|
strategy: l
|
|
2979
2991
|
} = e, {
|
|
2980
2992
|
boundary: c = "clippingAncestors",
|
|
2981
|
-
rootBoundary:
|
|
2993
|
+
rootBoundary: d = "viewport",
|
|
2982
2994
|
elementContext: p = "floating",
|
|
2983
2995
|
altBoundary: v = !1,
|
|
2984
2996
|
padding: g = 0
|
|
2985
|
-
} = Oe(t, e),
|
|
2997
|
+
} = Oe(t, e), x = Yr(g), m = s[v ? p === "floating" ? "reference" : "floating" : p], w = Mt(await a.getClippingRect({
|
|
2986
2998
|
element: (n = await (a.isElement == null ? void 0 : a.isElement(m))) == null || n ? m : m.contextElement || await (a.getDocumentElement == null ? void 0 : a.getDocumentElement(s.floating)),
|
|
2987
2999
|
boundary: c,
|
|
2988
|
-
rootBoundary:
|
|
3000
|
+
rootBoundary: d,
|
|
2989
3001
|
strategy: l
|
|
2990
|
-
})),
|
|
3002
|
+
})), b = p === "floating" ? {
|
|
2991
3003
|
x: r,
|
|
2992
3004
|
y: o,
|
|
2993
3005
|
width: i.floating.width,
|
|
2994
3006
|
height: i.floating.height
|
|
2995
|
-
} : i.reference,
|
|
3007
|
+
} : 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
3008
|
x: 1,
|
|
2997
3009
|
y: 1
|
|
2998
3010
|
} : {
|
|
@@ -3000,15 +3012,15 @@ async function wt(e, t) {
|
|
|
3000
3012
|
y: 1
|
|
3001
3013
|
}, S = Mt(a.convertOffsetParentRelativeRectToViewportRelativeRect ? await a.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
3002
3014
|
elements: s,
|
|
3003
|
-
rect:
|
|
3004
|
-
offsetParent:
|
|
3015
|
+
rect: b,
|
|
3016
|
+
offsetParent: y,
|
|
3005
3017
|
strategy: l
|
|
3006
|
-
}) :
|
|
3018
|
+
}) : b);
|
|
3007
3019
|
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 +
|
|
3020
|
+
top: (w.top - S.top + x.top) / C.y,
|
|
3021
|
+
bottom: (S.bottom - w.bottom + x.bottom) / C.y,
|
|
3022
|
+
left: (w.left - S.left + x.left) / C.x,
|
|
3023
|
+
right: (S.right - w.right + x.right) / C.x
|
|
3012
3024
|
};
|
|
3013
3025
|
}
|
|
3014
3026
|
const ms = (e) => ({
|
|
@@ -3025,22 +3037,22 @@ const ms = (e) => ({
|
|
|
3025
3037
|
middlewareData: l
|
|
3026
3038
|
} = t, {
|
|
3027
3039
|
element: c,
|
|
3028
|
-
padding:
|
|
3040
|
+
padding: d = 0
|
|
3029
3041
|
} = Oe(e, t) || {};
|
|
3030
3042
|
if (c == null)
|
|
3031
3043
|
return {};
|
|
3032
|
-
const p = Yr(
|
|
3044
|
+
const p = Yr(d), v = {
|
|
3033
3045
|
x: n,
|
|
3034
3046
|
y: r
|
|
3035
|
-
}, g = In(o),
|
|
3036
|
-
let k =
|
|
3037
|
-
(!k || !await (i.isElement == null ? void 0 : i.isElement(
|
|
3038
|
-
const I = C / 2 - S / 2, D = k / 2 -
|
|
3047
|
+
}, g = In(o), x = Rn(g), f = await i.getDimensions(c), m = g === "y", w = m ? "top" : "left", b = m ? "bottom" : "right", y = m ? "clientHeight" : "clientWidth", C = a.reference[x] + a.reference[g] - v[g] - a.floating[x], S = v[g] - a.reference[g], E = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c));
|
|
3048
|
+
let k = E ? E[y] : 0;
|
|
3049
|
+
(!k || !await (i.isElement == null ? void 0 : i.isElement(E))) && (k = s.floating[y] || a.floating[x]);
|
|
3050
|
+
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
3051
|
return {
|
|
3040
3052
|
[g]: v[g] + M,
|
|
3041
3053
|
data: {
|
|
3042
|
-
[g]:
|
|
3043
|
-
centerOffset:
|
|
3054
|
+
[g]: _,
|
|
3055
|
+
centerOffset: N - _ - M,
|
|
3044
3056
|
...O && {
|
|
3045
3057
|
alignmentOffset: M
|
|
3046
3058
|
}
|
|
@@ -3062,56 +3074,56 @@ const ms = (e) => ({
|
|
|
3062
3074
|
platform: l,
|
|
3063
3075
|
elements: c
|
|
3064
3076
|
} = t, {
|
|
3065
|
-
mainAxis:
|
|
3077
|
+
mainAxis: d = !0,
|
|
3066
3078
|
crossAxis: p = !0,
|
|
3067
3079
|
fallbackPlacements: v,
|
|
3068
3080
|
fallbackStrategy: g = "bestFit",
|
|
3069
|
-
fallbackAxisSideDirection:
|
|
3070
|
-
flipAlignment:
|
|
3081
|
+
fallbackAxisSideDirection: x = "none",
|
|
3082
|
+
flipAlignment: f = !0,
|
|
3071
3083
|
...m
|
|
3072
3084
|
} = Oe(e, t);
|
|
3073
3085
|
if ((n = a.arrow) != null && n.alignmentOffset)
|
|
3074
3086
|
return {};
|
|
3075
|
-
const w = Le(o),
|
|
3076
|
-
!v &&
|
|
3087
|
+
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";
|
|
3088
|
+
!v && E && S.push(...ps(s, f, x, C));
|
|
3077
3089
|
const k = [s, ...S], I = await wt(t, m), D = [];
|
|
3078
3090
|
let L = ((r = a.flip) == null ? void 0 : r.overflows) || [];
|
|
3079
|
-
if (
|
|
3080
|
-
const
|
|
3081
|
-
D.push(I[
|
|
3091
|
+
if (d && D.push(I[w]), p) {
|
|
3092
|
+
const N = ls(o, i, C);
|
|
3093
|
+
D.push(I[N[0]], I[N[1]]);
|
|
3082
3094
|
}
|
|
3083
3095
|
if (L = [...L, {
|
|
3084
3096
|
placement: o,
|
|
3085
3097
|
overflows: D
|
|
3086
|
-
}], !D.every((
|
|
3098
|
+
}], !D.every((N) => N <= 0)) {
|
|
3087
3099
|
var $, W;
|
|
3088
|
-
const
|
|
3089
|
-
if (
|
|
3100
|
+
const N = ((($ = a.flip) == null ? void 0 : $.index) || 0) + 1, _ = k[N];
|
|
3101
|
+
if (_ && (!(p === "alignment" ? b !== ye(_) : !1) || // We leave the current main axis only if every placement on that axis
|
|
3090
3102
|
// overflows the main axis.
|
|
3091
|
-
L.every((P) => ye(P.placement) ===
|
|
3103
|
+
L.every((P) => ye(P.placement) === b ? P.overflows[0] > 0 : !0)))
|
|
3092
3104
|
return {
|
|
3093
3105
|
data: {
|
|
3094
|
-
index:
|
|
3106
|
+
index: N,
|
|
3095
3107
|
overflows: L
|
|
3096
3108
|
},
|
|
3097
3109
|
reset: {
|
|
3098
|
-
placement:
|
|
3110
|
+
placement: _
|
|
3099
3111
|
}
|
|
3100
3112
|
};
|
|
3101
3113
|
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
3114
|
if (!O)
|
|
3103
3115
|
switch (g) {
|
|
3104
3116
|
case "bestFit": {
|
|
3105
|
-
var
|
|
3106
|
-
const M = (
|
|
3107
|
-
if (
|
|
3117
|
+
var F;
|
|
3118
|
+
const M = (F = L.filter((P) => {
|
|
3119
|
+
if (E) {
|
|
3108
3120
|
const z = ye(P.placement);
|
|
3109
|
-
return z ===
|
|
3121
|
+
return z === b || // Create a bias to the `y` side axis due to horizontal
|
|
3110
3122
|
// reading directions favoring greater width.
|
|
3111
3123
|
z === "y";
|
|
3112
3124
|
}
|
|
3113
3125
|
return !0;
|
|
3114
|
-
}).map((P) => [P.placement, P.overflows.filter((z) => z > 0).reduce((z,
|
|
3126
|
+
}).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
3127
|
M && (O = M);
|
|
3116
3128
|
break;
|
|
3117
3129
|
}
|
|
@@ -3188,11 +3200,11 @@ async function bs(e, t) {
|
|
|
3188
3200
|
placement: n,
|
|
3189
3201
|
platform: r,
|
|
3190
3202
|
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,
|
|
3203
|
+
} = 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
3204
|
let {
|
|
3193
3205
|
mainAxis: v,
|
|
3194
3206
|
crossAxis: g,
|
|
3195
|
-
alignmentAxis:
|
|
3207
|
+
alignmentAxis: x
|
|
3196
3208
|
} = typeof p == "number" ? {
|
|
3197
3209
|
mainAxis: p,
|
|
3198
3210
|
crossAxis: 0,
|
|
@@ -3202,12 +3214,12 @@ async function bs(e, t) {
|
|
|
3202
3214
|
crossAxis: p.crossAxis || 0,
|
|
3203
3215
|
alignmentAxis: p.alignmentAxis
|
|
3204
3216
|
};
|
|
3205
|
-
return s && typeof
|
|
3206
|
-
x: g *
|
|
3217
|
+
return s && typeof x == "number" && (g = s === "end" ? x * -1 : x), l ? {
|
|
3218
|
+
x: g * d,
|
|
3207
3219
|
y: v * c
|
|
3208
3220
|
} : {
|
|
3209
3221
|
x: v * c,
|
|
3210
|
-
y: g *
|
|
3222
|
+
y: g * d
|
|
3211
3223
|
};
|
|
3212
3224
|
}
|
|
3213
3225
|
const xs = function(e) {
|
|
@@ -3248,11 +3260,11 @@ const xs = function(e) {
|
|
|
3248
3260
|
fn: (m) => {
|
|
3249
3261
|
let {
|
|
3250
3262
|
x: w,
|
|
3251
|
-
y
|
|
3263
|
+
y: b
|
|
3252
3264
|
} = m;
|
|
3253
3265
|
return {
|
|
3254
3266
|
x: w,
|
|
3255
|
-
y
|
|
3267
|
+
y: b
|
|
3256
3268
|
};
|
|
3257
3269
|
}
|
|
3258
3270
|
},
|
|
@@ -3260,26 +3272,26 @@ const xs = function(e) {
|
|
|
3260
3272
|
} = Oe(e, t), c = {
|
|
3261
3273
|
x: n,
|
|
3262
3274
|
y: r
|
|
3263
|
-
},
|
|
3264
|
-
let g = c[v],
|
|
3275
|
+
}, d = await wt(t, l), p = ye(Le(o)), v = Pn(p);
|
|
3276
|
+
let g = c[v], x = c[p];
|
|
3265
3277
|
if (a) {
|
|
3266
|
-
const m = v === "y" ? "top" : "left", w = v === "y" ? "bottom" : "right",
|
|
3267
|
-
g = ln(
|
|
3278
|
+
const m = v === "y" ? "top" : "left", w = v === "y" ? "bottom" : "right", b = g + d[m], y = g - d[w];
|
|
3279
|
+
g = ln(b, g, y);
|
|
3268
3280
|
}
|
|
3269
3281
|
if (i) {
|
|
3270
|
-
const m = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right",
|
|
3271
|
-
|
|
3282
|
+
const m = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", b = x + d[m], y = x - d[w];
|
|
3283
|
+
x = ln(b, x, y);
|
|
3272
3284
|
}
|
|
3273
|
-
const
|
|
3285
|
+
const f = s.fn({
|
|
3274
3286
|
...t,
|
|
3275
3287
|
[v]: g,
|
|
3276
|
-
[p]:
|
|
3288
|
+
[p]: x
|
|
3277
3289
|
});
|
|
3278
3290
|
return {
|
|
3279
|
-
...
|
|
3291
|
+
...f,
|
|
3280
3292
|
data: {
|
|
3281
|
-
x:
|
|
3282
|
-
y:
|
|
3293
|
+
x: f.x - n,
|
|
3294
|
+
y: f.y - r,
|
|
3283
3295
|
enabled: {
|
|
3284
3296
|
[v]: a,
|
|
3285
3297
|
[p]: i
|
|
@@ -3302,31 +3314,31 @@ const xs = function(e) {
|
|
|
3302
3314
|
offset: s = 0,
|
|
3303
3315
|
mainAxis: l = !0,
|
|
3304
3316
|
crossAxis: c = !0
|
|
3305
|
-
} = Oe(e, t),
|
|
3317
|
+
} = Oe(e, t), d = {
|
|
3306
3318
|
x: n,
|
|
3307
3319
|
y: r
|
|
3308
3320
|
}, p = ye(o), v = Pn(p);
|
|
3309
|
-
let g =
|
|
3310
|
-
const
|
|
3311
|
-
mainAxis:
|
|
3321
|
+
let g = d[v], x = d[p];
|
|
3322
|
+
const f = Oe(s, t), m = typeof f == "number" ? {
|
|
3323
|
+
mainAxis: f,
|
|
3312
3324
|
crossAxis: 0
|
|
3313
3325
|
} : {
|
|
3314
3326
|
mainAxis: 0,
|
|
3315
3327
|
crossAxis: 0,
|
|
3316
|
-
...
|
|
3328
|
+
...f
|
|
3317
3329
|
};
|
|
3318
3330
|
if (l) {
|
|
3319
|
-
const
|
|
3331
|
+
const y = v === "y" ? "height" : "width", C = a.reference[v] - a.floating[y] + m.mainAxis, S = a.reference[v] + a.reference[y] - m.mainAxis;
|
|
3320
3332
|
g < C ? g = C : g > S && (g = S);
|
|
3321
3333
|
}
|
|
3322
3334
|
if (c) {
|
|
3323
|
-
var w,
|
|
3324
|
-
const
|
|
3325
|
-
|
|
3335
|
+
var w, b;
|
|
3336
|
+
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 : m.crossAxis), E = a.reference[p] + a.reference[y] + (C ? 0 : ((b = i.offset) == null ? void 0 : b[p]) || 0) - (C ? m.crossAxis : 0);
|
|
3337
|
+
x < S ? x = S : x > E && (x = E);
|
|
3326
3338
|
}
|
|
3327
3339
|
return {
|
|
3328
3340
|
[v]: g,
|
|
3329
|
-
[p]:
|
|
3341
|
+
[p]: x
|
|
3330
3342
|
};
|
|
3331
3343
|
}
|
|
3332
3344
|
};
|
|
@@ -3345,17 +3357,17 @@ const xs = function(e) {
|
|
|
3345
3357
|
apply: l = () => {
|
|
3346
3358
|
},
|
|
3347
3359
|
...c
|
|
3348
|
-
} = Oe(e, t),
|
|
3349
|
-
width:
|
|
3350
|
-
height:
|
|
3360
|
+
} = Oe(e, t), d = await wt(t, c), p = Le(o), v = st(o), g = ye(o) === "y", {
|
|
3361
|
+
width: x,
|
|
3362
|
+
height: f
|
|
3351
3363
|
} = a.floating;
|
|
3352
3364
|
let m, w;
|
|
3353
3365
|
p === "top" || p === "bottom" ? (m = p, w = v === (await (i.isRTL == null ? void 0 : i.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (w = p, m = v === "end" ? "top" : "bottom");
|
|
3354
|
-
const
|
|
3366
|
+
const b = f - d.top - d.bottom, y = x - d.left - d.right, C = ze(f - d[m], b), S = ze(x - d[w], y), E = !t.middlewareData.shift;
|
|
3355
3367
|
let k = C, I = S;
|
|
3356
|
-
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I =
|
|
3357
|
-
const L = ce(
|
|
3358
|
-
g ? I =
|
|
3368
|
+
if ((n = t.middlewareData.shift) != null && n.enabled.x && (I = y), (r = t.middlewareData.shift) != null && r.enabled.y && (k = b), E && !v) {
|
|
3369
|
+
const L = ce(d.left, 0), $ = ce(d.right, 0), W = ce(d.top, 0), F = ce(d.bottom, 0);
|
|
3370
|
+
g ? 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
3371
|
}
|
|
3360
3372
|
await l({
|
|
3361
3373
|
...t,
|
|
@@ -3363,7 +3375,7 @@ const xs = function(e) {
|
|
|
3363
3375
|
availableHeight: k
|
|
3364
3376
|
});
|
|
3365
3377
|
const D = await i.getDimensions(s.floating);
|
|
3366
|
-
return
|
|
3378
|
+
return x !== D.width || f !== D.height ? {
|
|
3367
3379
|
reset: {
|
|
3368
3380
|
rects: !0
|
|
3369
3381
|
}
|
|
@@ -3530,17 +3542,17 @@ function Ye(e, t, n, r) {
|
|
|
3530
3542
|
let i = ke(1);
|
|
3531
3543
|
t && (r ? me(r) && (i = tt(r)) : i = tt(e));
|
|
3532
3544
|
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,
|
|
3545
|
+
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
3546
|
if (a) {
|
|
3535
3547
|
const v = ue(a), g = r && me(r) ? ue(r) : r;
|
|
3536
|
-
let
|
|
3537
|
-
for (;
|
|
3538
|
-
const m = tt(
|
|
3539
|
-
l *= m.x, c *= m.y,
|
|
3548
|
+
let x = v, f = un(x);
|
|
3549
|
+
for (; f && r && g !== x; ) {
|
|
3550
|
+
const m = tt(f), w = f.getBoundingClientRect(), b = ge(f), y = w.left + (f.clientLeft + parseFloat(b.paddingLeft)) * m.x, C = w.top + (f.clientTop + parseFloat(b.paddingTop)) * m.y;
|
|
3551
|
+
l *= m.x, c *= m.y, d *= m.x, p *= m.y, l += y, c += C, x = ue(f), f = un(x);
|
|
3540
3552
|
}
|
|
3541
3553
|
}
|
|
3542
3554
|
return Mt({
|
|
3543
|
-
width:
|
|
3555
|
+
width: d,
|
|
3544
3556
|
height: p,
|
|
3545
3557
|
x: l,
|
|
3546
3558
|
y: c
|
|
@@ -3575,17 +3587,17 @@ function Ms(e) {
|
|
|
3575
3587
|
scrollLeft: 0,
|
|
3576
3588
|
scrollTop: 0
|
|
3577
3589
|
}, c = ke(1);
|
|
3578
|
-
const
|
|
3590
|
+
const d = ke(0), p = Te(r);
|
|
3579
3591
|
if ((p || !p && !a) && ((lt(r) !== "body" || xt(i)) && (l = Wt(r)), Te(r))) {
|
|
3580
3592
|
const g = Ye(r);
|
|
3581
|
-
c = tt(r),
|
|
3593
|
+
c = tt(r), d.x = g.x + r.clientLeft, d.y = g.y + r.clientTop;
|
|
3582
3594
|
}
|
|
3583
3595
|
const v = i && !p && !a ? Qr(i, l, !0) : ke(0);
|
|
3584
3596
|
return {
|
|
3585
3597
|
width: n.width * c.x,
|
|
3586
3598
|
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 +
|
|
3599
|
+
x: n.x * c.x - l.scrollLeft * c.x + d.x + v.x,
|
|
3600
|
+
y: n.y * c.y - l.scrollTop * c.y + d.y + v.y
|
|
3589
3601
|
};
|
|
3590
3602
|
}
|
|
3591
3603
|
function Ds(e) {
|
|
@@ -3659,7 +3671,7 @@ function $s(e, t) {
|
|
|
3659
3671
|
let i = a ? Ve(e) : e;
|
|
3660
3672
|
for (; me(i) && !ot(i); ) {
|
|
3661
3673
|
const s = ge(i), l = Nn(i);
|
|
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((
|
|
3674
|
+
!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
3675
|
}
|
|
3664
3676
|
return t.set(e, r), r;
|
|
3665
3677
|
}
|
|
@@ -3670,8 +3682,8 @@ function Ws(e) {
|
|
|
3670
3682
|
rootBoundary: r,
|
|
3671
3683
|
strategy: o
|
|
3672
3684
|
} = 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,
|
|
3685
|
+
const i = [...n === "clippingAncestors" ? $t(t) ? [] : $s(t, this._c) : [].concat(n), r], s = i[0], l = i.reduce((c, d) => {
|
|
3686
|
+
const p = or(t, d, o);
|
|
3675
3687
|
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
3688
|
}, or(t, s, o));
|
|
3677
3689
|
return {
|
|
@@ -3707,7 +3719,7 @@ function Us(e, t, n) {
|
|
|
3707
3719
|
l.x = g.x + t.clientLeft, l.y = g.y + t.clientTop;
|
|
3708
3720
|
} else o && c();
|
|
3709
3721
|
a && !r && o && c();
|
|
3710
|
-
const
|
|
3722
|
+
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
3723
|
return {
|
|
3712
3724
|
x: p,
|
|
3713
3725
|
y: v,
|
|
@@ -3784,20 +3796,20 @@ function Xs(e, t) {
|
|
|
3784
3796
|
function i(s, l) {
|
|
3785
3797
|
s === void 0 && (s = !1), l === void 0 && (l = 1), a();
|
|
3786
3798
|
const c = e.getBoundingClientRect(), {
|
|
3787
|
-
left:
|
|
3799
|
+
left: d,
|
|
3788
3800
|
top: p,
|
|
3789
3801
|
width: v,
|
|
3790
3802
|
height: g
|
|
3791
3803
|
} = c;
|
|
3792
3804
|
if (s || t(), !v || !g)
|
|
3793
3805
|
return;
|
|
3794
|
-
const
|
|
3795
|
-
rootMargin: -
|
|
3806
|
+
const x = St(p), f = St(o.clientWidth - (d + v)), m = St(o.clientHeight - (p + g)), w = St(d), y = {
|
|
3807
|
+
rootMargin: -x + "px " + -f + "px " + -m + "px " + -w + "px",
|
|
3796
3808
|
threshold: ce(0, ze(1, l)) || 1
|
|
3797
3809
|
};
|
|
3798
3810
|
let C = !0;
|
|
3799
|
-
function S(
|
|
3800
|
-
const k =
|
|
3811
|
+
function S(E) {
|
|
3812
|
+
const k = E[0].intersectionRatio;
|
|
3801
3813
|
if (k !== l) {
|
|
3802
3814
|
if (!C)
|
|
3803
3815
|
return i();
|
|
@@ -3809,12 +3821,12 @@ function Xs(e, t) {
|
|
|
3809
3821
|
}
|
|
3810
3822
|
try {
|
|
3811
3823
|
n = new IntersectionObserver(S, {
|
|
3812
|
-
...
|
|
3824
|
+
...y,
|
|
3813
3825
|
// Handle <iframe>s
|
|
3814
3826
|
root: o.ownerDocument
|
|
3815
3827
|
});
|
|
3816
3828
|
} catch {
|
|
3817
|
-
n = new IntersectionObserver(S,
|
|
3829
|
+
n = new IntersectionObserver(S, y);
|
|
3818
3830
|
}
|
|
3819
3831
|
n.observe(e);
|
|
3820
3832
|
}
|
|
@@ -3828,8 +3840,8 @@ function Zs(e, t, n, r) {
|
|
|
3828
3840
|
elementResize: i = typeof ResizeObserver == "function",
|
|
3829
3841
|
layoutShift: s = typeof IntersectionObserver == "function",
|
|
3830
3842
|
animationFrame: l = !1
|
|
3831
|
-
} = r, c = Ln(e),
|
|
3832
|
-
|
|
3843
|
+
} = r, c = Ln(e), d = o || a ? [...c ? bt(c) : [], ...bt(t)] : [];
|
|
3844
|
+
d.forEach((w) => {
|
|
3833
3845
|
o && w.addEventListener("scroll", n, {
|
|
3834
3846
|
passive: !0
|
|
3835
3847
|
}), a && w.addEventListener("resize", n);
|
|
@@ -3837,23 +3849,23 @@ function Zs(e, t, n, r) {
|
|
|
3837
3849
|
const p = c && s ? Xs(c, n) : null;
|
|
3838
3850
|
let v = -1, g = null;
|
|
3839
3851
|
i && (g = new ResizeObserver((w) => {
|
|
3840
|
-
let [
|
|
3841
|
-
|
|
3842
|
-
var
|
|
3843
|
-
(
|
|
3852
|
+
let [b] = w;
|
|
3853
|
+
b && b.target === c && g && (g.unobserve(t), cancelAnimationFrame(v), v = requestAnimationFrame(() => {
|
|
3854
|
+
var y;
|
|
3855
|
+
(y = g) == null || y.observe(t);
|
|
3844
3856
|
})), n();
|
|
3845
3857
|
}), c && !l && g.observe(c), g.observe(t));
|
|
3846
|
-
let
|
|
3858
|
+
let x, f = l ? Ye(e) : null;
|
|
3847
3859
|
l && m();
|
|
3848
3860
|
function m() {
|
|
3849
3861
|
const w = Ye(e);
|
|
3850
|
-
|
|
3862
|
+
f && !to(f, w) && n(), f = w, x = requestAnimationFrame(m);
|
|
3851
3863
|
}
|
|
3852
3864
|
return n(), () => {
|
|
3853
3865
|
var w;
|
|
3854
|
-
|
|
3855
|
-
o &&
|
|
3856
|
-
}), p == null || p(), (w = g) == null || w.disconnect(), g = null, l && cancelAnimationFrame(
|
|
3866
|
+
d.forEach((b) => {
|
|
3867
|
+
o && b.removeEventListener("scroll", n), a && b.removeEventListener("resize", n);
|
|
3868
|
+
}), p == null || p(), (w = g) == null || w.disconnect(), g = null, l && cancelAnimationFrame(x);
|
|
3857
3869
|
};
|
|
3858
3870
|
}
|
|
3859
3871
|
const Gs = xs, qs = ys, Qs = gs, Js = Ss, el = ws, ir = ms, tl = Cs, nl = (e, t, n) => {
|
|
@@ -3928,7 +3940,7 @@ function al(e) {
|
|
|
3928
3940
|
transform: s = !0,
|
|
3929
3941
|
whileElementsMounted: l,
|
|
3930
3942
|
open: c
|
|
3931
|
-
} = e, [
|
|
3943
|
+
} = e, [d, p] = h.useState({
|
|
3932
3944
|
x: 0,
|
|
3933
3945
|
y: 0,
|
|
3934
3946
|
strategy: n,
|
|
@@ -3937,20 +3949,20 @@ function al(e) {
|
|
|
3937
3949
|
isPositioned: !1
|
|
3938
3950
|
}), [v, g] = h.useState(r);
|
|
3939
3951
|
Dt(v, r) || g(r);
|
|
3940
|
-
const [
|
|
3941
|
-
P !==
|
|
3942
|
-
}, []),
|
|
3952
|
+
const [x, f] = h.useState(null), [m, w] = h.useState(null), b = h.useCallback((P) => {
|
|
3953
|
+
P !== E.current && (E.current = P, f(P));
|
|
3954
|
+
}, []), y = h.useCallback((P) => {
|
|
3943
3955
|
P !== k.current && (k.current = P, w(P));
|
|
3944
|
-
}, []), C = a ||
|
|
3945
|
-
if (!
|
|
3956
|
+
}, []), C = a || x, S = i || m, 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(() => {
|
|
3957
|
+
if (!E.current || !k.current)
|
|
3946
3958
|
return;
|
|
3947
3959
|
const P = {
|
|
3948
3960
|
placement: t,
|
|
3949
3961
|
strategy: n,
|
|
3950
3962
|
middleware: v
|
|
3951
3963
|
};
|
|
3952
|
-
$.current && (P.platform = $.current), nl(
|
|
3953
|
-
const
|
|
3964
|
+
$.current && (P.platform = $.current), nl(E.current, k.current, P).then((z) => {
|
|
3965
|
+
const Q = {
|
|
3954
3966
|
...z,
|
|
3955
3967
|
// The floating element's position may be recomputed while it's closed
|
|
3956
3968
|
// but still mounted (such as when transitioning out). To ensure
|
|
@@ -3958,8 +3970,8 @@ function al(e) {
|
|
|
3958
3970
|
// setting it to `true` when `open === false` (must be specified).
|
|
3959
3971
|
isPositioned: W.current !== !1
|
|
3960
3972
|
};
|
|
3961
|
-
|
|
3962
|
-
p(
|
|
3973
|
+
N.current && !Dt(I.current, Q) && (I.current = Q, h.flushSync(() => {
|
|
3974
|
+
p(Q);
|
|
3963
3975
|
}));
|
|
3964
3976
|
});
|
|
3965
3977
|
}, [v, t, n, $, W]);
|
|
@@ -3969,22 +3981,22 @@ function al(e) {
|
|
|
3969
3981
|
isPositioned: !1
|
|
3970
3982
|
})));
|
|
3971
3983
|
}, [c]);
|
|
3972
|
-
const
|
|
3973
|
-
Pt(() => (
|
|
3974
|
-
|
|
3984
|
+
const N = h.useRef(!1);
|
|
3985
|
+
Pt(() => (N.current = !0, () => {
|
|
3986
|
+
N.current = !1;
|
|
3975
3987
|
}), []), Pt(() => {
|
|
3976
|
-
if (C && (
|
|
3988
|
+
if (C && (E.current = C), S && (k.current = S), C && S) {
|
|
3977
3989
|
if (L.current)
|
|
3978
|
-
return L.current(C, S,
|
|
3979
|
-
|
|
3990
|
+
return L.current(C, S, F);
|
|
3991
|
+
F();
|
|
3980
3992
|
}
|
|
3981
|
-
}, [C, S,
|
|
3982
|
-
const
|
|
3983
|
-
reference:
|
|
3993
|
+
}, [C, S, F, L, D]);
|
|
3994
|
+
const _ = h.useMemo(() => ({
|
|
3995
|
+
reference: E,
|
|
3984
3996
|
floating: k,
|
|
3985
|
-
setReference:
|
|
3986
|
-
setFloating:
|
|
3987
|
-
}), [
|
|
3997
|
+
setReference: b,
|
|
3998
|
+
setFloating: y
|
|
3999
|
+
}), [b, y]), O = h.useMemo(() => ({
|
|
3988
4000
|
reference: C,
|
|
3989
4001
|
floating: S
|
|
3990
4002
|
}), [C, S]), M = h.useMemo(() => {
|
|
@@ -3995,26 +4007,26 @@ function al(e) {
|
|
|
3995
4007
|
};
|
|
3996
4008
|
if (!O.floating)
|
|
3997
4009
|
return P;
|
|
3998
|
-
const z = sr(O.floating,
|
|
4010
|
+
const z = sr(O.floating, d.x), Q = sr(O.floating, d.y);
|
|
3999
4011
|
return s ? {
|
|
4000
4012
|
...P,
|
|
4001
|
-
transform: "translate(" + z + "px, " +
|
|
4013
|
+
transform: "translate(" + z + "px, " + Q + "px)",
|
|
4002
4014
|
...no(O.floating) >= 1.5 && {
|
|
4003
4015
|
willChange: "transform"
|
|
4004
4016
|
}
|
|
4005
4017
|
} : {
|
|
4006
4018
|
position: n,
|
|
4007
4019
|
left: z,
|
|
4008
|
-
top:
|
|
4020
|
+
top: Q
|
|
4009
4021
|
};
|
|
4010
|
-
}, [n, s, O.floating,
|
|
4022
|
+
}, [n, s, O.floating, d.x, d.y]);
|
|
4011
4023
|
return h.useMemo(() => ({
|
|
4012
|
-
...
|
|
4013
|
-
update:
|
|
4014
|
-
refs:
|
|
4024
|
+
...d,
|
|
4025
|
+
update: F,
|
|
4026
|
+
refs: _,
|
|
4015
4027
|
elements: O,
|
|
4016
4028
|
floatingStyles: M
|
|
4017
|
-
}), [
|
|
4029
|
+
}), [d, F, _, O, M]);
|
|
4018
4030
|
}
|
|
4019
4031
|
const il = (e) => {
|
|
4020
4032
|
function t(n) {
|
|
@@ -4061,7 +4073,7 @@ const il = (e) => {
|
|
|
4061
4073
|
});
|
|
4062
4074
|
var hl = "Arrow", ro = h.forwardRef((e, t) => {
|
|
4063
4075
|
const { children: n, width: r = 10, height: o = 5, ...a } = e;
|
|
4064
|
-
return /* @__PURE__ */
|
|
4076
|
+
return /* @__PURE__ */ T(
|
|
4065
4077
|
X.svg,
|
|
4066
4078
|
{
|
|
4067
4079
|
...a,
|
|
@@ -4070,7 +4082,7 @@ var hl = "Arrow", ro = h.forwardRef((e, t) => {
|
|
|
4070
4082
|
height: o,
|
|
4071
4083
|
viewBox: "0 0 30 10",
|
|
4072
4084
|
preserveAspectRatio: "none",
|
|
4073
|
-
children: e.asChild ? n : /* @__PURE__ */
|
|
4085
|
+
children: e.asChild ? n : /* @__PURE__ */ T("polygon", { points: "0,0 30,0 15,10" })
|
|
4074
4086
|
}
|
|
4075
4087
|
);
|
|
4076
4088
|
});
|
|
@@ -4100,22 +4112,22 @@ function ml(e) {
|
|
|
4100
4112
|
}
|
|
4101
4113
|
var Dn = "Popper", [oo, ao] = An(Dn), [gl, io] = oo(Dn), so = (e) => {
|
|
4102
4114
|
const { __scopePopper: t, children: n } = e, [r, o] = h.useState(null);
|
|
4103
|
-
return /* @__PURE__ */
|
|
4115
|
+
return /* @__PURE__ */ T(gl, { scope: t, anchor: r, onAnchorChange: o, children: n });
|
|
4104
4116
|
};
|
|
4105
4117
|
so.displayName = Dn;
|
|
4106
4118
|
var lo = "PopperAnchor", co = h.forwardRef(
|
|
4107
4119
|
(e, t) => {
|
|
4108
|
-
const { __scopePopper: n, virtualRef: r, ...o } = e, a = io(lo, n), i = h.useRef(null), s =
|
|
4120
|
+
const { __scopePopper: n, virtualRef: r, ...o } = e, a = io(lo, n), i = h.useRef(null), s = ne(t, i), l = h.useRef(null);
|
|
4109
4121
|
return h.useEffect(() => {
|
|
4110
4122
|
const c = l.current;
|
|
4111
4123
|
l.current = (r == null ? void 0 : r.current) || i.current, c !== l.current && a.onAnchorChange(l.current);
|
|
4112
|
-
}), r ? null : /* @__PURE__ */
|
|
4124
|
+
}), r ? null : /* @__PURE__ */ T(X.div, { ...o, ref: s });
|
|
4113
4125
|
}
|
|
4114
4126
|
);
|
|
4115
4127
|
co.displayName = lo;
|
|
4116
4128
|
var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
4117
4129
|
(e, t) => {
|
|
4118
|
-
var R, K,
|
|
4130
|
+
var R, K, re, j, H, U;
|
|
4119
4131
|
const {
|
|
4120
4132
|
__scopePopper: n,
|
|
4121
4133
|
side: r = "bottom",
|
|
@@ -4125,18 +4137,18 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4125
4137
|
arrowPadding: s = 0,
|
|
4126
4138
|
avoidCollisions: l = !0,
|
|
4127
4139
|
collisionBoundary: c = [],
|
|
4128
|
-
collisionPadding:
|
|
4140
|
+
collisionPadding: d = 0,
|
|
4129
4141
|
sticky: p = "partial",
|
|
4130
4142
|
hideWhenDetached: v = !1,
|
|
4131
4143
|
updatePositionStrategy: g = "optimized",
|
|
4132
|
-
onPlaced:
|
|
4133
|
-
...
|
|
4134
|
-
} = e, m = io(Fn, n), [w,
|
|
4144
|
+
onPlaced: x,
|
|
4145
|
+
...f
|
|
4146
|
+
} = e, m = io(Fn, n), [w, b] = h.useState(null), y = ne(t, (le) => b(le)), [C, S] = h.useState(null), E = ml(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
4147
|
padding: L,
|
|
4136
4148
|
boundary: $.filter(yl),
|
|
4137
4149
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
4138
4150
|
altBoundary: W
|
|
4139
|
-
}, { refs:
|
|
4151
|
+
}, { refs: N, floatingStyles: _, placement: O, isPositioned: M, middlewareData: P } = al({
|
|
4140
4152
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
4141
4153
|
strategy: "fixed",
|
|
4142
4154
|
placement: D,
|
|
@@ -4152,11 +4164,11 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4152
4164
|
mainAxis: !0,
|
|
4153
4165
|
crossAxis: !1,
|
|
4154
4166
|
limiter: p === "partial" ? cl() : void 0,
|
|
4155
|
-
...
|
|
4167
|
+
...F
|
|
4156
4168
|
}),
|
|
4157
|
-
l && ul({ ...
|
|
4169
|
+
l && ul({ ...F }),
|
|
4158
4170
|
dl({
|
|
4159
|
-
...
|
|
4171
|
+
...F,
|
|
4160
4172
|
apply: ({ elements: le, rects: we, availableWidth: ft, availableHeight: pt }) => {
|
|
4161
4173
|
const { width: ht, height: na } = we.reference, yt = le.floating.style;
|
|
4162
4174
|
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 +4176,23 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4164
4176
|
}),
|
|
4165
4177
|
C && pl({ element: C, padding: s }),
|
|
4166
4178
|
Cl({ arrowWidth: k, arrowHeight: I }),
|
|
4167
|
-
v && fl({ strategy: "referenceHidden", ...
|
|
4179
|
+
v && fl({ strategy: "referenceHidden", ...F })
|
|
4168
4180
|
]
|
|
4169
|
-
}), [z,
|
|
4181
|
+
}), [z, Q] = ho(O), Pe = je(x);
|
|
4170
4182
|
se(() => {
|
|
4171
4183
|
M && (Pe == null || Pe());
|
|
4172
4184
|
}, [M, Pe]);
|
|
4173
|
-
const ut = (R = P.arrow) == null ? void 0 : R.x, dt = (K = P.arrow) == null ? void 0 : K.y, Me = ((
|
|
4185
|
+
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
4186
|
return se(() => {
|
|
4175
4187
|
w && He(window.getComputedStyle(w).zIndex);
|
|
4176
|
-
}, [w]), /* @__PURE__ */
|
|
4188
|
+
}, [w]), /* @__PURE__ */ T(
|
|
4177
4189
|
"div",
|
|
4178
4190
|
{
|
|
4179
|
-
ref:
|
|
4191
|
+
ref: N.setFloating,
|
|
4180
4192
|
"data-radix-popper-content-wrapper": "",
|
|
4181
4193
|
style: {
|
|
4182
|
-
...
|
|
4183
|
-
transform: M ?
|
|
4194
|
+
..._,
|
|
4195
|
+
transform: M ? _.transform : "translate(0, -200%)",
|
|
4184
4196
|
// keep off the page when measuring
|
|
4185
4197
|
minWidth: "max-content",
|
|
4186
4198
|
zIndex: Ze,
|
|
@@ -4197,7 +4209,7 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4197
4209
|
}
|
|
4198
4210
|
},
|
|
4199
4211
|
dir: e.dir,
|
|
4200
|
-
children: /* @__PURE__ */
|
|
4212
|
+
children: /* @__PURE__ */ T(
|
|
4201
4213
|
wl,
|
|
4202
4214
|
{
|
|
4203
4215
|
scope: n,
|
|
@@ -4206,15 +4218,15 @@ var Fn = "PopperContent", [wl, bl] = oo(Fn), uo = h.forwardRef(
|
|
|
4206
4218
|
arrowX: ut,
|
|
4207
4219
|
arrowY: dt,
|
|
4208
4220
|
shouldHideArrow: Me,
|
|
4209
|
-
children: /* @__PURE__ */
|
|
4221
|
+
children: /* @__PURE__ */ T(
|
|
4210
4222
|
X.div,
|
|
4211
4223
|
{
|
|
4212
4224
|
"data-side": z,
|
|
4213
|
-
"data-align":
|
|
4214
|
-
...
|
|
4215
|
-
ref:
|
|
4225
|
+
"data-align": Q,
|
|
4226
|
+
...f,
|
|
4227
|
+
ref: y,
|
|
4216
4228
|
style: {
|
|
4217
|
-
...
|
|
4229
|
+
...f.style,
|
|
4218
4230
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
4219
4231
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
4220
4232
|
animation: M ? void 0 : "none"
|
|
@@ -4239,7 +4251,7 @@ var fo = "PopperArrow", xl = {
|
|
|
4239
4251
|
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
|
|
4240
4252
|
// doesn't report size as we'd expect on SVG elements.
|
|
4241
4253
|
// it reports their bounding box which is effectively the largest path inside the SVG.
|
|
4242
|
-
/* @__PURE__ */
|
|
4254
|
+
/* @__PURE__ */ T(
|
|
4243
4255
|
"span",
|
|
4244
4256
|
{
|
|
4245
4257
|
ref: a.onArrowChange,
|
|
@@ -4262,7 +4274,7 @@ var fo = "PopperArrow", xl = {
|
|
|
4262
4274
|
}[a.placedSide],
|
|
4263
4275
|
visibility: a.shouldHideArrow ? "hidden" : void 0
|
|
4264
4276
|
},
|
|
4265
|
-
children: /* @__PURE__ */
|
|
4277
|
+
children: /* @__PURE__ */ T(
|
|
4266
4278
|
vl,
|
|
4267
4279
|
{
|
|
4268
4280
|
...o,
|
|
@@ -4286,10 +4298,10 @@ var Cl = (e) => ({
|
|
|
4286
4298
|
name: "transformOrigin",
|
|
4287
4299
|
options: e,
|
|
4288
4300
|
fn(t) {
|
|
4289
|
-
var m, w,
|
|
4290
|
-
const { placement: n, rects: r, middlewareData: o } = t, i = ((m = o.arrow) == null ? void 0 : m.centerOffset) !== 0, s = i ? 0 : e.arrowWidth, l = i ? 0 : e.arrowHeight, [c,
|
|
4291
|
-
let
|
|
4292
|
-
return c === "bottom" ? (
|
|
4301
|
+
var m, w, b;
|
|
4302
|
+
const { placement: n, rects: r, middlewareData: o } = t, i = ((m = o.arrow) == null ? void 0 : m.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, g = (((b = o.arrow) == null ? void 0 : b.y) ?? 0) + l / 2;
|
|
4303
|
+
let x = "", f = "";
|
|
4304
|
+
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 : `${g}px`) : c === "left" && (x = `${r.floating.width + l}px`, f = i ? p : `${g}px`), { data: { x, y: f } };
|
|
4293
4305
|
}
|
|
4294
4306
|
});
|
|
4295
4307
|
function ho(e) {
|
|
@@ -4301,7 +4313,7 @@ var Sl = so, kl = co, El = uo, Tl = po, Al = "Portal", vo = h.forwardRef((e, t)
|
|
|
4301
4313
|
const { container: n, ...r } = e, [o, a] = h.useState(!1);
|
|
4302
4314
|
se(() => a(!0), []);
|
|
4303
4315
|
const i = n || o && ((s = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : s.body);
|
|
4304
|
-
return i ? De.createPortal(/* @__PURE__ */
|
|
4316
|
+
return i ? De.createPortal(/* @__PURE__ */ T(X.div, { ...r, ref: t }), i) : null;
|
|
4305
4317
|
});
|
|
4306
4318
|
vo.displayName = Al;
|
|
4307
4319
|
var _l = h[" useInsertionEffect ".trim().toString()] || se;
|
|
@@ -4317,22 +4329,22 @@ function lr({
|
|
|
4317
4329
|
onChange: n
|
|
4318
4330
|
}), s = e !== void 0, l = s ? e : o;
|
|
4319
4331
|
{
|
|
4320
|
-
const
|
|
4332
|
+
const d = h.useRef(e !== void 0);
|
|
4321
4333
|
h.useEffect(() => {
|
|
4322
|
-
const p =
|
|
4334
|
+
const p = d.current;
|
|
4323
4335
|
p !== s && console.warn(
|
|
4324
4336
|
`${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
|
-
),
|
|
4337
|
+
), d.current = s;
|
|
4326
4338
|
}, [s, r]);
|
|
4327
4339
|
}
|
|
4328
4340
|
const c = h.useCallback(
|
|
4329
|
-
(
|
|
4341
|
+
(d) => {
|
|
4330
4342
|
var p;
|
|
4331
4343
|
if (s) {
|
|
4332
|
-
const v = Rl(
|
|
4344
|
+
const v = Rl(d) ? d(e) : d;
|
|
4333
4345
|
v !== e && ((p = i.current) == null || p.call(i, v));
|
|
4334
4346
|
} else
|
|
4335
|
-
a(
|
|
4347
|
+
a(d);
|
|
4336
4348
|
},
|
|
4337
4349
|
[s, e, a, i]
|
|
4338
4350
|
);
|
|
@@ -4370,7 +4382,7 @@ var mo = Object.freeze({
|
|
|
4370
4382
|
whiteSpace: "nowrap",
|
|
4371
4383
|
wordWrap: "normal"
|
|
4372
4384
|
}), Nl = "VisuallyHidden", Ol = h.forwardRef(
|
|
4373
|
-
(e, t) => /* @__PURE__ */
|
|
4385
|
+
(e, t) => /* @__PURE__ */ T(
|
|
4374
4386
|
X.span,
|
|
4375
4387
|
{
|
|
4376
4388
|
...e,
|
|
@@ -4403,20 +4415,20 @@ var Ll = function(e) {
|
|
|
4403
4415
|
!p || s.has(p) || (s.add(p), c(p.parentNode));
|
|
4404
4416
|
};
|
|
4405
4417
|
o.forEach(c);
|
|
4406
|
-
var
|
|
4418
|
+
var d = function(p) {
|
|
4407
4419
|
!p || l.has(p) || Array.prototype.forEach.call(p.children, function(v) {
|
|
4408
4420
|
if (s.has(v))
|
|
4409
|
-
|
|
4421
|
+
d(v);
|
|
4410
4422
|
else
|
|
4411
4423
|
try {
|
|
4412
|
-
var g = v.getAttribute(r),
|
|
4413
|
-
Ge.set(v,
|
|
4424
|
+
var g = v.getAttribute(r), x = g !== null && g !== "false", f = (Ge.get(v) || 0) + 1, m = (a.get(v) || 0) + 1;
|
|
4425
|
+
Ge.set(v, f), a.set(v, m), i.push(v), f === 1 && x && kt.set(v, !0), m === 1 && v.setAttribute(n, "true"), x || v.setAttribute(r, "true");
|
|
4414
4426
|
} catch (w) {
|
|
4415
4427
|
console.error("aria-hidden: cannot operate on ", v, w);
|
|
4416
4428
|
}
|
|
4417
4429
|
});
|
|
4418
4430
|
};
|
|
4419
|
-
return
|
|
4431
|
+
return d(t), s.clear(), en++, function() {
|
|
4420
4432
|
i.forEach(function(p) {
|
|
4421
4433
|
var v = Ge.get(p) - 1, g = a.get(p) - 1;
|
|
4422
4434
|
Ge.set(p, v), a.set(p, g), v || (kt.has(p) || p.removeAttribute(r), kt.delete(p)), g || p.removeAttribute(n);
|
|
@@ -4536,17 +4548,17 @@ function jl(e, t) {
|
|
|
4536
4548
|
n = [], s.forEach(a), i = n;
|
|
4537
4549
|
}
|
|
4538
4550
|
var l = function() {
|
|
4539
|
-
var
|
|
4540
|
-
i = [],
|
|
4551
|
+
var d = i;
|
|
4552
|
+
i = [], d.forEach(a);
|
|
4541
4553
|
}, c = function() {
|
|
4542
4554
|
return Promise.resolve().then(l);
|
|
4543
4555
|
};
|
|
4544
4556
|
c(), n = {
|
|
4545
|
-
push: function(
|
|
4546
|
-
i.push(
|
|
4557
|
+
push: function(d) {
|
|
4558
|
+
i.push(d), c();
|
|
4547
4559
|
},
|
|
4548
|
-
filter: function(
|
|
4549
|
-
return i = i.filter(
|
|
4560
|
+
filter: function(d) {
|
|
4561
|
+
return i = i.filter(d), n;
|
|
4550
4562
|
}
|
|
4551
4563
|
};
|
|
4552
4564
|
}
|
|
@@ -4577,12 +4589,12 @@ var xo = Yl(), nn = function() {
|
|
|
4577
4589
|
onScrollCapture: nn,
|
|
4578
4590
|
onWheelCapture: nn,
|
|
4579
4591
|
onTouchMoveCapture: nn
|
|
4580
|
-
}), o = r[0], a = r[1], i = e.forwardProps, s = e.children, l = e.className, c = e.removeScrollBar,
|
|
4592
|
+
}), 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, g = e.noRelative, x = e.noIsolation, f = e.inert, m = 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
4593
|
return h.createElement(
|
|
4582
4594
|
h.Fragment,
|
|
4583
4595
|
null,
|
|
4584
|
-
|
|
4585
|
-
i ? h.cloneElement(h.Children.only(s), xe(xe({}, k), { ref:
|
|
4596
|
+
d && h.createElement(S, { sideCar: xo, removeScrollBar: c, shards: p, noRelative: g, noIsolation: x, inert: f, setCallbacks: a, allowPinchZoom: !!m, lockRef: n, gapMode: y }),
|
|
4597
|
+
i ? h.cloneElement(h.Children.only(s), xe(xe({}, k), { ref: E })) : h.createElement(b, xe({}, k, { className: l, ref: E }), s)
|
|
4586
4598
|
);
|
|
4587
4599
|
});
|
|
4588
4600
|
Ht.defaultProps = {
|
|
@@ -4780,20 +4792,20 @@ var qe = dn ? { passive: !1 } : !1, sc = function(e) {
|
|
|
4780
4792
|
}, fc = function(e, t) {
|
|
4781
4793
|
return e === "h" && t === "rtl" ? -1 : 1;
|
|
4782
4794
|
}, 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,
|
|
4795
|
+
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
4796
|
do {
|
|
4785
4797
|
if (!s)
|
|
4786
4798
|
break;
|
|
4787
|
-
var g = ko(e, s),
|
|
4788
|
-
(
|
|
4789
|
-
var
|
|
4790
|
-
s =
|
|
4799
|
+
var g = ko(e, s), x = g[0], f = g[1], m = g[2], w = f - m - a * x;
|
|
4800
|
+
(x || w) && So(e, s) && (p += w, v += x);
|
|
4801
|
+
var b = s.parentNode;
|
|
4802
|
+
s = b && b.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? b.host : b;
|
|
4791
4803
|
} while (
|
|
4792
4804
|
// portaled content
|
|
4793
4805
|
!l && s !== document.body || // self content
|
|
4794
4806
|
l && (t.contains(s) || t === s)
|
|
4795
4807
|
);
|
|
4796
|
-
return (
|
|
4808
|
+
return (d && Math.abs(p) < 1 || !d && Math.abs(v) < 1) && (c = !0), c;
|
|
4797
4809
|
}, At = function(e) {
|
|
4798
4810
|
return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
|
|
4799
4811
|
}, fr = function(e) {
|
|
@@ -4815,78 +4827,78 @@ function gc(e) {
|
|
|
4815
4827
|
}, [e]), h.useEffect(function() {
|
|
4816
4828
|
if (e.inert) {
|
|
4817
4829
|
document.body.classList.add("block-interactivity-".concat(o));
|
|
4818
|
-
var
|
|
4819
|
-
return
|
|
4830
|
+
var f = Bl([e.lockRef.current], (e.shards || []).map(pr), !0).filter(Boolean);
|
|
4831
|
+
return f.forEach(function(m) {
|
|
4820
4832
|
return m.classList.add("allow-interactivity-".concat(o));
|
|
4821
4833
|
}), function() {
|
|
4822
|
-
document.body.classList.remove("block-interactivity-".concat(o)),
|
|
4834
|
+
document.body.classList.remove("block-interactivity-".concat(o)), f.forEach(function(m) {
|
|
4823
4835
|
return m.classList.remove("allow-interactivity-".concat(o));
|
|
4824
4836
|
});
|
|
4825
4837
|
};
|
|
4826
4838
|
}
|
|
4827
4839
|
}, [e.inert, e.lockRef.current, e.shards]);
|
|
4828
|
-
var s = h.useCallback(function(
|
|
4829
|
-
if ("touches" in
|
|
4840
|
+
var s = h.useCallback(function(f, m) {
|
|
4841
|
+
if ("touches" in f && f.touches.length === 2 || f.type === "wheel" && f.ctrlKey)
|
|
4830
4842
|
return !i.current.allowPinchZoom;
|
|
4831
|
-
var w = At(
|
|
4832
|
-
if ("touches" in
|
|
4843
|
+
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";
|
|
4844
|
+
if ("touches" in f && k === "h" && E.type === "range")
|
|
4833
4845
|
return !1;
|
|
4834
|
-
var I = dr(k,
|
|
4846
|
+
var I = dr(k, E);
|
|
4835
4847
|
if (!I)
|
|
4836
4848
|
return !0;
|
|
4837
|
-
if (I ? S = k : (S = k === "v" ? "h" : "v", I = dr(k,
|
|
4849
|
+
if (I ? S = k : (S = k === "v" ? "h" : "v", I = dr(k, E)), !I)
|
|
4838
4850
|
return !1;
|
|
4839
|
-
if (!r.current && "changedTouches" in
|
|
4851
|
+
if (!r.current && "changedTouches" in f && (y || C) && (r.current = S), !S)
|
|
4840
4852
|
return !0;
|
|
4841
4853
|
var D = r.current || S;
|
|
4842
|
-
return pc(D, m,
|
|
4843
|
-
}, []), l = h.useCallback(function(
|
|
4844
|
-
var m =
|
|
4854
|
+
return pc(D, m, f, D === "h" ? y : C);
|
|
4855
|
+
}, []), l = h.useCallback(function(f) {
|
|
4856
|
+
var m = f;
|
|
4845
4857
|
if (!(!Qe.length || Qe[Qe.length - 1] !== a)) {
|
|
4846
|
-
var w = "deltaY" in m ? fr(m) : At(m),
|
|
4858
|
+
var w = "deltaY" in m ? fr(m) : At(m), b = t.current.filter(function(S) {
|
|
4847
4859
|
return S.name === m.type && (S.target === m.target || m.target === S.shadowParent) && hc(S.delta, w);
|
|
4848
4860
|
})[0];
|
|
4849
|
-
if (
|
|
4861
|
+
if (b && b.should) {
|
|
4850
4862
|
m.cancelable && m.preventDefault();
|
|
4851
4863
|
return;
|
|
4852
4864
|
}
|
|
4853
|
-
if (!
|
|
4854
|
-
var
|
|
4865
|
+
if (!b) {
|
|
4866
|
+
var y = (i.current.shards || []).map(pr).filter(Boolean).filter(function(S) {
|
|
4855
4867
|
return S.contains(m.target);
|
|
4856
|
-
}), C =
|
|
4868
|
+
}), C = y.length > 0 ? s(m, y[0]) : !i.current.noIsolation;
|
|
4857
4869
|
C && m.cancelable && m.preventDefault();
|
|
4858
4870
|
}
|
|
4859
4871
|
}
|
|
4860
|
-
}, []), c = h.useCallback(function(
|
|
4861
|
-
var
|
|
4862
|
-
t.current.push(
|
|
4872
|
+
}, []), c = h.useCallback(function(f, m, w, b) {
|
|
4873
|
+
var y = { name: f, delta: m, target: w, should: b, shadowParent: wc(w) };
|
|
4874
|
+
t.current.push(y), setTimeout(function() {
|
|
4863
4875
|
t.current = t.current.filter(function(C) {
|
|
4864
|
-
return C !==
|
|
4876
|
+
return C !== y;
|
|
4865
4877
|
});
|
|
4866
4878
|
}, 1);
|
|
4867
|
-
}, []),
|
|
4868
|
-
n.current = At(
|
|
4869
|
-
}, []), p = h.useCallback(function(
|
|
4870
|
-
c(
|
|
4871
|
-
}, []), v = h.useCallback(function(
|
|
4872
|
-
c(
|
|
4879
|
+
}, []), d = h.useCallback(function(f) {
|
|
4880
|
+
n.current = At(f), r.current = void 0;
|
|
4881
|
+
}, []), p = h.useCallback(function(f) {
|
|
4882
|
+
c(f.type, fr(f), f.target, s(f, e.lockRef.current));
|
|
4883
|
+
}, []), v = h.useCallback(function(f) {
|
|
4884
|
+
c(f.type, At(f), f.target, s(f, e.lockRef.current));
|
|
4873
4885
|
}, []);
|
|
4874
4886
|
h.useEffect(function() {
|
|
4875
4887
|
return Qe.push(a), e.setCallbacks({
|
|
4876
4888
|
onScrollCapture: p,
|
|
4877
4889
|
onWheelCapture: p,
|
|
4878
4890
|
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",
|
|
4891
|
+
}), document.addEventListener("wheel", l, qe), document.addEventListener("touchmove", l, qe), document.addEventListener("touchstart", d, qe), function() {
|
|
4892
|
+
Qe = Qe.filter(function(f) {
|
|
4893
|
+
return f !== a;
|
|
4894
|
+
}), document.removeEventListener("wheel", l, qe), document.removeEventListener("touchmove", l, qe), document.removeEventListener("touchstart", d, qe);
|
|
4883
4895
|
};
|
|
4884
4896
|
}, []);
|
|
4885
|
-
var g = e.removeScrollBar,
|
|
4897
|
+
var g = e.removeScrollBar, x = e.inert;
|
|
4886
4898
|
return h.createElement(
|
|
4887
4899
|
h.Fragment,
|
|
4888
4900
|
null,
|
|
4889
|
-
|
|
4901
|
+
x ? h.createElement(a, { styles: vc(o) }) : null,
|
|
4890
4902
|
g ? h.createElement(ic, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
|
|
4891
4903
|
);
|
|
4892
4904
|
}
|
|
@@ -4914,12 +4926,12 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4914
4926
|
defaultValue: s,
|
|
4915
4927
|
onValueChange: l,
|
|
4916
4928
|
dir: c,
|
|
4917
|
-
name:
|
|
4929
|
+
name: d,
|
|
4918
4930
|
autoComplete: p,
|
|
4919
4931
|
disabled: v,
|
|
4920
4932
|
required: g,
|
|
4921
|
-
form:
|
|
4922
|
-
} = e,
|
|
4933
|
+
form: x
|
|
4934
|
+
} = e, f = Yt(t), [m, w] = h.useState(null), [b, y] = h.useState(null), [C, S] = h.useState(!1), E = Fi(c), [k, I] = lr({
|
|
4923
4935
|
prop: r,
|
|
4924
4936
|
defaultProp: o ?? !1,
|
|
4925
4937
|
onChange: a,
|
|
@@ -4929,16 +4941,16 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4929
4941
|
defaultProp: s,
|
|
4930
4942
|
onChange: l,
|
|
4931
4943
|
caller: Ke
|
|
4932
|
-
}), $ = h.useRef(null), W = m ?
|
|
4933
|
-
return /* @__PURE__ */
|
|
4944
|
+
}), $ = h.useRef(null), W = m ? x || !!m.closest("form") : !0, [F, N] = h.useState(/* @__PURE__ */ new Set()), _ = Array.from(F).map((O) => O.props.value).join(";");
|
|
4945
|
+
return /* @__PURE__ */ T(Sl, { ...f, children: /* @__PURE__ */ Nt(
|
|
4934
4946
|
Sc,
|
|
4935
4947
|
{
|
|
4936
4948
|
required: g,
|
|
4937
4949
|
scope: t,
|
|
4938
4950
|
trigger: m,
|
|
4939
4951
|
onTriggerChange: w,
|
|
4940
|
-
valueNode:
|
|
4941
|
-
onValueNodeChange:
|
|
4952
|
+
valueNode: b,
|
|
4953
|
+
onValueNodeChange: y,
|
|
4942
4954
|
valueNodeHasChildren: C,
|
|
4943
4955
|
onValueNodeHasChildrenChange: S,
|
|
4944
4956
|
contentId: _n(),
|
|
@@ -4946,19 +4958,19 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4946
4958
|
onValueChange: L,
|
|
4947
4959
|
open: k,
|
|
4948
4960
|
onOpenChange: I,
|
|
4949
|
-
dir:
|
|
4961
|
+
dir: E,
|
|
4950
4962
|
triggerPointerDownPosRef: $,
|
|
4951
4963
|
disabled: v,
|
|
4952
4964
|
children: [
|
|
4953
|
-
/* @__PURE__ */
|
|
4965
|
+
/* @__PURE__ */ T(Ut.Provider, { scope: t, children: /* @__PURE__ */ T(
|
|
4954
4966
|
kc,
|
|
4955
4967
|
{
|
|
4956
4968
|
scope: e.__scopeSelect,
|
|
4957
4969
|
onNativeOptionAdd: h.useCallback((O) => {
|
|
4958
|
-
|
|
4970
|
+
N((M) => new Set(M).add(O));
|
|
4959
4971
|
}, []),
|
|
4960
4972
|
onNativeOptionRemove: h.useCallback((O) => {
|
|
4961
|
-
|
|
4973
|
+
N((M) => {
|
|
4962
4974
|
const P = new Set(M);
|
|
4963
4975
|
return P.delete(O), P;
|
|
4964
4976
|
});
|
|
@@ -4972,18 +4984,18 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4972
4984
|
"aria-hidden": !0,
|
|
4973
4985
|
required: g,
|
|
4974
4986
|
tabIndex: -1,
|
|
4975
|
-
name:
|
|
4987
|
+
name: d,
|
|
4976
4988
|
autoComplete: p,
|
|
4977
4989
|
value: D,
|
|
4978
4990
|
onChange: (O) => L(O.target.value),
|
|
4979
4991
|
disabled: v,
|
|
4980
|
-
form:
|
|
4992
|
+
form: x,
|
|
4981
4993
|
children: [
|
|
4982
|
-
D === void 0 ? /* @__PURE__ */
|
|
4983
|
-
Array.from(
|
|
4994
|
+
D === void 0 ? /* @__PURE__ */ T("option", { value: "" }) : null,
|
|
4995
|
+
Array.from(F)
|
|
4984
4996
|
]
|
|
4985
4997
|
},
|
|
4986
|
-
|
|
4998
|
+
_
|
|
4987
4999
|
) : null
|
|
4988
5000
|
]
|
|
4989
5001
|
}
|
|
@@ -4992,16 +5004,16 @@ var xc = [" ", "Enter", "ArrowUp", "ArrowDown"], yc = [" ", "Enter"], Ke = "Sele
|
|
|
4992
5004
|
To.displayName = Ke;
|
|
4993
5005
|
var Ao = "SelectTrigger", _o = h.forwardRef(
|
|
4994
5006
|
(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 m = c().filter((
|
|
4997
|
-
|
|
4998
|
-
}),
|
|
4999
|
-
s || (i.onOpenChange(!0), g()),
|
|
5000
|
-
x: Math.round(
|
|
5001
|
-
y: Math.round(
|
|
5007
|
+
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, g] = Zo((f) => {
|
|
5008
|
+
const m = c().filter((y) => !y.disabled), w = m.find((y) => y.value === i.value), b = Go(m, f, w);
|
|
5009
|
+
b !== void 0 && i.onValueChange(b.value);
|
|
5010
|
+
}), x = (f) => {
|
|
5011
|
+
s || (i.onOpenChange(!0), g()), f && (i.triggerPointerDownPosRef.current = {
|
|
5012
|
+
x: Math.round(f.pageX),
|
|
5013
|
+
y: Math.round(f.pageY)
|
|
5002
5014
|
});
|
|
5003
5015
|
};
|
|
5004
|
-
return /* @__PURE__ */
|
|
5016
|
+
return /* @__PURE__ */ T(kl, { asChild: !0, ...a, children: /* @__PURE__ */ T(
|
|
5005
5017
|
X.button,
|
|
5006
5018
|
{
|
|
5007
5019
|
type: "button",
|
|
@@ -5017,17 +5029,17 @@ var Ao = "SelectTrigger", _o = h.forwardRef(
|
|
|
5017
5029
|
"data-placeholder": Xo(i.value) ? "" : void 0,
|
|
5018
5030
|
...o,
|
|
5019
5031
|
ref: l,
|
|
5020
|
-
onClick: Z(o.onClick, (
|
|
5021
|
-
|
|
5032
|
+
onClick: Z(o.onClick, (f) => {
|
|
5033
|
+
f.currentTarget.focus(), d.current !== "mouse" && x(f);
|
|
5022
5034
|
}),
|
|
5023
|
-
onPointerDown: Z(o.onPointerDown, (
|
|
5024
|
-
|
|
5025
|
-
const m =
|
|
5026
|
-
m.hasPointerCapture(
|
|
5035
|
+
onPointerDown: Z(o.onPointerDown, (f) => {
|
|
5036
|
+
d.current = f.pointerType;
|
|
5037
|
+
const m = f.target;
|
|
5038
|
+
m.hasPointerCapture(f.pointerId) && m.releasePointerCapture(f.pointerId), f.button === 0 && f.ctrlKey === !1 && f.pointerType === "mouse" && (x(f), f.preventDefault());
|
|
5027
5039
|
}),
|
|
5028
|
-
onKeyDown: Z(o.onKeyDown, (
|
|
5040
|
+
onKeyDown: Z(o.onKeyDown, (f) => {
|
|
5029
5041
|
const m = p.current !== "";
|
|
5030
|
-
!(
|
|
5042
|
+
!(f.ctrlKey || f.altKey || f.metaKey) && f.key.length === 1 && v(f.key), !(m && f.key === " ") && xc.includes(f.key) && (x(), f.preventDefault());
|
|
5031
5043
|
})
|
|
5032
5044
|
}
|
|
5033
5045
|
) });
|
|
@@ -5036,16 +5048,16 @@ var Ao = "SelectTrigger", _o = h.forwardRef(
|
|
|
5036
5048
|
_o.displayName = Ao;
|
|
5037
5049
|
var Po = "SelectValue", Tc = h.forwardRef(
|
|
5038
5050
|
(e, t) => {
|
|
5039
|
-
const { __scopeSelect: n, className: r, style: o, children: a, placeholder: i = "", ...s } = e, l = $e(Po, n), { onValueNodeHasChildrenChange: c } = l,
|
|
5051
|
+
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
5052
|
return se(() => {
|
|
5041
|
-
c(
|
|
5042
|
-
}, [c,
|
|
5053
|
+
c(d);
|
|
5054
|
+
}, [c, d]), /* @__PURE__ */ T(
|
|
5043
5055
|
X.span,
|
|
5044
5056
|
{
|
|
5045
5057
|
...s,
|
|
5046
5058
|
ref: p,
|
|
5047
5059
|
style: { pointerEvents: "none" },
|
|
5048
|
-
children: Xo(l.value) ? /* @__PURE__ */
|
|
5060
|
+
children: Xo(l.value) ? /* @__PURE__ */ T(gn, { children: i }) : a
|
|
5049
5061
|
}
|
|
5050
5062
|
);
|
|
5051
5063
|
}
|
|
@@ -5054,11 +5066,11 @@ Tc.displayName = Po;
|
|
|
5054
5066
|
var Ac = "SelectIcon", Ro = h.forwardRef(
|
|
5055
5067
|
(e, t) => {
|
|
5056
5068
|
const { __scopeSelect: n, children: r, ...o } = e;
|
|
5057
|
-
return /* @__PURE__ */
|
|
5069
|
+
return /* @__PURE__ */ T(X.span, { "aria-hidden": !0, ...o, ref: t, children: r || "▼" });
|
|
5058
5070
|
}
|
|
5059
5071
|
);
|
|
5060
5072
|
Ro.displayName = Ac;
|
|
5061
|
-
var _c = "SelectPortal", Io = (e) => /* @__PURE__ */
|
|
5073
|
+
var _c = "SelectPortal", Io = (e) => /* @__PURE__ */ T(vo, { asChild: !0, ...e });
|
|
5062
5074
|
Io.displayName = _c;
|
|
5063
5075
|
var Xe = "SelectContent", No = h.forwardRef(
|
|
5064
5076
|
(e, t) => {
|
|
@@ -5068,11 +5080,11 @@ var Xe = "SelectContent", No = h.forwardRef(
|
|
|
5068
5080
|
}, []), !n.open) {
|
|
5069
5081
|
const a = r;
|
|
5070
5082
|
return a ? h.createPortal(
|
|
5071
|
-
/* @__PURE__ */
|
|
5083
|
+
/* @__PURE__ */ T(Oo, { scope: e.__scopeSelect, children: /* @__PURE__ */ T(Ut.Slot, { scope: e.__scopeSelect, children: /* @__PURE__ */ T("div", { children: e.children }) }) }),
|
|
5072
5084
|
a
|
|
5073
5085
|
) : null;
|
|
5074
5086
|
}
|
|
5075
|
-
return /* @__PURE__ */
|
|
5087
|
+
return /* @__PURE__ */ T(Lo, { ...e, ref: t });
|
|
5076
5088
|
}
|
|
5077
5089
|
);
|
|
5078
5090
|
No.displayName = Xe;
|
|
@@ -5089,38 +5101,38 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5089
5101
|
side: s,
|
|
5090
5102
|
sideOffset: l,
|
|
5091
5103
|
align: c,
|
|
5092
|
-
alignOffset:
|
|
5104
|
+
alignOffset: d,
|
|
5093
5105
|
arrowPadding: p,
|
|
5094
5106
|
collisionBoundary: v,
|
|
5095
5107
|
collisionPadding: g,
|
|
5096
|
-
sticky:
|
|
5097
|
-
hideWhenDetached:
|
|
5108
|
+
sticky: x,
|
|
5109
|
+
hideWhenDetached: f,
|
|
5098
5110
|
avoidCollisions: m,
|
|
5099
5111
|
//
|
|
5100
5112
|
...w
|
|
5101
|
-
} = e,
|
|
5113
|
+
} = 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
5114
|
null
|
|
5103
|
-
), W = jt(n), [
|
|
5115
|
+
), W = jt(n), [F, N] = h.useState(!1), _ = h.useRef(!1);
|
|
5104
5116
|
h.useEffect(() => {
|
|
5105
|
-
if (
|
|
5106
|
-
}, [
|
|
5117
|
+
if (y) return Fl(y);
|
|
5118
|
+
}, [y]), Xi();
|
|
5107
5119
|
const O = h.useCallback(
|
|
5108
5120
|
(R) => {
|
|
5109
|
-
const [K, ...
|
|
5121
|
+
const [K, ...re] = W().map((U) => U.ref.current), [j] = re.slice(-1), H = document.activeElement;
|
|
5110
5122
|
for (const U of R)
|
|
5111
5123
|
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
5124
|
},
|
|
5113
5125
|
[W, S]
|
|
5114
5126
|
), M = h.useCallback(
|
|
5115
|
-
() => O([I,
|
|
5116
|
-
[O, I,
|
|
5127
|
+
() => O([I, y]),
|
|
5128
|
+
[O, I, y]
|
|
5117
5129
|
);
|
|
5118
5130
|
h.useEffect(() => {
|
|
5119
|
-
|
|
5120
|
-
}, [
|
|
5121
|
-
const { onOpenChange: P, triggerPointerDownPosRef: z } =
|
|
5131
|
+
F && M();
|
|
5132
|
+
}, [F, M]);
|
|
5133
|
+
const { onOpenChange: P, triggerPointerDownPosRef: z } = b;
|
|
5122
5134
|
h.useEffect(() => {
|
|
5123
|
-
if (
|
|
5135
|
+
if (y) {
|
|
5124
5136
|
let R = { x: 0, y: 0 };
|
|
5125
5137
|
const K = (j) => {
|
|
5126
5138
|
var H, U;
|
|
@@ -5128,53 +5140,53 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5128
5140
|
x: Math.abs(Math.round(j.pageX) - (((H = z.current) == null ? void 0 : H.x) ?? 0)),
|
|
5129
5141
|
y: Math.abs(Math.round(j.pageY) - (((U = z.current) == null ? void 0 : U.y) ?? 0))
|
|
5130
5142
|
};
|
|
5131
|
-
},
|
|
5132
|
-
R.x <= 10 && R.y <= 10 ? j.preventDefault() :
|
|
5143
|
+
}, re = (j) => {
|
|
5144
|
+
R.x <= 10 && R.y <= 10 ? j.preventDefault() : y.contains(j.target) || P(!1), document.removeEventListener("pointermove", K), z.current = null;
|
|
5133
5145
|
};
|
|
5134
|
-
return z.current !== null && (document.addEventListener("pointermove", K), document.addEventListener("pointerup",
|
|
5135
|
-
document.removeEventListener("pointermove", K), document.removeEventListener("pointerup",
|
|
5146
|
+
return z.current !== null && (document.addEventListener("pointermove", K), document.addEventListener("pointerup", re, { capture: !0, once: !0 })), () => {
|
|
5147
|
+
document.removeEventListener("pointermove", K), document.removeEventListener("pointerup", re, { capture: !0 });
|
|
5136
5148
|
};
|
|
5137
5149
|
}
|
|
5138
|
-
}, [
|
|
5150
|
+
}, [y, P, z]), h.useEffect(() => {
|
|
5139
5151
|
const R = () => P(!1);
|
|
5140
5152
|
return window.addEventListener("blur", R), window.addEventListener("resize", R), () => {
|
|
5141
5153
|
window.removeEventListener("blur", R), window.removeEventListener("resize", R);
|
|
5142
5154
|
};
|
|
5143
5155
|
}, [P]);
|
|
5144
|
-
const [
|
|
5145
|
-
const K = W().filter((H) => !H.disabled),
|
|
5156
|
+
const [Q, Pe] = Zo((R) => {
|
|
5157
|
+
const K = W().filter((H) => !H.disabled), re = K.find((H) => H.ref.current === document.activeElement), j = Go(K, R, re);
|
|
5146
5158
|
j && setTimeout(() => j.ref.current.focus());
|
|
5147
5159
|
}), ut = h.useCallback(
|
|
5148
|
-
(R, K,
|
|
5149
|
-
const j = !
|
|
5150
|
-
(
|
|
5160
|
+
(R, K, re) => {
|
|
5161
|
+
const j = !_.current && !re;
|
|
5162
|
+
(b.value !== void 0 && b.value === K || j) && (D(R), j && (_.current = !0));
|
|
5151
5163
|
},
|
|
5152
|
-
[
|
|
5153
|
-
), dt = h.useCallback(() =>
|
|
5154
|
-
(R, K,
|
|
5155
|
-
const j = !
|
|
5156
|
-
(
|
|
5164
|
+
[b.value]
|
|
5165
|
+
), dt = h.useCallback(() => y == null ? void 0 : y.focus(), [y]), Me = h.useCallback(
|
|
5166
|
+
(R, K, re) => {
|
|
5167
|
+
const j = !_.current && !re;
|
|
5168
|
+
(b.value !== void 0 && b.value === K || j) && $(R);
|
|
5157
5169
|
},
|
|
5158
|
-
[
|
|
5170
|
+
[b.value]
|
|
5159
5171
|
), Ze = r === "popper" ? fn : Mo, He = Ze === fn ? {
|
|
5160
5172
|
side: s,
|
|
5161
5173
|
sideOffset: l,
|
|
5162
5174
|
align: c,
|
|
5163
|
-
alignOffset:
|
|
5175
|
+
alignOffset: d,
|
|
5164
5176
|
arrowPadding: p,
|
|
5165
5177
|
collisionBoundary: v,
|
|
5166
5178
|
collisionPadding: g,
|
|
5167
|
-
sticky:
|
|
5168
|
-
hideWhenDetached:
|
|
5179
|
+
sticky: x,
|
|
5180
|
+
hideWhenDetached: f,
|
|
5169
5181
|
avoidCollisions: m
|
|
5170
5182
|
} : {};
|
|
5171
|
-
return /* @__PURE__ */
|
|
5183
|
+
return /* @__PURE__ */ T(
|
|
5172
5184
|
Oo,
|
|
5173
5185
|
{
|
|
5174
5186
|
scope: n,
|
|
5175
|
-
content:
|
|
5187
|
+
content: y,
|
|
5176
5188
|
viewport: S,
|
|
5177
|
-
onViewportChange:
|
|
5189
|
+
onViewportChange: E,
|
|
5178
5190
|
itemRefCallback: ut,
|
|
5179
5191
|
selectedItem: I,
|
|
5180
5192
|
onItemLeave: dt,
|
|
@@ -5182,21 +5194,21 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5182
5194
|
focusSelectedItem: M,
|
|
5183
5195
|
selectedItemText: L,
|
|
5184
5196
|
position: r,
|
|
5185
|
-
isPositioned:
|
|
5186
|
-
searchRef:
|
|
5187
|
-
children: /* @__PURE__ */
|
|
5197
|
+
isPositioned: F,
|
|
5198
|
+
searchRef: Q,
|
|
5199
|
+
children: /* @__PURE__ */ T(Eo, { as: Rc, allowPinchZoom: !0, children: /* @__PURE__ */ T(
|
|
5188
5200
|
Ur,
|
|
5189
5201
|
{
|
|
5190
5202
|
asChild: !0,
|
|
5191
|
-
trapped:
|
|
5203
|
+
trapped: b.open,
|
|
5192
5204
|
onMountAutoFocus: (R) => {
|
|
5193
5205
|
R.preventDefault();
|
|
5194
5206
|
},
|
|
5195
5207
|
onUnmountAutoFocus: Z(o, (R) => {
|
|
5196
5208
|
var K;
|
|
5197
|
-
(K =
|
|
5209
|
+
(K = b.trigger) == null || K.focus({ preventScroll: !0 }), R.preventDefault();
|
|
5198
5210
|
}),
|
|
5199
|
-
children: /* @__PURE__ */
|
|
5211
|
+
children: /* @__PURE__ */ T(
|
|
5200
5212
|
Wr,
|
|
5201
5213
|
{
|
|
5202
5214
|
asChild: !0,
|
|
@@ -5204,18 +5216,18 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5204
5216
|
onEscapeKeyDown: a,
|
|
5205
5217
|
onPointerDownOutside: i,
|
|
5206
5218
|
onFocusOutside: (R) => R.preventDefault(),
|
|
5207
|
-
onDismiss: () =>
|
|
5208
|
-
children: /* @__PURE__ */
|
|
5219
|
+
onDismiss: () => b.onOpenChange(!1),
|
|
5220
|
+
children: /* @__PURE__ */ T(
|
|
5209
5221
|
Ze,
|
|
5210
5222
|
{
|
|
5211
5223
|
role: "listbox",
|
|
5212
|
-
id:
|
|
5213
|
-
"data-state":
|
|
5214
|
-
dir:
|
|
5224
|
+
id: b.contentId,
|
|
5225
|
+
"data-state": b.open ? "open" : "closed",
|
|
5226
|
+
dir: b.dir,
|
|
5215
5227
|
onContextMenu: (R) => R.preventDefault(),
|
|
5216
5228
|
...w,
|
|
5217
5229
|
...He,
|
|
5218
|
-
onPlaced: () =>
|
|
5230
|
+
onPlaced: () => N(!0),
|
|
5219
5231
|
ref: k,
|
|
5220
5232
|
style: {
|
|
5221
5233
|
// flex layout so we can place the scroll buttons properly
|
|
@@ -5248,8 +5260,8 @@ var pe = 10, [Oo, We] = ct(Xe), Pc = "SelectContentImpl", Rc = /* @__PURE__ */ g
|
|
|
5248
5260
|
);
|
|
5249
5261
|
Lo.displayName = Pc;
|
|
5250
5262
|
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 &&
|
|
5263
|
+
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), g = h.useRef(!1), x = h.useRef(!0), { viewport: f, selectedItem: m, selectedItemText: w, focusSelectedItem: b } = i, y = h.useCallback(() => {
|
|
5264
|
+
if (a.trigger && a.valueNode && s && c && f && m && w) {
|
|
5253
5265
|
const k = a.trigger.getBoundingClientRect(), I = c.getBoundingClientRect(), D = a.valueNode.getBoundingClientRect(), L = w.getBoundingClientRect();
|
|
5254
5266
|
if (a.dir !== "rtl") {
|
|
5255
5267
|
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,11 +5281,11 @@ var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
|
5269
5281
|
]);
|
|
5270
5282
|
s.style.minWidth = we + "px", s.style.right = ht + "px";
|
|
5271
5283
|
}
|
|
5272
|
-
const $ = v(), W = window.innerHeight - pe * 2,
|
|
5284
|
+
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(m.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 = m.offsetHeight / 2, R = m.offsetTop + He, K = _ + O + R, re = z - K;
|
|
5273
5285
|
if (K <= Me) {
|
|
5274
5286
|
const H = $.length > 0 && m === $[$.length - 1].ref.current;
|
|
5275
5287
|
s.style.bottom = "0px";
|
|
5276
|
-
const U = c.clientHeight -
|
|
5288
|
+
const U = c.clientHeight - f.offsetTop - f.offsetHeight, le = Math.max(
|
|
5277
5289
|
Ze,
|
|
5278
5290
|
He + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
5279
5291
|
(H ? dt : 0) + U + M
|
|
@@ -5284,12 +5296,12 @@ var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
|
5284
5296
|
s.style.top = "0px";
|
|
5285
5297
|
const le = Math.max(
|
|
5286
5298
|
Me,
|
|
5287
|
-
|
|
5299
|
+
_ + f.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
5288
5300
|
(H ? ut : 0) + He
|
|
5289
|
-
) +
|
|
5290
|
-
s.style.height = le + "px",
|
|
5301
|
+
) + re;
|
|
5302
|
+
s.style.height = le + "px", f.scrollTop = K - Me + f.offsetTop;
|
|
5291
5303
|
}
|
|
5292
|
-
s.style.margin = `${pe}px 0`, s.style.minHeight =
|
|
5304
|
+
s.style.margin = `${pe}px 0`, s.style.minHeight = Q + "px", s.style.maxHeight = W + "px", r == null || r(), requestAnimationFrame(() => g.current = !0);
|
|
5293
5305
|
}
|
|
5294
5306
|
}, [
|
|
5295
5307
|
v,
|
|
@@ -5297,31 +5309,31 @@ var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
|
5297
5309
|
a.valueNode,
|
|
5298
5310
|
s,
|
|
5299
5311
|
c,
|
|
5300
|
-
|
|
5312
|
+
f,
|
|
5301
5313
|
m,
|
|
5302
5314
|
w,
|
|
5303
5315
|
a.dir,
|
|
5304
5316
|
r
|
|
5305
5317
|
]);
|
|
5306
|
-
se(() =>
|
|
5318
|
+
se(() => y(), [y]);
|
|
5307
5319
|
const [C, S] = h.useState();
|
|
5308
5320
|
se(() => {
|
|
5309
5321
|
c && S(window.getComputedStyle(c).zIndex);
|
|
5310
5322
|
}, [c]);
|
|
5311
|
-
const
|
|
5323
|
+
const E = h.useCallback(
|
|
5312
5324
|
(k) => {
|
|
5313
|
-
k &&
|
|
5325
|
+
k && x.current === !0 && (y(), b == null || b(), x.current = !1);
|
|
5314
5326
|
},
|
|
5315
|
-
[
|
|
5327
|
+
[y, b]
|
|
5316
5328
|
);
|
|
5317
|
-
return /* @__PURE__ */
|
|
5329
|
+
return /* @__PURE__ */ T(
|
|
5318
5330
|
Oc,
|
|
5319
5331
|
{
|
|
5320
5332
|
scope: n,
|
|
5321
5333
|
contentWrapper: s,
|
|
5322
5334
|
shouldExpandOnScrollRef: g,
|
|
5323
|
-
onScrollButtonChange:
|
|
5324
|
-
children: /* @__PURE__ */
|
|
5335
|
+
onScrollButtonChange: E,
|
|
5336
|
+
children: /* @__PURE__ */ T(
|
|
5325
5337
|
"div",
|
|
5326
5338
|
{
|
|
5327
5339
|
ref: l,
|
|
@@ -5331,7 +5343,7 @@ var Ic = "SelectItemAlignedPosition", Mo = h.forwardRef((e, t) => {
|
|
|
5331
5343
|
position: "fixed",
|
|
5332
5344
|
zIndex: C
|
|
5333
5345
|
},
|
|
5334
|
-
children: /* @__PURE__ */
|
|
5346
|
+
children: /* @__PURE__ */ T(
|
|
5335
5347
|
X.div,
|
|
5336
5348
|
{
|
|
5337
5349
|
...o,
|
|
@@ -5359,7 +5371,7 @@ var Nc = "SelectPopperPosition", fn = h.forwardRef((e, t) => {
|
|
|
5359
5371
|
collisionPadding: o = pe,
|
|
5360
5372
|
...a
|
|
5361
5373
|
} = e, i = Yt(n);
|
|
5362
|
-
return /* @__PURE__ */
|
|
5374
|
+
return /* @__PURE__ */ T(
|
|
5363
5375
|
El,
|
|
5364
5376
|
{
|
|
5365
5377
|
...i,
|
|
@@ -5383,9 +5395,9 @@ var Nc = "SelectPopperPosition", fn = h.forwardRef((e, t) => {
|
|
|
5383
5395
|
fn.displayName = Nc;
|
|
5384
5396
|
var [Oc, Bn] = ct(Xe, {}), pn = "SelectViewport", Do = h.forwardRef(
|
|
5385
5397
|
(e, t) => {
|
|
5386
|
-
const { __scopeSelect: n, nonce: r, ...o } = e, a = We(pn, n), i = Bn(pn, n), s =
|
|
5398
|
+
const { __scopeSelect: n, nonce: r, ...o } = e, a = We(pn, n), i = Bn(pn, n), s = ne(t, a.onViewportChange), l = h.useRef(0);
|
|
5387
5399
|
return /* @__PURE__ */ Nt(gn, { children: [
|
|
5388
|
-
/* @__PURE__ */
|
|
5400
|
+
/* @__PURE__ */ T(
|
|
5389
5401
|
"style",
|
|
5390
5402
|
{
|
|
5391
5403
|
dangerouslySetInnerHTML: {
|
|
@@ -5394,7 +5406,7 @@ var [Oc, Bn] = ct(Xe, {}), pn = "SelectViewport", Do = h.forwardRef(
|
|
|
5394
5406
|
nonce: r
|
|
5395
5407
|
}
|
|
5396
5408
|
),
|
|
5397
|
-
/* @__PURE__ */
|
|
5409
|
+
/* @__PURE__ */ T(Ut.Slot, { scope: n, children: /* @__PURE__ */ T(
|
|
5398
5410
|
X.div,
|
|
5399
5411
|
{
|
|
5400
5412
|
"data-radix-select-viewport": "",
|
|
@@ -5415,18 +5427,18 @@ var [Oc, Bn] = ct(Xe, {}), pn = "SelectViewport", Do = h.forwardRef(
|
|
|
5415
5427
|
...o.style
|
|
5416
5428
|
},
|
|
5417
5429
|
onScroll: Z(o.onScroll, (c) => {
|
|
5418
|
-
const
|
|
5430
|
+
const d = c.currentTarget, { contentWrapper: p, shouldExpandOnScrollRef: v } = i;
|
|
5419
5431
|
if (v != null && v.current && p) {
|
|
5420
|
-
const g = Math.abs(l.current -
|
|
5432
|
+
const g = Math.abs(l.current - d.scrollTop);
|
|
5421
5433
|
if (g > 0) {
|
|
5422
|
-
const
|
|
5423
|
-
if (w <
|
|
5424
|
-
const
|
|
5425
|
-
p.style.height =
|
|
5434
|
+
const x = window.innerHeight - pe * 2, f = parseFloat(p.style.minHeight), m = parseFloat(p.style.height), w = Math.max(f, m);
|
|
5435
|
+
if (w < x) {
|
|
5436
|
+
const b = w + g, y = Math.min(x, b), C = b - y;
|
|
5437
|
+
p.style.height = y + "px", p.style.bottom === "0px" && (d.scrollTop = C > 0 ? C : 0, p.style.justifyContent = "flex-end");
|
|
5426
5438
|
}
|
|
5427
5439
|
}
|
|
5428
5440
|
}
|
|
5429
|
-
l.current =
|
|
5441
|
+
l.current = d.scrollTop;
|
|
5430
5442
|
})
|
|
5431
5443
|
}
|
|
5432
5444
|
) })
|
|
@@ -5437,14 +5449,14 @@ Do.displayName = pn;
|
|
|
5437
5449
|
var Fo = "SelectGroup", [Lc, Mc] = ct(Fo), Dc = h.forwardRef(
|
|
5438
5450
|
(e, t) => {
|
|
5439
5451
|
const { __scopeSelect: n, ...r } = e, o = _n();
|
|
5440
|
-
return /* @__PURE__ */
|
|
5452
|
+
return /* @__PURE__ */ T(Lc, { scope: n, id: o, children: /* @__PURE__ */ T(X.div, { role: "group", "aria-labelledby": o, ...r, ref: t }) });
|
|
5441
5453
|
}
|
|
5442
5454
|
);
|
|
5443
5455
|
Dc.displayName = Fo;
|
|
5444
5456
|
var Bo = "SelectLabel", Fc = h.forwardRef(
|
|
5445
5457
|
(e, t) => {
|
|
5446
5458
|
const { __scopeSelect: n, ...r } = e, o = Mc(Bo, n);
|
|
5447
|
-
return /* @__PURE__ */
|
|
5459
|
+
return /* @__PURE__ */ T(X.div, { id: o.id, ...r, ref: t });
|
|
5448
5460
|
}
|
|
5449
5461
|
);
|
|
5450
5462
|
Fc.displayName = Bo;
|
|
@@ -5456,42 +5468,42 @@ var Ft = "SelectItem", [Bc, zo] = ct(Ft), Vo = h.forwardRef(
|
|
|
5456
5468
|
disabled: o = !1,
|
|
5457
5469
|
textValue: a,
|
|
5458
5470
|
...i
|
|
5459
|
-
} = e, s = $e(Ft, n), l = We(Ft, n), c = s.value === r, [
|
|
5471
|
+
} = e, s = $e(Ft, n), l = We(Ft, n), c = s.value === r, [d, p] = h.useState(a ?? ""), [v, g] = h.useState(!1), x = ne(
|
|
5460
5472
|
t,
|
|
5461
|
-
(
|
|
5462
|
-
var
|
|
5463
|
-
return (
|
|
5473
|
+
(b) => {
|
|
5474
|
+
var y;
|
|
5475
|
+
return (y = l.itemRefCallback) == null ? void 0 : y.call(l, b, r, o);
|
|
5464
5476
|
}
|
|
5465
|
-
),
|
|
5477
|
+
), f = _n(), m = h.useRef("touch"), w = () => {
|
|
5466
5478
|
o || (s.onValueChange(r), s.onOpenChange(!1));
|
|
5467
5479
|
};
|
|
5468
5480
|
if (r === "")
|
|
5469
5481
|
throw new Error(
|
|
5470
5482
|
"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
5483
|
);
|
|
5472
|
-
return /* @__PURE__ */
|
|
5484
|
+
return /* @__PURE__ */ T(
|
|
5473
5485
|
Bc,
|
|
5474
5486
|
{
|
|
5475
5487
|
scope: n,
|
|
5476
5488
|
value: r,
|
|
5477
5489
|
disabled: o,
|
|
5478
|
-
textId:
|
|
5490
|
+
textId: f,
|
|
5479
5491
|
isSelected: c,
|
|
5480
|
-
onItemTextChange: h.useCallback((
|
|
5481
|
-
p((
|
|
5492
|
+
onItemTextChange: h.useCallback((b) => {
|
|
5493
|
+
p((y) => y || ((b == null ? void 0 : b.textContent) ?? "").trim());
|
|
5482
5494
|
}, []),
|
|
5483
|
-
children: /* @__PURE__ */
|
|
5495
|
+
children: /* @__PURE__ */ T(
|
|
5484
5496
|
Ut.ItemSlot,
|
|
5485
5497
|
{
|
|
5486
5498
|
scope: n,
|
|
5487
5499
|
value: r,
|
|
5488
5500
|
disabled: o,
|
|
5489
|
-
textValue:
|
|
5490
|
-
children: /* @__PURE__ */
|
|
5501
|
+
textValue: d,
|
|
5502
|
+
children: /* @__PURE__ */ T(
|
|
5491
5503
|
X.div,
|
|
5492
5504
|
{
|
|
5493
5505
|
role: "option",
|
|
5494
|
-
"aria-labelledby":
|
|
5506
|
+
"aria-labelledby": f,
|
|
5495
5507
|
"data-highlighted": v ? "" : void 0,
|
|
5496
5508
|
"aria-selected": c && v,
|
|
5497
5509
|
"data-state": c ? "checked" : "unchecked",
|
|
@@ -5499,7 +5511,7 @@ var Ft = "SelectItem", [Bc, zo] = ct(Ft), Vo = h.forwardRef(
|
|
|
5499
5511
|
"data-disabled": o ? "" : void 0,
|
|
5500
5512
|
tabIndex: o ? void 0 : -1,
|
|
5501
5513
|
...i,
|
|
5502
|
-
ref:
|
|
5514
|
+
ref: x,
|
|
5503
5515
|
onFocus: Z(i.onFocus, () => g(!0)),
|
|
5504
5516
|
onBlur: Z(i.onBlur, () => g(!1)),
|
|
5505
5517
|
onClick: Z(i.onClick, () => {
|
|
@@ -5508,20 +5520,20 @@ var Ft = "SelectItem", [Bc, zo] = ct(Ft), Vo = h.forwardRef(
|
|
|
5508
5520
|
onPointerUp: Z(i.onPointerUp, () => {
|
|
5509
5521
|
m.current === "mouse" && w();
|
|
5510
5522
|
}),
|
|
5511
|
-
onPointerDown: Z(i.onPointerDown, (
|
|
5512
|
-
m.current =
|
|
5523
|
+
onPointerDown: Z(i.onPointerDown, (b) => {
|
|
5524
|
+
m.current = b.pointerType;
|
|
5513
5525
|
}),
|
|
5514
|
-
onPointerMove: Z(i.onPointerMove, (
|
|
5515
|
-
var
|
|
5516
|
-
m.current =
|
|
5526
|
+
onPointerMove: Z(i.onPointerMove, (b) => {
|
|
5527
|
+
var y;
|
|
5528
|
+
m.current = b.pointerType, o ? (y = l.onItemLeave) == null || y.call(l) : m.current === "mouse" && b.currentTarget.focus({ preventScroll: !0 });
|
|
5517
5529
|
}),
|
|
5518
|
-
onPointerLeave: Z(i.onPointerLeave, (
|
|
5519
|
-
var
|
|
5520
|
-
|
|
5530
|
+
onPointerLeave: Z(i.onPointerLeave, (b) => {
|
|
5531
|
+
var y;
|
|
5532
|
+
b.currentTarget === document.activeElement && ((y = l.onItemLeave) == null || y.call(l));
|
|
5521
5533
|
}),
|
|
5522
|
-
onKeyDown: Z(i.onKeyDown, (
|
|
5534
|
+
onKeyDown: Z(i.onKeyDown, (b) => {
|
|
5523
5535
|
var C;
|
|
5524
|
-
((C = l.searchRef) == null ? void 0 : C.current) !== "" &&
|
|
5536
|
+
((C = l.searchRef) == null ? void 0 : C.current) !== "" && b.key === " " || (yc.includes(b.key) && w(), b.key === " " && b.preventDefault());
|
|
5525
5537
|
})
|
|
5526
5538
|
}
|
|
5527
5539
|
)
|
|
@@ -5534,20 +5546,20 @@ var Ft = "SelectItem", [Bc, zo] = ct(Ft), Vo = h.forwardRef(
|
|
|
5534
5546
|
Vo.displayName = Ft;
|
|
5535
5547
|
var mt = "SelectItemText", $o = h.forwardRef(
|
|
5536
5548
|
(e, t) => {
|
|
5537
|
-
const { __scopeSelect: n, className: r, style: o, ...a } = e, i = $e(mt, n), s = We(mt, n), l = zo(mt, n), c = Ec(mt, n), [
|
|
5549
|
+
const { __scopeSelect: n, className: r, style: o, ...a } = e, i = $e(mt, n), s = We(mt, n), l = zo(mt, n), c = Ec(mt, n), [d, p] = h.useState(null), v = ne(
|
|
5538
5550
|
t,
|
|
5539
5551
|
(w) => p(w),
|
|
5540
5552
|
l.onItemTextChange,
|
|
5541
5553
|
(w) => {
|
|
5542
|
-
var
|
|
5543
|
-
return (
|
|
5554
|
+
var b;
|
|
5555
|
+
return (b = s.itemTextRefCallback) == null ? void 0 : b.call(s, w, l.value, l.disabled);
|
|
5544
5556
|
}
|
|
5545
|
-
), g =
|
|
5546
|
-
() => /* @__PURE__ */
|
|
5557
|
+
), g = d == null ? void 0 : d.textContent, x = h.useMemo(
|
|
5558
|
+
() => /* @__PURE__ */ T("option", { value: l.value, disabled: l.disabled, children: g }, l.value),
|
|
5547
5559
|
[l.disabled, l.value, g]
|
|
5548
|
-
), { onNativeOptionAdd:
|
|
5549
|
-
return se(() => (
|
|
5550
|
-
/* @__PURE__ */
|
|
5560
|
+
), { onNativeOptionAdd: f, onNativeOptionRemove: m } = c;
|
|
5561
|
+
return se(() => (f(x), () => m(x)), [f, m, x]), /* @__PURE__ */ Nt(gn, { children: [
|
|
5562
|
+
/* @__PURE__ */ T(X.span, { id: l.textId, ...a, ref: v }),
|
|
5551
5563
|
l.isSelected && i.valueNode && !i.valueNodeHasChildren ? h.createPortal(a.children, i.valueNode) : null
|
|
5552
5564
|
] });
|
|
5553
5565
|
}
|
|
@@ -5556,12 +5568,12 @@ $o.displayName = mt;
|
|
|
5556
5568
|
var Wo = "SelectItemIndicator", Ho = h.forwardRef(
|
|
5557
5569
|
(e, t) => {
|
|
5558
5570
|
const { __scopeSelect: n, ...r } = e;
|
|
5559
|
-
return zo(Wo, n).isSelected ? /* @__PURE__ */
|
|
5571
|
+
return zo(Wo, n).isSelected ? /* @__PURE__ */ T(X.span, { "aria-hidden": !0, ...r, ref: t }) : null;
|
|
5560
5572
|
}
|
|
5561
5573
|
);
|
|
5562
5574
|
Ho.displayName = Wo;
|
|
5563
5575
|
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 =
|
|
5576
|
+
const n = We(hn, e.__scopeSelect), r = Bn(hn, e.__scopeSelect), [o, a] = h.useState(!1), i = ne(t, r.onScrollButtonChange);
|
|
5565
5577
|
return se(() => {
|
|
5566
5578
|
if (n.viewport && n.isPositioned) {
|
|
5567
5579
|
let s = function() {
|
|
@@ -5571,7 +5583,7 @@ var hn = "SelectScrollUpButton", Uo = h.forwardRef((e, t) => {
|
|
|
5571
5583
|
const l = n.viewport;
|
|
5572
5584
|
return s(), l.addEventListener("scroll", s), () => l.removeEventListener("scroll", s);
|
|
5573
5585
|
}
|
|
5574
|
-
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */
|
|
5586
|
+
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ T(
|
|
5575
5587
|
Yo,
|
|
5576
5588
|
{
|
|
5577
5589
|
...e,
|
|
@@ -5585,17 +5597,17 @@ var hn = "SelectScrollUpButton", Uo = h.forwardRef((e, t) => {
|
|
|
5585
5597
|
});
|
|
5586
5598
|
Uo.displayName = hn;
|
|
5587
5599
|
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 =
|
|
5600
|
+
const n = We(vn, e.__scopeSelect), r = Bn(vn, e.__scopeSelect), [o, a] = h.useState(!1), i = ne(t, r.onScrollButtonChange);
|
|
5589
5601
|
return se(() => {
|
|
5590
5602
|
if (n.viewport && n.isPositioned) {
|
|
5591
5603
|
let s = function() {
|
|
5592
|
-
const c = l.scrollHeight - l.clientHeight,
|
|
5593
|
-
a(
|
|
5604
|
+
const c = l.scrollHeight - l.clientHeight, d = Math.ceil(l.scrollTop) < c;
|
|
5605
|
+
a(d);
|
|
5594
5606
|
};
|
|
5595
5607
|
const l = n.viewport;
|
|
5596
5608
|
return s(), l.addEventListener("scroll", s), () => l.removeEventListener("scroll", s);
|
|
5597
5609
|
}
|
|
5598
|
-
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */
|
|
5610
|
+
}, [n.viewport, n.isPositioned]), o ? /* @__PURE__ */ T(
|
|
5599
5611
|
Yo,
|
|
5600
5612
|
{
|
|
5601
5613
|
...e,
|
|
@@ -5613,10 +5625,10 @@ var Yo = h.forwardRef((e, t) => {
|
|
|
5613
5625
|
i.current !== null && (window.clearInterval(i.current), i.current = null);
|
|
5614
5626
|
}, []);
|
|
5615
5627
|
return h.useEffect(() => () => l(), [l]), se(() => {
|
|
5616
|
-
var
|
|
5628
|
+
var d;
|
|
5617
5629
|
const c = s().find((p) => p.ref.current === document.activeElement);
|
|
5618
|
-
(
|
|
5619
|
-
}, [s]), /* @__PURE__ */
|
|
5630
|
+
(d = c == null ? void 0 : c.ref.current) == null || d.scrollIntoView({ block: "nearest" });
|
|
5631
|
+
}, [s]), /* @__PURE__ */ T(
|
|
5620
5632
|
X.div,
|
|
5621
5633
|
{
|
|
5622
5634
|
"aria-hidden": !0,
|
|
@@ -5638,32 +5650,32 @@ var Yo = h.forwardRef((e, t) => {
|
|
|
5638
5650
|
}), zc = "SelectSeparator", Vc = h.forwardRef(
|
|
5639
5651
|
(e, t) => {
|
|
5640
5652
|
const { __scopeSelect: n, ...r } = e;
|
|
5641
|
-
return /* @__PURE__ */
|
|
5653
|
+
return /* @__PURE__ */ T(X.div, { "aria-hidden": !0, ...r, ref: t });
|
|
5642
5654
|
}
|
|
5643
5655
|
);
|
|
5644
5656
|
Vc.displayName = zc;
|
|
5645
5657
|
var mn = "SelectArrow", $c = h.forwardRef(
|
|
5646
5658
|
(e, t) => {
|
|
5647
5659
|
const { __scopeSelect: n, ...r } = e, o = Yt(n), a = $e(mn, n), i = We(mn, n);
|
|
5648
|
-
return a.open && i.position === "popper" ? /* @__PURE__ */
|
|
5660
|
+
return a.open && i.position === "popper" ? /* @__PURE__ */ T(Tl, { ...o, ...r, ref: t }) : null;
|
|
5649
5661
|
}
|
|
5650
5662
|
);
|
|
5651
5663
|
$c.displayName = mn;
|
|
5652
5664
|
var Wc = "SelectBubbleInput", Ko = h.forwardRef(
|
|
5653
5665
|
({ __scopeSelect: e, value: t, ...n }, r) => {
|
|
5654
|
-
const o = h.useRef(null), a =
|
|
5666
|
+
const o = h.useRef(null), a = ne(r, o), i = Il(t);
|
|
5655
5667
|
return h.useEffect(() => {
|
|
5656
5668
|
const s = o.current;
|
|
5657
5669
|
if (!s) return;
|
|
5658
|
-
const l = window.HTMLSelectElement.prototype,
|
|
5670
|
+
const l = window.HTMLSelectElement.prototype, d = Object.getOwnPropertyDescriptor(
|
|
5659
5671
|
l,
|
|
5660
5672
|
"value"
|
|
5661
5673
|
).set;
|
|
5662
|
-
if (i !== t &&
|
|
5674
|
+
if (i !== t && d) {
|
|
5663
5675
|
const p = new Event("change", { bubbles: !0 });
|
|
5664
|
-
|
|
5676
|
+
d.call(s, t), s.dispatchEvent(p);
|
|
5665
5677
|
}
|
|
5666
|
-
}, [i, t]), /* @__PURE__ */
|
|
5678
|
+
}, [i, t]), /* @__PURE__ */ T(
|
|
5667
5679
|
X.select,
|
|
5668
5680
|
{
|
|
5669
5681
|
...n,
|
|
@@ -5731,7 +5743,7 @@ function zn({
|
|
|
5731
5743
|
}
|
|
5732
5744
|
function Jo({ children: e, ...t }) {
|
|
5733
5745
|
const [n, r] = Ie(!1), { language: o, setLanguage: a, options: i } = at(), s = za();
|
|
5734
|
-
return /* @__PURE__ */
|
|
5746
|
+
return /* @__PURE__ */ A(
|
|
5735
5747
|
Uc,
|
|
5736
5748
|
{
|
|
5737
5749
|
open: n,
|
|
@@ -5744,7 +5756,7 @@ function Jo({ children: e, ...t }) {
|
|
|
5744
5756
|
},
|
|
5745
5757
|
children: [
|
|
5746
5758
|
e,
|
|
5747
|
-
/* @__PURE__ */ u(jc, { container: s, children: /* @__PURE__ */
|
|
5759
|
+
/* @__PURE__ */ u(jc, { container: s, children: /* @__PURE__ */ A(
|
|
5748
5760
|
Yc,
|
|
5749
5761
|
{
|
|
5750
5762
|
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 +5770,7 @@ function Jo({ children: e, ...t }) {
|
|
|
5758
5770
|
...t,
|
|
5759
5771
|
children: [
|
|
5760
5772
|
/* @__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__ */
|
|
5773
|
+
/* @__PURE__ */ u(Kc, { className: "p-1.5", children: i.value.map((l) => /* @__PURE__ */ A(
|
|
5762
5774
|
Xc,
|
|
5763
5775
|
{
|
|
5764
5776
|
value: l.languageCode,
|
|
@@ -5784,7 +5796,7 @@ function eu({
|
|
|
5784
5796
|
...t
|
|
5785
5797
|
}) {
|
|
5786
5798
|
const n = G(), { language: r, showPicker: o } = at();
|
|
5787
|
-
return o.value ? /* @__PURE__ */ u(Jo, { align: "center", children: /* @__PURE__ */
|
|
5799
|
+
return o.value ? /* @__PURE__ */ u(Jo, { align: "center", children: /* @__PURE__ */ A(
|
|
5788
5800
|
qo,
|
|
5789
5801
|
{
|
|
5790
5802
|
className: V(
|
|
@@ -5809,7 +5821,7 @@ function tu({
|
|
|
5809
5821
|
showLanguageSelector: o
|
|
5810
5822
|
}) {
|
|
5811
5823
|
const a = G();
|
|
5812
|
-
return /* @__PURE__ */
|
|
5824
|
+
return /* @__PURE__ */ A(
|
|
5813
5825
|
"div",
|
|
5814
5826
|
{
|
|
5815
5827
|
className: V(
|
|
@@ -5817,7 +5829,7 @@ function tu({
|
|
|
5817
5829
|
r && "shadow-header"
|
|
5818
5830
|
),
|
|
5819
5831
|
children: [
|
|
5820
|
-
/* @__PURE__ */
|
|
5832
|
+
/* @__PURE__ */ A("div", { className: "flex gap-2 p-4 items-start", children: [
|
|
5821
5833
|
e ? /* @__PURE__ */ u(
|
|
5822
5834
|
ve,
|
|
5823
5835
|
{
|
|
@@ -5828,9 +5840,9 @@ function tu({
|
|
|
5828
5840
|
children: /* @__PURE__ */ u(Se, { name: "chevron-up", className: "-rotate-90", size: "sm" })
|
|
5829
5841
|
}
|
|
5830
5842
|
) : /* @__PURE__ */ u("div", { className: "relative w-8 h-8" }),
|
|
5831
|
-
/* @__PURE__ */ u(
|
|
5843
|
+
/* @__PURE__ */ u(ie, { active: n, children: /* @__PURE__ */ u(Cn, { className: "transition-opacity data-hidden:opacity-0" }) })
|
|
5832
5844
|
] }),
|
|
5833
|
-
/* @__PURE__ */ u(
|
|
5845
|
+
/* @__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
5846
|
]
|
|
5835
5847
|
}
|
|
5836
5848
|
);
|
|
@@ -5844,22 +5856,22 @@ const nu = {
|
|
|
5844
5856
|
bottom: "origin-bottom"
|
|
5845
5857
|
};
|
|
5846
5858
|
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 } =
|
|
5859
|
+
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(), g = Y(() => {
|
|
5848
5860
|
var w;
|
|
5849
|
-
return n.value || r.value ? !
|
|
5861
|
+
return n.value || r.value ? !d.value || !n.value ? l.value : [
|
|
5850
5862
|
{
|
|
5851
5863
|
type: "message",
|
|
5852
5864
|
role: "ai",
|
|
5853
|
-
message:
|
|
5865
|
+
message: d.value,
|
|
5854
5866
|
isText: !0,
|
|
5855
5867
|
conversationIndex: ((w = l.value[0]) == null ? void 0 : w.conversationIndex) ?? c.peek()
|
|
5856
5868
|
},
|
|
5857
5869
|
...l.value
|
|
5858
5870
|
] : o.value.transcript_enabled ? l.value : l.value.filter(
|
|
5859
|
-
(
|
|
5871
|
+
(b) => b.type !== "message" || b.isText
|
|
5860
5872
|
);
|
|
5861
|
-
}),
|
|
5862
|
-
return /* @__PURE__ */ u(
|
|
5873
|
+
}), x = g.value.length > 0 || !i.value && o.value.transcript_enabled, f = J(!0), m = p.value !== "feedback";
|
|
5874
|
+
return /* @__PURE__ */ u(ie, { initial: !1, active: e, children: /* @__PURE__ */ A(
|
|
5863
5875
|
"div",
|
|
5864
5876
|
{
|
|
5865
5877
|
className: V(
|
|
@@ -5874,45 +5886,45 @@ function hr({ open: e }) {
|
|
|
5874
5886
|
{
|
|
5875
5887
|
showBackButton: v.showHeaderBack,
|
|
5876
5888
|
onBackClick: v.onHeaderBack,
|
|
5877
|
-
showStatusLabel:
|
|
5878
|
-
showShadow:
|
|
5879
|
-
showLanguageSelector: p.value !== "feedback" && (!
|
|
5889
|
+
showStatusLabel: x && !i.value,
|
|
5890
|
+
showShadow: x,
|
|
5891
|
+
showLanguageSelector: p.value !== "feedback" && (!x || i.value)
|
|
5880
5892
|
}
|
|
5881
5893
|
),
|
|
5882
|
-
/* @__PURE__ */ u(
|
|
5894
|
+
/* @__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
5895
|
/* @__PURE__ */ u(
|
|
5884
5896
|
Ri,
|
|
5885
5897
|
{
|
|
5886
5898
|
transcript: g,
|
|
5887
|
-
scrollPinned:
|
|
5899
|
+
scrollPinned: f
|
|
5888
5900
|
}
|
|
5889
5901
|
),
|
|
5890
5902
|
/* @__PURE__ */ u(
|
|
5891
5903
|
Ii,
|
|
5892
5904
|
{
|
|
5893
|
-
scrollPinned:
|
|
5894
|
-
showTranscript:
|
|
5905
|
+
scrollPinned: f,
|
|
5906
|
+
showTranscript: x
|
|
5895
5907
|
}
|
|
5896
5908
|
)
|
|
5897
5909
|
] }) }),
|
|
5898
|
-
/* @__PURE__ */ u(
|
|
5910
|
+
/* @__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
5911
|
/* @__PURE__ */ u(Ni, {}),
|
|
5900
5912
|
/* @__PURE__ */ u(Oi, {})
|
|
5901
5913
|
] }) }),
|
|
5902
|
-
/* @__PURE__ */ u(
|
|
5914
|
+
/* @__PURE__ */ u(ie, { active: m, children: /* @__PURE__ */ A(
|
|
5903
5915
|
"div",
|
|
5904
5916
|
{
|
|
5905
5917
|
className: V(
|
|
5906
5918
|
"absolute origin-top-left transition-[transform,left,top,opacity,scale] duration-200 z-1",
|
|
5907
5919
|
"data-hidden:opacity-0",
|
|
5908
|
-
|
|
5920
|
+
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
5921
|
),
|
|
5910
5922
|
children: [
|
|
5911
5923
|
/* @__PURE__ */ u(it, { size: "lg" }),
|
|
5912
5924
|
/* @__PURE__ */ u(
|
|
5913
|
-
|
|
5925
|
+
ie,
|
|
5914
5926
|
{
|
|
5915
|
-
active: !
|
|
5927
|
+
active: !x && i.value && !n.value,
|
|
5916
5928
|
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
5929
|
ve,
|
|
5918
5930
|
{
|
|
@@ -5924,7 +5936,7 @@ function hr({ open: e }) {
|
|
|
5924
5936
|
) })
|
|
5925
5937
|
}
|
|
5926
5938
|
),
|
|
5927
|
-
/* @__PURE__ */ u(
|
|
5939
|
+
/* @__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
5940
|
]
|
|
5929
5941
|
}
|
|
5930
5942
|
) })
|
|
@@ -5933,10 +5945,10 @@ function hr({ open: e }) {
|
|
|
5933
5945
|
) });
|
|
5934
5946
|
}
|
|
5935
5947
|
function ea({ expanded: e }) {
|
|
5936
|
-
const t = zt(), n = q().value.variant, { isDisconnected: r } =
|
|
5948
|
+
const t = zt(), n = q().value.variant, { isDisconnected: r } = oe(), o = G(), a = te(() => {
|
|
5937
5949
|
e.value = !e.value;
|
|
5938
5950
|
}, [e]);
|
|
5939
|
-
return /* @__PURE__ */
|
|
5951
|
+
return /* @__PURE__ */ A(rt, { children: [
|
|
5940
5952
|
n === "full" && /* @__PURE__ */ u(
|
|
5941
5953
|
Ne,
|
|
5942
5954
|
{
|
|
@@ -5982,8 +5994,8 @@ function ru({
|
|
|
5982
5994
|
className: t,
|
|
5983
5995
|
...n
|
|
5984
5996
|
}) {
|
|
5985
|
-
const { isDisconnected: r } =
|
|
5986
|
-
return /* @__PURE__ */
|
|
5997
|
+
const { isDisconnected: r } = oe(), o = G();
|
|
5998
|
+
return /* @__PURE__ */ A(
|
|
5987
5999
|
"div",
|
|
5988
6000
|
{
|
|
5989
6001
|
className: V(
|
|
@@ -5998,7 +6010,7 @@ function ru({
|
|
|
5998
6010
|
{
|
|
5999
6011
|
visible: !e.value && r.value,
|
|
6000
6012
|
className: "p-1 !min-w-60",
|
|
6001
|
-
children: /* @__PURE__ */
|
|
6013
|
+
children: /* @__PURE__ */ A("div", { className: "flex items-center gap-2", children: [
|
|
6002
6014
|
/* @__PURE__ */ u(it, {}),
|
|
6003
6015
|
/* @__PURE__ */ u("div", { className: "text-sm max-w-64", children: o.main_label })
|
|
6004
6016
|
] })
|
|
@@ -6014,7 +6026,7 @@ function ou({
|
|
|
6014
6026
|
className: t,
|
|
6015
6027
|
...n
|
|
6016
6028
|
}) {
|
|
6017
|
-
return /* @__PURE__ */
|
|
6029
|
+
return /* @__PURE__ */ A(
|
|
6018
6030
|
"div",
|
|
6019
6031
|
{
|
|
6020
6032
|
className: V("rounded-compact-sheet flex items-center p-2", t),
|
|
@@ -6028,7 +6040,7 @@ function ou({
|
|
|
6028
6040
|
}
|
|
6029
6041
|
function au({ visible: e, className: t, ...n }) {
|
|
6030
6042
|
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__ */
|
|
6043
|
+
return a.value ? /* @__PURE__ */ u(Ne, { visible: e, className: "p-1", children: /* @__PURE__ */ u(Jo, { children: /* @__PURE__ */ A(
|
|
6032
6044
|
qo,
|
|
6033
6045
|
{
|
|
6034
6046
|
className: V(
|
|
@@ -6045,8 +6057,8 @@ function au({ visible: e, className: t, ...n }) {
|
|
|
6045
6057
|
) }) }) : null;
|
|
6046
6058
|
}
|
|
6047
6059
|
function ta() {
|
|
6048
|
-
const e = q().value.variant, { isDisconnected: t, status: n } =
|
|
6049
|
-
return /* @__PURE__ */
|
|
6060
|
+
const e = q().value.variant, { isDisconnected: t, status: n } = oe();
|
|
6061
|
+
return /* @__PURE__ */ A(rt, { children: [
|
|
6050
6062
|
/* @__PURE__ */ u(
|
|
6051
6063
|
Tn,
|
|
6052
6064
|
{
|
|
@@ -6064,11 +6076,11 @@ function iu({
|
|
|
6064
6076
|
className: e,
|
|
6065
6077
|
...t
|
|
6066
6078
|
}) {
|
|
6067
|
-
const { isDisconnected: n } =
|
|
6068
|
-
return /* @__PURE__ */
|
|
6069
|
-
/* @__PURE__ */
|
|
6079
|
+
const { isDisconnected: n } = oe(), r = G();
|
|
6080
|
+
return /* @__PURE__ */ A("div", { className: V("flex flex-col p-2 rounded-sheet", e), ...t, children: [
|
|
6081
|
+
/* @__PURE__ */ A("div", { className: "flex items-center p-1 gap-2 min-w-60", children: [
|
|
6070
6082
|
/* @__PURE__ */ u(it, {}),
|
|
6071
|
-
/* @__PURE__ */
|
|
6083
|
+
/* @__PURE__ */ A("div", { className: "relative text-sm max-w-64", children: [
|
|
6072
6084
|
/* @__PURE__ */ u(
|
|
6073
6085
|
"span",
|
|
6074
6086
|
{
|
|
@@ -6079,7 +6091,7 @@ function iu({
|
|
|
6079
6091
|
children: r.main_label
|
|
6080
6092
|
}
|
|
6081
6093
|
),
|
|
6082
|
-
/* @__PURE__ */ u(
|
|
6094
|
+
/* @__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
6095
|
] })
|
|
6084
6096
|
] }),
|
|
6085
6097
|
/* @__PURE__ */ u("div", { className: "flex items-center", children: /* @__PURE__ */ u(ta, {}) })
|
|
@@ -6089,7 +6101,7 @@ function su({
|
|
|
6089
6101
|
className: e,
|
|
6090
6102
|
...t
|
|
6091
6103
|
}) {
|
|
6092
|
-
return /* @__PURE__ */
|
|
6104
|
+
return /* @__PURE__ */ A(
|
|
6093
6105
|
"div",
|
|
6094
6106
|
{
|
|
6095
6107
|
className: V("rounded-compact-sheet flex items-center p-2", e),
|
|
@@ -6102,7 +6114,7 @@ function su({
|
|
|
6102
6114
|
);
|
|
6103
6115
|
}
|
|
6104
6116
|
function lu({ expandable: e, expanded: t }) {
|
|
6105
|
-
const n = q().value.variant, r = Bt(), { isDisconnected: o } =
|
|
6117
|
+
const n = q().value.variant, r = Bt(), { isDisconnected: o } = oe(), a = te(async () => {
|
|
6106
6118
|
await r.requestTerms(), t.value = !t.peek();
|
|
6107
6119
|
}, [t]), i = n === "full";
|
|
6108
6120
|
return e ? /* @__PURE__ */ u(
|
|
@@ -6119,7 +6131,7 @@ function lu({ expandable: e, expanded: t }) {
|
|
|
6119
6131
|
}
|
|
6120
6132
|
function cu() {
|
|
6121
6133
|
const e = G(), t = q(), { dismissTerms: n, acceptTerms: r } = Bt();
|
|
6122
|
-
return /* @__PURE__ */
|
|
6134
|
+
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
6135
|
/* @__PURE__ */ u(
|
|
6124
6136
|
"div",
|
|
6125
6137
|
{
|
|
@@ -6127,7 +6139,7 @@ function cu() {
|
|
|
6127
6139
|
dangerouslySetInnerHTML: { __html: t.value.terms_html ?? "" }
|
|
6128
6140
|
}
|
|
6129
6141
|
),
|
|
6130
|
-
/* @__PURE__ */
|
|
6142
|
+
/* @__PURE__ */ A("div", { className: "flex justify-end gap-2", children: [
|
|
6131
6143
|
/* @__PURE__ */ u(ve, { onClick: n, children: e.dismiss_terms }),
|
|
6132
6144
|
/* @__PURE__ */ u(ve, { onClick: r, variant: "primary", children: e.accept_terms })
|
|
6133
6145
|
] })
|
|
@@ -6145,30 +6157,30 @@ function uu({ copyText: e, children: t }) {
|
|
|
6145
6157
|
};
|
|
6146
6158
|
}
|
|
6147
6159
|
}, [r]);
|
|
6148
|
-
const a =
|
|
6160
|
+
const a = te(() => {
|
|
6149
6161
|
const i = Ir(e);
|
|
6150
6162
|
i && (navigator.clipboard.writeText(i), o(!0));
|
|
6151
6163
|
}, []);
|
|
6152
6164
|
return /* @__PURE__ */ u(ve, { onClick: a, children: r ? n.copied : t });
|
|
6153
6165
|
}
|
|
6154
6166
|
function du({ sawError: e }) {
|
|
6155
|
-
const t = G(), { error: n, lastId: r } =
|
|
6167
|
+
const t = G(), { error: n, lastId: r } = oe(), o = te(() => {
|
|
6156
6168
|
e.value = !0;
|
|
6157
6169
|
}, []);
|
|
6158
|
-
return /* @__PURE__ */
|
|
6159
|
-
/* @__PURE__ */
|
|
6170
|
+
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: [
|
|
6171
|
+
/* @__PURE__ */ A("div", { className: "p-2 pt-1", children: [
|
|
6160
6172
|
/* @__PURE__ */ u("h1", { className: "text-md font-medium pb-1", children: t.error_occurred }),
|
|
6161
6173
|
n.value,
|
|
6162
|
-
r.value && /* @__PURE__ */
|
|
6174
|
+
r.value && /* @__PURE__ */ A(rt, { children: [
|
|
6163
6175
|
/* @__PURE__ */ u("br", {}),
|
|
6164
|
-
/* @__PURE__ */
|
|
6176
|
+
/* @__PURE__ */ A("span", { className: "text-base-subtle", children: [
|
|
6165
6177
|
t.conversation_id,
|
|
6166
6178
|
": ",
|
|
6167
6179
|
r.value
|
|
6168
6180
|
] })
|
|
6169
6181
|
] })
|
|
6170
6182
|
] }),
|
|
6171
|
-
/* @__PURE__ */
|
|
6183
|
+
/* @__PURE__ */ A("div", { className: "flex justify-end gap-2", children: [
|
|
6172
6184
|
/* @__PURE__ */ u(uu, { copyText: r, children: t.copy_id }),
|
|
6173
6185
|
/* @__PURE__ */ u(ve, { variant: "primary", onClick: o, children: "Close" })
|
|
6174
6186
|
] })
|
|
@@ -6176,7 +6188,7 @@ function du({ sawError: e }) {
|
|
|
6176
6188
|
}
|
|
6177
6189
|
function fu() {
|
|
6178
6190
|
const e = q();
|
|
6179
|
-
return e.value.disable_banner ? null : /* @__PURE__ */
|
|
6191
|
+
return e.value.disable_banner ? null : /* @__PURE__ */ A(
|
|
6180
6192
|
"p",
|
|
6181
6193
|
{
|
|
6182
6194
|
className: V(
|
|
@@ -6216,7 +6228,7 @@ const Je = {
|
|
|
6216
6228
|
}, _t = {
|
|
6217
6229
|
display: "none"
|
|
6218
6230
|
}, hu = vr(function() {
|
|
6219
|
-
const t = q(), n =
|
|
6231
|
+
const t = q(), n = J(t.peek().default_expanded), r = J(!1), { error: o } = oe(), a = Bt(), i = Y(
|
|
6220
6232
|
() => t.value.transcript_enabled || t.value.text_input_enabled
|
|
6221
6233
|
), s = Y(
|
|
6222
6234
|
() => V(
|
|
@@ -6228,26 +6240,26 @@ const Je = {
|
|
|
6228
6240
|
o.value && (i.value ? (r.value = !0, n.value = !0) : r.value = !1);
|
|
6229
6241
|
}), Ee(() => {
|
|
6230
6242
|
const v = (g) => {
|
|
6231
|
-
var
|
|
6232
|
-
((
|
|
6243
|
+
var x, f, m;
|
|
6244
|
+
((x = g.detail) == null ? void 0 : x.action) === "expand" ? n.value = !0 : ((f = g.detail) == null ? void 0 : f.action) === "collapse" ? n.value = !1 : ((m = g.detail) == null ? void 0 : m.action) === "toggle" && (n.value = !n.value);
|
|
6233
6245
|
};
|
|
6234
6246
|
return document.addEventListener("elevenlabs-agent:expand", v), () => {
|
|
6235
6247
|
document.removeEventListener("elevenlabs-agent:expand", v);
|
|
6236
6248
|
};
|
|
6237
6249
|
});
|
|
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(
|
|
6250
|
+
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");
|
|
6251
|
+
return /* @__PURE__ */ A(rt, { children: [
|
|
6252
|
+
/* @__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
6253
|
i.value && /* @__PURE__ */ u(hr, { open: n }),
|
|
6242
6254
|
/* @__PURE__ */ u(lu, { expandable: i.value, expanded: n })
|
|
6243
6255
|
] }) }) }),
|
|
6244
|
-
/* @__PURE__ */ u(
|
|
6245
|
-
/* @__PURE__ */ u(
|
|
6256
|
+
/* @__PURE__ */ u(ie, { initial: !1, active: d, children: /* @__PURE__ */ u(Ct, { className: s, style: _t, children: /* @__PURE__ */ u(cu, {}) }) }),
|
|
6257
|
+
/* @__PURE__ */ u(ie, { initial: !1, active: c, children: /* @__PURE__ */ u(Ct, { className: s, style: _t, children: /* @__PURE__ */ u(du, { sawError: r }) }) }),
|
|
6246
6258
|
/* @__PURE__ */ u(Ct, { className: s, style: _t, children: /* @__PURE__ */ u(fu, {}) })
|
|
6247
6259
|
] });
|
|
6248
6260
|
});
|
|
6249
6261
|
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__ */
|
|
6262
|
+
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(gi, { children: [
|
|
6251
6263
|
/* @__PURE__ */ u(La, {}),
|
|
6252
6264
|
/* @__PURE__ */ u(hu, {})
|
|
6253
6265
|
] }) }) }) }) }) }) }) }) }) }) }) });
|