@unizap/uniui 1.0.96 → 1.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/uniui.js +461 -461
- package/dist/uniui.umd.cjs +25 -25
- package/package.json +1 -1
package/dist/uniui.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as k, jsx as s, Fragment as be } from "react/jsx-runtime";
|
|
3
3
|
import * as Dt from "react";
|
|
4
|
-
import Ae, { useRef as se, useState as q, useEffect as le, useCallback as
|
|
4
|
+
import Ae, { useRef as se, useState as q, useEffect as le, useCallback as Q, useMemo as $e, useReducer as xo, forwardRef as Ye, useImperativeHandle as Ut, Fragment as yo, memo as bo, useLayoutEffect as wo } from "react";
|
|
5
5
|
import { createPortal as He } from "react-dom";
|
|
6
6
|
const xe = {
|
|
7
7
|
dark: {
|
|
@@ -503,78 +503,79 @@ const Ee = ({
|
|
|
503
503
|
disabled: b = !1,
|
|
504
504
|
searchOn: h
|
|
505
505
|
}) => {
|
|
506
|
-
const [$, y] = q(!1), [C, x] = q(-1), [D, E] = q(""), [H, oe] = q({}), Z = se(null), re = se(null), ge = se(null),
|
|
507
|
-
l === void 0 && y(
|
|
508
|
-
}, V = g ? Array.isArray(e) ? e : [] : e && !Array.isArray(e) ? [e] : [], ue = I ? n.filter((
|
|
509
|
-
const P = typeof
|
|
510
|
-
if (
|
|
506
|
+
const [$, y] = q(!1), [C, x] = q(-1), [D, E] = q(""), [H, oe] = q({}), Z = se(null), re = se(null), ge = se(null), ee = se(null), I = zo(D, 300), O = l !== void 0 ? l : $, U = (S) => {
|
|
507
|
+
l === void 0 && y(S), S || E(""), a == null || a(S);
|
|
508
|
+
}, V = g ? Array.isArray(e) ? e : [] : e && !Array.isArray(e) ? [e] : [], ue = I ? n.filter((S) => {
|
|
509
|
+
const P = typeof S.label == "string" ? S.label : String(S.label), J = S.value ? String(S.value) : "", z = I.toLowerCase(), N = h || "label";
|
|
510
|
+
if (N === "label")
|
|
511
511
|
return P.toLowerCase().includes(z);
|
|
512
|
-
if (
|
|
513
|
-
return
|
|
514
|
-
if (
|
|
515
|
-
return P.toLowerCase().includes(z) ||
|
|
512
|
+
if (N === "value")
|
|
513
|
+
return J.toLowerCase().includes(z);
|
|
514
|
+
if (N === "both")
|
|
515
|
+
return P.toLowerCase().includes(z) || J.toLowerCase().includes(z);
|
|
516
516
|
{
|
|
517
|
-
const te =
|
|
517
|
+
const te = S[N];
|
|
518
518
|
return typeof te == "string" ? te.toLowerCase().includes(z) : !1;
|
|
519
519
|
}
|
|
520
|
-
}) : n,
|
|
521
|
-
(
|
|
522
|
-
(P) => P.label ===
|
|
520
|
+
}) : n, _ = ue.filter(
|
|
521
|
+
(S) => V.some(
|
|
522
|
+
(P) => P.label === S.label && P.value === S.value
|
|
523
523
|
)
|
|
524
524
|
), w = ue.filter(
|
|
525
|
-
(
|
|
526
|
-
(P) => P.label ===
|
|
525
|
+
(S) => !V.some(
|
|
526
|
+
(P) => P.label === S.label && P.value === S.value
|
|
527
527
|
)
|
|
528
|
-
),
|
|
528
|
+
), R = [..._, ...w], A = _.length > 0 && w.length > 0, L = (S) => {
|
|
529
529
|
if (g) {
|
|
530
530
|
const P = Array.isArray(e) ? e : [], z = P.some(
|
|
531
|
-
(
|
|
531
|
+
(N) => N.label === S.label && N.value === S.value
|
|
532
532
|
) ? P.filter(
|
|
533
|
-
(
|
|
534
|
-
) : [...P,
|
|
533
|
+
(N) => !(N.label === S.label && N.value === S.value)
|
|
534
|
+
) : [...P, S];
|
|
535
535
|
r == null || r(z);
|
|
536
536
|
} else
|
|
537
|
-
r == null || r(
|
|
538
|
-
}, j = (
|
|
537
|
+
r == null || r(S), i || (U(!1), E(""));
|
|
538
|
+
}, j = (S, P) => {
|
|
539
539
|
if (P.stopPropagation(), g && Array.isArray(e)) {
|
|
540
|
-
const
|
|
541
|
-
(z) => !(z.label ===
|
|
540
|
+
const J = e.filter(
|
|
541
|
+
(z) => !(z.label === S.label && z.value === S.value)
|
|
542
542
|
);
|
|
543
|
-
r == null || r(
|
|
543
|
+
r == null || r(J);
|
|
544
544
|
}
|
|
545
|
-
}, W = (
|
|
546
|
-
|
|
545
|
+
}, W = (S) => {
|
|
546
|
+
S.stopPropagation(), r == null || r(g ? [] : null);
|
|
547
547
|
};
|
|
548
548
|
le(() => {
|
|
549
|
-
const
|
|
549
|
+
const S = (P) => {
|
|
550
550
|
var te, ie;
|
|
551
|
-
const
|
|
552
|
-
!z && !
|
|
551
|
+
const J = P.target, z = (te = Z.current) == null ? void 0 : te.contains(J), N = (ie = re.current) == null ? void 0 : ie.contains(J);
|
|
552
|
+
!z && !N && (U(!1), x(-1));
|
|
553
553
|
};
|
|
554
|
-
return document.addEventListener("mousedown",
|
|
554
|
+
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
555
555
|
}, []);
|
|
556
|
-
const
|
|
556
|
+
const M = Q(() => {
|
|
557
557
|
if (Z.current) {
|
|
558
|
-
const
|
|
558
|
+
const S = Z.current.getBoundingClientRect(), P = Math.min(R.length * 44 + (u ? 48 : 0), c + 16), J = window.innerHeight - S.bottom, z = S.top, N = d === "top" || d === "auto" && J < P && z >= P;
|
|
559
559
|
oe({
|
|
560
560
|
position: "fixed",
|
|
561
|
-
top:
|
|
562
|
-
|
|
563
|
-
|
|
561
|
+
top: N ? void 0 : S.bottom + 4,
|
|
562
|
+
bottom: N ? window.innerHeight - S.top + 4 : void 0,
|
|
563
|
+
left: S.left,
|
|
564
|
+
width: S.width,
|
|
564
565
|
zIndex: 9999
|
|
565
566
|
});
|
|
566
567
|
}
|
|
567
|
-
}, []);
|
|
568
|
-
le(() => (O && (u &&
|
|
569
|
-
window.removeEventListener("scroll",
|
|
570
|
-
}), [O, u,
|
|
571
|
-
const T = (
|
|
572
|
-
|
|
568
|
+
}, [R.length, u, c, d]);
|
|
569
|
+
le(() => (O && (u && ee.current && ee.current.focus(), window.addEventListener("scroll", M, !0), window.addEventListener("resize", M)), () => {
|
|
570
|
+
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M);
|
|
571
|
+
}), [O, u, M]);
|
|
572
|
+
const T = (S) => {
|
|
573
|
+
S.key === "ArrowDown" ? (S.preventDefault(), O ? x((P) => Math.min(P + 1, R.length - 1)) : (M(), U(!0), x(0))) : S.key === "ArrowUp" ? (S.preventDefault(), x((P) => Math.max(P - 1, 0))) : S.key === "Enter" ? (S.preventDefault(), C >= 0 && R[C] && (L(R[C]), R[C].onClick(R[C]))) : S.key === "Escape" && (S.preventDefault(), U(!1), x(-1), E(""));
|
|
573
574
|
}, B = () => {
|
|
574
575
|
if (g) {
|
|
575
576
|
if (V.length === 0)
|
|
576
577
|
return /* @__PURE__ */ s("span", { className: "text-color-gray-400", children: v });
|
|
577
|
-
const P = V[0],
|
|
578
|
+
const P = V[0], J = V.length - 1;
|
|
578
579
|
return /* @__PURE__ */ k("div", { className: "flex items-center gap-2", children: [
|
|
579
580
|
/* @__PURE__ */ k("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-color-gray-100 rounded-md", children: [
|
|
580
581
|
/* @__PURE__ */ s("span", { children: P.label }),
|
|
@@ -592,15 +593,15 @@ const Ee = ({
|
|
|
592
593
|
}
|
|
593
594
|
)
|
|
594
595
|
] }),
|
|
595
|
-
|
|
596
|
+
J > 0 && /* @__PURE__ */ k("span", { className: "text-sm text-color-gray-500", children: [
|
|
596
597
|
"+",
|
|
597
|
-
|
|
598
|
+
J,
|
|
598
599
|
" more"
|
|
599
600
|
] })
|
|
600
601
|
] });
|
|
601
602
|
}
|
|
602
|
-
const
|
|
603
|
-
return
|
|
603
|
+
const S = V[0];
|
|
604
|
+
return S ? /* @__PURE__ */ s("span", { children: S.label }) : /* @__PURE__ */ s("span", { className: "text-color-gray-400", children: v });
|
|
604
605
|
};
|
|
605
606
|
return /* @__PURE__ */ k("div", { ref: Z, className: "relative inline-block w-full", children: [
|
|
606
607
|
/* @__PURE__ */ k(
|
|
@@ -608,7 +609,7 @@ const Ee = ({
|
|
|
608
609
|
{
|
|
609
610
|
type: "button",
|
|
610
611
|
onClick: () => {
|
|
611
|
-
b || (O ||
|
|
612
|
+
b || (O || M(), U(!O));
|
|
612
613
|
},
|
|
613
614
|
onKeyDown: T,
|
|
614
615
|
disabled: b,
|
|
@@ -641,11 +642,11 @@ const Ee = ({
|
|
|
641
642
|
u && /* @__PURE__ */ s("div", { className: "px-2 pb-2", children: /* @__PURE__ */ s(
|
|
642
643
|
"input",
|
|
643
644
|
{
|
|
644
|
-
ref:
|
|
645
|
+
ref: ee,
|
|
645
646
|
type: "text",
|
|
646
647
|
value: D,
|
|
647
|
-
onChange: (
|
|
648
|
-
E(
|
|
648
|
+
onChange: (S) => {
|
|
649
|
+
E(S.target.value), x(0);
|
|
649
650
|
},
|
|
650
651
|
onKeyDown: T,
|
|
651
652
|
placeholder: m,
|
|
@@ -658,36 +659,36 @@ const Ee = ({
|
|
|
658
659
|
ref: ge,
|
|
659
660
|
className: "overflow-y-auto",
|
|
660
661
|
style: { maxHeight: `${c}px` },
|
|
661
|
-
children:
|
|
662
|
-
|
|
662
|
+
children: R.length > 0 ? /* @__PURE__ */ k(be, { children: [
|
|
663
|
+
_.map((S, P) => /* @__PURE__ */ k(
|
|
663
664
|
"li",
|
|
664
665
|
{
|
|
665
666
|
onClick: () => {
|
|
666
|
-
|
|
667
|
+
L(S), S.onClick(S);
|
|
667
668
|
},
|
|
668
669
|
className: `flex items-center gap-3 cursor-pointer w-full px-4 py-2 text-left text-sm text-color-gray-700 bg-color-gray-200 hover:bg-color-gray-100
|
|
669
670
|
${C === P ? "bg-color-gray-100" : ""}`,
|
|
670
671
|
children: [
|
|
671
672
|
g && /* @__PURE__ */ s("span", { className: "flex items-center justify-center size-4 border rounded bg-color-blue-500 border-color-blue-500", children: /* @__PURE__ */ s("svg", { className: "size-3 text-color-white", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ s("path", { d: "M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z" }) }) }),
|
|
672
|
-
/* @__PURE__ */ s("span", { className: "flex-1", children:
|
|
673
|
+
/* @__PURE__ */ s("span", { className: "flex-1", children: S.label })
|
|
673
674
|
]
|
|
674
675
|
},
|
|
675
676
|
`selected-${P}`
|
|
676
677
|
)),
|
|
677
678
|
A && /* @__PURE__ */ s("li", { className: "border-t border-color-gray-200 my-1" }),
|
|
678
|
-
w.map((
|
|
679
|
-
const
|
|
679
|
+
w.map((S, P) => {
|
|
680
|
+
const J = _.length + (A ? 1 : 0) + P;
|
|
680
681
|
return /* @__PURE__ */ k(
|
|
681
682
|
"li",
|
|
682
683
|
{
|
|
683
684
|
onClick: () => {
|
|
684
|
-
|
|
685
|
+
L(S), S.onClick(S);
|
|
685
686
|
},
|
|
686
687
|
className: `flex items-center gap-3 cursor-pointer w-full px-4 py-2 text-left text-sm text-color-gray-700 hover:bg-color-gray-100
|
|
687
|
-
${C ===
|
|
688
|
+
${C === J ? "bg-color-gray-100" : ""}`,
|
|
688
689
|
children: [
|
|
689
690
|
g && /* @__PURE__ */ s("span", { className: "flex items-center justify-center size-4 border rounded border-color-gray-300" }),
|
|
690
|
-
/* @__PURE__ */ s("span", { className: "flex-1", children:
|
|
691
|
+
/* @__PURE__ */ s("span", { className: "flex-1", children: S.label })
|
|
691
692
|
]
|
|
692
693
|
},
|
|
693
694
|
`unselected-${P}`
|
|
@@ -800,8 +801,8 @@ function Mo() {
|
|
|
800
801
|
}
|
|
801
802
|
function C(z) {
|
|
802
803
|
if (typeof z == "object" && z !== null) {
|
|
803
|
-
var
|
|
804
|
-
switch (
|
|
804
|
+
var N = z.$$typeof;
|
|
805
|
+
switch (N) {
|
|
805
806
|
case n:
|
|
806
807
|
var te = z.type;
|
|
807
808
|
switch (te) {
|
|
@@ -822,28 +823,28 @@ function Mo() {
|
|
|
822
823
|
case l:
|
|
823
824
|
return ie;
|
|
824
825
|
default:
|
|
825
|
-
return
|
|
826
|
+
return N;
|
|
826
827
|
}
|
|
827
828
|
}
|
|
828
829
|
case t:
|
|
829
|
-
return
|
|
830
|
+
return N;
|
|
830
831
|
}
|
|
831
832
|
}
|
|
832
833
|
}
|
|
833
|
-
var x = c, D = d, E = a, H = l, oe = n, Z = u, re = o, ge = v,
|
|
834
|
-
function
|
|
834
|
+
var x = c, D = d, E = a, H = l, oe = n, Z = u, re = o, ge = v, ee = g, I = t, O = r, U = i, V = m, ue = !1;
|
|
835
|
+
function _(z) {
|
|
835
836
|
return ue || (ue = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), w(z) || C(z) === c;
|
|
836
837
|
}
|
|
837
838
|
function w(z) {
|
|
838
839
|
return C(z) === d;
|
|
839
840
|
}
|
|
840
|
-
function
|
|
841
|
+
function R(z) {
|
|
841
842
|
return C(z) === a;
|
|
842
843
|
}
|
|
843
844
|
function A(z) {
|
|
844
845
|
return C(z) === l;
|
|
845
846
|
}
|
|
846
|
-
function
|
|
847
|
+
function L(z) {
|
|
847
848
|
return typeof z == "object" && z !== null && z.$$typeof === n;
|
|
848
849
|
}
|
|
849
850
|
function j(z) {
|
|
@@ -852,7 +853,7 @@ function Mo() {
|
|
|
852
853
|
function W(z) {
|
|
853
854
|
return C(z) === o;
|
|
854
855
|
}
|
|
855
|
-
function
|
|
856
|
+
function M(z) {
|
|
856
857
|
return C(z) === v;
|
|
857
858
|
}
|
|
858
859
|
function T(z) {
|
|
@@ -861,16 +862,16 @@ function Mo() {
|
|
|
861
862
|
function B(z) {
|
|
862
863
|
return C(z) === t;
|
|
863
864
|
}
|
|
864
|
-
function
|
|
865
|
+
function S(z) {
|
|
865
866
|
return C(z) === r;
|
|
866
867
|
}
|
|
867
868
|
function P(z) {
|
|
868
869
|
return C(z) === i;
|
|
869
870
|
}
|
|
870
|
-
function
|
|
871
|
+
function J(z) {
|
|
871
872
|
return C(z) === m;
|
|
872
873
|
}
|
|
873
|
-
de.AsyncMode = x, de.ConcurrentMode = D, de.ContextConsumer = E, de.ContextProvider = H, de.Element = oe, de.ForwardRef = Z, de.Fragment = re, de.Lazy = ge, de.Memo =
|
|
874
|
+
de.AsyncMode = x, de.ConcurrentMode = D, de.ContextConsumer = E, de.ContextProvider = H, de.Element = oe, de.ForwardRef = Z, de.Fragment = re, de.Lazy = ge, de.Memo = ee, de.Portal = I, de.Profiler = O, de.StrictMode = U, de.Suspense = V, de.isAsyncMode = _, de.isConcurrentMode = w, de.isContextConsumer = R, de.isContextProvider = A, de.isElement = L, de.isForwardRef = j, de.isFragment = W, de.isLazy = M, de.isMemo = T, de.isPortal = B, de.isProfiler = S, de.isStrictMode = P, de.isSuspense = J, de.isValidElementType = y, de.typeOf = C;
|
|
874
875
|
}()), de;
|
|
875
876
|
}
|
|
876
877
|
var an;
|
|
@@ -1008,9 +1009,9 @@ function Po() {
|
|
|
1008
1009
|
return _t = function(a, c) {
|
|
1009
1010
|
var d = typeof Symbol == "function" && Symbol.iterator, u = "@@iterator";
|
|
1010
1011
|
function m(w) {
|
|
1011
|
-
var
|
|
1012
|
-
if (typeof
|
|
1013
|
-
return
|
|
1012
|
+
var R = w && (d && w[d] || w[u]);
|
|
1013
|
+
if (typeof R == "function")
|
|
1014
|
+
return R;
|
|
1014
1015
|
}
|
|
1015
1016
|
var p = "<<anonymous>>", g = {
|
|
1016
1017
|
array: h("array"),
|
|
@@ -1031,211 +1032,211 @@ function Po() {
|
|
|
1031
1032
|
oneOf: E,
|
|
1032
1033
|
oneOfType: oe,
|
|
1033
1034
|
shape: ge,
|
|
1034
|
-
exact:
|
|
1035
|
+
exact: ee
|
|
1035
1036
|
};
|
|
1036
|
-
function v(w,
|
|
1037
|
-
return w ===
|
|
1037
|
+
function v(w, R) {
|
|
1038
|
+
return w === R ? w !== 0 || 1 / w === 1 / R : w !== w && R !== R;
|
|
1038
1039
|
}
|
|
1039
|
-
function f(w,
|
|
1040
|
-
this.message = w, this.data =
|
|
1040
|
+
function f(w, R) {
|
|
1041
|
+
this.message = w, this.data = R && typeof R == "object" ? R : {}, this.stack = "";
|
|
1041
1042
|
}
|
|
1042
1043
|
f.prototype = Error.prototype;
|
|
1043
1044
|
function b(w) {
|
|
1044
1045
|
if (process.env.NODE_ENV !== "production")
|
|
1045
|
-
var
|
|
1046
|
-
function
|
|
1047
|
-
if (B = B || p, P = P || T,
|
|
1046
|
+
var R = {}, A = 0;
|
|
1047
|
+
function L(W, M, T, B, S, P, J) {
|
|
1048
|
+
if (B = B || p, P = P || T, J !== t) {
|
|
1048
1049
|
if (c) {
|
|
1049
1050
|
var z = new Error(
|
|
1050
1051
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
1051
1052
|
);
|
|
1052
1053
|
throw z.name = "Invariant Violation", z;
|
|
1053
1054
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
1054
|
-
var
|
|
1055
|
-
!
|
|
1055
|
+
var N = B + ":" + T;
|
|
1056
|
+
!R[N] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
1056
1057
|
A < 3 && (r(
|
|
1057
1058
|
"You are manually calling a React.PropTypes validation function for the `" + P + "` prop on `" + B + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
1058
|
-
),
|
|
1059
|
+
), R[N] = !0, A++);
|
|
1059
1060
|
}
|
|
1060
1061
|
}
|
|
1061
|
-
return
|
|
1062
|
+
return M[T] == null ? W ? M[T] === null ? new f("The " + S + " `" + P + "` is marked as required " + ("in `" + B + "`, but its value is `null`.")) : new f("The " + S + " `" + P + "` is marked as required in " + ("`" + B + "`, but its value is `undefined`.")) : null : w(M, T, B, S, P);
|
|
1062
1063
|
}
|
|
1063
|
-
var j =
|
|
1064
|
-
return j.isRequired =
|
|
1064
|
+
var j = L.bind(null, !1);
|
|
1065
|
+
return j.isRequired = L.bind(null, !0), j;
|
|
1065
1066
|
}
|
|
1066
1067
|
function h(w) {
|
|
1067
|
-
function
|
|
1068
|
-
var B = A[
|
|
1069
|
-
if (
|
|
1068
|
+
function R(A, L, j, W, M, T) {
|
|
1069
|
+
var B = A[L], S = U(B);
|
|
1070
|
+
if (S !== w) {
|
|
1070
1071
|
var P = V(B);
|
|
1071
1072
|
return new f(
|
|
1072
|
-
"Invalid " + W + " `" +
|
|
1073
|
+
"Invalid " + W + " `" + M + "` of type " + ("`" + P + "` supplied to `" + j + "`, expected ") + ("`" + w + "`."),
|
|
1073
1074
|
{ expectedType: w }
|
|
1074
1075
|
);
|
|
1075
1076
|
}
|
|
1076
1077
|
return null;
|
|
1077
1078
|
}
|
|
1078
|
-
return b(
|
|
1079
|
+
return b(R);
|
|
1079
1080
|
}
|
|
1080
1081
|
function $() {
|
|
1081
1082
|
return b(l);
|
|
1082
1083
|
}
|
|
1083
1084
|
function y(w) {
|
|
1084
|
-
function
|
|
1085
|
+
function R(A, L, j, W, M) {
|
|
1085
1086
|
if (typeof w != "function")
|
|
1086
|
-
return new f("Property `" +
|
|
1087
|
-
var T = A[
|
|
1087
|
+
return new f("Property `" + M + "` of component `" + j + "` has invalid PropType notation inside arrayOf.");
|
|
1088
|
+
var T = A[L];
|
|
1088
1089
|
if (!Array.isArray(T)) {
|
|
1089
1090
|
var B = U(T);
|
|
1090
|
-
return new f("Invalid " + W + " `" +
|
|
1091
|
+
return new f("Invalid " + W + " `" + M + "` of type " + ("`" + B + "` supplied to `" + j + "`, expected an array."));
|
|
1091
1092
|
}
|
|
1092
|
-
for (var
|
|
1093
|
-
var P = w(T,
|
|
1093
|
+
for (var S = 0; S < T.length; S++) {
|
|
1094
|
+
var P = w(T, S, j, W, M + "[" + S + "]", t);
|
|
1094
1095
|
if (P instanceof Error)
|
|
1095
1096
|
return P;
|
|
1096
1097
|
}
|
|
1097
1098
|
return null;
|
|
1098
1099
|
}
|
|
1099
|
-
return b(
|
|
1100
|
+
return b(R);
|
|
1100
1101
|
}
|
|
1101
1102
|
function C() {
|
|
1102
|
-
function w(
|
|
1103
|
-
var
|
|
1104
|
-
if (!a(
|
|
1105
|
-
var T = U(
|
|
1106
|
-
return new f("Invalid " + j + " `" + W + "` of type " + ("`" + T + "` supplied to `" +
|
|
1103
|
+
function w(R, A, L, j, W) {
|
|
1104
|
+
var M = R[A];
|
|
1105
|
+
if (!a(M)) {
|
|
1106
|
+
var T = U(M);
|
|
1107
|
+
return new f("Invalid " + j + " `" + W + "` of type " + ("`" + T + "` supplied to `" + L + "`, expected a single ReactElement."));
|
|
1107
1108
|
}
|
|
1108
1109
|
return null;
|
|
1109
1110
|
}
|
|
1110
1111
|
return b(w);
|
|
1111
1112
|
}
|
|
1112
1113
|
function x() {
|
|
1113
|
-
function w(
|
|
1114
|
-
var
|
|
1115
|
-
if (!e.isValidElementType(
|
|
1116
|
-
var T = U(
|
|
1117
|
-
return new f("Invalid " + j + " `" + W + "` of type " + ("`" + T + "` supplied to `" +
|
|
1114
|
+
function w(R, A, L, j, W) {
|
|
1115
|
+
var M = R[A];
|
|
1116
|
+
if (!e.isValidElementType(M)) {
|
|
1117
|
+
var T = U(M);
|
|
1118
|
+
return new f("Invalid " + j + " `" + W + "` of type " + ("`" + T + "` supplied to `" + L + "`, expected a single ReactElement type."));
|
|
1118
1119
|
}
|
|
1119
1120
|
return null;
|
|
1120
1121
|
}
|
|
1121
1122
|
return b(w);
|
|
1122
1123
|
}
|
|
1123
1124
|
function D(w) {
|
|
1124
|
-
function
|
|
1125
|
-
if (!(A[
|
|
1126
|
-
var T = w.name || p, B =
|
|
1127
|
-
return new f("Invalid " + W + " `" +
|
|
1125
|
+
function R(A, L, j, W, M) {
|
|
1126
|
+
if (!(A[L] instanceof w)) {
|
|
1127
|
+
var T = w.name || p, B = _(A[L]);
|
|
1128
|
+
return new f("Invalid " + W + " `" + M + "` of type " + ("`" + B + "` supplied to `" + j + "`, expected ") + ("instance of `" + T + "`."));
|
|
1128
1129
|
}
|
|
1129
1130
|
return null;
|
|
1130
1131
|
}
|
|
1131
|
-
return b(
|
|
1132
|
+
return b(R);
|
|
1132
1133
|
}
|
|
1133
1134
|
function E(w) {
|
|
1134
1135
|
if (!Array.isArray(w))
|
|
1135
1136
|
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? r(
|
|
1136
1137
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
1137
1138
|
) : r("Invalid argument supplied to oneOf, expected an array.")), l;
|
|
1138
|
-
function
|
|
1139
|
-
for (var T = A[
|
|
1139
|
+
function R(A, L, j, W, M) {
|
|
1140
|
+
for (var T = A[L], B = 0; B < w.length; B++)
|
|
1140
1141
|
if (v(T, w[B]))
|
|
1141
1142
|
return null;
|
|
1142
|
-
var
|
|
1143
|
-
var
|
|
1144
|
-
return
|
|
1143
|
+
var S = JSON.stringify(w, function(J, z) {
|
|
1144
|
+
var N = V(z);
|
|
1145
|
+
return N === "symbol" ? String(z) : z;
|
|
1145
1146
|
});
|
|
1146
|
-
return new f("Invalid " + W + " `" +
|
|
1147
|
+
return new f("Invalid " + W + " `" + M + "` of value `" + String(T) + "` " + ("supplied to `" + j + "`, expected one of " + S + "."));
|
|
1147
1148
|
}
|
|
1148
|
-
return b(
|
|
1149
|
+
return b(R);
|
|
1149
1150
|
}
|
|
1150
1151
|
function H(w) {
|
|
1151
|
-
function
|
|
1152
|
+
function R(A, L, j, W, M) {
|
|
1152
1153
|
if (typeof w != "function")
|
|
1153
|
-
return new f("Property `" +
|
|
1154
|
-
var T = A[
|
|
1154
|
+
return new f("Property `" + M + "` of component `" + j + "` has invalid PropType notation inside objectOf.");
|
|
1155
|
+
var T = A[L], B = U(T);
|
|
1155
1156
|
if (B !== "object")
|
|
1156
|
-
return new f("Invalid " + W + " `" +
|
|
1157
|
-
for (var
|
|
1158
|
-
if (o(T,
|
|
1159
|
-
var P = w(T,
|
|
1157
|
+
return new f("Invalid " + W + " `" + M + "` of type " + ("`" + B + "` supplied to `" + j + "`, expected an object."));
|
|
1158
|
+
for (var S in T)
|
|
1159
|
+
if (o(T, S)) {
|
|
1160
|
+
var P = w(T, S, j, W, M + "." + S, t);
|
|
1160
1161
|
if (P instanceof Error)
|
|
1161
1162
|
return P;
|
|
1162
1163
|
}
|
|
1163
1164
|
return null;
|
|
1164
1165
|
}
|
|
1165
|
-
return b(
|
|
1166
|
+
return b(R);
|
|
1166
1167
|
}
|
|
1167
1168
|
function oe(w) {
|
|
1168
1169
|
if (!Array.isArray(w))
|
|
1169
1170
|
return process.env.NODE_ENV !== "production" && r("Invalid argument supplied to oneOfType, expected an instance of array."), l;
|
|
1170
|
-
for (var
|
|
1171
|
-
var A = w[
|
|
1171
|
+
for (var R = 0; R < w.length; R++) {
|
|
1172
|
+
var A = w[R];
|
|
1172
1173
|
if (typeof A != "function")
|
|
1173
1174
|
return r(
|
|
1174
|
-
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ue(A) + " at index " +
|
|
1175
|
+
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + ue(A) + " at index " + R + "."
|
|
1175
1176
|
), l;
|
|
1176
1177
|
}
|
|
1177
|
-
function
|
|
1178
|
-
for (var
|
|
1179
|
-
var
|
|
1178
|
+
function L(j, W, M, T, B) {
|
|
1179
|
+
for (var S = [], P = 0; P < w.length; P++) {
|
|
1180
|
+
var J = w[P], z = J(j, W, M, T, B, t);
|
|
1180
1181
|
if (z == null)
|
|
1181
1182
|
return null;
|
|
1182
|
-
z.data && o(z.data, "expectedType") &&
|
|
1183
|
+
z.data && o(z.data, "expectedType") && S.push(z.data.expectedType);
|
|
1183
1184
|
}
|
|
1184
|
-
var
|
|
1185
|
-
return new f("Invalid " + T + " `" + B + "` supplied to " + ("`" +
|
|
1185
|
+
var N = S.length > 0 ? ", expected one of type [" + S.join(", ") + "]" : "";
|
|
1186
|
+
return new f("Invalid " + T + " `" + B + "` supplied to " + ("`" + M + "`" + N + "."));
|
|
1186
1187
|
}
|
|
1187
|
-
return b(
|
|
1188
|
+
return b(L);
|
|
1188
1189
|
}
|
|
1189
1190
|
function Z() {
|
|
1190
|
-
function w(
|
|
1191
|
-
return I(
|
|
1191
|
+
function w(R, A, L, j, W) {
|
|
1192
|
+
return I(R[A]) ? null : new f("Invalid " + j + " `" + W + "` supplied to " + ("`" + L + "`, expected a ReactNode."));
|
|
1192
1193
|
}
|
|
1193
1194
|
return b(w);
|
|
1194
1195
|
}
|
|
1195
|
-
function re(w,
|
|
1196
|
+
function re(w, R, A, L, j) {
|
|
1196
1197
|
return new f(
|
|
1197
|
-
(w || "React class") + ": " +
|
|
1198
|
+
(w || "React class") + ": " + R + " type `" + A + "." + L + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + j + "`."
|
|
1198
1199
|
);
|
|
1199
1200
|
}
|
|
1200
1201
|
function ge(w) {
|
|
1201
|
-
function
|
|
1202
|
-
var T = A[
|
|
1202
|
+
function R(A, L, j, W, M) {
|
|
1203
|
+
var T = A[L], B = U(T);
|
|
1203
1204
|
if (B !== "object")
|
|
1204
|
-
return new f("Invalid " + W + " `" +
|
|
1205
|
-
for (var
|
|
1206
|
-
var P = w[
|
|
1205
|
+
return new f("Invalid " + W + " `" + M + "` of type `" + B + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
1206
|
+
for (var S in w) {
|
|
1207
|
+
var P = w[S];
|
|
1207
1208
|
if (typeof P != "function")
|
|
1208
|
-
return re(j, W,
|
|
1209
|
-
var
|
|
1210
|
-
if (
|
|
1211
|
-
return
|
|
1209
|
+
return re(j, W, M, S, V(P));
|
|
1210
|
+
var J = P(T, S, j, W, M + "." + S, t);
|
|
1211
|
+
if (J)
|
|
1212
|
+
return J;
|
|
1212
1213
|
}
|
|
1213
1214
|
return null;
|
|
1214
1215
|
}
|
|
1215
|
-
return b(
|
|
1216
|
+
return b(R);
|
|
1216
1217
|
}
|
|
1217
|
-
function
|
|
1218
|
-
function
|
|
1219
|
-
var T = A[
|
|
1218
|
+
function ee(w) {
|
|
1219
|
+
function R(A, L, j, W, M) {
|
|
1220
|
+
var T = A[L], B = U(T);
|
|
1220
1221
|
if (B !== "object")
|
|
1221
|
-
return new f("Invalid " + W + " `" +
|
|
1222
|
-
var
|
|
1223
|
-
for (var P in
|
|
1224
|
-
var
|
|
1225
|
-
if (o(w, P) && typeof
|
|
1226
|
-
return re(j, W,
|
|
1227
|
-
if (!
|
|
1222
|
+
return new f("Invalid " + W + " `" + M + "` of type `" + B + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
1223
|
+
var S = n({}, A[L], w);
|
|
1224
|
+
for (var P in S) {
|
|
1225
|
+
var J = w[P];
|
|
1226
|
+
if (o(w, P) && typeof J != "function")
|
|
1227
|
+
return re(j, W, M, P, V(J));
|
|
1228
|
+
if (!J)
|
|
1228
1229
|
return new f(
|
|
1229
|
-
"Invalid " + W + " `" +
|
|
1230
|
+
"Invalid " + W + " `" + M + "` key `" + P + "` supplied to `" + j + "`.\nBad object: " + JSON.stringify(A[L], null, " ") + `
|
|
1230
1231
|
Valid keys: ` + JSON.stringify(Object.keys(w), null, " ")
|
|
1231
1232
|
);
|
|
1232
|
-
var z =
|
|
1233
|
+
var z = J(T, P, j, W, M + "." + P, t);
|
|
1233
1234
|
if (z)
|
|
1234
1235
|
return z;
|
|
1235
1236
|
}
|
|
1236
1237
|
return null;
|
|
1237
1238
|
}
|
|
1238
|
-
return b(
|
|
1239
|
+
return b(R);
|
|
1239
1240
|
}
|
|
1240
1241
|
function I(w) {
|
|
1241
1242
|
switch (typeof w) {
|
|
@@ -1250,16 +1251,16 @@ Valid keys: ` + JSON.stringify(Object.keys(w), null, " ")
|
|
|
1250
1251
|
return w.every(I);
|
|
1251
1252
|
if (w === null || a(w))
|
|
1252
1253
|
return !0;
|
|
1253
|
-
var
|
|
1254
|
-
if (
|
|
1255
|
-
var A =
|
|
1256
|
-
if (
|
|
1257
|
-
for (; !(
|
|
1258
|
-
if (!I(
|
|
1254
|
+
var R = m(w);
|
|
1255
|
+
if (R) {
|
|
1256
|
+
var A = R.call(w), L;
|
|
1257
|
+
if (R !== w.entries) {
|
|
1258
|
+
for (; !(L = A.next()).done; )
|
|
1259
|
+
if (!I(L.value))
|
|
1259
1260
|
return !1;
|
|
1260
1261
|
} else
|
|
1261
|
-
for (; !(
|
|
1262
|
-
var j =
|
|
1262
|
+
for (; !(L = A.next()).done; ) {
|
|
1263
|
+
var j = L.value;
|
|
1263
1264
|
if (j && !I(j[1]))
|
|
1264
1265
|
return !1;
|
|
1265
1266
|
}
|
|
@@ -1270,40 +1271,40 @@ Valid keys: ` + JSON.stringify(Object.keys(w), null, " ")
|
|
|
1270
1271
|
return !1;
|
|
1271
1272
|
}
|
|
1272
1273
|
}
|
|
1273
|
-
function O(w,
|
|
1274
|
-
return w === "symbol" ? !0 :
|
|
1274
|
+
function O(w, R) {
|
|
1275
|
+
return w === "symbol" ? !0 : R ? R["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && R instanceof Symbol : !1;
|
|
1275
1276
|
}
|
|
1276
1277
|
function U(w) {
|
|
1277
|
-
var
|
|
1278
|
-
return Array.isArray(w) ? "array" : w instanceof RegExp ? "object" : O(
|
|
1278
|
+
var R = typeof w;
|
|
1279
|
+
return Array.isArray(w) ? "array" : w instanceof RegExp ? "object" : O(R, w) ? "symbol" : R;
|
|
1279
1280
|
}
|
|
1280
1281
|
function V(w) {
|
|
1281
1282
|
if (typeof w > "u" || w === null)
|
|
1282
1283
|
return "" + w;
|
|
1283
|
-
var
|
|
1284
|
-
if (
|
|
1284
|
+
var R = U(w);
|
|
1285
|
+
if (R === "object") {
|
|
1285
1286
|
if (w instanceof Date)
|
|
1286
1287
|
return "date";
|
|
1287
1288
|
if (w instanceof RegExp)
|
|
1288
1289
|
return "regexp";
|
|
1289
1290
|
}
|
|
1290
|
-
return
|
|
1291
|
+
return R;
|
|
1291
1292
|
}
|
|
1292
1293
|
function ue(w) {
|
|
1293
|
-
var
|
|
1294
|
-
switch (
|
|
1294
|
+
var R = V(w);
|
|
1295
|
+
switch (R) {
|
|
1295
1296
|
case "array":
|
|
1296
1297
|
case "object":
|
|
1297
|
-
return "an " +
|
|
1298
|
+
return "an " + R;
|
|
1298
1299
|
case "boolean":
|
|
1299
1300
|
case "date":
|
|
1300
1301
|
case "regexp":
|
|
1301
|
-
return "a " +
|
|
1302
|
+
return "a " + R;
|
|
1302
1303
|
default:
|
|
1303
|
-
return
|
|
1304
|
+
return R;
|
|
1304
1305
|
}
|
|
1305
1306
|
}
|
|
1306
|
-
function
|
|
1307
|
+
function _(w) {
|
|
1307
1308
|
return !w.constructor || !w.constructor.name ? p : w.constructor.name;
|
|
1308
1309
|
}
|
|
1309
1310
|
return g.checkPropTypes = i, g.resetWarningCache = i.resetWarningCache, g.PropTypes = g, g;
|
|
@@ -3274,23 +3275,23 @@ function Qn() {
|
|
|
3274
3275
|
return fi(t);
|
|
3275
3276
|
}, [t]), ge = $e(function() {
|
|
3276
3277
|
return typeof b == "function" ? b : _n;
|
|
3277
|
-
}, [b]),
|
|
3278
|
+
}, [b]), ee = $e(function() {
|
|
3278
3279
|
return typeof f == "function" ? f : _n;
|
|
3279
|
-
}, [f]), I = se(null), O = se(null), U = xo(Ni, Ht), V = Rt(U, 2), ue = V[0],
|
|
3280
|
-
!A.current &&
|
|
3280
|
+
}, [f]), I = se(null), O = se(null), U = xo(Ni, Ht), V = Rt(U, 2), ue = V[0], _ = V[1], w = ue.isFocused, R = ue.isFileDialogActive, A = se(typeof window < "u" && window.isSecureContext && h && gi()), L = function() {
|
|
3281
|
+
!A.current && R && setTimeout(function() {
|
|
3281
3282
|
if (O.current) {
|
|
3282
3283
|
var Y = O.current.files;
|
|
3283
|
-
Y.length || (
|
|
3284
|
+
Y.length || (_({
|
|
3284
3285
|
type: "closeDialog"
|
|
3285
|
-
}),
|
|
3286
|
+
}), ee());
|
|
3286
3287
|
}
|
|
3287
3288
|
}, 300);
|
|
3288
3289
|
};
|
|
3289
3290
|
le(function() {
|
|
3290
|
-
return window.addEventListener("focus",
|
|
3291
|
-
window.removeEventListener("focus",
|
|
3291
|
+
return window.addEventListener("focus", L, !1), function() {
|
|
3292
|
+
window.removeEventListener("focus", L, !1);
|
|
3292
3293
|
};
|
|
3293
|
-
}, [O,
|
|
3294
|
+
}, [O, R, ee, A]);
|
|
3294
3295
|
var j = se([]), W = function(Y) {
|
|
3295
3296
|
I.current && I.current.contains(Y.target) || (Y.preventDefault(), j.current = []);
|
|
3296
3297
|
};
|
|
@@ -3302,9 +3303,9 @@ function Qn() {
|
|
|
3302
3303
|
return !o && $ && I.current && I.current.focus(), function() {
|
|
3303
3304
|
};
|
|
3304
3305
|
}, [I, $, o]);
|
|
3305
|
-
var
|
|
3306
|
+
var M = Q(function(F) {
|
|
3306
3307
|
H ? H(F) : console.error(F);
|
|
3307
|
-
}, [H]), T =
|
|
3308
|
+
}, [H]), T = Q(function(F) {
|
|
3308
3309
|
F.preventDefault(), F.persist(), ke(F), j.current = [].concat(ki(j.current), [F.target]), st(F) && Promise.resolve(i(F)).then(function(Y) {
|
|
3309
3310
|
if (!(mt(F) && !E)) {
|
|
3310
3311
|
var ve = Y.length, he = ve > 0 && ci({
|
|
@@ -3316,7 +3317,7 @@ function Qn() {
|
|
|
3316
3317
|
maxFiles: c,
|
|
3317
3318
|
validator: oe
|
|
3318
3319
|
}), we = ve > 0 && !he;
|
|
3319
|
-
|
|
3320
|
+
_({
|
|
3320
3321
|
isDragAccept: he,
|
|
3321
3322
|
isDragReject: we,
|
|
3322
3323
|
isDragActive: !0,
|
|
@@ -3324,9 +3325,9 @@ function Qn() {
|
|
|
3324
3325
|
}), d && d(F);
|
|
3325
3326
|
}
|
|
3326
3327
|
}).catch(function(Y) {
|
|
3327
|
-
return
|
|
3328
|
+
return M(Y);
|
|
3328
3329
|
});
|
|
3329
|
-
}, [i, d,
|
|
3330
|
+
}, [i, d, M, E, Z, l, r, a, c, oe]), B = Q(function(F) {
|
|
3330
3331
|
F.preventDefault(), F.persist(), ke(F);
|
|
3331
3332
|
var Y = st(F);
|
|
3332
3333
|
if (Y && F.dataTransfer)
|
|
@@ -3335,18 +3336,18 @@ function Qn() {
|
|
|
3335
3336
|
} catch {
|
|
3336
3337
|
}
|
|
3337
3338
|
return Y && m && m(F), !1;
|
|
3338
|
-
}, [m, E]),
|
|
3339
|
+
}, [m, E]), S = Q(function(F) {
|
|
3339
3340
|
F.preventDefault(), F.persist(), ke(F);
|
|
3340
3341
|
var Y = j.current.filter(function(he) {
|
|
3341
3342
|
return I.current && I.current.contains(he);
|
|
3342
3343
|
}), ve = Y.indexOf(F.target);
|
|
3343
|
-
ve !== -1 && Y.splice(ve, 1), j.current = Y, !(Y.length > 0) && (
|
|
3344
|
+
ve !== -1 && Y.splice(ve, 1), j.current = Y, !(Y.length > 0) && (_({
|
|
3344
3345
|
type: "setDraggedFiles",
|
|
3345
3346
|
isDragActive: !1,
|
|
3346
3347
|
isDragAccept: !1,
|
|
3347
3348
|
isDragReject: !1
|
|
3348
3349
|
}), st(F) && u && u(F));
|
|
3349
|
-
}, [I, u, E]), P =
|
|
3350
|
+
}, [I, u, E]), P = Q(function(F, Y) {
|
|
3350
3351
|
var ve = [], he = [];
|
|
3351
3352
|
F.forEach(function(we) {
|
|
3352
3353
|
var je = Yn(we, Z), Fe = Rt(je, 2), We = Fe[0], Ue = Fe[1], Ke = Wn(we, l, r), Ge = Rt(Ke, 2), Xe = Ge[0], Je = Ge[1], Qe = oe ? oe(we) : null;
|
|
@@ -3366,23 +3367,23 @@ function Qn() {
|
|
|
3366
3367
|
file: we,
|
|
3367
3368
|
errors: [si]
|
|
3368
3369
|
});
|
|
3369
|
-
}), ve.splice(0)),
|
|
3370
|
+
}), ve.splice(0)), _({
|
|
3370
3371
|
acceptedFiles: ve,
|
|
3371
3372
|
fileRejections: he,
|
|
3372
3373
|
isDragReject: he.length > 0,
|
|
3373
3374
|
type: "setFiles"
|
|
3374
3375
|
}), p && p(ve, he, Y), he.length > 0 && v && v(he, Y), ve.length > 0 && g && g(ve, Y);
|
|
3375
|
-
}, [
|
|
3376
|
+
}, [_, a, Z, l, r, c, p, g, v, oe]), J = Q(function(F) {
|
|
3376
3377
|
F.preventDefault(), F.persist(), ke(F), j.current = [], st(F) && Promise.resolve(i(F)).then(function(Y) {
|
|
3377
3378
|
mt(F) && !E || P(Y, F);
|
|
3378
3379
|
}).catch(function(Y) {
|
|
3379
|
-
return
|
|
3380
|
-
}),
|
|
3380
|
+
return M(Y);
|
|
3381
|
+
}), _({
|
|
3381
3382
|
type: "reset"
|
|
3382
3383
|
});
|
|
3383
|
-
}, [i, P,
|
|
3384
|
+
}, [i, P, M, E]), z = Q(function() {
|
|
3384
3385
|
if (A.current) {
|
|
3385
|
-
|
|
3386
|
+
_({
|
|
3386
3387
|
type: "openDialog"
|
|
3387
3388
|
}), ge();
|
|
3388
3389
|
var F = {
|
|
@@ -3392,30 +3393,30 @@ function Qn() {
|
|
|
3392
3393
|
window.showOpenFilePicker(F).then(function(Y) {
|
|
3393
3394
|
return i(Y);
|
|
3394
3395
|
}).then(function(Y) {
|
|
3395
|
-
P(Y, null),
|
|
3396
|
+
P(Y, null), _({
|
|
3396
3397
|
type: "closeDialog"
|
|
3397
3398
|
});
|
|
3398
3399
|
}).catch(function(Y) {
|
|
3399
|
-
vi(Y) ? (
|
|
3400
|
+
vi(Y) ? (ee(Y), _({
|
|
3400
3401
|
type: "closeDialog"
|
|
3401
|
-
})) : hi(Y) ? (A.current = !1, O.current ? (O.current.value = null, O.current.click()) :
|
|
3402
|
+
})) : hi(Y) ? (A.current = !1, O.current ? (O.current.value = null, O.current.click()) : M(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))) : M(Y);
|
|
3402
3403
|
});
|
|
3403
3404
|
return;
|
|
3404
3405
|
}
|
|
3405
|
-
O.current && (
|
|
3406
|
+
O.current && (_({
|
|
3406
3407
|
type: "openDialog"
|
|
3407
3408
|
}), ge(), O.current.value = null, O.current.click());
|
|
3408
|
-
}, [
|
|
3409
|
+
}, [_, ge, ee, h, P, M, re, a]), N = Q(function(F) {
|
|
3409
3410
|
!I.current || !I.current.isEqualNode(F.target) || (F.key === " " || F.key === "Enter" || F.keyCode === 32 || F.keyCode === 13) && (F.preventDefault(), z());
|
|
3410
|
-
}, [I, z]), te =
|
|
3411
|
-
|
|
3411
|
+
}, [I, z]), te = Q(function() {
|
|
3412
|
+
_({
|
|
3412
3413
|
type: "focus"
|
|
3413
3414
|
});
|
|
3414
|
-
}, []), ie =
|
|
3415
|
-
|
|
3415
|
+
}, []), ie = Q(function() {
|
|
3416
|
+
_({
|
|
3416
3417
|
type: "blur"
|
|
3417
3418
|
});
|
|
3418
|
-
}, []), fe =
|
|
3419
|
+
}, []), fe = Q(function() {
|
|
3419
3420
|
C || (pi() ? setTimeout(z, 0) : z());
|
|
3420
3421
|
}, [C, z]), G = function(Y) {
|
|
3421
3422
|
return o ? null : Y;
|
|
@@ -3429,20 +3430,20 @@ function Qn() {
|
|
|
3429
3430
|
return function() {
|
|
3430
3431
|
var F = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, Y = F.refKey, ve = Y === void 0 ? "ref" : Y, he = F.role, we = F.onKeyDown, je = F.onFocus, Fe = F.onBlur, We = F.onClick, Ue = F.onDragEnter, Ke = F.onDragOver, Ge = F.onDragLeave, Xe = F.onDrop, Je = vt(F, bi);
|
|
3431
3432
|
return me(me(Vt({
|
|
3432
|
-
onKeyDown: ae(Re(we,
|
|
3433
|
+
onKeyDown: ae(Re(we, N)),
|
|
3433
3434
|
onFocus: ae(Re(je, te)),
|
|
3434
3435
|
onBlur: ae(Re(Fe, ie)),
|
|
3435
3436
|
onClick: G(Re(We, fe)),
|
|
3436
3437
|
onDragEnter: _e(Re(Ue, T)),
|
|
3437
3438
|
onDragOver: _e(Re(Ke, B)),
|
|
3438
|
-
onDragLeave: _e(Re(Ge,
|
|
3439
|
-
onDrop: _e(Re(Xe,
|
|
3439
|
+
onDragLeave: _e(Re(Ge, S)),
|
|
3440
|
+
onDrop: _e(Re(Xe, J)),
|
|
3440
3441
|
role: typeof he == "string" && he !== "" ? he : "presentation"
|
|
3441
3442
|
}, ve, I), !o && !x ? {
|
|
3442
3443
|
tabIndex: 0
|
|
3443
3444
|
} : {}), Je);
|
|
3444
3445
|
};
|
|
3445
|
-
}, [I,
|
|
3446
|
+
}, [I, N, te, ie, fe, T, B, S, J, x, D, o]), Se = Q(function(F) {
|
|
3446
3447
|
F.stopPropagation();
|
|
3447
3448
|
}, []), Le = $e(function() {
|
|
3448
3449
|
return function() {
|
|
@@ -3462,13 +3463,13 @@ function Qn() {
|
|
|
3462
3463
|
width: "1px",
|
|
3463
3464
|
whiteSpace: "nowrap"
|
|
3464
3465
|
},
|
|
3465
|
-
onChange: G(Re(he,
|
|
3466
|
+
onChange: G(Re(he, J)),
|
|
3466
3467
|
onClick: G(Re(we, Se)),
|
|
3467
3468
|
tabIndex: -1
|
|
3468
3469
|
}, ve, O);
|
|
3469
3470
|
return me(me({}, Fe), je);
|
|
3470
3471
|
};
|
|
3471
|
-
}, [O, t, a,
|
|
3472
|
+
}, [O, t, a, J, o]);
|
|
3472
3473
|
return me(me({}, ue), {}, {
|
|
3473
3474
|
isFocused: w && !o,
|
|
3474
3475
|
getRootProps: Ne,
|
|
@@ -3549,7 +3550,7 @@ const Ia = ({
|
|
|
3549
3550
|
le(() => {
|
|
3550
3551
|
(h.length !== C.length || h.some((I, O) => I !== C[O])) && x(h);
|
|
3551
3552
|
}, [h]);
|
|
3552
|
-
const H =
|
|
3553
|
+
const H = Q(
|
|
3553
3554
|
(I, O) => {
|
|
3554
3555
|
const U = [];
|
|
3555
3556
|
if (O.length > 0 && O.forEach((V) => {
|
|
@@ -3581,7 +3582,7 @@ const Ia = ({
|
|
|
3581
3582
|
]
|
|
3582
3583
|
), oe = (I) => {
|
|
3583
3584
|
x((O) => O.filter((U, V) => V !== I)), $(C);
|
|
3584
|
-
}, { getRootProps: Z, getInputProps: re, isDragActive: ge, isDragReject:
|
|
3585
|
+
}, { getRootProps: Z, getInputProps: re, isDragActive: ge, isDragReject: ee } = Qn({
|
|
3585
3586
|
onDrop: H,
|
|
3586
3587
|
accept: t,
|
|
3587
3588
|
multiple: o,
|
|
@@ -3594,7 +3595,7 @@ const Ia = ({
|
|
|
3594
3595
|
className: `
|
|
3595
3596
|
border border-style-dashed rounded-lg p-0 overflow-hidden transition
|
|
3596
3597
|
${ge ? "border-color-blue-500 bg-color-blue-50" : "border-color-gray-200 bg-color-gray-50"}
|
|
3597
|
-
${
|
|
3598
|
+
${ee ? "border-color-red-500 bg-color-red-50" : ""}
|
|
3598
3599
|
${l ? "opacity-50 cursor-not-allowed" : ""}
|
|
3599
3600
|
${u}
|
|
3600
3601
|
`,
|
|
@@ -6159,19 +6160,19 @@ function jr(e) {
|
|
|
6159
6160
|
return !0;
|
|
6160
6161
|
}
|
|
6161
6162
|
return !1;
|
|
6162
|
-
}, r =
|
|
6163
|
+
}, r = Q(
|
|
6163
6164
|
(c) => {
|
|
6164
6165
|
e && (i(c, o.current) || (o.current = c, e(c)));
|
|
6165
6166
|
},
|
|
6166
6167
|
[e]
|
|
6167
|
-
), l =
|
|
6168
|
+
), l = Q(
|
|
6168
6169
|
(c) => {
|
|
6169
6170
|
t.current = c, n.current == null && (n.current = requestAnimationFrame(() => {
|
|
6170
6171
|
n.current = null, t.current != null && r(t.current);
|
|
6171
6172
|
}));
|
|
6172
6173
|
},
|
|
6173
6174
|
[r]
|
|
6174
|
-
), a =
|
|
6175
|
+
), a = Q(() => {
|
|
6175
6176
|
n.current != null && cancelAnimationFrame(n.current), n.current = null;
|
|
6176
6177
|
}, []);
|
|
6177
6178
|
return { schedule: l, flush: r, cancel: a, last: t };
|
|
@@ -6197,90 +6198,90 @@ const Za = bo(function({
|
|
|
6197
6198
|
range: f = !1,
|
|
6198
6199
|
minDistance: b = 0
|
|
6199
6200
|
}) {
|
|
6200
|
-
const h = n !== void 0, [$, y] = q(() => t !== void 0 ? t : f ? [r, l] : r), C = h ? n : $, x = Array.isArray(C) ? C[0] : C, [D, E] = Array.isArray(C) ? C : [C, C], H = It[c] || It.blue, oe = Nn[d] ?? Nn.medium, Z =
|
|
6201
|
-
(
|
|
6201
|
+
const h = n !== void 0, [$, y] = q(() => t !== void 0 ? t : f ? [r, l] : r), C = h ? n : $, x = Array.isArray(C) ? C[0] : C, [D, E] = Array.isArray(C) ? C : [C, C], H = It[c] || It.blue, oe = Nn[d] ?? Nn.medium, Z = Q(
|
|
6202
|
+
(N) => (N - r) / (l - r) * 100,
|
|
6202
6203
|
[r, l]
|
|
6203
|
-
), re = Z(x), ge = Z(D),
|
|
6204
|
-
(
|
|
6205
|
-
h || y(
|
|
6204
|
+
), re = Z(x), ge = Z(D), ee = Z(E), I = Q((N) => Math.max(r, Math.min(l, N)), [r, l]), O = Q((N) => Math.round(N / a) * a, [a]), U = jr(o), V = Q(
|
|
6205
|
+
(N, te = !0) => {
|
|
6206
|
+
h || y(N), te ? U.schedule(N) : U.flush(N);
|
|
6206
6207
|
},
|
|
6207
6208
|
[h, U]
|
|
6208
|
-
), ue =
|
|
6209
|
-
const
|
|
6210
|
-
|
|
6211
|
-
}, [U, i]),
|
|
6212
|
-
(
|
|
6213
|
-
if (f && Array.isArray(
|
|
6214
|
-
let [ie, fe] =
|
|
6209
|
+
), ue = Q(() => {
|
|
6210
|
+
const N = U.last.current;
|
|
6211
|
+
N != null && (U.flush(N), i == null || i(N));
|
|
6212
|
+
}, [U, i]), _ = Q(
|
|
6213
|
+
(N, te) => {
|
|
6214
|
+
if (f && Array.isArray(N)) {
|
|
6215
|
+
let [ie, fe] = N, G = O(I(ie)), ae = O(I(fe));
|
|
6215
6216
|
return ae - G < b && (te === "min" ? ae = I(G + b) : te === "max" && (G = I(ae - b))), G > ae && (te === "min" ? G = ae : ae = G), [G, ae];
|
|
6216
|
-
} else if (!f && typeof
|
|
6217
|
-
return O(I(
|
|
6218
|
-
return
|
|
6217
|
+
} else if (!f && typeof N == "number")
|
|
6218
|
+
return O(I(N));
|
|
6219
|
+
return N;
|
|
6219
6220
|
},
|
|
6220
6221
|
[f, I, O, b]
|
|
6221
|
-
), w = se(null),
|
|
6222
|
-
(
|
|
6222
|
+
), w = se(null), R = Q(
|
|
6223
|
+
(N) => {
|
|
6223
6224
|
var fe;
|
|
6224
6225
|
const te = (fe = w.current) == null ? void 0 : fe.getBoundingClientRect();
|
|
6225
6226
|
if (!te) return f ? r : x;
|
|
6226
|
-
const ie = Math.max(0, Math.min(1, (
|
|
6227
|
+
const ie = Math.max(0, Math.min(1, (N - te.left) / te.width));
|
|
6227
6228
|
return r + ie * (l - r);
|
|
6228
6229
|
},
|
|
6229
6230
|
[r, l, f, x]
|
|
6230
|
-
), A =
|
|
6231
|
-
(
|
|
6232
|
-
const te = Math.abs(
|
|
6231
|
+
), A = Q(
|
|
6232
|
+
(N) => {
|
|
6233
|
+
const te = Math.abs(N - D), ie = Math.abs(N - E);
|
|
6233
6234
|
return te <= ie ? "min" : "max";
|
|
6234
6235
|
},
|
|
6235
6236
|
[D, E]
|
|
6236
|
-
), [
|
|
6237
|
-
(
|
|
6237
|
+
), [L, j] = q(null), [W, M] = q(null), [T, B] = q(null), S = Q(
|
|
6238
|
+
(N, te) => {
|
|
6238
6239
|
var fe, G;
|
|
6239
6240
|
if (u) return;
|
|
6240
|
-
|
|
6241
|
-
const ie =
|
|
6241
|
+
N.preventDefault(), (G = (fe = N.currentTarget).setPointerCapture) == null || G.call(fe, N.pointerId), B(N.pointerId);
|
|
6242
|
+
const ie = R(N.clientX);
|
|
6242
6243
|
if (f) {
|
|
6243
6244
|
const ae = te || A(ie);
|
|
6244
|
-
j(ae), V(ae === "min" ?
|
|
6245
|
+
j(ae), V(ae === "min" ? _([ie, E], "min") : _([D, ie], "max"));
|
|
6245
6246
|
} else
|
|
6246
|
-
j("single"), V(
|
|
6247
|
+
j("single"), V(_(ie, "single"));
|
|
6247
6248
|
},
|
|
6248
6249
|
[
|
|
6249
6250
|
u,
|
|
6250
6251
|
f,
|
|
6251
|
-
|
|
6252
|
+
R,
|
|
6252
6253
|
A,
|
|
6253
|
-
|
|
6254
|
+
_,
|
|
6254
6255
|
D,
|
|
6255
6256
|
E,
|
|
6256
6257
|
V
|
|
6257
6258
|
]
|
|
6258
|
-
), P =
|
|
6259
|
-
(
|
|
6260
|
-
if (u || T == null ||
|
|
6261
|
-
const te =
|
|
6262
|
-
f ?
|
|
6259
|
+
), P = Q(
|
|
6260
|
+
(N) => {
|
|
6261
|
+
if (u || T == null || L == null) return;
|
|
6262
|
+
const te = R(N.clientX);
|
|
6263
|
+
f ? L === "min" ? V(_([te, E], "min")) : L === "max" && V(_([D, te], "max")) : V(_(te, "single"));
|
|
6263
6264
|
},
|
|
6264
6265
|
[
|
|
6265
6266
|
u,
|
|
6266
6267
|
T,
|
|
6267
|
-
|
|
6268
|
+
L,
|
|
6268
6269
|
f,
|
|
6269
|
-
|
|
6270
|
-
|
|
6270
|
+
R,
|
|
6271
|
+
_,
|
|
6271
6272
|
D,
|
|
6272
6273
|
E,
|
|
6273
6274
|
V
|
|
6274
6275
|
]
|
|
6275
|
-
),
|
|
6276
|
-
|
|
6277
|
-
}, [
|
|
6278
|
-
(
|
|
6276
|
+
), J = Q(() => {
|
|
6277
|
+
L != null && (j(null), B(null), ue());
|
|
6278
|
+
}, [L, ue]), z = Q(
|
|
6279
|
+
(N, te) => {
|
|
6279
6280
|
if (u) return;
|
|
6280
6281
|
const ie = f ? te === "min" ? D : E : x;
|
|
6281
6282
|
let fe = ie;
|
|
6282
6283
|
const G = (l - r) / 10;
|
|
6283
|
-
switch (
|
|
6284
|
+
switch (N.key) {
|
|
6284
6285
|
case "ArrowLeft":
|
|
6285
6286
|
case "ArrowDown":
|
|
6286
6287
|
fe = ie - a;
|
|
@@ -6304,7 +6305,7 @@ const Za = bo(function({
|
|
|
6304
6305
|
default:
|
|
6305
6306
|
return;
|
|
6306
6307
|
}
|
|
6307
|
-
|
|
6308
|
+
N.preventDefault(), V(f ? te === "min" ? _([fe, E], "min") : _([D, fe], "max") : _(fe, "single"), !1), i == null || i(h ? n : C);
|
|
6308
6309
|
},
|
|
6309
6310
|
[
|
|
6310
6311
|
u,
|
|
@@ -6315,7 +6316,7 @@ const Za = bo(function({
|
|
|
6315
6316
|
a,
|
|
6316
6317
|
r,
|
|
6317
6318
|
l,
|
|
6318
|
-
|
|
6319
|
+
_,
|
|
6319
6320
|
V,
|
|
6320
6321
|
i,
|
|
6321
6322
|
h,
|
|
@@ -6324,12 +6325,12 @@ const Za = bo(function({
|
|
|
6324
6325
|
]
|
|
6325
6326
|
);
|
|
6326
6327
|
return le(() => {
|
|
6327
|
-
if (!
|
|
6328
|
-
const
|
|
6328
|
+
if (!L) return;
|
|
6329
|
+
const N = document.body.style.userSelect;
|
|
6329
6330
|
return document.body.style.userSelect = "none", () => {
|
|
6330
|
-
document.body.style.userSelect =
|
|
6331
|
+
document.body.style.userSelect = N;
|
|
6331
6332
|
};
|
|
6332
|
-
}, [
|
|
6333
|
+
}, [L]), /* @__PURE__ */ s("div", { className: `w-full ${m}`, children: /* @__PURE__ */ k("div", { className: "relative flex items-center", children: [
|
|
6333
6334
|
f && /* @__PURE__ */ s("div", { className: "mr-3 text-sm font-medium text-color-gray-700 dark:text-color-gray-200 min-w-[2rem]", children: /* @__PURE__ */ s("div", { className: "range-min", children: /* @__PURE__ */ s("div", { children: D }) }) }),
|
|
6334
6335
|
/* @__PURE__ */ k("div", { className: "w-full", children: [
|
|
6335
6336
|
/* @__PURE__ */ k(
|
|
@@ -6340,26 +6341,26 @@ const Za = bo(function({
|
|
|
6340
6341
|
relative w-full ${oe.track} ${H.track} rounded-full
|
|
6341
6342
|
${u ? "opacity-60 cursor-not-allowed" : "cursor-pointer"}
|
|
6342
6343
|
`,
|
|
6343
|
-
onPointerDown: (
|
|
6344
|
+
onPointerDown: (N) => S(N),
|
|
6344
6345
|
onPointerMove: P,
|
|
6345
|
-
onPointerUp:
|
|
6346
|
-
onPointerCancel:
|
|
6346
|
+
onPointerUp: J,
|
|
6347
|
+
onPointerCancel: J,
|
|
6347
6348
|
children: [
|
|
6348
6349
|
f ? /* @__PURE__ */ s(
|
|
6349
6350
|
"div",
|
|
6350
6351
|
{
|
|
6351
|
-
className: `absolute top-0 ${oe.track} ${H.progress} rounded-full ${
|
|
6352
|
-
style: { left: `${ge}%`, width: `${
|
|
6352
|
+
className: `absolute top-0 ${oe.track} ${H.progress} rounded-full ${L ? "" : "transition-all duration-150"}`,
|
|
6353
|
+
style: { left: `${ge}%`, width: `${ee - ge}%` }
|
|
6353
6354
|
}
|
|
6354
6355
|
) : /* @__PURE__ */ s(
|
|
6355
6356
|
"div",
|
|
6356
6357
|
{
|
|
6357
|
-
className: `absolute top-0 left-0 ${oe.track} ${H.progress} rounded-full ${
|
|
6358
|
+
className: `absolute top-0 left-0 ${oe.track} ${H.progress} rounded-full ${L ? "" : "transition-all duration-150"}`,
|
|
6358
6359
|
style: { width: `${re}%` }
|
|
6359
6360
|
}
|
|
6360
6361
|
),
|
|
6361
|
-
g && v.map((
|
|
6362
|
-
const ie = Z(
|
|
6362
|
+
g && v.map((N, te) => {
|
|
6363
|
+
const ie = Z(N.value);
|
|
6363
6364
|
return /* @__PURE__ */ s(
|
|
6364
6365
|
"div",
|
|
6365
6366
|
{
|
|
@@ -6376,7 +6377,7 @@ const Za = bo(function({
|
|
|
6376
6377
|
absolute top-1/2 transform -translate-y-1/2 -translate-x-1/2
|
|
6377
6378
|
${oe.thumb} ${H.thumb} ${H.thumbHover} ${H.thumbActive}
|
|
6378
6379
|
rounded-full border-2 ${u ? "opacity-60 cursor-not-allowed" : "cursor-grab"}
|
|
6379
|
-
${
|
|
6380
|
+
${L === "single" ? "cursor-grabbing scale-110" : L ? "" : "transition-all duration-150"}
|
|
6380
6381
|
${W === "single" ? "ring-2 ring-offset-1 ring-blue-300" : ""}
|
|
6381
6382
|
shadow-md hover:shadow-lg focus:outline-none dark:shadow-none
|
|
6382
6383
|
`,
|
|
@@ -6388,10 +6389,10 @@ const Za = bo(function({
|
|
|
6388
6389
|
"aria-valuemax": l,
|
|
6389
6390
|
"aria-valuenow": x,
|
|
6390
6391
|
"aria-disabled": u,
|
|
6391
|
-
onKeyDown: (
|
|
6392
|
-
onFocus: () =>
|
|
6393
|
-
onBlur: () =>
|
|
6394
|
-
onPointerDown: (
|
|
6392
|
+
onKeyDown: (N) => z(N, "single"),
|
|
6393
|
+
onFocus: () => M("single"),
|
|
6394
|
+
onBlur: () => M(null),
|
|
6395
|
+
onPointerDown: (N) => S(N, "single")
|
|
6395
6396
|
}
|
|
6396
6397
|
),
|
|
6397
6398
|
f && /* @__PURE__ */ k(be, { children: [
|
|
@@ -6402,7 +6403,7 @@ const Za = bo(function({
|
|
|
6402
6403
|
absolute top-1/2 transform -translate-y-1/2 -translate-x-1/2 z-10
|
|
6403
6404
|
${oe.thumb} ${H.thumb} ${H.thumbHover} ${H.thumbActive}
|
|
6404
6405
|
rounded-full border-2 ${u ? "opacity-60 cursor-not-allowed" : "cursor-grab"}
|
|
6405
|
-
${
|
|
6406
|
+
${L === "min" ? "cursor-grabbing scale-110 z-20" : L ? "" : "transition-all duration-150"}
|
|
6406
6407
|
${W === "min" ? "ring-2 ring-offset-1 ring-blue-300" : ""}
|
|
6407
6408
|
shadow-md hover:shadow-lg focus:outline-none dark:shadow-none
|
|
6408
6409
|
`,
|
|
@@ -6415,10 +6416,10 @@ const Za = bo(function({
|
|
|
6415
6416
|
"aria-valuenow": D,
|
|
6416
6417
|
"aria-disabled": u,
|
|
6417
6418
|
"aria-label": "Minimum value",
|
|
6418
|
-
onKeyDown: (
|
|
6419
|
-
onFocus: () =>
|
|
6420
|
-
onBlur: () =>
|
|
6421
|
-
onPointerDown: (
|
|
6419
|
+
onKeyDown: (N) => z(N, "min"),
|
|
6420
|
+
onFocus: () => M("min"),
|
|
6421
|
+
onBlur: () => M(null),
|
|
6422
|
+
onPointerDown: (N) => S(N, "min")
|
|
6422
6423
|
}
|
|
6423
6424
|
),
|
|
6424
6425
|
/* @__PURE__ */ s(
|
|
@@ -6428,11 +6429,11 @@ const Za = bo(function({
|
|
|
6428
6429
|
absolute top-1/2 transform -translate-y-1/2 -translate-x-1/2 z-10
|
|
6429
6430
|
${oe.thumb} ${H.thumb} ${H.thumbHover} ${H.thumbActive}
|
|
6430
6431
|
rounded-full border-2 ${u ? "opacity-60 cursor-not-allowed" : "cursor-grab"}
|
|
6431
|
-
${
|
|
6432
|
+
${L === "max" ? "cursor-grabbing scale-110 z-20" : L ? "" : "transition-all duration-150"}
|
|
6432
6433
|
${W === "max" ? "ring-2 ring-offset-1 ring-blue-300" : ""}
|
|
6433
6434
|
shadow-md hover:shadow-lg focus:outline-none dark:shadow-none
|
|
6434
6435
|
`,
|
|
6435
|
-
style: { left: `${
|
|
6436
|
+
style: { left: `${ee}%` },
|
|
6436
6437
|
tabIndex: u ? -1 : 0,
|
|
6437
6438
|
role: "slider",
|
|
6438
6439
|
"aria-orientation": "horizontal",
|
|
@@ -6441,10 +6442,10 @@ const Za = bo(function({
|
|
|
6441
6442
|
"aria-valuenow": E,
|
|
6442
6443
|
"aria-disabled": u,
|
|
6443
6444
|
"aria-label": "Maximum value",
|
|
6444
|
-
onKeyDown: (
|
|
6445
|
-
onFocus: () =>
|
|
6446
|
-
onBlur: () =>
|
|
6447
|
-
onPointerDown: (
|
|
6445
|
+
onKeyDown: (N) => z(N, "max"),
|
|
6446
|
+
onFocus: () => M("max"),
|
|
6447
|
+
onBlur: () => M(null),
|
|
6448
|
+
onPointerDown: (N) => S(N, "max")
|
|
6448
6449
|
}
|
|
6449
6450
|
)
|
|
6450
6451
|
] })
|
|
@@ -6455,14 +6456,14 @@ const Za = bo(function({
|
|
|
6455
6456
|
"div",
|
|
6456
6457
|
{
|
|
6457
6458
|
className: "relative mt-2 text-xs text-color-gray-500 dark:text-color-gray-200",
|
|
6458
|
-
children: v.map((
|
|
6459
|
-
const ie = Z(
|
|
6459
|
+
children: v.map((N, te) => {
|
|
6460
|
+
const ie = Z(N.value);
|
|
6460
6461
|
return /* @__PURE__ */ s(
|
|
6461
6462
|
"div",
|
|
6462
6463
|
{
|
|
6463
6464
|
className: "absolute transform -translate-x-1/2 text-xs",
|
|
6464
6465
|
style: { left: `${ie}%` },
|
|
6465
|
-
children:
|
|
6466
|
+
children: N.label || N.value
|
|
6466
6467
|
},
|
|
6467
6468
|
te
|
|
6468
6469
|
);
|
|
@@ -6497,7 +6498,7 @@ const Za = bo(function({
|
|
|
6497
6498
|
if (e)
|
|
6498
6499
|
return document.addEventListener("keydown", p), () => document.removeEventListener("keydown", p);
|
|
6499
6500
|
}, [e, r]);
|
|
6500
|
-
const c =
|
|
6501
|
+
const c = Q(() => {
|
|
6501
6502
|
r && r();
|
|
6502
6503
|
}, [r]), d = (p) => {
|
|
6503
6504
|
const g = "fixed z-50 transform transition-all duration-300 ease-in-out";
|
|
@@ -6811,30 +6812,30 @@ const Ka = ({
|
|
|
6811
6812
|
x == null ? void 0 : x.swipeable,
|
|
6812
6813
|
g,
|
|
6813
6814
|
D
|
|
6814
|
-
),
|
|
6815
|
-
a &&
|
|
6816
|
-
),
|
|
6815
|
+
), ee = e.length, I = Math.min(Math.max(E, 0.1), ee), [O, U] = q(0), [V, ue] = q(!1), [_, w] = q(!1), [R, A] = q(0), L = se(null), j = se(0), W = se(0), M = I >= ee ? 0 : Math.max(0, ee - I), T = (G) => Math.max(0, Math.min(G, M)), B = (G) => U(
|
|
6816
|
+
a && M > 0 ? (G % (M + 1) + (M + 1)) % (M + 1) : T(G)
|
|
6817
|
+
), S = () => B(a && M > 0 && O === 0 ? M : O - 1), P = () => B(a && M > 0 && O >= M ? 0 : O + 1);
|
|
6817
6818
|
le(() => {
|
|
6818
|
-
if (!r || p && V ||
|
|
6819
|
+
if (!r || p && V || _ || M === 0) return;
|
|
6819
6820
|
const G = setInterval(() => {
|
|
6820
|
-
U((ae) => Br(ae,
|
|
6821
|
+
U((ae) => Br(ae, M, a));
|
|
6821
6822
|
}, l);
|
|
6822
6823
|
return () => clearInterval(G);
|
|
6823
|
-
}, [r, l, V, p,
|
|
6824
|
-
O >
|
|
6825
|
-
}, [
|
|
6826
|
-
const
|
|
6827
|
-
!ge ||
|
|
6824
|
+
}, [r, l, V, p, _, M, a]), le(() => {
|
|
6825
|
+
O > M && U(Math.min(O, M));
|
|
6826
|
+
}, [M, O]);
|
|
6827
|
+
const J = (G, ae) => {
|
|
6828
|
+
!ge || M === 0 || (w(!0), j.current = f === "horizontal" ? G : ae, W.current = j.current);
|
|
6828
6829
|
}, z = (G, ae) => {
|
|
6829
|
-
|
|
6830
|
-
},
|
|
6831
|
-
if (!
|
|
6830
|
+
_ && (W.current = f === "horizontal" ? G : ae, A(W.current - j.current));
|
|
6831
|
+
}, N = () => {
|
|
6832
|
+
if (!_) return;
|
|
6832
6833
|
const G = Gr(W.current, j.current);
|
|
6833
|
-
G === "next" && P(), G === "prev" &&
|
|
6834
|
+
G === "next" && P(), G === "prev" && S(), w(!1), A(0);
|
|
6834
6835
|
}, te = () => {
|
|
6835
|
-
const G = f === "horizontal" ? "X" : "Y", ae = Vr(
|
|
6836
|
+
const G = f === "horizontal" ? "X" : "Y", ae = Vr(_, L, M, R, f, I, ee), ke = Math.min(O, M) * (100 / ee) - ae, Ne = Hr(O, M, H, E);
|
|
6836
6837
|
return `translate${G}(calc(-${ke}% - ${Ne}px))`;
|
|
6837
|
-
}, ie = () => I >=
|
|
6838
|
+
}, ie = () => I >= ee ? 1 : Math.floor(M) + 1, fe = () => M === 0 ? 0 : Math.round(O / M * (ie() - 1));
|
|
6838
6839
|
return /* @__PURE__ */ k(
|
|
6839
6840
|
"div",
|
|
6840
6841
|
{
|
|
@@ -6846,54 +6847,54 @@ const Ka = ({
|
|
|
6846
6847
|
/* @__PURE__ */ k(
|
|
6847
6848
|
"div",
|
|
6848
6849
|
{
|
|
6849
|
-
ref:
|
|
6850
|
-
className: `w-full overflow-hidden relative ${ge &&
|
|
6850
|
+
ref: L,
|
|
6851
|
+
className: `w-full overflow-hidden relative ${ge && M > 0 ? _ ? "cursor-grabbing" : "cursor-grab" : "cursor-default"}`,
|
|
6851
6852
|
style: {
|
|
6852
6853
|
height: re ? `calc(${t} - ${v + 20}px)` : t
|
|
6853
6854
|
},
|
|
6854
6855
|
onMouseDown: (G) => {
|
|
6855
|
-
G.preventDefault(),
|
|
6856
|
+
G.preventDefault(), J(G.clientX, G.clientY);
|
|
6856
6857
|
},
|
|
6857
6858
|
onMouseMove: (G) => z(G.clientX, G.clientY),
|
|
6858
|
-
onMouseUp:
|
|
6859
|
-
onMouseLeave:
|
|
6860
|
-
onTouchStart: (G) =>
|
|
6859
|
+
onMouseUp: N,
|
|
6860
|
+
onMouseLeave: N,
|
|
6861
|
+
onTouchStart: (G) => J(G.touches[0].clientX, G.touches[0].clientY),
|
|
6861
6862
|
onTouchMove: (G) => z(G.touches[0].clientX, G.touches[0].clientY),
|
|
6862
|
-
onTouchEnd:
|
|
6863
|
+
onTouchEnd: N,
|
|
6863
6864
|
children: [
|
|
6864
6865
|
/* @__PURE__ */ s(
|
|
6865
6866
|
"div",
|
|
6866
6867
|
{
|
|
6867
6868
|
className: `flex ${f === "horizontal" ? "flex-row" : "flex-col"} transition-all duration-300 ease-in-out`,
|
|
6868
6869
|
style: {
|
|
6869
|
-
width: f === "vertical" ? "100%" : `calc(${
|
|
6870
|
-
height: f === "vertical" ? `${
|
|
6870
|
+
width: f === "vertical" ? "100%" : `calc(${ee * 100 / I}% + ${(ee - 1) * H}px)`,
|
|
6871
|
+
height: f === "vertical" ? `${ee * 100 / I}%` : "100%",
|
|
6871
6872
|
transform: te(),
|
|
6872
6873
|
gap: `${H}px`,
|
|
6873
|
-
transitionProperty:
|
|
6874
|
+
transitionProperty: _ ? "none" : "transform"
|
|
6874
6875
|
},
|
|
6875
6876
|
children: e.map((G, ae) => /* @__PURE__ */ s(
|
|
6876
6877
|
"div",
|
|
6877
6878
|
{
|
|
6878
6879
|
className: "shrink-0 flex items-center justify-center",
|
|
6879
6880
|
style: {
|
|
6880
|
-
width: f === "horizontal" ? `calc(${100 /
|
|
6881
|
-
height: f === "vertical" ? `calc(${100 /
|
|
6881
|
+
width: f === "horizontal" ? `calc(${100 / ee}% - ${H / E}px)` : "100%",
|
|
6882
|
+
height: f === "vertical" ? `calc(${100 / ee}% - ${H * (ee - 1) / ee}px)` : "100%"
|
|
6882
6883
|
},
|
|
6883
|
-
onClick: () => !
|
|
6884
|
+
onClick: () => !_ && (u == null ? void 0 : u(ae)),
|
|
6884
6885
|
children: G
|
|
6885
6886
|
},
|
|
6886
6887
|
ae
|
|
6887
6888
|
))
|
|
6888
6889
|
}
|
|
6889
6890
|
),
|
|
6890
|
-
oe &&
|
|
6891
|
+
oe && M > 0 && /* @__PURE__ */ k(be, { children: [
|
|
6891
6892
|
/* @__PURE__ */ s(
|
|
6892
6893
|
"button",
|
|
6893
6894
|
{
|
|
6894
6895
|
type: "button",
|
|
6895
6896
|
"aria-label": "prev",
|
|
6896
|
-
onClick:
|
|
6897
|
+
onClick: S,
|
|
6897
6898
|
className: `absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
|
|
6898
6899
|
${f === "horizontal" ? "left-1 md:left-2 top-1/2 -translate-y-1/2" : "left-1/2 top-1 md:top-2 -translate-x-1/2"}`,
|
|
6899
6900
|
children: h || (f === "horizontal" ? "‹" : "↑")
|
|
@@ -6922,7 +6923,7 @@ const Ka = ({
|
|
|
6922
6923
|
type: "button",
|
|
6923
6924
|
onClick: () => B(
|
|
6924
6925
|
Math.round(
|
|
6925
|
-
ae / (ie() - 1) *
|
|
6926
|
+
ae / (ie() - 1) * M
|
|
6926
6927
|
)
|
|
6927
6928
|
),
|
|
6928
6929
|
className: `w-2 h-2 md:w-[10px] md:h-[10px] rounded-full transition-color hover:bg-color-gray-600 cursor-pointer ${ae === fe() ? "bg-color-gray-800" : "bg-color-gray-400"}`
|
|
@@ -6944,7 +6945,7 @@ const Ka = ({
|
|
|
6944
6945
|
const Ne = Math.max(
|
|
6945
6946
|
0,
|
|
6946
6947
|
Math.min(
|
|
6947
|
-
|
|
6948
|
+
M,
|
|
6948
6949
|
ae - Math.floor(I / 2)
|
|
6949
6950
|
)
|
|
6950
6951
|
);
|
|
@@ -7241,7 +7242,7 @@ const Ka = ({
|
|
|
7241
7242
|
showToggleButton: Z = !1,
|
|
7242
7243
|
toggleButtonIcon: re
|
|
7243
7244
|
}) => {
|
|
7244
|
-
const [ge,
|
|
7245
|
+
const [ge, ee] = q(-1), I = t ?? o, O = (A) => {
|
|
7245
7246
|
switch (A) {
|
|
7246
7247
|
case "small":
|
|
7247
7248
|
return "w-4 h-4";
|
|
@@ -7251,21 +7252,21 @@ const Ka = ({
|
|
|
7251
7252
|
return "w-5 h-5";
|
|
7252
7253
|
}
|
|
7253
7254
|
}, U = () => {
|
|
7254
|
-
var A,
|
|
7255
|
+
var A, L;
|
|
7255
7256
|
return v ? {
|
|
7256
7257
|
border: "peer-checked:border-color-red-500",
|
|
7257
7258
|
text: "text-color-red-500"
|
|
7258
7259
|
} : {
|
|
7259
7260
|
border: ((A = xe[d]) == null ? void 0 : A.peer) || "",
|
|
7260
|
-
text: ((
|
|
7261
|
+
text: ((L = xe[d]) == null ? void 0 : L.peer) || ""
|
|
7261
7262
|
};
|
|
7262
|
-
}, V = (A,
|
|
7263
|
-
i == null || i(A),
|
|
7263
|
+
}, V = (A, L) => {
|
|
7264
|
+
i == null || i(A), ee(L);
|
|
7264
7265
|
}, ue = (A) => {
|
|
7265
7266
|
r == null || r(A);
|
|
7266
|
-
},
|
|
7267
|
-
|
|
7268
|
-
}, w = U(),
|
|
7267
|
+
}, _ = (A, L) => {
|
|
7268
|
+
ee(L), l == null || l(A);
|
|
7269
|
+
}, w = U(), R = g || f ? `${e}-helper-text` : void 0;
|
|
7269
7270
|
return y === "card" ? /* @__PURE__ */ k("div", { className: "w-full", children: [
|
|
7270
7271
|
v && f && /* @__PURE__ */ s(
|
|
7271
7272
|
"div",
|
|
@@ -7282,11 +7283,11 @@ const Ka = ({
|
|
|
7282
7283
|
role: "radiogroup",
|
|
7283
7284
|
"aria-label": h,
|
|
7284
7285
|
"aria-labelledby": $,
|
|
7285
|
-
"aria-describedby":
|
|
7286
|
+
"aria-describedby": R,
|
|
7286
7287
|
"aria-required": b,
|
|
7287
7288
|
className: `flex ${a === "row" ? "flex-row gap-4" : "flex-col gap-4"} ${u}`,
|
|
7288
|
-
children: n.map(({ label: A, value:
|
|
7289
|
-
const T = c || j, B = I ===
|
|
7289
|
+
children: n.map(({ label: A, value: L, disabled: j, id: W }, M) => {
|
|
7290
|
+
const T = c || j, B = I === L, S = v && B;
|
|
7290
7291
|
return /* @__PURE__ */ s(
|
|
7291
7292
|
"div",
|
|
7292
7293
|
{
|
|
@@ -7295,15 +7296,15 @@ const Ka = ({
|
|
|
7295
7296
|
"div",
|
|
7296
7297
|
{
|
|
7297
7298
|
className: `relative transition-all duration-200 cursor-pointer
|
|
7298
|
-
${B ?
|
|
7299
|
+
${B ? S ? "border-color-red-500 bg-red-50" : `${x}` : "border-color-gray-300 bg-white hover:border-color-gray-400"}
|
|
7299
7300
|
${T ? "" : "hover:shadow-md"}
|
|
7300
7301
|
${C}
|
|
7301
7302
|
`,
|
|
7302
7303
|
onClick: (P) => {
|
|
7303
|
-
P.stopPropagation(), !T && V(
|
|
7304
|
+
P.stopPropagation(), !T && V(L, M);
|
|
7304
7305
|
},
|
|
7305
7306
|
children: [
|
|
7306
|
-
B &&
|
|
7307
|
+
B && S && /* @__PURE__ */ s("div", { className: "absolute top-2 right-2 w-6 h-6 bg-color-red-500 rounded-full flex items-center justify-center", children: /* @__PURE__ */ s(
|
|
7307
7308
|
"svg",
|
|
7308
7309
|
{
|
|
7309
7310
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7322,7 +7323,7 @@ const Ka = ({
|
|
|
7322
7323
|
)
|
|
7323
7324
|
}
|
|
7324
7325
|
) }),
|
|
7325
|
-
!Z && B && !
|
|
7326
|
+
!Z && B && !S && D && /* @__PURE__ */ s("div", { className: `absolute rounded-full flex items-center justify-center shadow-sm ${H}`, children: E || /* @__PURE__ */ s(
|
|
7326
7327
|
"svg",
|
|
7327
7328
|
{
|
|
7328
7329
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7341,18 +7342,18 @@ const Ka = ({
|
|
|
7341
7342
|
)
|
|
7342
7343
|
}
|
|
7343
7344
|
) }),
|
|
7344
|
-
/* @__PURE__ */ k("div", { className: `flex items-start gap-3 ${
|
|
7345
|
+
/* @__PURE__ */ k("div", { className: `flex items-start gap-3 ${S ? "text-color-red-700" : ""}`, children: [
|
|
7345
7346
|
Z && /* @__PURE__ */ s(
|
|
7346
7347
|
"button",
|
|
7347
7348
|
{
|
|
7348
7349
|
type: "button",
|
|
7349
7350
|
onClick: (P) => {
|
|
7350
|
-
P.stopPropagation(), T || V(
|
|
7351
|
+
P.stopPropagation(), T || V(L, M);
|
|
7351
7352
|
},
|
|
7352
7353
|
disabled: T,
|
|
7353
7354
|
className: `mt-1 flex-shrink-0 rounded-full bg-color-gray-300 transition-all duration-150 ${O(p)} ${T ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`,
|
|
7354
7355
|
"aria-checked": B,
|
|
7355
|
-
children: B && !
|
|
7356
|
+
children: B && !S && /* @__PURE__ */ s("div", { className: "w-full h-full flex items-center justify-center", children: re || E || /* @__PURE__ */ k(
|
|
7356
7357
|
"svg",
|
|
7357
7358
|
{
|
|
7358
7359
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7373,7 +7374,7 @@ const Ka = ({
|
|
|
7373
7374
|
}
|
|
7374
7375
|
)
|
|
7375
7376
|
},
|
|
7376
|
-
|
|
7377
|
+
L
|
|
7377
7378
|
);
|
|
7378
7379
|
})
|
|
7379
7380
|
}
|
|
@@ -7381,7 +7382,7 @@ const Ka = ({
|
|
|
7381
7382
|
g && !v && /* @__PURE__ */ s(
|
|
7382
7383
|
"div",
|
|
7383
7384
|
{
|
|
7384
|
-
id:
|
|
7385
|
+
id: R,
|
|
7385
7386
|
className: "mt-2 text-sm text-color-gray-600",
|
|
7386
7387
|
children: g
|
|
7387
7388
|
}
|
|
@@ -7389,7 +7390,7 @@ const Ka = ({
|
|
|
7389
7390
|
v && !f && g && /* @__PURE__ */ s(
|
|
7390
7391
|
"div",
|
|
7391
7392
|
{
|
|
7392
|
-
id:
|
|
7393
|
+
id: R,
|
|
7393
7394
|
className: "mt-2 text-sm text-color-red-600",
|
|
7394
7395
|
children: g
|
|
7395
7396
|
}
|
|
@@ -7410,11 +7411,11 @@ const Ka = ({
|
|
|
7410
7411
|
role: "radiogroup",
|
|
7411
7412
|
"aria-label": h,
|
|
7412
7413
|
"aria-labelledby": $,
|
|
7413
|
-
"aria-describedby":
|
|
7414
|
+
"aria-describedby": R,
|
|
7414
7415
|
"aria-required": b,
|
|
7415
7416
|
className: `flex ${a === "row" ? "flex-row gap-6" : "flex-col gap-3"} ${u}`,
|
|
7416
|
-
children: n.map(({ label: A, value:
|
|
7417
|
-
const T = c || j, B = I ===
|
|
7417
|
+
children: n.map(({ label: A, value: L, disabled: j, id: W }, M) => {
|
|
7418
|
+
const T = c || j, B = I === L, S = v && B;
|
|
7418
7419
|
return /* @__PURE__ */ k(
|
|
7419
7420
|
"label",
|
|
7420
7421
|
{
|
|
@@ -7425,12 +7426,12 @@ const Ka = ({
|
|
|
7425
7426
|
{
|
|
7426
7427
|
type: "radio",
|
|
7427
7428
|
name: e,
|
|
7428
|
-
value:
|
|
7429
|
+
value: L,
|
|
7429
7430
|
disabled: T,
|
|
7430
7431
|
checked: B,
|
|
7431
|
-
onChange: () => !T && V(
|
|
7432
|
+
onChange: () => !T && V(L, M),
|
|
7432
7433
|
onBlur: ue,
|
|
7433
|
-
onFocus: (P) =>
|
|
7434
|
+
onFocus: (P) => _(P, M),
|
|
7434
7435
|
className: "sr-only peer",
|
|
7435
7436
|
"aria-invalid": v,
|
|
7436
7437
|
...W && { id: W }
|
|
@@ -7439,19 +7440,19 @@ const Ka = ({
|
|
|
7439
7440
|
/* @__PURE__ */ s(
|
|
7440
7441
|
"div",
|
|
7441
7442
|
{
|
|
7442
|
-
className: `rounded-full border-2 transition-all duration-150 ${
|
|
7443
|
+
className: `rounded-full border-2 transition-all duration-150 ${S ? "border-color-red-500 peer-checked:border-[7px] peer-checked:border-color-red-500" : `border-color-gray-400 peer-checked:border-[7px] ${w.border}`} ${m} ${O(p)}`
|
|
7443
7444
|
}
|
|
7444
7445
|
),
|
|
7445
7446
|
/* @__PURE__ */ s(
|
|
7446
7447
|
"span",
|
|
7447
7448
|
{
|
|
7448
|
-
className: `ml-2 text-sm ${
|
|
7449
|
+
className: `ml-2 text-sm ${S ? "text-color-red-500" : w.text}`,
|
|
7449
7450
|
children: A
|
|
7450
7451
|
}
|
|
7451
7452
|
)
|
|
7452
7453
|
]
|
|
7453
7454
|
},
|
|
7454
|
-
|
|
7455
|
+
L
|
|
7455
7456
|
);
|
|
7456
7457
|
})
|
|
7457
7458
|
}
|
|
@@ -7459,7 +7460,7 @@ const Ka = ({
|
|
|
7459
7460
|
g && !v && /* @__PURE__ */ s(
|
|
7460
7461
|
"div",
|
|
7461
7462
|
{
|
|
7462
|
-
id:
|
|
7463
|
+
id: R,
|
|
7463
7464
|
className: "mt-2 text-sm text-color-gray-600",
|
|
7464
7465
|
children: g
|
|
7465
7466
|
}
|
|
@@ -7467,7 +7468,7 @@ const Ka = ({
|
|
|
7467
7468
|
v && !f && g && /* @__PURE__ */ s(
|
|
7468
7469
|
"div",
|
|
7469
7470
|
{
|
|
7470
|
-
id:
|
|
7471
|
+
id: R,
|
|
7471
7472
|
className: "mt-2 text-sm text-color-red-600",
|
|
7472
7473
|
children: g
|
|
7473
7474
|
}
|
|
@@ -8618,23 +8619,23 @@ const Jr = ({
|
|
|
8618
8619
|
fromTime: E,
|
|
8619
8620
|
toTime: H
|
|
8620
8621
|
}) => {
|
|
8621
|
-
const [oe, Z] = q(!1), [re, ge] = q(null), [
|
|
8622
|
+
const [oe, Z] = q(!1), [re, ge] = q(null), [ee, I] = q(
|
|
8622
8623
|
aa($, y, h)
|
|
8623
8624
|
), [O, U] = q(Tn(f, h)), [V, ue] = q(
|
|
8624
8625
|
$ ? new Date($) : null
|
|
8625
|
-
), [
|
|
8626
|
+
), [_, w] = q(
|
|
8626
8627
|
y ? new Date(y) : null
|
|
8627
|
-
), [
|
|
8628
|
+
), [R, A] = q(null), [L, j] = q({
|
|
8628
8629
|
hour: 12,
|
|
8629
8630
|
minute: 0,
|
|
8630
8631
|
ampm: "AM"
|
|
8631
|
-
}), W = se(null), [
|
|
8632
|
+
}), W = se(null), [M, T] = q(
|
|
8632
8633
|
Tn(f, h)
|
|
8633
|
-
), [B,
|
|
8634
|
+
), [B, S] = q(
|
|
8634
8635
|
$ ? new Date($) : null
|
|
8635
|
-
), [P,
|
|
8636
|
+
), [P, J] = q(
|
|
8636
8637
|
y ? new Date(y) : null
|
|
8637
|
-
), [z,
|
|
8638
|
+
), [z, N] = q(!1), [te, ie] = q(!1), [fe, G] = q(!1), [ae, _e] = q({
|
|
8638
8639
|
hour: 12,
|
|
8639
8640
|
minute: 0,
|
|
8640
8641
|
ampm: "AM"
|
|
@@ -8664,11 +8665,11 @@ const Jr = ({
|
|
|
8664
8665
|
}, [f, h]), le(() => {
|
|
8665
8666
|
if (!$) return;
|
|
8666
8667
|
const ne = new Date($);
|
|
8667
|
-
ue(ne),
|
|
8668
|
+
ue(ne), S(ne), U(ne), T(ne);
|
|
8668
8669
|
}, [$]), le(() => {
|
|
8669
8670
|
if (!y) return;
|
|
8670
8671
|
const ne = new Date(y);
|
|
8671
|
-
w(ne),
|
|
8672
|
+
w(ne), J(ne), U(ne), T(ne);
|
|
8672
8673
|
}, [y]), le(() => {
|
|
8673
8674
|
if (!D || f || h) return;
|
|
8674
8675
|
const ne = /* @__PURE__ */ new Date();
|
|
@@ -8682,41 +8683,41 @@ const Jr = ({
|
|
|
8682
8683
|
e,
|
|
8683
8684
|
O,
|
|
8684
8685
|
V,
|
|
8685
|
-
|
|
8686
|
+
_,
|
|
8686
8687
|
U,
|
|
8687
8688
|
ue,
|
|
8688
8689
|
w,
|
|
8689
8690
|
Z
|
|
8690
8691
|
);
|
|
8691
8692
|
return document.addEventListener("mousedown", ne), () => document.removeEventListener("mousedown", ne);
|
|
8692
|
-
}, [oe, n, e, O, V,
|
|
8693
|
-
const Y =
|
|
8693
|
+
}, [oe, n, e, O, V, _]);
|
|
8694
|
+
const Y = Q(
|
|
8694
8695
|
(ne) => la(ne, g, v, b, x, C),
|
|
8695
8696
|
[g, v, b, x, C]
|
|
8696
|
-
), ve =
|
|
8697
|
-
(ne) => ga(ne, e, O, V,
|
|
8698
|
-
[e, O, V,
|
|
8699
|
-
), he =
|
|
8697
|
+
), ve = Q(
|
|
8698
|
+
(ne) => ga(ne, e, O, V, _, R),
|
|
8699
|
+
[e, O, V, _, R]
|
|
8700
|
+
), he = Q((ne) => {
|
|
8700
8701
|
ne.stopPropagation(), ge(ne.currentTarget), Z(!0);
|
|
8701
|
-
const Oe =
|
|
8702
|
+
const Oe = M ?? (h ? yt(h) : null);
|
|
8702
8703
|
Oe && I(new Date(Oe));
|
|
8703
|
-
}, [
|
|
8704
|
-
Z(!1), U(
|
|
8705
|
-
}, [
|
|
8706
|
-
(ne) => xa(ne, e, Y, V,
|
|
8707
|
-
[e, Y, V,
|
|
8708
|
-
), Fe =
|
|
8704
|
+
}, [M, h]), we = Q(() => {
|
|
8705
|
+
Z(!1), U(M), ue(B), w(P), I(M ? new Date(M) : /* @__PURE__ */ new Date()), d == null || d();
|
|
8706
|
+
}, [M, B, P, d]), je = Q(
|
|
8707
|
+
(ne) => xa(ne, e, Y, V, _, U, ue, w),
|
|
8708
|
+
[e, Y, V, _]
|
|
8709
|
+
), Fe = Q((ne) => {
|
|
8709
8710
|
if (!ne || Y(ne)) {
|
|
8710
8711
|
A(null);
|
|
8711
8712
|
return;
|
|
8712
8713
|
}
|
|
8713
|
-
e === "range" && V && !
|
|
8714
|
-
}, [e, Y, V,
|
|
8715
|
-
Z(!1), e === "single" ? va(o, O,
|
|
8716
|
-
}, [e, o, O,
|
|
8714
|
+
e === "range" && V && !_ && A(ne);
|
|
8715
|
+
}, [e, Y, V, _]), We = Q(() => A(null), []), Ue = Q(() => {
|
|
8716
|
+
Z(!1), e === "single" ? va(o, O, L, T, a, c) : ha(V, _, S, J, a, c);
|
|
8717
|
+
}, [e, o, O, L, V, _, a, c]), Ke = Q(() => {
|
|
8717
8718
|
const ne = Dn(ae);
|
|
8718
8719
|
ie(!1), a == null || a({ fromTime: ne.getTime(), toTime: Le ? Le.getTime() : null });
|
|
8719
|
-
}, [ae, Le, a]), Ge =
|
|
8720
|
+
}, [ae, Le, a]), Ge = Q(() => {
|
|
8720
8721
|
if (!Se) return;
|
|
8721
8722
|
const ne = Dn(ke);
|
|
8722
8723
|
if (!(ne.getTime() > Se.getTime())) {
|
|
@@ -8726,26 +8727,26 @@ const Jr = ({
|
|
|
8726
8727
|
G(!1);
|
|
8727
8728
|
const nn = { fromTime: Se.getTime(), toTime: ne.getTime() };
|
|
8728
8729
|
a == null || a(nn), c == null || c(nn);
|
|
8729
|
-
}, [Se, ke, a, c]), Xe =
|
|
8730
|
+
}, [Se, ke, a, c]), Xe = Q(() => {
|
|
8730
8731
|
ie(!1), Se && _e(gt(Se)), d == null || d();
|
|
8731
|
-
}, [Se, d]), Je =
|
|
8732
|
+
}, [Se, d]), Je = Q(() => {
|
|
8732
8733
|
G(!1), Le && Ne(gt(Le)), d == null || d();
|
|
8733
|
-
}, [Le, d]), Qe =
|
|
8734
|
+
}, [Le, d]), Qe = Q(() => {
|
|
8734
8735
|
if (!Se) {
|
|
8735
8736
|
u == null || u({ type: "FROM_TIME_REQUIRED", message: "Please select and confirm From Time first" });
|
|
8736
8737
|
return;
|
|
8737
8738
|
}
|
|
8738
8739
|
G(!0);
|
|
8739
8740
|
}, [Se, u]), et = $e(
|
|
8740
|
-
() => pa(
|
|
8741
|
-
[
|
|
8742
|
-
), it =
|
|
8743
|
-
(ne, Oe) => fa(ne, e, o, t,
|
|
8744
|
-
[e, o, t,
|
|
8741
|
+
() => pa(ee, b),
|
|
8742
|
+
[ee, b]
|
|
8743
|
+
), it = Q(
|
|
8744
|
+
(ne, Oe) => fa(ne, e, o, t, L, m, Oe),
|
|
8745
|
+
[e, o, t, L, m]
|
|
8745
8746
|
), go = $e(
|
|
8746
|
-
() => ya(e,
|
|
8747
|
-
[e,
|
|
8748
|
-
), fo = Sa(n), mo = _a(n, re), tn = $a(e,
|
|
8747
|
+
() => ya(e, M, f, V, _, B, P, it, m),
|
|
8748
|
+
[e, M, f, V, _, B, P, it, m]
|
|
8749
|
+
), fo = Sa(n), mo = _a(n, re), tn = $a(e, _, o), vo = za(tn);
|
|
8749
8750
|
if (i)
|
|
8750
8751
|
return /* @__PURE__ */ s(
|
|
8751
8752
|
ka,
|
|
@@ -8780,7 +8781,7 @@ const Jr = ({
|
|
|
8780
8781
|
/* @__PURE__ */ s(
|
|
8781
8782
|
ba,
|
|
8782
8783
|
{
|
|
8783
|
-
currentDate:
|
|
8784
|
+
currentDate: ee,
|
|
8784
8785
|
setCurrentDate: I,
|
|
8785
8786
|
constraints: F
|
|
8786
8787
|
}
|
|
@@ -8798,7 +8799,7 @@ const Jr = ({
|
|
|
8798
8799
|
}
|
|
8799
8800
|
)
|
|
8800
8801
|
] }),
|
|
8801
|
-
(t || o) && /* @__PURE__ */ s(Wt, { timeState:
|
|
8802
|
+
(t || o) && /* @__PURE__ */ s(Wt, { timeState: L, setTimeState: j }),
|
|
8802
8803
|
/* @__PURE__ */ s("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ s(
|
|
8803
8804
|
Ee,
|
|
8804
8805
|
{
|
|
@@ -8841,10 +8842,10 @@ const Jr = ({
|
|
|
8841
8842
|
z && /* @__PURE__ */ s(
|
|
8842
8843
|
Ca,
|
|
8843
8844
|
{
|
|
8844
|
-
time:
|
|
8845
|
+
time: L,
|
|
8845
8846
|
setTime: j,
|
|
8846
8847
|
showTimePicker: z,
|
|
8847
|
-
setShowTimePicker:
|
|
8848
|
+
setShowTimePicker: N,
|
|
8848
8849
|
setInternalSelectedDate: U,
|
|
8849
8850
|
setConfirmedDate: T
|
|
8850
8851
|
}
|
|
@@ -9247,72 +9248,71 @@ const jn = [
|
|
|
9247
9248
|
showClearAll: v = !1
|
|
9248
9249
|
}) => {
|
|
9249
9250
|
const [f, b] = q(!1), [h, $] = q(""), [y, C] = q(-1), [x, D] = q("bottom"), E = se(null), H = se(null), oe = se(null), Z = t ? Array.isArray(e) ? e : [] : e && !Array.isArray(e) ? [e] : [], re = h ? jn.filter(
|
|
9250
|
-
(
|
|
9251
|
+
(_) => _.name.toLowerCase().includes(h.toLowerCase()) || _.code.toLowerCase().includes(h.toLowerCase()) || _.dialCode.includes(h)
|
|
9251
9252
|
) : jn, ge = re.filter(
|
|
9252
|
-
(
|
|
9253
|
-
),
|
|
9254
|
-
(
|
|
9255
|
-
), I = (
|
|
9253
|
+
(_) => Z.some((w) => w.code === _.code)
|
|
9254
|
+
), ee = re.filter(
|
|
9255
|
+
(_) => !Z.some((w) => w.code === _.code)
|
|
9256
|
+
), I = (_) => {
|
|
9256
9257
|
if (t) {
|
|
9257
|
-
const w = Array.isArray(e) ? e : [], A = w.some((
|
|
9258
|
+
const w = Array.isArray(e) ? e : [], A = w.some((L) => L.code === _.code) ? w.filter((L) => L.code !== _.code) : [...w, _];
|
|
9258
9259
|
n == null || n(A);
|
|
9259
9260
|
} else
|
|
9260
|
-
n == null || n(
|
|
9261
|
-
}, O = (
|
|
9262
|
-
w.stopPropagation(), t && Array.isArray(e) && (n == null || n(e.filter((
|
|
9263
|
-
}, U = (
|
|
9264
|
-
|
|
9261
|
+
n == null || n(_), b(!1), $("");
|
|
9262
|
+
}, O = (_, w) => {
|
|
9263
|
+
w.stopPropagation(), t && Array.isArray(e) && (n == null || n(e.filter((R) => R.code !== _.code)));
|
|
9264
|
+
}, U = (_) => {
|
|
9265
|
+
_.stopPropagation(), n == null || n(t ? [] : null);
|
|
9265
9266
|
};
|
|
9266
9267
|
le(() => {
|
|
9267
|
-
const
|
|
9268
|
+
const _ = (w) => {
|
|
9268
9269
|
E.current && !E.current.contains(w.target) && (b(!1), $(""), C(-1));
|
|
9269
9270
|
};
|
|
9270
|
-
return document.addEventListener("mousedown",
|
|
9271
|
+
return document.addEventListener("mousedown", _), () => document.removeEventListener("mousedown", _);
|
|
9271
9272
|
}, []), le(() => {
|
|
9272
9273
|
if (f && E.current) {
|
|
9273
9274
|
if (d === "auto") {
|
|
9274
|
-
const
|
|
9275
|
-
D(
|
|
9275
|
+
const _ = E.current.getBoundingClientRect(), w = Math.min(re.length * 44, c), R = window.innerHeight - _.bottom, A = _.top;
|
|
9276
|
+
D(R >= w || R >= A ? "bottom" : "top");
|
|
9276
9277
|
} else
|
|
9277
9278
|
D(d);
|
|
9278
9279
|
o && H.current && H.current.focus();
|
|
9279
9280
|
}
|
|
9280
9281
|
}, [f, re.length, c, d, o]);
|
|
9281
|
-
const V = (
|
|
9282
|
-
|
|
9282
|
+
const V = (_) => {
|
|
9283
|
+
_.key === "ArrowDown" ? (_.preventDefault(), f ? C((w) => Math.min(w + 1, re.length - 1)) : (b(!0), C(0))) : _.key === "ArrowUp" ? (_.preventDefault(), C((w) => Math.max(w - 1, 0))) : _.key === "Enter" ? (_.preventDefault(), y >= 0 && re[y] && I(re[y])) : _.key === "Escape" && (_.preventDefault(), b(!1), $(""), C(-1));
|
|
9283
9284
|
}, ue = () => {
|
|
9284
9285
|
if (t) {
|
|
9285
9286
|
if (Z.length === 0)
|
|
9286
9287
|
return /* @__PURE__ */ s("span", { className: "text-color-gray-400", children: i });
|
|
9287
|
-
const w = Z[0],
|
|
9288
|
+
const w = Z[0], R = Z.length - 1;
|
|
9288
9289
|
return /* @__PURE__ */ k("div", { className: "flex items-center gap-2", children: [
|
|
9289
9290
|
/* @__PURE__ */ k("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 text-xs bg-color-gray-100 rounded-md", children: [
|
|
9290
9291
|
p && /* @__PURE__ */ s("img", { src: w.flag, alt: w.name, className: "size-4 object-contain" }),
|
|
9291
9292
|
/* @__PURE__ */ s("span", { children: w.name }),
|
|
9292
9293
|
/* @__PURE__ */ s(
|
|
9293
|
-
"
|
|
9294
|
+
"div",
|
|
9294
9295
|
{
|
|
9295
|
-
type: "button",
|
|
9296
9296
|
onClick: (A) => O(w, A),
|
|
9297
9297
|
className: "ml-1 text-color-gray-500 hover:text-color-gray-700",
|
|
9298
9298
|
children: /* @__PURE__ */ s("svg", { className: "size-3", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ s("path", { d: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636l4.95 4.95z" }) })
|
|
9299
9299
|
}
|
|
9300
9300
|
)
|
|
9301
9301
|
] }),
|
|
9302
|
-
|
|
9302
|
+
R > 0 && /* @__PURE__ */ k("span", { className: "text-sm text-color-gray-500", children: [
|
|
9303
9303
|
"+",
|
|
9304
|
-
|
|
9304
|
+
R,
|
|
9305
9305
|
" more"
|
|
9306
9306
|
] })
|
|
9307
9307
|
] });
|
|
9308
9308
|
}
|
|
9309
|
-
const
|
|
9310
|
-
return
|
|
9311
|
-
p && /* @__PURE__ */ s("img", { src:
|
|
9312
|
-
/* @__PURE__ */ s("span", { children:
|
|
9309
|
+
const _ = Z[0];
|
|
9310
|
+
return _ ? /* @__PURE__ */ k("span", { className: "flex items-center gap-2", children: [
|
|
9311
|
+
p && /* @__PURE__ */ s("img", { src: _.flag, alt: _.name, className: "size-5 object-contain" }),
|
|
9312
|
+
/* @__PURE__ */ s("span", { children: _.name }),
|
|
9313
9313
|
m && /* @__PURE__ */ k("span", { className: "text-color-gray-400", children: [
|
|
9314
9314
|
"(",
|
|
9315
|
-
|
|
9315
|
+
_.dialCode,
|
|
9316
9316
|
")"
|
|
9317
9317
|
] })
|
|
9318
9318
|
] }) : /* @__PURE__ */ s("span", { className: "text-color-gray-400", children: i });
|
|
@@ -9360,8 +9360,8 @@ const jn = [
|
|
|
9360
9360
|
ref: H,
|
|
9361
9361
|
type: "text",
|
|
9362
9362
|
value: h,
|
|
9363
|
-
onChange: (
|
|
9364
|
-
$(
|
|
9363
|
+
onChange: (_) => {
|
|
9364
|
+
$(_.target.value), C(0);
|
|
9365
9365
|
},
|
|
9366
9366
|
onKeyDown: V,
|
|
9367
9367
|
placeholder: r,
|
|
@@ -9375,38 +9375,38 @@ const jn = [
|
|
|
9375
9375
|
className: "overflow-y-auto",
|
|
9376
9376
|
style: { maxHeight: `${c}px` },
|
|
9377
9377
|
children: re.length > 0 ? /* @__PURE__ */ k(be, { children: [
|
|
9378
|
-
ge.map((
|
|
9378
|
+
ge.map((_, w) => /* @__PURE__ */ k(
|
|
9379
9379
|
"li",
|
|
9380
9380
|
{
|
|
9381
|
-
onClick: () => I(
|
|
9381
|
+
onClick: () => I(_),
|
|
9382
9382
|
className: `flex items-center gap-3 cursor-pointer w-full px-4 py-2 text-left text-sm text-color-gray-700 bg-color-gray-200 hover:bg-color-gray-100
|
|
9383
9383
|
${y === w ? "bg-color-gray-100" : ""}`,
|
|
9384
9384
|
children: [
|
|
9385
9385
|
t && /* @__PURE__ */ s("span", { className: "flex items-center justify-center size-4 border rounded bg-color-blue-500 border-color-blue-500", children: /* @__PURE__ */ s("svg", { className: "size-3 text-color-white", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ s("path", { d: "M9.9997 15.1709L19.1921 5.97852L20.6063 7.39273L9.9997 17.9993L3.63574 11.6354L5.04996 10.2212L9.9997 15.1709Z" }) }) }),
|
|
9386
|
-
p && /* @__PURE__ */ s("img", { src:
|
|
9387
|
-
/* @__PURE__ */ s("span", { className: "flex-1", children:
|
|
9388
|
-
m && /* @__PURE__ */ s("span", { className: "text-color-gray-400", children:
|
|
9386
|
+
p && /* @__PURE__ */ s("img", { src: _.flag, alt: _.name, className: "size-5 object-contain" }),
|
|
9387
|
+
/* @__PURE__ */ s("span", { className: "flex-1", children: _.name }),
|
|
9388
|
+
m && /* @__PURE__ */ s("span", { className: "text-color-gray-400", children: _.dialCode })
|
|
9389
9389
|
]
|
|
9390
9390
|
},
|
|
9391
|
-
`selected-${
|
|
9391
|
+
`selected-${_.code}`
|
|
9392
9392
|
)),
|
|
9393
|
-
ge.length > 0 &&
|
|
9394
|
-
|
|
9395
|
-
const
|
|
9393
|
+
ge.length > 0 && ee.length > 0 && /* @__PURE__ */ s("li", { className: "border-t border-color-gray-200 my-1" }),
|
|
9394
|
+
ee.map((_, w) => {
|
|
9395
|
+
const R = ge.length + (ge.length > 0 && ee.length > 0 ? 1 : 0) + w;
|
|
9396
9396
|
return /* @__PURE__ */ k(
|
|
9397
9397
|
"li",
|
|
9398
9398
|
{
|
|
9399
|
-
onClick: () => I(
|
|
9399
|
+
onClick: () => I(_),
|
|
9400
9400
|
className: `flex items-center gap-3 cursor-pointer w-full px-4 py-2 text-left text-sm text-color-gray-700 hover:bg-color-gray-100
|
|
9401
|
-
${y ===
|
|
9401
|
+
${y === R ? "bg-color-gray-100" : ""}`,
|
|
9402
9402
|
children: [
|
|
9403
9403
|
t && /* @__PURE__ */ s("span", { className: "flex items-center justify-center size-4 border rounded border-color-gray-300" }),
|
|
9404
|
-
p && /* @__PURE__ */ s("img", { src:
|
|
9405
|
-
/* @__PURE__ */ s("span", { className: "flex-1", children:
|
|
9406
|
-
m && /* @__PURE__ */ s("span", { className: "text-color-gray-400", children:
|
|
9404
|
+
p && /* @__PURE__ */ s("img", { src: _.flag, alt: _.name, className: "size-5 object-contain" }),
|
|
9405
|
+
/* @__PURE__ */ s("span", { className: "flex-1", children: _.name }),
|
|
9406
|
+
m && /* @__PURE__ */ s("span", { className: "text-color-gray-400", children: _.dialCode })
|
|
9407
9407
|
]
|
|
9408
9408
|
},
|
|
9409
|
-
`unselected-${
|
|
9409
|
+
`unselected-${_.code}`
|
|
9410
9410
|
);
|
|
9411
9411
|
})
|
|
9412
9412
|
] }) : /* @__PURE__ */ s("li", { className: "px-4 py-2 text-sm text-color-gray-500", children: "No countries found" })
|