@citrusworx/juiceui 0.6.0 → 0.8.0
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/README.md +113 -1
- package/dist/index.css +1026 -28
- package/dist/index.d.ts +16 -0
- package/dist/index.js +2128 -123
- package/dist/js/juice.d.ts +16 -0
- package/dist/js/src/banner/banner-runtime.d.ts +40 -0
- package/dist/js/src/combobox/combobox-runtime.d.ts +75 -0
- package/dist/js/src/drawer/drawer-runtime.d.ts +30 -0
- package/dist/js/src/menu/menu-runtime.d.ts +64 -0
- package/dist/js/src/popover/popover-runtime.d.ts +58 -0
- package/dist/js/src/shared/events.d.ts +7 -0
- package/dist/js/src/shared/focus.d.ts +7 -0
- package/dist/js/src/shared/ids.d.ts +7 -0
- package/dist/js/src/shared/overlays.d.ts +14 -0
- package/dist/js/src/toast/toast-runtime.d.ts +48 -0
- package/dist/js/src/tooltip/tooltip-runtime.d.ts +60 -0
- package/dist/js/src/wizard/wizard-runtime.d.ts +54 -0
- package/dist/themes/aquaflux.css +529 -0
- package/dist/themes/citrusmint.css +509 -0
- package/dist/themes/kiwipress.css +553 -28
- package/dist/themes/tide.css +525 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -341,18 +341,30 @@ typeof window < "u" && typeof document < "u" && (document.readyState === "loadin
|
|
|
341
341
|
O();
|
|
342
342
|
}) : O());
|
|
343
343
|
//#endregion
|
|
344
|
-
//#region src/js/src/
|
|
345
|
-
var A = {
|
|
344
|
+
//#region src/js/src/shared/events.ts
|
|
345
|
+
var A = () => {
|
|
346
|
+
let e = /* @__PURE__ */ new WeakSet();
|
|
347
|
+
return (t) => e.has(t) ? !1 : (e.add(t), !0);
|
|
348
|
+
}, j = (e) => typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e, M = (e) => (e ?? "").trim().split(/\s+/).filter(Boolean), N = (e) => M(e.getAttribute("aria-controls")), P = (e, t) => {
|
|
349
|
+
let n = j(e);
|
|
350
|
+
if (t instanceof Document || t instanceof Element) {
|
|
351
|
+
let e = t.querySelector(`#${n}`);
|
|
352
|
+
if (e) return e;
|
|
353
|
+
}
|
|
354
|
+
if (typeof document > "u") return null;
|
|
355
|
+
let r = document.getElementById(e);
|
|
356
|
+
return r instanceof HTMLElement ? r : null;
|
|
357
|
+
}, F = {
|
|
346
358
|
root: typeof document < "u" ? document : {},
|
|
347
359
|
accordionSelector: "[accordion]",
|
|
348
360
|
triggerSelector: "[accordion-item]"
|
|
349
|
-
},
|
|
361
|
+
}, I = (e) => Array.from(e), L = "juice-accordion-trigger", R = "juice-accordion-panel", z = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, B = A(), V = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "accordion", H = (e, t, n) => {
|
|
350
362
|
let r = String(n);
|
|
351
363
|
if (e.getAttribute("aria-expanded") !== r && e.setAttribute("aria-expanded", r), !t) return;
|
|
352
364
|
t.hidden !== !n && (t.hidden = !n);
|
|
353
365
|
let i = String(!n);
|
|
354
366
|
t.getAttribute("aria-hidden") !== i && t.setAttribute("aria-hidden", i);
|
|
355
|
-
},
|
|
367
|
+
}, ee = (e, t) => t ? !t.hasAttribute("hidden") : e.getAttribute("aria-expanded") === "true", te = (e = {}) => {
|
|
356
368
|
if (typeof window > "u" || typeof document > "u") return {
|
|
357
369
|
destroy: () => {},
|
|
358
370
|
sync: () => {},
|
|
@@ -361,9 +373,9 @@ var A = {
|
|
|
361
373
|
toggle: () => {}
|
|
362
374
|
};
|
|
363
375
|
let t = {
|
|
364
|
-
...
|
|
376
|
+
...F,
|
|
365
377
|
...e
|
|
366
|
-
}, n = t.root ?? document, r = n, i = () =>
|
|
378
|
+
}, n = t.root ?? document, r = n, i = () => I(n.querySelectorAll(t.accordionSelector)), a = (e) => I(e.querySelectorAll(t.triggerSelector)).filter((n) => n.closest(t.accordionSelector) === e), o = () => i().flatMap((e) => a(e)), s = 0, c = null, l = (e) => (s += 1, `${e}-${s}`), u = (e) => {
|
|
367
379
|
if (!e) return null;
|
|
368
380
|
let n = e.closest(t.accordionSelector);
|
|
369
381
|
return n instanceof HTMLElement ? n : null;
|
|
@@ -372,8 +384,8 @@ var A = {
|
|
|
372
384
|
if (!n) return null;
|
|
373
385
|
let r = e.getAttribute("aria-controls");
|
|
374
386
|
if (r) {
|
|
375
|
-
let e =
|
|
376
|
-
if (
|
|
387
|
+
let e = n.querySelector(`#${j(r)}`);
|
|
388
|
+
if (e) return e;
|
|
377
389
|
}
|
|
378
390
|
let i = e.nextElementSibling;
|
|
379
391
|
for (; i;) {
|
|
@@ -390,26 +402,26 @@ var A = {
|
|
|
390
402
|
return o()[0] ?? null;
|
|
391
403
|
}, p = (e) => {
|
|
392
404
|
let t = e.getAttribute("name");
|
|
393
|
-
return t ?
|
|
405
|
+
return t ? V(t) : null;
|
|
394
406
|
}, m = (e, t) => {
|
|
395
407
|
let n = u(e);
|
|
396
408
|
if (!n) return;
|
|
397
409
|
let r = a(n), i = Math.max(0, r.indexOf(e)), o = p(n), s = r.length > 1 ? `-${i + 1}` : "";
|
|
398
|
-
e.id ||= o ? `${o}-trigger${s}` : l(
|
|
410
|
+
e.id ||= o ? `${o}-trigger${s}` : l(L), z(e) || (e.setAttribute("role", "button"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0")), t && (t.id ||= o ? `${o}-panel${s}` : l(R), e.getAttribute("aria-controls") !== t.id && e.setAttribute("aria-controls", t.id), t.getAttribute("role") !== "region" && t.setAttribute("role", "region"), t.getAttribute("aria-labelledby") !== e.id && t.setAttribute("aria-labelledby", e.id));
|
|
399
411
|
}, h = (e) => {
|
|
400
412
|
let t = f(e);
|
|
401
413
|
if (!t) return;
|
|
402
414
|
let n = d(t);
|
|
403
|
-
m(t, n),
|
|
415
|
+
m(t, n), H(t, n, !0), c = t;
|
|
404
416
|
}, g = (e) => {
|
|
405
417
|
let t = f(e);
|
|
406
418
|
if (!t) return;
|
|
407
419
|
let n = d(t);
|
|
408
|
-
m(t, n),
|
|
420
|
+
m(t, n), H(t, n, !1), t === c && (c = o().find((e) => e !== t && ee(e, d(e))) ?? null);
|
|
409
421
|
}, _ = (e) => {
|
|
410
422
|
let t = f(e);
|
|
411
423
|
if (t) {
|
|
412
|
-
if (
|
|
424
|
+
if (ee(t, d(t))) {
|
|
413
425
|
g(t);
|
|
414
426
|
return;
|
|
415
427
|
}
|
|
@@ -420,7 +432,7 @@ var A = {
|
|
|
420
432
|
a(e).forEach((e) => {
|
|
421
433
|
let t = d(e);
|
|
422
434
|
if (m(e, t), t) {
|
|
423
|
-
|
|
435
|
+
H(e, t, ee(e, t));
|
|
424
436
|
return;
|
|
425
437
|
}
|
|
426
438
|
e.hasAttribute("aria-expanded") || e.setAttribute("aria-expanded", "false");
|
|
@@ -430,23 +442,23 @@ var A = {
|
|
|
430
442
|
let n = e.target;
|
|
431
443
|
if (!(n instanceof Element)) return;
|
|
432
444
|
let r = n.closest(t.triggerSelector);
|
|
433
|
-
!(r instanceof HTMLElement) || !u(r) ||
|
|
445
|
+
!(r instanceof HTMLElement) || !u(r) || B(e) && _(r);
|
|
434
446
|
}, b = (e) => {
|
|
435
447
|
let n = e.closest(t.triggerSelector);
|
|
436
|
-
return n instanceof HTMLElement && u(n) &&
|
|
448
|
+
return n instanceof HTMLElement && u(n) && ee(n, d(n)) ? n : o().filter((e) => ee(e, d(e))).find((t) => d(t)?.contains(e)) || (c && u(c) && ee(c, d(c)) ? c : null);
|
|
437
449
|
}, x = (e) => {
|
|
438
450
|
if (!(e instanceof KeyboardEvent)) return;
|
|
439
451
|
let n = e.target;
|
|
440
452
|
if (!(n instanceof Element)) return;
|
|
441
453
|
if (e.key === "Escape") {
|
|
442
454
|
let t = b(n);
|
|
443
|
-
if (!t || !
|
|
455
|
+
if (!t || !B(e)) return;
|
|
444
456
|
e.preventDefault(), g(t), t.focus();
|
|
445
457
|
return;
|
|
446
458
|
}
|
|
447
459
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
448
460
|
let r = n.closest(t.triggerSelector);
|
|
449
|
-
!(r instanceof HTMLElement) || !u(r) ||
|
|
461
|
+
!(r instanceof HTMLElement) || !u(r) || z(r) || B(e) && (e.preventDefault(), _(r));
|
|
450
462
|
}, S = !1, C = () => {
|
|
451
463
|
S || (S = !0, requestAnimationFrame(() => {
|
|
452
464
|
S = !1, v();
|
|
@@ -472,14 +484,14 @@ var A = {
|
|
|
472
484
|
collapse: g,
|
|
473
485
|
toggle: _
|
|
474
486
|
};
|
|
475
|
-
},
|
|
476
|
-
|
|
477
|
-
},
|
|
478
|
-
|
|
487
|
+
}, ne = (e = {}) => te(e), U = null, re = !1, ie = null, ae = () => {
|
|
488
|
+
ie &&= (document.removeEventListener("DOMContentLoaded", ie), null);
|
|
489
|
+
}, oe = () => typeof window > "u" || typeof document > "u" ? null : (re = !1, ae(), U ? (U.sync(), U) : (U = te(), U)), se = () => {
|
|
490
|
+
re = !0, ae(), U?.destroy(), U = null;
|
|
479
491
|
};
|
|
480
|
-
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (
|
|
481
|
-
|
|
482
|
-
}, document.addEventListener("DOMContentLoaded",
|
|
492
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (ie = () => {
|
|
493
|
+
ie = null, re || oe();
|
|
494
|
+
}, document.addEventListener("DOMContentLoaded", ie)) : oe());
|
|
483
495
|
//#endregion
|
|
484
496
|
//#region src/js/src/tabs/tabs-runtime.ts
|
|
485
497
|
var ce = {
|
|
@@ -488,7 +500,7 @@ var ce = {
|
|
|
488
500
|
listSelector: "[tabs-list]",
|
|
489
501
|
triggerSelector: "[tab]",
|
|
490
502
|
panelSelector: "[tab-panel]"
|
|
491
|
-
},
|
|
503
|
+
}, le = (e) => Array.from(e), ue = "juice-tabs-trigger", de = "juice-tabs-panel", fe = A(), pe = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, me = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "tabs", he = (e) => e instanceof HTMLElement ? e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement ? !0 : e.isContentEditable : !1, ge = (e = {}) => {
|
|
492
504
|
if (typeof window > "u" || typeof document > "u") return {
|
|
493
505
|
destroy: () => {},
|
|
494
506
|
sync: () => {},
|
|
@@ -497,7 +509,7 @@ var ce = {
|
|
|
497
509
|
let t = {
|
|
498
510
|
...ce,
|
|
499
511
|
...e
|
|
500
|
-
}, n = t.root ?? document, r = n, i = () =>
|
|
512
|
+
}, n = t.root ?? document, r = n, i = () => le(n.querySelectorAll(t.tabsSelector)), a = (e) => {
|
|
501
513
|
let n = e.querySelector(`:scope > ${t.listSelector}`);
|
|
502
514
|
return n instanceof HTMLElement ? n : null;
|
|
503
515
|
}, o = (e) => {
|
|
@@ -517,16 +529,16 @@ var ce = {
|
|
|
517
529
|
let n = a(e) ?? e, r = /* @__PURE__ */ new Set(), i = [], o = (t) => {
|
|
518
530
|
t instanceof HTMLElement && (!c(t, e) || r.has(t) || (r.add(t), i.push(t)));
|
|
519
531
|
};
|
|
520
|
-
return
|
|
532
|
+
return le(n.children).forEach(o), le(n.querySelectorAll(t.triggerSelector)).forEach(o), le(n.querySelectorAll("[role=\"tab\"]")).forEach(o), i.sort((e, t) => {
|
|
521
533
|
let n = e.compareDocumentPosition(t);
|
|
522
534
|
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
523
535
|
});
|
|
524
|
-
}, u = (e) =>
|
|
536
|
+
}, u = (e) => le(e.querySelectorAll(t.panelSelector)).filter((t) => o(t) === e), d = () => i().flatMap((e) => l(e)), f = 0, p = (e) => (f += 1, `${e}-${f}`), m = (e) => {
|
|
525
537
|
let n = o(e);
|
|
526
538
|
if (!n) return null;
|
|
527
539
|
let r = e.getAttribute("aria-controls");
|
|
528
540
|
if (r) {
|
|
529
|
-
let e = n.querySelector(`#${
|
|
541
|
+
let e = n.querySelector(`#${j(r)}`);
|
|
530
542
|
if (e && e.matches(t.panelSelector) && o(e) === n) return e;
|
|
531
543
|
}
|
|
532
544
|
let i = l(n), a = u(n), s = i.indexOf(e);
|
|
@@ -551,7 +563,7 @@ var ce = {
|
|
|
551
563
|
return d()[0] ?? null;
|
|
552
564
|
}, g = (e) => {
|
|
553
565
|
let t = e.getAttribute("name");
|
|
554
|
-
return t ?
|
|
566
|
+
return t ? me(t) : null;
|
|
555
567
|
}, _ = (e) => {
|
|
556
568
|
let t = a(e), n = u(e), r = t ?? (n.length === 0 ? e : null);
|
|
557
569
|
if (!r) return;
|
|
@@ -563,7 +575,7 @@ var ce = {
|
|
|
563
575
|
if (!n) return;
|
|
564
576
|
_(n);
|
|
565
577
|
let r = l(n), i = Math.max(0, r.indexOf(e)), a = g(n), s = r.length > 1 ? `-${i + 1}` : "";
|
|
566
|
-
e.id ||= a ? `${a}-tab${s}` : p(
|
|
578
|
+
e.id ||= a ? `${a}-tab${s}` : p(ue), e.getAttribute("role") !== "tab" && e.setAttribute("role", "tab"), !pe(e) && !e.hasAttribute("tabindex") && e.setAttribute("tabindex", "-1"), t && (t.id ||= a ? `${a}-panel${s}` : p(de), e.getAttribute("aria-controls") !== t.id && e.setAttribute("aria-controls", t.id), t.getAttribute("role") !== "tabpanel" && t.setAttribute("role", "tabpanel"), t.getAttribute("aria-labelledby") !== e.id && t.setAttribute("aria-labelledby", e.id));
|
|
567
579
|
}, y = (e) => e.hasAttribute("active") || e.getAttribute("aria-selected") === "true", b = (e, t, n) => {
|
|
568
580
|
n ? e.hasAttribute("active") || e.setAttribute("active", "") : e.hasAttribute("active") && e.removeAttribute("active");
|
|
569
581
|
let r = String(n);
|
|
@@ -609,7 +621,7 @@ var ce = {
|
|
|
609
621
|
let t = e.target;
|
|
610
622
|
if (!(t instanceof Element)) return;
|
|
611
623
|
let n = T(t);
|
|
612
|
-
n &&
|
|
624
|
+
n && fe(e) && S(n);
|
|
613
625
|
}, D = (e, t) => {
|
|
614
626
|
let n = o(e);
|
|
615
627
|
if (!n) return;
|
|
@@ -620,37 +632,37 @@ var ce = {
|
|
|
620
632
|
}, O = (e) => {
|
|
621
633
|
if (!(e instanceof KeyboardEvent)) return;
|
|
622
634
|
let t = e.target;
|
|
623
|
-
if (!(t instanceof Element) ||
|
|
635
|
+
if (!(t instanceof Element) || he(t)) return;
|
|
624
636
|
let n = T(t);
|
|
625
637
|
if (n && !(e.key === "Escape" || e.key === "ArrowUp" || e.key === "ArrowDown")) {
|
|
626
638
|
if (e.key === "ArrowRight") {
|
|
627
|
-
if (!
|
|
639
|
+
if (!fe(e)) return;
|
|
628
640
|
e.preventDefault(), D(n, (e, t) => (e + 1) % t);
|
|
629
641
|
return;
|
|
630
642
|
}
|
|
631
643
|
if (e.key === "ArrowLeft") {
|
|
632
|
-
if (!
|
|
644
|
+
if (!fe(e)) return;
|
|
633
645
|
e.preventDefault(), D(n, (e, t) => (e - 1 + t) % t);
|
|
634
646
|
return;
|
|
635
647
|
}
|
|
636
648
|
if (e.key === "Home") {
|
|
637
|
-
if (!
|
|
649
|
+
if (!fe(e)) return;
|
|
638
650
|
e.preventDefault(), D(n, () => 0);
|
|
639
651
|
return;
|
|
640
652
|
}
|
|
641
653
|
if (e.key === "End") {
|
|
642
|
-
if (!
|
|
654
|
+
if (!fe(e)) return;
|
|
643
655
|
e.preventDefault(), D(n, (e, t) => t - 1);
|
|
644
656
|
return;
|
|
645
657
|
}
|
|
646
|
-
e.key !== "Enter" && e.key !== " " ||
|
|
658
|
+
e.key !== "Enter" && e.key !== " " || pe(n) || fe(e) && (e.preventDefault(), S(n));
|
|
647
659
|
}
|
|
648
660
|
}, k = !1, A = () => {
|
|
649
661
|
k || (k = !0, requestAnimationFrame(() => {
|
|
650
662
|
k = !1, w();
|
|
651
663
|
}));
|
|
652
|
-
},
|
|
653
|
-
return r.addEventListener("click", E), r.addEventListener("keydown", O),
|
|
664
|
+
}, M = typeof MutationObserver < "u" ? new MutationObserver(() => A()) : null;
|
|
665
|
+
return r.addEventListener("click", E), r.addEventListener("keydown", O), M && n instanceof Node && M.observe(n, {
|
|
654
666
|
childList: !0,
|
|
655
667
|
subtree: !0,
|
|
656
668
|
attributes: !0,
|
|
@@ -666,35 +678,44 @@ var ce = {
|
|
|
666
678
|
]
|
|
667
679
|
}), w(), {
|
|
668
680
|
destroy: () => {
|
|
669
|
-
r.removeEventListener("click", E), r.removeEventListener("keydown", O),
|
|
681
|
+
r.removeEventListener("click", E), r.removeEventListener("keydown", O), M?.disconnect();
|
|
670
682
|
},
|
|
671
683
|
sync: w,
|
|
672
684
|
select: S
|
|
673
685
|
};
|
|
674
|
-
},
|
|
675
|
-
|
|
676
|
-
},
|
|
677
|
-
|
|
686
|
+
}, _e = (e = {}) => ge(e), ve = null, ye = !1, be = null, xe = () => {
|
|
687
|
+
be &&= (document.removeEventListener("DOMContentLoaded", be), null);
|
|
688
|
+
}, Se = () => typeof window > "u" || typeof document > "u" ? null : (ye = !1, xe(), ve ? (ve.sync(), ve) : (ve = ge(), ve)), Ce = () => {
|
|
689
|
+
ye = !0, xe(), ve?.destroy(), ve = null;
|
|
678
690
|
};
|
|
679
|
-
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (
|
|
680
|
-
|
|
681
|
-
}, document.addEventListener("DOMContentLoaded",
|
|
691
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (be = () => {
|
|
692
|
+
be = null, ye || Se();
|
|
693
|
+
}, document.addEventListener("DOMContentLoaded", be)) : Se());
|
|
682
694
|
//#endregion
|
|
683
|
-
//#region src/js/src/
|
|
684
|
-
var
|
|
685
|
-
root: typeof document < "u" ? document : {},
|
|
686
|
-
overlaySelector: "[modal-overlay]",
|
|
687
|
-
dialogSelector: "[modal]",
|
|
688
|
-
closeSelector: "[modal-close]",
|
|
689
|
-
closeOnBackdrop: !0
|
|
690
|
-
}, K = (e) => Array.from(e), xe = "juice-modal-overlay", Se = "juice-modal-dialog", Ce = "juice-modal-title", we = [
|
|
695
|
+
//#region src/js/src/shared/focus.ts
|
|
696
|
+
var we = [
|
|
691
697
|
"a[href]",
|
|
692
698
|
"button:not([disabled])",
|
|
693
699
|
"textarea:not([disabled])",
|
|
694
700
|
"input:not([disabled]):not([type=\"hidden\"])",
|
|
695
701
|
"select:not([disabled])",
|
|
696
702
|
"[tabindex]:not([tabindex=\"-1\"])"
|
|
697
|
-
].join(","), Te =
|
|
703
|
+
].join(","), Te = (e) => !(e.closest("[hidden]") || e.getAttribute("aria-hidden") === "true" || e instanceof HTMLButtonElement && e.disabled || e instanceof HTMLInputElement && e.disabled), Ee = (e) => Array.from(e.querySelectorAll(we)).filter(Te), De = (e) => {
|
|
704
|
+
let t = e.querySelector("[autofocus]"), n = Ee(e), r = (t && Te(t) ? t : null) ?? n[0] ?? e;
|
|
705
|
+
r === e && !e.hasAttribute("tabindex") && e.setAttribute("tabindex", "-1"), r.focus();
|
|
706
|
+
}, Oe = (e, t) => {
|
|
707
|
+
if (e.key !== "Tab") return !1;
|
|
708
|
+
let n = Ee(t), r = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
709
|
+
if (n.length === 0) return e.preventDefault(), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "-1"), t.focus(), !0;
|
|
710
|
+
let i = n[0], a = n[n.length - 1];
|
|
711
|
+
return e.shiftKey ? !r || r === i || !t.contains(r) ? (e.preventDefault(), a.focus(), !0) : !0 : !r || r === a || !t.contains(r) ? (e.preventDefault(), i.focus(), !0) : !0;
|
|
712
|
+
}, ke = {
|
|
713
|
+
root: typeof document < "u" ? document : {},
|
|
714
|
+
overlaySelector: "[modal-overlay]",
|
|
715
|
+
dialogSelector: "[modal]",
|
|
716
|
+
closeSelector: "[modal-close]",
|
|
717
|
+
closeOnBackdrop: !0
|
|
718
|
+
}, Ae = (e) => Array.from(e), je = "juice-modal-overlay", Me = "juice-modal-dialog", Ne = "juice-modal-title", W = A(), Pe = /* @__PURE__ */ new WeakMap(), Fe = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "modal", Ie = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, G = (e) => !e.hasAttribute("hidden"), Le = (e = {}) => {
|
|
698
719
|
if (typeof window > "u" || typeof document > "u") return {
|
|
699
720
|
destroy: () => {},
|
|
700
721
|
sync: () => {},
|
|
@@ -703,23 +724,15 @@ var be = {
|
|
|
703
724
|
toggle: () => {}
|
|
704
725
|
};
|
|
705
726
|
let t = {
|
|
706
|
-
...
|
|
727
|
+
...ke,
|
|
707
728
|
...e
|
|
708
|
-
}, n = t.root ?? document, r = n, i = 0, a = (e) => (i += 1, `${e}-${i}`), o = () =>
|
|
729
|
+
}, n = t.root ?? document, r = n, i = 0, a = (e) => (i += 1, `${e}-${i}`), o = () => Ae(n.querySelectorAll(t.overlaySelector)), s = (e) => {
|
|
709
730
|
if (!e) return null;
|
|
710
731
|
let n = e.closest(t.overlaySelector);
|
|
711
732
|
return n instanceof HTMLElement ? n : null;
|
|
712
|
-
}, c = (e) => {
|
|
713
|
-
let t = Ee(e);
|
|
714
|
-
if (n instanceof Document || n instanceof Element) {
|
|
715
|
-
let e = n.querySelector(`#${t}`);
|
|
716
|
-
if (e) return e;
|
|
717
|
-
}
|
|
718
|
-
let r = document.getElementById(e);
|
|
719
|
-
return r instanceof HTMLElement ? r : null;
|
|
720
|
-
}, l = (e) => e?.matches(t.overlaySelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : o().includes(e) : !1, u = (e) => K(e.querySelectorAll(t.dialogSelector)).find((t) => s(t) === e) || K(e.querySelectorAll("[role=\"dialog\"]")).find((t) => s(t) === e) || (K(e.children).find((e) => e instanceof HTMLElement) ?? e), d = (e) => {
|
|
733
|
+
}, c = (e) => P(e, n), l = (e) => e?.matches(t.overlaySelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : o().includes(e) : !1, u = (e) => Ae(e.querySelectorAll(t.dialogSelector)).find((t) => s(t) === e) || Ae(e.querySelectorAll("[role=\"dialog\"]")).find((t) => s(t) === e) || (Ae(e.children).find((e) => e instanceof HTMLElement) ?? e), d = (e) => {
|
|
721
734
|
if (s(e)) return null;
|
|
722
|
-
for (let t of
|
|
735
|
+
for (let t of N(e)) {
|
|
723
736
|
let e = c(t);
|
|
724
737
|
if (e && l(e)) return e;
|
|
725
738
|
}
|
|
@@ -741,47 +754,46 @@ var be = {
|
|
|
741
754
|
if (e) return e;
|
|
742
755
|
}
|
|
743
756
|
}
|
|
744
|
-
return o().find(
|
|
757
|
+
return o().find(G) ?? o()[0] ?? null;
|
|
745
758
|
}, p = (e) => {
|
|
746
759
|
let t = e.getAttribute("name");
|
|
747
|
-
return t ?
|
|
748
|
-
}, m = (e) => e.id ?
|
|
760
|
+
return t ? Fe(t) : e.id ? Fe(e.id) : null;
|
|
761
|
+
}, m = (e) => e.id ? Ae(document.querySelectorAll("[aria-controls]")).filter((t) => s(t) ? !1 : N(t).includes(e.id)) : [], h = (e, t) => {
|
|
749
762
|
let n = String(t);
|
|
750
763
|
m(e).forEach((e) => {
|
|
751
764
|
e.getAttribute("aria-expanded") !== n && e.setAttribute("aria-expanded", n), e.hasAttribute("aria-haspopup") || e.setAttribute("aria-haspopup", "dialog");
|
|
752
765
|
});
|
|
753
766
|
}, g = (e) => {
|
|
754
767
|
let n = u(e), r = p(e);
|
|
755
|
-
if (e.id ||= r ? `${r}-overlay` : a(
|
|
768
|
+
if (e.id ||= r ? `${r}-overlay` : a(je), n.id ||= r ? `${r}-dialog` : a(Me), n.getAttribute("role") !== "dialog" && n.setAttribute("role", "dialog"), n.getAttribute("aria-modal") !== "true" && n.setAttribute("aria-modal", "true"), !n.hasAttribute("aria-labelledby") && !n.hasAttribute("aria-label")) {
|
|
756
769
|
let e = n.querySelector("[modal-header] :is(h1,h2,h3,h4,h5,h6), :is(h1,h2,h3,h4,h5,h6)");
|
|
757
|
-
e && (e.id ||= r ? `${r}-title` : a(
|
|
770
|
+
e && (e.id ||= r ? `${r}-title` : a(Ne), n.setAttribute("aria-labelledby", e.id));
|
|
758
771
|
}
|
|
759
|
-
|
|
760
|
-
|
|
772
|
+
Ae(e.querySelectorAll(t.closeSelector)).filter((t) => s(t) === e).forEach((e) => {
|
|
773
|
+
Ie(e) || (e.setAttribute("role", "button"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0")), !e.hasAttribute("aria-label") && !e.hasAttribute("aria-labelledby") && !e.textContent?.trim() && e.setAttribute("aria-label", "Close");
|
|
761
774
|
}), m(e).forEach((t) => {
|
|
762
|
-
|
|
775
|
+
Ie(t) || (t.setAttribute("role", "button"), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0")), t.hasAttribute("aria-haspopup") || t.setAttribute("aria-haspopup", "dialog"), t.hasAttribute("aria-expanded") || t.setAttribute("aria-expanded", String(G(e)));
|
|
763
776
|
});
|
|
764
777
|
}, _ = (e, t) => {
|
|
765
778
|
let n = document.activeElement instanceof HTMLElement ? document.activeElement : null, r = t && !e.contains(t) ? t : n && !e.contains(n) ? n : null;
|
|
766
|
-
r &&
|
|
779
|
+
r && Pe.set(e, r);
|
|
767
780
|
}, v = (e) => {
|
|
768
|
-
let t =
|
|
769
|
-
|
|
781
|
+
let t = Pe.get(e);
|
|
782
|
+
Pe.delete(e), t?.isConnected && t.focus();
|
|
770
783
|
}, y = (e) => {
|
|
771
|
-
|
|
772
|
-
i === t && !t.hasAttribute("tabindex") && t.setAttribute("tabindex", "-1"), i.focus();
|
|
784
|
+
De(u(e));
|
|
773
785
|
}, b = (e, t) => {
|
|
774
786
|
e.hidden !== !t && (e.hidden = !t);
|
|
775
787
|
}, x = (e, t) => {
|
|
776
|
-
g(e), b(e, !1), h(e, !1), t ? v(e) :
|
|
788
|
+
g(e), b(e, !1), h(e, !1), t ? v(e) : Pe.delete(e);
|
|
777
789
|
}, S = (e, n) => {
|
|
778
|
-
o().concat(
|
|
779
|
-
t === e || !
|
|
790
|
+
o().concat(Ae(document.querySelectorAll(t.overlaySelector))).forEach((t) => {
|
|
791
|
+
t === e || !G(t) || x(t, !1);
|
|
780
792
|
}), _(e, n), g(e), b(e, !0), h(e, !0), y(e);
|
|
781
793
|
}, C = (e) => {
|
|
782
794
|
let t = f(e);
|
|
783
795
|
if (t) {
|
|
784
|
-
if (
|
|
796
|
+
if (G(t)) {
|
|
785
797
|
g(t), h(t, !0);
|
|
786
798
|
return;
|
|
787
799
|
}
|
|
@@ -789,11 +801,11 @@ var be = {
|
|
|
789
801
|
}
|
|
790
802
|
}, w = (e) => {
|
|
791
803
|
let t = f(e);
|
|
792
|
-
!t || !
|
|
804
|
+
!t || !G(t) || x(t, !0);
|
|
793
805
|
}, T = (e) => {
|
|
794
806
|
let t = f(e);
|
|
795
807
|
if (t) {
|
|
796
|
-
if (
|
|
808
|
+
if (G(t)) {
|
|
797
809
|
w(t);
|
|
798
810
|
return;
|
|
799
811
|
}
|
|
@@ -801,7 +813,7 @@ var be = {
|
|
|
801
813
|
}
|
|
802
814
|
}, E = () => {
|
|
803
815
|
o().forEach((e) => {
|
|
804
|
-
g(e), h(e,
|
|
816
|
+
g(e), h(e, G(e));
|
|
805
817
|
});
|
|
806
818
|
}, D = (e) => t.closeOnBackdrop ? e.getAttribute("modal-overlay") !== "static" : !1, O = (e) => {
|
|
807
819
|
if (!(e instanceof HTMLElement) || s(e)) return null;
|
|
@@ -815,61 +827,55 @@ var be = {
|
|
|
815
827
|
if (r && l(r)) {
|
|
816
828
|
let i = n.closest(t.closeSelector) instanceof HTMLElement ? n.closest(t.closeSelector) : null;
|
|
817
829
|
if (i && s(i) === r) {
|
|
818
|
-
if (!
|
|
830
|
+
if (!W(e)) return;
|
|
819
831
|
w(r);
|
|
820
832
|
return;
|
|
821
833
|
}
|
|
822
834
|
if (n === r && D(r)) {
|
|
823
|
-
if (!
|
|
835
|
+
if (!W(e)) return;
|
|
824
836
|
w(r);
|
|
825
837
|
}
|
|
826
838
|
return;
|
|
827
839
|
}
|
|
828
840
|
let i = O(n);
|
|
829
|
-
i &&
|
|
830
|
-
}, A = () => o().find(
|
|
831
|
-
if (e.key !== "Tab") return !1;
|
|
832
|
-
let n = u(t), r = Ae(n), i = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
833
|
-
if (r.length === 0) return e.preventDefault(), n.hasAttribute("tabindex") || n.setAttribute("tabindex", "-1"), n.focus(), !0;
|
|
834
|
-
let a = r[0], o = r[r.length - 1];
|
|
835
|
-
return e.shiftKey ? !i || i === a || !n.contains(i) ? (e.preventDefault(), o.focus(), !0) : !0 : !i || i === o || !n.contains(i) ? (e.preventDefault(), a.focus(), !0) : !0;
|
|
836
|
-
}, ee = (e) => {
|
|
841
|
+
i && W(e) && T(i);
|
|
842
|
+
}, A = () => o().find(G) ?? null, j = (e, t) => Oe(e, u(t)), M = (e) => {
|
|
837
843
|
if (!(e instanceof KeyboardEvent)) return;
|
|
838
844
|
let n = e.target;
|
|
839
845
|
if (!(n instanceof Element)) return;
|
|
840
846
|
let r = A();
|
|
841
847
|
if (r && e.key === "Escape") {
|
|
842
|
-
if (!
|
|
848
|
+
if (!W(e)) return;
|
|
843
849
|
e.preventDefault(), e.stopPropagation(), w(r);
|
|
844
850
|
return;
|
|
845
851
|
}
|
|
846
852
|
if (r && e.key === "Tab") {
|
|
847
|
-
if (!
|
|
853
|
+
if (!W(e)) return;
|
|
848
854
|
j(e, r);
|
|
849
855
|
return;
|
|
850
856
|
}
|
|
851
857
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
852
858
|
let i = n.closest(t.closeSelector);
|
|
853
|
-
if (i instanceof HTMLElement && s(i) && !
|
|
854
|
-
if (!
|
|
859
|
+
if (i instanceof HTMLElement && s(i) && !Ie(i)) {
|
|
860
|
+
if (!W(e)) return;
|
|
855
861
|
e.preventDefault(), w(i);
|
|
856
862
|
return;
|
|
857
863
|
}
|
|
858
864
|
let a = O(n);
|
|
859
|
-
!a ||
|
|
860
|
-
},
|
|
865
|
+
!a || Ie(a) || W(e) && (e.preventDefault(), T(a));
|
|
866
|
+
}, F = (e) => {
|
|
861
867
|
let t = A();
|
|
862
868
|
if (!t) return;
|
|
863
869
|
let n = e.target;
|
|
864
|
-
if (!(n instanceof Node) || t.contains(n) || !
|
|
870
|
+
if (!(n instanceof Node) || t.contains(n) || !W(e)) return;
|
|
865
871
|
let r = u(t);
|
|
866
|
-
(
|
|
867
|
-
},
|
|
868
|
-
|
|
869
|
-
|
|
872
|
+
(Ee(r)[0] ?? r).focus();
|
|
873
|
+
}, I = !1, L = () => {
|
|
874
|
+
I || (I = !0, requestAnimationFrame(() => {
|
|
875
|
+
I = !1, E();
|
|
870
876
|
}));
|
|
871
|
-
},
|
|
872
|
-
return r.addEventListener("click", k), r.addEventListener("keydown",
|
|
877
|
+
}, R = typeof MutationObserver < "u" ? new MutationObserver(() => L()) : null;
|
|
878
|
+
return r.addEventListener("click", k), r.addEventListener("keydown", M, !0), r.addEventListener("focusin", F, !0), R && n instanceof Node && R.observe(n, {
|
|
873
879
|
childList: !0,
|
|
874
880
|
subtree: !0,
|
|
875
881
|
attributes: !0,
|
|
@@ -884,24 +890,2023 @@ var be = {
|
|
|
884
890
|
]
|
|
885
891
|
}), E(), {
|
|
886
892
|
destroy: () => {
|
|
887
|
-
r.removeEventListener("click", k), r.removeEventListener("keydown",
|
|
893
|
+
r.removeEventListener("click", k), r.removeEventListener("keydown", M, !0), r.removeEventListener("focusin", F, !0), R?.disconnect();
|
|
894
|
+
},
|
|
895
|
+
sync: E,
|
|
896
|
+
open: C,
|
|
897
|
+
close: w,
|
|
898
|
+
toggle: T
|
|
899
|
+
};
|
|
900
|
+
}, Re = (e = {}) => Le(e), ze = null, Be = !1, Ve = null, He = () => {
|
|
901
|
+
Ve &&= (document.removeEventListener("DOMContentLoaded", Ve), null);
|
|
902
|
+
}, Ue = () => typeof window > "u" || typeof document > "u" ? null : (Be = !1, He(), ze ? (ze.sync(), ze) : (ze = Le(), ze)), We = () => {
|
|
903
|
+
Be = !0, He(), ze?.destroy(), ze = null;
|
|
904
|
+
};
|
|
905
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (Ve = () => {
|
|
906
|
+
Ve = null, Be || Ue();
|
|
907
|
+
}, document.addEventListener("DOMContentLoaded", Ve)) : Ue());
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region src/js/src/drawer/drawer-runtime.ts
|
|
910
|
+
var Ge = {
|
|
911
|
+
root: typeof document < "u" ? document : {},
|
|
912
|
+
overlaySelector: "[drawer-overlay]",
|
|
913
|
+
dialogSelector: "[drawer]",
|
|
914
|
+
closeSelector: "[drawer-close]",
|
|
915
|
+
closeOnBackdrop: !0
|
|
916
|
+
}, Ke = (e) => Array.from(e), qe = "juice-drawer-overlay", Je = "juice-drawer-dialog", Ye = "juice-drawer-title", K = A(), Xe = /* @__PURE__ */ new WeakMap(), Ze = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "drawer", Qe = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, q = (e) => !e.hasAttribute("hidden"), $e = (e = {}) => {
|
|
917
|
+
if (typeof window > "u" || typeof document > "u") return {
|
|
918
|
+
destroy: () => {},
|
|
919
|
+
sync: () => {},
|
|
920
|
+
open: () => {},
|
|
921
|
+
close: () => {},
|
|
922
|
+
toggle: () => {}
|
|
923
|
+
};
|
|
924
|
+
let t = {
|
|
925
|
+
...Ge,
|
|
926
|
+
...e
|
|
927
|
+
}, n = t.root ?? document, r = n, i = 0, a = (e) => (i += 1, `${e}-${i}`), o = () => Ke(n.querySelectorAll(t.overlaySelector)), s = (e) => {
|
|
928
|
+
if (!e) return null;
|
|
929
|
+
let n = e.closest(t.overlaySelector);
|
|
930
|
+
return n instanceof HTMLElement ? n : null;
|
|
931
|
+
}, c = (e) => P(e, n), l = (e) => e?.matches(t.overlaySelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : o().includes(e) : !1, u = (e) => Ke(e.querySelectorAll(t.dialogSelector)).find((t) => s(t) === e) || Ke(e.querySelectorAll("[role=\"dialog\"]")).find((t) => s(t) === e) || (Ke(e.children).find((e) => e instanceof HTMLElement) ?? e), d = (e) => {
|
|
932
|
+
if (s(e)) return null;
|
|
933
|
+
for (let t of N(e)) {
|
|
934
|
+
let e = c(t);
|
|
935
|
+
if (e && l(e)) return e;
|
|
936
|
+
}
|
|
937
|
+
return null;
|
|
938
|
+
}, f = (e) => {
|
|
939
|
+
if (e) {
|
|
940
|
+
if (l(e)) return e;
|
|
941
|
+
let n = s(e);
|
|
942
|
+
if (n && l(n)) return n;
|
|
943
|
+
if (e.matches(t.closeSelector)) {
|
|
944
|
+
let t = s(e);
|
|
945
|
+
if (t && l(t)) return t;
|
|
946
|
+
}
|
|
947
|
+
let r = d(e);
|
|
948
|
+
if (r) return r;
|
|
949
|
+
let i = e.closest("[aria-controls]");
|
|
950
|
+
if (i instanceof HTMLElement) {
|
|
951
|
+
let e = d(i);
|
|
952
|
+
if (e) return e;
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
return o().find(q) ?? o()[0] ?? null;
|
|
956
|
+
}, p = (e) => {
|
|
957
|
+
let t = e.getAttribute("name");
|
|
958
|
+
return t ? Ze(t) : e.id ? Ze(e.id) : null;
|
|
959
|
+
}, m = (e) => e.id ? Ke(document.querySelectorAll("[aria-controls]")).filter((t) => s(t) ? !1 : N(t).includes(e.id)) : [], h = (e, t) => {
|
|
960
|
+
let n = String(t);
|
|
961
|
+
m(e).forEach((e) => {
|
|
962
|
+
e.getAttribute("aria-expanded") !== n && e.setAttribute("aria-expanded", n), e.hasAttribute("aria-haspopup") || e.setAttribute("aria-haspopup", "dialog");
|
|
963
|
+
});
|
|
964
|
+
}, g = (e) => {
|
|
965
|
+
let n = u(e), r = p(e);
|
|
966
|
+
if (e.id ||= r ? `${r}-overlay` : a(qe), n.id ||= r ? `${r}-dialog` : a(Je), n.getAttribute("role") !== "dialog" && n.setAttribute("role", "dialog"), n.getAttribute("aria-modal") !== "true" && n.setAttribute("aria-modal", "true"), !n.hasAttribute("aria-labelledby") && !n.hasAttribute("aria-label")) {
|
|
967
|
+
let e = n.querySelector("[drawer-header] :is(h1,h2,h3,h4,h5,h6), :is(h1,h2,h3,h4,h5,h6)");
|
|
968
|
+
e && (e.id ||= r ? `${r}-title` : a(Ye), n.setAttribute("aria-labelledby", e.id));
|
|
969
|
+
}
|
|
970
|
+
Ke(e.querySelectorAll(t.closeSelector)).filter((t) => s(t) === e).forEach((e) => {
|
|
971
|
+
Qe(e) || (e.setAttribute("role", "button"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0")), !e.hasAttribute("aria-label") && !e.hasAttribute("aria-labelledby") && !e.textContent?.trim() && e.setAttribute("aria-label", "Close");
|
|
972
|
+
}), m(e).forEach((t) => {
|
|
973
|
+
Qe(t) || (t.setAttribute("role", "button"), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0")), t.hasAttribute("aria-haspopup") || t.setAttribute("aria-haspopup", "dialog"), t.hasAttribute("aria-expanded") || t.setAttribute("aria-expanded", String(q(e)));
|
|
974
|
+
});
|
|
975
|
+
}, _ = (e, t) => {
|
|
976
|
+
let n = document.activeElement instanceof HTMLElement ? document.activeElement : null, r = t && !e.contains(t) ? t : n && !e.contains(n) ? n : null;
|
|
977
|
+
r && Xe.set(e, r);
|
|
978
|
+
}, v = (e) => {
|
|
979
|
+
let t = Xe.get(e);
|
|
980
|
+
Xe.delete(e), t?.isConnected && t.focus();
|
|
981
|
+
}, y = (e) => {
|
|
982
|
+
De(u(e));
|
|
983
|
+
}, b = (e, t) => {
|
|
984
|
+
e.hidden !== !t && (e.hidden = !t);
|
|
985
|
+
}, x = (e, t) => {
|
|
986
|
+
g(e), b(e, !1), h(e, !1), t ? v(e) : Xe.delete(e);
|
|
987
|
+
}, S = (e, n) => {
|
|
988
|
+
o().concat(Ke(document.querySelectorAll(t.overlaySelector))).forEach((t) => {
|
|
989
|
+
t === e || !q(t) || x(t, !1);
|
|
990
|
+
}), _(e, n), g(e), b(e, !0), h(e, !0), y(e);
|
|
991
|
+
}, C = (e) => {
|
|
992
|
+
let t = f(e);
|
|
993
|
+
if (t) {
|
|
994
|
+
if (q(t)) {
|
|
995
|
+
g(t), h(t, !0);
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
S(t, e && d(e) === t ? e : e?.closest("[aria-controls]") instanceof HTMLElement && d(e.closest("[aria-controls]")) === t ? e.closest("[aria-controls]") : null);
|
|
999
|
+
}
|
|
1000
|
+
}, w = (e) => {
|
|
1001
|
+
let t = f(e);
|
|
1002
|
+
!t || !q(t) || x(t, !0);
|
|
1003
|
+
}, T = (e) => {
|
|
1004
|
+
let t = f(e);
|
|
1005
|
+
if (t) {
|
|
1006
|
+
if (q(t)) {
|
|
1007
|
+
w(t);
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
C(e ?? t);
|
|
1011
|
+
}
|
|
1012
|
+
}, E = () => {
|
|
1013
|
+
o().forEach((e) => {
|
|
1014
|
+
g(e), h(e, q(e));
|
|
1015
|
+
});
|
|
1016
|
+
}, D = (e) => t.closeOnBackdrop ? e.getAttribute("drawer-overlay") !== "static" : !1, O = (e) => {
|
|
1017
|
+
if (!(e instanceof HTMLElement) || s(e)) return null;
|
|
1018
|
+
if (d(e)) return e;
|
|
1019
|
+
let t = e.closest("[aria-controls]");
|
|
1020
|
+
return t instanceof HTMLElement && d(t) ? t : null;
|
|
1021
|
+
}, k = (e) => {
|
|
1022
|
+
let n = e.target;
|
|
1023
|
+
if (!(n instanceof Element)) return;
|
|
1024
|
+
let r = s(n instanceof HTMLElement ? n : n.parentElement);
|
|
1025
|
+
if (r && l(r)) {
|
|
1026
|
+
let i = n.closest(t.closeSelector) instanceof HTMLElement ? n.closest(t.closeSelector) : null;
|
|
1027
|
+
if (i && s(i) === r) {
|
|
1028
|
+
if (!K(e)) return;
|
|
1029
|
+
w(r);
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
if (n === r && D(r)) {
|
|
1033
|
+
if (!K(e)) return;
|
|
1034
|
+
w(r);
|
|
1035
|
+
}
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
let i = O(n);
|
|
1039
|
+
i && K(e) && T(i);
|
|
1040
|
+
}, A = () => o().find(q) ?? null, j = (e, t) => Oe(e, u(t)), M = (e) => {
|
|
1041
|
+
if (!(e instanceof KeyboardEvent)) return;
|
|
1042
|
+
let n = e.target;
|
|
1043
|
+
if (!(n instanceof Element)) return;
|
|
1044
|
+
let r = A();
|
|
1045
|
+
if (r && e.key === "Escape") {
|
|
1046
|
+
if (!K(e)) return;
|
|
1047
|
+
e.preventDefault(), e.stopPropagation(), w(r);
|
|
1048
|
+
return;
|
|
1049
|
+
}
|
|
1050
|
+
if (r && e.key === "Tab") {
|
|
1051
|
+
if (!K(e)) return;
|
|
1052
|
+
j(e, r);
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
1056
|
+
let i = n.closest(t.closeSelector);
|
|
1057
|
+
if (i instanceof HTMLElement && s(i) && !Qe(i)) {
|
|
1058
|
+
if (!K(e)) return;
|
|
1059
|
+
e.preventDefault(), w(i);
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
let a = O(n);
|
|
1063
|
+
!a || Qe(a) || K(e) && (e.preventDefault(), T(a));
|
|
1064
|
+
}, F = (e) => {
|
|
1065
|
+
let t = A();
|
|
1066
|
+
if (!t) return;
|
|
1067
|
+
let n = e.target;
|
|
1068
|
+
if (!(n instanceof Node) || t.contains(n) || !K(e)) return;
|
|
1069
|
+
let r = u(t);
|
|
1070
|
+
(Ee(r)[0] ?? r).focus();
|
|
1071
|
+
}, I = !1, L = () => {
|
|
1072
|
+
I || (I = !0, requestAnimationFrame(() => {
|
|
1073
|
+
I = !1, E();
|
|
1074
|
+
}));
|
|
1075
|
+
}, R = typeof MutationObserver < "u" ? new MutationObserver(() => L()) : null;
|
|
1076
|
+
return r.addEventListener("click", k), r.addEventListener("keydown", M, !0), r.addEventListener("focusin", F, !0), R && n instanceof Node && R.observe(n, {
|
|
1077
|
+
childList: !0,
|
|
1078
|
+
subtree: !0,
|
|
1079
|
+
attributes: !0,
|
|
1080
|
+
attributeFilter: [
|
|
1081
|
+
"hidden",
|
|
1082
|
+
"aria-controls",
|
|
1083
|
+
"aria-labelledby",
|
|
1084
|
+
"aria-modal",
|
|
1085
|
+
"drawer-overlay",
|
|
1086
|
+
"drawer",
|
|
1087
|
+
"drawer-close"
|
|
1088
|
+
]
|
|
1089
|
+
}), E(), {
|
|
1090
|
+
destroy: () => {
|
|
1091
|
+
r.removeEventListener("click", k), r.removeEventListener("keydown", M, !0), r.removeEventListener("focusin", F, !0), R?.disconnect();
|
|
888
1092
|
},
|
|
889
1093
|
sync: E,
|
|
890
1094
|
open: C,
|
|
891
1095
|
close: w,
|
|
892
1096
|
toggle: T
|
|
893
1097
|
};
|
|
894
|
-
},
|
|
895
|
-
|
|
896
|
-
},
|
|
897
|
-
|
|
1098
|
+
}, et = (e = {}) => $e(e), tt = null, nt = !1, rt = null, it = () => {
|
|
1099
|
+
rt &&= (document.removeEventListener("DOMContentLoaded", rt), null);
|
|
1100
|
+
}, at = () => typeof window > "u" || typeof document > "u" ? null : (nt = !1, it(), tt ? (tt.sync(), tt) : (tt = $e(), tt)), ot = () => {
|
|
1101
|
+
nt = !0, it(), tt?.destroy(), tt = null;
|
|
1102
|
+
};
|
|
1103
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (rt = () => {
|
|
1104
|
+
rt = null, nt || at();
|
|
1105
|
+
}, document.addEventListener("DOMContentLoaded", rt)) : at());
|
|
1106
|
+
//#endregion
|
|
1107
|
+
//#region src/js/src/shared/overlays.ts
|
|
1108
|
+
var st = (e) => typeof document > "u" ? !1 : !!document.querySelector(e), ct = () => st("[modal-overlay]:not([hidden]), [drawer-overlay]:not([hidden])"), lt = () => st("[popover-root]:not([hidden])"), ut = () => st("[menu-root] [menu]:not([hidden])"), dt = () => st("[combobox-list]:not([hidden])"), ft = () => st("[tooltip-root]:not([hidden])"), pt = {
|
|
1109
|
+
root: typeof document < "u" ? document : {},
|
|
1110
|
+
regionSelector: "[toast-region]",
|
|
1111
|
+
toastSelector: "[toast]",
|
|
1112
|
+
closeSelector: "[toast-close]",
|
|
1113
|
+
defaultDuration: 5e3
|
|
1114
|
+
}, mt = (e) => Array.from(e), ht = A(), gt = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, J = (e) => !e.hasAttribute("hidden"), _t = (e) => !Number.isFinite(e) || e <= 0, vt = (e, t) => {
|
|
1115
|
+
if (e == null) return t;
|
|
1116
|
+
let n = e.trim();
|
|
1117
|
+
if (!n) return t;
|
|
1118
|
+
if (n.toLowerCase() === "infinity") return 0;
|
|
1119
|
+
let r = Number(n);
|
|
1120
|
+
return Number.isNaN(r) ? t : r;
|
|
1121
|
+
}, yt = () => ct() || lt() || ut() || dt() || ft(), bt = (e = {}) => {
|
|
1122
|
+
if (typeof window > "u" || typeof document > "u") return {
|
|
1123
|
+
destroy: () => {},
|
|
1124
|
+
sync: () => {},
|
|
1125
|
+
show: () => {},
|
|
1126
|
+
dismiss: () => {}
|
|
1127
|
+
};
|
|
1128
|
+
let t = {
|
|
1129
|
+
...pt,
|
|
1130
|
+
...e
|
|
1131
|
+
}, n = t.root ?? document, r = n, i = typeof e.defaultDuration == "number" ? e.defaultDuration : pt.defaultDuration, a = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new Set(), s = [], c = () => mt(n.querySelectorAll(t.regionSelector)), l = (e) => {
|
|
1132
|
+
if (!e) return null;
|
|
1133
|
+
let n = e.closest(t.regionSelector);
|
|
1134
|
+
return n instanceof HTMLElement ? n : null;
|
|
1135
|
+
}, u = (e) => {
|
|
1136
|
+
if (!e) return null;
|
|
1137
|
+
let n = e.closest(t.toastSelector);
|
|
1138
|
+
return !(n instanceof HTMLElement) || !l(n) ? null : n;
|
|
1139
|
+
}, d = (e) => mt((e ?? n).querySelectorAll(t.toastSelector)).filter((e) => l(e)), f = (e) => !e?.matches(t.toastSelector) || !l(e) ? !1 : n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : d().includes(e), p = (e) => vt(e.getAttribute("toast-duration"), i), m = (e, t) => e.getAttribute("aria-live") === "assertive" || e.getAttribute("toast-live") === "assertive" || t.getAttribute("aria-live") === "assertive" || t.getAttribute("toast-live") === "assertive", h = (e, t = !0) => {
|
|
1140
|
+
let n = s.indexOf(e);
|
|
1141
|
+
if (n >= 0) {
|
|
1142
|
+
if (!t) return;
|
|
1143
|
+
s.splice(n, 1);
|
|
1144
|
+
}
|
|
1145
|
+
s.push(e);
|
|
1146
|
+
}, g = (e) => {
|
|
1147
|
+
let t = s.indexOf(e);
|
|
1148
|
+
t >= 0 && s.splice(t, 1);
|
|
1149
|
+
}, _ = () => {
|
|
1150
|
+
for (let e = s.length - 1; e >= 0; --e) {
|
|
1151
|
+
let t = s[e];
|
|
1152
|
+
if (t.isConnected && f(t) && J(t)) return t;
|
|
1153
|
+
}
|
|
1154
|
+
let e = d().filter(J);
|
|
1155
|
+
return e[e.length - 1] ?? null;
|
|
1156
|
+
}, v = (e) => {
|
|
1157
|
+
if (e) {
|
|
1158
|
+
if (f(e)) return e;
|
|
1159
|
+
let t = u(e);
|
|
1160
|
+
if (t && f(t)) return t;
|
|
1161
|
+
}
|
|
1162
|
+
return _() ?? d()[0] ?? null;
|
|
1163
|
+
}, y = (e) => {
|
|
1164
|
+
let t = a.get(e);
|
|
1165
|
+
t?.timeoutId != null && clearTimeout(t.timeoutId), a.delete(e), o.delete(e);
|
|
1166
|
+
}, b = () => {
|
|
1167
|
+
o.forEach((e) => {
|
|
1168
|
+
let t = a.get(e);
|
|
1169
|
+
t?.timeoutId != null && clearTimeout(t.timeoutId), a.delete(e);
|
|
1170
|
+
}), o.clear();
|
|
1171
|
+
}, x = (e) => {
|
|
1172
|
+
if (!J(e)) {
|
|
1173
|
+
y(e);
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
let t = p(e);
|
|
1177
|
+
if (_t(t)) {
|
|
1178
|
+
y(e);
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
let n = a.get(e);
|
|
1182
|
+
if (n && (n.timeoutId != null || n.paused)) return;
|
|
1183
|
+
let r = {
|
|
1184
|
+
timeoutId: null,
|
|
1185
|
+
remaining: t,
|
|
1186
|
+
startedAt: Date.now(),
|
|
1187
|
+
paused: !1
|
|
1188
|
+
};
|
|
1189
|
+
r.timeoutId = setTimeout(() => k(e), t), a.set(e, r), o.add(e);
|
|
1190
|
+
}, S = (e) => {
|
|
1191
|
+
let t = a.get(e);
|
|
1192
|
+
!t || t.paused || (t.timeoutId != null && (clearTimeout(t.timeoutId), t.timeoutId = null, t.remaining = Math.max(0, t.remaining - (Date.now() - t.startedAt))), t.paused = !0);
|
|
1193
|
+
}, C = (e) => {
|
|
1194
|
+
let t = a.get(e);
|
|
1195
|
+
if (!(!t || !t.paused)) {
|
|
1196
|
+
if (t.paused = !1, t.remaining <= 0) {
|
|
1197
|
+
k(e);
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
t.startedAt = Date.now(), t.timeoutId = setTimeout(() => k(e), t.remaining);
|
|
1201
|
+
}
|
|
1202
|
+
}, w = (e) => {
|
|
1203
|
+
mt(e.querySelectorAll(t.closeSelector)).filter((t) => u(t) === e).forEach((e) => {
|
|
1204
|
+
gt(e) || (e.setAttribute("role", "button"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0")), !e.hasAttribute("aria-label") && !e.hasAttribute("aria-labelledby") && !e.textContent?.trim() && e.setAttribute("aria-label", "Dismiss");
|
|
1205
|
+
});
|
|
1206
|
+
}, T = (e) => {
|
|
1207
|
+
if (!e.hasAttribute("aria-live")) {
|
|
1208
|
+
let t = e.getAttribute("toast-live") === "assertive" ? "assertive" : "polite";
|
|
1209
|
+
e.setAttribute("aria-live", t);
|
|
1210
|
+
}
|
|
1211
|
+
e.hasAttribute("aria-relevant") || e.setAttribute("aria-relevant", "additions");
|
|
1212
|
+
}, E = (e, t) => {
|
|
1213
|
+
let n = t.getAttribute("toast") === "error" || m(e, t) ? "alert" : "status";
|
|
1214
|
+
t.getAttribute("role") !== n && t.setAttribute("role", n), w(t);
|
|
1215
|
+
}, D = (e, t) => {
|
|
1216
|
+
e.hidden !== !t && (e.hidden = !t);
|
|
1217
|
+
}, O = (e) => {
|
|
1218
|
+
let t = v(e);
|
|
1219
|
+
if (!t) return;
|
|
1220
|
+
let n = l(t);
|
|
1221
|
+
if (n) {
|
|
1222
|
+
if (T(n), E(n, t), J(t)) {
|
|
1223
|
+
h(t), x(t);
|
|
1224
|
+
return;
|
|
1225
|
+
}
|
|
1226
|
+
D(t, !0), h(t), y(t), x(t);
|
|
1227
|
+
}
|
|
1228
|
+
}, k = (e) => {
|
|
1229
|
+
let t = v(e);
|
|
1230
|
+
!t || !J(t) || (y(t), g(t), D(t, !1));
|
|
1231
|
+
}, A = () => {
|
|
1232
|
+
c().forEach((e) => {
|
|
1233
|
+
T(e), d(e).forEach((t) => {
|
|
1234
|
+
if (E(e, t), J(t)) {
|
|
1235
|
+
h(t, !1), x(t);
|
|
1236
|
+
return;
|
|
1237
|
+
}
|
|
1238
|
+
y(t), g(t);
|
|
1239
|
+
});
|
|
1240
|
+
}), o.forEach((e) => {
|
|
1241
|
+
(!e.isConnected || !f(e) || !J(e)) && y(e);
|
|
1242
|
+
});
|
|
1243
|
+
}, j = (e) => {
|
|
1244
|
+
let n = e.target;
|
|
1245
|
+
if (!(n instanceof Element)) return;
|
|
1246
|
+
let r = n.closest(t.closeSelector);
|
|
1247
|
+
if (!(r instanceof HTMLElement)) return;
|
|
1248
|
+
let i = u(r);
|
|
1249
|
+
!i || !f(i) || ht(e) && k(i);
|
|
1250
|
+
}, M = (e, t) => {
|
|
1251
|
+
let n = e.relatedTarget;
|
|
1252
|
+
return !(n instanceof Node && t.contains(n));
|
|
1253
|
+
}, N = (e) => {
|
|
1254
|
+
let t = e.target;
|
|
1255
|
+
if (!(t instanceof Element)) return;
|
|
1256
|
+
let n = u(t instanceof HTMLElement ? t : t.parentElement);
|
|
1257
|
+
!n || !f(n) || !J(n) || S(n);
|
|
1258
|
+
}, P = (e) => {
|
|
1259
|
+
if (!(e instanceof MouseEvent)) return;
|
|
1260
|
+
let t = e.target;
|
|
1261
|
+
if (!(t instanceof Element)) return;
|
|
1262
|
+
let n = u(t instanceof HTMLElement ? t : t.parentElement);
|
|
1263
|
+
!n || !f(n) || !J(n) || M(e, n) && C(n);
|
|
1264
|
+
}, F = (e) => {
|
|
1265
|
+
let t = e.target;
|
|
1266
|
+
if (!(t instanceof Element)) return;
|
|
1267
|
+
let n = u(t instanceof HTMLElement ? t : t.parentElement);
|
|
1268
|
+
!n || !f(n) || !J(n) || S(n);
|
|
1269
|
+
}, I = (e) => {
|
|
1270
|
+
if (!(e instanceof FocusEvent)) return;
|
|
1271
|
+
let t = e.target;
|
|
1272
|
+
if (!(t instanceof Element)) return;
|
|
1273
|
+
let n = u(t instanceof HTMLElement ? t : t.parentElement);
|
|
1274
|
+
!n || !f(n) || !J(n) || M(e, n) && C(n);
|
|
1275
|
+
}, L = (e) => {
|
|
1276
|
+
if (!(e instanceof KeyboardEvent)) return;
|
|
1277
|
+
let n = e.target;
|
|
1278
|
+
if (!(n instanceof Element)) return;
|
|
1279
|
+
if (e.key === "Escape") {
|
|
1280
|
+
if (yt() || e.defaultPrevented) return;
|
|
1281
|
+
let t = _();
|
|
1282
|
+
if (!t || !ht(e)) return;
|
|
1283
|
+
e.preventDefault(), e.stopPropagation(), k(t);
|
|
1284
|
+
return;
|
|
1285
|
+
}
|
|
1286
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
1287
|
+
let r = n.closest(t.closeSelector);
|
|
1288
|
+
if (r instanceof HTMLElement && u(r) && !gt(r)) {
|
|
1289
|
+
if (!ht(e)) return;
|
|
1290
|
+
e.preventDefault(), k(r);
|
|
1291
|
+
}
|
|
1292
|
+
}, R = !1, z = () => {
|
|
1293
|
+
R || (R = !0, requestAnimationFrame(() => {
|
|
1294
|
+
R = !1, A();
|
|
1295
|
+
}));
|
|
1296
|
+
}, B = typeof MutationObserver < "u" ? new MutationObserver(() => z()) : null;
|
|
1297
|
+
return r.addEventListener("click", j), r.addEventListener("keydown", L), r.addEventListener("mouseover", N), r.addEventListener("mouseout", P), r.addEventListener("focusin", F), r.addEventListener("focusout", I), B && n instanceof Node && B.observe(n, {
|
|
1298
|
+
childList: !0,
|
|
1299
|
+
subtree: !0,
|
|
1300
|
+
attributes: !0,
|
|
1301
|
+
attributeFilter: [
|
|
1302
|
+
"hidden",
|
|
1303
|
+
"toast-region",
|
|
1304
|
+
"toast",
|
|
1305
|
+
"toast-close",
|
|
1306
|
+
"toast-duration",
|
|
1307
|
+
"toast-live",
|
|
1308
|
+
"aria-live",
|
|
1309
|
+
"aria-relevant"
|
|
1310
|
+
]
|
|
1311
|
+
}), A(), {
|
|
1312
|
+
destroy: () => {
|
|
1313
|
+
r.removeEventListener("click", j), r.removeEventListener("keydown", L), r.removeEventListener("mouseover", N), r.removeEventListener("mouseout", P), r.removeEventListener("focusin", F), r.removeEventListener("focusout", I), B?.disconnect(), b();
|
|
1314
|
+
},
|
|
1315
|
+
sync: A,
|
|
1316
|
+
show: O,
|
|
1317
|
+
dismiss: k
|
|
1318
|
+
};
|
|
1319
|
+
}, xt = (e = {}) => bt(e), St = null, Ct = !1, wt = null, Tt = () => {
|
|
1320
|
+
wt &&= (document.removeEventListener("DOMContentLoaded", wt), null);
|
|
1321
|
+
}, Et = () => typeof window > "u" || typeof document > "u" ? null : (Ct = !1, Tt(), St ? (St.sync(), St) : (St = bt(), St)), Dt = () => {
|
|
1322
|
+
Ct = !0, Tt(), St?.destroy(), St = null;
|
|
1323
|
+
};
|
|
1324
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (wt = () => {
|
|
1325
|
+
wt = null, Ct || Et();
|
|
1326
|
+
}, document.addEventListener("DOMContentLoaded", wt)) : Et());
|
|
1327
|
+
//#endregion
|
|
1328
|
+
//#region src/js/src/popover/popover-runtime.ts
|
|
1329
|
+
var Ot = {
|
|
1330
|
+
root: typeof document < "u" ? document : {},
|
|
1331
|
+
rootSelector: "[popover-root]",
|
|
1332
|
+
panelSelector: "[popover-panel]",
|
|
1333
|
+
closeSelector: "[popover-close]",
|
|
1334
|
+
gap: 8
|
|
1335
|
+
}, kt = new Set([
|
|
1336
|
+
"top",
|
|
1337
|
+
"bottom",
|
|
1338
|
+
"left",
|
|
1339
|
+
"right"
|
|
1340
|
+
]), At = (e) => Array.from(e), jt = "juice-popover-root", Mt = "juice-popover-panel", Nt = "juice-popover-title", Pt = A(), Ft = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(), Lt = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "popover", Rt = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, Y = (e) => !e.hasAttribute("hidden"), zt = (e) => {
|
|
1341
|
+
let t = e.getAttribute("popover-root");
|
|
1342
|
+
return t && kt.has(t) ? t : "bottom";
|
|
1343
|
+
}, Bt = (e) => {
|
|
1344
|
+
switch (e) {
|
|
1345
|
+
case "top": return "bottom";
|
|
1346
|
+
case "bottom": return "top";
|
|
1347
|
+
case "left": return "right";
|
|
1348
|
+
case "right": return "left";
|
|
1349
|
+
}
|
|
1350
|
+
}, Vt = (e, t, n, r, i) => {
|
|
1351
|
+
switch (e) {
|
|
1352
|
+
case "bottom": return {
|
|
1353
|
+
top: t.bottom + i,
|
|
1354
|
+
left: t.left
|
|
1355
|
+
};
|
|
1356
|
+
case "top": return {
|
|
1357
|
+
top: t.top - r - i,
|
|
1358
|
+
left: t.left
|
|
1359
|
+
};
|
|
1360
|
+
case "right": return {
|
|
1361
|
+
top: t.top,
|
|
1362
|
+
left: t.right + i
|
|
1363
|
+
};
|
|
1364
|
+
case "left": return {
|
|
1365
|
+
top: t.top,
|
|
1366
|
+
left: t.left - n - i
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
}, Ht = (e, t, n, r, i) => {
|
|
1370
|
+
let a = window.innerWidth, o = window.innerHeight;
|
|
1371
|
+
switch (e) {
|
|
1372
|
+
case "bottom": return t + i > o;
|
|
1373
|
+
case "top": return t < 0;
|
|
1374
|
+
case "right": return n + r > a;
|
|
1375
|
+
case "left": return n < 0;
|
|
1376
|
+
}
|
|
1377
|
+
}, Ut = (e) => (e ?? "").split(/[,\s]+/).map((e) => e.trim()).filter(Boolean), Wt = (e) => {
|
|
1378
|
+
if (!(e instanceof HTMLElement) || e === document.documentElement || e === document.body) return !1;
|
|
1379
|
+
let t = window.getComputedStyle(e);
|
|
1380
|
+
if (t.transform !== "none" || t.perspective !== "none" || t.filter !== "none") return !0;
|
|
1381
|
+
let n = t.getPropertyValue("backdrop-filter");
|
|
1382
|
+
return n && n !== "none" || Ut(t.willChange).some((e) => [
|
|
1383
|
+
"transform",
|
|
1384
|
+
"perspective",
|
|
1385
|
+
"filter",
|
|
1386
|
+
"backdrop-filter"
|
|
1387
|
+
].includes(e)) ? !0 : Ut(t.contain).some((e) => [
|
|
1388
|
+
"paint",
|
|
1389
|
+
"layout",
|
|
1390
|
+
"strict",
|
|
1391
|
+
"content"
|
|
1392
|
+
].includes(e));
|
|
1393
|
+
}, Gt = (e) => {
|
|
1394
|
+
let t = e.parentElement;
|
|
1395
|
+
for (; t && t !== document.documentElement;) {
|
|
1396
|
+
if (Wt(t)) return t;
|
|
1397
|
+
t = t.parentElement;
|
|
1398
|
+
}
|
|
1399
|
+
return null;
|
|
1400
|
+
}, Kt = (e, t, n) => {
|
|
1401
|
+
let r = Gt(e);
|
|
1402
|
+
if (!r) return {
|
|
1403
|
+
top: t,
|
|
1404
|
+
left: n
|
|
1405
|
+
};
|
|
1406
|
+
let i = r.getBoundingClientRect();
|
|
1407
|
+
return {
|
|
1408
|
+
top: t - i.top,
|
|
1409
|
+
left: n - i.left
|
|
1410
|
+
};
|
|
1411
|
+
}, qt = (e = {}) => {
|
|
1412
|
+
if (typeof window > "u" || typeof document > "u") return {
|
|
1413
|
+
destroy: () => {},
|
|
1414
|
+
sync: () => {},
|
|
1415
|
+
open: () => {},
|
|
1416
|
+
close: () => {},
|
|
1417
|
+
toggle: () => {}
|
|
1418
|
+
};
|
|
1419
|
+
let t = {
|
|
1420
|
+
...Ot,
|
|
1421
|
+
...e
|
|
1422
|
+
}, n = t.root ?? document, r = typeof e.gap == "number" && Number.isFinite(e.gap) ? e.gap : Ot.gap, i = 0, a = (e) => (i += 1, `${e}-${i}`), o = () => At(n.querySelectorAll(t.rootSelector)), s = (e) => {
|
|
1423
|
+
if (!e) return null;
|
|
1424
|
+
let n = e.closest(t.rootSelector);
|
|
1425
|
+
return n instanceof HTMLElement ? n : null;
|
|
1426
|
+
}, c = (e) => P(e, n), l = (e) => e?.matches(t.rootSelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : o().includes(e) : !1, u = (e) => At(e.querySelectorAll(t.panelSelector)).find((t) => s(t) === e) || At(e.querySelectorAll("[role=\"dialog\"]")).find((t) => s(t) === e) || (At(e.children).find((e) => e instanceof HTMLElement) ?? e), d = (e) => {
|
|
1427
|
+
if (s(e)) return null;
|
|
1428
|
+
for (let t of N(e)) {
|
|
1429
|
+
let e = c(t);
|
|
1430
|
+
if (e && l(e)) return e;
|
|
1431
|
+
}
|
|
1432
|
+
return null;
|
|
1433
|
+
}, f = (e) => {
|
|
1434
|
+
if (e) {
|
|
1435
|
+
if (l(e)) return e;
|
|
1436
|
+
let n = s(e);
|
|
1437
|
+
if (n && l(n)) return n;
|
|
1438
|
+
if (e.matches(t.closeSelector)) {
|
|
1439
|
+
let t = s(e);
|
|
1440
|
+
if (t && l(t)) return t;
|
|
1441
|
+
}
|
|
1442
|
+
let r = d(e);
|
|
1443
|
+
if (r) return r;
|
|
1444
|
+
let i = e.closest("[aria-controls]");
|
|
1445
|
+
if (i instanceof HTMLElement) {
|
|
1446
|
+
let e = d(i);
|
|
1447
|
+
if (e) return e;
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
return o().find(Y) ?? o()[0] ?? null;
|
|
1451
|
+
}, p = (e) => {
|
|
1452
|
+
let t = e.getAttribute("name");
|
|
1453
|
+
return t ? Lt(t) : e.id ? Lt(e.id) : null;
|
|
1454
|
+
}, m = (e) => e.id ? At(document.querySelectorAll("[aria-controls]")).filter((t) => s(t) ? !1 : N(t).includes(e.id)) : [], h = (e, t) => {
|
|
1455
|
+
let n = String(t);
|
|
1456
|
+
m(e).forEach((e) => {
|
|
1457
|
+
e.getAttribute("aria-expanded") !== n && e.setAttribute("aria-expanded", n), e.hasAttribute("aria-haspopup") || e.setAttribute("aria-haspopup", "dialog");
|
|
1458
|
+
});
|
|
1459
|
+
}, g = (e) => {
|
|
1460
|
+
let n = u(e), r = p(e);
|
|
1461
|
+
if (e.id ||= r ? `${r}-root` : a(jt), n.id ||= r ? `${r}-panel` : a(Mt), n.getAttribute("role") !== "dialog" && n.setAttribute("role", "dialog"), !n.hasAttribute("aria-labelledby") && !n.hasAttribute("aria-label")) {
|
|
1462
|
+
let e = n.querySelector("[popover-header] :is(h1,h2,h3,h4,h5,h6), :is(h1,h2,h3,h4,h5,h6)");
|
|
1463
|
+
e && (e.id ||= r ? `${r}-title` : a(Nt), n.setAttribute("aria-labelledby", e.id));
|
|
1464
|
+
}
|
|
1465
|
+
At(e.querySelectorAll(t.closeSelector)).filter((t) => s(t) === e).forEach((e) => {
|
|
1466
|
+
Rt(e) || (e.setAttribute("role", "button"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0")), !e.hasAttribute("aria-label") && !e.hasAttribute("aria-labelledby") && !e.textContent?.trim() && e.setAttribute("aria-label", "Close");
|
|
1467
|
+
}), m(e).forEach((t) => {
|
|
1468
|
+
Rt(t) || (t.setAttribute("role", "button"), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0")), t.hasAttribute("aria-haspopup") || t.setAttribute("aria-haspopup", "dialog"), t.hasAttribute("aria-expanded") || t.setAttribute("aria-expanded", String(Y(e)));
|
|
1469
|
+
});
|
|
1470
|
+
}, _ = (e, t) => {
|
|
1471
|
+
let n = document.activeElement instanceof HTMLElement ? document.activeElement : null, r = t && !e.contains(t) ? t : n && !e.contains(n) ? n : null;
|
|
1472
|
+
r && Ft.set(e, r), t && !e.contains(t) && It.set(e, t);
|
|
1473
|
+
}, v = (e) => {
|
|
1474
|
+
let t = Ft.get(e);
|
|
1475
|
+
Ft.delete(e), t?.isConnected && t.focus();
|
|
1476
|
+
}, y = (e) => {
|
|
1477
|
+
De(u(e));
|
|
1478
|
+
}, b = (e) => {
|
|
1479
|
+
e.style.removeProperty("position"), e.style.removeProperty("top"), e.style.removeProperty("left"), e.style.removeProperty("right"), e.style.removeProperty("bottom"), e.style.removeProperty("margin");
|
|
1480
|
+
let t = u(e);
|
|
1481
|
+
t !== e && t.style.removeProperty("margin");
|
|
1482
|
+
}, x = (e, t) => {
|
|
1483
|
+
let n = t ?? It.get(e) ?? m(e)[0] ?? null;
|
|
1484
|
+
if (!n) return;
|
|
1485
|
+
let i = u(e);
|
|
1486
|
+
e.style.position = "fixed", e.style.right = "auto", e.style.bottom = "auto", e.style.margin = "0", i !== e && (i.style.margin = "0");
|
|
1487
|
+
let a = zt(e), o = n.getBoundingClientRect(), s = e.getBoundingClientRect(), c = s.width || e.offsetWidth, l = s.height || e.offsetHeight, d = a, { top: f, left: p } = Vt(d, o, c, l, r);
|
|
1488
|
+
Ht(d, f, p, c, l) && (d = Bt(d), {top: f, left: p} = Vt(d, o, c, l, r)), {top: f, left: p} = Kt(e, f, p), e.style.top = `${f}px`, e.style.left = `${p}px`;
|
|
1489
|
+
}, S = (e, t) => {
|
|
1490
|
+
e.hidden !== !t && (e.hidden = !t);
|
|
1491
|
+
}, C = (e, t) => {
|
|
1492
|
+
g(e), S(e, !1), h(e, !1), b(e), t ? v(e) : Ft.delete(e);
|
|
1493
|
+
}, w = (e, n) => {
|
|
1494
|
+
o().concat(At(document.querySelectorAll(t.rootSelector))).forEach((t) => {
|
|
1495
|
+
t === e || !Y(t) || C(t, !1);
|
|
1496
|
+
}), _(e, n), g(e), S(e, !0), h(e, !0), x(e, n), y(e);
|
|
1497
|
+
}, T = (e) => {
|
|
1498
|
+
let t = f(e);
|
|
1499
|
+
if (t) {
|
|
1500
|
+
if (Y(t)) {
|
|
1501
|
+
g(t), h(t, !0), x(t);
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
w(t, e && d(e) === t ? e : e?.closest("[aria-controls]") instanceof HTMLElement && d(e.closest("[aria-controls]")) === t ? e.closest("[aria-controls]") : null);
|
|
1505
|
+
}
|
|
1506
|
+
}, E = (e, t = !0) => {
|
|
1507
|
+
let n = f(e);
|
|
1508
|
+
!n || !Y(n) || C(n, t);
|
|
1509
|
+
}, D = (e) => {
|
|
1510
|
+
let t = f(e);
|
|
1511
|
+
if (t) {
|
|
1512
|
+
if (Y(t)) {
|
|
1513
|
+
E(t);
|
|
1514
|
+
return;
|
|
1515
|
+
}
|
|
1516
|
+
T(e ?? t);
|
|
1517
|
+
}
|
|
1518
|
+
}, O = () => {
|
|
1519
|
+
o().forEach((e) => {
|
|
1520
|
+
Y(e) && x(e);
|
|
1521
|
+
});
|
|
1522
|
+
}, k = () => {
|
|
1523
|
+
o().forEach((e) => {
|
|
1524
|
+
g(e), h(e, Y(e)), Y(e) && x(e);
|
|
1525
|
+
});
|
|
1526
|
+
}, A = (e) => {
|
|
1527
|
+
let t = e instanceof HTMLElement ? e : e.closest("[aria-controls]");
|
|
1528
|
+
if (!(t instanceof HTMLElement) || s(t)) return null;
|
|
1529
|
+
if (d(t)) return t;
|
|
1530
|
+
let n = t.closest("[aria-controls]");
|
|
1531
|
+
return n instanceof HTMLElement && d(n) ? n : null;
|
|
1532
|
+
}, j = () => o().find(Y) ?? null, M = (e) => {
|
|
1533
|
+
let n = e.target;
|
|
1534
|
+
if (!(n instanceof Element)) return;
|
|
1535
|
+
let r = s(n);
|
|
1536
|
+
if (r && l(r)) {
|
|
1537
|
+
let i = n.closest(t.closeSelector) instanceof HTMLElement ? n.closest(t.closeSelector) : null;
|
|
1538
|
+
if (i && s(i) === r) {
|
|
1539
|
+
if (!Pt(e)) return;
|
|
1540
|
+
E(r);
|
|
1541
|
+
}
|
|
1542
|
+
return;
|
|
1543
|
+
}
|
|
1544
|
+
let i = A(n);
|
|
1545
|
+
if (i) {
|
|
1546
|
+
if (!Pt(e)) return;
|
|
1547
|
+
D(i);
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
let a = j();
|
|
1551
|
+
a && Pt(e) && E(a, !1);
|
|
1552
|
+
}, F = (e, t) => Oe(e, u(t)), I = (e) => {
|
|
1553
|
+
if (!(e instanceof KeyboardEvent)) return;
|
|
1554
|
+
let n = e.target;
|
|
1555
|
+
if (!(n instanceof Element)) return;
|
|
1556
|
+
let r = j();
|
|
1557
|
+
if (r && e.key === "Tab") {
|
|
1558
|
+
if (!Pt(e)) return;
|
|
1559
|
+
F(e, r);
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1562
|
+
if (e.key !== "Enter" && e.key !== " ") return;
|
|
1563
|
+
let i = n.closest(t.closeSelector);
|
|
1564
|
+
if (i instanceof HTMLElement && s(i) && !Rt(i)) {
|
|
1565
|
+
if (!Pt(e)) return;
|
|
1566
|
+
e.preventDefault(), E(i);
|
|
1567
|
+
return;
|
|
1568
|
+
}
|
|
1569
|
+
let a = A(n);
|
|
1570
|
+
!a || Rt(a) || Pt(e) && (e.preventDefault(), D(a));
|
|
1571
|
+
}, L = (e) => {
|
|
1572
|
+
if (!(e instanceof KeyboardEvent) || e.key !== "Escape" || ct() || e.defaultPrevented) return;
|
|
1573
|
+
let t = j();
|
|
1574
|
+
t && Pt(e) && (e.preventDefault(), e.stopPropagation(), E(t));
|
|
1575
|
+
}, R = !1, z = () => {
|
|
1576
|
+
R || (R = !0, requestAnimationFrame(() => {
|
|
1577
|
+
R = !1, k();
|
|
1578
|
+
}));
|
|
1579
|
+
}, B = !1, V = () => {
|
|
1580
|
+
B || (B = !0, requestAnimationFrame(() => {
|
|
1581
|
+
B = !1, O();
|
|
1582
|
+
}));
|
|
1583
|
+
}, H = typeof MutationObserver < "u" ? new MutationObserver(() => z()) : null;
|
|
1584
|
+
return document.addEventListener("click", M), document.addEventListener("keydown", I, !0), document.addEventListener("keydown", L), window.addEventListener("resize", V), window.addEventListener("scroll", V, !0), H && n instanceof Node && H.observe(n, {
|
|
1585
|
+
childList: !0,
|
|
1586
|
+
subtree: !0,
|
|
1587
|
+
attributes: !0,
|
|
1588
|
+
attributeFilter: [
|
|
1589
|
+
"hidden",
|
|
1590
|
+
"aria-controls",
|
|
1591
|
+
"aria-labelledby",
|
|
1592
|
+
"popover-root",
|
|
1593
|
+
"popover-panel",
|
|
1594
|
+
"popover-close",
|
|
1595
|
+
"popover-header"
|
|
1596
|
+
]
|
|
1597
|
+
}), k(), {
|
|
1598
|
+
destroy: () => {
|
|
1599
|
+
document.removeEventListener("click", M), document.removeEventListener("keydown", I, !0), document.removeEventListener("keydown", L), window.removeEventListener("resize", V), window.removeEventListener("scroll", V, !0), H?.disconnect();
|
|
1600
|
+
},
|
|
1601
|
+
sync: k,
|
|
1602
|
+
open: T,
|
|
1603
|
+
close: E,
|
|
1604
|
+
toggle: D
|
|
1605
|
+
};
|
|
1606
|
+
}, Jt = (e = {}) => qt(e), Yt = null, Xt = !1, Zt = null, Qt = () => {
|
|
1607
|
+
Zt &&= (document.removeEventListener("DOMContentLoaded", Zt), null);
|
|
1608
|
+
}, $t = () => typeof window > "u" || typeof document > "u" ? null : (Xt = !1, Qt(), Yt ? (Yt.sync(), Yt) : (Yt = qt(), Yt)), en = () => {
|
|
1609
|
+
Xt = !0, Qt(), Yt?.destroy(), Yt = null;
|
|
1610
|
+
};
|
|
1611
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (Zt = () => {
|
|
1612
|
+
Zt = null, Xt || $t();
|
|
1613
|
+
}, document.addEventListener("DOMContentLoaded", Zt)) : $t());
|
|
1614
|
+
//#endregion
|
|
1615
|
+
//#region src/js/src/tooltip/tooltip-runtime.ts
|
|
1616
|
+
var tn = {
|
|
1617
|
+
root: typeof document < "u" ? document : {},
|
|
1618
|
+
rootSelector: "[tooltip-root]",
|
|
1619
|
+
panelSelector: "[tooltip-panel]",
|
|
1620
|
+
gap: 8,
|
|
1621
|
+
hideDelay: 150
|
|
1622
|
+
}, nn = new Set([
|
|
1623
|
+
"top",
|
|
1624
|
+
"bottom",
|
|
1625
|
+
"left",
|
|
1626
|
+
"right"
|
|
1627
|
+
]), rn = (e) => Array.from(e), an = "juice-tooltip-root", on = A(), sn = /* @__PURE__ */ new WeakMap(), cn = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "tooltip", ln = (e) => M(e.getAttribute("aria-describedby")), un = (e, t) => {
|
|
1628
|
+
let n = M(e);
|
|
1629
|
+
return n.includes(t) ? n.join(" ") : [...n, t].join(" ");
|
|
1630
|
+
}, X = (e) => !e.hasAttribute("hidden"), dn = () => ct() || lt() || ut() || dt(), fn = (e) => {
|
|
1631
|
+
let t = e.getAttribute("tooltip-root");
|
|
1632
|
+
return t && nn.has(t) ? t : "top";
|
|
1633
|
+
}, pn = (e) => {
|
|
1634
|
+
switch (e) {
|
|
1635
|
+
case "top": return "bottom";
|
|
1636
|
+
case "bottom": return "top";
|
|
1637
|
+
case "left": return "right";
|
|
1638
|
+
case "right": return "left";
|
|
1639
|
+
}
|
|
1640
|
+
}, mn = (e, t, n, r, i) => {
|
|
1641
|
+
switch (e) {
|
|
1642
|
+
case "bottom": return {
|
|
1643
|
+
top: t.bottom + i,
|
|
1644
|
+
left: t.left
|
|
1645
|
+
};
|
|
1646
|
+
case "top": return {
|
|
1647
|
+
top: t.top - r - i,
|
|
1648
|
+
left: t.left
|
|
1649
|
+
};
|
|
1650
|
+
case "right": return {
|
|
1651
|
+
top: t.top,
|
|
1652
|
+
left: t.right + i
|
|
1653
|
+
};
|
|
1654
|
+
case "left": return {
|
|
1655
|
+
top: t.top,
|
|
1656
|
+
left: t.left - n - i
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
}, hn = (e, t, n, r, i) => {
|
|
1660
|
+
let a = window.innerWidth, o = window.innerHeight;
|
|
1661
|
+
switch (e) {
|
|
1662
|
+
case "bottom": return t + i > o;
|
|
1663
|
+
case "top": return t < 0;
|
|
1664
|
+
case "right": return n + r > a;
|
|
1665
|
+
case "left": return n < 0;
|
|
1666
|
+
}
|
|
1667
|
+
}, gn = (e) => (e ?? "").split(/[,\s]+/).map((e) => e.trim()).filter(Boolean), _n = (e) => {
|
|
1668
|
+
if (!(e instanceof HTMLElement) || e === document.documentElement || e === document.body) return !1;
|
|
1669
|
+
let t = window.getComputedStyle(e);
|
|
1670
|
+
if (t.transform !== "none" || t.perspective !== "none" || t.filter !== "none") return !0;
|
|
1671
|
+
let n = t.getPropertyValue("backdrop-filter");
|
|
1672
|
+
return n && n !== "none" || gn(t.willChange).some((e) => [
|
|
1673
|
+
"transform",
|
|
1674
|
+
"perspective",
|
|
1675
|
+
"filter",
|
|
1676
|
+
"backdrop-filter"
|
|
1677
|
+
].includes(e)) ? !0 : gn(t.contain).some((e) => [
|
|
1678
|
+
"paint",
|
|
1679
|
+
"layout",
|
|
1680
|
+
"strict",
|
|
1681
|
+
"content"
|
|
1682
|
+
].includes(e));
|
|
1683
|
+
}, vn = (e) => {
|
|
1684
|
+
let t = e.parentElement;
|
|
1685
|
+
for (; t && t !== document.documentElement;) {
|
|
1686
|
+
if (_n(t)) return t;
|
|
1687
|
+
t = t.parentElement;
|
|
1688
|
+
}
|
|
1689
|
+
return null;
|
|
1690
|
+
}, yn = (e, t, n) => {
|
|
1691
|
+
let r = vn(e);
|
|
1692
|
+
if (!r) return {
|
|
1693
|
+
top: t,
|
|
1694
|
+
left: n
|
|
1695
|
+
};
|
|
1696
|
+
let i = r.getBoundingClientRect();
|
|
1697
|
+
return {
|
|
1698
|
+
top: t - i.top,
|
|
1699
|
+
left: n - i.left
|
|
1700
|
+
};
|
|
1701
|
+
}, bn = (e = {}) => {
|
|
1702
|
+
if (typeof window > "u" || typeof document > "u") return {
|
|
1703
|
+
destroy: () => {},
|
|
1704
|
+
sync: () => {},
|
|
1705
|
+
show: () => {},
|
|
1706
|
+
hide: () => {}
|
|
1707
|
+
};
|
|
1708
|
+
let t = {
|
|
1709
|
+
...tn,
|
|
1710
|
+
...e
|
|
1711
|
+
}, n = t.root ?? document, r = typeof e.gap == "number" && Number.isFinite(e.gap) ? e.gap : tn.gap, i = typeof e.hideDelay == "number" && Number.isFinite(e.hideDelay) ? Math.max(0, e.hideDelay) : tn.hideDelay, a = 0, o = null, s = null, c = null, l = (e) => (a += 1, `${e}-${a}`), u = () => rn(n.querySelectorAll(t.rootSelector)), d = (e) => {
|
|
1712
|
+
if (!e) return null;
|
|
1713
|
+
let n = e.closest(t.rootSelector);
|
|
1714
|
+
return n instanceof HTMLElement ? n : null;
|
|
1715
|
+
}, f = (e) => P(e, n), p = (e) => e?.matches(t.rootSelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : u().includes(e) : !1, m = (e) => rn(e.querySelectorAll(t.panelSelector)).find((t) => d(t) === e) || rn(e.querySelectorAll("[role=\"tooltip\"]")).find((t) => d(t) === e) || (rn(e.children).find((e) => e instanceof HTMLElement) ?? e), h = (e) => {
|
|
1716
|
+
if (d(e)) return null;
|
|
1717
|
+
for (let t of ln(e)) {
|
|
1718
|
+
let e = f(t);
|
|
1719
|
+
if (e && p(e)) return e;
|
|
1720
|
+
}
|
|
1721
|
+
for (let t of N(e)) {
|
|
1722
|
+
let e = f(t);
|
|
1723
|
+
if (e && p(e)) return e;
|
|
1724
|
+
}
|
|
1725
|
+
return null;
|
|
1726
|
+
}, g = (e) => {
|
|
1727
|
+
let t = e instanceof HTMLElement ? e : e.parentElement;
|
|
1728
|
+
if (!t) return null;
|
|
1729
|
+
let n = t.closest("[aria-describedby]");
|
|
1730
|
+
if (n instanceof HTMLElement && h(n)) return n;
|
|
1731
|
+
let r = t.closest("[aria-controls]");
|
|
1732
|
+
return r instanceof HTMLElement && h(r) ? r : t instanceof HTMLElement && h(t) ? t : null;
|
|
1733
|
+
}, _ = () => u().find(X) ?? null, v = (e) => {
|
|
1734
|
+
if (e) {
|
|
1735
|
+
if (p(e)) return e;
|
|
1736
|
+
let t = d(e);
|
|
1737
|
+
if (t && p(t)) return t;
|
|
1738
|
+
if (h(e)) return h(e);
|
|
1739
|
+
let n = g(e);
|
|
1740
|
+
if (n) return h(n);
|
|
1741
|
+
}
|
|
1742
|
+
return _() ?? u()[0] ?? null;
|
|
1743
|
+
}, y = (e) => {
|
|
1744
|
+
let t = e.getAttribute("name");
|
|
1745
|
+
return t ? cn(t) : e.id ? cn(e.id) : null;
|
|
1746
|
+
}, b = (e) => {
|
|
1747
|
+
if (!e.id) return [];
|
|
1748
|
+
let t = /* @__PURE__ */ new Set(), n = [];
|
|
1749
|
+
return rn(document.querySelectorAll("[aria-describedby], [aria-controls]")).forEach((r) => {
|
|
1750
|
+
t.has(r) || d(r) || h(r) === e && (t.add(r), n.push(r));
|
|
1751
|
+
}), n;
|
|
1752
|
+
}, x = (e, t) => {
|
|
1753
|
+
if (!t.id) return;
|
|
1754
|
+
let n = un(e.getAttribute("aria-describedby"), t.id);
|
|
1755
|
+
e.getAttribute("aria-describedby") !== n && e.setAttribute("aria-describedby", n);
|
|
1756
|
+
}, S = (e) => {
|
|
1757
|
+
let t = m(e), n = y(e);
|
|
1758
|
+
e.id ||= n ? `${n}-root` : l(an), t.getAttribute("role") !== "tooltip" && t.setAttribute("role", "tooltip"), b(e).forEach((t) => {
|
|
1759
|
+
x(t, e);
|
|
1760
|
+
});
|
|
1761
|
+
}, C = (e, t) => {
|
|
1762
|
+
t && !e.contains(t) && sn.set(e, t);
|
|
1763
|
+
}, w = (e) => {
|
|
1764
|
+
e.style.removeProperty("position"), e.style.removeProperty("top"), e.style.removeProperty("left"), e.style.removeProperty("right"), e.style.removeProperty("bottom"), e.style.removeProperty("margin");
|
|
1765
|
+
let t = m(e);
|
|
1766
|
+
t !== e && t.style.removeProperty("margin");
|
|
1767
|
+
}, T = (e, t) => {
|
|
1768
|
+
let n = t ?? sn.get(e) ?? b(e)[0] ?? null;
|
|
1769
|
+
if (!n) return;
|
|
1770
|
+
let i = m(e);
|
|
1771
|
+
e.style.position = "fixed", e.style.right = "auto", e.style.bottom = "auto", e.style.margin = "0", i !== e && (i.style.margin = "0");
|
|
1772
|
+
let a = fn(e), o = n.getBoundingClientRect(), s = e.getBoundingClientRect(), c = s.width || e.offsetWidth, l = s.height || e.offsetHeight, u = a, { top: d, left: f } = mn(u, o, c, l, r);
|
|
1773
|
+
hn(u, d, f, c, l) && (u = pn(u), {top: d, left: f} = mn(u, o, c, l, r)), {top: d, left: f} = yn(e, d, f), e.style.top = `${d}px`, e.style.left = `${f}px`;
|
|
1774
|
+
}, E = (e, t) => {
|
|
1775
|
+
e.hidden !== !t && (e.hidden = !t);
|
|
1776
|
+
}, D = () => {
|
|
1777
|
+
o != null && (clearTimeout(o), o = null);
|
|
1778
|
+
}, O = (e) => {
|
|
1779
|
+
D(), S(e), E(e, !1), w(e);
|
|
1780
|
+
}, k = (e, n) => {
|
|
1781
|
+
D(), u().concat(rn(document.querySelectorAll(t.rootSelector))).forEach((t) => {
|
|
1782
|
+
t === e || !X(t) || O(t);
|
|
1783
|
+
}), C(e, n), S(e), n && x(n, e), E(e, !0), T(e, n);
|
|
1784
|
+
}, A = (e) => {
|
|
1785
|
+
let t = v(e);
|
|
1786
|
+
if (!t) return;
|
|
1787
|
+
let n = e && h(e) === t ? e : g(e ?? t);
|
|
1788
|
+
if (X(t)) {
|
|
1789
|
+
S(t), n && x(n, t), T(t, n);
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
k(t, n);
|
|
1793
|
+
}, j = (e) => {
|
|
1794
|
+
let t = v(e);
|
|
1795
|
+
!t || !X(t) || O(t);
|
|
1796
|
+
}, M = (e) => {
|
|
1797
|
+
if (D(), i <= 0) {
|
|
1798
|
+
O(e);
|
|
1799
|
+
return;
|
|
1800
|
+
}
|
|
1801
|
+
o = setTimeout(() => {
|
|
1802
|
+
o = null, !(s && h(s) === e) && (c && h(c) === e || O(e));
|
|
1803
|
+
}, i);
|
|
1804
|
+
}, F = () => {
|
|
1805
|
+
u().forEach((e) => {
|
|
1806
|
+
X(e) && T(e);
|
|
1807
|
+
});
|
|
1808
|
+
}, I = () => {
|
|
1809
|
+
u().forEach((e) => {
|
|
1810
|
+
S(e), X(e) && T(e);
|
|
1811
|
+
});
|
|
1812
|
+
}, L = (e) => {
|
|
1813
|
+
if (!(e instanceof MouseEvent)) return;
|
|
1814
|
+
let t = e.target;
|
|
1815
|
+
if (!(t instanceof Element)) return;
|
|
1816
|
+
let n = g(t);
|
|
1817
|
+
n && on(e) && (s = n, D(), A(n));
|
|
1818
|
+
}, R = (e) => {
|
|
1819
|
+
if (!(e instanceof MouseEvent)) return;
|
|
1820
|
+
let t = e.target;
|
|
1821
|
+
if (!(t instanceof Element)) return;
|
|
1822
|
+
let n = g(t);
|
|
1823
|
+
if (!n) return;
|
|
1824
|
+
let r = e.relatedTarget;
|
|
1825
|
+
if (r instanceof Node && n.contains(r) || !on(e)) return;
|
|
1826
|
+
s === n && (s = null);
|
|
1827
|
+
let i = h(n);
|
|
1828
|
+
!i || !X(i) || c && h(c) === i || M(i);
|
|
1829
|
+
}, z = (e) => {
|
|
1830
|
+
let t = e.target;
|
|
1831
|
+
if (!(t instanceof Element)) return;
|
|
1832
|
+
let n = g(t);
|
|
1833
|
+
n && on(e) && (c = n, D(), A(n));
|
|
1834
|
+
}, B = (e) => {
|
|
1835
|
+
if (!(e instanceof FocusEvent)) return;
|
|
1836
|
+
let t = e.target;
|
|
1837
|
+
if (!(t instanceof Element)) return;
|
|
1838
|
+
let n = g(t);
|
|
1839
|
+
if (!n) return;
|
|
1840
|
+
let r = e.relatedTarget;
|
|
1841
|
+
if (r instanceof Node && n.contains(r) || !on(e)) return;
|
|
1842
|
+
c === n && (c = null);
|
|
1843
|
+
let i = h(n);
|
|
1844
|
+
!i || !X(i) || s && h(s) === i || M(i);
|
|
1845
|
+
}, V = (e) => {
|
|
1846
|
+
if (!(e instanceof KeyboardEvent) || e.key !== "Escape" || dn() || e.defaultPrevented) return;
|
|
1847
|
+
let t = _();
|
|
1848
|
+
t && on(e) && (e.preventDefault(), e.stopPropagation(), O(t));
|
|
1849
|
+
}, H = !1, ee = () => {
|
|
1850
|
+
H || (H = !0, requestAnimationFrame(() => {
|
|
1851
|
+
H = !1, I();
|
|
1852
|
+
}));
|
|
1853
|
+
}, te = !1, ne = () => {
|
|
1854
|
+
te || (te = !0, requestAnimationFrame(() => {
|
|
1855
|
+
te = !1, F();
|
|
1856
|
+
}));
|
|
1857
|
+
}, U = typeof MutationObserver < "u" ? new MutationObserver(() => ee()) : null;
|
|
1858
|
+
return document.addEventListener("mouseover", L), document.addEventListener("mouseout", R), document.addEventListener("focusin", z), document.addEventListener("focusout", B), document.addEventListener("keydown", V), window.addEventListener("resize", ne), window.addEventListener("scroll", ne, !0), U && n instanceof Node && U.observe(n, {
|
|
1859
|
+
childList: !0,
|
|
1860
|
+
subtree: !0,
|
|
1861
|
+
attributes: !0,
|
|
1862
|
+
attributeFilter: [
|
|
1863
|
+
"hidden",
|
|
1864
|
+
"aria-describedby",
|
|
1865
|
+
"aria-controls",
|
|
1866
|
+
"tooltip-root",
|
|
1867
|
+
"tooltip-panel"
|
|
1868
|
+
]
|
|
1869
|
+
}), I(), {
|
|
1870
|
+
destroy: () => {
|
|
1871
|
+
D(), s = null, c = null, document.removeEventListener("mouseover", L), document.removeEventListener("mouseout", R), document.removeEventListener("focusin", z), document.removeEventListener("focusout", B), document.removeEventListener("keydown", V), window.removeEventListener("resize", ne), window.removeEventListener("scroll", ne, !0), U?.disconnect();
|
|
1872
|
+
},
|
|
1873
|
+
sync: I,
|
|
1874
|
+
show: A,
|
|
1875
|
+
hide: j
|
|
1876
|
+
};
|
|
1877
|
+
}, xn = (e = {}) => bn(e), Sn = null, Cn = !1, wn = null, Tn = () => {
|
|
1878
|
+
wn &&= (document.removeEventListener("DOMContentLoaded", wn), null);
|
|
1879
|
+
}, En = () => typeof window > "u" || typeof document > "u" ? null : (Cn = !1, Tn(), Sn ? (Sn.sync(), Sn) : (Sn = bn(), Sn)), Dn = () => {
|
|
1880
|
+
Cn = !0, Tn(), Sn?.destroy(), Sn = null;
|
|
1881
|
+
};
|
|
1882
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (wn = () => {
|
|
1883
|
+
wn = null, Cn || En();
|
|
1884
|
+
}, document.addEventListener("DOMContentLoaded", wn)) : En());
|
|
1885
|
+
//#endregion
|
|
1886
|
+
//#region src/js/src/wizard/wizard-runtime.ts
|
|
1887
|
+
var On = {
|
|
1888
|
+
root: typeof document < "u" ? document : {},
|
|
1889
|
+
shellSelector: "[wizard-shell]",
|
|
1890
|
+
trackerSelector: "[step-tracker]",
|
|
1891
|
+
stepsSelector: "[steps]",
|
|
1892
|
+
stepSelector: "[step]",
|
|
1893
|
+
pageSelector: "[step-page]",
|
|
1894
|
+
navSelector: "[step-nav]",
|
|
1895
|
+
nextSelector: "[wizard-next]",
|
|
1896
|
+
prevSelector: "[wizard-prev]",
|
|
1897
|
+
completeSelector: "[wizard-complete]"
|
|
1898
|
+
}, kn = (e) => Array.from(e), An = "juice-wizard-step", jn = "juice-wizard-page", Mn = A(), Nn = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLInputElement ? e.type === "button" || e.type === "submit" : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, Pn = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "wizard", Fn = (e, t) => {
|
|
1899
|
+
let n = e.compareDocumentPosition(t);
|
|
1900
|
+
return n & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : n & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
1901
|
+
}, In = (e) => {
|
|
1902
|
+
let t = (e.getAttribute("wizard-shell") || "").trim().toLowerCase();
|
|
1903
|
+
return t === "linear" ? "linear" : t === "free" ? "free" : "default";
|
|
1904
|
+
}, Ln = (e) => e.getAttribute("data-step") || e.getAttribute("name") || e.getAttribute("step-page") || (e.id ? e.id : null), Rn = (e) => {
|
|
1905
|
+
let t = /* @__PURE__ */ new Set(), n = e.getAttribute("data-step");
|
|
1906
|
+
n && t.add(n);
|
|
1907
|
+
let r = e.getAttribute("name");
|
|
1908
|
+
r && t.add(r);
|
|
1909
|
+
let i = e.getAttribute("step-page");
|
|
1910
|
+
return i && t.add(i), e.id && t.add(e.id), t;
|
|
1911
|
+
}, zn = (e, t, n) => t === n ? !0 : e === "linear" ? !1 : e === "free" ? !0 : t < n, Bn = (e) => (e instanceof HTMLButtonElement || e instanceof HTMLInputElement) && e.disabled ? !0 : e.getAttribute("aria-disabled") === "true", Vn = (e = {}) => {
|
|
1912
|
+
if (typeof window > "u" || typeof document > "u") return {
|
|
1913
|
+
destroy: () => {},
|
|
1914
|
+
sync: () => {},
|
|
1915
|
+
next: () => {},
|
|
1916
|
+
prev: () => {},
|
|
1917
|
+
goTo: () => {},
|
|
1918
|
+
current: () => 0
|
|
1919
|
+
};
|
|
1920
|
+
let t = {
|
|
1921
|
+
...On,
|
|
1922
|
+
...e
|
|
1923
|
+
}, n = t.root ?? document, r = n, i = () => kn(n.querySelectorAll(t.shellSelector)), a = (e) => {
|
|
1924
|
+
if (!e) return null;
|
|
1925
|
+
let n = e.closest(t.shellSelector);
|
|
1926
|
+
return n instanceof HTMLElement ? n : null;
|
|
1927
|
+
}, o = (e, t) => a(e) === t, s = (e) => {
|
|
1928
|
+
let n = e.querySelector(t.stepsSelector), r = e.querySelector(t.trackerSelector), i = n ?? r ?? e, a = /* @__PURE__ */ new Set(), s = [];
|
|
1929
|
+
return kn(i.querySelectorAll(t.stepSelector)).forEach((n) => {
|
|
1930
|
+
n instanceof HTMLElement && n.matches(t.stepSelector) && (!o(n, e) || a.has(n) || n.closest(t.pageSelector) || (a.add(n), s.push(n)));
|
|
1931
|
+
}), s.sort(Fn);
|
|
1932
|
+
}, c = (e) => kn(e.querySelectorAll(t.pageSelector)).filter((t) => o(t, e)).sort(Fn), l = (e) => kn(e.querySelectorAll(t.navSelector)).filter((t) => o(t, e)), u = (e, t) => kn(e.querySelectorAll(t)).filter((t) => o(t, e)), d = (e) => {
|
|
1933
|
+
let n = /* @__PURE__ */ new Set(), r = [], i = (t) => {
|
|
1934
|
+
t instanceof HTMLElement && (n.has(t) || !e.contains(t) || !o(t, a(e) ?? e) || (n.add(t), r.push(t)));
|
|
1935
|
+
};
|
|
1936
|
+
return kn(e.querySelectorAll("button")).forEach(i), kn(e.querySelectorAll(`${t.prevSelector}, ${t.nextSelector}`)).forEach(i), r.sort(Fn);
|
|
1937
|
+
}, f = (e) => {
|
|
1938
|
+
let n = u(e, t.prevSelector);
|
|
1939
|
+
if (n.length > 0) return n;
|
|
1940
|
+
let r = [];
|
|
1941
|
+
return l(e).forEach((e) => {
|
|
1942
|
+
let n = d(e).filter((e) => !e.matches(t.nextSelector));
|
|
1943
|
+
n.length >= 2 && r.push(n[0]);
|
|
1944
|
+
}), r;
|
|
1945
|
+
}, p = (e) => {
|
|
1946
|
+
let n = u(e, t.nextSelector);
|
|
1947
|
+
if (n.length > 0) return n;
|
|
1948
|
+
let r = [];
|
|
1949
|
+
return l(e).forEach((e) => {
|
|
1950
|
+
let n = d(e).filter((e) => !e.matches(t.prevSelector));
|
|
1951
|
+
n.length >= 2 ? r.push(n[n.length - 1]) : n.length === 1 && r.push(n[0]);
|
|
1952
|
+
}), r;
|
|
1953
|
+
}, m = (e) => u(e, t.completeSelector), h = (e, n) => {
|
|
1954
|
+
let r = c(e), i = s(e), a = n.getAttribute("aria-controls");
|
|
1955
|
+
if (a) {
|
|
1956
|
+
let n = e.querySelector(`#${j(a)}`);
|
|
1957
|
+
if (n && n.matches(t.pageSelector) && o(n, e)) return n;
|
|
1958
|
+
}
|
|
1959
|
+
let l = Ln(n);
|
|
1960
|
+
if (l) {
|
|
1961
|
+
let e = r.find((e) => Rn(e).has(l));
|
|
1962
|
+
if (e) return e;
|
|
1963
|
+
}
|
|
1964
|
+
let u = i.indexOf(n);
|
|
1965
|
+
return u >= 0 ? r[u] ?? null : null;
|
|
1966
|
+
}, g = (e, t) => {
|
|
1967
|
+
let n = s(e), r = c(e), i = n.find((n) => h(e, n) === t);
|
|
1968
|
+
if (i) return i;
|
|
1969
|
+
let a = r.indexOf(t);
|
|
1970
|
+
return a >= 0 ? n[a] ?? null : null;
|
|
1971
|
+
}, _ = (e, t) => {
|
|
1972
|
+
let n = s(e), r = c(e), i = n.findIndex((e) => e.id === t ? !0 : Rn(e).has(t));
|
|
1973
|
+
if (i >= 0) return i;
|
|
1974
|
+
let a = r.findIndex((e) => e.id === t ? !0 : Rn(e).has(t));
|
|
1975
|
+
if (a >= 0) {
|
|
1976
|
+
let t = g(e, r[a]), i = t ? n.indexOf(t) : a;
|
|
1977
|
+
return i >= 0 ? i : a;
|
|
1978
|
+
}
|
|
1979
|
+
return -1;
|
|
1980
|
+
}, v = (e) => {
|
|
1981
|
+
let t = Math.max(s(e).length, c(e).length);
|
|
1982
|
+
return Math.max(0, t - 1);
|
|
1983
|
+
}, y = (e) => {
|
|
1984
|
+
let t = s(e), n = c(e), r = t.findIndex((e) => e.getAttribute("step") === "active");
|
|
1985
|
+
if (r >= 0) return r;
|
|
1986
|
+
let i = n.find((e) => !e.hasAttribute("hidden"));
|
|
1987
|
+
if (i) {
|
|
1988
|
+
let r = g(e, i), a = r ? t.indexOf(r) : n.indexOf(i);
|
|
1989
|
+
if (a >= 0) return a;
|
|
1990
|
+
}
|
|
1991
|
+
let a = e.querySelector("[wizard-content]"), o = e.getAttribute("data-step") || a?.getAttribute("data-step");
|
|
1992
|
+
if (o) {
|
|
1993
|
+
let t = _(e, o);
|
|
1994
|
+
if (t >= 0) return t;
|
|
1995
|
+
}
|
|
1996
|
+
return 0;
|
|
1997
|
+
}, b = 0, x = (e) => (b += 1, `${e}-${b}`), S = (e) => {
|
|
1998
|
+
let t = e.getAttribute("name");
|
|
1999
|
+
return t ? Pn(t) : null;
|
|
2000
|
+
}, C = (e) => {
|
|
2001
|
+
let n = e.querySelector(t.stepsSelector);
|
|
2002
|
+
!n || !o(n, e) || n.tagName === "UL" || n.tagName === "OL" || n.getAttribute("role") || n.setAttribute("role", "list");
|
|
2003
|
+
}, w = (e, t, n, r, i) => {
|
|
2004
|
+
let a = s(e), o = S(e), l = a.length > 1 || c(e).length > 1 ? `-${r + 1}` : "";
|
|
2005
|
+
t.id ||= o ? `${o}-step${l}` : x(An), Nn(t) || (i && t.getAttribute("tabindex") !== "0" && t.setAttribute("tabindex", "0"), !i && t.getAttribute("tabindex") === "0" && t.removeAttribute("tabindex")), n && (n.id ||= o ? `${o}-page${l}` : x(jn), t.getAttribute("aria-controls") !== n.id && t.setAttribute("aria-controls", n.id), n.getAttribute("role") || n.setAttribute("role", "region"), !n.hasAttribute("aria-label") && !n.hasAttribute("aria-labelledby") && n.setAttribute("aria-labelledby", t.id));
|
|
2006
|
+
}, T = (e, t) => {
|
|
2007
|
+
(e instanceof HTMLButtonElement || e instanceof HTMLInputElement) && e.disabled !== t && (e.disabled = t);
|
|
2008
|
+
let n = String(t);
|
|
2009
|
+
e.getAttribute("aria-disabled") !== n && e.setAttribute("aria-disabled", n);
|
|
2010
|
+
}, E = (e, t) => {
|
|
2011
|
+
e.hidden !== !t && (e.hidden = !t);
|
|
2012
|
+
let n = String(!t);
|
|
2013
|
+
e.getAttribute("aria-hidden") !== n && e.setAttribute("aria-hidden", n);
|
|
2014
|
+
}, D = (e, t) => {
|
|
2015
|
+
let n = s(e), r = c(e);
|
|
2016
|
+
if (n.length === 0 && r.length === 0) return;
|
|
2017
|
+
let i = Math.min(Math.max(0, t), v(e)), a = In(e);
|
|
2018
|
+
C(e), n.forEach((t, n) => {
|
|
2019
|
+
let r = n < i ? "completed" : n === i ? "active" : "pending";
|
|
2020
|
+
t.getAttribute("step") !== r && t.setAttribute("step", r), n === i ? t.getAttribute("aria-current") !== "step" && t.setAttribute("aria-current", "step") : t.hasAttribute("aria-current") && t.removeAttribute("aria-current");
|
|
2021
|
+
let o = zn(a, n, i);
|
|
2022
|
+
w(e, t, h(e, t), n, o), o ? t.getAttribute("aria-disabled") === "true" && t.removeAttribute("aria-disabled") : t.getAttribute("aria-disabled") !== "true" && t.setAttribute("aria-disabled", "true");
|
|
2023
|
+
});
|
|
2024
|
+
let o = n[i] ?? null, l = o ? h(e, o) : r[i] ?? null;
|
|
2025
|
+
r.forEach((t) => {
|
|
2026
|
+
let a = g(e, t);
|
|
2027
|
+
E(t, (a ? n.indexOf(a) : r.indexOf(t)) === i), t.getAttribute("role") || t.setAttribute("role", "region");
|
|
2028
|
+
});
|
|
2029
|
+
let u = e.querySelector("[wizard-content]"), d = l && Ln(l) || o && Ln(o);
|
|
2030
|
+
u && d && u.getAttribute("data-step") !== d && u.setAttribute("data-step", d);
|
|
2031
|
+
let _ = i <= 0, y = i >= v(e);
|
|
2032
|
+
f(e).forEach((e) => T(e, _)), p(e).forEach((e) => T(e, y)), m(e).forEach((e) => T(e, !y));
|
|
2033
|
+
}, O = (e) => {
|
|
2034
|
+
if (e) {
|
|
2035
|
+
let t = a(e);
|
|
2036
|
+
if (t) return t;
|
|
2037
|
+
}
|
|
2038
|
+
return i()[0] ?? null;
|
|
2039
|
+
}, k = (e) => {
|
|
2040
|
+
let t = O(e);
|
|
2041
|
+
return t ? y(t) : 0;
|
|
2042
|
+
}, A = (e, t) => {
|
|
2043
|
+
let n = O(t);
|
|
2044
|
+
if (!n) return;
|
|
2045
|
+
let r = typeof e == "number" ? e : _(n, e);
|
|
2046
|
+
r < 0 || D(n, r);
|
|
2047
|
+
}, M = (e) => {
|
|
2048
|
+
let t = O(e);
|
|
2049
|
+
t && D(t, y(t) + 1);
|
|
2050
|
+
}, N = (e) => {
|
|
2051
|
+
let t = O(e);
|
|
2052
|
+
t && D(t, y(t) - 1);
|
|
2053
|
+
}, P = () => {
|
|
2054
|
+
i().forEach((e) => {
|
|
2055
|
+
D(e, y(e));
|
|
2056
|
+
});
|
|
2057
|
+
}, F = (e) => {
|
|
2058
|
+
if (!(e instanceof HTMLElement)) return null;
|
|
2059
|
+
let n = a(e);
|
|
2060
|
+
if (!n || e.closest(t.pageSelector)) return null;
|
|
2061
|
+
let r = e.closest(t.stepSelector);
|
|
2062
|
+
return !(r instanceof HTMLElement) || !o(r, n) || r.closest(t.pageSelector) ? null : s(n).includes(r) ? r : null;
|
|
2063
|
+
}, I = (e) => {
|
|
2064
|
+
if (!(e instanceof HTMLElement)) return null;
|
|
2065
|
+
let n = a(e);
|
|
2066
|
+
if (!n) return null;
|
|
2067
|
+
let r = e.closest(t.completeSelector);
|
|
2068
|
+
if (r instanceof HTMLElement && o(r, n)) return "complete";
|
|
2069
|
+
let i = e.closest(t.nextSelector);
|
|
2070
|
+
if (i instanceof HTMLElement && o(i, n)) return "next";
|
|
2071
|
+
let s = e.closest(t.prevSelector);
|
|
2072
|
+
if (s instanceof HTMLElement && o(s, n)) return "prev";
|
|
2073
|
+
let c = e.closest(t.navSelector);
|
|
2074
|
+
if (!(c instanceof HTMLElement) || !o(c, n)) return null;
|
|
2075
|
+
let l = e.closest("button, [wizard-next], [wizard-prev]");
|
|
2076
|
+
return !(l instanceof HTMLElement) || !c.contains(l) ? null : p(n).includes(l) ? "next" : f(n).includes(l) ? "prev" : null;
|
|
2077
|
+
}, L = (e) => {
|
|
2078
|
+
let t = a(e);
|
|
2079
|
+
if (!t) return;
|
|
2080
|
+
let n = s(t).indexOf(e);
|
|
2081
|
+
n < 0 || zn(In(t), n, y(t)) && D(t, n);
|
|
2082
|
+
}, R = (e) => {
|
|
2083
|
+
let n = e.target;
|
|
2084
|
+
if (!(n instanceof Element)) return;
|
|
2085
|
+
let r = I(n), i = n instanceof HTMLElement ? n.closest(`${t.nextSelector}, ${t.prevSelector}, ${t.completeSelector}, button`) : null;
|
|
2086
|
+
if (i instanceof HTMLElement && Bn(i) && (r === "next" || r === "prev" || r === "complete")) return;
|
|
2087
|
+
if (r === "complete") {
|
|
2088
|
+
Mn(e);
|
|
2089
|
+
return;
|
|
2090
|
+
}
|
|
2091
|
+
if (r === "next") {
|
|
2092
|
+
if (!Mn(e)) return;
|
|
2093
|
+
M(n);
|
|
2094
|
+
return;
|
|
2095
|
+
}
|
|
2096
|
+
if (r === "prev") {
|
|
2097
|
+
if (!Mn(e)) return;
|
|
2098
|
+
N(n);
|
|
2099
|
+
return;
|
|
2100
|
+
}
|
|
2101
|
+
let a = F(n);
|
|
2102
|
+
a && Mn(e) && L(a);
|
|
2103
|
+
}, z = (e) => {
|
|
2104
|
+
if (!(e instanceof KeyboardEvent) || e.key !== "Enter" && e.key !== " ") return;
|
|
2105
|
+
let t = e.target;
|
|
2106
|
+
if (!(t instanceof Element)) return;
|
|
2107
|
+
let n = I(t);
|
|
2108
|
+
if (n === "next" || n === "prev") {
|
|
2109
|
+
let r = t.closest("button, [wizard-next], [wizard-prev]");
|
|
2110
|
+
if (r instanceof HTMLElement && Nn(r) || !Mn(e)) return;
|
|
2111
|
+
e.preventDefault(), n === "next" ? M(t) : N(t);
|
|
2112
|
+
return;
|
|
2113
|
+
}
|
|
2114
|
+
let r = F(t);
|
|
2115
|
+
!r || Nn(r) || Mn(e) && (e.preventDefault(), L(r));
|
|
2116
|
+
}, B = !1, V = () => {
|
|
2117
|
+
B || (B = !0, requestAnimationFrame(() => {
|
|
2118
|
+
B = !1, P();
|
|
2119
|
+
}));
|
|
2120
|
+
}, H = typeof MutationObserver < "u" ? new MutationObserver(() => V()) : null;
|
|
2121
|
+
return r.addEventListener("click", R), r.addEventListener("keydown", z), H && n instanceof Node && H.observe(n, {
|
|
2122
|
+
childList: !0,
|
|
2123
|
+
subtree: !0,
|
|
2124
|
+
attributes: !0,
|
|
2125
|
+
attributeFilter: [
|
|
2126
|
+
"hidden",
|
|
2127
|
+
"step",
|
|
2128
|
+
"data-step",
|
|
2129
|
+
"aria-controls",
|
|
2130
|
+
"wizard-shell",
|
|
2131
|
+
"step-page",
|
|
2132
|
+
"wizard-next",
|
|
2133
|
+
"wizard-prev",
|
|
2134
|
+
"wizard-complete"
|
|
2135
|
+
]
|
|
2136
|
+
}), P(), {
|
|
2137
|
+
destroy: () => {
|
|
2138
|
+
r.removeEventListener("click", R), r.removeEventListener("keydown", z), H?.disconnect();
|
|
2139
|
+
},
|
|
2140
|
+
sync: P,
|
|
2141
|
+
next: M,
|
|
2142
|
+
prev: N,
|
|
2143
|
+
goTo: A,
|
|
2144
|
+
current: k
|
|
2145
|
+
};
|
|
2146
|
+
}, Hn = (e = {}) => Vn(e), Un = null, Wn = !1, Gn = null, Kn = () => {
|
|
2147
|
+
Gn &&= (document.removeEventListener("DOMContentLoaded", Gn), null);
|
|
2148
|
+
}, qn = () => typeof window > "u" || typeof document > "u" ? null : (Wn = !1, Kn(), Un ? (Un.sync(), Un) : (Un = Vn(), Un)), Jn = () => {
|
|
2149
|
+
Wn = !0, Kn(), Un?.destroy(), Un = null;
|
|
2150
|
+
};
|
|
2151
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (Gn = () => {
|
|
2152
|
+
Gn = null, Wn || qn();
|
|
2153
|
+
}, document.addEventListener("DOMContentLoaded", Gn)) : qn());
|
|
2154
|
+
//#endregion
|
|
2155
|
+
//#region src/js/src/combobox/combobox-runtime.ts
|
|
2156
|
+
var Yn = {
|
|
2157
|
+
root: typeof document < "u" ? document : {},
|
|
2158
|
+
rootSelector: "[combobox]",
|
|
2159
|
+
inputSelector: "[combobox-input]",
|
|
2160
|
+
triggerSelector: "[combobox-trigger]",
|
|
2161
|
+
listSelector: "[combobox-list]",
|
|
2162
|
+
optionSelector: "[combobox-option]"
|
|
2163
|
+
}, Xn = (e) => Array.from(e), Zn = "juice-combobox-list", Qn = "juice-combobox-option", $n = 0, er = (e) => {
|
|
2164
|
+
let t = "";
|
|
2165
|
+
do
|
|
2166
|
+
$n += 1, t = `${e}-${$n}`;
|
|
2167
|
+
while (typeof document < "u" && document.getElementById(t));
|
|
2168
|
+
return t;
|
|
2169
|
+
}, tr = (e, t, n) => e.id ? e.id : t && !document.getElementById(t) ? (e.id = t, t) : (e.id = er(n), e.id), Z = A(), nr = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "combobox", rr = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, ir = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement, ar = (e) => ir(e) ? e.value : e.textContent ?? "", or = (e, t) => {
|
|
2170
|
+
if (ir(e)) {
|
|
2171
|
+
e.value = t;
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
e.textContent = t;
|
|
2175
|
+
}, sr = (e) => e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement ? e.disabled : e.getAttribute("aria-disabled") === "true", cr = (e) => e.isComposing || e.keyCode === 229, lr = () => ct() || lt() || ut(), ur = () => ({
|
|
2176
|
+
destroy: () => {},
|
|
2177
|
+
sync: () => {},
|
|
2178
|
+
open: () => {},
|
|
2179
|
+
close: () => {},
|
|
2180
|
+
toggle: () => {},
|
|
2181
|
+
select: () => {}
|
|
2182
|
+
}), dr = (e = {}) => {
|
|
2183
|
+
if (typeof window > "u" || typeof document > "u") return ur();
|
|
2184
|
+
let t = {
|
|
2185
|
+
...Yn,
|
|
2186
|
+
...e
|
|
2187
|
+
}, n = t.root ?? document, r = () => Xn(n.querySelectorAll(t.rootSelector)), i = (e) => {
|
|
2188
|
+
if (!e) return null;
|
|
2189
|
+
let n = e.closest(t.rootSelector);
|
|
2190
|
+
return n instanceof HTMLElement ? n : null;
|
|
2191
|
+
}, a = (e) => e?.matches(t.rootSelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : r().includes(e) : !1, o = (e) => Xn(e.querySelectorAll(t.inputSelector)).find((t) => i(t) === e) ?? null, s = (e) => Xn(e.querySelectorAll(t.listSelector)).find((t) => i(t) === e) ?? null, c = (e) => Xn(e.querySelectorAll(t.triggerSelector)).find((t) => i(t) === e) ?? null, l = (e) => Xn((s(e) ?? e).querySelectorAll(t.optionSelector)).filter((t) => i(t) === e), u = (e) => {
|
|
2192
|
+
let t = s(e);
|
|
2193
|
+
return !!(t && !t.hasAttribute("hidden"));
|
|
2194
|
+
}, d = (e) => l(e).filter((e) => !e.hasAttribute("hidden")), f = (e) => d(e).find((e) => e.getAttribute("combobox-option") === "active") ?? null, p = (e) => {
|
|
2195
|
+
if (e) {
|
|
2196
|
+
if (a(e)) return e;
|
|
2197
|
+
let t = i(e);
|
|
2198
|
+
if (t && a(t)) return t;
|
|
2199
|
+
}
|
|
2200
|
+
return r().find(u) ?? r()[0] ?? null;
|
|
2201
|
+
}, m = (e) => {
|
|
2202
|
+
let t = e.getAttribute("name");
|
|
2203
|
+
return t ? nr(t) : e.id ? nr(e.id) : null;
|
|
2204
|
+
}, h = (e, t) => {
|
|
2205
|
+
if (!t || (e.textContent ?? "").trim().toLowerCase().includes(t)) return !0;
|
|
2206
|
+
let n = e.getAttribute("data-value");
|
|
2207
|
+
return n != null && n.toLowerCase().includes(t);
|
|
2208
|
+
}, g = (e) => {
|
|
2209
|
+
let t = o(e), n = t ? ar(t).trim().toLowerCase() : "";
|
|
2210
|
+
if (l(e).forEach((e) => {
|
|
2211
|
+
let t = h(e, n);
|
|
2212
|
+
e.hidden !== !t && (e.hidden = !t);
|
|
2213
|
+
}), !f(e)) {
|
|
2214
|
+
l(e).forEach((e) => {
|
|
2215
|
+
e.getAttribute("combobox-option") === "active" && e.setAttribute("combobox-option", "");
|
|
2216
|
+
});
|
|
2217
|
+
let t = o(e);
|
|
2218
|
+
t?.hasAttribute("aria-activedescendant") && t.removeAttribute("aria-activedescendant");
|
|
2219
|
+
}
|
|
2220
|
+
}, _ = (e) => {
|
|
2221
|
+
l(e).forEach((e) => {
|
|
2222
|
+
e.hidden &&= !1;
|
|
2223
|
+
});
|
|
2224
|
+
}, v = (e, t) => {
|
|
2225
|
+
let n = String(t), r = o(e);
|
|
2226
|
+
r && r.getAttribute("aria-expanded") !== n && r.setAttribute("aria-expanded", n);
|
|
2227
|
+
let i = c(e);
|
|
2228
|
+
i && i.getAttribute("aria-expanded") !== n && i.setAttribute("aria-expanded", n);
|
|
2229
|
+
}, y = (e, t) => {
|
|
2230
|
+
let n = s(e);
|
|
2231
|
+
n && n.hidden !== !t && (n.hidden = !t);
|
|
2232
|
+
}, b = (e, t) => {
|
|
2233
|
+
let n = o(e);
|
|
2234
|
+
if (l(e).forEach((e) => {
|
|
2235
|
+
if (e === t) {
|
|
2236
|
+
e.getAttribute("combobox-option") !== "active" && e.setAttribute("combobox-option", "active");
|
|
2237
|
+
return;
|
|
2238
|
+
}
|
|
2239
|
+
e.getAttribute("combobox-option") === "active" && e.setAttribute("combobox-option", "");
|
|
2240
|
+
}), n) {
|
|
2241
|
+
if (t?.id) {
|
|
2242
|
+
n.getAttribute("aria-activedescendant") !== t.id && n.setAttribute("aria-activedescendant", t.id), typeof t.scrollIntoView == "function" && t.scrollIntoView({ block: "nearest" });
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
n.hasAttribute("aria-activedescendant") && n.removeAttribute("aria-activedescendant");
|
|
2246
|
+
}
|
|
2247
|
+
}, x = (e) => {
|
|
2248
|
+
let t = o(e), n = s(e), r = c(e), i = l(e);
|
|
2249
|
+
if (!t || !n) return;
|
|
2250
|
+
let a = m(e);
|
|
2251
|
+
t.getAttribute("role") !== "combobox" && t.setAttribute("role", "combobox"), t.getAttribute("aria-autocomplete") !== "list" && t.setAttribute("aria-autocomplete", "list"), tr(n, a ? `${a}-list` : null, Zn), n.getAttribute("role") !== "listbox" && n.setAttribute("role", "listbox"), t.getAttribute("aria-controls") !== n.id && t.setAttribute("aria-controls", n.id), i.forEach((e, t) => {
|
|
2252
|
+
tr(e, a ? `${a}-option-${t + 1}` : null, Qn), e.getAttribute("role") !== "option" && e.setAttribute("role", "option");
|
|
2253
|
+
}), r && (rr(r) || (r.setAttribute("role", "button"), r.hasAttribute("tabindex") || r.setAttribute("tabindex", "0")), r.getAttribute("aria-controls") !== n.id && r.setAttribute("aria-controls", n.id), r.hasAttribute("aria-haspopup") || r.setAttribute("aria-haspopup", "listbox")), v(e, u(e));
|
|
2254
|
+
}, S = (e) => {
|
|
2255
|
+
x(e), y(e, !1), v(e, !1), b(e, null), _(e);
|
|
2256
|
+
}, C = (e) => {
|
|
2257
|
+
r().concat(Xn(document.querySelectorAll(t.rootSelector))).forEach((t) => {
|
|
2258
|
+
t === e || !u(t) || S(t);
|
|
2259
|
+
}), x(e), g(e), y(e, !0), v(e, !0);
|
|
2260
|
+
}, w = (e) => {
|
|
2261
|
+
let t = p(e);
|
|
2262
|
+
if (!t) return;
|
|
2263
|
+
let n = o(t);
|
|
2264
|
+
if (!(!n || sr(n))) {
|
|
2265
|
+
if (u(t)) {
|
|
2266
|
+
x(t), g(t), v(t, !0);
|
|
2267
|
+
return;
|
|
2268
|
+
}
|
|
2269
|
+
C(t);
|
|
2270
|
+
}
|
|
2271
|
+
}, T = (e) => {
|
|
2272
|
+
let t = p(e);
|
|
2273
|
+
!t || !u(t) || S(t);
|
|
2274
|
+
}, E = (e) => {
|
|
2275
|
+
let t = p(e);
|
|
2276
|
+
if (t) {
|
|
2277
|
+
if (u(t)) {
|
|
2278
|
+
T(t);
|
|
2279
|
+
return;
|
|
2280
|
+
}
|
|
2281
|
+
w(e ?? t);
|
|
2282
|
+
}
|
|
2283
|
+
}, D = (e) => {
|
|
2284
|
+
let t = i(e);
|
|
2285
|
+
if (!t || !a(t)) return;
|
|
2286
|
+
let n = o(t);
|
|
2287
|
+
!n || sr(n) || (x(t), or(n, e.hasAttribute("data-value") ? e.getAttribute("data-value") ?? "" : (e.textContent ?? "").trim()), l(t).forEach((t) => {
|
|
2288
|
+
let n = String(t === e);
|
|
2289
|
+
t.getAttribute("aria-selected") !== n && t.setAttribute("aria-selected", n);
|
|
2290
|
+
}), b(t, e), S(t));
|
|
2291
|
+
}, O = (e) => {
|
|
2292
|
+
if (e) {
|
|
2293
|
+
if (e.matches(t.optionSelector)) {
|
|
2294
|
+
D(e);
|
|
2295
|
+
return;
|
|
2296
|
+
}
|
|
2297
|
+
let n = e.closest(t.optionSelector);
|
|
2298
|
+
if (n instanceof HTMLElement) {
|
|
2299
|
+
D(n);
|
|
2300
|
+
return;
|
|
2301
|
+
}
|
|
2302
|
+
}
|
|
2303
|
+
let n = p(e);
|
|
2304
|
+
if (!n) return;
|
|
2305
|
+
let r = f(n);
|
|
2306
|
+
r && D(r);
|
|
2307
|
+
}, k = (e, t) => {
|
|
2308
|
+
let n = d(e);
|
|
2309
|
+
if (n.length === 0) return;
|
|
2310
|
+
let r = t(n.findIndex((e) => e.getAttribute("combobox-option") === "active"), n.length), i = n[Math.max(0, Math.min(n.length - 1, r))];
|
|
2311
|
+
i && b(e, i);
|
|
2312
|
+
}, A = () => {
|
|
2313
|
+
r().forEach((e) => {
|
|
2314
|
+
if (x(e), u(e)) {
|
|
2315
|
+
g(e), v(e, !0);
|
|
2316
|
+
return;
|
|
2317
|
+
}
|
|
2318
|
+
v(e, !1);
|
|
2319
|
+
});
|
|
2320
|
+
}, j = (e, n) => {
|
|
2321
|
+
let r = e.closest(t.optionSelector);
|
|
2322
|
+
return r instanceof HTMLElement && i(r) === n ? r : null;
|
|
2323
|
+
}, M = (e, n) => {
|
|
2324
|
+
let r = e.closest(t.triggerSelector);
|
|
2325
|
+
return r instanceof HTMLElement && i(r) === n ? r : null;
|
|
2326
|
+
}, N = (e, n) => {
|
|
2327
|
+
let r = e.closest(t.inputSelector);
|
|
2328
|
+
return r instanceof HTMLElement && i(r) === n ? r : null;
|
|
2329
|
+
}, P = (e) => {
|
|
2330
|
+
let t = e.target;
|
|
2331
|
+
if (!(t instanceof Element)) return;
|
|
2332
|
+
let n = i(t);
|
|
2333
|
+
if (n && a(n)) {
|
|
2334
|
+
let r = j(t, n);
|
|
2335
|
+
if (r) {
|
|
2336
|
+
if (!Z(e)) return;
|
|
2337
|
+
D(r);
|
|
2338
|
+
return;
|
|
2339
|
+
}
|
|
2340
|
+
if (M(t, n)) {
|
|
2341
|
+
if (!Z(e)) return;
|
|
2342
|
+
E(n);
|
|
2343
|
+
let t = o(n);
|
|
2344
|
+
u(n) && t && document.activeElement !== t && t.focus();
|
|
2345
|
+
return;
|
|
2346
|
+
}
|
|
2347
|
+
return;
|
|
2348
|
+
}
|
|
2349
|
+
let s = r().filter(u);
|
|
2350
|
+
s.length !== 0 && Z(e) && s.forEach((e) => S(e));
|
|
2351
|
+
}, F = (e) => {
|
|
2352
|
+
let t = e.target;
|
|
2353
|
+
if (!(t instanceof Element)) return;
|
|
2354
|
+
let n = i(t);
|
|
2355
|
+
!n || !a(n) || j(t, n) && e.preventDefault();
|
|
2356
|
+
}, I = (e) => {
|
|
2357
|
+
let t = e.target;
|
|
2358
|
+
if (!(t instanceof Element)) return;
|
|
2359
|
+
let n = i(t);
|
|
2360
|
+
if (!n || !a(n)) return;
|
|
2361
|
+
let r = N(t, n);
|
|
2362
|
+
!r || sr(r) || Z(e) && w(n);
|
|
2363
|
+
}, L = (e) => {
|
|
2364
|
+
if (!(e instanceof FocusEvent)) return;
|
|
2365
|
+
let t = e.target;
|
|
2366
|
+
if (!(t instanceof Element)) return;
|
|
2367
|
+
let n = i(t);
|
|
2368
|
+
if (!n || !a(n) || !u(n) || !N(t, n)) return;
|
|
2369
|
+
let r = e.relatedTarget;
|
|
2370
|
+
r instanceof Node && n.contains(r) || Z(e) && S(n);
|
|
2371
|
+
}, R = (e) => {
|
|
2372
|
+
let t = e.target;
|
|
2373
|
+
if (!(t instanceof Element)) return;
|
|
2374
|
+
let n = i(t);
|
|
2375
|
+
if (!n || !a(n)) return;
|
|
2376
|
+
let r = N(t, n);
|
|
2377
|
+
!r || sr(r) || Z(e) && w(n);
|
|
2378
|
+
}, z = (e) => {
|
|
2379
|
+
if (!(e instanceof KeyboardEvent) || cr(e)) return;
|
|
2380
|
+
let t = e.target;
|
|
2381
|
+
if (!(t instanceof Element)) return;
|
|
2382
|
+
let n = i(t);
|
|
2383
|
+
if (!n || !a(n)) return;
|
|
2384
|
+
let r = N(t, n), s = M(t, n);
|
|
2385
|
+
if (!r && !s || r && sr(r)) return;
|
|
2386
|
+
if (e.key === "Escape") {
|
|
2387
|
+
if (!u(n) || lr() || e.defaultPrevented || !Z(e)) return;
|
|
2388
|
+
e.preventDefault(), e.stopPropagation(), T(n);
|
|
2389
|
+
return;
|
|
2390
|
+
}
|
|
2391
|
+
if (e.key === "Tab") {
|
|
2392
|
+
if (!u(n) || !Z(e)) return;
|
|
2393
|
+
T(n);
|
|
2394
|
+
return;
|
|
2395
|
+
}
|
|
2396
|
+
if (e.key === "ArrowDown") {
|
|
2397
|
+
if (!Z(e)) return;
|
|
2398
|
+
e.preventDefault(), u(n) || w(n), s && !r && o(n)?.focus(), k(n, (e) => e < 0 ? 0 : e + 1);
|
|
2399
|
+
return;
|
|
2400
|
+
}
|
|
2401
|
+
if (e.key === "ArrowUp") {
|
|
2402
|
+
if (!Z(e)) return;
|
|
2403
|
+
e.preventDefault(), u(n) || w(n), s && !r && o(n)?.focus(), k(n, (e, t) => e < 0 ? t - 1 : e - 1);
|
|
2404
|
+
return;
|
|
2405
|
+
}
|
|
2406
|
+
if (s && !r && !rr(s) && (e.key === "Enter" || e.key === " ")) {
|
|
2407
|
+
if (!Z(e)) return;
|
|
2408
|
+
e.preventDefault(), E(n);
|
|
2409
|
+
let t = o(n);
|
|
2410
|
+
u(n) && t && document.activeElement !== t && t.focus();
|
|
2411
|
+
return;
|
|
2412
|
+
}
|
|
2413
|
+
if (!r || !u(n)) return;
|
|
2414
|
+
if (e.key === "Home") {
|
|
2415
|
+
if (!Z(e)) return;
|
|
2416
|
+
e.preventDefault(), k(n, () => 0);
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
if (e.key === "End") {
|
|
2420
|
+
if (!Z(e)) return;
|
|
2421
|
+
e.preventDefault(), k(n, (e, t) => t - 1);
|
|
2422
|
+
return;
|
|
2423
|
+
}
|
|
2424
|
+
if (e.key !== "Enter") return;
|
|
2425
|
+
let c = f(n);
|
|
2426
|
+
c && Z(e) && (e.preventDefault(), D(c));
|
|
2427
|
+
}, B = !1, V = () => {
|
|
2428
|
+
B || (B = !0, requestAnimationFrame(() => {
|
|
2429
|
+
B = !1, A();
|
|
2430
|
+
}));
|
|
2431
|
+
}, H = typeof MutationObserver < "u" ? new MutationObserver(() => V()) : null;
|
|
2432
|
+
return document.addEventListener("click", P), document.addEventListener("mousedown", F), document.addEventListener("focusin", I), document.addEventListener("focusout", L), document.addEventListener("input", R), document.addEventListener("keydown", z), H && n instanceof Node && H.observe(n, {
|
|
2433
|
+
childList: !0,
|
|
2434
|
+
subtree: !0,
|
|
2435
|
+
attributes: !0,
|
|
2436
|
+
attributeFilter: [
|
|
2437
|
+
"hidden",
|
|
2438
|
+
"aria-expanded",
|
|
2439
|
+
"aria-selected",
|
|
2440
|
+
"aria-controls",
|
|
2441
|
+
"aria-activedescendant",
|
|
2442
|
+
"combobox",
|
|
2443
|
+
"combobox-input",
|
|
2444
|
+
"combobox-trigger",
|
|
2445
|
+
"combobox-list",
|
|
2446
|
+
"combobox-option"
|
|
2447
|
+
]
|
|
2448
|
+
}), A(), {
|
|
2449
|
+
destroy: () => {
|
|
2450
|
+
document.removeEventListener("click", P), document.removeEventListener("mousedown", F), document.removeEventListener("focusin", I), document.removeEventListener("focusout", L), document.removeEventListener("input", R), document.removeEventListener("keydown", z), H?.disconnect();
|
|
2451
|
+
},
|
|
2452
|
+
sync: A,
|
|
2453
|
+
open: w,
|
|
2454
|
+
close: T,
|
|
2455
|
+
toggle: E,
|
|
2456
|
+
select: O
|
|
2457
|
+
};
|
|
2458
|
+
}, fr = (e = {}) => dr(e), pr = null, mr = !1, hr = null, gr = () => {
|
|
2459
|
+
hr &&= (document.removeEventListener("DOMContentLoaded", hr), null);
|
|
2460
|
+
}, _r = () => typeof window > "u" || typeof document > "u" ? null : (mr = !1, gr(), pr ? (pr.sync(), pr) : (pr = dr(), pr)), vr = () => {
|
|
2461
|
+
mr = !0, gr(), pr?.destroy(), pr = null;
|
|
2462
|
+
};
|
|
2463
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (hr = () => {
|
|
2464
|
+
hr = null, mr || _r();
|
|
2465
|
+
}, document.addEventListener("DOMContentLoaded", hr)) : _r());
|
|
2466
|
+
//#endregion
|
|
2467
|
+
//#region src/js/src/banner/banner-runtime.ts
|
|
2468
|
+
var yr = {
|
|
2469
|
+
root: typeof document < "u" ? document : {},
|
|
2470
|
+
bannerSelector: "[banner]",
|
|
2471
|
+
closeSelector: "[banner-close]"
|
|
2472
|
+
}, br = "juice-banner:", xr = (e) => Array.from(e), Sr = A(), Cr = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, wr = (e) => !e.hasAttribute("hidden"), Tr = (e) => {
|
|
2473
|
+
let t = e.getAttribute("banner-tone");
|
|
2474
|
+
return t === "error" || t === "warning";
|
|
2475
|
+
}, Er = (e) => {
|
|
2476
|
+
let t = e.getAttribute("banner-persist");
|
|
2477
|
+
if (t !== "session" && t !== "local") return null;
|
|
2478
|
+
let n = e.getAttribute("name")?.trim(), r = e.id?.trim(), i = n || r;
|
|
2479
|
+
if (!i) return null;
|
|
2480
|
+
let a = t === "local" ? typeof localStorage > "u" ? null : localStorage : typeof sessionStorage > "u" ? null : sessionStorage;
|
|
2481
|
+
return a ? {
|
|
2482
|
+
storage: a,
|
|
2483
|
+
key: `${br}${i}`
|
|
2484
|
+
} : null;
|
|
2485
|
+
}, Dr = (e) => {
|
|
2486
|
+
let t = Er(e);
|
|
2487
|
+
if (!t) return !1;
|
|
2488
|
+
try {
|
|
2489
|
+
return t.storage.getItem(t.key) === "1";
|
|
2490
|
+
} catch {
|
|
2491
|
+
return !1;
|
|
2492
|
+
}
|
|
2493
|
+
}, Or = (e, t) => {
|
|
2494
|
+
let n = Er(e);
|
|
2495
|
+
if (n) try {
|
|
2496
|
+
if (t) {
|
|
2497
|
+
n.storage.setItem(n.key, "1");
|
|
2498
|
+
return;
|
|
2499
|
+
}
|
|
2500
|
+
n.storage.removeItem(n.key);
|
|
2501
|
+
} catch {}
|
|
2502
|
+
}, kr = (e = {}) => {
|
|
2503
|
+
if (typeof window > "u" || typeof document > "u") return {
|
|
2504
|
+
destroy: () => {},
|
|
2505
|
+
sync: () => {},
|
|
2506
|
+
show: () => {},
|
|
2507
|
+
dismiss: () => {}
|
|
2508
|
+
};
|
|
2509
|
+
let t = {
|
|
2510
|
+
...yr,
|
|
2511
|
+
...e
|
|
2512
|
+
}, n = t.root ?? document, r = n, i = () => xr(n.querySelectorAll(t.bannerSelector)), a = (e) => {
|
|
2513
|
+
if (!e) return null;
|
|
2514
|
+
let n = e.closest(t.bannerSelector);
|
|
2515
|
+
return n instanceof HTMLElement ? n : null;
|
|
2516
|
+
}, o = (e) => e?.matches(t.bannerSelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : i().includes(e) : !1, s = (e) => {
|
|
2517
|
+
if (e) {
|
|
2518
|
+
if (o(e)) return e;
|
|
2519
|
+
let t = a(e);
|
|
2520
|
+
if (t && o(t)) return t;
|
|
2521
|
+
}
|
|
2522
|
+
let t = i().filter(o);
|
|
2523
|
+
return t.find(wr) ?? t[0] ?? null;
|
|
2524
|
+
}, c = (e) => {
|
|
2525
|
+
xr(e.querySelectorAll(t.closeSelector)).filter((t) => a(t) === e).forEach((e) => {
|
|
2526
|
+
Cr(e) || (e.setAttribute("role", "button"), e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0")), !e.hasAttribute("aria-label") && !e.hasAttribute("aria-labelledby") && !e.textContent?.trim() && e.setAttribute("aria-label", "Dismiss");
|
|
2527
|
+
});
|
|
2528
|
+
}, l = (e) => {
|
|
2529
|
+
let t = Tr(e) ? "alert" : "status";
|
|
2530
|
+
e.getAttribute("role") !== t && e.setAttribute("role", t), c(e);
|
|
2531
|
+
}, u = (e, t) => {
|
|
2532
|
+
e.hidden !== !t && (e.hidden = !t);
|
|
2533
|
+
}, d = (e) => {
|
|
2534
|
+
let t = s(e);
|
|
2535
|
+
t && (Or(t, !1), l(t), !wr(t) && u(t, !0));
|
|
2536
|
+
}, f = (e) => {
|
|
2537
|
+
let t = s(e);
|
|
2538
|
+
!t || !wr(t) || (Or(t, !0), u(t, !1));
|
|
2539
|
+
}, p = () => {
|
|
2540
|
+
i().forEach((e) => {
|
|
2541
|
+
o(e) && (Dr(e) && wr(e) && u(e, !1), l(e));
|
|
2542
|
+
});
|
|
2543
|
+
}, m = (e) => {
|
|
2544
|
+
let n = e.target;
|
|
2545
|
+
if (!(n instanceof Element)) return;
|
|
2546
|
+
let r = n.closest(t.closeSelector);
|
|
2547
|
+
if (!(r instanceof HTMLElement)) return;
|
|
2548
|
+
let i = a(r);
|
|
2549
|
+
!i || !o(i) || Sr(e) && f(i);
|
|
2550
|
+
}, h = (e) => {
|
|
2551
|
+
if (!(e instanceof KeyboardEvent) || e.key !== "Enter" && e.key !== " ") return;
|
|
2552
|
+
let n = e.target;
|
|
2553
|
+
if (!(n instanceof Element)) return;
|
|
2554
|
+
let r = n.closest(t.closeSelector);
|
|
2555
|
+
if (r instanceof HTMLElement && a(r) && !Cr(r)) {
|
|
2556
|
+
if (!Sr(e)) return;
|
|
2557
|
+
e.preventDefault(), f(r);
|
|
2558
|
+
}
|
|
2559
|
+
}, g = !1, _ = () => {
|
|
2560
|
+
g || (g = !0, requestAnimationFrame(() => {
|
|
2561
|
+
g = !1, p();
|
|
2562
|
+
}));
|
|
2563
|
+
}, v = typeof MutationObserver < "u" ? new MutationObserver(() => _()) : null;
|
|
2564
|
+
return r.addEventListener("click", m), r.addEventListener("keydown", h), v && n instanceof Node && v.observe(n, {
|
|
2565
|
+
childList: !0,
|
|
2566
|
+
subtree: !0,
|
|
2567
|
+
attributes: !0,
|
|
2568
|
+
attributeFilter: [
|
|
2569
|
+
"hidden",
|
|
2570
|
+
"banner",
|
|
2571
|
+
"banner-close",
|
|
2572
|
+
"banner-tone",
|
|
2573
|
+
"banner-persist",
|
|
2574
|
+
"name",
|
|
2575
|
+
"id",
|
|
2576
|
+
"role",
|
|
2577
|
+
"aria-label"
|
|
2578
|
+
]
|
|
2579
|
+
}), p(), {
|
|
2580
|
+
destroy: () => {
|
|
2581
|
+
r.removeEventListener("click", m), r.removeEventListener("keydown", h), v?.disconnect();
|
|
2582
|
+
},
|
|
2583
|
+
sync: p,
|
|
2584
|
+
show: d,
|
|
2585
|
+
dismiss: f
|
|
2586
|
+
};
|
|
2587
|
+
}, Ar = (e = {}) => kr(e), jr = null, Mr = !1, Nr = null, Pr = () => {
|
|
2588
|
+
Nr &&= (document.removeEventListener("DOMContentLoaded", Nr), null);
|
|
2589
|
+
}, Fr = () => typeof window > "u" || typeof document > "u" ? null : (Mr = !1, Pr(), jr ? (jr.sync(), jr) : (jr = kr(), jr)), Ir = () => {
|
|
2590
|
+
Mr = !0, Pr(), jr?.destroy(), jr = null;
|
|
2591
|
+
};
|
|
2592
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (Nr = () => {
|
|
2593
|
+
Nr = null, Mr || Fr();
|
|
2594
|
+
}, document.addEventListener("DOMContentLoaded", Nr)) : Fr());
|
|
2595
|
+
//#endregion
|
|
2596
|
+
//#region src/js/src/menu/menu-runtime.ts
|
|
2597
|
+
var Lr = {
|
|
2598
|
+
root: typeof document < "u" ? document : {},
|
|
2599
|
+
rootSelector: "[menu-root]",
|
|
2600
|
+
buttonSelector: "[menu-button]",
|
|
2601
|
+
menuSelector: "[menu]",
|
|
2602
|
+
itemSelector: "[menuitem]",
|
|
2603
|
+
separatorSelector: "[menu-separator]",
|
|
2604
|
+
labelSelector: "[menu-label]"
|
|
2605
|
+
}, Q = (e) => Array.from(e), Rr = "juice-menu", zr = "juice-menuitem", Br = 0, Vr = (e) => {
|
|
2606
|
+
let t = "";
|
|
2607
|
+
do
|
|
2608
|
+
Br += 1, t = `${e}-${Br}`;
|
|
2609
|
+
while (typeof document < "u" && document.getElementById(t));
|
|
2610
|
+
return t;
|
|
2611
|
+
}, Hr = (e, t, n) => e.id ? e.id : t && !document.getElementById(t) ? (e.id = t, t) : (e.id = Vr(n), e.id), $ = A(), Ur = /* @__PURE__ */ new WeakMap(), Wr = /* @__PURE__ */ new WeakMap(), Gr = (e) => e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "menu", Kr = (e) => e instanceof HTMLButtonElement ? !0 : e instanceof HTMLAnchorElement ? e.hasAttribute("href") : !1, qr = (e) => !!(e.getAttribute("aria-disabled") === "true" || e instanceof HTMLButtonElement && e.disabled || e instanceof HTMLInputElement && e.disabled), Jr = () => ({
|
|
2612
|
+
destroy: () => {},
|
|
2613
|
+
sync: () => {},
|
|
2614
|
+
open: () => {},
|
|
2615
|
+
close: () => {},
|
|
2616
|
+
toggle: () => {},
|
|
2617
|
+
select: () => {}
|
|
2618
|
+
}), Yr = (e = {}) => {
|
|
2619
|
+
if (typeof window > "u" || typeof document > "u") return Jr();
|
|
2620
|
+
let t = {
|
|
2621
|
+
...Lr,
|
|
2622
|
+
...e
|
|
2623
|
+
}, n = t.root ?? document, r = () => Q(n.querySelectorAll(t.rootSelector)), i = (e) => {
|
|
2624
|
+
if (!e) return null;
|
|
2625
|
+
let n = e.closest(t.rootSelector);
|
|
2626
|
+
return n instanceof HTMLElement ? n : null;
|
|
2627
|
+
}, a = (e) => e?.matches(t.rootSelector) ? n instanceof Document ? !0 : n instanceof Node ? n.contains(e) : r().includes(e) : !1, o = (e) => Q(e.querySelectorAll(t.menuSelector)).find((t) => i(t) === e) ?? null, s = (e, t) => {
|
|
2628
|
+
let n = o(t);
|
|
2629
|
+
return !!(n && n.contains(e));
|
|
2630
|
+
}, c = (e) => {
|
|
2631
|
+
let n = o(e);
|
|
2632
|
+
return n ? Q(n.querySelectorAll(t.itemSelector)).filter((t) => i(t) === e) : [];
|
|
2633
|
+
}, l = (e) => c(e).filter((e) => !e.hasAttribute("hidden") && !qr(e)), u = (e) => {
|
|
2634
|
+
let n = o(e);
|
|
2635
|
+
return n ? Q(n.querySelectorAll(t.separatorSelector)).filter((t) => i(t) === e) : [];
|
|
2636
|
+
}, d = (e) => {
|
|
2637
|
+
let n = Q(e.querySelectorAll(t.buttonSelector)).find((t) => i(t) === e && !s(t, e));
|
|
2638
|
+
if (n) return n;
|
|
2639
|
+
let r = Q(e.querySelectorAll("[aria-haspopup=\"menu\"]")).find((t) => i(t) === e && !s(t, e));
|
|
2640
|
+
if (r) return r;
|
|
2641
|
+
let a = o(e);
|
|
2642
|
+
if (a?.id) {
|
|
2643
|
+
let t = Q(e.querySelectorAll("[aria-controls]")).find((t) => i(t) !== e || s(t, e) ? !1 : N(t).includes(a.id));
|
|
2644
|
+
if (t) return t;
|
|
2645
|
+
}
|
|
2646
|
+
return Q(e.querySelectorAll("button, [role=\"button\"], a[href]")).find((t) => i(t) === e && !s(t, e)) ?? null;
|
|
2647
|
+
}, f = (e) => {
|
|
2648
|
+
let t = o(e);
|
|
2649
|
+
return !!(t && !t.hasAttribute("hidden"));
|
|
2650
|
+
}, p = (e) => l(e).find((e) => e.getAttribute("menuitem") === "active") ?? null, m = (e) => {
|
|
2651
|
+
if (e) {
|
|
2652
|
+
if (a(e)) return e;
|
|
2653
|
+
let t = i(e);
|
|
2654
|
+
if (t && a(t)) return t;
|
|
2655
|
+
}
|
|
2656
|
+
return r().find(f) ?? r()[0] ?? null;
|
|
2657
|
+
}, h = (e) => {
|
|
2658
|
+
let t = e.getAttribute("name");
|
|
2659
|
+
if (t) return Gr(t);
|
|
2660
|
+
if (e.id) return Gr(e.id);
|
|
2661
|
+
let n = o(e);
|
|
2662
|
+
return n?.id ? Gr(n.id) : null;
|
|
2663
|
+
}, g = (e, t) => {
|
|
2664
|
+
let n = d(e);
|
|
2665
|
+
if (!n) return;
|
|
2666
|
+
let r = String(t);
|
|
2667
|
+
n.getAttribute("aria-expanded") !== r && n.setAttribute("aria-expanded", r);
|
|
2668
|
+
}, _ = (e, t) => {
|
|
2669
|
+
let n = o(e);
|
|
2670
|
+
n && n.hidden !== !t && (n.hidden = !t);
|
|
2671
|
+
}, v = (e, t) => {
|
|
2672
|
+
let n = f(e);
|
|
2673
|
+
c(e).forEach((r) => {
|
|
2674
|
+
if (r === t && n && !qr(r)) {
|
|
2675
|
+
r.getAttribute("menuitem") !== "active" && r.setAttribute("menuitem", "active"), r.getAttribute("tabindex") !== "0" && r.setAttribute("tabindex", "0"), Ur.set(e, r);
|
|
2676
|
+
return;
|
|
2677
|
+
}
|
|
2678
|
+
r.getAttribute("menuitem") === "active" && r.setAttribute("menuitem", ""), r.getAttribute("tabindex") !== "-1" && r.setAttribute("tabindex", "-1");
|
|
2679
|
+
});
|
|
2680
|
+
}, y = (e, t, n) => {
|
|
2681
|
+
v(e, t), n && t && f(e) && typeof t.focus == "function" && t.focus();
|
|
2682
|
+
}, b = (e, t = "previous") => {
|
|
2683
|
+
let n = l(e);
|
|
2684
|
+
if (n.length === 0) return null;
|
|
2685
|
+
if (t === "last") return n[n.length - 1] ?? null;
|
|
2686
|
+
if (t === "first") return n[0] ?? null;
|
|
2687
|
+
let r = Ur.get(e);
|
|
2688
|
+
return r && n.includes(r) ? r : n.find((e) => e.getAttribute("menuitem") === "active") ?? n[0] ?? null;
|
|
2689
|
+
}, x = (e) => {
|
|
2690
|
+
let t = o(e);
|
|
2691
|
+
if (!t) return;
|
|
2692
|
+
let n = d(e), r = c(e), i = h(e);
|
|
2693
|
+
Hr(t, i ? `${i}-menu` : null, Rr), t.getAttribute("role") !== "menu" && t.setAttribute("role", "menu"), r.forEach((e, t) => {
|
|
2694
|
+
Hr(e, i ? `${i}-item-${t + 1}` : null, zr), e.getAttribute("role") !== "menuitem" && e.setAttribute("role", "menuitem");
|
|
2695
|
+
}), u(e).forEach((e) => {
|
|
2696
|
+
e.getAttribute("role") !== "separator" && e.setAttribute("role", "separator");
|
|
2697
|
+
}), n && (Kr(n) || (n.setAttribute("role", "button"), n.hasAttribute("tabindex") || n.setAttribute("tabindex", "0")), n.getAttribute("aria-haspopup") !== "menu" && n.setAttribute("aria-haspopup", "menu"), n.getAttribute("aria-controls") !== t.id && n.setAttribute("aria-controls", t.id)), g(e, f(e)), v(e, f(e) ? b(e) : null);
|
|
2698
|
+
}, S = (e, t) => {
|
|
2699
|
+
let n = document.activeElement instanceof HTMLElement ? document.activeElement : null, r = t && !s(t, e) ? t : n && !s(n, e) ? n : d(e);
|
|
2700
|
+
r && Wr.set(e, r);
|
|
2701
|
+
}, C = (e) => {
|
|
2702
|
+
let t = Wr.get(e) ?? d(e);
|
|
2703
|
+
Wr.delete(e), t?.isConnected && typeof t.focus == "function" && t.focus();
|
|
2704
|
+
}, w = (e, t) => {
|
|
2705
|
+
x(e), _(e, !1), g(e, !1), v(e, null), t ? C(e) : Wr.delete(e);
|
|
2706
|
+
}, T = (e, n, i = "previous") => {
|
|
2707
|
+
r().concat(Q(document.querySelectorAll(t.rootSelector))).forEach((t) => {
|
|
2708
|
+
t === e || !f(t) || w(t, !1);
|
|
2709
|
+
}), S(e, n ?? d(e)), x(e), _(e, !0), g(e, !0);
|
|
2710
|
+
let a = b(e, i);
|
|
2711
|
+
if (y(e, a, !0), !a) {
|
|
2712
|
+
let t = o(e);
|
|
2713
|
+
t && (t.hasAttribute("tabindex") || t.setAttribute("tabindex", "-1"), t.focus());
|
|
2714
|
+
}
|
|
2715
|
+
}, E = (e, t = "previous") => {
|
|
2716
|
+
let n = m(e);
|
|
2717
|
+
if (n) {
|
|
2718
|
+
if (f(n)) {
|
|
2719
|
+
x(n), g(n, !0);
|
|
2720
|
+
return;
|
|
2721
|
+
}
|
|
2722
|
+
T(n, e && d(n) === e ? e : d(n), t);
|
|
2723
|
+
}
|
|
2724
|
+
}, D = (e, t = !0) => {
|
|
2725
|
+
let n = m(e);
|
|
2726
|
+
!n || !f(n) || w(n, t);
|
|
2727
|
+
}, O = (e) => {
|
|
2728
|
+
let t = m(e);
|
|
2729
|
+
if (t) {
|
|
2730
|
+
if (f(t)) {
|
|
2731
|
+
D(t);
|
|
2732
|
+
return;
|
|
2733
|
+
}
|
|
2734
|
+
E(e ?? t);
|
|
2735
|
+
}
|
|
2736
|
+
}, k = (e) => {
|
|
2737
|
+
let t = i(e);
|
|
2738
|
+
!t || !a(t) || qr(e) || e.click();
|
|
2739
|
+
}, A = (e) => {
|
|
2740
|
+
if (e) {
|
|
2741
|
+
if (e.matches(t.itemSelector)) {
|
|
2742
|
+
k(e);
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2745
|
+
let n = e.closest(t.itemSelector);
|
|
2746
|
+
if (n instanceof HTMLElement) {
|
|
2747
|
+
k(n);
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
let n = m(e);
|
|
2752
|
+
if (!n) return;
|
|
2753
|
+
let r = p(n);
|
|
2754
|
+
r && k(r);
|
|
2755
|
+
}, j = (e, t) => {
|
|
2756
|
+
let n = l(e);
|
|
2757
|
+
if (n.length === 0) return;
|
|
2758
|
+
let r = n[(t(n.findIndex((e) => e.getAttribute("menuitem") === "active"), n.length) % n.length + n.length) % n.length];
|
|
2759
|
+
r && y(e, r, !0);
|
|
2760
|
+
}, M = () => {
|
|
2761
|
+
r().forEach((e) => {
|
|
2762
|
+
x(e), g(e, f(e));
|
|
2763
|
+
});
|
|
2764
|
+
}, P = (e, n) => {
|
|
2765
|
+
let r = e.closest(t.itemSelector);
|
|
2766
|
+
return r instanceof HTMLElement && i(r) === n ? r : null;
|
|
2767
|
+
}, F = (e, t) => {
|
|
2768
|
+
let n = d(t);
|
|
2769
|
+
return n && (e === n || n.contains(e)) ? n : null;
|
|
2770
|
+
}, I = () => r().find(f) ?? null, L = (e) => {
|
|
2771
|
+
let t = e.target;
|
|
2772
|
+
if (!(t instanceof Element)) return;
|
|
2773
|
+
let n = i(t);
|
|
2774
|
+
if (!n || !a(n)) return;
|
|
2775
|
+
let r = P(t, n);
|
|
2776
|
+
!r || !qr(r) || $(e) && (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
|
|
2777
|
+
}, R = (e) => {
|
|
2778
|
+
let t = e.target;
|
|
2779
|
+
if (!(t instanceof Element)) return;
|
|
2780
|
+
let n = i(t);
|
|
2781
|
+
if (n && a(n)) {
|
|
2782
|
+
let r = P(t, n);
|
|
2783
|
+
if (r) {
|
|
2784
|
+
if (qr(r) || !$(e)) return;
|
|
2785
|
+
Ur.set(n, r), w(n, !0);
|
|
2786
|
+
return;
|
|
2787
|
+
}
|
|
2788
|
+
if (F(t, n)) {
|
|
2789
|
+
if (!o(n) || !$(e)) return;
|
|
2790
|
+
e.preventDefault(), O(n);
|
|
2791
|
+
return;
|
|
2792
|
+
}
|
|
2793
|
+
if (s(t, n)) return;
|
|
2794
|
+
let i = I();
|
|
2795
|
+
if (!i || i !== n || !$(e)) return;
|
|
2796
|
+
w(i, !1);
|
|
2797
|
+
return;
|
|
2798
|
+
}
|
|
2799
|
+
let r = I();
|
|
2800
|
+
r && $(e) && w(r, !1);
|
|
2801
|
+
}, z = (e) => {
|
|
2802
|
+
if (!(e instanceof KeyboardEvent)) return;
|
|
2803
|
+
let t = e.target;
|
|
2804
|
+
if (!(t instanceof Element)) return;
|
|
2805
|
+
let n = i(t), r = I();
|
|
2806
|
+
if (e.key === "Escape") {
|
|
2807
|
+
if (!r || ct() || e.defaultPrevented || !$(e)) return;
|
|
2808
|
+
e.preventDefault(), e.stopPropagation(), D(r);
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
if (e.key === "Tab") {
|
|
2812
|
+
if (!r || !$(e)) return;
|
|
2813
|
+
D(r, !0);
|
|
2814
|
+
return;
|
|
2815
|
+
}
|
|
2816
|
+
if (!n || !a(n)) return;
|
|
2817
|
+
let s = F(t, n), c = P(t, n);
|
|
2818
|
+
if (e.key === "ArrowDown") {
|
|
2819
|
+
if (!f(n)) {
|
|
2820
|
+
if (!s || !o(n) || !$(e)) return;
|
|
2821
|
+
e.preventDefault(), E(s, "first");
|
|
2822
|
+
return;
|
|
2823
|
+
}
|
|
2824
|
+
if (!c && !s || !$(e)) return;
|
|
2825
|
+
e.preventDefault(), j(n, (e) => e < 0 ? 0 : e + 1);
|
|
2826
|
+
return;
|
|
2827
|
+
}
|
|
2828
|
+
if (e.key === "ArrowUp") {
|
|
2829
|
+
if (!f(n)) {
|
|
2830
|
+
if (!s || !o(n) || !$(e)) return;
|
|
2831
|
+
e.preventDefault(), E(s, "last");
|
|
2832
|
+
return;
|
|
2833
|
+
}
|
|
2834
|
+
if (!c && !s || !$(e)) return;
|
|
2835
|
+
e.preventDefault(), j(n, (e, t) => e < 0 ? t - 1 : e - 1);
|
|
2836
|
+
return;
|
|
2837
|
+
}
|
|
2838
|
+
if (!f(n)) {
|
|
2839
|
+
if (s && o(n) && !Kr(s) && (e.key === "Enter" || e.key === " ")) {
|
|
2840
|
+
if (!$(e)) return;
|
|
2841
|
+
e.preventDefault(), O(n);
|
|
2842
|
+
}
|
|
2843
|
+
return;
|
|
2844
|
+
}
|
|
2845
|
+
if (e.key === "Home") {
|
|
2846
|
+
if (!c && !s || !$(e)) return;
|
|
2847
|
+
e.preventDefault(), j(n, () => 0);
|
|
2848
|
+
return;
|
|
2849
|
+
}
|
|
2850
|
+
if (e.key === "End") {
|
|
2851
|
+
if (!c && !s || !$(e)) return;
|
|
2852
|
+
e.preventDefault(), j(n, (e, t) => t - 1);
|
|
2853
|
+
return;
|
|
2854
|
+
}
|
|
2855
|
+
if (!(e.key !== "Enter" && e.key !== " ")) {
|
|
2856
|
+
if (c && !qr(c)) {
|
|
2857
|
+
if (!$(e)) return;
|
|
2858
|
+
e.preventDefault(), c.click();
|
|
2859
|
+
return;
|
|
2860
|
+
}
|
|
2861
|
+
if (s && !Kr(s) && (e.key === "Enter" || e.key === " ")) {
|
|
2862
|
+
if (!$(e)) return;
|
|
2863
|
+
e.preventDefault(), O(n);
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
}, B = !1, V = () => {
|
|
2867
|
+
B || (B = !0, requestAnimationFrame(() => {
|
|
2868
|
+
B = !1, M();
|
|
2869
|
+
}));
|
|
2870
|
+
}, H = typeof MutationObserver < "u" ? new MutationObserver(() => V()) : null;
|
|
2871
|
+
return document.addEventListener("click", L, !0), document.addEventListener("click", R), document.addEventListener("keydown", z), H && n instanceof Node && H.observe(n, {
|
|
2872
|
+
childList: !0,
|
|
2873
|
+
subtree: !0,
|
|
2874
|
+
attributes: !0,
|
|
2875
|
+
attributeFilter: [
|
|
2876
|
+
"hidden",
|
|
2877
|
+
"aria-controls",
|
|
2878
|
+
"aria-expanded",
|
|
2879
|
+
"aria-disabled",
|
|
2880
|
+
"aria-haspopup",
|
|
2881
|
+
"disabled",
|
|
2882
|
+
"menu-root",
|
|
2883
|
+
"menu-button",
|
|
2884
|
+
"menu",
|
|
2885
|
+
"menuitem",
|
|
2886
|
+
"menu-separator",
|
|
2887
|
+
"menu-label"
|
|
2888
|
+
]
|
|
2889
|
+
}), M(), {
|
|
2890
|
+
destroy: () => {
|
|
2891
|
+
document.removeEventListener("click", L, !0), document.removeEventListener("click", R), document.removeEventListener("keydown", z), H?.disconnect();
|
|
2892
|
+
},
|
|
2893
|
+
sync: M,
|
|
2894
|
+
open: E,
|
|
2895
|
+
close: D,
|
|
2896
|
+
toggle: O,
|
|
2897
|
+
select: A
|
|
2898
|
+
};
|
|
2899
|
+
}, Xr = (e = {}) => Yr(e), Zr = null, Qr = !1, $r = null, ei = () => {
|
|
2900
|
+
$r &&= (document.removeEventListener("DOMContentLoaded", $r), null);
|
|
2901
|
+
}, ti = () => typeof window > "u" || typeof document > "u" ? null : (Qr = !1, ei(), Zr ? (Zr.sync(), Zr) : (Zr = Yr(), Zr)), ni = () => {
|
|
2902
|
+
Qr = !0, ei(), Zr?.destroy(), Zr = null;
|
|
898
2903
|
};
|
|
899
|
-
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? (
|
|
900
|
-
|
|
901
|
-
}, document.addEventListener("DOMContentLoaded",
|
|
2904
|
+
typeof window < "u" && typeof document < "u" && (document.readyState === "loading" ? ($r = () => {
|
|
2905
|
+
$r = null, Qr || ti();
|
|
2906
|
+
}, document.addEventListener("DOMContentLoaded", $r)) : ti());
|
|
902
2907
|
//#endregion
|
|
903
2908
|
//#region src/tokens/index.ts
|
|
904
|
-
var
|
|
2909
|
+
var ri = {
|
|
905
2910
|
colors: {
|
|
906
2911
|
families: [
|
|
907
2912
|
"black",
|
|
@@ -1069,4 +3074,4 @@ var Ie = {
|
|
|
1069
3074
|
themes: {}
|
|
1070
3075
|
};
|
|
1071
3076
|
//#endregion
|
|
1072
|
-
export { v as Accordion,
|
|
3077
|
+
export { v as Accordion, te as createAccordion, kr as createBanner, dr as createCombobox, $e as createDrawer, Yr as createMenu, Le as createModal, T as createNavigation, qt as createPopover, ge as createTabs, bt as createToast, bn as createTooltip, Vn as createWizard, ne as initAccordion, Ar as initBanner, fr as initCombobox, et as initDrawer, Xr as initMenu, Re as initModal, E as initNavigation, Jt as initPopover, _e as initTabs, xt as initToast, xn as initTooltip, Hn as initWizard, oe as startAccordionRuntime, Fr as startBannerRuntime, _r as startComboboxRuntime, at as startDrawerRuntime, ti as startMenuRuntime, Ue as startModalRuntime, O as startNavigationRuntime, $t as startPopoverRuntime, Se as startTabsRuntime, Et as startToastRuntime, En as startTooltipRuntime, qn as startWizardRuntime, se as stopAccordionRuntime, Ir as stopBannerRuntime, vr as stopComboboxRuntime, ot as stopDrawerRuntime, ni as stopMenuRuntime, We as stopModalRuntime, k as stopNavigationRuntime, en as stopPopoverRuntime, Ce as stopTabsRuntime, Dt as stopToastRuntime, Dn as stopTooltipRuntime, Jn as stopWizardRuntime, ri as tokens };
|