@rpcbase/ui 0.233.0 → 0.234.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/dist/index167.js +3 -3
- package/dist/index172.js +3 -3
- package/dist/index175.js +1 -1
- package/dist/index176.js +4 -4
- package/dist/index182.js +1 -1
- package/dist/index184.js +12 -12
- package/dist/index185.js +1 -1
- package/dist/index187.js +5 -5
- package/dist/index189.js +6 -6
- package/dist/index190.js +5 -5
- package/dist/index193.js +3 -3
- package/dist/index194.js +5 -5
- package/dist/index198.js +57 -36
- package/dist/index198.js.map +1 -1
- package/dist/index199.js.map +1 -1
- package/dist/index262.js +2 -2
- package/dist/index274.js +1 -1
- package/dist/index278.js +20 -20
- package/dist/index278.js.map +1 -1
- package/dist/index279.js +24 -62
- package/dist/index279.js.map +1 -1
- package/dist/index280.js +16 -6
- package/dist/index280.js.map +1 -1
- package/dist/index281.js +20 -12
- package/dist/index281.js.map +1 -1
- package/dist/index282.js +64 -48
- package/dist/index282.js.map +1 -1
- package/dist/index283.js +7 -4
- package/dist/index283.js.map +1 -1
- package/dist/index284.js +11 -29
- package/dist/index284.js.map +1 -1
- package/dist/index285.js +49 -15
- package/dist/index285.js.map +1 -1
- package/dist/index286.js +4 -6
- package/dist/index286.js.map +1 -1
- package/dist/index287.js +28 -20
- package/dist/index287.js.map +1 -1
- package/dist/index288.js +15 -50
- package/dist/index288.js.map +1 -1
- package/dist/index289.js +5 -25
- package/dist/index289.js.map +1 -1
- package/dist/index290.js +21 -41
- package/dist/index290.js.map +1 -1
- package/dist/index291.js +50 -38
- package/dist/index291.js.map +1 -1
- package/dist/index292.js +26 -45
- package/dist/index292.js.map +1 -1
- package/dist/index293.js +40 -19
- package/dist/index293.js.map +1 -1
- package/dist/index294.js +38 -69
- package/dist/index294.js.map +1 -1
- package/dist/index295.js +45 -18
- package/dist/index295.js.map +1 -1
- package/dist/index296.js +20 -11
- package/dist/index296.js.map +1 -1
- package/dist/index297.js +69 -26
- package/dist/index297.js.map +1 -1
- package/dist/index298.js +16 -12
- package/dist/index298.js.map +1 -1
- package/dist/index299.js +10 -17
- package/dist/index299.js.map +1 -1
- package/dist/index300.js +26 -35
- package/dist/index300.js.map +1 -1
- package/dist/index301.js +12 -261
- package/dist/index301.js.map +1 -1
- package/dist/index302.js +15 -275
- package/dist/index302.js.map +1 -1
- package/dist/index303.js +36 -68
- package/dist/index303.js.map +1 -1
- package/dist/index304.js +256 -93
- package/dist/index304.js.map +1 -1
- package/dist/index305.js +270 -75
- package/dist/index305.js.map +1 -1
- package/dist/index306.js +68 -3
- package/dist/index306.js.map +1 -1
- package/dist/index307.js +96 -26
- package/dist/index307.js.map +1 -1
- package/dist/index308.js +83 -16
- package/dist/index308.js.map +1 -1
- package/dist/index309.js +4 -35
- package/dist/index309.js.map +1 -1
- package/dist/index310.js +28 -15
- package/dist/index310.js.map +1 -1
- package/dist/index311.js +16 -3
- package/dist/index311.js.map +1 -1
- package/dist/index312.js +35 -27
- package/dist/index312.js.map +1 -1
- package/dist/index313.js +16 -28
- package/dist/index313.js.map +1 -1
- package/dist/index314.js +4 -4
- package/dist/index314.js.map +1 -1
- package/dist/index315.js +23 -75
- package/dist/index315.js.map +1 -1
- package/dist/index316.js +25 -266
- package/dist/index316.js.map +1 -1
- package/dist/index317.js +4 -12
- package/dist/index317.js.map +1 -1
- package/dist/index318.js +79 -11
- package/dist/index318.js.map +1 -1
- package/dist/index319.js +267 -23
- package/dist/index319.js.map +1 -1
- package/dist/index320.js +11 -16
- package/dist/index320.js.map +1 -1
- package/dist/index321.js +10 -125
- package/dist/index321.js.map +1 -1
- package/dist/index322.js +24 -4
- package/dist/index322.js.map +1 -1
- package/dist/index323.js +16 -40
- package/dist/index323.js.map +1 -1
- package/dist/index324.js +121 -61
- package/dist/index324.js.map +1 -1
- package/dist/index325.js +6 -14
- package/dist/index325.js.map +1 -1
- package/dist/index326.js +40 -7
- package/dist/index326.js.map +1 -1
- package/dist/index327.js +65 -5
- package/dist/index327.js.map +1 -1
- package/dist/index328.js +14 -4
- package/dist/index328.js.map +1 -1
- package/dist/index329.js +7 -10
- package/dist/index329.js.map +1 -1
- package/dist/index330.js +5 -7
- package/dist/index330.js.map +1 -1
- package/dist/index331.js +3 -133
- package/dist/index331.js.map +1 -1
- package/dist/index332.js +9 -398
- package/dist/index332.js.map +1 -1
- package/dist/index333.js +7 -52
- package/dist/index333.js.map +1 -1
- package/dist/index334.js +133 -11
- package/dist/index334.js.map +1 -1
- package/dist/index335.js +399 -11
- package/dist/index335.js.map +1 -1
- package/dist/index336.js +51 -18
- package/dist/index336.js.map +1 -1
- package/dist/index337.js +11 -28
- package/dist/index337.js.map +1 -1
- package/dist/index338.js +11 -16
- package/dist/index338.js.map +1 -1
- package/dist/index339.js +1 -1
- package/dist/index346.js +2 -2
- package/dist/index347.js +122 -5
- package/dist/index347.js.map +1 -1
- package/dist/index348.js +31 -121
- package/dist/index348.js.map +1 -1
- package/dist/index349.js +72 -31
- package/dist/index349.js.map +1 -1
- package/dist/index350.js +139 -70
- package/dist/index350.js.map +1 -1
- package/dist/index351.js +35 -116
- package/dist/index351.js.map +1 -1
- package/dist/index352.js +44 -56
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +14 -49
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +6 -15
- package/dist/index354.js.map +1 -1
- package/dist/index368.js +1 -1
- package/dist/index371.js +2 -2
- package/dist/index372.js +3 -3
- package/dist/index374.js +3 -3
- package/dist/index375.js +1 -1
- package/dist/index376.js +3 -3
- package/dist/index378.js +2 -2
- package/dist/index380.js +1 -1
- package/dist/index381.js +2 -2
- package/dist/index384.js +2 -2
- package/dist/index386.js +1 -1
- package/dist/index407.js +1 -1
- package/dist/index417.js +1 -1
- package/dist/index418.js +1 -1
- package/dist/index421.js +1 -1
- package/dist/index422.js +1 -1
- package/dist/index427.js +2 -2
- package/dist/index429.js +2 -2
- package/dist/index44.js +1 -1
- package/dist/index45.js +2 -2
- package/dist/index49.js +28 -28
- package/dist/index50.js +21 -21
- package/dist/index51.js +1 -1
- package/dist/index52.js +8 -8
- package/dist/index53.js +2 -2
- package/dist/index55.js +17 -17
- package/dist/index56.js +4 -4
- package/dist/index57.js +3 -3
- package/dist/index58.js +7 -7
- package/dist/index59.js +4 -4
- package/dist/index60.js +12 -12
- package/dist/index61.js +2 -2
- package/dist/index62.js +2 -2
- package/dist/index70.js +1 -1
- package/dist/index71.js +1 -1
- package/dist/index74.js +6 -2
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +8 -2
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +5 -5
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +2 -8
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +2 -6
- package/dist/index78.js.map +1 -1
- package/package.json +1 -1
package/dist/index167.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import b from "./index262.js";
|
|
2
|
-
import y from "./
|
|
3
|
-
import m from "./
|
|
4
|
-
import C from "./
|
|
2
|
+
import y from "./index278.js";
|
|
3
|
+
import m from "./index279.js";
|
|
4
|
+
import C from "./index280.js";
|
|
5
5
|
import v from "./index158.js";
|
|
6
6
|
import { VALID_PUNCTUATION as s, VALID_DIGITS as g, PLUS_CHARS as p } from "./index160.js";
|
|
7
7
|
function d(i) {
|
package/dist/index172.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import b from "./index191.js";
|
|
2
2
|
import * as c from "react";
|
|
3
3
|
import { createElement as p } from "react";
|
|
4
|
-
import { useMergedRefs as E, useMergedRefsN as g } from "./
|
|
4
|
+
import { useMergedRefs as E, useMergedRefsN as g } from "./index282.js";
|
|
5
5
|
import { getReactElementRef as y } from "./index339.js";
|
|
6
6
|
import { mergeObjects as R } from "./index340.js";
|
|
7
7
|
import { warn as v } from "./index341.js";
|
|
8
|
-
import { EMPTY_OBJECT as f } from "./
|
|
8
|
+
import { EMPTY_OBJECT as f } from "./index289.js";
|
|
9
9
|
import { getStateAttributesProps as w } from "./index342.js";
|
|
10
10
|
import { resolveClassName as C } from "./index343.js";
|
|
11
11
|
import { resolveStyle as T } from "./index344.js";
|
|
12
|
-
import { mergeClassNames as _, mergeProps as h, mergePropsN as k } from "./
|
|
12
|
+
import { mergeClassNames as _, mergeProps as h, mergePropsN as k } from "./index307.js";
|
|
13
13
|
function q(r, e, t = {}) {
|
|
14
14
|
const a = e.render, s = I(e, t);
|
|
15
15
|
if (t.enabled === !1)
|
package/dist/index175.js
CHANGED
package/dist/index176.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as l from "react";
|
|
2
|
-
import { isHTMLElement as M } from "./
|
|
3
|
-
import { useStableCallback as H } from "./
|
|
2
|
+
import { isHTMLElement as M } from "./index334.js";
|
|
3
|
+
import { useStableCallback as H } from "./index287.js";
|
|
4
4
|
import { error as y } from "./index355.js";
|
|
5
5
|
import { SafeReact as B } from "./index356.js";
|
|
6
|
-
import { useIsoLayoutEffect as A } from "./
|
|
6
|
+
import { useIsoLayoutEffect as A } from "./index286.js";
|
|
7
7
|
import { useCompositeRootContext as L } from "./index357.js";
|
|
8
8
|
import { useFocusableWhenDisabled as W } from "./index358.js";
|
|
9
|
-
import { mergeProps as $, makeEventPreventable as x } from "./
|
|
9
|
+
import { mergeProps as $, makeEventPreventable as x } from "./index307.js";
|
|
10
10
|
function Y(a = {}) {
|
|
11
11
|
const {
|
|
12
12
|
disabled: o = !1,
|
package/dist/index182.js
CHANGED
package/dist/index184.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import * as p from "react";
|
|
2
|
-
import { isHTMLElement as G, getNodeName as We, getWindow as _e } from "./
|
|
3
|
-
import { addEventListener as I } from "./
|
|
2
|
+
import { isHTMLElement as G, getNodeName as We, getWindow as _e } from "./index334.js";
|
|
3
|
+
import { addEventListener as I } from "./index325.js";
|
|
4
4
|
import { mergeCleanups as Te } from "./index373.js";
|
|
5
|
-
import { useMergedRefs as Fe } from "./
|
|
6
|
-
import { useValueAsRef as te } from "./
|
|
7
|
-
import { useStableCallback as ne } from "./
|
|
8
|
-
import { useIsoLayoutEffect as _ } from "./
|
|
9
|
-
import { useTimeout as ye } from "./
|
|
10
|
-
import { isWebKit as Ue } from "./
|
|
11
|
-
import { useAnimationFrame as $e } from "./
|
|
12
|
-
import { ownerDocument as O } from "./
|
|
5
|
+
import { useMergedRefs as Fe } from "./index282.js";
|
|
6
|
+
import { useValueAsRef as te } from "./index288.js";
|
|
7
|
+
import { useStableCallback as ne } from "./index287.js";
|
|
8
|
+
import { useIsoLayoutEffect as _ } from "./index286.js";
|
|
9
|
+
import { useTimeout as ye } from "./index310.js";
|
|
10
|
+
import { isWebKit as Ue } from "./index326.js";
|
|
11
|
+
import { useAnimationFrame as $e } from "./index327.js";
|
|
12
|
+
import { ownerDocument as O } from "./index309.js";
|
|
13
13
|
import { FocusGuard as xe } from "./index374.js";
|
|
14
|
-
import { isTypeableCombobox as Ie, getFloatingFocusElement as he, isTypeableElement as Be } from "./
|
|
14
|
+
import { isTypeableCombobox as Ie, getFloatingFocusElement as he, isTypeableElement as Be } from "./index315.js";
|
|
15
15
|
import { isVirtualClick as ze, isVirtualPointerEvent as Je, stopEvent as Qe } from "./index375.js";
|
|
16
16
|
import { isOutsideEvent as ve, getNextTabbable as Xe, getPreviousTabbable as Ye, tabbable as Se, isTabbable as ue, focusable as Ze } from "./index376.js";
|
|
17
17
|
import { getNodeAncestors as Ce, getNodeChildren as ke } from "./index377.js";
|
|
@@ -25,7 +25,7 @@ import { useFloatingTree as rt } from "./index382.js";
|
|
|
25
25
|
import { CLICK_TRIGGER_IDENTIFIER as ot } from "./index192.js";
|
|
26
26
|
import { resolveRef as w } from "./index383.js";
|
|
27
27
|
import { j as oe } from "./index30.js";
|
|
28
|
-
import { activeElement as V, contains as a, getTarget as B } from "./
|
|
28
|
+
import { activeElement as V, contains as a, getTarget as B } from "./index316.js";
|
|
29
29
|
import { triggerHover as st, outsidePress as ut, focusOut as it } from "./index177.js";
|
|
30
30
|
function ct(t, h) {
|
|
31
31
|
const D = _e(B(t));
|
package/dist/index185.js
CHANGED
package/dist/index187.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as o from "react";
|
|
2
2
|
import * as I from "react-dom";
|
|
3
|
-
import { isNode as V } from "./
|
|
4
|
-
import { addEventListener as O } from "./
|
|
3
|
+
import { isNode as V } from "./index334.js";
|
|
4
|
+
import { addEventListener as O } from "./index325.js";
|
|
5
5
|
import { mergeCleanups as w } from "./index373.js";
|
|
6
6
|
import { useId as G } from "./index345.js";
|
|
7
|
-
import { useIsoLayoutEffect as _ } from "./
|
|
8
|
-
import { useStableCallback as L } from "./
|
|
9
|
-
import { EMPTY_OBJECT as k } from "./
|
|
7
|
+
import { useIsoLayoutEffect as _ } from "./index286.js";
|
|
8
|
+
import { useStableCallback as L } from "./index287.js";
|
|
9
|
+
import { EMPTY_OBJECT as k } from "./index289.js";
|
|
10
10
|
import { FocusGuard as S } from "./index374.js";
|
|
11
11
|
import { enableFocusInside as T, isOutsideEvent as C, getPreviousTabbable as q, getNextTabbable as A, disableFocusInside as B } from "./index376.js";
|
|
12
12
|
import { createChangeEventDetails as H } from "./index175.js";
|
package/dist/index189.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as t from "react";
|
|
2
|
-
import { useScrollLock as v } from "./
|
|
3
|
-
import { useOpenInteractionType as I } from "./
|
|
2
|
+
import { useScrollLock as v } from "./index347.js";
|
|
3
|
+
import { useOpenInteractionType as I } from "./index300.js";
|
|
4
4
|
import { createChangeEventDetails as A } from "./index175.js";
|
|
5
5
|
import { useImplicitActiveTrigger as M, useOpenStateTransitions as B } from "./index193.js";
|
|
6
|
-
import { useSyncedFloatingRootContext as F } from "./
|
|
7
|
-
import { useRole as H } from "./
|
|
8
|
-
import { useDismiss as K } from "./
|
|
6
|
+
import { useSyncedFloatingRootContext as F } from "./index348.js";
|
|
7
|
+
import { useRole as H } from "./index349.js";
|
|
8
|
+
import { useDismiss as K } from "./index304.js";
|
|
9
9
|
import { useInteractions as L } from "./index195.js";
|
|
10
|
-
import { getTarget as U, contains as V } from "./
|
|
10
|
+
import { getTarget as U, contains as V } from "./index316.js";
|
|
11
11
|
import { imperativeAction as j } from "./index177.js";
|
|
12
12
|
function $(P) {
|
|
13
13
|
const {
|
package/dist/index190.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i from "react";
|
|
2
|
-
import { useRefWithInit as d } from "./
|
|
3
|
-
import { ReactStore as a } from "./
|
|
4
|
-
import { PopupTriggerMap as p } from "./
|
|
5
|
-
import { popupStoreSelectors as u, createInitialPopupStoreState as c } from "./
|
|
6
|
-
import { createSelector as n } from "./
|
|
2
|
+
import { useRefWithInit as d } from "./index283.js";
|
|
3
|
+
import { ReactStore as a } from "./index350.js";
|
|
4
|
+
import { PopupTriggerMap as p } from "./index351.js";
|
|
5
|
+
import { popupStoreSelectors as u, createInitialPopupStoreState as c } from "./index352.js";
|
|
6
|
+
import { createSelector as n } from "./index353.js";
|
|
7
7
|
const m = {
|
|
8
8
|
...u,
|
|
9
9
|
modal: n((e) => e.modal),
|
package/dist/index193.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as l from "react";
|
|
2
|
-
import { useStableCallback as a } from "./
|
|
3
|
-
import { useIsoLayoutEffect as s } from "./
|
|
4
|
-
import { useTransitionStatus as f } from "./
|
|
2
|
+
import { useStableCallback as a } from "./index287.js";
|
|
3
|
+
import { useIsoLayoutEffect as s } from "./index286.js";
|
|
4
|
+
import { useTransitionStatus as f } from "./index294.js";
|
|
5
5
|
import { useOpenChangeComplete as m } from "./index182.js";
|
|
6
6
|
function d(e, n) {
|
|
7
7
|
const t = l.useRef(null), r = l.useRef(null);
|
package/dist/index194.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as k from "react";
|
|
2
|
-
import { useAnimationFrame as b } from "./
|
|
3
|
-
import { useTimeout as I } from "./
|
|
4
|
-
import { EMPTY_OBJECT as x } from "./
|
|
5
|
-
import { isTypeableElement as L } from "./
|
|
2
|
+
import { useAnimationFrame as b } from "./index327.js";
|
|
3
|
+
import { useTimeout as I } from "./index310.js";
|
|
4
|
+
import { EMPTY_OBJECT as x } from "./index289.js";
|
|
5
|
+
import { isTypeableElement as L } from "./index315.js";
|
|
6
6
|
import { isMouseLikePointerType as M, isClickLikeEvent as S } from "./index375.js";
|
|
7
7
|
import { createChangeEventDetails as y } from "./index175.js";
|
|
8
|
-
import { getTarget as q } from "./
|
|
8
|
+
import { getTarget as q } from "./index316.js";
|
|
9
9
|
import { triggerPress as A } from "./index177.js";
|
|
10
10
|
function G(T, D = {}) {
|
|
11
11
|
const e = "rootStore" in T ? T.rootStore : T, g = e.context.dataRef, {
|
package/dist/index198.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { tzOffset as s } from "./index199.js";
|
|
2
|
-
class
|
|
2
|
+
class o extends Date {
|
|
3
3
|
//#region static
|
|
4
4
|
constructor(...e) {
|
|
5
|
-
super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(s(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)),
|
|
5
|
+
super(), e.length > 1 && typeof e[e.length - 1] == "string" && (this.timeZone = e.pop()), this.internal = /* @__PURE__ */ new Date(), isNaN(s(this.timeZone, this)) ? this.setTime(NaN) : e.length ? typeof e[0] == "number" && (e.length === 1 || e.length === 2 && typeof e[1] != "number") ? this.setTime(e[0]) : typeof e[0] == "string" ? this.setTime(+new Date(e[0])) : e[0] instanceof Date ? this.setTime(+e[0]) : (this.setTime(+new Date(...e)), z(this, e)) : this.setTime(Date.now());
|
|
6
6
|
}
|
|
7
|
-
static tz(e, ...
|
|
8
|
-
return
|
|
7
|
+
static tz(e, ...n) {
|
|
8
|
+
return n.length ? new o(...n, e) : new o(Date.now(), e);
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region time zone
|
|
12
12
|
withTimeZone(e) {
|
|
13
|
-
return new
|
|
13
|
+
return new o(+this, e);
|
|
14
14
|
}
|
|
15
15
|
getTimezoneOffset() {
|
|
16
16
|
const e = -s(this.timeZone, this);
|
|
@@ -19,52 +19,73 @@ class n extends Date {
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region time
|
|
21
21
|
setTime(e) {
|
|
22
|
-
return Date.prototype.setTime.apply(this, arguments),
|
|
22
|
+
return Date.prototype.setTime.apply(this, arguments), p(this), +this;
|
|
23
23
|
}
|
|
24
24
|
//#endregion
|
|
25
25
|
//#region date-fns integration
|
|
26
26
|
[/* @__PURE__ */ Symbol.for("constructDateFrom")](e) {
|
|
27
|
-
return new
|
|
27
|
+
return new o(+new Date(e), this.timeZone);
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const Z = /^(get|set)(?!UTC)/;
|
|
32
32
|
Object.getOwnPropertyNames(Date.prototype).forEach((t) => {
|
|
33
|
-
if (!
|
|
34
|
-
const e = t.replace(
|
|
35
|
-
|
|
33
|
+
if (!Z.test(t)) return;
|
|
34
|
+
const e = t.replace(Z, "$1UTC");
|
|
35
|
+
o.prototype[e] && (t.startsWith("get") ? o.prototype[t] = function() {
|
|
36
36
|
return this.internal[e]();
|
|
37
|
-
} : (
|
|
38
|
-
return Date.prototype[e].apply(this.internal, arguments),
|
|
39
|
-
},
|
|
40
|
-
return Date.prototype[e].apply(this, arguments),
|
|
37
|
+
} : (o.prototype[t] = function() {
|
|
38
|
+
return Date.prototype[e].apply(this.internal, arguments), j(this), +this;
|
|
39
|
+
}, o.prototype[e] = function() {
|
|
40
|
+
return Date.prototype[e].apply(this, arguments), p(this), +this;
|
|
41
41
|
}));
|
|
42
42
|
});
|
|
43
|
-
function
|
|
44
|
-
t.internal.setTime(+t), t.internal.setUTCSeconds(t.internal.getUTCSeconds() -
|
|
43
|
+
function p(t) {
|
|
44
|
+
t.internal.setTime(+t), t.internal.setUTCSeconds(t.internal.getUTCSeconds() - // Round after converting minutes to seconds to avoid fractional offset
|
|
45
|
+
// precision errors from historical offsets.
|
|
46
|
+
Math.round(-s(t.timeZone, t) * 60));
|
|
45
47
|
}
|
|
46
|
-
function
|
|
47
|
-
Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()),
|
|
48
|
+
function j(t) {
|
|
49
|
+
Date.prototype.setFullYear.call(t, t.internal.getUTCFullYear(), t.internal.getUTCMonth(), t.internal.getUTCDate()), Date.prototype.setHours.call(t, t.internal.getUTCHours(), t.internal.getUTCMinutes(), t.internal.getUTCSeconds(), t.internal.getUTCMilliseconds()), z(t);
|
|
48
50
|
}
|
|
49
|
-
function
|
|
50
|
-
const e = s(t.timeZone, t),
|
|
51
|
-
|
|
52
|
-
const r = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + C);
|
|
63
|
-
const h = s(t.timeZone, t), S = h > 0 ? Math.floor(h) : Math.ceil(h), T = u - S;
|
|
64
|
-
T && (t.internal.setUTCMinutes(t.internal.getUTCMinutes() + T), Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + T));
|
|
51
|
+
function z(t, e) {
|
|
52
|
+
const n = Array.isArray(e) ? v(e) : +t.internal, h = s(t.timeZone, t), i = h > 0 ? Math.floor(h) : Math.ceil(h), T = /* @__PURE__ */ new Date(+t);
|
|
53
|
+
T.setUTCHours(T.getUTCHours() - 1);
|
|
54
|
+
const r = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset(), S = -(/* @__PURE__ */ new Date(+T)).getTimezoneOffset(), b = r - S;
|
|
55
|
+
let M = r;
|
|
56
|
+
if (b && r !== i) {
|
|
57
|
+
const l = Date.prototype.getHours.apply(t), U = Array.isArray(e) ? e[3] || 0 : t.internal.getUTCHours();
|
|
58
|
+
if (l !== U) {
|
|
59
|
+
const f = /* @__PURE__ */ new Date(+t), H = r - i;
|
|
60
|
+
H && f.setUTCMinutes(f.getUTCMinutes() + H);
|
|
61
|
+
const O = s(t.timeZone, f);
|
|
62
|
+
(O > 0 ? Math.floor(O) : Math.ceil(O)) === i && (M = S);
|
|
63
|
+
}
|
|
65
64
|
}
|
|
65
|
+
const u = M - i;
|
|
66
|
+
u && Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + u);
|
|
67
|
+
const m = /* @__PURE__ */ new Date(+t);
|
|
68
|
+
m.setUTCSeconds(0);
|
|
69
|
+
const g = r > 0 ? m.getSeconds() : (m.getSeconds() - 60) % 60, a = Math.round(-(s(t.timeZone, t) * 60)) % 60;
|
|
70
|
+
(a || g) && Date.prototype.setUTCSeconds.call(t, Date.prototype.getUTCSeconds.call(t) + a + g);
|
|
71
|
+
const y = s(t.timeZone, t), c = y > 0 ? Math.floor(y) : Math.ceil(y), F = -(/* @__PURE__ */ new Date(+t)).getTimezoneOffset() - c, I = c !== i, D = F - u, w = c - i, N = n - c * 60 * 1e3, W = w > 0 && x(t) - n === w * 60 * 1e3 && x(t, N) !== n;
|
|
72
|
+
if (I && D && !W) {
|
|
73
|
+
Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + D);
|
|
74
|
+
const l = s(t.timeZone, t), U = l > 0 ? Math.floor(l) : Math.ceil(l), f = c - U;
|
|
75
|
+
f && D < 0 && Date.prototype.setUTCMinutes.call(t, Date.prototype.getUTCMinutes.call(t) + f);
|
|
76
|
+
}
|
|
77
|
+
p(t);
|
|
78
|
+
const C = (e ? n : n + a * 1e3) - +t.internal;
|
|
79
|
+
C && Math.abs(C) < 1800 * 1e3 && (Date.prototype.setTime.call(t, +t + C), p(t));
|
|
80
|
+
}
|
|
81
|
+
function v(t) {
|
|
82
|
+
return Date.UTC(t[0], t.length > 1 ? t[1] : 0, t.length > 2 ? t[2] : 1, ...t.slice(3));
|
|
83
|
+
}
|
|
84
|
+
function x(t, e) {
|
|
85
|
+
const n = new Date(e ?? +t);
|
|
86
|
+
return n.setUTCSeconds(n.getUTCSeconds() - Math.round(-s(t.timeZone, n) * 60)), +n;
|
|
66
87
|
}
|
|
67
88
|
export {
|
|
68
|
-
|
|
89
|
+
o as TZDateMini
|
|
69
90
|
};
|
|
70
91
|
//# sourceMappingURL=index198.js.map
|
package/dist/index198.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index198.js","sources":["../../../node_modules/@date-fns/tz/date/mini.js"],"sourcesContent":["import { tzOffset } from \"../tzOffset/index.js\";\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n this.setTime(+args[0]);\n } else {\n this.setTime(+new Date(...args));\n adjustToSystemTZ(this, NaN);\n syncToInternal(this);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n const offset = -tzOffset(this.timeZone, this);\n // Remove the seconds offset\n // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.\n return offset > 0 ? Math.floor(offset) : Math.ceil(offset);\n }\n\n //#endregion\n\n //#region time\n\n setTime(time) {\n Date.prototype.setTime.apply(this, arguments);\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * Function syncs time to internal date, applying the time zone offset.\n *\n * @param {Date} date - Date to sync\n */\nfunction syncToInternal(date) {\n date.internal.setTime(+date);\n date.internal.setUTCSeconds(date.internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, date) * 60));\n}\n\n/**\n * Function syncs the internal date UTC values to the date. It allows to get\n * accurate timestamp value.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // First we transpose the internal values\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * @param {Date} date - Date to adjust\n */\nfunction adjustToSystemTZ(date) {\n // Save the time zone offset before all the adjustments\n const baseOffset = tzOffset(date.timeZone, date);\n // Remove the seconds offset\n // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.\n const offset = baseOffset > 0 ? Math.floor(baseOffset) : Math.ceil(baseOffset);\n //#region System DST adjustment\n\n // The biggest problem with using the system time zone is that when we create\n // a date from internal values stored in UTC, the system time zone might end\n // up on the DST hour:\n //\n // $ TZ=America/New_York node\n // > new Date(2020, 2, 8, 1).toString()\n // 'Sun Mar 08 2020 01:00:00 GMT-0500 (Eastern Standard Time)'\n // > new Date(2020, 2, 8, 2).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 3).toString()\n // 'Sun Mar 08 2020 03:00:00 GMT-0400 (Eastern Daylight Time)'\n // > new Date(2020, 2, 8, 4).toString()\n // 'Sun Mar 08 2020 04:00:00 GMT-0400 (Eastern Daylight Time)'\n //\n // Here we get the same hour for both 2 and 3, because the system time zone\n // has DST beginning at 8 March 2020, 2 a.m. and jumps to 3 a.m. So we have\n // to adjust the internal date to reflect that.\n //\n // However we want to adjust only if that's the DST hour the change happenes,\n // not the hour where DST moves to.\n\n // We calculate the previous hour to see if the time zone offset has changed\n // and we have landed on the DST hour.\n const prevHour = new Date(+date);\n // We use UTC methods here as we don't want to land on the same hour again\n // in case of DST.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Calculate if we are on the system DST hour.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n // Detect the DST shift. System DST change will occur both on\n const dstShift = Date.prototype.getHours.apply(date) !== date.internal.getUTCHours();\n\n // Move the internal date when we are on the system DST hour.\n if (systemDSTChange && dstShift) date.internal.setUTCMinutes(date.internal.getUTCMinutes() + systemDSTChange);\n\n //#endregion\n\n //#region System diff adjustment\n\n // Now we need to adjust the date, since we just applied internal values.\n // We need to calculate the difference between the system and date time zones\n // and apply it to the date.\n\n const offsetDiff = systemOffset - offset;\n if (offsetDiff) Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Seconds System diff adjustment\n\n const systemDate = new Date(+date);\n // Set the UTC seconds to 0 to isolate the timezone offset in seconds.\n systemDate.setUTCSeconds(0);\n // For negative systemOffset, invert the seconds.\n const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;\n\n // Calculate the seconds offset based on the timezone offset.\n const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;\n if (secondsOffset || systemSecondsOffset) {\n date.internal.setUTCSeconds(date.internal.getUTCSeconds() + secondsOffset);\n Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);\n }\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n const postBaseOffset = tzOffset(date.timeZone, date);\n // Remove the seconds offset\n // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.\n const postOffset = postBaseOffset > 0 ? Math.floor(postBaseOffset) : Math.ceil(postBaseOffset);\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n const postOffsetDiff = postSystemOffset - postOffset;\n const offsetChanged = postOffset !== offset;\n const postDiff = postOffsetDiff - offsetDiff;\n if (offsetChanged && postDiff) {\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Now we need to check if got offset change during the post-adjustment.\n // If so, we also need both dates to reflect that.\n\n const newBaseOffset = tzOffset(date.timeZone, date);\n // Remove the seconds offset\n // use Math.floor for negative GMT timezones and Math.ceil for positive GMT timezones.\n const newOffset = newBaseOffset > 0 ? Math.floor(newBaseOffset) : Math.ceil(newBaseOffset);\n const offsetChange = postOffset - newOffset;\n if (offsetChange) {\n date.internal.setUTCMinutes(date.internal.getUTCMinutes() + offsetChange);\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n}"],"names":["TZDateMini","args","tzOffset","adjustToSystemTZ","syncToInternal","tz","timeZone","offset","time","date","re","method","utcMethod","syncFromInternal","baseOffset","prevHour","systemOffset","prevHourSystemOffset","systemDSTChange","dstShift","offsetDiff","systemDate","systemSecondsOffset","secondsOffset","postBaseOffset","postOffset","postOffsetDiff","offsetChanged","postDiff","newBaseOffset","newOffset","offsetChange"],"mappings":";AACO,MAAMA,UAAmB,KAAK;AAAA;AAAA,EAGnC,eAAeC,GAAM;AACnB,UAAK,GACDA,EAAK,SAAS,KAAK,OAAOA,EAAKA,EAAK,SAAS,CAAC,KAAM,aACtD,KAAK,WAAWA,EAAK,IAAG,IAE1B,KAAK,WAAW,oBAAI,KAAI,GACpB,MAAMC,EAAS,KAAK,UAAU,IAAI,CAAC,IACrC,KAAK,QAAQ,GAAG,IAEXD,EAAK,SAEC,OAAOA,EAAK,CAAC,KAAM,aAAaA,EAAK,WAAW,KAAKA,EAAK,WAAW,KAAK,OAAOA,EAAK,CAAC,KAAM,YACtG,KAAK,QAAQA,EAAK,CAAC,CAAC,IACX,OAAOA,EAAK,CAAC,KAAM,WAC5B,KAAK,QAAQ,CAAC,IAAI,KAAKA,EAAK,CAAC,CAAC,CAAC,IACtBA,EAAK,CAAC,aAAa,OAC5B,KAAK,QAAQ,CAACA,EAAK,CAAC,CAAC,KAErB,KAAK,QAAQ,CAAC,IAAI,KAAK,GAAGA,CAAI,CAAC,GAC/BE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tzOffset } from \"../tzOffset/index.js\";\n\n// TZDate stores time in two `Date` objects because native `Date` can only\n// expose local fields in the system time zone.\n//\n// The external date (`this`) stores the real timestamp. It is the value used by\n// `getTime()`, `valueOf()`, UTC getters/setters, comparisons, and arithmetic.\n// Its local getters are not used for target-zone fields because they would read\n// the timestamp through the system time zone.\n//\n// The internal date (`this.internal`) stores the target-zone wall-clock fields.\n// We read and write those fields through UTC getters/setters so the host system\n// time zone cannot reinterpret them. For example, `getHours()` returns\n// `internal.getUTCHours()`, and `setHours()` writes `internal.setUTCHours(...)`.\n//\n// Syncing moves data between the two representations:\n//\n// - `syncToInternal` starts from the external timestamp and rebuilds internal\n// wall-clock fields using `this.timeZone` offset.\n//\n// - `syncFromInternal` starts from internal wall-clock fields, writes them into\n// the external date, then adjusts that timestamp for the system/target offset\n// difference and DST edge cases.\n//\n// The public TZDate value is the combination of both: external is the instant,\n// internal is the wall-clock view of that instant in `this.timeZone`.\n\nexport class TZDateMini extends Date {\n //#region static\n\n constructor(...args) {\n super();\n\n // Time zone string is always the last string argument unless date string\n // is passed (as a single argument).\n if (args.length > 1 && typeof args[args.length - 1] === \"string\") {\n this.timeZone = args.pop();\n }\n this.internal = new Date();\n\n // Validate the time zone by checking its offset.\n if (isNaN(tzOffset(this.timeZone, this))) {\n this.setTime(NaN);\n } else {\n if (!args.length) {\n // No arguments passed: use current time\n this.setTime(Date.now());\n } else if (typeof args[0] === \"number\" && (args.length === 1 || args.length === 2 && typeof args[1] !== \"number\")) {\n // Timestamp passed: use it as is\n this.setTime(args[0]);\n } else if (typeof args[0] === \"string\") {\n // `Date` string passed: parse it as external date\n this.setTime(+new Date(args[0]));\n } else if (args[0] instanceof Date) {\n // `Date` passed: use its timestamp\n this.setTime(+args[0]);\n } else {\n // `Date` values passed:\n\n // Set it as external date.\n this.setTime(+new Date(...args));\n\n // Adjust internal and external dates considering that we might have\n // landed on the DST hour.\n adjustToSystemTZ(this, args);\n }\n }\n }\n static tz(tz, ...args) {\n return args.length ? new TZDateMini(...args, tz) : new TZDateMini(Date.now(), tz);\n }\n\n //#endregion\n\n //#region time zone\n\n withTimeZone(timeZone) {\n return new TZDateMini(+this, timeZone);\n }\n getTimezoneOffset() {\n const offset = -tzOffset(this.timeZone, this);\n // Remove the seconds offset using `Math.floor` for negative UTC time zones\n // and `Math.ceil` for positive UTC time zones.\n return offset > 0 ? Math.floor(offset) : Math.ceil(offset);\n }\n\n //#endregion\n\n //#region time\n\n setTime(_time) {\n // Use the native `setTime` to the external date time.\n Date.prototype.setTime.apply(this, arguments);\n\n // Then apply it to the internal date adjusting to the timezone offset.\n syncToInternal(this);\n return +this;\n }\n\n //#endregion\n\n //#region date-fns integration\n\n [Symbol.for(\"constructDateFrom\")](date) {\n return new TZDateMini(+new Date(date), this.timeZone);\n }\n\n //#endregion\n}\n\n// Assign getters and setters\nconst re = /^(get|set)(?!UTC)/;\nObject.getOwnPropertyNames(Date.prototype).forEach(method => {\n if (!re.test(method)) return;\n const utcMethod = method.replace(re, \"$1UTC\");\n // Filter out methods without UTC counterparts\n if (!TZDateMini.prototype[utcMethod]) return;\n if (method.startsWith(\"get\")) {\n // Delegate to internal date's UTC method\n TZDateMini.prototype[method] = function () {\n return this.internal[utcMethod]();\n };\n } else {\n // Assign regular setter\n TZDateMini.prototype[method] = function () {\n Date.prototype[utcMethod].apply(this.internal, arguments);\n syncFromInternal(this);\n return +this;\n };\n\n // Assign UTC setter\n TZDateMini.prototype[utcMethod] = function () {\n Date.prototype[utcMethod].apply(this, arguments);\n syncToInternal(this);\n return +this;\n };\n }\n});\n\n/**\n * @internal\n * Function syncs time to internal date, applying the current time zone offset.\n *\n * @param {Date} date - `Date` to sync\n */\nfunction syncToInternal(date) {\n // Start internal from the same real timestamp as external.\n date.internal.setTime(+date);\n\n // Shift internal by the target offset so its UTC fields become the target-zone\n // wall-clock fields for the external timestamp.\n //\n // o internal UTC fields: 2024-02-11 00:00\n // |\n // | + Asia/Singapore offset (+08:00)\n // v\n // x internal UTC fields: 2024-02-11 08:00\n //\n date.internal.setUTCSeconds(date.internal.getUTCSeconds() -\n // Round after converting minutes to seconds to avoid fractional offset\n // precision errors from historical offsets.\n Math.round(-tzOffset(date.timeZone, date) * 60));\n}\n\n/**\n * @internal\n * Function syncs internal wall-clock fields into the external date.\n *\n * @param {Date} date - The date to sync\n */\nfunction syncFromInternal(date) {\n // Copy target-zone wall-clock fields from internal into external using native\n // local setters. At this point external holds the right field values but they\n // are interpreted in the system time zone; `adjustToSystemTZ` fixes that.\n Date.prototype.setFullYear.call(date, date.internal.getUTCFullYear(), date.internal.getUTCMonth(), date.internal.getUTCDate());\n Date.prototype.setHours.call(date, date.internal.getUTCHours(), date.internal.getUTCMinutes(), date.internal.getUTCSeconds(), date.internal.getUTCMilliseconds());\n\n // Now we have to adjust the date to the system time zone\n adjustToSystemTZ(date);\n}\n\n/**\n * @internal\n * Function adjusts the date to the system time zone. It uses the time zone\n * differences to calculate the offset and adjust the date.\n *\n * We use it when constructing `TZDate` and syncing the external date from\n * the internal one.\n *\n * @param {TZDate} date - `TZDate` to adjust.\n */\nfunction adjustToSystemTZ(date, constructorArgs) {\n // Keep the intended target-zone wall-clock value before native Date/system\n // time zone normalization can move it. Later corrections compare against this\n // value to distinguish intended DST normalization from accidental drift.\n const expectedInternalTime = Array.isArray(constructorArgs) ? constructorArgsToInternalTime(constructorArgs) : +date.internal;\n //#region Initial offset calculation\n\n // Current target time zone offset at the native timestamp. It may include\n // historical offset seconds, which we preserve for the seconds adjustment.\n const offsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset used by minute-based timestamp adjustments.\n // Historical offsets can contain seconds, so we strip the fractional minute\n // here and handle remaining seconds in the seconds adjustment below.\n const offset = offsetWithSeconds > 0 ? Math.floor(offsetWithSeconds) : Math.ceil(offsetWithSeconds);\n\n //#endregion\n\n //#region System DST adjustment\n\n // Native `Date` may normalize the requested wall time when the system time\n // zone skips that hour for DST.\n //\n // We compare the system wall-clock hour represented by the external date with\n // the wall-clock hour stored in the internal date. If they differ, the next\n // offset-diff calculation may need the previous system offset, because the\n // current external timestamp is already after the system DST jump.\n\n // Previous-hour reference used to detect whether the system offset changed\n // immediately before the current native timestamp.\n const prevHour = new Date(+date);\n\n // Use UTC math so subtracting one hour cannot be normalized back into the\n // same missing local DST hour.\n prevHour.setUTCHours(prevHour.getUTCHours() - 1);\n\n // Current system offset at the native timestamp.\n const systemOffset = -new Date(+date).getTimezoneOffset();\n\n // System offset one real hour before the native timestamp.\n const prevHourSystemOffset = -new Date(+prevHour).getTimezoneOffset();\n\n // Non-zero when the system offset changed between `prevHour` and `date`.\n const systemDSTChange = systemOffset - prevHourSystemOffset;\n\n // System offset to use in the later system-target offset difference.\n // Defaults to the current system offset and switches to the previous offset\n // only when native `Date` normalized a missing system wall time.\n let systemOffsetForDiff = systemOffset;\n if (systemDSTChange && systemOffset !== offset) {\n // System wall-clock hour represented by the current external timestamp.\n const systemHour = Date.prototype.getHours.apply(date);\n\n // Target wall-clock hour currently stored in internal fields. Constructors\n // get it from arguments because internal may have already been synced from\n // the normalized external timestamp; setters get it directly from internal.\n const expectedHour = Array.isArray(constructorArgs) ? constructorArgs[3] || 0 : date.internal.getUTCHours();\n if (systemHour !== expectedHour) {\n // Check whether using the current system offset would keep the target\n // offset unchanged. If so, the only DST jump we crossed is the system\n // one, so the diff should use the pre-DST system offset.\n const testDate = new Date(+date);\n\n // Difference that the later offset-diff step would apply with the\n // current system offset.\n const testOffsetDiff = systemOffset - offset;\n if (testOffsetDiff) testDate.setUTCMinutes(testDate.getUTCMinutes() + testOffsetDiff);\n\n // Target offset after applying the current system offset difference.\n const testOffsetWithSeconds = tzOffset(date.timeZone, testDate);\n\n // Target offset without historical seconds, matching `offset`.\n const testOffset = testOffsetWithSeconds > 0 ? Math.floor(testOffsetWithSeconds) : Math.ceil(testOffsetWithSeconds);\n if (testOffset === offset) systemOffsetForDiff = prevHourSystemOffset;\n }\n }\n\n //#endregion\n\n //#region System diff adjustment\n\n // Move external from the system-zone interpretation of internal fields toward\n // the timestamp that represents those fields in the target time zone.\n //\n // At this point native `Date` has treated the internal wall-clock fields as if\n // they belonged to the system zone. The system-target offset difference moves\n // external by the distance between that system interpretation and the target\n // interpretation.\n\n // Difference between the system offset selected above and the minute-precision\n // target offset. Positive values move external forward; negative values move\n // it backward.\n const offsetDiff = systemOffsetForDiff - offset;\n if (offsetDiff)\n // Apply the system-target minute difference to external. Internal is\n // rebuilt from the final external timestamp after all adjustments are\n // complete.\n //\n // o external as target: 2023-01-31 23:00\n // |\n // | add `offsetDiff`\n // v\n // x external as target: 2023-02-01 12:00\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetDiff);\n\n //#endregion\n\n //#region Seconds system diff adjustment\n\n // Historical time zone offsets can include seconds, but the minute-based\n // offset adjustment above intentionally used minute precision.\n //\n // This adjustment applies the remaining seconds difference to external. For\n // example, historical Singapore used UTC+06:55:25, while ISO formatting shows\n // only `+06:55`; without the seconds correction, setter paths keep the wrong\n // wall-clock seconds.\n\n // Clone external as a native `Date` so we can inspect how the system time zone\n // represents the same timestamp.\n const systemDate = new Date(+date);\n\n // Zero UTC seconds before reading system seconds. Any remaining local seconds\n // then come from the system time zone offset rather than from the timestamp's\n // own seconds value.\n systemDate.setUTCSeconds(0);\n\n // Seconds part contributed by the system time zone offset. Negative offsets\n // need wrapping because `Date#getSeconds()` returns values in the 0..59 range.\n const systemSecondsOffset = systemOffset > 0 ? systemDate.getSeconds() : (systemDate.getSeconds() - 60) % 60;\n\n // Seconds part contributed by the target time zone offset.\n const secondsOffset = Math.round(-(tzOffset(date.timeZone, date) * 60)) % 60;\n if (secondsOffset || systemSecondsOffset)\n // Apply the remaining second-level system-target difference to external.\n //\n // o external as Asia/Singapore: 1900-01-01 00:00:56\n // |\n // | + `secondsOffset`\n // | + `systemSecondsOffset`\n // v\n // x external as Asia/Singapore: 1900-01-01 00:00:31\n //\n Date.prototype.setUTCSeconds.call(date, Date.prototype.getUTCSeconds.call(date) + secondsOffset + systemSecondsOffset);\n\n //#endregion\n\n //#region Post-adjustment DST fix\n\n // The first system-target offset move can cross a target-zone DST boundary.\n //\n // When that happens, the target offset at the new external timestamp differs\n // from the target offset used for `offsetDiff`. We compare the original move\n // with the move that would be calculated at the new timestamp, then apply the\n // difference to external.\n\n // Target offset at the current external timestamp, including historical\n // seconds for the later seconds adjustment.\n const postOffsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset at the current external timestamp.\n const postOffset = postOffsetWithSeconds > 0 ? Math.floor(postOffsetWithSeconds) : Math.ceil(postOffsetWithSeconds);\n\n // System offset at the current external timestamp.\n const postSystemOffset = -new Date(+date).getTimezoneOffset();\n\n // System-target offset difference at the current external timestamp.\n const postOffsetDiff = postSystemOffset - postOffset;\n\n // Whether the target offset changed after the first offset move.\n const offsetChanged = postOffset !== offset;\n\n // Difference between the current offset move and the move already applied.\n const postDiff = postOffsetDiff - offsetDiff;\n\n // If the first offset move already normalized a target DST gap forward, the\n // generic post-DST correction below would undo that valid normalization. This\n // happens, for example, with America/New_York 02:00 during spring-forward when\n // the system zone also changes offset around the same instant.\n const targetDSTShift = postOffset - offset;\n\n // Candidate timestamp that would represent the requested wall-clock time with\n // the post-transition target offset. If it still does not round-trip to the\n // requested wall-clock fields, the requested time is inside a target DST gap.\n const postOffsetCandidate = expectedInternalTime - postOffset * 60 * 1000;\n\n // Only positive target offset shifts are spring-forward gaps. Negative shifts\n // are fall-back overlaps and still need the regular post-adjustment path.\n const normalizedTargetDSTGap = targetDSTShift > 0 && targetInternalTime(date) - expectedInternalTime === targetDSTShift * 60 * 1000 && targetInternalTime(date, postOffsetCandidate) !== expectedInternalTime;\n if (offsetChanged && postDiff && !normalizedTargetDSTGap) {\n // Apply the target-DST correction to external. In the backward-crossing case\n // shown here, this lands on an intermediate value that needs `offsetChange`\n // below.\n //\n // o external as America/New_York: 2023-03-12 03:00 EDT\n // |\n // | + `postDiff`\n // v\n // x external as America/New_York: 2023-03-12 01:00 EST\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + postDiff);\n\n // Target offset after applying `postDiff`. It may change again if the\n // correction itself crosses a target-zone DST boundary.\n const newOffsetWithSeconds = tzOffset(date.timeZone, date);\n\n // Minute-precision target offset after applying `postDiff`.\n const newOffset = newOffsetWithSeconds > 0 ? Math.floor(newOffsetWithSeconds) : Math.ceil(newOffsetWithSeconds);\n\n // Offset change caused by the `postDiff` move itself.\n const offsetChange = postOffset - newOffset;\n\n // If the correction moved external backward across the target DST boundary,\n // apply the boundary change so external lands on the valid target-zone\n // timestamp. Forward crossings are already normalized by native Date, and\n // applying this correction there would undo the valid post-DST result.\n if (offsetChange && postDiff < 0) {\n // Apply the second target-DST correction to external.\n //\n // o external as America/New_York: 2023-03-12 01:00 EST\n // |\n // | + `offsetChange`\n // v\n // x external as America/New_York: 2023-03-12 03:00 EDT\n //\n Date.prototype.setUTCMinutes.call(date, Date.prototype.getUTCMinutes.call(date) + offsetChange);\n }\n }\n\n //#endregion\n\n // Rebuild internal wall-clock fields from the final external timestamp.\n syncToInternal(date);\n\n // Native Date can normalize historical system offsets with minute and second\n // precision before we adjust to the target time zone. Correct only small\n // historical drift so DST gap normalization (usually one hour) remains intact.\n const expectedTime = constructorArgs ? expectedInternalTime : expectedInternalTime + secondsOffset * 1000;\n const drift = expectedTime - +date.internal;\n if (drift && Math.abs(drift) < 30 * 60 * 1000) {\n Date.prototype.setTime.call(date, +date + drift);\n syncToInternal(date);\n }\n}\nfunction constructorArgsToInternalTime(args) {\n // Mirror Date's date-value constructor defaults while preserving explicit\n // `undefined` behavior. Missing month/day default, but passed `undefined`\n // should remain invalid just like `Date.UTC(year, undefined, ...)`.\n return Date.UTC(args[0], args.length > 1 ? args[1] : 0, args.length > 2 ? args[2] : 1, ...args.slice(3));\n}\nfunction targetInternalTime(date, time) {\n // Compute the target-zone wall-clock representation for a timestamp without\n // mutating the TZDate. This mirrors syncToInternal for temporary checks.\n const internal = new Date(time ?? +date);\n internal.setUTCSeconds(internal.getUTCSeconds() - Math.round(-tzOffset(date.timeZone, internal) * 60));\n return +internal;\n}"],"names":["TZDateMini","args","tzOffset","adjustToSystemTZ","tz","timeZone","offset","_time","syncToInternal","date","re","method","utcMethod","syncFromInternal","constructorArgs","expectedInternalTime","constructorArgsToInternalTime","offsetWithSeconds","prevHour","systemOffset","prevHourSystemOffset","systemDSTChange","systemOffsetForDiff","systemHour","expectedHour","testDate","testOffsetDiff","testOffsetWithSeconds","offsetDiff","systemDate","systemSecondsOffset","secondsOffset","postOffsetWithSeconds","postOffset","postOffsetDiff","offsetChanged","postDiff","targetDSTShift","postOffsetCandidate","normalizedTargetDSTGap","targetInternalTime","newOffsetWithSeconds","newOffset","offsetChange","drift","time","internal"],"mappings":";AA2BO,MAAMA,UAAmB,KAAK;AAAA;AAAA,EAGnC,eAAeC,GAAM;AACnB,UAAK,GAIDA,EAAK,SAAS,KAAK,OAAOA,EAAKA,EAAK,SAAS,CAAC,KAAM,aACtD,KAAK,WAAWA,EAAK,IAAG,IAE1B,KAAK,WAAW,oBAAI,KAAI,GAGpB,MAAMC,EAAS,KAAK,UAAU,IAAI,CAAC,IACrC,KAAK,QAAQ,GAAG,IAEXD,EAAK,SAGC,OAAOA,EAAK,CAAC,KAAM,aAAaA,EAAK,WAAW,KAAKA,EAAK,WAAW,KAAK,OAAOA,EAAK,CAAC,KAAM,YAEtG,KAAK,QAAQA,EAAK,CAAC,CAAC,IACX,OAAOA,EAAK,CAAC,KAAM,WAE5B,KAAK,QAAQ,CAAC,IAAI,KAAKA,EAAK,CAAC,CAAC,CAAC,IACtBA,EAAK,CAAC,aAAa,OAE5B,KAAK,QAAQ,CAACA,EAAK,CAAC,CAAC,KAKrB,KAAK,QAAQ,CAAC,IAAI,KAAK,GAAGA,CAAI,CAAC,GAI/BE,EAAiB,MAAMF,CAAI,KAlB3B,KAAK,QAAQ,KAAK,KAAK;AAAA,EAqB7B;AAAA,EACA,OA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MAAMvB;AACzL,MAAIoB,KAAiBC,KAAY,CAACG,GAAwB;AAWxD,SAAK,UAAU,cAAc,KAAK9B,GAAM,KAAK,UAAU,cAAc,KAAKA,CAAI,IAAI2B,CAAQ;AAI1F,UAAMK,IAAuBvC,EAASO,EAAK,UAAUA,CAAI,GAGnDiC,IAAYD,IAAuB,IAAI,KAAK,MAAMA,CAAoB,IAAI,KAAK,KAAKA,CAAoB,GAGxGE,IAAeV,IAAaS;AAMlC,IAAIC,KAAgBP,IAAW,KAS7B,KAAK,UAAU,cAAc,KAAK3B,GAAM,KAAK,UAAU,cAAc,KAAKA,CAAI,IAAIkC,CAAY;AAAA,EAElG;AAKA,EAAAnC,EAAeC,CAAI;AAMnB,QAAMmC,KADe9B,IAAkBC,IAAuBA,IAAuBgB,IAAgB,OACxE,CAACtB,EAAK;AACnC,EAAImC,KAAS,KAAK,IAAIA,CAAK,IAAI,OAAU,QACvC,KAAK,UAAU,QAAQ,KAAKnC,GAAM,CAACA,IAAOmC,CAAK,GAC/CpC,EAAeC,CAAI;AAEvB;AACA,SAASO,EAA8Bf,GAAM;AAI3C,SAAO,KAAK,IAAIA,EAAK,CAAC,GAAGA,EAAK,SAAS,IAAIA,EAAK,CAAC,IAAI,GAAGA,EAAK,SAAS,IAAIA,EAAK,CAAC,IAAI,GAAG,GAAGA,EAAK,MAAM,CAAC,CAAC;AACzG;AACA,SAASuC,EAAmB/B,GAAMoC,GAAM;AAGtC,QAAMC,IAAW,IAAI,KAAKD,KAAQ,CAACpC,CAAI;AACvC,SAAAqC,EAAS,cAAcA,EAAS,cAAa,IAAK,KAAK,MAAM,CAAC5C,EAASO,EAAK,UAAUqC,CAAQ,IAAI,EAAE,CAAC,GAC9F,CAACA;AACV;","x_google_ignoreList":[0]}
|
package/dist/index199.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index199.js","sources":["../../../node_modules/@date-fns/tz/tzOffset/index.js"],"sourcesContent":["const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function
|
|
1
|
+
{"version":3,"file":"index199.js","sources":["../../../node_modules/@date-fns/tz/tzOffset/index.js"],"sourcesContent":["const offsetFormatCache = {};\nconst offsetCache = {};\n\n/**\n * The function returns UTC offset in minutes for the given date in specified\n * time zone.\n *\n * Unlike `Date.prototype.getTimezoneOffset`, this function returns the value\n * mirrored to the sign of the offset in the time zone. For Asia/Singapore\n * (UTC+8), `tzOffset` returns `480`, while `getTimezoneOffset` returns `-480`.\n *\n * It uses `Intl.DateTimeFormat` internally to access otherwise unavailable\n * runtime's time zone data, and falls back to basic manual parsing if Intl API\n * is not supported (e.g., older Node.js versions, React Native's Hermes, etc.).\n *\n * @param timeZone - Time zone name (IANA or UTC offset).\n * @param date - Date to check the offset for.\n *\n * @returns UTC offset in minutes (e.g., `480` for date in UTC+8).\n */\nexport function tzOffset(timeZone, date) {\n try {\n // Create `Intl.DateTimeFormat` with `\"longOffset\"` that gives us consistent\n // date strings like `\"5/19/2026, GMT-08:00\"`.\n const format = offsetFormatCache[timeZone] ||= new Intl.DateTimeFormat(\"en-US\", {\n timeZone,\n timeZoneName: \"longOffset\"\n }).format;\n\n // Get `\"-08:00\"`.\n const offsetStr = format(date).split(\"GMT\")[1];\n\n // Avoid parsing the same offset string.\n if (offsetStr in offsetCache) return offsetCache[offsetStr];\n\n // Calculate offset from `[\"-08\", \"00\"]` and cache it.\n return calcOffset(offsetStr, offsetStr.split(\":\"));\n } catch {\n // Fallback to manual parsing if the runtime doesn't support\n // `±HH:MM/±HHMM/±HH`. See: https://github.com/nodejs/node/issues/53419.\n if (timeZone in offsetCache) return offsetCache[timeZone];\n const captures = timeZone?.match(offsetRe);\n if (captures) return calcOffset(timeZone, captures.slice(1));\n return NaN;\n }\n}\nconst offsetRe = /([+-]\\d\\d):?(\\d\\d)?/;\nfunction calcOffset(cacheStr, values) {\n const hours = +(values[0] || 0);\n const minutes = +(values[1] || 0);\n // Convert seconds to minutes by dividing by 60 to keep the function return in minutes.\n const seconds = +(values[2] || 0) / 60;\n return offsetCache[cacheStr] = hours * 60 + minutes > 0 ? hours * 60 + minutes + seconds : hours * 60 - minutes - seconds;\n}"],"names":["offsetFormatCache","offsetCache","tzOffset","timeZone","date","offsetStr","calcOffset","captures","offsetRe","cacheStr","values","hours","minutes","seconds"],"mappings":"AAAA,MAAMA,IAAoB,CAAA,GACpBC,IAAc,CAAA;AAmBb,SAASC,EAASC,GAAUC,GAAM;AACvC,MAAI;AASF,UAAMC,KANSL,EAAkBG,CAAQ,MAAM,IAAI,KAAK,eAAe,SAAS;AAAA,MAC9E,UAAAA;AAAA,MACA,cAAc;AAAA,IACpB,CAAK,EAAE,QAGsBC,CAAI,EAAE,MAAM,KAAK,EAAE,CAAC;AAG7C,WAAIC,KAAaJ,IAAoBA,EAAYI,CAAS,IAGnDC,EAAWD,GAAWA,EAAU,MAAM,GAAG,CAAC;AAAA,EACnD,QAAQ;AAGN,QAAIF,KAAYF,EAAa,QAAOA,EAAYE,CAAQ;AACxD,UAAMI,IAAWJ,GAAU,MAAMK,CAAQ;AACzC,WAAID,IAAiBD,EAAWH,GAAUI,EAAS,MAAM,CAAC,CAAC,IACpD;AAAA,EACT;AACF;AACA,MAAMC,IAAW;AACjB,SAASF,EAAWG,GAAUC,GAAQ;AACpC,QAAMC,IAAQ,EAAED,EAAO,CAAC,KAAK,IACvBE,IAAU,EAAEF,EAAO,CAAC,KAAK,IAEzBG,IAAU,EAAEH,EAAO,CAAC,KAAK,KAAK;AACpC,SAAOT,EAAYQ,CAAQ,IAAIE,IAAQ,KAAKC,IAAU,IAAID,IAAQ,KAAKC,IAAUC,IAAUF,IAAQ,KAAKC,IAAUC;AACpH;","x_google_ignoreList":[0]}
|
package/dist/index262.js
CHANGED
package/dist/index274.js
CHANGED
package/dist/index278.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
1
|
+
import c, { getCountryCallingCode as b } from "./index164.js";
|
|
2
|
+
import g from "./index273.js";
|
|
3
|
+
import C from "./index274.js";
|
|
4
|
+
import h from "./index256.js";
|
|
5
|
+
function P(i, r, l, N, n) {
|
|
6
|
+
var e = r || l ? b(r || l, n) : N;
|
|
7
|
+
if (i.indexOf(e) === 0) {
|
|
8
|
+
n = new c(n), n.selectNumberingPlan(r || l, e);
|
|
9
|
+
var o = i.slice(e.length), f = C(o, r, n), m = f.nationalNumber, u = C(i, r, n), t = u.nationalNumber;
|
|
10
|
+
if (!g(t, n.nationalNumberPattern()) && g(m, n.nationalNumberPattern()) || h(t, r, n) === "TOO_LONG")
|
|
11
|
+
return {
|
|
12
|
+
countryCallingCode: e,
|
|
13
|
+
number: o
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
number: i
|
|
18
|
+
};
|
|
19
|
+
}
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
-
t as visuallyHiddenInput
|
|
21
|
+
P as default
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=index278.js.map
|
package/dist/index278.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index278.js","sources":["../../../node_modules
|
|
1
|
+
{"version":3,"file":"index278.js","sources":["../../../node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js"],"sourcesContent":["import Metadata from '../metadata.js';\nimport matchesEntirely from './matchesEntirely.js';\nimport extractNationalNumber from './extractNationalNumber.js';\nimport checkNumberLength from './checkNumberLength.js';\nimport getCountryCallingCode from '../getCountryCallingCode.js';\n\n/**\r\n * Sometimes some people incorrectly input international phone numbers\r\n * without the leading `+`. This function corrects such input.\r\n * @param {string} number — Phone number digits.\r\n * @param {string} [country] — Exact country of the phone number.\r\n * @param {string} [defaultCountry]\r\n * @param {string} [defaultCallingCode]\r\n * @param {object} metadata\r\n * @return {object} `{ countryCallingCode: string?, number: string }`.\r\n */\nexport default function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country, defaultCountry, defaultCallingCode, metadata) {\n var countryCallingCode = country || defaultCountry ? getCountryCallingCode(country || defaultCountry, metadata) : defaultCallingCode;\n if (number.indexOf(countryCallingCode) === 0) {\n metadata = new Metadata(metadata);\n metadata.selectNumberingPlan(country || defaultCountry, countryCallingCode);\n var possibleShorterNumber = number.slice(countryCallingCode.length);\n var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, country, metadata),\n possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;\n var _extractNationalNumbe2 = extractNationalNumber(number, country, metadata),\n nationalNumber = _extractNationalNumbe2.nationalNumber;\n\n // If the number was not valid before but is valid now,\n // or if it was too long before, we consider the number\n // with the country calling code stripped to be a better result\n // and keep that instead.\n // For example, in Germany (+49), `49` is a valid area code,\n // so if a number starts with `49`, it could be both a valid\n // national German number or an international number without\n // a leading `+`.\n if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, country, metadata) === 'TOO_LONG') {\n return {\n countryCallingCode: countryCallingCode,\n number: possibleShorterNumber\n };\n }\n }\n return {\n number: number\n };\n}\n//# sourceMappingURL=extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js.map"],"names":["extractCountryCallingCodeFromInternationalNumberWithoutPlusSign","number","country","defaultCountry","defaultCallingCode","metadata","countryCallingCode","getCountryCallingCode","Metadata","possibleShorterNumber","_extractNationalNumbe","extractNationalNumber","possibleShorterNationalNumber","_extractNationalNumbe2","nationalNumber","matchesEntirely","checkNumberLength"],"mappings":";;;;AAgBe,SAASA,EAAgEC,GAAQC,GAASC,GAAgBC,GAAoBC,GAAU;AACrJ,MAAIC,IAAqBJ,KAAWC,IAAiBI,EAAsBL,KAAWC,GAAgBE,CAAQ,IAAID;AAClH,MAAIH,EAAO,QAAQK,CAAkB,MAAM,GAAG;AAC5C,IAAAD,IAAW,IAAIG,EAASH,CAAQ,GAChCA,EAAS,oBAAoBH,KAAWC,GAAgBG,CAAkB;AAC1E,QAAIG,IAAwBR,EAAO,MAAMK,EAAmB,MAAM,GAC9DI,IAAwBC,EAAsBF,GAAuBP,GAASG,CAAQ,GACxFO,IAAgCF,EAAsB,gBACpDG,IAAyBF,EAAsBV,GAAQC,GAASG,CAAQ,GAC1ES,IAAiBD,EAAuB;AAU1C,QAAI,CAACE,EAAgBD,GAAgBT,EAAS,sBAAqB,CAAE,KAAKU,EAAgBH,GAA+BP,EAAS,sBAAqB,CAAE,KAAKW,EAAkBF,GAAgBZ,GAASG,CAAQ,MAAM;AACrN,aAAO;AAAA,QACL,oBAAoBC;AAAA,QACpB,QAAQG;AAAA,MAChB;AAAA,EAEE;AACA,SAAO;AAAA,IACL,QAAQR;AAAA,EACZ;AACA;","x_google_ignoreList":[0]}
|