@servicetitan/anvil2 1.3.4 → 1.4.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/{Alert-85a791c2.js → Alert-097d82a2.js} +2 -2
- package/Alert-097d82a2.js.map +1 -0
- package/Alert-d2a2976a.cjs +2 -0
- package/Alert-d2a2976a.cjs.map +1 -0
- package/Alert.cjs +1 -1
- package/Alert.js +1 -1
- package/Announcement.cjs +1 -1
- package/Announcement.cjs.map +1 -1
- package/Announcement.js +1 -1
- package/Announcement.js.map +1 -1
- package/AnvilProvider.cjs +1 -1
- package/AnvilProvider.js +1 -1
- package/Avatar.cjs +1 -1
- package/Avatar.cjs.map +1 -1
- package/Avatar.js +14 -14
- package/Avatar.js.map +1 -1
- package/Badge.cjs.map +1 -1
- package/Badge.js +7 -7
- package/Badge.js.map +1 -1
- package/Button.cjs +1 -1
- package/Button.js +1 -1
- package/ButtonCompound.cjs +1 -1
- package/ButtonCompound.js +1 -1
- package/ButtonLink.cjs +1 -1
- package/ButtonLink.js +1 -1
- package/ButtonToggle.cjs +1 -1
- package/ButtonToggle.js +1 -1
- package/Calendar.cjs +1 -1
- package/Calendar.cjs.map +1 -1
- package/Calendar.js +935 -936
- package/Calendar.js.map +1 -1
- package/Card.cjs.map +1 -1
- package/Card.js.map +1 -1
- package/{Checkbox-d1db5a71.cjs → Checkbox-38b018dd.cjs} +2 -2
- package/Checkbox-38b018dd.cjs.map +1 -0
- package/{Checkbox-634c4d3d.js → Checkbox-80900b39.js} +3 -3
- package/Checkbox-80900b39.js.map +1 -0
- package/Checkbox.cjs +1 -1
- package/Checkbox.js +5 -5
- package/{Chip-73b032eb.js → Chip-68233f63.js} +3 -3
- package/Chip-68233f63.js.map +1 -0
- package/Chip-c32236d6.cjs +2 -0
- package/Chip-c32236d6.cjs.map +1 -0
- package/Chip.cjs +1 -1
- package/Chip.js +1 -1
- package/Combobox.cjs +6 -6
- package/Combobox.cjs.map +1 -1
- package/Combobox.js +12 -12
- package/Combobox.js.map +1 -1
- package/Details.cjs +1 -1
- package/Details.cjs.map +1 -1
- package/Details.js +9 -9
- package/Details.js.map +1 -1
- package/{Dialog-1984afe2.js → Dialog-893ed36b.js} +3 -3
- package/Dialog-893ed36b.js.map +1 -0
- package/Dialog-bf33c086.cjs +2 -0
- package/{Dialog-1984afe2.js.map → Dialog-bf33c086.cjs.map} +1 -1
- package/Dialog.cjs +1 -1
- package/Dialog.js +1 -1
- package/Divider.cjs.map +1 -1
- package/Divider.js.map +1 -1
- package/Drawer.cjs +1 -1
- package/Drawer.cjs.map +1 -1
- package/Drawer.js +8 -8
- package/Drawer.js.map +1 -1
- package/Flex-d06c75c0.js.map +1 -1
- package/Flex-da1ad9db.cjs.map +1 -1
- package/Grid.cjs.map +1 -1
- package/Grid.js.map +1 -1
- package/Icon-847b3515.cjs.map +1 -1
- package/Icon-be690f0b.js.map +1 -1
- package/InputMask.cjs +2 -0
- package/InputMask.cjs.map +1 -0
- package/InputMask.d.ts +13 -0
- package/InputMask.js +126 -0
- package/InputMask.js.map +1 -0
- package/{Label-e2593298.cjs → Label-aca119f2.cjs} +2 -2
- package/{Label-e2593298.cjs.map → Label-aca119f2.cjs.map} +1 -1
- package/{Label-854a39e4.js → Label-ed5cd8a7.js} +2 -2
- package/{Label-854a39e4.js.map → Label-ed5cd8a7.js.map} +1 -1
- package/Link.cjs +1 -1
- package/Link.js +1 -1
- package/ListView.cjs +1 -1
- package/ListView.cjs.map +1 -1
- package/ListView.js +2 -2
- package/ListView.js.map +1 -1
- package/Listbox.cjs +1 -1
- package/Listbox.cjs.map +1 -1
- package/Listbox.js +10 -10
- package/Listbox.js.map +1 -1
- package/LocalizationProvider.cjs.map +1 -1
- package/LocalizationProvider.js.map +1 -1
- package/Menu.cjs +1 -1
- package/Menu.cjs.map +1 -1
- package/Menu.js +28 -28
- package/Menu.js.map +1 -1
- package/{Overflow-a026904d.js → Overflow-a2f48366.js} +2 -2
- package/Overflow-a2f48366.js.map +1 -0
- package/{Overflow-057bbf4e.cjs → Overflow-b4d706e8.cjs} +2 -2
- package/Overflow-b4d706e8.cjs.map +1 -0
- package/Overflow.cjs +1 -1
- package/Overflow.js +15 -15
- package/Page.cjs +1 -1
- package/Page.cjs.map +1 -1
- package/Page.js +6 -5
- package/Page.js.map +1 -1
- package/Popover-44119105.js +276 -0
- package/Popover-44119105.js.map +1 -0
- package/Popover-665147d6.cjs +2 -0
- package/Popover-665147d6.cjs.map +1 -0
- package/Popover.cjs +1 -1
- package/Popover.js +15 -15
- package/ProgressBar.cjs +1 -1
- package/ProgressBar.cjs.map +1 -1
- package/ProgressBar.js +1 -1
- package/ProgressBar.js.map +1 -1
- package/Radio.cjs +1 -1
- package/Radio.cjs.map +1 -1
- package/Radio.js +25 -25
- package/Radio.js.map +1 -1
- package/SegmentedControl.cjs +1 -1
- package/SegmentedControl.cjs.map +1 -1
- package/SegmentedControl.js +28 -28
- package/SegmentedControl.js.map +1 -1
- package/SideNav.cjs +1 -1
- package/SideNav.cjs.map +1 -1
- package/SideNav.js +10 -10
- package/SideNav.js.map +1 -1
- package/SrOnly-0c7fd87a.js.map +1 -1
- package/SrOnly-91a467dc.cjs.map +1 -1
- package/Stepper.cjs +1 -1
- package/Stepper.cjs.map +1 -1
- package/Stepper.js +12 -12
- package/Stepper.js.map +1 -1
- package/Switch.cjs.map +1 -1
- package/Switch.js.map +1 -1
- package/Tab.cjs +1 -1
- package/Tab.cjs.map +1 -1
- package/Tab.js +14 -14
- package/Tab.js.map +1 -1
- package/Text-08c90c22.js.map +1 -1
- package/Text-8ed03ac7.cjs.map +1 -1
- package/TextField-7d04b45f.js +142 -0
- package/TextField-7d04b45f.js.map +1 -0
- package/TextField-bd5f664e.cjs +2 -0
- package/TextField-bd5f664e.cjs.map +1 -0
- package/TextField.cjs +1 -1
- package/TextField.cjs.map +1 -1
- package/TextField.css +1 -0
- package/TextField.js +21 -156
- package/TextField.js.map +1 -1
- package/Textarea.cjs +1 -1
- package/Textarea.cjs.map +1 -1
- package/Textarea.js +30 -30
- package/Textarea.js.map +1 -1
- package/ThemeProvider.cjs +1 -1
- package/ThemeProvider.js +1 -1
- package/Toast.cjs +3 -3
- package/Toast.cjs.map +1 -1
- package/Toast.js +9 -9
- package/Toast.js.map +1 -1
- package/{Tooltip-dcc5d45c.js → Tooltip-13761a78.js} +28 -28
- package/Tooltip-13761a78.js.map +1 -0
- package/Tooltip-ea2b58dc.cjs +2 -0
- package/Tooltip-ea2b58dc.cjs.map +1 -0
- package/Tooltip.cjs +1 -1
- package/Tooltip.js +1 -1
- package/anvil2.cjs +1 -1
- package/anvil2.d.ts +19 -0
- package/anvil2.js +110 -105
- package/anvil2.js.map +1 -1
- package/{index-11b6ca91-d30fd1d3.cjs → index-16923f36-13f8775f.cjs} +2 -2
- package/index-16923f36-13f8775f.cjs.map +1 -0
- package/{index-11b6ca91-14b4e485.js → index-16923f36-b76f5ccb.js} +6 -6
- package/index-16923f36-b76f5ccb.js.map +1 -0
- package/{index-04060912.js → index-204e7e78.js} +1115 -1062
- package/index-204e7e78.js.map +1 -0
- package/{index-902bf2b0.js → index-3df95505.js} +4 -4
- package/index-3df95505.js.map +1 -0
- package/index-628a2685.cjs +5 -0
- package/index-628a2685.cjs.map +1 -0
- package/{index-dcf78e3f.cjs → index-98c0e500.cjs} +2 -2
- package/index-98c0e500.cjs.map +1 -0
- package/{index-eb2e706f-03380994.js → index-f6869ed6-10ae0c3c.js} +2 -2
- package/index-f6869ed6-10ae0c3c.js.map +1 -0
- package/{index-eb2e706f-ff6c4157.cjs → index-f6869ed6-8e47d5d4.cjs} +2 -2
- package/index-f6869ed6-8e47d5d4.cjs.map +1 -0
- package/index21.css +1 -1
- package/index22.css +1 -1
- package/index23.css +1 -1
- package/package.json +2 -2
- package/useLinkStyles.cjs +1 -1
- package/useLinkStyles.js +1 -1
- package/useMergeRefs.cjs +1 -1
- package/useMergeRefs.cjs.map +1 -1
- package/useMergeRefs.js +9 -2
- package/useMergeRefs.js.map +1 -1
- package/Alert-673d75aa.cjs +0 -2
- package/Alert-673d75aa.cjs.map +0 -1
- package/Alert-85a791c2.js.map +0 -1
- package/Checkbox-634c4d3d.js.map +0 -1
- package/Checkbox-d1db5a71.cjs.map +0 -1
- package/Chip-73b032eb.js.map +0 -1
- package/Chip-88873569.cjs +0 -2
- package/Chip-88873569.cjs.map +0 -1
- package/Dialog-de6969a2.cjs +0 -2
- package/Dialog-de6969a2.cjs.map +0 -1
- package/Overflow-057bbf4e.cjs.map +0 -1
- package/Overflow-a026904d.js.map +0 -1
- package/Popover-aaeea980.js +0 -272
- package/Popover-aaeea980.js.map +0 -1
- package/Popover-e336dabc.cjs +0 -2
- package/Popover-e336dabc.cjs.map +0 -1
- package/Tooltip-2ecbf35e.cjs +0 -2
- package/Tooltip-2ecbf35e.cjs.map +0 -1
- package/Tooltip-dcc5d45c.js.map +0 -1
- package/index-04060912.js.map +0 -1
- package/index-11b6ca91-14b4e485.js.map +0 -1
- package/index-11b6ca91-d30fd1d3.cjs.map +0 -1
- package/index-40821bc4.cjs +0 -2
- package/index-40821bc4.cjs.map +0 -1
- package/index-49242812.js +0 -59
- package/index-49242812.js.map +0 -1
- package/index-69174413.cjs +0 -5
- package/index-69174413.cjs.map +0 -1
- package/index-902bf2b0.js.map +0 -1
- package/index-dcf78e3f.cjs.map +0 -1
- package/index-eb2e706f-03380994.js.map +0 -1
- package/index-eb2e706f-ff6c4157.cjs.map +0 -1
- package/index24.css +0 -1
- /package/{index-eb2e706f.css → index-f6869ed6.css} +0 -0
package/Calendar.js
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
1
|
import "./index4.css";
|
|
2
|
-
import { j as
|
|
2
|
+
import { j as ze } from "./jsx-runtime-82a9ddf6.js";
|
|
3
3
|
import { f as S } from "./jsx-runtime-944c88e2-e73fa629.js";
|
|
4
|
-
import * as
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import { S as
|
|
7
|
-
import { G as
|
|
4
|
+
import * as tt from "react";
|
|
5
|
+
import { forwardRef as ee, useRef as Lr, useCallback as $r, useEffect as nt, createContext as Zr, useId as zr, useState as pt, useMemo as Ar, useContext as _r } from "react";
|
|
6
|
+
import { S as Lt } from "./index-f6869ed6-10ae0c3c.js";
|
|
7
|
+
import { G as We } from "./index-c6e22bb9.js";
|
|
8
8
|
import "./tinycolor-d415b1fd.js";
|
|
9
|
-
import { useSwipe as
|
|
10
|
-
import { p as
|
|
9
|
+
import { useSwipe as qr } from "./useSwipe.js";
|
|
10
|
+
import { p as Rr } from "./SrOnly-0c7fd87a.js";
|
|
11
11
|
import { J as Ur } from "./useLayoutPropsUtil-f34e9597.js";
|
|
12
|
-
class
|
|
12
|
+
class he extends Error {
|
|
13
13
|
}
|
|
14
|
-
class
|
|
14
|
+
class Hr extends he {
|
|
15
15
|
constructor(e) {
|
|
16
16
|
super(`Invalid DateTime: ${e.toMessage()}`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
class
|
|
19
|
+
class Yr extends he {
|
|
20
20
|
constructor(e) {
|
|
21
21
|
super(`Invalid Interval: ${e.toMessage()}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
class
|
|
24
|
+
class Pr extends he {
|
|
25
25
|
constructor(e) {
|
|
26
26
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
class
|
|
29
|
+
class ke extends he {
|
|
30
30
|
}
|
|
31
|
-
class
|
|
31
|
+
class On extends he {
|
|
32
32
|
constructor(e) {
|
|
33
33
|
super(`Invalid unit ${e}`);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
class
|
|
36
|
+
class Z extends he {
|
|
37
37
|
}
|
|
38
|
-
class
|
|
38
|
+
class re extends he {
|
|
39
39
|
constructor() {
|
|
40
40
|
super("Zone is an abstract class");
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
const c = "numeric",
|
|
43
|
+
const c = "numeric", Q = "short", A = "long", rt = {
|
|
44
44
|
year: c,
|
|
45
45
|
month: c,
|
|
46
46
|
day: c
|
|
47
|
-
},
|
|
47
|
+
}, Mn = {
|
|
48
48
|
year: c,
|
|
49
|
-
month:
|
|
49
|
+
month: Q,
|
|
50
50
|
day: c
|
|
51
|
-
},
|
|
51
|
+
}, jr = {
|
|
52
52
|
year: c,
|
|
53
|
-
month:
|
|
53
|
+
month: Q,
|
|
54
54
|
day: c,
|
|
55
|
-
weekday:
|
|
56
|
-
},
|
|
55
|
+
weekday: Q
|
|
56
|
+
}, Dn = {
|
|
57
57
|
year: c,
|
|
58
58
|
month: A,
|
|
59
59
|
day: c
|
|
60
|
-
},
|
|
60
|
+
}, Nn = {
|
|
61
61
|
year: c,
|
|
62
62
|
month: A,
|
|
63
63
|
day: c,
|
|
64
64
|
weekday: A
|
|
65
|
-
},
|
|
65
|
+
}, In = {
|
|
66
66
|
hour: c,
|
|
67
67
|
minute: c
|
|
68
|
-
},
|
|
68
|
+
}, xn = {
|
|
69
69
|
hour: c,
|
|
70
70
|
minute: c,
|
|
71
71
|
second: c
|
|
72
|
-
},
|
|
72
|
+
}, En = {
|
|
73
73
|
hour: c,
|
|
74
74
|
minute: c,
|
|
75
75
|
second: c,
|
|
76
|
-
timeZoneName:
|
|
77
|
-
},
|
|
76
|
+
timeZoneName: Q
|
|
77
|
+
}, bn = {
|
|
78
78
|
hour: c,
|
|
79
79
|
minute: c,
|
|
80
80
|
second: c,
|
|
81
81
|
timeZoneName: A
|
|
82
|
-
},
|
|
82
|
+
}, Fn = {
|
|
83
83
|
hour: c,
|
|
84
84
|
minute: c,
|
|
85
85
|
hourCycle: "h23"
|
|
86
|
-
},
|
|
86
|
+
}, Cn = {
|
|
87
87
|
hour: c,
|
|
88
88
|
minute: c,
|
|
89
89
|
second: c,
|
|
90
90
|
hourCycle: "h23"
|
|
91
|
-
},
|
|
91
|
+
}, Vn = {
|
|
92
92
|
hour: c,
|
|
93
93
|
minute: c,
|
|
94
94
|
second: c,
|
|
95
95
|
hourCycle: "h23",
|
|
96
|
-
timeZoneName:
|
|
97
|
-
},
|
|
96
|
+
timeZoneName: Q
|
|
97
|
+
}, Wn = {
|
|
98
98
|
hour: c,
|
|
99
99
|
minute: c,
|
|
100
100
|
second: c,
|
|
101
101
|
hourCycle: "h23",
|
|
102
102
|
timeZoneName: A
|
|
103
|
-
},
|
|
103
|
+
}, Ln = {
|
|
104
104
|
year: c,
|
|
105
105
|
month: c,
|
|
106
106
|
day: c,
|
|
107
107
|
hour: c,
|
|
108
108
|
minute: c
|
|
109
|
-
},
|
|
109
|
+
}, $n = {
|
|
110
110
|
year: c,
|
|
111
111
|
month: c,
|
|
112
112
|
day: c,
|
|
113
113
|
hour: c,
|
|
114
114
|
minute: c,
|
|
115
115
|
second: c
|
|
116
|
-
},
|
|
116
|
+
}, Zn = {
|
|
117
117
|
year: c,
|
|
118
|
-
month:
|
|
118
|
+
month: Q,
|
|
119
119
|
day: c,
|
|
120
120
|
hour: c,
|
|
121
121
|
minute: c
|
|
122
|
-
},
|
|
122
|
+
}, zn = {
|
|
123
123
|
year: c,
|
|
124
|
-
month:
|
|
124
|
+
month: Q,
|
|
125
125
|
day: c,
|
|
126
126
|
hour: c,
|
|
127
127
|
minute: c,
|
|
128
128
|
second: c
|
|
129
|
-
},
|
|
129
|
+
}, Gr = {
|
|
130
130
|
year: c,
|
|
131
|
-
month:
|
|
131
|
+
month: Q,
|
|
132
132
|
day: c,
|
|
133
|
-
weekday:
|
|
133
|
+
weekday: Q,
|
|
134
134
|
hour: c,
|
|
135
135
|
minute: c
|
|
136
|
-
},
|
|
136
|
+
}, An = {
|
|
137
137
|
year: c,
|
|
138
138
|
month: A,
|
|
139
139
|
day: c,
|
|
140
140
|
hour: c,
|
|
141
141
|
minute: c,
|
|
142
|
-
timeZoneName:
|
|
143
|
-
},
|
|
142
|
+
timeZoneName: Q
|
|
143
|
+
}, _n = {
|
|
144
144
|
year: c,
|
|
145
145
|
month: A,
|
|
146
146
|
day: c,
|
|
147
147
|
hour: c,
|
|
148
148
|
minute: c,
|
|
149
149
|
second: c,
|
|
150
|
-
timeZoneName:
|
|
151
|
-
},
|
|
150
|
+
timeZoneName: Q
|
|
151
|
+
}, qn = {
|
|
152
152
|
year: c,
|
|
153
153
|
month: A,
|
|
154
154
|
day: c,
|
|
@@ -156,7 +156,7 @@ const c = "numeric", K = "short", A = "long", nt = {
|
|
|
156
156
|
hour: c,
|
|
157
157
|
minute: c,
|
|
158
158
|
timeZoneName: A
|
|
159
|
-
},
|
|
159
|
+
}, Rn = {
|
|
160
160
|
year: c,
|
|
161
161
|
month: A,
|
|
162
162
|
day: c,
|
|
@@ -166,14 +166,14 @@ const c = "numeric", K = "short", A = "long", nt = {
|
|
|
166
166
|
second: c,
|
|
167
167
|
timeZoneName: A
|
|
168
168
|
};
|
|
169
|
-
class
|
|
169
|
+
class Ae {
|
|
170
170
|
/**
|
|
171
171
|
* The type of zone
|
|
172
172
|
* @abstract
|
|
173
173
|
* @type {string}
|
|
174
174
|
*/
|
|
175
175
|
get type() {
|
|
176
|
-
throw new
|
|
176
|
+
throw new re();
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
179
179
|
* The name of this zone.
|
|
@@ -181,7 +181,7 @@ class ze {
|
|
|
181
181
|
* @type {string}
|
|
182
182
|
*/
|
|
183
183
|
get name() {
|
|
184
|
-
throw new
|
|
184
|
+
throw new re();
|
|
185
185
|
}
|
|
186
186
|
get ianaName() {
|
|
187
187
|
return this.name;
|
|
@@ -192,7 +192,7 @@ class ze {
|
|
|
192
192
|
* @type {boolean}
|
|
193
193
|
*/
|
|
194
194
|
get isUniversal() {
|
|
195
|
-
throw new
|
|
195
|
+
throw new re();
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* Returns the offset's common name (such as EST) at the specified timestamp
|
|
@@ -204,7 +204,7 @@ class ze {
|
|
|
204
204
|
* @return {string}
|
|
205
205
|
*/
|
|
206
206
|
offsetName(e, n) {
|
|
207
|
-
throw new
|
|
207
|
+
throw new re();
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
210
210
|
* Returns the offset's value as a string
|
|
@@ -215,7 +215,7 @@ class ze {
|
|
|
215
215
|
* @return {string}
|
|
216
216
|
*/
|
|
217
217
|
formatOffset(e, n) {
|
|
218
|
-
throw new
|
|
218
|
+
throw new re();
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* Return the offset in minutes for this zone at the specified timestamp.
|
|
@@ -224,7 +224,7 @@ class ze {
|
|
|
224
224
|
* @return {number}
|
|
225
225
|
*/
|
|
226
226
|
offset(e) {
|
|
227
|
-
throw new
|
|
227
|
+
throw new re();
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* Return whether this Zone is equal to another zone
|
|
@@ -233,7 +233,7 @@ class ze {
|
|
|
233
233
|
* @return {boolean}
|
|
234
234
|
*/
|
|
235
235
|
equals(e) {
|
|
236
|
-
throw new
|
|
236
|
+
throw new re();
|
|
237
237
|
}
|
|
238
238
|
/**
|
|
239
239
|
* Return whether this Zone is valid.
|
|
@@ -241,17 +241,17 @@ class ze {
|
|
|
241
241
|
* @type {boolean}
|
|
242
242
|
*/
|
|
243
243
|
get isValid() {
|
|
244
|
-
throw new
|
|
244
|
+
throw new re();
|
|
245
245
|
}
|
|
246
246
|
}
|
|
247
|
-
let
|
|
248
|
-
class
|
|
247
|
+
let kt = null;
|
|
248
|
+
class dt extends Ae {
|
|
249
249
|
/**
|
|
250
250
|
* Get a singleton instance of the local zone
|
|
251
251
|
* @return {SystemZone}
|
|
252
252
|
*/
|
|
253
253
|
static get instance() {
|
|
254
|
-
return
|
|
254
|
+
return kt === null && (kt = new dt()), kt;
|
|
255
255
|
}
|
|
256
256
|
/** @override **/
|
|
257
257
|
get type() {
|
|
@@ -267,11 +267,11 @@ class ct extends ze {
|
|
|
267
267
|
}
|
|
268
268
|
/** @override **/
|
|
269
269
|
offsetName(e, { format: n, locale: r }) {
|
|
270
|
-
return
|
|
270
|
+
return Kn(e, n, r);
|
|
271
271
|
}
|
|
272
272
|
/** @override **/
|
|
273
273
|
formatOffset(e, n) {
|
|
274
|
-
return
|
|
274
|
+
return Le(this.offset(e), n);
|
|
275
275
|
}
|
|
276
276
|
/** @override **/
|
|
277
277
|
offset(e) {
|
|
@@ -286,9 +286,9 @@ class ct extends ze {
|
|
|
286
286
|
return !0;
|
|
287
287
|
}
|
|
288
288
|
}
|
|
289
|
-
let
|
|
290
|
-
function
|
|
291
|
-
return
|
|
289
|
+
let Ke = {};
|
|
290
|
+
function Jr(t) {
|
|
291
|
+
return Ke[t] || (Ke[t] = new Intl.DateTimeFormat("en-US", {
|
|
292
292
|
hour12: !1,
|
|
293
293
|
timeZone: t,
|
|
294
294
|
year: "numeric",
|
|
@@ -298,9 +298,9 @@ function Gr(t) {
|
|
|
298
298
|
minute: "2-digit",
|
|
299
299
|
second: "2-digit",
|
|
300
300
|
era: "short"
|
|
301
|
-
})),
|
|
301
|
+
})), Ke[t];
|
|
302
302
|
}
|
|
303
|
-
const
|
|
303
|
+
const Br = {
|
|
304
304
|
year: 0,
|
|
305
305
|
month: 1,
|
|
306
306
|
day: 2,
|
|
@@ -309,33 +309,33 @@ const Jr = {
|
|
|
309
309
|
minute: 5,
|
|
310
310
|
second: 6
|
|
311
311
|
};
|
|
312
|
-
function
|
|
312
|
+
function Kr(t, e) {
|
|
313
313
|
const n = t.format(e).replace(/\u200E/g, ""), r = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n), [, s, i, a, o, l, u, d] = r;
|
|
314
314
|
return [a, s, i, o, l, u, d];
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function Qr(t, e) {
|
|
317
317
|
const n = t.formatToParts(e), r = [];
|
|
318
318
|
for (let s = 0; s < n.length; s++) {
|
|
319
|
-
const { type: i, value: a } = n[s], o =
|
|
319
|
+
const { type: i, value: a } = n[s], o = Br[i];
|
|
320
320
|
i === "era" ? r[o] = a : p(o) || (r[o] = parseInt(a, 10));
|
|
321
321
|
}
|
|
322
322
|
return r;
|
|
323
323
|
}
|
|
324
|
-
let
|
|
325
|
-
class
|
|
324
|
+
let Ye = {};
|
|
325
|
+
class ne extends Ae {
|
|
326
326
|
/**
|
|
327
327
|
* @param {string} name - Zone name
|
|
328
328
|
* @return {IANAZone}
|
|
329
329
|
*/
|
|
330
330
|
static create(e) {
|
|
331
|
-
return
|
|
331
|
+
return Ye[e] || (Ye[e] = new ne(e)), Ye[e];
|
|
332
332
|
}
|
|
333
333
|
/**
|
|
334
334
|
* Reset local caches. Should only be necessary in testing scenarios.
|
|
335
335
|
* @return {void}
|
|
336
336
|
*/
|
|
337
337
|
static resetCache() {
|
|
338
|
-
|
|
338
|
+
Ye = {}, Ke = {};
|
|
339
339
|
}
|
|
340
340
|
/**
|
|
341
341
|
* Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.
|
|
@@ -366,7 +366,7 @@ class te extends ze {
|
|
|
366
366
|
}
|
|
367
367
|
}
|
|
368
368
|
constructor(e) {
|
|
369
|
-
super(), this.zoneName = e, this.valid =
|
|
369
|
+
super(), this.zoneName = e, this.valid = ne.isValidZone(e);
|
|
370
370
|
}
|
|
371
371
|
/** @override **/
|
|
372
372
|
get type() {
|
|
@@ -382,21 +382,21 @@ class te extends ze {
|
|
|
382
382
|
}
|
|
383
383
|
/** @override **/
|
|
384
384
|
offsetName(e, { format: n, locale: r }) {
|
|
385
|
-
return
|
|
385
|
+
return Kn(e, n, r, this.name);
|
|
386
386
|
}
|
|
387
387
|
/** @override **/
|
|
388
388
|
formatOffset(e, n) {
|
|
389
|
-
return
|
|
389
|
+
return Le(this.offset(e), n);
|
|
390
390
|
}
|
|
391
391
|
/** @override **/
|
|
392
392
|
offset(e) {
|
|
393
393
|
const n = new Date(e);
|
|
394
394
|
if (isNaN(n))
|
|
395
395
|
return NaN;
|
|
396
|
-
const r =
|
|
397
|
-
let [s, i, a, o, l, u, d] = r.formatToParts ?
|
|
396
|
+
const r = Jr(this.name);
|
|
397
|
+
let [s, i, a, o, l, u, d] = r.formatToParts ? Qr(r, n) : Kr(r, n);
|
|
398
398
|
o === "BC" && (s = -Math.abs(s) + 1);
|
|
399
|
-
const
|
|
399
|
+
const O = ht({
|
|
400
400
|
year: s,
|
|
401
401
|
month: i,
|
|
402
402
|
day: a,
|
|
@@ -407,7 +407,7 @@ class te extends ze {
|
|
|
407
407
|
});
|
|
408
408
|
let f = +n;
|
|
409
409
|
const w = f % 1e3;
|
|
410
|
-
return f -= w >= 0 ? w : 1e3 + w, (
|
|
410
|
+
return f -= w >= 0 ? w : 1e3 + w, (O - f) / (60 * 1e3);
|
|
411
411
|
}
|
|
412
412
|
/** @override **/
|
|
413
413
|
equals(e) {
|
|
@@ -418,44 +418,44 @@ class te extends ze {
|
|
|
418
418
|
return this.valid;
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
|
-
let
|
|
422
|
-
function
|
|
423
|
-
const n = JSON.stringify([t, e]);
|
|
424
|
-
let r = Yt[n];
|
|
425
|
-
return r || (r = new Intl.ListFormat(t, e), Yt[n] = r), r;
|
|
426
|
-
}
|
|
427
|
-
let Nt = {};
|
|
428
|
-
function It(t, e = {}) {
|
|
421
|
+
let Pt = {};
|
|
422
|
+
function Xr(t, e = {}) {
|
|
429
423
|
const n = JSON.stringify([t, e]);
|
|
430
|
-
let r =
|
|
431
|
-
return r || (r = new Intl.
|
|
424
|
+
let r = Pt[n];
|
|
425
|
+
return r || (r = new Intl.ListFormat(t, e), Pt[n] = r), r;
|
|
432
426
|
}
|
|
433
|
-
let
|
|
434
|
-
function
|
|
427
|
+
let It = {};
|
|
428
|
+
function xt(t, e = {}) {
|
|
435
429
|
const n = JSON.stringify([t, e]);
|
|
436
|
-
let r =
|
|
437
|
-
return r || (r = new Intl.
|
|
430
|
+
let r = It[n];
|
|
431
|
+
return r || (r = new Intl.DateTimeFormat(t, e), It[n] = r), r;
|
|
438
432
|
}
|
|
439
433
|
let Et = {};
|
|
440
434
|
function es(t, e = {}) {
|
|
435
|
+
const n = JSON.stringify([t, e]);
|
|
436
|
+
let r = Et[n];
|
|
437
|
+
return r || (r = new Intl.NumberFormat(t, e), Et[n] = r), r;
|
|
438
|
+
}
|
|
439
|
+
let bt = {};
|
|
440
|
+
function ts(t, e = {}) {
|
|
441
441
|
const { base: n, ...r } = e, s = JSON.stringify([t, r]);
|
|
442
|
-
let i =
|
|
443
|
-
return i || (i = new Intl.RelativeTimeFormat(t, e),
|
|
442
|
+
let i = bt[s];
|
|
443
|
+
return i || (i = new Intl.RelativeTimeFormat(t, e), bt[s] = i), i;
|
|
444
444
|
}
|
|
445
|
-
let
|
|
446
|
-
function
|
|
447
|
-
return
|
|
445
|
+
let Ce = null;
|
|
446
|
+
function ns() {
|
|
447
|
+
return Ce || (Ce = new Intl.DateTimeFormat().resolvedOptions().locale, Ce);
|
|
448
448
|
}
|
|
449
|
-
let
|
|
450
|
-
function
|
|
451
|
-
let e =
|
|
449
|
+
let jt = {};
|
|
450
|
+
function rs(t) {
|
|
451
|
+
let e = jt[t];
|
|
452
452
|
if (!e) {
|
|
453
453
|
const n = new Intl.Locale(t);
|
|
454
|
-
e = "getWeekInfo" in n ? n.getWeekInfo() : n.weekInfo,
|
|
454
|
+
e = "getWeekInfo" in n ? n.getWeekInfo() : n.weekInfo, jt[t] = e;
|
|
455
455
|
}
|
|
456
456
|
return e;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
458
|
+
function ss(t) {
|
|
459
459
|
const e = t.indexOf("-x-");
|
|
460
460
|
e !== -1 && (t = t.substring(0, e));
|
|
461
461
|
const n = t.indexOf("-u-");
|
|
@@ -464,19 +464,19 @@ function rs(t) {
|
|
|
464
464
|
{
|
|
465
465
|
let r, s;
|
|
466
466
|
try {
|
|
467
|
-
r =
|
|
467
|
+
r = xt(t).resolvedOptions(), s = t;
|
|
468
468
|
} catch {
|
|
469
469
|
const l = t.substring(0, n);
|
|
470
|
-
r =
|
|
470
|
+
r = xt(l).resolvedOptions(), s = l;
|
|
471
471
|
}
|
|
472
472
|
const { numberingSystem: i, calendar: a } = r;
|
|
473
473
|
return [s, i, a];
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function is(t, e, n) {
|
|
477
477
|
return (n || e) && (t.includes("-u-") || (t += "-u"), n && (t += `-ca-${n}`), e && (t += `-nu-${e}`)), t;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function as(t) {
|
|
480
480
|
const e = [];
|
|
481
481
|
for (let n = 1; n <= 12; n++) {
|
|
482
482
|
const r = y.utc(2009, n, 1);
|
|
@@ -484,7 +484,7 @@ function is(t) {
|
|
|
484
484
|
}
|
|
485
485
|
return e;
|
|
486
486
|
}
|
|
487
|
-
function
|
|
487
|
+
function os(t) {
|
|
488
488
|
const e = [];
|
|
489
489
|
for (let n = 1; n <= 7; n++) {
|
|
490
490
|
const r = y.utc(2016, 11, 13 + n);
|
|
@@ -492,20 +492,20 @@ function as(t) {
|
|
|
492
492
|
}
|
|
493
493
|
return e;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
495
|
+
function Pe(t, e, n, r) {
|
|
496
496
|
const s = t.listingMode();
|
|
497
497
|
return s === "error" ? null : s === "en" ? n(e) : r(e);
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function ls(t) {
|
|
500
500
|
return t.numberingSystem && t.numberingSystem !== "latn" ? !1 : t.numberingSystem === "latn" || !t.locale || t.locale.startsWith("en") || new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem === "latn";
|
|
501
501
|
}
|
|
502
|
-
class
|
|
502
|
+
class us {
|
|
503
503
|
constructor(e, n, r) {
|
|
504
504
|
this.padTo = r.padTo || 0, this.floor = r.floor || !1;
|
|
505
505
|
const { padTo: s, floor: i, ...a } = r;
|
|
506
506
|
if (!n || Object.keys(a).length > 0) {
|
|
507
507
|
const o = { useGrouping: !1, ...r };
|
|
508
|
-
r.padTo > 0 && (o.minimumIntegerDigits = r.padTo), this.inf =
|
|
508
|
+
r.padTo > 0 && (o.minimumIntegerDigits = r.padTo), this.inf = es(e, o);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
format(e) {
|
|
@@ -513,12 +513,12 @@ class ls {
|
|
|
513
513
|
const n = this.floor ? Math.floor(e) : e;
|
|
514
514
|
return this.inf.format(n);
|
|
515
515
|
} else {
|
|
516
|
-
const n = this.floor ? Math.floor(e) :
|
|
516
|
+
const n = this.floor ? Math.floor(e) : At(e, 3);
|
|
517
517
|
return b(n, this.padTo);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
|
-
class
|
|
521
|
+
class cs {
|
|
522
522
|
constructor(e, n, r) {
|
|
523
523
|
this.opts = r, this.originalZone = void 0;
|
|
524
524
|
let s;
|
|
@@ -526,11 +526,11 @@ class us {
|
|
|
526
526
|
this.dt = e;
|
|
527
527
|
else if (e.zone.type === "fixed") {
|
|
528
528
|
const a = -1 * (e.offset / 60), o = a >= 0 ? `Etc/GMT+${a}` : `Etc/GMT${a}`;
|
|
529
|
-
e.offset !== 0 &&
|
|
529
|
+
e.offset !== 0 && ne.create(o).valid ? (s = o, this.dt = e) : (s = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
530
530
|
} else
|
|
531
531
|
e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, s = e.zone.name) : (s = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
532
532
|
const i = { ...this.opts };
|
|
533
|
-
i.timeZone = i.timeZone || s, this.dtf =
|
|
533
|
+
i.timeZone = i.timeZone || s, this.dtf = xt(n, i);
|
|
534
534
|
}
|
|
535
535
|
format() {
|
|
536
536
|
return this.originalZone ? this.formatToParts().map(({ value: e }) => e).join("") : this.dtf.format(this.dt.toJSDate());
|
|
@@ -555,18 +555,18 @@ class us {
|
|
|
555
555
|
return this.dtf.resolvedOptions();
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
class
|
|
558
|
+
class ds {
|
|
559
559
|
constructor(e, n, r) {
|
|
560
|
-
this.opts = { style: "long", ...r }, !n &&
|
|
560
|
+
this.opts = { style: "long", ...r }, !n && Jn() && (this.rtf = ts(e, r));
|
|
561
561
|
}
|
|
562
562
|
format(e, n) {
|
|
563
|
-
return this.rtf ? this.rtf.format(e, n) :
|
|
563
|
+
return this.rtf ? this.rtf.format(e, n) : Fs(n, e, this.opts.numeric, this.opts.style !== "long");
|
|
564
564
|
}
|
|
565
565
|
formatToParts(e, n) {
|
|
566
566
|
return this.rtf ? this.rtf.formatToParts(e, n) : [];
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
const
|
|
569
|
+
const fs = {
|
|
570
570
|
firstDay: 1,
|
|
571
571
|
minimalDays: 4,
|
|
572
572
|
weekend: [6, 7]
|
|
@@ -582,21 +582,21 @@ class D {
|
|
|
582
582
|
);
|
|
583
583
|
}
|
|
584
584
|
static create(e, n, r, s, i = !1) {
|
|
585
|
-
const a = e || x.defaultLocale, o = a || (i ? "en-US" :
|
|
585
|
+
const a = e || x.defaultLocale, o = a || (i ? "en-US" : ns()), l = n || x.defaultNumberingSystem, u = r || x.defaultOutputCalendar, d = Ft(s) || x.defaultWeekSettings;
|
|
586
586
|
return new D(o, l, u, d, a);
|
|
587
587
|
}
|
|
588
588
|
static resetCache() {
|
|
589
|
-
|
|
589
|
+
Ce = null, It = {}, Et = {}, bt = {};
|
|
590
590
|
}
|
|
591
591
|
static fromObject({ locale: e, numberingSystem: n, outputCalendar: r, weekSettings: s } = {}) {
|
|
592
592
|
return D.create(e, n, r, s);
|
|
593
593
|
}
|
|
594
594
|
constructor(e, n, r, s, i) {
|
|
595
|
-
const [a, o, l] =
|
|
596
|
-
this.locale = a, this.numberingSystem = n || o || null, this.outputCalendar = r || l || null, this.weekSettings = s, this.intl =
|
|
595
|
+
const [a, o, l] = ss(e);
|
|
596
|
+
this.locale = a, this.numberingSystem = n || o || null, this.outputCalendar = r || l || null, this.weekSettings = s, this.intl = is(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = i, this.fastNumbersCached = null;
|
|
597
597
|
}
|
|
598
598
|
get fastNumbers() {
|
|
599
|
-
return this.fastNumbersCached == null && (this.fastNumbersCached =
|
|
599
|
+
return this.fastNumbersCached == null && (this.fastNumbersCached = ls(this)), this.fastNumbersCached;
|
|
600
600
|
}
|
|
601
601
|
listingMode() {
|
|
602
602
|
const e = this.isEnglish(), n = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
|
|
@@ -607,7 +607,7 @@ class D {
|
|
|
607
607
|
e.locale || this.specifiedLocale,
|
|
608
608
|
e.numberingSystem || this.numberingSystem,
|
|
609
609
|
e.outputCalendar || this.outputCalendar,
|
|
610
|
-
|
|
610
|
+
Ft(e.weekSettings) || this.weekSettings,
|
|
611
611
|
e.defaultToEN || !1
|
|
612
612
|
);
|
|
613
613
|
}
|
|
@@ -618,24 +618,24 @@ class D {
|
|
|
618
618
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
619
619
|
}
|
|
620
620
|
months(e, n = !1) {
|
|
621
|
-
return
|
|
621
|
+
return Pe(this, e, er, () => {
|
|
622
622
|
const r = n ? { month: e, day: "numeric" } : { month: e }, s = n ? "format" : "standalone";
|
|
623
|
-
return this.monthsCache[s][e] || (this.monthsCache[s][e] =
|
|
623
|
+
return this.monthsCache[s][e] || (this.monthsCache[s][e] = as((i) => this.extract(i, r, "month"))), this.monthsCache[s][e];
|
|
624
624
|
});
|
|
625
625
|
}
|
|
626
626
|
weekdays(e, n = !1) {
|
|
627
|
-
return
|
|
627
|
+
return Pe(this, e, rr, () => {
|
|
628
628
|
const r = n ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = n ? "format" : "standalone";
|
|
629
|
-
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] =
|
|
629
|
+
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = os(
|
|
630
630
|
(i) => this.extract(i, r, "weekday")
|
|
631
631
|
)), this.weekdaysCache[s][e];
|
|
632
632
|
});
|
|
633
633
|
}
|
|
634
634
|
meridiems() {
|
|
635
|
-
return
|
|
635
|
+
return Pe(
|
|
636
636
|
this,
|
|
637
637
|
void 0,
|
|
638
|
-
() =>
|
|
638
|
+
() => sr,
|
|
639
639
|
() => {
|
|
640
640
|
if (!this.meridiemCache) {
|
|
641
641
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -648,7 +648,7 @@ class D {
|
|
|
648
648
|
);
|
|
649
649
|
}
|
|
650
650
|
eras(e) {
|
|
651
|
-
return
|
|
651
|
+
return Pe(this, e, ir, () => {
|
|
652
652
|
const n = { era: e };
|
|
653
653
|
return this.eraCache[e] || (this.eraCache[e] = [y.utc(-40, 1, 1), y.utc(2017, 1, 1)].map(
|
|
654
654
|
(r) => this.extract(r, n, "era")
|
|
@@ -660,22 +660,22 @@ class D {
|
|
|
660
660
|
return a ? a.value : null;
|
|
661
661
|
}
|
|
662
662
|
numberFormatter(e = {}) {
|
|
663
|
-
return new
|
|
663
|
+
return new us(this.intl, e.forceSimple || this.fastNumbers, e);
|
|
664
664
|
}
|
|
665
665
|
dtFormatter(e, n = {}) {
|
|
666
|
-
return new
|
|
666
|
+
return new cs(e, this.intl, n);
|
|
667
667
|
}
|
|
668
668
|
relFormatter(e = {}) {
|
|
669
|
-
return new
|
|
669
|
+
return new ds(this.intl, this.isEnglish(), e);
|
|
670
670
|
}
|
|
671
671
|
listFormatter(e = {}) {
|
|
672
|
-
return
|
|
672
|
+
return Xr(this.intl, e);
|
|
673
673
|
}
|
|
674
674
|
isEnglish() {
|
|
675
675
|
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
|
|
676
676
|
}
|
|
677
677
|
getWeekSettings() {
|
|
678
|
-
return this.weekSettings ? this.weekSettings :
|
|
678
|
+
return this.weekSettings ? this.weekSettings : Bn() ? rs(this.locale) : fs;
|
|
679
679
|
}
|
|
680
680
|
getStartOfWeek() {
|
|
681
681
|
return this.getWeekSettings().firstDay;
|
|
@@ -690,14 +690,14 @@ class D {
|
|
|
690
690
|
return this.locale === e.locale && this.numberingSystem === e.numberingSystem && this.outputCalendar === e.outputCalendar;
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
|
-
let
|
|
694
|
-
class W extends
|
|
693
|
+
let St = null;
|
|
694
|
+
class W extends Ae {
|
|
695
695
|
/**
|
|
696
696
|
* Get a singleton instance of UTC
|
|
697
697
|
* @return {FixedOffsetZone}
|
|
698
698
|
*/
|
|
699
699
|
static get utcInstance() {
|
|
700
|
-
return
|
|
700
|
+
return St === null && (St = new W(0)), St;
|
|
701
701
|
}
|
|
702
702
|
/**
|
|
703
703
|
* Get an instance with a specified offset
|
|
@@ -719,7 +719,7 @@ class W extends ze {
|
|
|
719
719
|
if (e) {
|
|
720
720
|
const n = e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
|
|
721
721
|
if (n)
|
|
722
|
-
return new W(
|
|
722
|
+
return new W(mt(n[1], n[2]));
|
|
723
723
|
}
|
|
724
724
|
return null;
|
|
725
725
|
}
|
|
@@ -732,10 +732,10 @@ class W extends ze {
|
|
|
732
732
|
}
|
|
733
733
|
/** @override **/
|
|
734
734
|
get name() {
|
|
735
|
-
return this.fixed === 0 ? "UTC" : `UTC${
|
|
735
|
+
return this.fixed === 0 ? "UTC" : `UTC${Le(this.fixed, "narrow")}`;
|
|
736
736
|
}
|
|
737
737
|
get ianaName() {
|
|
738
|
-
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${
|
|
738
|
+
return this.fixed === 0 ? "Etc/UTC" : `Etc/GMT${Le(-this.fixed, "narrow")}`;
|
|
739
739
|
}
|
|
740
740
|
/** @override **/
|
|
741
741
|
offsetName() {
|
|
@@ -743,7 +743,7 @@ class W extends ze {
|
|
|
743
743
|
}
|
|
744
744
|
/** @override **/
|
|
745
745
|
formatOffset(e, n) {
|
|
746
|
-
return
|
|
746
|
+
return Le(this.fixed, n);
|
|
747
747
|
}
|
|
748
748
|
/** @override **/
|
|
749
749
|
get isUniversal() {
|
|
@@ -762,7 +762,7 @@ class W extends ze {
|
|
|
762
762
|
return !0;
|
|
763
763
|
}
|
|
764
764
|
}
|
|
765
|
-
class
|
|
765
|
+
class hs extends Ae {
|
|
766
766
|
constructor(e) {
|
|
767
767
|
super(), this.zoneName = e;
|
|
768
768
|
}
|
|
@@ -799,25 +799,25 @@ class fs extends ze {
|
|
|
799
799
|
return !1;
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function oe(t, e) {
|
|
803
803
|
if (p(t) || t === null)
|
|
804
804
|
return e;
|
|
805
|
-
if (t instanceof
|
|
805
|
+
if (t instanceof Ae)
|
|
806
806
|
return t;
|
|
807
|
-
if (
|
|
807
|
+
if (gs(t)) {
|
|
808
808
|
const n = t.toLowerCase();
|
|
809
|
-
return n === "default" ? e : n === "local" || n === "system" ?
|
|
809
|
+
return n === "default" ? e : n === "local" || n === "system" ? dt.instance : n === "utc" || n === "gmt" ? W.utcInstance : W.parseSpecifier(n) || ne.create(t);
|
|
810
810
|
} else
|
|
811
|
-
return
|
|
811
|
+
return fe(t) ? W.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new hs(t);
|
|
812
812
|
}
|
|
813
|
-
let
|
|
813
|
+
let Gt = () => Date.now(), Jt = "system", Bt = null, Kt = null, Qt = null, Xt = 60, en, tn = null;
|
|
814
814
|
class x {
|
|
815
815
|
/**
|
|
816
816
|
* Get the callback for returning the current timestamp.
|
|
817
817
|
* @type {function}
|
|
818
818
|
*/
|
|
819
819
|
static get now() {
|
|
820
|
-
return
|
|
820
|
+
return Gt;
|
|
821
821
|
}
|
|
822
822
|
/**
|
|
823
823
|
* Set the callback for returning the current timestamp.
|
|
@@ -827,7 +827,7 @@ class x {
|
|
|
827
827
|
* @example Settings.now = () => 0 // always pretend it's Jan 1, 1970 at midnight in UTC time
|
|
828
828
|
*/
|
|
829
829
|
static set now(e) {
|
|
830
|
-
|
|
830
|
+
Gt = e;
|
|
831
831
|
}
|
|
832
832
|
/**
|
|
833
833
|
* Set the default time zone to create DateTimes in. Does not affect existing instances.
|
|
@@ -835,7 +835,7 @@ class x {
|
|
|
835
835
|
* @type {string}
|
|
836
836
|
*/
|
|
837
837
|
static set defaultZone(e) {
|
|
838
|
-
|
|
838
|
+
Jt = e;
|
|
839
839
|
}
|
|
840
840
|
/**
|
|
841
841
|
* Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
|
|
@@ -843,49 +843,49 @@ class x {
|
|
|
843
843
|
* @type {Zone}
|
|
844
844
|
*/
|
|
845
845
|
static get defaultZone() {
|
|
846
|
-
return
|
|
846
|
+
return oe(Jt, dt.instance);
|
|
847
847
|
}
|
|
848
848
|
/**
|
|
849
849
|
* Get the default locale to create DateTimes with. Does not affect existing instances.
|
|
850
850
|
* @type {string}
|
|
851
851
|
*/
|
|
852
852
|
static get defaultLocale() {
|
|
853
|
-
return
|
|
853
|
+
return Bt;
|
|
854
854
|
}
|
|
855
855
|
/**
|
|
856
856
|
* Set the default locale to create DateTimes with. Does not affect existing instances.
|
|
857
857
|
* @type {string}
|
|
858
858
|
*/
|
|
859
859
|
static set defaultLocale(e) {
|
|
860
|
-
|
|
860
|
+
Bt = e;
|
|
861
861
|
}
|
|
862
862
|
/**
|
|
863
863
|
* Get the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
864
864
|
* @type {string}
|
|
865
865
|
*/
|
|
866
866
|
static get defaultNumberingSystem() {
|
|
867
|
-
return
|
|
867
|
+
return Kt;
|
|
868
868
|
}
|
|
869
869
|
/**
|
|
870
870
|
* Set the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
871
871
|
* @type {string}
|
|
872
872
|
*/
|
|
873
873
|
static set defaultNumberingSystem(e) {
|
|
874
|
-
|
|
874
|
+
Kt = e;
|
|
875
875
|
}
|
|
876
876
|
/**
|
|
877
877
|
* Get the default output calendar to create DateTimes with. Does not affect existing instances.
|
|
878
878
|
* @type {string}
|
|
879
879
|
*/
|
|
880
880
|
static get defaultOutputCalendar() {
|
|
881
|
-
return
|
|
881
|
+
return Qt;
|
|
882
882
|
}
|
|
883
883
|
/**
|
|
884
884
|
* Set the default output calendar to create DateTimes with. Does not affect existing instances.
|
|
885
885
|
* @type {string}
|
|
886
886
|
*/
|
|
887
887
|
static set defaultOutputCalendar(e) {
|
|
888
|
-
|
|
888
|
+
Qt = e;
|
|
889
889
|
}
|
|
890
890
|
/**
|
|
891
891
|
* @typedef {Object} WeekSettings
|
|
@@ -897,7 +897,7 @@ class x {
|
|
|
897
897
|
* @return {WeekSettings|null}
|
|
898
898
|
*/
|
|
899
899
|
static get defaultWeekSettings() {
|
|
900
|
-
return
|
|
900
|
+
return tn;
|
|
901
901
|
}
|
|
902
902
|
/**
|
|
903
903
|
* Allows overriding the default locale week settings, i.e. the start of the week, the weekend and
|
|
@@ -907,14 +907,14 @@ class x {
|
|
|
907
907
|
* @param {WeekSettings|null} weekSettings
|
|
908
908
|
*/
|
|
909
909
|
static set defaultWeekSettings(e) {
|
|
910
|
-
|
|
910
|
+
tn = Ft(e);
|
|
911
911
|
}
|
|
912
912
|
/**
|
|
913
913
|
* Get the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.
|
|
914
914
|
* @type {number}
|
|
915
915
|
*/
|
|
916
916
|
static get twoDigitCutoffYear() {
|
|
917
|
-
return
|
|
917
|
+
return Xt;
|
|
918
918
|
}
|
|
919
919
|
/**
|
|
920
920
|
* Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century.
|
|
@@ -925,31 +925,31 @@ class x {
|
|
|
925
925
|
* @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
|
|
926
926
|
*/
|
|
927
927
|
static set twoDigitCutoffYear(e) {
|
|
928
|
-
|
|
928
|
+
Xt = e % 100;
|
|
929
929
|
}
|
|
930
930
|
/**
|
|
931
931
|
* Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
932
932
|
* @type {boolean}
|
|
933
933
|
*/
|
|
934
934
|
static get throwOnInvalid() {
|
|
935
|
-
return
|
|
935
|
+
return en;
|
|
936
936
|
}
|
|
937
937
|
/**
|
|
938
938
|
* Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
939
939
|
* @type {boolean}
|
|
940
940
|
*/
|
|
941
941
|
static set throwOnInvalid(e) {
|
|
942
|
-
|
|
942
|
+
en = e;
|
|
943
943
|
}
|
|
944
944
|
/**
|
|
945
945
|
* Reset Luxon's global caches. Should only be necessary in testing scenarios.
|
|
946
946
|
* @return {void}
|
|
947
947
|
*/
|
|
948
948
|
static resetCaches() {
|
|
949
|
-
D.resetCache(),
|
|
949
|
+
D.resetCache(), ne.resetCache();
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
|
-
class
|
|
952
|
+
class K {
|
|
953
953
|
constructor(e, n) {
|
|
954
954
|
this.reason = e, this.explanation = n;
|
|
955
955
|
}
|
|
@@ -957,53 +957,53 @@ class B {
|
|
|
957
957
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
958
958
|
}
|
|
959
959
|
}
|
|
960
|
-
const Un = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334],
|
|
961
|
-
function
|
|
962
|
-
return new
|
|
960
|
+
const Un = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Hn = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
961
|
+
function U(t, e) {
|
|
962
|
+
return new K(
|
|
963
963
|
"unit out of range",
|
|
964
964
|
`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`
|
|
965
965
|
);
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function $t(t, e, n) {
|
|
968
968
|
const r = new Date(Date.UTC(t, e - 1, n));
|
|
969
969
|
t < 100 && t >= 0 && r.setUTCFullYear(r.getUTCFullYear() - 1900);
|
|
970
970
|
const s = r.getUTCDay();
|
|
971
971
|
return s === 0 ? 7 : s;
|
|
972
972
|
}
|
|
973
|
-
function
|
|
974
|
-
return n + (
|
|
973
|
+
function Yn(t, e, n) {
|
|
974
|
+
return n + (_e(t) ? Hn : Un)[e - 1];
|
|
975
975
|
}
|
|
976
|
-
function
|
|
977
|
-
const n =
|
|
976
|
+
function Pn(t, e) {
|
|
977
|
+
const n = _e(t) ? Hn : Un, r = n.findIndex((i) => i < e), s = e - n[r];
|
|
978
978
|
return { month: r + 1, day: s };
|
|
979
979
|
}
|
|
980
|
-
function
|
|
980
|
+
function Zt(t, e) {
|
|
981
981
|
return (t - e + 7) % 7 + 1;
|
|
982
982
|
}
|
|
983
|
-
function
|
|
984
|
-
const { year: r, month: s, day: i } = t, a =
|
|
983
|
+
function st(t, e = 4, n = 1) {
|
|
984
|
+
const { year: r, month: s, day: i } = t, a = Yn(r, s, i), o = Zt($t(r, s, i), n);
|
|
985
985
|
let l = Math.floor((a - o + 14 - e) / 7), u;
|
|
986
|
-
return l < 1 ? (u = r - 1, l =
|
|
986
|
+
return l < 1 ? (u = r - 1, l = Ze(u, e, n)) : l > Ze(r, e, n) ? (u = r + 1, l = 1) : u = r, { weekYear: u, weekNumber: l, weekday: o, ...yt(t) };
|
|
987
987
|
}
|
|
988
|
-
function
|
|
989
|
-
const { weekYear: r, weekNumber: s, weekday: i } = t, a = $t(
|
|
988
|
+
function nn(t, e = 4, n = 1) {
|
|
989
|
+
const { weekYear: r, weekNumber: s, weekday: i } = t, a = Zt($t(r, 1, e), n), o = Se(r);
|
|
990
990
|
let l = s * 7 + i - a - 7 + e, u;
|
|
991
|
-
l < 1 ? (u = r - 1, l +=
|
|
992
|
-
const { month: d, day: m } =
|
|
993
|
-
return { year: u, month: d, day: m, ...
|
|
991
|
+
l < 1 ? (u = r - 1, l += Se(u)) : l > o ? (u = r + 1, l -= Se(r)) : u = r;
|
|
992
|
+
const { month: d, day: m } = Pn(u, l);
|
|
993
|
+
return { year: u, month: d, day: m, ...yt(t) };
|
|
994
994
|
}
|
|
995
|
-
function
|
|
996
|
-
const { year: e, month: n, day: r } = t, s =
|
|
997
|
-
return { year: e, ordinal: s, ...
|
|
995
|
+
function Tt(t) {
|
|
996
|
+
const { year: e, month: n, day: r } = t, s = Yn(e, n, r);
|
|
997
|
+
return { year: e, ordinal: s, ...yt(t) };
|
|
998
998
|
}
|
|
999
|
-
function
|
|
1000
|
-
const { year: e, ordinal: n } = t, { month: r, day: s } =
|
|
1001
|
-
return { year: e, month: r, day: s, ...
|
|
999
|
+
function rn(t) {
|
|
1000
|
+
const { year: e, ordinal: n } = t, { month: r, day: s } = Pn(e, n);
|
|
1001
|
+
return { year: e, month: r, day: s, ...yt(t) };
|
|
1002
1002
|
}
|
|
1003
|
-
function
|
|
1003
|
+
function sn(t, e) {
|
|
1004
1004
|
if (!p(t.localWeekday) || !p(t.localWeekNumber) || !p(t.localWeekYear)) {
|
|
1005
1005
|
if (!p(t.weekday) || !p(t.weekNumber) || !p(t.weekYear))
|
|
1006
|
-
throw new
|
|
1006
|
+
throw new ke(
|
|
1007
1007
|
"Cannot mix locale-based week fields with ISO-based week fields"
|
|
1008
1008
|
);
|
|
1009
1009
|
return p(t.localWeekday) || (t.weekday = t.localWeekday), p(t.localWeekNumber) || (t.weekNumber = t.localWeekNumber), p(t.localWeekYear) || (t.weekYear = t.localWeekYear), delete t.localWeekday, delete t.localWeekNumber, delete t.localWeekYear, {
|
|
@@ -1013,78 +1013,78 @@ function rn(t, e) {
|
|
|
1013
1013
|
} else
|
|
1014
1014
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
1015
1015
|
}
|
|
1016
|
-
function
|
|
1017
|
-
const r =
|
|
1016
|
+
function ms(t, e = 4, n = 1) {
|
|
1017
|
+
const r = ft(t.weekYear), s = H(
|
|
1018
1018
|
t.weekNumber,
|
|
1019
1019
|
1,
|
|
1020
|
-
|
|
1020
|
+
Ze(t.weekYear, e, n)
|
|
1021
1021
|
), i = H(t.weekday, 1, 7);
|
|
1022
|
-
return r ? s ? i ? !1 :
|
|
1023
|
-
}
|
|
1024
|
-
function ms(t) {
|
|
1025
|
-
const e = dt(t.year), n = H(t.ordinal, 1, pe(t.year));
|
|
1026
|
-
return e ? n ? !1 : R("ordinal", t.ordinal) : R("year", t.year);
|
|
1022
|
+
return r ? s ? i ? !1 : U("weekday", t.weekday) : U("week", t.weekNumber) : U("weekYear", t.weekYear);
|
|
1027
1023
|
}
|
|
1028
|
-
function
|
|
1029
|
-
const e =
|
|
1030
|
-
return e ? n ?
|
|
1024
|
+
function ys(t) {
|
|
1025
|
+
const e = ft(t.year), n = H(t.ordinal, 1, Se(t.year));
|
|
1026
|
+
return e ? n ? !1 : U("ordinal", t.ordinal) : U("year", t.year);
|
|
1031
1027
|
}
|
|
1032
1028
|
function jn(t) {
|
|
1029
|
+
const e = ft(t.year), n = H(t.month, 1, 12), r = H(t.day, 1, it(t.year, t.month));
|
|
1030
|
+
return e ? n ? r ? !1 : U("day", t.day) : U("month", t.month) : U("year", t.year);
|
|
1031
|
+
}
|
|
1032
|
+
function Gn(t) {
|
|
1033
1033
|
const { hour: e, minute: n, second: r, millisecond: s } = t, i = H(e, 0, 23) || e === 24 && n === 0 && r === 0 && s === 0, a = H(n, 0, 59), o = H(r, 0, 59), l = H(s, 0, 999);
|
|
1034
|
-
return i ? a ? o ? l ? !1 :
|
|
1034
|
+
return i ? a ? o ? l ? !1 : U("millisecond", s) : U("second", r) : U("minute", n) : U("hour", e);
|
|
1035
1035
|
}
|
|
1036
1036
|
function p(t) {
|
|
1037
1037
|
return typeof t > "u";
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function fe(t) {
|
|
1040
1040
|
return typeof t == "number";
|
|
1041
1041
|
}
|
|
1042
|
-
function
|
|
1042
|
+
function ft(t) {
|
|
1043
1043
|
return typeof t == "number" && t % 1 === 0;
|
|
1044
1044
|
}
|
|
1045
|
-
function
|
|
1045
|
+
function gs(t) {
|
|
1046
1046
|
return typeof t == "string";
|
|
1047
1047
|
}
|
|
1048
|
-
function
|
|
1048
|
+
function ws(t) {
|
|
1049
1049
|
return Object.prototype.toString.call(t) === "[object Date]";
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1051
|
+
function Jn() {
|
|
1052
1052
|
try {
|
|
1053
1053
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
1054
1054
|
} catch {
|
|
1055
1055
|
return !1;
|
|
1056
1056
|
}
|
|
1057
1057
|
}
|
|
1058
|
-
function
|
|
1058
|
+
function Bn() {
|
|
1059
1059
|
try {
|
|
1060
1060
|
return typeof Intl < "u" && !!Intl.Locale && ("weekInfo" in Intl.Locale.prototype || "getWeekInfo" in Intl.Locale.prototype);
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
return !1;
|
|
1063
1063
|
}
|
|
1064
1064
|
}
|
|
1065
|
-
function
|
|
1065
|
+
function ps(t) {
|
|
1066
1066
|
return Array.isArray(t) ? t : [t];
|
|
1067
1067
|
}
|
|
1068
|
-
function
|
|
1068
|
+
function an(t, e, n) {
|
|
1069
1069
|
if (t.length !== 0)
|
|
1070
1070
|
return t.reduce((r, s) => {
|
|
1071
1071
|
const i = [e(s), s];
|
|
1072
1072
|
return r && n(r[0], i[0]) === r[0] ? r : i;
|
|
1073
1073
|
}, null)[1];
|
|
1074
1074
|
}
|
|
1075
|
-
function
|
|
1075
|
+
function ks(t, e) {
|
|
1076
1076
|
return e.reduce((n, r) => (n[r] = t[r], n), {});
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1078
|
+
function ve(t, e) {
|
|
1079
1079
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function Ft(t) {
|
|
1082
1082
|
if (t == null)
|
|
1083
1083
|
return null;
|
|
1084
1084
|
if (typeof t != "object")
|
|
1085
|
-
throw new
|
|
1085
|
+
throw new Z("Week settings must be an object");
|
|
1086
1086
|
if (!H(t.firstDay, 1, 7) || !H(t.minimalDays, 1, 7) || !Array.isArray(t.weekend) || t.weekend.some((e) => !H(e, 1, 7)))
|
|
1087
|
-
throw new
|
|
1087
|
+
throw new Z("Invalid week settings");
|
|
1088
1088
|
return {
|
|
1089
1089
|
firstDay: t.firstDay,
|
|
1090
1090
|
minimalDays: t.minimalDays,
|
|
@@ -1092,9 +1092,9 @@ function bt(t) {
|
|
|
1092
1092
|
};
|
|
1093
1093
|
}
|
|
1094
1094
|
function H(t, e, n) {
|
|
1095
|
-
return
|
|
1095
|
+
return ft(t) && t >= e && t <= n;
|
|
1096
1096
|
}
|
|
1097
|
-
function
|
|
1097
|
+
function Ss(t, e) {
|
|
1098
1098
|
return t - e * Math.floor(t / e);
|
|
1099
1099
|
}
|
|
1100
1100
|
function b(t, e = 2) {
|
|
@@ -1102,35 +1102,35 @@ function b(t, e = 2) {
|
|
|
1102
1102
|
let r;
|
|
1103
1103
|
return n ? r = "-" + ("" + -t).padStart(e, "0") : r = ("" + t).padStart(e, "0"), r;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function ae(t) {
|
|
1106
1106
|
if (!(p(t) || t === null || t === ""))
|
|
1107
1107
|
return parseInt(t, 10);
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1109
|
+
function ue(t) {
|
|
1110
1110
|
if (!(p(t) || t === null || t === ""))
|
|
1111
1111
|
return parseFloat(t);
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function zt(t) {
|
|
1114
1114
|
if (!(p(t) || t === null || t === "")) {
|
|
1115
1115
|
const e = parseFloat("0." + t) * 1e3;
|
|
1116
1116
|
return Math.floor(e);
|
|
1117
1117
|
}
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function At(t, e, n = !1) {
|
|
1120
1120
|
const r = 10 ** e;
|
|
1121
1121
|
return (n ? Math.trunc : Math.round)(t * r) / r;
|
|
1122
1122
|
}
|
|
1123
|
-
function
|
|
1123
|
+
function _e(t) {
|
|
1124
1124
|
return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
|
|
1125
1125
|
}
|
|
1126
|
-
function
|
|
1127
|
-
return
|
|
1126
|
+
function Se(t) {
|
|
1127
|
+
return _e(t) ? 366 : 365;
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
const n =
|
|
1131
|
-
return n === 2 ?
|
|
1129
|
+
function it(t, e) {
|
|
1130
|
+
const n = Ss(e - 1, 12) + 1, r = t + (e - n) / 12;
|
|
1131
|
+
return n === 2 ? _e(r) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][n - 1];
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function ht(t) {
|
|
1134
1134
|
let e = Date.UTC(
|
|
1135
1135
|
t.year,
|
|
1136
1136
|
t.month - 1,
|
|
@@ -1142,17 +1142,17 @@ function ft(t) {
|
|
|
1142
1142
|
);
|
|
1143
1143
|
return t.year < 100 && t.year >= 0 && (e = new Date(e), e.setUTCFullYear(t.year, t.month - 1, t.day)), +e;
|
|
1144
1144
|
}
|
|
1145
|
-
function
|
|
1146
|
-
return
|
|
1145
|
+
function on(t, e, n) {
|
|
1146
|
+
return -Zt($t(t, 1, e), n) + e - 1;
|
|
1147
1147
|
}
|
|
1148
|
-
function
|
|
1149
|
-
const r =
|
|
1150
|
-
return (
|
|
1148
|
+
function Ze(t, e = 4, n = 1) {
|
|
1149
|
+
const r = on(t, e, n), s = on(t + 1, e, n);
|
|
1150
|
+
return (Se(t) - r + s) / 7;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function Ct(t) {
|
|
1153
1153
|
return t > 99 ? t : t > x.twoDigitCutoffYear ? 1900 + t : 2e3 + t;
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function Kn(t, e, n, r = null) {
|
|
1156
1156
|
const s = new Date(t), i = {
|
|
1157
1157
|
hourCycle: "h23",
|
|
1158
1158
|
year: "numeric",
|
|
@@ -1165,30 +1165,30 @@ function Bn(t, e, n, r = null) {
|
|
|
1165
1165
|
const a = { timeZoneName: e, ...i }, o = new Intl.DateTimeFormat(n, a).formatToParts(s).find((l) => l.type.toLowerCase() === "timezonename");
|
|
1166
1166
|
return o ? o.value : null;
|
|
1167
1167
|
}
|
|
1168
|
-
function
|
|
1168
|
+
function mt(t, e) {
|
|
1169
1169
|
let n = parseInt(t, 10);
|
|
1170
1170
|
Number.isNaN(n) && (n = 0);
|
|
1171
1171
|
const r = parseInt(e, 10) || 0, s = n < 0 || Object.is(n, -0) ? -r : r;
|
|
1172
1172
|
return n * 60 + s;
|
|
1173
1173
|
}
|
|
1174
|
-
function
|
|
1174
|
+
function Qn(t) {
|
|
1175
1175
|
const e = Number(t);
|
|
1176
1176
|
if (typeof t == "boolean" || t === "" || Number.isNaN(e))
|
|
1177
|
-
throw new
|
|
1177
|
+
throw new Z(`Invalid unit value ${t}`);
|
|
1178
1178
|
return e;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function at(t, e) {
|
|
1181
1181
|
const n = {};
|
|
1182
1182
|
for (const r in t)
|
|
1183
|
-
if (
|
|
1183
|
+
if (ve(t, r)) {
|
|
1184
1184
|
const s = t[r];
|
|
1185
1185
|
if (s == null)
|
|
1186
1186
|
continue;
|
|
1187
|
-
n[e(r)] =
|
|
1187
|
+
n[e(r)] = Qn(s);
|
|
1188
1188
|
}
|
|
1189
1189
|
return n;
|
|
1190
1190
|
}
|
|
1191
|
-
function
|
|
1191
|
+
function Le(t, e) {
|
|
1192
1192
|
const n = Math.trunc(Math.abs(t / 60)), r = Math.trunc(Math.abs(t % 60)), s = t >= 0 ? "+" : "-";
|
|
1193
1193
|
switch (e) {
|
|
1194
1194
|
case "short":
|
|
@@ -1201,10 +1201,10 @@ function We(t, e) {
|
|
|
1201
1201
|
throw new RangeError(`Value format ${e} is out of range for property format`);
|
|
1202
1202
|
}
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return
|
|
1204
|
+
function yt(t) {
|
|
1205
|
+
return ks(t, ["hour", "minute", "second", "millisecond"]);
|
|
1206
1206
|
}
|
|
1207
|
-
const
|
|
1207
|
+
const Ts = [
|
|
1208
1208
|
"January",
|
|
1209
1209
|
"February",
|
|
1210
1210
|
"March",
|
|
@@ -1217,7 +1217,7 @@ const Ss = [
|
|
|
1217
1217
|
"October",
|
|
1218
1218
|
"November",
|
|
1219
1219
|
"December"
|
|
1220
|
-
],
|
|
1220
|
+
], Xn = [
|
|
1221
1221
|
"Jan",
|
|
1222
1222
|
"Feb",
|
|
1223
1223
|
"Mar",
|
|
@@ -1230,15 +1230,15 @@ const Ss = [
|
|
|
1230
1230
|
"Oct",
|
|
1231
1231
|
"Nov",
|
|
1232
1232
|
"Dec"
|
|
1233
|
-
],
|
|
1234
|
-
function
|
|
1233
|
+
], vs = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
1234
|
+
function er(t) {
|
|
1235
1235
|
switch (t) {
|
|
1236
1236
|
case "narrow":
|
|
1237
|
-
return [...
|
|
1237
|
+
return [...vs];
|
|
1238
1238
|
case "short":
|
|
1239
|
-
return [...
|
|
1239
|
+
return [...Xn];
|
|
1240
1240
|
case "long":
|
|
1241
|
-
return [...
|
|
1241
|
+
return [...Ts];
|
|
1242
1242
|
case "numeric":
|
|
1243
1243
|
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
|
|
1244
1244
|
case "2-digit":
|
|
@@ -1247,7 +1247,7 @@ function Xn(t) {
|
|
|
1247
1247
|
return null;
|
|
1248
1248
|
}
|
|
1249
1249
|
}
|
|
1250
|
-
const
|
|
1250
|
+
const tr = [
|
|
1251
1251
|
"Monday",
|
|
1252
1252
|
"Tuesday",
|
|
1253
1253
|
"Wednesday",
|
|
@@ -1255,47 +1255,47 @@ const er = [
|
|
|
1255
1255
|
"Friday",
|
|
1256
1256
|
"Saturday",
|
|
1257
1257
|
"Sunday"
|
|
1258
|
-
],
|
|
1259
|
-
function
|
|
1258
|
+
], nr = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Os = ["M", "T", "W", "T", "F", "S", "S"];
|
|
1259
|
+
function rr(t) {
|
|
1260
1260
|
switch (t) {
|
|
1261
1261
|
case "narrow":
|
|
1262
|
-
return [...
|
|
1262
|
+
return [...Os];
|
|
1263
1263
|
case "short":
|
|
1264
|
-
return [...
|
|
1264
|
+
return [...nr];
|
|
1265
1265
|
case "long":
|
|
1266
|
-
return [...
|
|
1266
|
+
return [...tr];
|
|
1267
1267
|
case "numeric":
|
|
1268
1268
|
return ["1", "2", "3", "4", "5", "6", "7"];
|
|
1269
1269
|
default:
|
|
1270
1270
|
return null;
|
|
1271
1271
|
}
|
|
1272
1272
|
}
|
|
1273
|
-
const
|
|
1274
|
-
function
|
|
1273
|
+
const sr = ["AM", "PM"], Ms = ["Before Christ", "Anno Domini"], Ds = ["BC", "AD"], Ns = ["B", "A"];
|
|
1274
|
+
function ir(t) {
|
|
1275
1275
|
switch (t) {
|
|
1276
1276
|
case "narrow":
|
|
1277
|
-
return [...
|
|
1277
|
+
return [...Ns];
|
|
1278
1278
|
case "short":
|
|
1279
|
-
return [...
|
|
1279
|
+
return [...Ds];
|
|
1280
1280
|
case "long":
|
|
1281
|
-
return [...
|
|
1281
|
+
return [...Ms];
|
|
1282
1282
|
default:
|
|
1283
1283
|
return null;
|
|
1284
1284
|
}
|
|
1285
1285
|
}
|
|
1286
|
-
function
|
|
1287
|
-
return
|
|
1288
|
-
}
|
|
1289
|
-
function Is(t, e) {
|
|
1290
|
-
return nr(e)[t.weekday - 1];
|
|
1286
|
+
function Is(t) {
|
|
1287
|
+
return sr[t.hour < 12 ? 0 : 1];
|
|
1291
1288
|
}
|
|
1292
1289
|
function xs(t, e) {
|
|
1293
|
-
return
|
|
1290
|
+
return rr(e)[t.weekday - 1];
|
|
1294
1291
|
}
|
|
1295
1292
|
function Es(t, e) {
|
|
1296
|
-
return
|
|
1293
|
+
return er(e)[t.month - 1];
|
|
1294
|
+
}
|
|
1295
|
+
function bs(t, e) {
|
|
1296
|
+
return ir(e)[t.year < 0 ? 0 : 1];
|
|
1297
1297
|
}
|
|
1298
|
-
function
|
|
1298
|
+
function Fs(t, e, n = "always", r = !1) {
|
|
1299
1299
|
const s = {
|
|
1300
1300
|
years: ["year", "yr."],
|
|
1301
1301
|
quarters: ["quarter", "qtr."],
|
|
@@ -1320,33 +1320,33 @@ function bs(t, e, n = "always", r = !1) {
|
|
|
1320
1320
|
const a = Object.is(e, -0) || e < 0, o = Math.abs(e), l = o === 1, u = s[t], d = r ? l ? u[1] : u[2] || u[1] : l ? s[t][0] : t;
|
|
1321
1321
|
return a ? `${o} ${d} ago` : `in ${o} ${d}`;
|
|
1322
1322
|
}
|
|
1323
|
-
function
|
|
1323
|
+
function ln(t, e) {
|
|
1324
1324
|
let n = "";
|
|
1325
1325
|
for (const r of t)
|
|
1326
1326
|
r.literal ? n += r.val : n += e(r.val);
|
|
1327
1327
|
return n;
|
|
1328
1328
|
}
|
|
1329
|
-
const
|
|
1330
|
-
D:
|
|
1331
|
-
DD:
|
|
1332
|
-
DDD:
|
|
1333
|
-
DDDD:
|
|
1334
|
-
t:
|
|
1335
|
-
tt:
|
|
1336
|
-
ttt:
|
|
1337
|
-
tttt:
|
|
1338
|
-
T:
|
|
1339
|
-
TT:
|
|
1340
|
-
TTT:
|
|
1341
|
-
TTTT:
|
|
1342
|
-
f:
|
|
1343
|
-
ff:
|
|
1344
|
-
fff:
|
|
1345
|
-
ffff:
|
|
1346
|
-
F:
|
|
1347
|
-
FF:
|
|
1348
|
-
FFF:
|
|
1349
|
-
FFFF:
|
|
1329
|
+
const Cs = {
|
|
1330
|
+
D: rt,
|
|
1331
|
+
DD: Mn,
|
|
1332
|
+
DDD: Dn,
|
|
1333
|
+
DDDD: Nn,
|
|
1334
|
+
t: In,
|
|
1335
|
+
tt: xn,
|
|
1336
|
+
ttt: En,
|
|
1337
|
+
tttt: bn,
|
|
1338
|
+
T: Fn,
|
|
1339
|
+
TT: Cn,
|
|
1340
|
+
TTT: Vn,
|
|
1341
|
+
TTTT: Wn,
|
|
1342
|
+
f: Ln,
|
|
1343
|
+
ff: Zn,
|
|
1344
|
+
fff: An,
|
|
1345
|
+
ffff: qn,
|
|
1346
|
+
F: $n,
|
|
1347
|
+
FF: zn,
|
|
1348
|
+
FFF: _n,
|
|
1349
|
+
FFFF: Rn
|
|
1350
1350
|
};
|
|
1351
1351
|
class V {
|
|
1352
1352
|
static create(e, n = {}) {
|
|
@@ -1362,7 +1362,7 @@ class V {
|
|
|
1362
1362
|
return r.length > 0 && i.push({ literal: s || /^\s+$/.test(r), val: r }), i;
|
|
1363
1363
|
}
|
|
1364
1364
|
static macroTokenToFormatOpts(e) {
|
|
1365
|
-
return
|
|
1365
|
+
return Cs[e];
|
|
1366
1366
|
}
|
|
1367
1367
|
constructor(e, n) {
|
|
1368
1368
|
this.opts = n, this.loc = e, this.systemLoc = null;
|
|
@@ -1392,13 +1392,13 @@ class V {
|
|
|
1392
1392
|
return n > 0 && (r.padTo = n), this.loc.numberFormatter(r).format(e);
|
|
1393
1393
|
}
|
|
1394
1394
|
formatDateTimeFromString(e, n) {
|
|
1395
|
-
const r = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (f, w) => this.loc.extract(e, f, w), a = (f) => e.isOffsetFixed && e.offset === 0 && f.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, f.format) : "", o = () => r ?
|
|
1395
|
+
const r = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (f, w) => this.loc.extract(e, f, w), a = (f) => e.isOffsetFixed && e.offset === 0 && f.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, f.format) : "", o = () => r ? Is(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (f, w) => r ? Es(e, f) : i(w ? { month: f } : { month: f, day: "numeric" }, "month"), u = (f, w) => r ? xs(e, f) : i(
|
|
1396
1396
|
w ? { weekday: f } : { weekday: f, month: "long", day: "numeric" },
|
|
1397
1397
|
"weekday"
|
|
1398
1398
|
), d = (f) => {
|
|
1399
1399
|
const w = V.macroTokenToFormatOpts(f);
|
|
1400
1400
|
return w ? this.formatWithSystemDefault(e, w) : f;
|
|
1401
|
-
}, m = (f) => r ?
|
|
1401
|
+
}, m = (f) => r ? bs(e, f) : i({ era: f }, "era"), O = (f) => {
|
|
1402
1402
|
switch (f) {
|
|
1403
1403
|
case "S":
|
|
1404
1404
|
return this.num(e.millisecond);
|
|
@@ -1525,7 +1525,7 @@ class V {
|
|
|
1525
1525
|
return d(f);
|
|
1526
1526
|
}
|
|
1527
1527
|
};
|
|
1528
|
-
return
|
|
1528
|
+
return ln(V.parseFormat(n), O);
|
|
1529
1529
|
}
|
|
1530
1530
|
formatDurationFromString(e, n) {
|
|
1531
1531
|
const r = (l) => {
|
|
@@ -1556,15 +1556,15 @@ class V {
|
|
|
1556
1556
|
(l, { literal: u, val: d }) => u ? l : l.concat(d),
|
|
1557
1557
|
[]
|
|
1558
1558
|
), o = e.shiftTo(...a.map(r).filter((l) => l));
|
|
1559
|
-
return
|
|
1559
|
+
return ln(i, s(o));
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
|
-
const
|
|
1562
|
+
const ar = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
1563
1563
|
function Oe(...t) {
|
|
1564
1564
|
const e = t.reduce((n, r) => n + r.source, "");
|
|
1565
1565
|
return RegExp(`^${e}$`);
|
|
1566
1566
|
}
|
|
1567
|
-
function
|
|
1567
|
+
function Me(...t) {
|
|
1568
1568
|
return (e) => t.reduce(
|
|
1569
1569
|
([n, r, s], i) => {
|
|
1570
1570
|
const [a, o, l] = i(e, s);
|
|
@@ -1573,7 +1573,7 @@ function Te(...t) {
|
|
|
1573
1573
|
[{}, null, 1]
|
|
1574
1574
|
).slice(0, 2);
|
|
1575
1575
|
}
|
|
1576
|
-
function
|
|
1576
|
+
function De(t, ...e) {
|
|
1577
1577
|
if (t == null)
|
|
1578
1578
|
return [null, null];
|
|
1579
1579
|
for (const [n, r] of e) {
|
|
@@ -1583,62 +1583,62 @@ function ve(t, ...e) {
|
|
|
1583
1583
|
}
|
|
1584
1584
|
return [null, null];
|
|
1585
1585
|
}
|
|
1586
|
-
function
|
|
1586
|
+
function or(...t) {
|
|
1587
1587
|
return (e, n) => {
|
|
1588
1588
|
const r = {};
|
|
1589
1589
|
let s;
|
|
1590
1590
|
for (s = 0; s < t.length; s++)
|
|
1591
|
-
r[t[s]] =
|
|
1591
|
+
r[t[s]] = ae(e[n + s]);
|
|
1592
1592
|
return [r, null, n + s];
|
|
1593
1593
|
};
|
|
1594
1594
|
}
|
|
1595
|
-
const
|
|
1596
|
-
`${
|
|
1597
|
-
),
|
|
1598
|
-
function
|
|
1595
|
+
const lr = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/, Vs = `(?:${lr.source}?(?:\\[(${ar.source})\\])?)?`, _t = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, ur = RegExp(`${_t.source}${Vs}`), qt = RegExp(`(?:T${ur.source})?`), Ws = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Ls = /(\d{4})-?W(\d\d)(?:-?(\d))?/, $s = /(\d{4})-?(\d{3})/, Zs = or("weekYear", "weekNumber", "weekDay"), zs = or("year", "ordinal"), As = /(\d{4})-(\d\d)-(\d\d)/, cr = RegExp(
|
|
1596
|
+
`${_t.source} ?(?:${lr.source}|(${ar.source}))?`
|
|
1597
|
+
), _s = RegExp(`(?: ${cr.source})?`);
|
|
1598
|
+
function Te(t, e, n) {
|
|
1599
1599
|
const r = t[e];
|
|
1600
|
-
return p(r) ? n :
|
|
1600
|
+
return p(r) ? n : ae(r);
|
|
1601
1601
|
}
|
|
1602
|
-
function
|
|
1602
|
+
function qs(t, e) {
|
|
1603
1603
|
return [{
|
|
1604
|
-
year:
|
|
1605
|
-
month:
|
|
1606
|
-
day:
|
|
1604
|
+
year: Te(t, e),
|
|
1605
|
+
month: Te(t, e + 1, 1),
|
|
1606
|
+
day: Te(t, e + 2, 1)
|
|
1607
1607
|
}, null, e + 3];
|
|
1608
1608
|
}
|
|
1609
|
-
function
|
|
1609
|
+
function Ne(t, e) {
|
|
1610
1610
|
return [{
|
|
1611
|
-
hours:
|
|
1612
|
-
minutes:
|
|
1613
|
-
seconds:
|
|
1614
|
-
milliseconds:
|
|
1611
|
+
hours: Te(t, e, 0),
|
|
1612
|
+
minutes: Te(t, e + 1, 0),
|
|
1613
|
+
seconds: Te(t, e + 2, 0),
|
|
1614
|
+
milliseconds: zt(t[e + 3])
|
|
1615
1615
|
}, null, e + 4];
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1618
|
-
const n = !t[e] && !t[e + 1], r =
|
|
1617
|
+
function qe(t, e) {
|
|
1618
|
+
const n = !t[e] && !t[e + 1], r = mt(t[e + 1], t[e + 2]), s = n ? null : W.instance(r);
|
|
1619
1619
|
return [{}, s, e + 3];
|
|
1620
1620
|
}
|
|
1621
|
-
function
|
|
1622
|
-
const n = t[e] ?
|
|
1621
|
+
function Re(t, e) {
|
|
1622
|
+
const n = t[e] ? ne.create(t[e]) : null;
|
|
1623
1623
|
return [{}, n, e + 1];
|
|
1624
1624
|
}
|
|
1625
|
-
const
|
|
1626
|
-
function
|
|
1627
|
-
const [e, n, r, s, i, a, o, l, u] = t, d = e[0] === "-", m = l && l[0] === "-",
|
|
1625
|
+
const Rs = RegExp(`^T?${_t.source}$`), Us = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
|
|
1626
|
+
function Hs(t) {
|
|
1627
|
+
const [e, n, r, s, i, a, o, l, u] = t, d = e[0] === "-", m = l && l[0] === "-", O = (f, w = !1) => f !== void 0 && (w || f && d) ? -f : f;
|
|
1628
1628
|
return [
|
|
1629
1629
|
{
|
|
1630
|
-
years:
|
|
1631
|
-
months:
|
|
1632
|
-
weeks:
|
|
1633
|
-
days:
|
|
1634
|
-
hours:
|
|
1635
|
-
minutes:
|
|
1636
|
-
seconds:
|
|
1637
|
-
milliseconds:
|
|
1630
|
+
years: O(ue(n)),
|
|
1631
|
+
months: O(ue(r)),
|
|
1632
|
+
weeks: O(ue(s)),
|
|
1633
|
+
days: O(ue(i)),
|
|
1634
|
+
hours: O(ue(a)),
|
|
1635
|
+
minutes: O(ue(o)),
|
|
1636
|
+
seconds: O(ue(l), l === "-0"),
|
|
1637
|
+
milliseconds: O(zt(u), m)
|
|
1638
1638
|
}
|
|
1639
1639
|
];
|
|
1640
1640
|
}
|
|
1641
|
-
const
|
|
1641
|
+
const Ys = {
|
|
1642
1642
|
GMT: 0,
|
|
1643
1643
|
EDT: -4 * 60,
|
|
1644
1644
|
EST: -5 * 60,
|
|
@@ -1649,18 +1649,18 @@ const Hs = {
|
|
|
1649
1649
|
PDT: -7 * 60,
|
|
1650
1650
|
PST: -8 * 60
|
|
1651
1651
|
};
|
|
1652
|
-
function
|
|
1652
|
+
function Rt(t, e, n, r, s, i, a) {
|
|
1653
1653
|
const o = {
|
|
1654
|
-
year: e.length === 2 ?
|
|
1655
|
-
month:
|
|
1656
|
-
day:
|
|
1657
|
-
hour:
|
|
1658
|
-
minute:
|
|
1654
|
+
year: e.length === 2 ? Ct(ae(e)) : ae(e),
|
|
1655
|
+
month: Xn.indexOf(n) + 1,
|
|
1656
|
+
day: ae(r),
|
|
1657
|
+
hour: ae(s),
|
|
1658
|
+
minute: ae(i)
|
|
1659
1659
|
};
|
|
1660
|
-
return a && (o.second =
|
|
1660
|
+
return a && (o.second = ae(a)), t && (o.weekday = t.length > 3 ? tr.indexOf(t) + 1 : nr.indexOf(t) + 1), o;
|
|
1661
1661
|
}
|
|
1662
|
-
const
|
|
1663
|
-
function
|
|
1662
|
+
const Ps = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
|
|
1663
|
+
function js(t) {
|
|
1664
1664
|
const [
|
|
1665
1665
|
,
|
|
1666
1666
|
e,
|
|
@@ -1674,82 +1674,82 @@ function Ps(t) {
|
|
|
1674
1674
|
u,
|
|
1675
1675
|
d,
|
|
1676
1676
|
m
|
|
1677
|
-
] = t,
|
|
1677
|
+
] = t, O = Rt(e, s, r, n, i, a, o);
|
|
1678
1678
|
let f;
|
|
1679
|
-
return l ? f =
|
|
1679
|
+
return l ? f = Ys[l] : u ? f = 0 : f = mt(d, m), [O, new W(f)];
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1681
|
+
function Gs(t) {
|
|
1682
1682
|
return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
1683
1683
|
}
|
|
1684
|
-
const
|
|
1685
|
-
function
|
|
1684
|
+
const Js = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/, Bs = /^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/, Ks = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
|
|
1685
|
+
function un(t) {
|
|
1686
1686
|
const [, e, n, r, s, i, a, o] = t;
|
|
1687
|
-
return [
|
|
1687
|
+
return [Rt(e, s, r, n, i, a, o), W.utcInstance];
|
|
1688
1688
|
}
|
|
1689
|
-
function
|
|
1689
|
+
function Qs(t) {
|
|
1690
1690
|
const [, e, n, r, s, i, a, o] = t;
|
|
1691
|
-
return [
|
|
1692
|
-
}
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
),
|
|
1699
|
-
$s,
|
|
1700
|
-
Me,
|
|
1701
|
-
_e,
|
|
1702
|
-
qe
|
|
1703
|
-
), ri = Te(
|
|
1691
|
+
return [Rt(e, o, n, r, s, i, a), W.utcInstance];
|
|
1692
|
+
}
|
|
1693
|
+
const Xs = Oe(Ws, qt), ei = Oe(Ls, qt), ti = Oe($s, qt), ni = Oe(ur), dr = Me(
|
|
1694
|
+
qs,
|
|
1695
|
+
Ne,
|
|
1696
|
+
qe,
|
|
1697
|
+
Re
|
|
1698
|
+
), ri = Me(
|
|
1704
1699
|
Zs,
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
), si =
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
qe
|
|
1700
|
+
Ne,
|
|
1701
|
+
qe,
|
|
1702
|
+
Re
|
|
1703
|
+
), si = Me(
|
|
1704
|
+
zs,
|
|
1705
|
+
Ne,
|
|
1706
|
+
qe,
|
|
1707
|
+
Re
|
|
1708
|
+
), ii = Me(
|
|
1709
|
+
Ne,
|
|
1710
|
+
qe,
|
|
1711
|
+
Re
|
|
1712
1712
|
);
|
|
1713
|
-
function
|
|
1714
|
-
return
|
|
1713
|
+
function ai(t) {
|
|
1714
|
+
return De(
|
|
1715
1715
|
t,
|
|
1716
|
-
[
|
|
1717
|
-
[Xs, ni],
|
|
1716
|
+
[Xs, dr],
|
|
1718
1717
|
[ei, ri],
|
|
1719
|
-
[ti, si]
|
|
1718
|
+
[ti, si],
|
|
1719
|
+
[ni, ii]
|
|
1720
1720
|
);
|
|
1721
1721
|
}
|
|
1722
|
-
function ai(t) {
|
|
1723
|
-
return ve(js(t), [Ys, Ps]);
|
|
1724
|
-
}
|
|
1725
1722
|
function oi(t) {
|
|
1726
|
-
return
|
|
1723
|
+
return De(Gs(t), [Ps, js]);
|
|
1724
|
+
}
|
|
1725
|
+
function li(t) {
|
|
1726
|
+
return De(
|
|
1727
1727
|
t,
|
|
1728
|
-
[
|
|
1729
|
-
[
|
|
1730
|
-
[
|
|
1728
|
+
[Js, un],
|
|
1729
|
+
[Bs, un],
|
|
1730
|
+
[Ks, Qs]
|
|
1731
1731
|
);
|
|
1732
1732
|
}
|
|
1733
|
-
function
|
|
1734
|
-
return
|
|
1733
|
+
function ui(t) {
|
|
1734
|
+
return De(t, [Us, Hs]);
|
|
1735
1735
|
}
|
|
1736
|
-
const
|
|
1737
|
-
function
|
|
1738
|
-
return
|
|
1736
|
+
const ci = Me(Ne);
|
|
1737
|
+
function di(t) {
|
|
1738
|
+
return De(t, [Rs, ci]);
|
|
1739
1739
|
}
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1740
|
+
const fi = Oe(As, _s), hi = Oe(cr), mi = Me(
|
|
1741
|
+
Ne,
|
|
1742
|
+
qe,
|
|
1743
|
+
Re
|
|
1744
1744
|
);
|
|
1745
|
-
function
|
|
1746
|
-
return
|
|
1745
|
+
function yi(t) {
|
|
1746
|
+
return De(
|
|
1747
1747
|
t,
|
|
1748
|
-
[
|
|
1749
|
-
[
|
|
1748
|
+
[fi, dr],
|
|
1749
|
+
[hi, mi]
|
|
1750
1750
|
);
|
|
1751
1751
|
}
|
|
1752
|
-
const
|
|
1752
|
+
const cn = "Invalid Duration", fr = {
|
|
1753
1753
|
weeks: {
|
|
1754
1754
|
days: 7,
|
|
1755
1755
|
hours: 7 * 24,
|
|
@@ -1766,7 +1766,7 @@ const un = "Invalid Duration", dr = {
|
|
|
1766
1766
|
hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
|
|
1767
1767
|
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
|
|
1768
1768
|
seconds: { milliseconds: 1e3 }
|
|
1769
|
-
},
|
|
1769
|
+
}, gi = {
|
|
1770
1770
|
years: {
|
|
1771
1771
|
quarters: 4,
|
|
1772
1772
|
months: 12,
|
|
@@ -1794,37 +1794,37 @@ const un = "Invalid Duration", dr = {
|
|
|
1794
1794
|
seconds: 30 * 24 * 60 * 60,
|
|
1795
1795
|
milliseconds: 30 * 24 * 60 * 60 * 1e3
|
|
1796
1796
|
},
|
|
1797
|
-
...
|
|
1798
|
-
},
|
|
1797
|
+
...fr
|
|
1798
|
+
}, R = 146097 / 400, we = 146097 / 4800, wi = {
|
|
1799
1799
|
years: {
|
|
1800
1800
|
quarters: 4,
|
|
1801
1801
|
months: 12,
|
|
1802
|
-
weeks:
|
|
1803
|
-
days:
|
|
1804
|
-
hours:
|
|
1805
|
-
minutes:
|
|
1806
|
-
seconds:
|
|
1807
|
-
milliseconds:
|
|
1802
|
+
weeks: R / 7,
|
|
1803
|
+
days: R,
|
|
1804
|
+
hours: R * 24,
|
|
1805
|
+
minutes: R * 24 * 60,
|
|
1806
|
+
seconds: R * 24 * 60 * 60,
|
|
1807
|
+
milliseconds: R * 24 * 60 * 60 * 1e3
|
|
1808
1808
|
},
|
|
1809
1809
|
quarters: {
|
|
1810
1810
|
months: 3,
|
|
1811
|
-
weeks:
|
|
1812
|
-
days:
|
|
1813
|
-
hours:
|
|
1814
|
-
minutes:
|
|
1815
|
-
seconds:
|
|
1816
|
-
milliseconds:
|
|
1811
|
+
weeks: R / 28,
|
|
1812
|
+
days: R / 4,
|
|
1813
|
+
hours: R * 24 / 4,
|
|
1814
|
+
minutes: R * 24 * 60 / 4,
|
|
1815
|
+
seconds: R * 24 * 60 * 60 / 4,
|
|
1816
|
+
milliseconds: R * 24 * 60 * 60 * 1e3 / 4
|
|
1817
1817
|
},
|
|
1818
1818
|
months: {
|
|
1819
|
-
weeks:
|
|
1820
|
-
days:
|
|
1821
|
-
hours:
|
|
1822
|
-
minutes:
|
|
1823
|
-
seconds:
|
|
1824
|
-
milliseconds:
|
|
1819
|
+
weeks: we / 7,
|
|
1820
|
+
days: we,
|
|
1821
|
+
hours: we * 24,
|
|
1822
|
+
minutes: we * 24 * 60,
|
|
1823
|
+
seconds: we * 24 * 60 * 60,
|
|
1824
|
+
milliseconds: we * 24 * 60 * 60 * 1e3
|
|
1825
1825
|
},
|
|
1826
|
-
...
|
|
1827
|
-
},
|
|
1826
|
+
...fr
|
|
1827
|
+
}, de = [
|
|
1828
1828
|
"years",
|
|
1829
1829
|
"quarters",
|
|
1830
1830
|
"months",
|
|
@@ -1834,25 +1834,25 @@ const un = "Invalid Duration", dr = {
|
|
|
1834
1834
|
"minutes",
|
|
1835
1835
|
"seconds",
|
|
1836
1836
|
"milliseconds"
|
|
1837
|
-
],
|
|
1838
|
-
function
|
|
1837
|
+
], pi = de.slice(0).reverse();
|
|
1838
|
+
function se(t, e, n = !1) {
|
|
1839
1839
|
const r = {
|
|
1840
1840
|
values: n ? e.values : { ...t.values, ...e.values || {} },
|
|
1841
1841
|
loc: t.loc.clone(e.loc),
|
|
1842
1842
|
conversionAccuracy: e.conversionAccuracy || t.conversionAccuracy,
|
|
1843
1843
|
matrix: e.matrix || t.matrix
|
|
1844
1844
|
};
|
|
1845
|
-
return new
|
|
1845
|
+
return new v(r);
|
|
1846
1846
|
}
|
|
1847
|
-
function
|
|
1847
|
+
function hr(t, e) {
|
|
1848
1848
|
let n = e.milliseconds ?? 0;
|
|
1849
|
-
for (const r of
|
|
1849
|
+
for (const r of pi.slice(1))
|
|
1850
1850
|
e[r] && (n += e[r] * t[r].milliseconds);
|
|
1851
1851
|
return n;
|
|
1852
1852
|
}
|
|
1853
|
-
function
|
|
1854
|
-
const n =
|
|
1855
|
-
|
|
1853
|
+
function dn(t, e) {
|
|
1854
|
+
const n = hr(t, e) < 0 ? -1 : 1;
|
|
1855
|
+
de.reduceRight((r, s) => {
|
|
1856
1856
|
if (p(e[s]))
|
|
1857
1857
|
return r;
|
|
1858
1858
|
if (r) {
|
|
@@ -1860,7 +1860,7 @@ function cn(t, e) {
|
|
|
1860
1860
|
e[s] += o * n, e[r] -= o * a * n;
|
|
1861
1861
|
}
|
|
1862
1862
|
return s;
|
|
1863
|
-
}, null),
|
|
1863
|
+
}, null), de.reduce((r, s) => {
|
|
1864
1864
|
if (p(e[s]))
|
|
1865
1865
|
return r;
|
|
1866
1866
|
if (r) {
|
|
@@ -1870,19 +1870,19 @@ function cn(t, e) {
|
|
|
1870
1870
|
return s;
|
|
1871
1871
|
}, null);
|
|
1872
1872
|
}
|
|
1873
|
-
function
|
|
1873
|
+
function ki(t) {
|
|
1874
1874
|
const e = {};
|
|
1875
1875
|
for (const [n, r] of Object.entries(t))
|
|
1876
1876
|
r !== 0 && (e[n] = r);
|
|
1877
1877
|
return e;
|
|
1878
1878
|
}
|
|
1879
|
-
class
|
|
1879
|
+
class v {
|
|
1880
1880
|
/**
|
|
1881
1881
|
* @private
|
|
1882
1882
|
*/
|
|
1883
1883
|
constructor(e) {
|
|
1884
1884
|
const n = e.conversionAccuracy === "longterm" || !1;
|
|
1885
|
-
let r = n ?
|
|
1885
|
+
let r = n ? wi : gi;
|
|
1886
1886
|
e.matrix && (r = e.matrix), this.values = e.values, this.loc = e.loc || D.create(), this.conversionAccuracy = n ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = r, this.isLuxonDuration = !0;
|
|
1887
1887
|
}
|
|
1888
1888
|
/**
|
|
@@ -1895,7 +1895,7 @@ class T {
|
|
|
1895
1895
|
* @return {Duration}
|
|
1896
1896
|
*/
|
|
1897
1897
|
static fromMillis(e, n) {
|
|
1898
|
-
return
|
|
1898
|
+
return v.fromObject({ milliseconds: e }, n);
|
|
1899
1899
|
}
|
|
1900
1900
|
/**
|
|
1901
1901
|
* Create a Duration from a JavaScript object with keys like 'years' and 'hours'.
|
|
@@ -1919,11 +1919,11 @@ class T {
|
|
|
1919
1919
|
*/
|
|
1920
1920
|
static fromObject(e, n = {}) {
|
|
1921
1921
|
if (e == null || typeof e != "object")
|
|
1922
|
-
throw new
|
|
1922
|
+
throw new Z(
|
|
1923
1923
|
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
|
|
1924
1924
|
);
|
|
1925
|
-
return new
|
|
1926
|
-
values:
|
|
1925
|
+
return new v({
|
|
1926
|
+
values: at(e, v.normalizeUnit),
|
|
1927
1927
|
loc: D.fromObject(n),
|
|
1928
1928
|
conversionAccuracy: n.conversionAccuracy,
|
|
1929
1929
|
matrix: n.matrix
|
|
@@ -1940,13 +1940,13 @@ class T {
|
|
|
1940
1940
|
* @return {Duration}
|
|
1941
1941
|
*/
|
|
1942
1942
|
static fromDurationLike(e) {
|
|
1943
|
-
if (
|
|
1944
|
-
return
|
|
1945
|
-
if (
|
|
1943
|
+
if (fe(e))
|
|
1944
|
+
return v.fromMillis(e);
|
|
1945
|
+
if (v.isDuration(e))
|
|
1946
1946
|
return e;
|
|
1947
1947
|
if (typeof e == "object")
|
|
1948
|
-
return
|
|
1949
|
-
throw new
|
|
1948
|
+
return v.fromObject(e);
|
|
1949
|
+
throw new Z(
|
|
1950
1950
|
`Unknown duration argument ${e} of type ${typeof e}`
|
|
1951
1951
|
);
|
|
1952
1952
|
}
|
|
@@ -1965,8 +1965,8 @@ class T {
|
|
|
1965
1965
|
* @return {Duration}
|
|
1966
1966
|
*/
|
|
1967
1967
|
static fromISO(e, n) {
|
|
1968
|
-
const [r] =
|
|
1969
|
-
return r ?
|
|
1968
|
+
const [r] = ui(e);
|
|
1969
|
+
return r ? v.fromObject(r, n) : v.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
1970
1970
|
}
|
|
1971
1971
|
/**
|
|
1972
1972
|
* Create a Duration from an ISO 8601 time string.
|
|
@@ -1985,8 +1985,8 @@ class T {
|
|
|
1985
1985
|
* @return {Duration}
|
|
1986
1986
|
*/
|
|
1987
1987
|
static fromISOTime(e, n) {
|
|
1988
|
-
const [r] =
|
|
1989
|
-
return r ?
|
|
1988
|
+
const [r] = di(e);
|
|
1989
|
+
return r ? v.fromObject(r, n) : v.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
1990
1990
|
}
|
|
1991
1991
|
/**
|
|
1992
1992
|
* Create an invalid Duration.
|
|
@@ -1996,11 +1996,11 @@ class T {
|
|
|
1996
1996
|
*/
|
|
1997
1997
|
static invalid(e, n = null) {
|
|
1998
1998
|
if (!e)
|
|
1999
|
-
throw new
|
|
2000
|
-
const r = e instanceof
|
|
1999
|
+
throw new Z("need to specify a reason the Duration is invalid");
|
|
2000
|
+
const r = e instanceof K ? e : new K(e, n);
|
|
2001
2001
|
if (x.throwOnInvalid)
|
|
2002
|
-
throw new
|
|
2003
|
-
return new
|
|
2002
|
+
throw new Pr(r);
|
|
2003
|
+
return new v({ invalid: r });
|
|
2004
2004
|
}
|
|
2005
2005
|
/**
|
|
2006
2006
|
* @private
|
|
@@ -2027,7 +2027,7 @@ class T {
|
|
|
2027
2027
|
milliseconds: "milliseconds"
|
|
2028
2028
|
}[e && e.toLowerCase()];
|
|
2029
2029
|
if (!n)
|
|
2030
|
-
throw new
|
|
2030
|
+
throw new On(e);
|
|
2031
2031
|
return n;
|
|
2032
2032
|
}
|
|
2033
2033
|
/**
|
|
@@ -2080,7 +2080,7 @@ class T {
|
|
|
2080
2080
|
...n,
|
|
2081
2081
|
floor: n.round !== !1 && n.floor !== !1
|
|
2082
2082
|
};
|
|
2083
|
-
return this.isValid ? V.create(this.loc, r).formatDurationFromString(this, e) :
|
|
2083
|
+
return this.isValid ? V.create(this.loc, r).formatDurationFromString(this, e) : cn;
|
|
2084
2084
|
}
|
|
2085
2085
|
/**
|
|
2086
2086
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -2098,8 +2098,8 @@ class T {
|
|
|
2098
2098
|
*/
|
|
2099
2099
|
toHuman(e = {}) {
|
|
2100
2100
|
if (!this.isValid)
|
|
2101
|
-
return
|
|
2102
|
-
const n =
|
|
2101
|
+
return cn;
|
|
2102
|
+
const n = de.map((r) => {
|
|
2103
2103
|
const s = this.values[r];
|
|
2104
2104
|
return p(s) ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: r.slice(0, -1) }).format(s);
|
|
2105
2105
|
}).filter((r) => r);
|
|
@@ -2127,7 +2127,7 @@ class T {
|
|
|
2127
2127
|
if (!this.isValid)
|
|
2128
2128
|
return null;
|
|
2129
2129
|
let e = "P";
|
|
2130
|
-
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e +=
|
|
2130
|
+
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += At(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
|
|
2131
2131
|
}
|
|
2132
2132
|
/**
|
|
2133
2133
|
* Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.
|
|
@@ -2184,7 +2184,7 @@ class T {
|
|
|
2184
2184
|
* @return {number}
|
|
2185
2185
|
*/
|
|
2186
2186
|
toMillis() {
|
|
2187
|
-
return this.isValid ?
|
|
2187
|
+
return this.isValid ? hr(this.matrix, this.values) : NaN;
|
|
2188
2188
|
}
|
|
2189
2189
|
/**
|
|
2190
2190
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -2201,10 +2201,10 @@ class T {
|
|
|
2201
2201
|
plus(e) {
|
|
2202
2202
|
if (!this.isValid)
|
|
2203
2203
|
return this;
|
|
2204
|
-
const n =
|
|
2205
|
-
for (const s of
|
|
2206
|
-
(
|
|
2207
|
-
return
|
|
2204
|
+
const n = v.fromDurationLike(e), r = {};
|
|
2205
|
+
for (const s of de)
|
|
2206
|
+
(ve(n.values, s) || ve(this.values, s)) && (r[s] = n.get(s) + this.get(s));
|
|
2207
|
+
return se(this, { values: r }, !0);
|
|
2208
2208
|
}
|
|
2209
2209
|
/**
|
|
2210
2210
|
* Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
|
|
@@ -2214,7 +2214,7 @@ class T {
|
|
|
2214
2214
|
minus(e) {
|
|
2215
2215
|
if (!this.isValid)
|
|
2216
2216
|
return this;
|
|
2217
|
-
const n =
|
|
2217
|
+
const n = v.fromDurationLike(e);
|
|
2218
2218
|
return this.plus(n.negate());
|
|
2219
2219
|
}
|
|
2220
2220
|
/**
|
|
@@ -2229,8 +2229,8 @@ class T {
|
|
|
2229
2229
|
return this;
|
|
2230
2230
|
const n = {};
|
|
2231
2231
|
for (const r of Object.keys(this.values))
|
|
2232
|
-
n[r] =
|
|
2233
|
-
return
|
|
2232
|
+
n[r] = Qn(e(this.values[r], r));
|
|
2233
|
+
return se(this, { values: n }, !0);
|
|
2234
2234
|
}
|
|
2235
2235
|
/**
|
|
2236
2236
|
* Get the value of unit.
|
|
@@ -2241,7 +2241,7 @@ class T {
|
|
|
2241
2241
|
* @return {number}
|
|
2242
2242
|
*/
|
|
2243
2243
|
get(e) {
|
|
2244
|
-
return this[
|
|
2244
|
+
return this[v.normalizeUnit(e)];
|
|
2245
2245
|
}
|
|
2246
2246
|
/**
|
|
2247
2247
|
* "Set" the values of specified units. Return a newly-constructed Duration.
|
|
@@ -2253,8 +2253,8 @@ class T {
|
|
|
2253
2253
|
set(e) {
|
|
2254
2254
|
if (!this.isValid)
|
|
2255
2255
|
return this;
|
|
2256
|
-
const n = { ...this.values, ...
|
|
2257
|
-
return
|
|
2256
|
+
const n = { ...this.values, ...at(e, v.normalizeUnit) };
|
|
2257
|
+
return se(this, { values: n });
|
|
2258
2258
|
}
|
|
2259
2259
|
/**
|
|
2260
2260
|
* "Set" the locale and/or numberingSystem. Returns a newly-constructed Duration.
|
|
@@ -2263,7 +2263,7 @@ class T {
|
|
|
2263
2263
|
*/
|
|
2264
2264
|
reconfigure({ locale: e, numberingSystem: n, conversionAccuracy: r, matrix: s } = {}) {
|
|
2265
2265
|
const a = { loc: this.loc.clone({ locale: e, numberingSystem: n }), matrix: s, conversionAccuracy: r };
|
|
2266
|
-
return
|
|
2266
|
+
return se(this, a);
|
|
2267
2267
|
}
|
|
2268
2268
|
/**
|
|
2269
2269
|
* Return the length of the duration in the specified unit.
|
|
@@ -2295,7 +2295,7 @@ class T {
|
|
|
2295
2295
|
if (!this.isValid)
|
|
2296
2296
|
return this;
|
|
2297
2297
|
const e = this.toObject();
|
|
2298
|
-
return
|
|
2298
|
+
return dn(this.matrix, e), se(this, { values: e }, !0);
|
|
2299
2299
|
}
|
|
2300
2300
|
/**
|
|
2301
2301
|
* Rescale units to its largest representation
|
|
@@ -2305,8 +2305,8 @@ class T {
|
|
|
2305
2305
|
rescale() {
|
|
2306
2306
|
if (!this.isValid)
|
|
2307
2307
|
return this;
|
|
2308
|
-
const e =
|
|
2309
|
-
return
|
|
2308
|
+
const e = ki(this.normalize().shiftToAll().toObject());
|
|
2309
|
+
return se(this, { values: e }, !0);
|
|
2310
2310
|
}
|
|
2311
2311
|
/**
|
|
2312
2312
|
* Convert this Duration into its representation in a different set of units.
|
|
@@ -2318,23 +2318,23 @@ class T {
|
|
|
2318
2318
|
return this;
|
|
2319
2319
|
if (e.length === 0)
|
|
2320
2320
|
return this;
|
|
2321
|
-
e = e.map((a) =>
|
|
2321
|
+
e = e.map((a) => v.normalizeUnit(a));
|
|
2322
2322
|
const n = {}, r = {}, s = this.toObject();
|
|
2323
2323
|
let i;
|
|
2324
|
-
for (const a of
|
|
2324
|
+
for (const a of de)
|
|
2325
2325
|
if (e.indexOf(a) >= 0) {
|
|
2326
2326
|
i = a;
|
|
2327
2327
|
let o = 0;
|
|
2328
2328
|
for (const u in r)
|
|
2329
2329
|
o += this.matrix[u][a] * r[u], r[u] = 0;
|
|
2330
|
-
|
|
2330
|
+
fe(s[a]) && (o += s[a]);
|
|
2331
2331
|
const l = Math.trunc(o);
|
|
2332
2332
|
n[a] = l, r[a] = (o * 1e3 - l * 1e3) / 1e3;
|
|
2333
2333
|
} else
|
|
2334
|
-
|
|
2334
|
+
fe(s[a]) && (r[a] = s[a]);
|
|
2335
2335
|
for (const a in r)
|
|
2336
2336
|
r[a] !== 0 && (n[i] += a === i ? r[a] : r[a] / this.matrix[i][a]);
|
|
2337
|
-
return
|
|
2337
|
+
return dn(this.matrix, n), se(this, { values: n }, !0);
|
|
2338
2338
|
}
|
|
2339
2339
|
/**
|
|
2340
2340
|
* Shift this Duration to all available units.
|
|
@@ -2364,7 +2364,7 @@ class T {
|
|
|
2364
2364
|
const e = {};
|
|
2365
2365
|
for (const n of Object.keys(this.values))
|
|
2366
2366
|
e[n] = this.values[n] === 0 ? 0 : -this.values[n];
|
|
2367
|
-
return
|
|
2367
|
+
return se(this, { values: e }, !0);
|
|
2368
2368
|
}
|
|
2369
2369
|
/**
|
|
2370
2370
|
* Get the years.
|
|
@@ -2463,14 +2463,14 @@ class T {
|
|
|
2463
2463
|
function n(r, s) {
|
|
2464
2464
|
return r === void 0 || r === 0 ? s === void 0 || s === 0 : r === s;
|
|
2465
2465
|
}
|
|
2466
|
-
for (const r of
|
|
2466
|
+
for (const r of de)
|
|
2467
2467
|
if (!n(this.values[r], e.values[r]))
|
|
2468
2468
|
return !1;
|
|
2469
2469
|
return !0;
|
|
2470
2470
|
}
|
|
2471
2471
|
}
|
|
2472
|
-
const
|
|
2473
|
-
function
|
|
2472
|
+
const pe = "Invalid Interval";
|
|
2473
|
+
function Si(t, e) {
|
|
2474
2474
|
return !t || !t.isValid ? I.invalid("missing or invalid start") : !e || !e.isValid ? I.invalid("missing or invalid end") : e < t ? I.invalid(
|
|
2475
2475
|
"end before start",
|
|
2476
2476
|
`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`
|
|
@@ -2491,10 +2491,10 @@ class I {
|
|
|
2491
2491
|
*/
|
|
2492
2492
|
static invalid(e, n = null) {
|
|
2493
2493
|
if (!e)
|
|
2494
|
-
throw new
|
|
2495
|
-
const r = e instanceof
|
|
2494
|
+
throw new Z("need to specify a reason the Interval is invalid");
|
|
2495
|
+
const r = e instanceof K ? e : new K(e, n);
|
|
2496
2496
|
if (x.throwOnInvalid)
|
|
2497
|
-
throw new
|
|
2497
|
+
throw new Yr(r);
|
|
2498
2498
|
return new I({ invalid: r });
|
|
2499
2499
|
}
|
|
2500
2500
|
/**
|
|
@@ -2504,7 +2504,7 @@ class I {
|
|
|
2504
2504
|
* @return {Interval}
|
|
2505
2505
|
*/
|
|
2506
2506
|
static fromDateTimes(e, n) {
|
|
2507
|
-
const r =
|
|
2507
|
+
const r = Fe(e), s = Fe(n), i = Si(r, s);
|
|
2508
2508
|
return i ?? new I({
|
|
2509
2509
|
start: r,
|
|
2510
2510
|
end: s
|
|
@@ -2517,7 +2517,7 @@ class I {
|
|
|
2517
2517
|
* @return {Interval}
|
|
2518
2518
|
*/
|
|
2519
2519
|
static after(e, n) {
|
|
2520
|
-
const r =
|
|
2520
|
+
const r = v.fromDurationLike(n), s = Fe(e);
|
|
2521
2521
|
return I.fromDateTimes(s, s.plus(r));
|
|
2522
2522
|
}
|
|
2523
2523
|
/**
|
|
@@ -2527,7 +2527,7 @@ class I {
|
|
|
2527
2527
|
* @return {Interval}
|
|
2528
2528
|
*/
|
|
2529
2529
|
static before(e, n) {
|
|
2530
|
-
const r =
|
|
2530
|
+
const r = v.fromDurationLike(n), s = Fe(e);
|
|
2531
2531
|
return I.fromDateTimes(s.minus(r), s);
|
|
2532
2532
|
}
|
|
2533
2533
|
/**
|
|
@@ -2556,11 +2556,11 @@ class I {
|
|
|
2556
2556
|
if (a && l)
|
|
2557
2557
|
return I.fromDateTimes(i, o);
|
|
2558
2558
|
if (a) {
|
|
2559
|
-
const u =
|
|
2559
|
+
const u = v.fromISO(s, n);
|
|
2560
2560
|
if (u.isValid)
|
|
2561
2561
|
return I.after(i, u);
|
|
2562
2562
|
} else if (l) {
|
|
2563
|
-
const u =
|
|
2563
|
+
const u = v.fromISO(r, n);
|
|
2564
2564
|
if (u.isValid)
|
|
2565
2565
|
return I.before(o, u);
|
|
2566
2566
|
}
|
|
@@ -2691,7 +2691,7 @@ class I {
|
|
|
2691
2691
|
splitAt(...e) {
|
|
2692
2692
|
if (!this.isValid)
|
|
2693
2693
|
return [];
|
|
2694
|
-
const n = e.map(
|
|
2694
|
+
const n = e.map(Fe).filter((a) => this.contains(a)).sort((a, o) => a.toMillis() - o.toMillis()), r = [];
|
|
2695
2695
|
let { s } = this, i = 0;
|
|
2696
2696
|
for (; s < this.e; ) {
|
|
2697
2697
|
const a = n[i] || this.e, o = +a > +this.e ? this.e : a;
|
|
@@ -2706,7 +2706,7 @@ class I {
|
|
|
2706
2706
|
* @return {Array}
|
|
2707
2707
|
*/
|
|
2708
2708
|
splitBy(e) {
|
|
2709
|
-
const n =
|
|
2709
|
+
const n = v.fromDurationLike(e);
|
|
2710
2710
|
if (!this.isValid || !n.isValid || n.as("milliseconds") === 0)
|
|
2711
2711
|
return [];
|
|
2712
2712
|
let { s: r } = this, s = 1, i;
|
|
@@ -2831,7 +2831,7 @@ class I {
|
|
|
2831
2831
|
* @return {string}
|
|
2832
2832
|
*/
|
|
2833
2833
|
toString() {
|
|
2834
|
-
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` :
|
|
2834
|
+
return this.isValid ? `[${this.s.toISO()} – ${this.e.toISO()})` : pe;
|
|
2835
2835
|
}
|
|
2836
2836
|
/**
|
|
2837
2837
|
* Returns a string representation of this Interval appropriate for the REPL.
|
|
@@ -2858,8 +2858,8 @@ class I {
|
|
|
2858
2858
|
* @example Interval.fromISO('2022-11-07T17:00Z/2022-11-07T19:00Z').toLocaleString({ weekday: 'short', month: 'short', day: '2-digit', hour: '2-digit', minute: '2-digit' }); //=> Mon, Nov 07, 6:00 – 8:00 p
|
|
2859
2859
|
* @return {string}
|
|
2860
2860
|
*/
|
|
2861
|
-
toLocaleString(e =
|
|
2862
|
-
return this.isValid ? V.create(this.s.loc.clone(n), e).formatInterval(this) :
|
|
2861
|
+
toLocaleString(e = rt, n = {}) {
|
|
2862
|
+
return this.isValid ? V.create(this.s.loc.clone(n), e).formatInterval(this) : pe;
|
|
2863
2863
|
}
|
|
2864
2864
|
/**
|
|
2865
2865
|
* Returns an ISO 8601-compliant string representation of this Interval.
|
|
@@ -2868,7 +2868,7 @@ class I {
|
|
|
2868
2868
|
* @return {string}
|
|
2869
2869
|
*/
|
|
2870
2870
|
toISO(e) {
|
|
2871
|
-
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` :
|
|
2871
|
+
return this.isValid ? `${this.s.toISO(e)}/${this.e.toISO(e)}` : pe;
|
|
2872
2872
|
}
|
|
2873
2873
|
/**
|
|
2874
2874
|
* Returns an ISO 8601-compliant string representation of date of this Interval.
|
|
@@ -2877,7 +2877,7 @@ class I {
|
|
|
2877
2877
|
* @return {string}
|
|
2878
2878
|
*/
|
|
2879
2879
|
toISODate() {
|
|
2880
|
-
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` :
|
|
2880
|
+
return this.isValid ? `${this.s.toISODate()}/${this.e.toISODate()}` : pe;
|
|
2881
2881
|
}
|
|
2882
2882
|
/**
|
|
2883
2883
|
* Returns an ISO 8601-compliant string representation of time of this Interval.
|
|
@@ -2887,7 +2887,7 @@ class I {
|
|
|
2887
2887
|
* @return {string}
|
|
2888
2888
|
*/
|
|
2889
2889
|
toISOTime(e) {
|
|
2890
|
-
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` :
|
|
2890
|
+
return this.isValid ? `${this.s.toISOTime(e)}/${this.e.toISOTime(e)}` : pe;
|
|
2891
2891
|
}
|
|
2892
2892
|
/**
|
|
2893
2893
|
* Returns a string representation of this Interval formatted according to the specified format
|
|
@@ -2901,7 +2901,7 @@ class I {
|
|
|
2901
2901
|
* @return {string}
|
|
2902
2902
|
*/
|
|
2903
2903
|
toFormat(e, { separator: n = " – " } = {}) {
|
|
2904
|
-
return this.isValid ? `${this.s.toFormat(e)}${n}${this.e.toFormat(e)}` :
|
|
2904
|
+
return this.isValid ? `${this.s.toFormat(e)}${n}${this.e.toFormat(e)}` : pe;
|
|
2905
2905
|
}
|
|
2906
2906
|
/**
|
|
2907
2907
|
* Return a Duration representing the time spanned by this interval.
|
|
@@ -2916,7 +2916,7 @@ class I {
|
|
|
2916
2916
|
* @return {Duration}
|
|
2917
2917
|
*/
|
|
2918
2918
|
toDuration(e, n) {
|
|
2919
|
-
return this.isValid ? this.e.diff(this.s, e, n) :
|
|
2919
|
+
return this.isValid ? this.e.diff(this.s, e, n) : v.invalid(this.invalidReason);
|
|
2920
2920
|
}
|
|
2921
2921
|
/**
|
|
2922
2922
|
* Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes
|
|
@@ -2929,7 +2929,7 @@ class I {
|
|
|
2929
2929
|
return I.fromDateTimes(e(this.s), e(this.e));
|
|
2930
2930
|
}
|
|
2931
2931
|
}
|
|
2932
|
-
class
|
|
2932
|
+
class Ve {
|
|
2933
2933
|
/**
|
|
2934
2934
|
* Return whether the specified zone contains a DST.
|
|
2935
2935
|
* @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.
|
|
@@ -2945,7 +2945,7 @@ class Ce {
|
|
|
2945
2945
|
* @return {boolean}
|
|
2946
2946
|
*/
|
|
2947
2947
|
static isValidIANAZone(e) {
|
|
2948
|
-
return
|
|
2948
|
+
return ne.isValidZone(e);
|
|
2949
2949
|
}
|
|
2950
2950
|
/**
|
|
2951
2951
|
* Converts the input into a {@link Zone} instance.
|
|
@@ -2962,7 +2962,7 @@ class Ce {
|
|
|
2962
2962
|
* @return {Zone}
|
|
2963
2963
|
*/
|
|
2964
2964
|
static normalizeZone(e) {
|
|
2965
|
-
return
|
|
2965
|
+
return oe(e, x.defaultZone);
|
|
2966
2966
|
}
|
|
2967
2967
|
/**
|
|
2968
2968
|
* Get the weekday on which the week starts according to the given locale.
|
|
@@ -3097,14 +3097,14 @@ class Ce {
|
|
|
3097
3097
|
* @return {Object}
|
|
3098
3098
|
*/
|
|
3099
3099
|
static features() {
|
|
3100
|
-
return { relative:
|
|
3100
|
+
return { relative: Jn(), localeWeek: Bn() };
|
|
3101
3101
|
}
|
|
3102
3102
|
}
|
|
3103
|
-
function
|
|
3103
|
+
function fn(t, e) {
|
|
3104
3104
|
const n = (s) => s.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), r = n(e) - n(t);
|
|
3105
|
-
return Math.floor(
|
|
3105
|
+
return Math.floor(v.fromMillis(r).as("days"));
|
|
3106
3106
|
}
|
|
3107
|
-
function
|
|
3107
|
+
function Ti(t, e, n) {
|
|
3108
3108
|
const r = [
|
|
3109
3109
|
["years", (l, u) => u.year - l.year],
|
|
3110
3110
|
["quarters", (l, u) => u.quarter - l.quarter + (u.year - l.year) * 4],
|
|
@@ -3112,25 +3112,25 @@ function Si(t, e, n) {
|
|
|
3112
3112
|
[
|
|
3113
3113
|
"weeks",
|
|
3114
3114
|
(l, u) => {
|
|
3115
|
-
const d =
|
|
3115
|
+
const d = fn(l, u);
|
|
3116
3116
|
return (d - d % 7) / 7;
|
|
3117
3117
|
}
|
|
3118
3118
|
],
|
|
3119
|
-
["days",
|
|
3119
|
+
["days", fn]
|
|
3120
3120
|
], s = {}, i = t;
|
|
3121
3121
|
let a, o;
|
|
3122
3122
|
for (const [l, u] of r)
|
|
3123
3123
|
n.indexOf(l) >= 0 && (a = l, s[l] = u(t, e), o = i.plus(s), o > e ? (s[l]--, t = i.plus(s), t > e && (o = t, s[l]--, t = i.plus(s))) : t = o);
|
|
3124
3124
|
return [t, s, o, a];
|
|
3125
3125
|
}
|
|
3126
|
-
function
|
|
3127
|
-
let [s, i, a, o] =
|
|
3126
|
+
function vi(t, e, n, r) {
|
|
3127
|
+
let [s, i, a, o] = Ti(t, e, n);
|
|
3128
3128
|
const l = e - s, u = n.filter(
|
|
3129
3129
|
(m) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(m) >= 0
|
|
3130
3130
|
);
|
|
3131
3131
|
u.length === 0 && (a < e && (a = s.plus({ [o]: 1 })), a !== s && (i[o] = (i[o] || 0) + l / (a - s)));
|
|
3132
|
-
const d =
|
|
3133
|
-
return u.length > 0 ?
|
|
3132
|
+
const d = v.fromObject(i, r);
|
|
3133
|
+
return u.length > 0 ? v.fromMillis(l, r).shiftTo(...u).plus(d) : d;
|
|
3134
3134
|
}
|
|
3135
3135
|
const Ut = {
|
|
3136
3136
|
arab: "[٠-٩]",
|
|
@@ -3154,7 +3154,7 @@ const Ut = {
|
|
|
3154
3154
|
thai: "[๐-๙]",
|
|
3155
3155
|
tibt: "[༠-༩]",
|
|
3156
3156
|
latn: "\\d"
|
|
3157
|
-
},
|
|
3157
|
+
}, hn = {
|
|
3158
3158
|
arab: [1632, 1641],
|
|
3159
3159
|
arabext: [1776, 1785],
|
|
3160
3160
|
bali: [6992, 7001],
|
|
@@ -3174,18 +3174,18 @@ const Ut = {
|
|
|
3174
3174
|
telu: [3174, 3183],
|
|
3175
3175
|
thai: [3664, 3673],
|
|
3176
3176
|
tibt: [3872, 3881]
|
|
3177
|
-
},
|
|
3178
|
-
function
|
|
3177
|
+
}, Oi = Ut.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
3178
|
+
function Mi(t) {
|
|
3179
3179
|
let e = parseInt(t, 10);
|
|
3180
3180
|
if (isNaN(e)) {
|
|
3181
3181
|
e = "";
|
|
3182
3182
|
for (let n = 0; n < t.length; n++) {
|
|
3183
3183
|
const r = t.charCodeAt(n);
|
|
3184
3184
|
if (t[n].search(Ut.hanidec) !== -1)
|
|
3185
|
-
e +=
|
|
3185
|
+
e += Oi.indexOf(t[n]);
|
|
3186
3186
|
else
|
|
3187
|
-
for (const s in
|
|
3188
|
-
const [i, a] =
|
|
3187
|
+
for (const s in hn) {
|
|
3188
|
+
const [i, a] = hn[s];
|
|
3189
3189
|
r >= i && r <= a && (e += r - i);
|
|
3190
3190
|
}
|
|
3191
3191
|
}
|
|
@@ -3196,34 +3196,34 @@ function vi(t) {
|
|
|
3196
3196
|
function G({ numberingSystem: t }, e = "") {
|
|
3197
3197
|
return new RegExp(`${Ut[t || "latn"]}${e}`);
|
|
3198
3198
|
}
|
|
3199
|
-
const
|
|
3199
|
+
const Di = "missing Intl.DateTimeFormat.formatToParts support";
|
|
3200
3200
|
function M(t, e = (n) => n) {
|
|
3201
|
-
return { regex: t, deser: ([n]) => e(
|
|
3201
|
+
return { regex: t, deser: ([n]) => e(Mi(n)) };
|
|
3202
3202
|
}
|
|
3203
|
-
const
|
|
3204
|
-
function
|
|
3205
|
-
return t.replace(/\./g, "\\.?").replace(
|
|
3203
|
+
const Ni = String.fromCharCode(160), mr = `[ ${Ni}]`, yr = new RegExp(mr, "g");
|
|
3204
|
+
function Ii(t) {
|
|
3205
|
+
return t.replace(/\./g, "\\.?").replace(yr, mr);
|
|
3206
3206
|
}
|
|
3207
|
-
function
|
|
3208
|
-
return t.replace(/\./g, "").replace(
|
|
3207
|
+
function mn(t) {
|
|
3208
|
+
return t.replace(/\./g, "").replace(yr, " ").toLowerCase();
|
|
3209
3209
|
}
|
|
3210
3210
|
function J(t, e) {
|
|
3211
3211
|
return t === null ? null : {
|
|
3212
|
-
regex: RegExp(t.map(
|
|
3213
|
-
deser: ([n]) => t.findIndex((r) =>
|
|
3212
|
+
regex: RegExp(t.map(Ii).join("|")),
|
|
3213
|
+
deser: ([n]) => t.findIndex((r) => mn(n) === mn(r)) + e
|
|
3214
3214
|
};
|
|
3215
3215
|
}
|
|
3216
|
-
function
|
|
3217
|
-
return { regex: t, deser: ([, n, r]) =>
|
|
3216
|
+
function yn(t, e) {
|
|
3217
|
+
return { regex: t, deser: ([, n, r]) => mt(n, r), groups: e };
|
|
3218
3218
|
}
|
|
3219
|
-
function
|
|
3219
|
+
function je(t) {
|
|
3220
3220
|
return { regex: t, deser: ([e]) => e };
|
|
3221
3221
|
}
|
|
3222
|
-
function
|
|
3222
|
+
function xi(t) {
|
|
3223
3223
|
return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
3224
3224
|
}
|
|
3225
|
-
function
|
|
3226
|
-
const n = G(e), r = G(e, "{2}"), s = G(e, "{3}"), i = G(e, "{4}"), a = G(e, "{6}"), o = G(e, "{1,2}"), l = G(e, "{1,3}"), u = G(e, "{1,6}"), d = G(e, "{1,9}"), m = G(e, "{2,4}"),
|
|
3225
|
+
function Ei(t, e) {
|
|
3226
|
+
const n = G(e), r = G(e, "{2}"), s = G(e, "{3}"), i = G(e, "{4}"), a = G(e, "{6}"), o = G(e, "{1,2}"), l = G(e, "{1,3}"), u = G(e, "{1,6}"), d = G(e, "{1,9}"), m = G(e, "{2,4}"), O = G(e, "{4,6}"), f = (g) => ({ regex: RegExp(xi(g.val)), deser: ([F]) => F, literal: !0 }), E = ((g) => {
|
|
3227
3227
|
if (t.literal)
|
|
3228
3228
|
return f(g);
|
|
3229
3229
|
switch (g.val) {
|
|
@@ -3234,11 +3234,11 @@ function xi(t, e) {
|
|
|
3234
3234
|
case "y":
|
|
3235
3235
|
return M(u);
|
|
3236
3236
|
case "yy":
|
|
3237
|
-
return M(m,
|
|
3237
|
+
return M(m, Ct);
|
|
3238
3238
|
case "yyyy":
|
|
3239
3239
|
return M(i);
|
|
3240
3240
|
case "yyyyy":
|
|
3241
|
-
return M(
|
|
3241
|
+
return M(O);
|
|
3242
3242
|
case "yyyyyy":
|
|
3243
3243
|
return M(a);
|
|
3244
3244
|
case "M":
|
|
@@ -3290,9 +3290,9 @@ function xi(t, e) {
|
|
|
3290
3290
|
case "SSS":
|
|
3291
3291
|
return M(s);
|
|
3292
3292
|
case "u":
|
|
3293
|
-
return
|
|
3293
|
+
return je(d);
|
|
3294
3294
|
case "uu":
|
|
3295
|
-
return
|
|
3295
|
+
return je(o);
|
|
3296
3296
|
case "uuu":
|
|
3297
3297
|
return M(n);
|
|
3298
3298
|
case "a":
|
|
@@ -3300,7 +3300,7 @@ function xi(t, e) {
|
|
|
3300
3300
|
case "kkkk":
|
|
3301
3301
|
return M(i);
|
|
3302
3302
|
case "kk":
|
|
3303
|
-
return M(m,
|
|
3303
|
+
return M(m, Ct);
|
|
3304
3304
|
case "W":
|
|
3305
3305
|
return M(o);
|
|
3306
3306
|
case "WW":
|
|
@@ -3318,22 +3318,22 @@ function xi(t, e) {
|
|
|
3318
3318
|
return J(e.weekdays("long", !0), 1);
|
|
3319
3319
|
case "Z":
|
|
3320
3320
|
case "ZZ":
|
|
3321
|
-
return
|
|
3321
|
+
return yn(new RegExp(`([+-]${o.source})(?::(${r.source}))?`), 2);
|
|
3322
3322
|
case "ZZZ":
|
|
3323
|
-
return
|
|
3323
|
+
return yn(new RegExp(`([+-]${o.source})(${r.source})?`), 2);
|
|
3324
3324
|
case "z":
|
|
3325
|
-
return
|
|
3325
|
+
return je(/[a-z_+-/]{1,256}?/i);
|
|
3326
3326
|
case " ":
|
|
3327
|
-
return
|
|
3327
|
+
return je(/[^\S\n\r]/);
|
|
3328
3328
|
default:
|
|
3329
3329
|
return f(g);
|
|
3330
3330
|
}
|
|
3331
3331
|
})(t) || {
|
|
3332
|
-
invalidReason:
|
|
3332
|
+
invalidReason: Di
|
|
3333
3333
|
};
|
|
3334
3334
|
return E.token = t, E;
|
|
3335
3335
|
}
|
|
3336
|
-
const
|
|
3336
|
+
const bi = {
|
|
3337
3337
|
year: {
|
|
3338
3338
|
"2-digit": "yy",
|
|
3339
3339
|
numeric: "yyyyy"
|
|
@@ -3375,7 +3375,7 @@ const Ei = {
|
|
|
3375
3375
|
short: "ZZZ"
|
|
3376
3376
|
}
|
|
3377
3377
|
};
|
|
3378
|
-
function
|
|
3378
|
+
function Fi(t, e, n) {
|
|
3379
3379
|
const { type: r, value: s } = t;
|
|
3380
3380
|
if (r === "literal") {
|
|
3381
3381
|
const l = /^\s+$/.test(s);
|
|
@@ -3387,23 +3387,23 @@ function bi(t, e, n) {
|
|
|
3387
3387
|
const i = e[r];
|
|
3388
3388
|
let a = r;
|
|
3389
3389
|
r === "hour" && (e.hour12 != null ? a = e.hour12 ? "hour12" : "hour24" : e.hourCycle != null ? e.hourCycle === "h11" || e.hourCycle === "h12" ? a = "hour12" : a = "hour24" : a = n.hour12 ? "hour12" : "hour24");
|
|
3390
|
-
let o =
|
|
3390
|
+
let o = bi[a];
|
|
3391
3391
|
if (typeof o == "object" && (o = o[i]), o)
|
|
3392
3392
|
return {
|
|
3393
3393
|
literal: !1,
|
|
3394
3394
|
val: o
|
|
3395
3395
|
};
|
|
3396
3396
|
}
|
|
3397
|
-
function
|
|
3397
|
+
function Ci(t) {
|
|
3398
3398
|
return [`^${t.map((n) => n.regex).reduce((n, r) => `${n}(${r.source})`, "")}$`, t];
|
|
3399
3399
|
}
|
|
3400
|
-
function
|
|
3400
|
+
function Vi(t, e, n) {
|
|
3401
3401
|
const r = t.match(e);
|
|
3402
3402
|
if (r) {
|
|
3403
3403
|
const s = {};
|
|
3404
3404
|
let i = 1;
|
|
3405
3405
|
for (const a in n)
|
|
3406
|
-
if (
|
|
3406
|
+
if (ve(n, a)) {
|
|
3407
3407
|
const o = n[a], l = o.groups ? o.groups + 1 : 1;
|
|
3408
3408
|
!o.literal && o.token && (s[o.token.val[0]] = o.deser(r.slice(i, i + l))), i += l;
|
|
3409
3409
|
}
|
|
@@ -3411,7 +3411,7 @@ function Ci(t, e, n) {
|
|
|
3411
3411
|
} else
|
|
3412
3412
|
return [r, {}];
|
|
3413
3413
|
}
|
|
3414
|
-
function
|
|
3414
|
+
function Wi(t) {
|
|
3415
3415
|
const e = (i) => {
|
|
3416
3416
|
switch (i) {
|
|
3417
3417
|
case "S":
|
|
@@ -3446,62 +3446,62 @@ function Vi(t) {
|
|
|
3446
3446
|
}
|
|
3447
3447
|
};
|
|
3448
3448
|
let n = null, r;
|
|
3449
|
-
return p(t.z) || (n =
|
|
3449
|
+
return p(t.z) || (n = ne.create(t.z)), p(t.Z) || (n || (n = new W(t.Z)), r = t.Z), p(t.q) || (t.M = (t.q - 1) * 3 + 1), p(t.h) || (t.h < 12 && t.a === 1 ? t.h += 12 : t.h === 12 && t.a === 0 && (t.h = 0)), t.G === 0 && t.y && (t.y = -t.y), p(t.u) || (t.S = zt(t.u)), [Object.keys(t).reduce((i, a) => {
|
|
3450
3450
|
const o = e(a);
|
|
3451
3451
|
return o && (i[o] = t[a]), i;
|
|
3452
3452
|
}, {}), n, r];
|
|
3453
3453
|
}
|
|
3454
|
-
let
|
|
3455
|
-
function
|
|
3456
|
-
return
|
|
3454
|
+
let vt = null;
|
|
3455
|
+
function Li() {
|
|
3456
|
+
return vt || (vt = y.fromMillis(1555555555555)), vt;
|
|
3457
3457
|
}
|
|
3458
|
-
function
|
|
3458
|
+
function $i(t, e) {
|
|
3459
3459
|
if (t.literal)
|
|
3460
3460
|
return t;
|
|
3461
|
-
const n = V.macroTokenToFormatOpts(t.val), r =
|
|
3461
|
+
const n = V.macroTokenToFormatOpts(t.val), r = pr(n, e);
|
|
3462
3462
|
return r == null || r.includes(void 0) ? t : r;
|
|
3463
3463
|
}
|
|
3464
|
-
function
|
|
3465
|
-
return Array.prototype.concat(...t.map((n) =>
|
|
3464
|
+
function gr(t, e) {
|
|
3465
|
+
return Array.prototype.concat(...t.map((n) => $i(n, e)));
|
|
3466
3466
|
}
|
|
3467
|
-
function
|
|
3468
|
-
const r =
|
|
3467
|
+
function wr(t, e, n) {
|
|
3468
|
+
const r = gr(V.parseFormat(n), t), s = r.map((a) => Ei(a, t)), i = s.find((a) => a.invalidReason);
|
|
3469
3469
|
if (i)
|
|
3470
3470
|
return { input: e, tokens: r, invalidReason: i.invalidReason };
|
|
3471
3471
|
{
|
|
3472
|
-
const [a, o] =
|
|
3473
|
-
if (
|
|
3474
|
-
throw new
|
|
3472
|
+
const [a, o] = Ci(s), l = RegExp(a, "i"), [u, d] = Vi(e, l, o), [m, O, f] = d ? Wi(d) : [null, null, void 0];
|
|
3473
|
+
if (ve(d, "a") && ve(d, "H"))
|
|
3474
|
+
throw new ke(
|
|
3475
3475
|
"Can't include meridiem when specifying 24-hour format"
|
|
3476
3476
|
);
|
|
3477
|
-
return { input: e, tokens: r, regex: l, rawMatches: u, matches: d, result: m, zone:
|
|
3477
|
+
return { input: e, tokens: r, regex: l, rawMatches: u, matches: d, result: m, zone: O, specificOffset: f };
|
|
3478
3478
|
}
|
|
3479
3479
|
}
|
|
3480
|
-
function
|
|
3481
|
-
const { result: r, zone: s, specificOffset: i, invalidReason: a } =
|
|
3480
|
+
function Zi(t, e, n) {
|
|
3481
|
+
const { result: r, zone: s, specificOffset: i, invalidReason: a } = wr(t, e, n);
|
|
3482
3482
|
return [r, s, i, a];
|
|
3483
3483
|
}
|
|
3484
|
-
function
|
|
3484
|
+
function pr(t, e) {
|
|
3485
3485
|
if (!t)
|
|
3486
3486
|
return null;
|
|
3487
|
-
const r = V.create(e, t).dtFormatter(
|
|
3488
|
-
return s.map((a) =>
|
|
3487
|
+
const r = V.create(e, t).dtFormatter(Li()), s = r.formatToParts(), i = r.resolvedOptions();
|
|
3488
|
+
return s.map((a) => Fi(a, t, i));
|
|
3489
3489
|
}
|
|
3490
|
-
const
|
|
3491
|
-
function
|
|
3492
|
-
return new
|
|
3493
|
-
}
|
|
3494
|
-
function vt(t) {
|
|
3495
|
-
return t.weekData === null && (t.weekData = rt(t.c)), t.weekData;
|
|
3490
|
+
const Ot = "Invalid DateTime", gn = 864e13;
|
|
3491
|
+
function Ge(t) {
|
|
3492
|
+
return new K("unsupported zone", `the zone "${t.name}" is not supported`);
|
|
3496
3493
|
}
|
|
3497
3494
|
function Mt(t) {
|
|
3498
|
-
return t.
|
|
3495
|
+
return t.weekData === null && (t.weekData = st(t.c)), t.weekData;
|
|
3496
|
+
}
|
|
3497
|
+
function Dt(t) {
|
|
3498
|
+
return t.localWeekData === null && (t.localWeekData = st(
|
|
3499
3499
|
t.c,
|
|
3500
3500
|
t.loc.getMinDaysInFirstWeek(),
|
|
3501
3501
|
t.loc.getStartOfWeek()
|
|
3502
3502
|
)), t.localWeekData;
|
|
3503
3503
|
}
|
|
3504
|
-
function
|
|
3504
|
+
function ce(t, e) {
|
|
3505
3505
|
const n = {
|
|
3506
3506
|
ts: t.ts,
|
|
3507
3507
|
zone: t.zone,
|
|
@@ -3512,7 +3512,7 @@ function ue(t, e) {
|
|
|
3512
3512
|
};
|
|
3513
3513
|
return new y({ ...n, ...e, old: n });
|
|
3514
3514
|
}
|
|
3515
|
-
function
|
|
3515
|
+
function kr(t, e, n) {
|
|
3516
3516
|
let r = t - e * 60 * 1e3;
|
|
3517
3517
|
const s = n.offset(r);
|
|
3518
3518
|
if (e === s)
|
|
@@ -3521,7 +3521,7 @@ function pr(t, e, n) {
|
|
|
3521
3521
|
const i = n.offset(r);
|
|
3522
3522
|
return s === i ? [r, s] : [t - Math.min(s, i) * 60 * 1e3, Math.max(s, i)];
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3524
|
+
function Je(t, e) {
|
|
3525
3525
|
t += e * 60 * 1e3;
|
|
3526
3526
|
const n = new Date(t);
|
|
3527
3527
|
return {
|
|
@@ -3534,16 +3534,16 @@ function Ge(t, e) {
|
|
|
3534
3534
|
millisecond: n.getUTCMilliseconds()
|
|
3535
3535
|
};
|
|
3536
3536
|
}
|
|
3537
|
-
function
|
|
3538
|
-
return
|
|
3537
|
+
function Qe(t, e, n) {
|
|
3538
|
+
return kr(ht(t), e, n);
|
|
3539
3539
|
}
|
|
3540
|
-
function
|
|
3540
|
+
function wn(t, e) {
|
|
3541
3541
|
const n = t.o, r = t.c.year + Math.trunc(e.years), s = t.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, i = {
|
|
3542
3542
|
...t.c,
|
|
3543
3543
|
year: r,
|
|
3544
3544
|
month: s,
|
|
3545
|
-
day: Math.min(t.c.day,
|
|
3546
|
-
}, a =
|
|
3545
|
+
day: Math.min(t.c.day, it(r, s)) + Math.trunc(e.days) + Math.trunc(e.weeks) * 7
|
|
3546
|
+
}, a = v.fromObject({
|
|
3547
3547
|
years: e.years - Math.trunc(e.years),
|
|
3548
3548
|
quarters: e.quarters - Math.trunc(e.quarters),
|
|
3549
3549
|
months: e.months - Math.trunc(e.months),
|
|
@@ -3553,11 +3553,11 @@ function gn(t, e) {
|
|
|
3553
3553
|
minutes: e.minutes,
|
|
3554
3554
|
seconds: e.seconds,
|
|
3555
3555
|
milliseconds: e.milliseconds
|
|
3556
|
-
}).as("milliseconds"), o =
|
|
3557
|
-
let [l, u] =
|
|
3556
|
+
}).as("milliseconds"), o = ht(i);
|
|
3557
|
+
let [l, u] = kr(o, n, t.zone);
|
|
3558
3558
|
return a !== 0 && (l += a, u = t.zone.offset(l)), { ts: l, o: u };
|
|
3559
3559
|
}
|
|
3560
|
-
function
|
|
3560
|
+
function be(t, e, n, r, s, i) {
|
|
3561
3561
|
const { setZone: a, zone: o } = n;
|
|
3562
3562
|
if (t && Object.keys(t).length !== 0 || e) {
|
|
3563
3563
|
const l = e || o, u = y.fromObject(t, {
|
|
@@ -3568,45 +3568,45 @@ function Ee(t, e, n, r, s, i) {
|
|
|
3568
3568
|
return a ? u : u.setZone(o);
|
|
3569
3569
|
} else
|
|
3570
3570
|
return y.invalid(
|
|
3571
|
-
new
|
|
3571
|
+
new K("unparsable", `the input "${s}" can't be parsed as ${r}`)
|
|
3572
3572
|
);
|
|
3573
3573
|
}
|
|
3574
|
-
function
|
|
3574
|
+
function Be(t, e, n = !0) {
|
|
3575
3575
|
return t.isValid ? V.create(D.create("en-US"), {
|
|
3576
3576
|
allowZ: n,
|
|
3577
3577
|
forceSimple: !0
|
|
3578
3578
|
}).formatDateTimeFromString(t, e) : null;
|
|
3579
3579
|
}
|
|
3580
|
-
function
|
|
3580
|
+
function Nt(t, e) {
|
|
3581
3581
|
const n = t.c.year > 9999 || t.c.year < 0;
|
|
3582
3582
|
let r = "";
|
|
3583
3583
|
return n && t.c.year >= 0 && (r += "+"), r += b(t.c.year, n ? 6 : 4), e ? (r += "-", r += b(t.c.month), r += "-", r += b(t.c.day)) : (r += b(t.c.month), r += b(t.c.day)), r;
|
|
3584
3584
|
}
|
|
3585
|
-
function
|
|
3585
|
+
function pn(t, e, n, r, s, i) {
|
|
3586
3586
|
let a = b(t.c.hour);
|
|
3587
3587
|
return e ? (a += ":", a += b(t.c.minute), (t.c.millisecond !== 0 || t.c.second !== 0 || !n) && (a += ":")) : a += b(t.c.minute), (t.c.millisecond !== 0 || t.c.second !== 0 || !n) && (a += b(t.c.second), (t.c.millisecond !== 0 || !r) && (a += ".", a += b(t.c.millisecond, 3))), s && (t.isOffsetFixed && t.offset === 0 && !i ? a += "Z" : t.o < 0 ? (a += "-", a += b(Math.trunc(-t.o / 60)), a += ":", a += b(Math.trunc(-t.o % 60))) : (a += "+", a += b(Math.trunc(t.o / 60)), a += ":", a += b(Math.trunc(t.o % 60)))), i && (a += "[" + t.zone.ianaName + "]"), a;
|
|
3588
3588
|
}
|
|
3589
|
-
const
|
|
3589
|
+
const Sr = {
|
|
3590
3590
|
month: 1,
|
|
3591
3591
|
day: 1,
|
|
3592
3592
|
hour: 0,
|
|
3593
3593
|
minute: 0,
|
|
3594
3594
|
second: 0,
|
|
3595
3595
|
millisecond: 0
|
|
3596
|
-
},
|
|
3596
|
+
}, zi = {
|
|
3597
3597
|
weekNumber: 1,
|
|
3598
3598
|
weekday: 1,
|
|
3599
3599
|
hour: 0,
|
|
3600
3600
|
minute: 0,
|
|
3601
3601
|
second: 0,
|
|
3602
3602
|
millisecond: 0
|
|
3603
|
-
},
|
|
3603
|
+
}, Ai = {
|
|
3604
3604
|
ordinal: 1,
|
|
3605
3605
|
hour: 0,
|
|
3606
3606
|
minute: 0,
|
|
3607
3607
|
second: 0,
|
|
3608
3608
|
millisecond: 0
|
|
3609
|
-
},
|
|
3609
|
+
}, Tr = ["year", "month", "day", "hour", "minute", "second", "millisecond"], _i = [
|
|
3610
3610
|
"weekYear",
|
|
3611
3611
|
"weekNumber",
|
|
3612
3612
|
"weekday",
|
|
@@ -3614,8 +3614,8 @@ const kr = {
|
|
|
3614
3614
|
"minute",
|
|
3615
3615
|
"second",
|
|
3616
3616
|
"millisecond"
|
|
3617
|
-
],
|
|
3618
|
-
function
|
|
3617
|
+
], qi = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
|
|
3618
|
+
function Ri(t) {
|
|
3619
3619
|
const e = {
|
|
3620
3620
|
year: "year",
|
|
3621
3621
|
years: "year",
|
|
@@ -3643,10 +3643,10 @@ function qi(t) {
|
|
|
3643
3643
|
ordinal: "ordinal"
|
|
3644
3644
|
}[t.toLowerCase()];
|
|
3645
3645
|
if (!e)
|
|
3646
|
-
throw new
|
|
3646
|
+
throw new On(t);
|
|
3647
3647
|
return e;
|
|
3648
3648
|
}
|
|
3649
|
-
function
|
|
3649
|
+
function kn(t) {
|
|
3650
3650
|
switch (t.toLowerCase()) {
|
|
3651
3651
|
case "localweekday":
|
|
3652
3652
|
case "localweekdays":
|
|
@@ -3658,27 +3658,27 @@ function pn(t) {
|
|
|
3658
3658
|
case "localweekyears":
|
|
3659
3659
|
return "localWeekYear";
|
|
3660
3660
|
default:
|
|
3661
|
-
return
|
|
3661
|
+
return Ri(t);
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
3664
|
-
function
|
|
3665
|
-
const n =
|
|
3664
|
+
function Sn(t, e) {
|
|
3665
|
+
const n = oe(e.zone, x.defaultZone), r = D.fromObject(e), s = x.now();
|
|
3666
3666
|
let i, a;
|
|
3667
3667
|
if (p(t.year))
|
|
3668
3668
|
i = s;
|
|
3669
3669
|
else {
|
|
3670
|
-
for (const u of
|
|
3671
|
-
p(t[u]) && (t[u] =
|
|
3672
|
-
const o =
|
|
3670
|
+
for (const u of Tr)
|
|
3671
|
+
p(t[u]) && (t[u] = Sr[u]);
|
|
3672
|
+
const o = jn(t) || Gn(t);
|
|
3673
3673
|
if (o)
|
|
3674
3674
|
return y.invalid(o);
|
|
3675
3675
|
const l = n.offset(s);
|
|
3676
|
-
[i, a] =
|
|
3676
|
+
[i, a] = Qe(t, l, n);
|
|
3677
3677
|
}
|
|
3678
3678
|
return new y({ ts: i, zone: n, loc: r, o: a });
|
|
3679
3679
|
}
|
|
3680
|
-
function
|
|
3681
|
-
const r = p(n.round) ? !0 : n.round, s = (a, o) => (a =
|
|
3680
|
+
function Tn(t, e, n) {
|
|
3681
|
+
const r = p(n.round) ? !0 : n.round, s = (a, o) => (a = At(a, r || n.calendary ? 0 : 2, !0), e.loc.clone(n).relFormatter(n).format(a, o)), i = (a) => n.calendary ? e.hasSame(t, a) ? 0 : e.startOf(a).diff(t.startOf(a), a).get(a) : e.diff(t, a).get(a);
|
|
3682
3682
|
if (n.unit)
|
|
3683
3683
|
return s(i(n.unit), n.unit);
|
|
3684
3684
|
for (const a of n.units) {
|
|
@@ -3688,7 +3688,7 @@ function Sn(t, e, n) {
|
|
|
3688
3688
|
}
|
|
3689
3689
|
return s(t > e ? -0 : 0, n.units[n.units.length - 1]);
|
|
3690
3690
|
}
|
|
3691
|
-
function
|
|
3691
|
+
function vn(t) {
|
|
3692
3692
|
let e = {}, n;
|
|
3693
3693
|
return t.length > 0 && typeof t[t.length - 1] == "object" ? (e = t[t.length - 1], n = Array.from(t).slice(0, t.length - 1)) : n = Array.from(t), [e, n];
|
|
3694
3694
|
}
|
|
@@ -3698,7 +3698,7 @@ class y {
|
|
|
3698
3698
|
*/
|
|
3699
3699
|
constructor(e) {
|
|
3700
3700
|
const n = e.zone || x.defaultZone;
|
|
3701
|
-
let r = e.invalid || (Number.isNaN(e.ts) ? new
|
|
3701
|
+
let r = e.invalid || (Number.isNaN(e.ts) ? new K("invalid input") : null) || (n.isValid ? null : Ge(n));
|
|
3702
3702
|
this.ts = p(e.ts) ? x.now() : e.ts;
|
|
3703
3703
|
let s = null, i = null;
|
|
3704
3704
|
if (!r)
|
|
@@ -3706,7 +3706,7 @@ class y {
|
|
|
3706
3706
|
[s, i] = [e.old.c, e.old.o];
|
|
3707
3707
|
else {
|
|
3708
3708
|
const o = n.offset(this.ts);
|
|
3709
|
-
s =
|
|
3709
|
+
s = Je(this.ts, o), r = Number.isNaN(s.year) ? new K("invalid input") : null, s = r ? null : s, i = r ? null : o;
|
|
3710
3710
|
}
|
|
3711
3711
|
this._zone = n, this.loc = e.loc || D.create(), this.invalid = r, this.weekData = null, this.localWeekData = null, this.c = s, this.o = i, this.isLuxonDateTime = !0;
|
|
3712
3712
|
}
|
|
@@ -3743,8 +3743,8 @@ class y {
|
|
|
3743
3743
|
* @return {DateTime}
|
|
3744
3744
|
*/
|
|
3745
3745
|
static local() {
|
|
3746
|
-
const [e, n] =
|
|
3747
|
-
return
|
|
3746
|
+
const [e, n] = vn(arguments), [r, s, i, a, o, l, u] = n;
|
|
3747
|
+
return Sn({ year: r, month: s, day: i, hour: a, minute: o, second: l, millisecond: u }, e);
|
|
3748
3748
|
}
|
|
3749
3749
|
/**
|
|
3750
3750
|
* Create a DateTime in UTC
|
|
@@ -3771,8 +3771,8 @@ class y {
|
|
|
3771
3771
|
* @return {DateTime}
|
|
3772
3772
|
*/
|
|
3773
3773
|
static utc() {
|
|
3774
|
-
const [e, n] =
|
|
3775
|
-
return e.zone = W.utcInstance,
|
|
3774
|
+
const [e, n] = vn(arguments), [r, s, i, a, o, l, u] = n;
|
|
3775
|
+
return e.zone = W.utcInstance, Sn({ year: r, month: s, day: i, hour: a, minute: o, second: l, millisecond: u }, e);
|
|
3776
3776
|
}
|
|
3777
3777
|
/**
|
|
3778
3778
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -3782,15 +3782,15 @@ class y {
|
|
|
3782
3782
|
* @return {DateTime}
|
|
3783
3783
|
*/
|
|
3784
3784
|
static fromJSDate(e, n = {}) {
|
|
3785
|
-
const r =
|
|
3785
|
+
const r = ws(e) ? e.valueOf() : NaN;
|
|
3786
3786
|
if (Number.isNaN(r))
|
|
3787
3787
|
return y.invalid("invalid input");
|
|
3788
|
-
const s =
|
|
3788
|
+
const s = oe(n.zone, x.defaultZone);
|
|
3789
3789
|
return s.isValid ? new y({
|
|
3790
3790
|
ts: r,
|
|
3791
3791
|
zone: s,
|
|
3792
3792
|
loc: D.fromObject(n)
|
|
3793
|
-
}) : y.invalid(
|
|
3793
|
+
}) : y.invalid(Ge(s));
|
|
3794
3794
|
}
|
|
3795
3795
|
/**
|
|
3796
3796
|
* Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
|
|
@@ -3803,13 +3803,13 @@ class y {
|
|
|
3803
3803
|
* @return {DateTime}
|
|
3804
3804
|
*/
|
|
3805
3805
|
static fromMillis(e, n = {}) {
|
|
3806
|
-
if (
|
|
3807
|
-
return e < -
|
|
3806
|
+
if (fe(e))
|
|
3807
|
+
return e < -gn || e > gn ? y.invalid("Timestamp out of range") : new y({
|
|
3808
3808
|
ts: e,
|
|
3809
|
-
zone:
|
|
3809
|
+
zone: oe(n.zone, x.defaultZone),
|
|
3810
3810
|
loc: D.fromObject(n)
|
|
3811
3811
|
});
|
|
3812
|
-
throw new
|
|
3812
|
+
throw new Z(
|
|
3813
3813
|
`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`
|
|
3814
3814
|
);
|
|
3815
3815
|
}
|
|
@@ -3824,13 +3824,13 @@ class y {
|
|
|
3824
3824
|
* @return {DateTime}
|
|
3825
3825
|
*/
|
|
3826
3826
|
static fromSeconds(e, n = {}) {
|
|
3827
|
-
if (
|
|
3827
|
+
if (fe(e))
|
|
3828
3828
|
return new y({
|
|
3829
3829
|
ts: e * 1e3,
|
|
3830
|
-
zone:
|
|
3830
|
+
zone: oe(n.zone, x.defaultZone),
|
|
3831
3831
|
loc: D.fromObject(n)
|
|
3832
3832
|
});
|
|
3833
|
-
throw new
|
|
3833
|
+
throw new Z("fromSeconds requires a numerical input");
|
|
3834
3834
|
}
|
|
3835
3835
|
/**
|
|
3836
3836
|
* Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
|
|
@@ -3866,31 +3866,31 @@ class y {
|
|
|
3866
3866
|
*/
|
|
3867
3867
|
static fromObject(e, n = {}) {
|
|
3868
3868
|
e = e || {};
|
|
3869
|
-
const r =
|
|
3869
|
+
const r = oe(n.zone, x.defaultZone);
|
|
3870
3870
|
if (!r.isValid)
|
|
3871
|
-
return y.invalid(
|
|
3872
|
-
const s = D.fromObject(n), i =
|
|
3871
|
+
return y.invalid(Ge(r));
|
|
3872
|
+
const s = D.fromObject(n), i = at(e, kn), { minDaysInFirstWeek: a, startOfWeek: o } = sn(i, s), l = x.now(), u = p(n.specificOffset) ? r.offset(l) : n.specificOffset, d = !p(i.ordinal), m = !p(i.year), O = !p(i.month) || !p(i.day), f = m || O, w = i.weekYear || i.weekNumber;
|
|
3873
3873
|
if ((f || d) && w)
|
|
3874
|
-
throw new
|
|
3874
|
+
throw new ke(
|
|
3875
3875
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
3876
3876
|
);
|
|
3877
|
-
if (
|
|
3878
|
-
throw new
|
|
3877
|
+
if (O && d)
|
|
3878
|
+
throw new ke("Can't mix ordinal dates with month/day");
|
|
3879
3879
|
const E = w || i.weekday && !f;
|
|
3880
|
-
let g, F, _ =
|
|
3881
|
-
E ? (g =
|
|
3880
|
+
let g, F, _ = Je(l, u);
|
|
3881
|
+
E ? (g = _i, F = zi, _ = st(_, a, o)) : d ? (g = qi, F = Ai, _ = Tt(_)) : (g = Tr, F = Sr);
|
|
3882
3882
|
let L = !1;
|
|
3883
3883
|
for (const q of g) {
|
|
3884
|
-
const
|
|
3885
|
-
p(
|
|
3884
|
+
const me = i[q];
|
|
3885
|
+
p(me) ? L ? i[q] = F[q] : i[q] = _[q] : L = !0;
|
|
3886
3886
|
}
|
|
3887
|
-
const
|
|
3888
|
-
if (
|
|
3889
|
-
return y.invalid(
|
|
3890
|
-
const Y = E ?
|
|
3891
|
-
ts:
|
|
3887
|
+
const X = E ? ms(i, a, o) : d ? ys(i) : jn(i), le = X || Gn(i);
|
|
3888
|
+
if (le)
|
|
3889
|
+
return y.invalid(le);
|
|
3890
|
+
const Y = E ? nn(i, a, o) : d ? rn(i) : i, [te, $] = Qe(Y, u, r), P = new y({
|
|
3891
|
+
ts: te,
|
|
3892
3892
|
zone: r,
|
|
3893
|
-
o:
|
|
3893
|
+
o: $,
|
|
3894
3894
|
loc: s
|
|
3895
3895
|
});
|
|
3896
3896
|
return i.weekday && f && e.weekday !== P.weekday ? y.invalid(
|
|
@@ -3915,8 +3915,8 @@ class y {
|
|
|
3915
3915
|
* @return {DateTime}
|
|
3916
3916
|
*/
|
|
3917
3917
|
static fromISO(e, n = {}) {
|
|
3918
|
-
const [r, s] =
|
|
3919
|
-
return
|
|
3918
|
+
const [r, s] = ai(e);
|
|
3919
|
+
return be(r, s, n, "ISO 8601", e);
|
|
3920
3920
|
}
|
|
3921
3921
|
/**
|
|
3922
3922
|
* Create a DateTime from an RFC 2822 string
|
|
@@ -3933,8 +3933,8 @@ class y {
|
|
|
3933
3933
|
* @return {DateTime}
|
|
3934
3934
|
*/
|
|
3935
3935
|
static fromRFC2822(e, n = {}) {
|
|
3936
|
-
const [r, s] =
|
|
3937
|
-
return
|
|
3936
|
+
const [r, s] = oi(e);
|
|
3937
|
+
return be(r, s, n, "RFC 2822", e);
|
|
3938
3938
|
}
|
|
3939
3939
|
/**
|
|
3940
3940
|
* Create a DateTime from an HTTP header date
|
|
@@ -3952,8 +3952,8 @@ class y {
|
|
|
3952
3952
|
* @return {DateTime}
|
|
3953
3953
|
*/
|
|
3954
3954
|
static fromHTTP(e, n = {}) {
|
|
3955
|
-
const [r, s] =
|
|
3956
|
-
return
|
|
3955
|
+
const [r, s] = li(e);
|
|
3956
|
+
return be(r, s, n, "HTTP", n);
|
|
3957
3957
|
}
|
|
3958
3958
|
/**
|
|
3959
3959
|
* Create a DateTime from an input string and format string.
|
|
@@ -3970,13 +3970,13 @@ class y {
|
|
|
3970
3970
|
*/
|
|
3971
3971
|
static fromFormat(e, n, r = {}) {
|
|
3972
3972
|
if (p(e) || p(n))
|
|
3973
|
-
throw new
|
|
3973
|
+
throw new Z("fromFormat requires an input string and a format");
|
|
3974
3974
|
const { locale: s = null, numberingSystem: i = null } = r, a = D.fromOpts({
|
|
3975
3975
|
locale: s,
|
|
3976
3976
|
numberingSystem: i,
|
|
3977
3977
|
defaultToEN: !0
|
|
3978
|
-
}), [o, l, u, d] =
|
|
3979
|
-
return d ? y.invalid(d) :
|
|
3978
|
+
}), [o, l, u, d] = Zi(a, e, n);
|
|
3979
|
+
return d ? y.invalid(d) : be(o, l, r, `format ${n}`, e, u);
|
|
3980
3980
|
}
|
|
3981
3981
|
/**
|
|
3982
3982
|
* @deprecated use fromFormat instead
|
|
@@ -4005,8 +4005,8 @@ class y {
|
|
|
4005
4005
|
* @return {DateTime}
|
|
4006
4006
|
*/
|
|
4007
4007
|
static fromSQL(e, n = {}) {
|
|
4008
|
-
const [r, s] =
|
|
4009
|
-
return
|
|
4008
|
+
const [r, s] = yi(e);
|
|
4009
|
+
return be(r, s, n, "SQL", e);
|
|
4010
4010
|
}
|
|
4011
4011
|
/**
|
|
4012
4012
|
* Create an invalid DateTime.
|
|
@@ -4016,10 +4016,10 @@ class y {
|
|
|
4016
4016
|
*/
|
|
4017
4017
|
static invalid(e, n = null) {
|
|
4018
4018
|
if (!e)
|
|
4019
|
-
throw new
|
|
4020
|
-
const r = e instanceof
|
|
4019
|
+
throw new Z("need to specify a reason the DateTime is invalid");
|
|
4020
|
+
const r = e instanceof K ? e : new K(e, n);
|
|
4021
4021
|
if (x.throwOnInvalid)
|
|
4022
|
-
throw new
|
|
4022
|
+
throw new Hr(r);
|
|
4023
4023
|
return new y({ invalid: r });
|
|
4024
4024
|
}
|
|
4025
4025
|
/**
|
|
@@ -4037,7 +4037,7 @@ class y {
|
|
|
4037
4037
|
* @returns {string}
|
|
4038
4038
|
*/
|
|
4039
4039
|
static parseFormatForOpts(e, n = {}) {
|
|
4040
|
-
const r =
|
|
4040
|
+
const r = pr(e, D.fromObject(n));
|
|
4041
4041
|
return r ? r.map((s) => s ? s.val : null).join("") : null;
|
|
4042
4042
|
}
|
|
4043
4043
|
/**
|
|
@@ -4048,7 +4048,7 @@ class y {
|
|
|
4048
4048
|
* @returns {string}
|
|
4049
4049
|
*/
|
|
4050
4050
|
static expandFormat(e, n = {}) {
|
|
4051
|
-
return
|
|
4051
|
+
return gr(V.parseFormat(e), D.fromObject(n)).map((s) => s.val).join("");
|
|
4052
4052
|
}
|
|
4053
4053
|
// INFO
|
|
4054
4054
|
/**
|
|
@@ -4193,7 +4193,7 @@ class y {
|
|
|
4193
4193
|
* @type {number}
|
|
4194
4194
|
*/
|
|
4195
4195
|
get weekYear() {
|
|
4196
|
-
return this.isValid ?
|
|
4196
|
+
return this.isValid ? Mt(this).weekYear : NaN;
|
|
4197
4197
|
}
|
|
4198
4198
|
/**
|
|
4199
4199
|
* Get the week number of the week year (1-52ish).
|
|
@@ -4202,7 +4202,7 @@ class y {
|
|
|
4202
4202
|
* @type {number}
|
|
4203
4203
|
*/
|
|
4204
4204
|
get weekNumber() {
|
|
4205
|
-
return this.isValid ?
|
|
4205
|
+
return this.isValid ? Mt(this).weekNumber : NaN;
|
|
4206
4206
|
}
|
|
4207
4207
|
/**
|
|
4208
4208
|
* Get the day of the week.
|
|
@@ -4212,7 +4212,7 @@ class y {
|
|
|
4212
4212
|
* @type {number}
|
|
4213
4213
|
*/
|
|
4214
4214
|
get weekday() {
|
|
4215
|
-
return this.isValid ?
|
|
4215
|
+
return this.isValid ? Mt(this).weekday : NaN;
|
|
4216
4216
|
}
|
|
4217
4217
|
/**
|
|
4218
4218
|
* Returns true if this date is on a weekend according to the locale, false otherwise
|
|
@@ -4228,7 +4228,7 @@ class y {
|
|
|
4228
4228
|
* @returns {number}
|
|
4229
4229
|
*/
|
|
4230
4230
|
get localWeekday() {
|
|
4231
|
-
return this.isValid ?
|
|
4231
|
+
return this.isValid ? Dt(this).weekday : NaN;
|
|
4232
4232
|
}
|
|
4233
4233
|
/**
|
|
4234
4234
|
* Get the week number of the week year according to the locale. Different locales assign week numbers differently,
|
|
@@ -4237,7 +4237,7 @@ class y {
|
|
|
4237
4237
|
* @returns {number}
|
|
4238
4238
|
*/
|
|
4239
4239
|
get localWeekNumber() {
|
|
4240
|
-
return this.isValid ?
|
|
4240
|
+
return this.isValid ? Dt(this).weekNumber : NaN;
|
|
4241
4241
|
}
|
|
4242
4242
|
/**
|
|
4243
4243
|
* Get the week year according to the locale. Different locales assign week numbers (and therefor week years)
|
|
@@ -4245,7 +4245,7 @@ class y {
|
|
|
4245
4245
|
* @returns {number}
|
|
4246
4246
|
*/
|
|
4247
4247
|
get localWeekYear() {
|
|
4248
|
-
return this.isValid ?
|
|
4248
|
+
return this.isValid ? Dt(this).weekYear : NaN;
|
|
4249
4249
|
}
|
|
4250
4250
|
/**
|
|
4251
4251
|
* Get the ordinal (meaning the day of the year)
|
|
@@ -4253,7 +4253,7 @@ class y {
|
|
|
4253
4253
|
* @type {number|DateTime}
|
|
4254
4254
|
*/
|
|
4255
4255
|
get ordinal() {
|
|
4256
|
-
return this.isValid ?
|
|
4256
|
+
return this.isValid ? Tt(this.c).ordinal : NaN;
|
|
4257
4257
|
}
|
|
4258
4258
|
/**
|
|
4259
4259
|
* Get the human readable short month name, such as 'Oct'.
|
|
@@ -4262,7 +4262,7 @@ class y {
|
|
|
4262
4262
|
* @type {string}
|
|
4263
4263
|
*/
|
|
4264
4264
|
get monthShort() {
|
|
4265
|
-
return this.isValid ?
|
|
4265
|
+
return this.isValid ? Ve.months("short", { locObj: this.loc })[this.month - 1] : null;
|
|
4266
4266
|
}
|
|
4267
4267
|
/**
|
|
4268
4268
|
* Get the human readable long month name, such as 'October'.
|
|
@@ -4271,7 +4271,7 @@ class y {
|
|
|
4271
4271
|
* @type {string}
|
|
4272
4272
|
*/
|
|
4273
4273
|
get monthLong() {
|
|
4274
|
-
return this.isValid ?
|
|
4274
|
+
return this.isValid ? Ve.months("long", { locObj: this.loc })[this.month - 1] : null;
|
|
4275
4275
|
}
|
|
4276
4276
|
/**
|
|
4277
4277
|
* Get the human readable short weekday, such as 'Mon'.
|
|
@@ -4280,7 +4280,7 @@ class y {
|
|
|
4280
4280
|
* @type {string}
|
|
4281
4281
|
*/
|
|
4282
4282
|
get weekdayShort() {
|
|
4283
|
-
return this.isValid ?
|
|
4283
|
+
return this.isValid ? Ve.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
|
|
4284
4284
|
}
|
|
4285
4285
|
/**
|
|
4286
4286
|
* Get the human readable long weekday, such as 'Monday'.
|
|
@@ -4289,7 +4289,7 @@ class y {
|
|
|
4289
4289
|
* @type {string}
|
|
4290
4290
|
*/
|
|
4291
4291
|
get weekdayLong() {
|
|
4292
|
-
return this.isValid ?
|
|
4292
|
+
return this.isValid ? Ve.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
|
|
4293
4293
|
}
|
|
4294
4294
|
/**
|
|
4295
4295
|
* Get the UTC offset of this DateTime in minutes
|
|
@@ -4346,11 +4346,11 @@ class y {
|
|
|
4346
4346
|
getPossibleOffsets() {
|
|
4347
4347
|
if (!this.isValid || this.isOffsetFixed)
|
|
4348
4348
|
return [this];
|
|
4349
|
-
const e = 864e5, n = 6e4, r =
|
|
4349
|
+
const e = 864e5, n = 6e4, r = ht(this.c), s = this.zone.offset(r - e), i = this.zone.offset(r + e), a = this.zone.offset(r - s * n), o = this.zone.offset(r - i * n);
|
|
4350
4350
|
if (a === o)
|
|
4351
4351
|
return [this];
|
|
4352
|
-
const l = r - a * n, u = r - o * n, d =
|
|
4353
|
-
return d.hour === m.hour && d.minute === m.minute && d.second === m.second && d.millisecond === m.millisecond ? [
|
|
4352
|
+
const l = r - a * n, u = r - o * n, d = Je(l, a), m = Je(u, o);
|
|
4353
|
+
return d.hour === m.hour && d.minute === m.minute && d.second === m.second && d.millisecond === m.millisecond ? [ce(this, { ts: l }), ce(this, { ts: u })] : [this];
|
|
4354
4354
|
}
|
|
4355
4355
|
/**
|
|
4356
4356
|
* Returns true if this DateTime is in a leap year, false otherwise
|
|
@@ -4359,7 +4359,7 @@ class y {
|
|
|
4359
4359
|
* @type {boolean}
|
|
4360
4360
|
*/
|
|
4361
4361
|
get isInLeapYear() {
|
|
4362
|
-
return
|
|
4362
|
+
return _e(this.year);
|
|
4363
4363
|
}
|
|
4364
4364
|
/**
|
|
4365
4365
|
* Returns the number of days in this DateTime's month
|
|
@@ -4368,7 +4368,7 @@ class y {
|
|
|
4368
4368
|
* @type {number}
|
|
4369
4369
|
*/
|
|
4370
4370
|
get daysInMonth() {
|
|
4371
|
-
return
|
|
4371
|
+
return it(this.year, this.month);
|
|
4372
4372
|
}
|
|
4373
4373
|
/**
|
|
4374
4374
|
* Returns the number of days in this DateTime's year
|
|
@@ -4377,7 +4377,7 @@ class y {
|
|
|
4377
4377
|
* @type {number}
|
|
4378
4378
|
*/
|
|
4379
4379
|
get daysInYear() {
|
|
4380
|
-
return this.isValid ?
|
|
4380
|
+
return this.isValid ? Se(this.year) : NaN;
|
|
4381
4381
|
}
|
|
4382
4382
|
/**
|
|
4383
4383
|
* Returns the number of weeks in this DateTime's year
|
|
@@ -4387,7 +4387,7 @@ class y {
|
|
|
4387
4387
|
* @type {number}
|
|
4388
4388
|
*/
|
|
4389
4389
|
get weeksInWeekYear() {
|
|
4390
|
-
return this.isValid ?
|
|
4390
|
+
return this.isValid ? Ze(this.weekYear) : NaN;
|
|
4391
4391
|
}
|
|
4392
4392
|
/**
|
|
4393
4393
|
* Returns the number of weeks in this DateTime's local week year
|
|
@@ -4396,7 +4396,7 @@ class y {
|
|
|
4396
4396
|
* @type {number}
|
|
4397
4397
|
*/
|
|
4398
4398
|
get weeksInLocalWeekYear() {
|
|
4399
|
-
return this.isValid ?
|
|
4399
|
+
return this.isValid ? Ze(
|
|
4400
4400
|
this.localWeekYear,
|
|
4401
4401
|
this.loc.getMinDaysInFirstWeek(),
|
|
4402
4402
|
this.loc.getStartOfWeek()
|
|
@@ -4446,17 +4446,17 @@ class y {
|
|
|
4446
4446
|
* @return {DateTime}
|
|
4447
4447
|
*/
|
|
4448
4448
|
setZone(e, { keepLocalTime: n = !1, keepCalendarTime: r = !1 } = {}) {
|
|
4449
|
-
if (e =
|
|
4449
|
+
if (e = oe(e, x.defaultZone), e.equals(this.zone))
|
|
4450
4450
|
return this;
|
|
4451
4451
|
if (e.isValid) {
|
|
4452
4452
|
let s = this.ts;
|
|
4453
4453
|
if (n || r) {
|
|
4454
4454
|
const i = e.offset(this.ts), a = this.toObject();
|
|
4455
|
-
[s] =
|
|
4455
|
+
[s] = Qe(a, i, e);
|
|
4456
4456
|
}
|
|
4457
|
-
return
|
|
4457
|
+
return ce(this, { ts: s, zone: e });
|
|
4458
4458
|
} else
|
|
4459
|
-
return y.invalid(
|
|
4459
|
+
return y.invalid(Ge(e));
|
|
4460
4460
|
}
|
|
4461
4461
|
/**
|
|
4462
4462
|
* "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.
|
|
@@ -4466,7 +4466,7 @@ class y {
|
|
|
4466
4466
|
*/
|
|
4467
4467
|
reconfigure({ locale: e, numberingSystem: n, outputCalendar: r } = {}) {
|
|
4468
4468
|
const s = this.loc.clone({ locale: e, numberingSystem: n, outputCalendar: r });
|
|
4469
|
-
return
|
|
4469
|
+
return ce(this, { loc: s });
|
|
4470
4470
|
}
|
|
4471
4471
|
/**
|
|
4472
4472
|
* "Set" the locale. Returns a newly-constructed DateTime.
|
|
@@ -4493,21 +4493,21 @@ class y {
|
|
|
4493
4493
|
set(e) {
|
|
4494
4494
|
if (!this.isValid)
|
|
4495
4495
|
return this;
|
|
4496
|
-
const n =
|
|
4496
|
+
const n = at(e, kn), { minDaysInFirstWeek: r, startOfWeek: s } = sn(n, this.loc), i = !p(n.weekYear) || !p(n.weekNumber) || !p(n.weekday), a = !p(n.ordinal), o = !p(n.year), l = !p(n.month) || !p(n.day), u = o || l, d = n.weekYear || n.weekNumber;
|
|
4497
4497
|
if ((u || a) && d)
|
|
4498
|
-
throw new
|
|
4498
|
+
throw new ke(
|
|
4499
4499
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
4500
4500
|
);
|
|
4501
4501
|
if (l && a)
|
|
4502
|
-
throw new
|
|
4502
|
+
throw new ke("Can't mix ordinal dates with month/day");
|
|
4503
4503
|
let m;
|
|
4504
|
-
i ? m =
|
|
4505
|
-
{ ...
|
|
4504
|
+
i ? m = nn(
|
|
4505
|
+
{ ...st(this.c, r, s), ...n },
|
|
4506
4506
|
r,
|
|
4507
4507
|
s
|
|
4508
|
-
) : p(n.ordinal) ? (m = { ...this.toObject(), ...n }, p(n.day) && (m.day = Math.min(
|
|
4509
|
-
const [
|
|
4510
|
-
return
|
|
4508
|
+
) : p(n.ordinal) ? (m = { ...this.toObject(), ...n }, p(n.day) && (m.day = Math.min(it(m.year, m.month), m.day))) : m = rn({ ...Tt(this.c), ...n });
|
|
4509
|
+
const [O, f] = Qe(m, this.o, this.zone);
|
|
4510
|
+
return ce(this, { ts: O, o: f });
|
|
4511
4511
|
}
|
|
4512
4512
|
/**
|
|
4513
4513
|
* Add a period of time to this DateTime and return the resulting DateTime
|
|
@@ -4525,8 +4525,8 @@ class y {
|
|
|
4525
4525
|
plus(e) {
|
|
4526
4526
|
if (!this.isValid)
|
|
4527
4527
|
return this;
|
|
4528
|
-
const n =
|
|
4529
|
-
return
|
|
4528
|
+
const n = v.fromDurationLike(e);
|
|
4529
|
+
return ce(this, wn(this, n));
|
|
4530
4530
|
}
|
|
4531
4531
|
/**
|
|
4532
4532
|
* Subtract a period of time to this DateTime and return the resulting DateTime
|
|
@@ -4537,8 +4537,8 @@ class y {
|
|
|
4537
4537
|
minus(e) {
|
|
4538
4538
|
if (!this.isValid)
|
|
4539
4539
|
return this;
|
|
4540
|
-
const n =
|
|
4541
|
-
return
|
|
4540
|
+
const n = v.fromDurationLike(e).negate();
|
|
4541
|
+
return ce(this, wn(this, n));
|
|
4542
4542
|
}
|
|
4543
4543
|
/**
|
|
4544
4544
|
* "Set" this DateTime to the beginning of a unit of time.
|
|
@@ -4555,7 +4555,7 @@ class y {
|
|
|
4555
4555
|
startOf(e, { useLocaleWeeks: n = !1 } = {}) {
|
|
4556
4556
|
if (!this.isValid)
|
|
4557
4557
|
return this;
|
|
4558
|
-
const r = {}, s =
|
|
4558
|
+
const r = {}, s = v.normalizeUnit(e);
|
|
4559
4559
|
switch (s) {
|
|
4560
4560
|
case "years":
|
|
4561
4561
|
r.month = 1;
|
|
@@ -4614,7 +4614,7 @@ class y {
|
|
|
4614
4614
|
* @return {string}
|
|
4615
4615
|
*/
|
|
4616
4616
|
toFormat(e, n = {}) {
|
|
4617
|
-
return this.isValid ? V.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this, e) :
|
|
4617
|
+
return this.isValid ? V.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this, e) : Ot;
|
|
4618
4618
|
}
|
|
4619
4619
|
/**
|
|
4620
4620
|
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
|
|
@@ -4635,8 +4635,8 @@ class y {
|
|
|
4635
4635
|
* @example DateTime.now().toLocaleString({ hour: '2-digit', minute: '2-digit', hourCycle: 'h23' }); //=> '11:32'
|
|
4636
4636
|
* @return {string}
|
|
4637
4637
|
*/
|
|
4638
|
-
toLocaleString(e =
|
|
4639
|
-
return this.isValid ? V.create(this.loc.clone(n), e).formatDateTime(this) :
|
|
4638
|
+
toLocaleString(e = rt, n = {}) {
|
|
4639
|
+
return this.isValid ? V.create(this.loc.clone(n), e).formatDateTime(this) : Ot;
|
|
4640
4640
|
}
|
|
4641
4641
|
/**
|
|
4642
4642
|
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
|
|
@@ -4678,8 +4678,8 @@ class y {
|
|
|
4678
4678
|
if (!this.isValid)
|
|
4679
4679
|
return null;
|
|
4680
4680
|
const a = e === "extended";
|
|
4681
|
-
let o =
|
|
4682
|
-
return o += "T", o +=
|
|
4681
|
+
let o = Nt(this, a);
|
|
4682
|
+
return o += "T", o += pn(this, a, n, r, s, i), o;
|
|
4683
4683
|
}
|
|
4684
4684
|
/**
|
|
4685
4685
|
* Returns an ISO 8601-compliant string representation of this DateTime's date component
|
|
@@ -4690,7 +4690,7 @@ class y {
|
|
|
4690
4690
|
* @return {string}
|
|
4691
4691
|
*/
|
|
4692
4692
|
toISODate({ format: e = "extended" } = {}) {
|
|
4693
|
-
return this.isValid ?
|
|
4693
|
+
return this.isValid ? Nt(this, e === "extended") : null;
|
|
4694
4694
|
}
|
|
4695
4695
|
/**
|
|
4696
4696
|
* Returns an ISO 8601-compliant string representation of this DateTime's week date
|
|
@@ -4698,7 +4698,7 @@ class y {
|
|
|
4698
4698
|
* @return {string}
|
|
4699
4699
|
*/
|
|
4700
4700
|
toISOWeekDate() {
|
|
4701
|
-
return
|
|
4701
|
+
return Be(this, "kkkk-'W'WW-c");
|
|
4702
4702
|
}
|
|
4703
4703
|
/**
|
|
4704
4704
|
* Returns an ISO 8601-compliant string representation of this DateTime's time component
|
|
@@ -4723,7 +4723,7 @@ class y {
|
|
|
4723
4723
|
extendedZone: i = !1,
|
|
4724
4724
|
format: a = "extended"
|
|
4725
4725
|
} = {}) {
|
|
4726
|
-
return this.isValid ? (s ? "T" : "") +
|
|
4726
|
+
return this.isValid ? (s ? "T" : "") + pn(
|
|
4727
4727
|
this,
|
|
4728
4728
|
a === "extended",
|
|
4729
4729
|
n,
|
|
@@ -4739,7 +4739,7 @@ class y {
|
|
|
4739
4739
|
* @return {string}
|
|
4740
4740
|
*/
|
|
4741
4741
|
toRFC2822() {
|
|
4742
|
-
return
|
|
4742
|
+
return Be(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", !1);
|
|
4743
4743
|
}
|
|
4744
4744
|
/**
|
|
4745
4745
|
* Returns a string representation of this DateTime appropriate for use in HTTP headers. The output is always expressed in GMT.
|
|
@@ -4750,7 +4750,7 @@ class y {
|
|
|
4750
4750
|
* @return {string}
|
|
4751
4751
|
*/
|
|
4752
4752
|
toHTTP() {
|
|
4753
|
-
return
|
|
4753
|
+
return Be(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'");
|
|
4754
4754
|
}
|
|
4755
4755
|
/**
|
|
4756
4756
|
* Returns a string representation of this DateTime appropriate for use in SQL Date
|
|
@@ -4758,7 +4758,7 @@ class y {
|
|
|
4758
4758
|
* @return {string}
|
|
4759
4759
|
*/
|
|
4760
4760
|
toSQLDate() {
|
|
4761
|
-
return this.isValid ?
|
|
4761
|
+
return this.isValid ? Nt(this, !0) : null;
|
|
4762
4762
|
}
|
|
4763
4763
|
/**
|
|
4764
4764
|
* Returns a string representation of this DateTime appropriate for use in SQL Time
|
|
@@ -4774,7 +4774,7 @@ class y {
|
|
|
4774
4774
|
*/
|
|
4775
4775
|
toSQLTime({ includeOffset: e = !0, includeZone: n = !1, includeOffsetSpace: r = !0 } = {}) {
|
|
4776
4776
|
let s = "HH:mm:ss.SSS";
|
|
4777
|
-
return (n || e) && (r && (s += " "), n ? s += "z" : e && (s += "ZZ")),
|
|
4777
|
+
return (n || e) && (r && (s += " "), n ? s += "z" : e && (s += "ZZ")), Be(this, s, !0);
|
|
4778
4778
|
}
|
|
4779
4779
|
/**
|
|
4780
4780
|
* Returns a string representation of this DateTime appropriate for use in SQL DateTime
|
|
@@ -4796,7 +4796,7 @@ class y {
|
|
|
4796
4796
|
* @return {string}
|
|
4797
4797
|
*/
|
|
4798
4798
|
toString() {
|
|
4799
|
-
return this.isValid ? this.toISO() :
|
|
4799
|
+
return this.isValid ? this.toISO() : Ot;
|
|
4800
4800
|
}
|
|
4801
4801
|
/**
|
|
4802
4802
|
* Returns a string representation of this DateTime appropriate for the REPL.
|
|
@@ -4885,8 +4885,8 @@ class y {
|
|
|
4885
4885
|
*/
|
|
4886
4886
|
diff(e, n = "milliseconds", r = {}) {
|
|
4887
4887
|
if (!this.isValid || !e.isValid)
|
|
4888
|
-
return
|
|
4889
|
-
const s = { locale: this.locale, numberingSystem: this.numberingSystem, ...r }, i =
|
|
4888
|
+
return v.invalid("created by diffing an invalid DateTime");
|
|
4889
|
+
const s = { locale: this.locale, numberingSystem: this.numberingSystem, ...r }, i = ps(n).map(v.normalizeUnit), a = e.valueOf() > this.valueOf(), o = a ? this : e, l = a ? e : this, u = vi(o, l, i, s);
|
|
4890
4890
|
return a ? u.negate() : u;
|
|
4891
4891
|
}
|
|
4892
4892
|
/**
|
|
@@ -4958,7 +4958,7 @@ class y {
|
|
|
4958
4958
|
return null;
|
|
4959
4959
|
const n = e.base || y.fromObject({}, { zone: this.zone }), r = e.padding ? this < n ? -e.padding : e.padding : 0;
|
|
4960
4960
|
let s = ["years", "months", "days", "hours", "minutes", "seconds"], i = e.unit;
|
|
4961
|
-
return Array.isArray(e.unit) && (s = e.unit, i = void 0),
|
|
4961
|
+
return Array.isArray(e.unit) && (s = e.unit, i = void 0), Tn(n, this.plus(r), {
|
|
4962
4962
|
...e,
|
|
4963
4963
|
numeric: "always",
|
|
4964
4964
|
units: s,
|
|
@@ -4979,7 +4979,7 @@ class y {
|
|
|
4979
4979
|
* @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
|
|
4980
4980
|
*/
|
|
4981
4981
|
toRelativeCalendar(e = {}) {
|
|
4982
|
-
return this.isValid ?
|
|
4982
|
+
return this.isValid ? Tn(e.base || y.fromObject({}, { zone: this.zone }), this, {
|
|
4983
4983
|
...e,
|
|
4984
4984
|
numeric: "auto",
|
|
4985
4985
|
units: ["years", "months", "days"],
|
|
@@ -4993,8 +4993,8 @@ class y {
|
|
|
4993
4993
|
*/
|
|
4994
4994
|
static min(...e) {
|
|
4995
4995
|
if (!e.every(y.isDateTime))
|
|
4996
|
-
throw new
|
|
4997
|
-
return
|
|
4996
|
+
throw new Z("min requires all arguments be DateTimes");
|
|
4997
|
+
return an(e, (n) => n.valueOf(), Math.min);
|
|
4998
4998
|
}
|
|
4999
4999
|
/**
|
|
5000
5000
|
* Return the max of several date times
|
|
@@ -5003,8 +5003,8 @@ class y {
|
|
|
5003
5003
|
*/
|
|
5004
5004
|
static max(...e) {
|
|
5005
5005
|
if (!e.every(y.isDateTime))
|
|
5006
|
-
throw new
|
|
5007
|
-
return
|
|
5006
|
+
throw new Z("max requires all arguments be DateTimes");
|
|
5007
|
+
return an(e, (n) => n.valueOf(), Math.max);
|
|
5008
5008
|
}
|
|
5009
5009
|
// MISC
|
|
5010
5010
|
/**
|
|
@@ -5020,7 +5020,7 @@ class y {
|
|
|
5020
5020
|
numberingSystem: i,
|
|
5021
5021
|
defaultToEN: !0
|
|
5022
5022
|
});
|
|
5023
|
-
return
|
|
5023
|
+
return wr(a, e, n);
|
|
5024
5024
|
}
|
|
5025
5025
|
/**
|
|
5026
5026
|
* @deprecated use fromFormatExplain instead
|
|
@@ -5034,210 +5034,212 @@ class y {
|
|
|
5034
5034
|
* @type {Object}
|
|
5035
5035
|
*/
|
|
5036
5036
|
static get DATE_SHORT() {
|
|
5037
|
-
return
|
|
5037
|
+
return rt;
|
|
5038
5038
|
}
|
|
5039
5039
|
/**
|
|
5040
5040
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983'
|
|
5041
5041
|
* @type {Object}
|
|
5042
5042
|
*/
|
|
5043
5043
|
static get DATE_MED() {
|
|
5044
|
-
return
|
|
5044
|
+
return Mn;
|
|
5045
5045
|
}
|
|
5046
5046
|
/**
|
|
5047
5047
|
* {@link DateTime#toLocaleString} format like 'Fri, Oct 14, 1983'
|
|
5048
5048
|
* @type {Object}
|
|
5049
5049
|
*/
|
|
5050
5050
|
static get DATE_MED_WITH_WEEKDAY() {
|
|
5051
|
-
return
|
|
5051
|
+
return jr;
|
|
5052
5052
|
}
|
|
5053
5053
|
/**
|
|
5054
5054
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983'
|
|
5055
5055
|
* @type {Object}
|
|
5056
5056
|
*/
|
|
5057
5057
|
static get DATE_FULL() {
|
|
5058
|
-
return
|
|
5058
|
+
return Dn;
|
|
5059
5059
|
}
|
|
5060
5060
|
/**
|
|
5061
5061
|
* {@link DateTime#toLocaleString} format like 'Tuesday, October 14, 1983'
|
|
5062
5062
|
* @type {Object}
|
|
5063
5063
|
*/
|
|
5064
5064
|
static get DATE_HUGE() {
|
|
5065
|
-
return
|
|
5065
|
+
return Nn;
|
|
5066
5066
|
}
|
|
5067
5067
|
/**
|
|
5068
5068
|
* {@link DateTime#toLocaleString} format like '09:30 AM'. Only 12-hour if the locale is.
|
|
5069
5069
|
* @type {Object}
|
|
5070
5070
|
*/
|
|
5071
5071
|
static get TIME_SIMPLE() {
|
|
5072
|
-
return
|
|
5072
|
+
return In;
|
|
5073
5073
|
}
|
|
5074
5074
|
/**
|
|
5075
5075
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM'. Only 12-hour if the locale is.
|
|
5076
5076
|
* @type {Object}
|
|
5077
5077
|
*/
|
|
5078
5078
|
static get TIME_WITH_SECONDS() {
|
|
5079
|
-
return
|
|
5079
|
+
return xn;
|
|
5080
5080
|
}
|
|
5081
5081
|
/**
|
|
5082
5082
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM EDT'. Only 12-hour if the locale is.
|
|
5083
5083
|
* @type {Object}
|
|
5084
5084
|
*/
|
|
5085
5085
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
5086
|
-
return
|
|
5086
|
+
return En;
|
|
5087
5087
|
}
|
|
5088
5088
|
/**
|
|
5089
5089
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
5090
5090
|
* @type {Object}
|
|
5091
5091
|
*/
|
|
5092
5092
|
static get TIME_WITH_LONG_OFFSET() {
|
|
5093
|
-
return
|
|
5093
|
+
return bn;
|
|
5094
5094
|
}
|
|
5095
5095
|
/**
|
|
5096
5096
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
5097
5097
|
* @type {Object}
|
|
5098
5098
|
*/
|
|
5099
5099
|
static get TIME_24_SIMPLE() {
|
|
5100
|
-
return
|
|
5100
|
+
return Fn;
|
|
5101
5101
|
}
|
|
5102
5102
|
/**
|
|
5103
5103
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
5104
5104
|
* @type {Object}
|
|
5105
5105
|
*/
|
|
5106
5106
|
static get TIME_24_WITH_SECONDS() {
|
|
5107
|
-
return
|
|
5107
|
+
return Cn;
|
|
5108
5108
|
}
|
|
5109
5109
|
/**
|
|
5110
5110
|
* {@link DateTime#toLocaleString} format like '09:30:23 EDT', always 24-hour.
|
|
5111
5111
|
* @type {Object}
|
|
5112
5112
|
*/
|
|
5113
5113
|
static get TIME_24_WITH_SHORT_OFFSET() {
|
|
5114
|
-
return
|
|
5114
|
+
return Vn;
|
|
5115
5115
|
}
|
|
5116
5116
|
/**
|
|
5117
5117
|
* {@link DateTime#toLocaleString} format like '09:30:23 Eastern Daylight Time', always 24-hour.
|
|
5118
5118
|
* @type {Object}
|
|
5119
5119
|
*/
|
|
5120
5120
|
static get TIME_24_WITH_LONG_OFFSET() {
|
|
5121
|
-
return
|
|
5121
|
+
return Wn;
|
|
5122
5122
|
}
|
|
5123
5123
|
/**
|
|
5124
5124
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
5125
5125
|
* @type {Object}
|
|
5126
5126
|
*/
|
|
5127
5127
|
static get DATETIME_SHORT() {
|
|
5128
|
-
return
|
|
5128
|
+
return Ln;
|
|
5129
5129
|
}
|
|
5130
5130
|
/**
|
|
5131
5131
|
* {@link DateTime#toLocaleString} format like '10/14/1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
5132
5132
|
* @type {Object}
|
|
5133
5133
|
*/
|
|
5134
5134
|
static get DATETIME_SHORT_WITH_SECONDS() {
|
|
5135
|
-
return
|
|
5135
|
+
return $n;
|
|
5136
5136
|
}
|
|
5137
5137
|
/**
|
|
5138
5138
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
5139
5139
|
* @type {Object}
|
|
5140
5140
|
*/
|
|
5141
5141
|
static get DATETIME_MED() {
|
|
5142
|
-
return
|
|
5142
|
+
return Zn;
|
|
5143
5143
|
}
|
|
5144
5144
|
/**
|
|
5145
5145
|
* {@link DateTime#toLocaleString} format like 'Oct 14, 1983, 9:30:33 AM'. Only 12-hour if the locale is.
|
|
5146
5146
|
* @type {Object}
|
|
5147
5147
|
*/
|
|
5148
5148
|
static get DATETIME_MED_WITH_SECONDS() {
|
|
5149
|
-
return
|
|
5149
|
+
return zn;
|
|
5150
5150
|
}
|
|
5151
5151
|
/**
|
|
5152
5152
|
* {@link DateTime#toLocaleString} format like 'Fri, 14 Oct 1983, 9:30 AM'. Only 12-hour if the locale is.
|
|
5153
5153
|
* @type {Object}
|
|
5154
5154
|
*/
|
|
5155
5155
|
static get DATETIME_MED_WITH_WEEKDAY() {
|
|
5156
|
-
return
|
|
5156
|
+
return Gr;
|
|
5157
5157
|
}
|
|
5158
5158
|
/**
|
|
5159
5159
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
|
|
5160
5160
|
* @type {Object}
|
|
5161
5161
|
*/
|
|
5162
5162
|
static get DATETIME_FULL() {
|
|
5163
|
-
return
|
|
5163
|
+
return An;
|
|
5164
5164
|
}
|
|
5165
5165
|
/**
|
|
5166
5166
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30:33 AM EDT'. Only 12-hour if the locale is.
|
|
5167
5167
|
* @type {Object}
|
|
5168
5168
|
*/
|
|
5169
5169
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
5170
|
-
return
|
|
5170
|
+
return _n;
|
|
5171
5171
|
}
|
|
5172
5172
|
/**
|
|
5173
5173
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
5174
5174
|
* @type {Object}
|
|
5175
5175
|
*/
|
|
5176
5176
|
static get DATETIME_HUGE() {
|
|
5177
|
-
return
|
|
5177
|
+
return qn;
|
|
5178
5178
|
}
|
|
5179
5179
|
/**
|
|
5180
5180
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
5181
5181
|
* @type {Object}
|
|
5182
5182
|
*/
|
|
5183
5183
|
static get DATETIME_HUGE_WITH_SECONDS() {
|
|
5184
|
-
return
|
|
5184
|
+
return Rn;
|
|
5185
5185
|
}
|
|
5186
5186
|
}
|
|
5187
|
-
function
|
|
5187
|
+
function Fe(t) {
|
|
5188
5188
|
if (y.isDateTime(t))
|
|
5189
5189
|
return t;
|
|
5190
|
-
if (t && t.valueOf &&
|
|
5190
|
+
if (t && t.valueOf && fe(t.valueOf()))
|
|
5191
5191
|
return y.fromJSDate(t);
|
|
5192
5192
|
if (t && typeof t == "object")
|
|
5193
5193
|
return y.fromObject(t);
|
|
5194
|
-
throw new
|
|
5194
|
+
throw new Z(
|
|
5195
5195
|
`Unknown datetime argument: ${t}, of type ${typeof t}`
|
|
5196
5196
|
);
|
|
5197
5197
|
}
|
|
5198
|
-
const Ui = "_calendar_1qrsz_4",
|
|
5198
|
+
const Ui = "_calendar_1qrsz_4", Hi = "_header_1qrsz_17", Yi = "_heading_1qrsz_42", Pi = "_controller_1qrsz_48", ji = "_spacer_1qrsz_56", Gi = "_fadein_1qrsz_1", Ji = "_cell_1qrsz_69", Bi = "_overflow_1qrsz_99", Ki = "_content_1qrsz_102", Qi = "_weekday_1qrsz_105", Xi = "_range_1qrsz_130", ea = "_selected_1qrsz_140", ta = "_unavailable_1qrsz_148", N = {
|
|
5199
5199
|
calendar: Ui,
|
|
5200
|
-
header:
|
|
5201
|
-
heading:
|
|
5202
|
-
controller:
|
|
5203
|
-
spacer:
|
|
5200
|
+
header: Hi,
|
|
5201
|
+
heading: Yi,
|
|
5202
|
+
controller: Pi,
|
|
5203
|
+
spacer: ji,
|
|
5204
5204
|
"day-grid": "_day-grid_1qrsz_59",
|
|
5205
|
-
fadein:
|
|
5206
|
-
cell:
|
|
5207
|
-
overflow:
|
|
5208
|
-
content:
|
|
5209
|
-
weekday:
|
|
5205
|
+
fadein: Gi,
|
|
5206
|
+
cell: Ji,
|
|
5207
|
+
overflow: Bi,
|
|
5208
|
+
content: Ki,
|
|
5209
|
+
weekday: Qi,
|
|
5210
5210
|
"range-first": "_range-first_1qrsz_130",
|
|
5211
5211
|
"range-last": "_range-last_1qrsz_130",
|
|
5212
|
-
range:
|
|
5213
|
-
selected:
|
|
5214
|
-
unavailable:
|
|
5212
|
+
range: Xi,
|
|
5213
|
+
selected: ea,
|
|
5214
|
+
unavailable: ta,
|
|
5215
5215
|
"hover-last": "_hover-last_1qrsz_206",
|
|
5216
5216
|
"range-fill": "_range-fill_1qrsz_210",
|
|
5217
5217
|
"range-disabled": "_range-disabled_1qrsz_220",
|
|
5218
5218
|
"controller-button": "_controller-button_1qrsz_228"
|
|
5219
|
-
},
|
|
5219
|
+
}, na = (t) => /* @__PURE__ */ tt.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t }, /* @__PURE__ */ tt.createElement("path", { d: "M14.71 15.88 10.83 12l3.88-3.88a.996.996 0 1 0-1.41-1.41L8.71 11.3a.996.996 0 0 0 0 1.41l4.59 4.59c.39.39 1.02.39 1.41 0 .38-.39.39-1.03 0-1.42z" })), z = (t, e) => {
|
|
5220
5220
|
if (!(!t || !e))
|
|
5221
|
-
|
|
5222
|
-
|
|
5221
|
+
try {
|
|
5222
|
+
return !!(t.hasSame(e, "month") && t.hasSame(e, "year") && t.hasSame(e, "day"));
|
|
5223
|
+
} catch {
|
|
5224
|
+
return !1;
|
|
5225
|
+
}
|
|
5226
|
+
}, $e = (t, e) => {
|
|
5223
5227
|
if (!(!t || !e))
|
|
5224
5228
|
return !!(t.hasSame(e, "month") && t.hasSame(e, "year"));
|
|
5225
|
-
},
|
|
5229
|
+
}, ie = (t, e, n) => {
|
|
5226
5230
|
const r = /* @__PURE__ */ new Set();
|
|
5227
5231
|
return e.forEach((s) => {
|
|
5228
|
-
r.add(
|
|
5229
|
-
y.fromISO(s, { zone: n }).startOf("day").toISO()
|
|
5230
|
-
);
|
|
5232
|
+
r.add(B(y.fromISO(s, { zone: n })));
|
|
5231
5233
|
}), r.has(
|
|
5232
|
-
y.fromISO(t.toISO(), { zone: n })
|
|
5234
|
+
B(y.fromISO(t.toISO(), { zone: n }))
|
|
5233
5235
|
);
|
|
5234
|
-
},
|
|
5235
|
-
function
|
|
5236
|
+
}, Xe = (t, e) => e && e.toMillis() > t.toMillis(), et = (t, e) => e && e.toMillis() < t.toMillis(), C = (t, e) => y.fromISO(t, { zone: e }).startOf("day"), B = (t) => t.startOf("day").toISO();
|
|
5237
|
+
function Vt(t, e, n, r) {
|
|
5236
5238
|
if (t.start && z(t.start, e) && !t.end) {
|
|
5237
5239
|
n((s) => ({ ...s, end: e })), r == null || r({
|
|
5238
5240
|
value: {
|
|
5239
|
-
start: t.start
|
|
5240
|
-
end: e
|
|
5241
|
+
start: B(t.start) ?? void 0,
|
|
5242
|
+
end: B(e) ?? void 0
|
|
5241
5243
|
}
|
|
5242
5244
|
});
|
|
5243
5245
|
return;
|
|
@@ -5245,7 +5247,7 @@ function Ct(t, e, n, r) {
|
|
|
5245
5247
|
if (!t.start && !t.end || t.start && t.end || t.start && !t.end && t.start.startOf("day").toMillis() > e.startOf("day").toMillis()) {
|
|
5246
5248
|
n({ start: e, end: null }), r == null || r({
|
|
5247
5249
|
value: {
|
|
5248
|
-
start: e
|
|
5250
|
+
start: B(e) ?? void 0,
|
|
5249
5251
|
end: void 0
|
|
5250
5252
|
}
|
|
5251
5253
|
});
|
|
@@ -5254,8 +5256,8 @@ function Ct(t, e, n, r) {
|
|
|
5254
5256
|
if (t.start && !t.end && t.start.startOf("day").toMillis() < e.startOf("day").toMillis()) {
|
|
5255
5257
|
n((s) => ({ ...s, end: e })), r == null || r({
|
|
5256
5258
|
value: {
|
|
5257
|
-
start: t.start
|
|
5258
|
-
end: e
|
|
5259
|
+
start: B(t.start) ?? void 0,
|
|
5260
|
+
end: B(e) ?? void 0
|
|
5259
5261
|
}
|
|
5260
5262
|
});
|
|
5261
5263
|
return;
|
|
@@ -5263,16 +5265,16 @@ function Ct(t, e, n, r) {
|
|
|
5263
5265
|
if (!t.start && t.end) {
|
|
5264
5266
|
n((s) => ({ ...s, start: e })), r == null || r({
|
|
5265
5267
|
value: {
|
|
5266
|
-
start: e
|
|
5267
|
-
end: t.end
|
|
5268
|
+
start: B(e) ?? void 0,
|
|
5269
|
+
end: B(t.end) ?? void 0
|
|
5268
5270
|
}
|
|
5269
5271
|
});
|
|
5270
5272
|
return;
|
|
5271
5273
|
}
|
|
5272
5274
|
}
|
|
5273
|
-
const
|
|
5275
|
+
const ot = ee(
|
|
5274
5276
|
(t, e) => {
|
|
5275
|
-
const { onClick: n, className: r, ...s } = t, { focusedDate: i, setFocusedDate: a, minDate: o } =
|
|
5277
|
+
const { onClick: n, className: r, ...s } = t, { focusedDate: i, setFocusedDate: a, minDate: o } = gt(), l = (u) => {
|
|
5276
5278
|
n == null || n(u);
|
|
5277
5279
|
const d = i.minus({ month: 1 }).endOf("month"), m = i.minus({ month: 1 });
|
|
5278
5280
|
if (o !== null) {
|
|
@@ -5280,20 +5282,20 @@ const at = X(
|
|
|
5280
5282
|
a(m);
|
|
5281
5283
|
return;
|
|
5282
5284
|
}
|
|
5283
|
-
|
|
5285
|
+
$e(d, i) || a(o);
|
|
5284
5286
|
return;
|
|
5285
5287
|
}
|
|
5286
5288
|
a(m);
|
|
5287
5289
|
};
|
|
5288
5290
|
return /* @__PURE__ */ S.jsx(
|
|
5289
|
-
|
|
5291
|
+
Lt,
|
|
5290
5292
|
{
|
|
5291
5293
|
ref: e,
|
|
5292
5294
|
onClick: l,
|
|
5293
|
-
className:
|
|
5295
|
+
className: We(N["controller-button"], r),
|
|
5294
5296
|
appearance: "ghost",
|
|
5295
5297
|
size: "small",
|
|
5296
|
-
icon:
|
|
5298
|
+
icon: na,
|
|
5297
5299
|
"data-anv": "calendar-prev",
|
|
5298
5300
|
"aria-label": "Previous Month",
|
|
5299
5301
|
...s
|
|
@@ -5301,10 +5303,10 @@ const at = X(
|
|
|
5301
5303
|
);
|
|
5302
5304
|
}
|
|
5303
5305
|
);
|
|
5304
|
-
|
|
5305
|
-
const
|
|
5306
|
+
ot.displayName = "CalendarPrev";
|
|
5307
|
+
const ra = (t) => /* @__PURE__ */ tt.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t }, /* @__PURE__ */ tt.createElement("path", { d: "M9.29 15.88 13.17 12 9.29 8.12a.996.996 0 1 1 1.41-1.41l4.59 4.59c.39.39.39 1.02 0 1.41L10.7 17.3a.996.996 0 0 1-1.41 0c-.38-.39-.39-1.03 0-1.42z" })), lt = ee(
|
|
5306
5308
|
(t, e) => {
|
|
5307
|
-
const { onClick: n, className: r, ...s } = t, { focusedDate: i, setFocusedDate: a, maxDate: o } =
|
|
5309
|
+
const { onClick: n, className: r, ...s } = t, { focusedDate: i, setFocusedDate: a, maxDate: o } = gt(), l = (u) => {
|
|
5308
5310
|
n == null || n(u);
|
|
5309
5311
|
const d = i.plus({ month: 1 }).startOf("month"), m = i.plus({ month: 1 });
|
|
5310
5312
|
if (o !== null) {
|
|
@@ -5312,19 +5314,19 @@ const na = (t) => /* @__PURE__ */ et.createElement("svg", { xmlns: "http://www.w
|
|
|
5312
5314
|
a(m);
|
|
5313
5315
|
return;
|
|
5314
5316
|
}
|
|
5315
|
-
|
|
5317
|
+
$e(d, i) || a(o);
|
|
5316
5318
|
return;
|
|
5317
5319
|
}
|
|
5318
5320
|
a(m);
|
|
5319
5321
|
};
|
|
5320
5322
|
return /* @__PURE__ */ S.jsx(
|
|
5321
|
-
|
|
5323
|
+
Lt,
|
|
5322
5324
|
{
|
|
5323
5325
|
onClick: l,
|
|
5324
5326
|
appearance: "ghost",
|
|
5325
5327
|
size: "small",
|
|
5326
|
-
className:
|
|
5327
|
-
icon:
|
|
5328
|
+
className: We(N["controller-button"], r),
|
|
5329
|
+
icon: ra,
|
|
5328
5330
|
"aria-label": "Next Month",
|
|
5329
5331
|
"data-anv": "calendar-next",
|
|
5330
5332
|
ref: e,
|
|
@@ -5333,10 +5335,10 @@ const na = (t) => /* @__PURE__ */ et.createElement("svg", { xmlns: "http://www.w
|
|
|
5333
5335
|
);
|
|
5334
5336
|
}
|
|
5335
5337
|
);
|
|
5336
|
-
|
|
5337
|
-
const
|
|
5338
|
+
lt.displayName = "CalendarNext";
|
|
5339
|
+
const ut = ee(
|
|
5338
5340
|
(t, e) => {
|
|
5339
|
-
const { className: n, ...r } = t, s =
|
|
5341
|
+
const { className: n, ...r } = t, s = gt(), {
|
|
5340
5342
|
value: i,
|
|
5341
5343
|
setValue: a,
|
|
5342
5344
|
focusedDate: o,
|
|
@@ -5344,7 +5346,7 @@ const lt = X(
|
|
|
5344
5346
|
hoveredDate: u,
|
|
5345
5347
|
setHoveredDate: d,
|
|
5346
5348
|
onSelection: m,
|
|
5347
|
-
locale:
|
|
5349
|
+
locale: O,
|
|
5348
5350
|
minDate: f,
|
|
5349
5351
|
maxDate: w,
|
|
5350
5352
|
unavailableDates: E,
|
|
@@ -5352,15 +5354,15 @@ const lt = X(
|
|
|
5352
5354
|
controlled: F,
|
|
5353
5355
|
id: _,
|
|
5354
5356
|
range: L,
|
|
5355
|
-
dateFormat:
|
|
5356
|
-
startDay:
|
|
5357
|
-
} = s, Y =
|
|
5357
|
+
dateFormat: X,
|
|
5358
|
+
startDay: le
|
|
5359
|
+
} = s, Y = Lr(!1), te = We(N.grid, n), $ = $r(
|
|
5358
5360
|
(h) => {
|
|
5359
5361
|
if (!(w !== null && h.toMillis() > (w == null ? void 0 : w.toMillis()))) {
|
|
5360
|
-
if (
|
|
5362
|
+
if (ie(h, E, g)) {
|
|
5361
5363
|
let k = h.plus({ days: 1 });
|
|
5362
|
-
for (let
|
|
5363
|
-
if (
|
|
5364
|
+
for (let T = 0; T < 365 && !(w !== null && k.toMillis() > (w == null ? void 0 : w.toMillis())); T++)
|
|
5365
|
+
if (ie(
|
|
5364
5366
|
k,
|
|
5365
5367
|
E,
|
|
5366
5368
|
g
|
|
@@ -5378,10 +5380,10 @@ const lt = X(
|
|
|
5378
5380
|
[w, l, g, E]
|
|
5379
5381
|
), P = (h) => {
|
|
5380
5382
|
if (!(f !== null && h.toMillis() < (f == null ? void 0 : f.toMillis()))) {
|
|
5381
|
-
if (
|
|
5383
|
+
if (ie(h, E, g)) {
|
|
5382
5384
|
let k = h.minus({ days: 1 });
|
|
5383
|
-
for (let
|
|
5384
|
-
if (
|
|
5385
|
+
for (let T = 0; T < 365 && !(f !== null && k.toMillis() < (f == null ? void 0 : f.toMillis())); T++)
|
|
5386
|
+
if (ie(k, E, g))
|
|
5385
5387
|
k = k.minus({ days: 1 });
|
|
5386
5388
|
else {
|
|
5387
5389
|
l(k);
|
|
@@ -5391,7 +5393,7 @@ const lt = X(
|
|
|
5391
5393
|
}
|
|
5392
5394
|
l(h);
|
|
5393
5395
|
}
|
|
5394
|
-
}, q = (h, k) => L ? i.start && i.end ? h.toMillis() >= i.start.startOf("day").toMillis() && h.toMillis() <= i.end.endOf("day").toMillis() : z(h, i.start) : z(h, k ?? i),
|
|
5396
|
+
}, q = (h, k) => L ? i.start && i.end ? h.toMillis() >= i.start.startOf("day").toMillis() && h.toMillis() <= i.end.endOf("day").toMillis() : z(h, i.start) : z(h, k ?? i), me = (h) => L && i.start && i.end ? h.toMillis() >= i.start.startOf("day").toMillis() && h.toMillis() <= i.end.endOf("day").toMillis() && !z(i.start, h) && !z(i.end, h) : !1, ye = (h) => {
|
|
5395
5397
|
switch (h.code) {
|
|
5396
5398
|
case "Space":
|
|
5397
5399
|
case "Enter":
|
|
@@ -5401,19 +5403,19 @@ const lt = X(
|
|
|
5401
5403
|
});
|
|
5402
5404
|
break;
|
|
5403
5405
|
}
|
|
5404
|
-
|
|
5406
|
+
Vt(i, o, a, m);
|
|
5405
5407
|
break;
|
|
5406
5408
|
case "ArrowLeft":
|
|
5407
5409
|
h.preventDefault(), P(o.minus({ days: 1 }));
|
|
5408
5410
|
break;
|
|
5409
5411
|
case "ArrowRight":
|
|
5410
|
-
h.preventDefault(),
|
|
5412
|
+
h.preventDefault(), $(o.plus({ days: 1 }));
|
|
5411
5413
|
break;
|
|
5412
5414
|
case "ArrowUp":
|
|
5413
5415
|
h.preventDefault(), P(o.minus({ days: 7 }));
|
|
5414
5416
|
break;
|
|
5415
5417
|
case "ArrowDown":
|
|
5416
|
-
h.preventDefault(),
|
|
5418
|
+
h.preventDefault(), $(o.plus({ days: 7 }));
|
|
5417
5419
|
break;
|
|
5418
5420
|
case "PageUp":
|
|
5419
5421
|
if (h.preventDefault(), h.shiftKey) {
|
|
@@ -5424,15 +5426,15 @@ const lt = X(
|
|
|
5424
5426
|
break;
|
|
5425
5427
|
case "PageDown":
|
|
5426
5428
|
if (h.preventDefault(), h.shiftKey) {
|
|
5427
|
-
|
|
5429
|
+
$(o.plus({ years: 1 }));
|
|
5428
5430
|
break;
|
|
5429
5431
|
}
|
|
5430
|
-
|
|
5432
|
+
$(o.plus({ months: 1 }));
|
|
5431
5433
|
break;
|
|
5432
5434
|
}
|
|
5433
5435
|
};
|
|
5434
5436
|
let j = 6;
|
|
5435
|
-
switch (
|
|
5437
|
+
switch (le) {
|
|
5436
5438
|
case "Monday":
|
|
5437
5439
|
j = 0;
|
|
5438
5440
|
break;
|
|
@@ -5440,61 +5442,61 @@ const lt = X(
|
|
|
5440
5442
|
default:
|
|
5441
5443
|
j = 6;
|
|
5442
5444
|
}
|
|
5443
|
-
const
|
|
5445
|
+
const Ie = [];
|
|
5444
5446
|
for (let h = 0; h < 7; h++) {
|
|
5445
5447
|
const k = (j + h) % 7;
|
|
5446
|
-
|
|
5448
|
+
Ie.push(Ve.weekdays("narrow", { locale: O })[k]);
|
|
5447
5449
|
}
|
|
5448
|
-
const
|
|
5449
|
-
if (
|
|
5450
|
+
const ge = o.startOf("month"), Ue = o.endOf("month"), He = Array.from(new Array(ge.daysInMonth)).map((h, k) => ge.plus({ days: k })), xe = [];
|
|
5451
|
+
if (ge.weekday !== j + 1)
|
|
5450
5452
|
for (let h = 1; h < 8; h++) {
|
|
5451
|
-
const k =
|
|
5452
|
-
if (
|
|
5453
|
+
const k = ge.minus({ days: h });
|
|
5454
|
+
if (xe.push(k), k.weekday === j + 1)
|
|
5453
5455
|
break;
|
|
5454
5456
|
}
|
|
5455
|
-
|
|
5456
|
-
const
|
|
5457
|
+
xe.reverse();
|
|
5458
|
+
const Or = Array.from(new Array(14)).map((h, k) => Ue.plus({ days: k + 1 })), Ht = [...xe, ...He, ...Or], Mr = [...Array(Math.ceil(Ht.length / 7))].map((h, k) => Ht.slice(7 * k, 7 + 7 * k)).slice(0, 6), Dr = (h) => {
|
|
5457
5459
|
if (l(h), !L) {
|
|
5458
5460
|
m == null || m({
|
|
5459
|
-
value: h.setZone(g)
|
|
5461
|
+
value: B(h.setZone(g)) ?? void 0
|
|
5460
5462
|
}), !F && a(h);
|
|
5461
5463
|
return;
|
|
5462
5464
|
}
|
|
5463
|
-
|
|
5464
|
-
},
|
|
5465
|
+
Vt(i, h, a, m);
|
|
5466
|
+
}, Nr = (h) => {
|
|
5465
5467
|
d(h);
|
|
5466
|
-
},
|
|
5468
|
+
}, Ir = () => {
|
|
5467
5469
|
d(void 0);
|
|
5468
|
-
},
|
|
5470
|
+
}, xr = (h) => {
|
|
5469
5471
|
d(h), l(h);
|
|
5470
|
-
},
|
|
5472
|
+
}, Er = () => {
|
|
5471
5473
|
d(void 0);
|
|
5472
|
-
},
|
|
5474
|
+
}, br = (h) => {
|
|
5473
5475
|
if (h === "left") {
|
|
5474
5476
|
const k = o.plus({ month: 1 });
|
|
5475
|
-
if (
|
|
5477
|
+
if (Xe(k, f) || et(k, w))
|
|
5476
5478
|
return;
|
|
5477
5479
|
l(k);
|
|
5478
5480
|
return;
|
|
5479
5481
|
}
|
|
5480
5482
|
if (h === "right") {
|
|
5481
5483
|
const k = o.minus({ month: 1 });
|
|
5482
|
-
if (
|
|
5484
|
+
if (Xe(k, f) || et(k, w))
|
|
5483
5485
|
return;
|
|
5484
5486
|
l(k);
|
|
5485
5487
|
return;
|
|
5486
5488
|
}
|
|
5487
|
-
}, { direction:
|
|
5488
|
-
return
|
|
5489
|
+
}, { direction: ua, ...Fr } = qr(br);
|
|
5490
|
+
return nt(() => {
|
|
5489
5491
|
Y.current && setTimeout(() => {
|
|
5490
5492
|
const h = document.getElementById(
|
|
5491
5493
|
`${_}-${o.toISODate()}`
|
|
5492
5494
|
);
|
|
5493
5495
|
h == null || h.focus();
|
|
5494
5496
|
}, 100);
|
|
5495
|
-
}, [o, _]),
|
|
5496
|
-
|
|
5497
|
-
}, [o,
|
|
5497
|
+
}, [o, _]), nt(() => {
|
|
5498
|
+
ie(o, E, g) && $(o.plus({ days: 1 }));
|
|
5499
|
+
}, [o, $, g, E]), /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
5498
5500
|
/* @__PURE__ */ S.jsxs(
|
|
5499
5501
|
"table",
|
|
5500
5502
|
{
|
|
@@ -5506,14 +5508,14 @@ const lt = X(
|
|
|
5506
5508
|
onBlur: () => {
|
|
5507
5509
|
Y.current = !1;
|
|
5508
5510
|
},
|
|
5509
|
-
className:
|
|
5510
|
-
onMouseLeave:
|
|
5511
|
+
className: te,
|
|
5512
|
+
onMouseLeave: Er,
|
|
5511
5513
|
role: "grid",
|
|
5512
5514
|
...r,
|
|
5513
|
-
...
|
|
5515
|
+
...Fr,
|
|
5514
5516
|
children: [
|
|
5515
5517
|
/* @__PURE__ */ S.jsxs("thead", { "aria-hidden": !0, className: N.weekdays, children: [
|
|
5516
|
-
/* @__PURE__ */ S.jsx("tr", { children:
|
|
5518
|
+
/* @__PURE__ */ S.jsx("tr", { children: Ie.map((h, k) => /* @__PURE__ */ S.jsx(
|
|
5517
5519
|
"th",
|
|
5518
5520
|
{
|
|
5519
5521
|
scope: "col",
|
|
@@ -5528,55 +5530,55 @@ const lt = X(
|
|
|
5528
5530
|
"tbody",
|
|
5529
5531
|
{
|
|
5530
5532
|
className: N["day-grid"],
|
|
5531
|
-
children:
|
|
5532
|
-
const
|
|
5533
|
-
|
|
5533
|
+
children: Mr.map((h, k) => /* @__PURE__ */ S.jsx("tr", { children: h.map((T) => {
|
|
5534
|
+
const Yt = !$e(T, o) || Xe(T, f) || et(T, w) || ie(T, E, g), wt = ie(
|
|
5535
|
+
T,
|
|
5534
5536
|
E,
|
|
5535
5537
|
g
|
|
5536
|
-
),
|
|
5537
|
-
[N.selected]: !
|
|
5538
|
-
[N["range-first"]]: L && i.start && (i.end || u) && z(
|
|
5539
|
-
[N["range-last"]]: L && (i.start && i.end && z(
|
|
5540
|
-
[N.range]:
|
|
5541
|
-
[N.unavailable]:
|
|
5542
|
-
[N.overflow]:
|
|
5543
|
-
[N["hover-last"]]:
|
|
5544
|
-
}),
|
|
5538
|
+
), Ee = L && u && i.start && !i.end && T.toMillis() > i.start.toMillis() && T.toMillis() <= u.toMillis(), Cr = We(N.cell, {
|
|
5539
|
+
[N.selected]: !wt && q(T),
|
|
5540
|
+
[N["range-first"]]: L && i.start && (i.end || u) && z(T, i.start),
|
|
5541
|
+
[N["range-last"]]: L && (i.start && i.end && z(T, i.end) || Ee && z(T, u)),
|
|
5542
|
+
[N.range]: me(T) || Ee,
|
|
5543
|
+
[N.unavailable]: wt,
|
|
5544
|
+
[N.overflow]: !$e(T, o),
|
|
5545
|
+
[N["hover-last"]]: Ee && z(T, u)
|
|
5546
|
+
}), Vr = f !== null && T.toMillis() <= (f == null ? void 0 : f.toMillis()), Wr = w !== null && T.toMillis() >= (w == null ? void 0 : w.toMillis());
|
|
5545
5547
|
return /* @__PURE__ */ S.jsxs(
|
|
5546
5548
|
"td",
|
|
5547
5549
|
{
|
|
5548
|
-
"aria-disabled":
|
|
5550
|
+
"aria-disabled": !$e(T, o),
|
|
5549
5551
|
role: "gridcell",
|
|
5550
5552
|
children: [
|
|
5551
|
-
!
|
|
5553
|
+
!wt && (me(T) || Ee) ? /* @__PURE__ */ S.jsx(
|
|
5552
5554
|
"div",
|
|
5553
5555
|
{
|
|
5554
5556
|
role: "presentation",
|
|
5555
|
-
className:
|
|
5556
|
-
[N["range-disabled"]]:
|
|
5557
|
-
[N["hover-last"]]:
|
|
5557
|
+
className: We(N["range-fill"], {
|
|
5558
|
+
[N["range-disabled"]]: Yt,
|
|
5559
|
+
[N["hover-last"]]: Ee && z(T, u)
|
|
5558
5560
|
})
|
|
5559
5561
|
}
|
|
5560
5562
|
) : null,
|
|
5561
5563
|
/* @__PURE__ */ S.jsx(
|
|
5562
5564
|
"button",
|
|
5563
5565
|
{
|
|
5564
|
-
onClick: () =>
|
|
5565
|
-
onFocus: () =>
|
|
5566
|
-
onBlur: () =>
|
|
5567
|
-
className:
|
|
5568
|
-
onKeyDown:
|
|
5569
|
-
onMouseEnter: () =>
|
|
5570
|
-
tabIndex: z(
|
|
5571
|
-
disabled:
|
|
5572
|
-
"aria-label": `${
|
|
5573
|
-
id: `${_}-${
|
|
5574
|
-
children:
|
|
5566
|
+
onClick: () => Dr(T),
|
|
5567
|
+
onFocus: () => Nr(T),
|
|
5568
|
+
onBlur: () => Ir(),
|
|
5569
|
+
className: Cr,
|
|
5570
|
+
onKeyDown: ye,
|
|
5571
|
+
onMouseEnter: () => xr(T),
|
|
5572
|
+
tabIndex: z(T, o) ? 0 : -1,
|
|
5573
|
+
disabled: Yt ? !0 : void 0,
|
|
5574
|
+
"aria-label": `${T.toLocaleString(X)}${q(T) ? " selected" : ""}${Vr ? ", You are on the first available date" : ""}${Wr ? ", You are on the last available date" : ""}`,
|
|
5575
|
+
id: `${_}-${T.toISODate()}`,
|
|
5576
|
+
children: T.day
|
|
5575
5577
|
}
|
|
5576
5578
|
)
|
|
5577
5579
|
]
|
|
5578
5580
|
},
|
|
5579
|
-
|
|
5581
|
+
T.toISODate()
|
|
5580
5582
|
);
|
|
5581
5583
|
}) }, k))
|
|
5582
5584
|
},
|
|
@@ -5585,12 +5587,12 @@ const lt = X(
|
|
|
5585
5587
|
]
|
|
5586
5588
|
}
|
|
5587
5589
|
),
|
|
5588
|
-
L && i ? /* @__PURE__ */ S.jsx(
|
|
5590
|
+
L && i ? /* @__PURE__ */ S.jsx(Rr, { "aria-live": "polite", children: `Range starts at ${i.start && i.start.toLocaleString(X)}, ${i.end ? `ends at ${i.end.toLocaleString(X)}` : "select an end date"}` }) : null
|
|
5589
5591
|
] });
|
|
5590
5592
|
}
|
|
5591
5593
|
);
|
|
5592
|
-
|
|
5593
|
-
const
|
|
5594
|
+
ut.displayName = "CalendarMonth";
|
|
5595
|
+
const ct = ee(
|
|
5594
5596
|
(t, e) => {
|
|
5595
5597
|
const { onClick: n, ...r } = t, {
|
|
5596
5598
|
setFocusedDate: s,
|
|
@@ -5601,21 +5603,21 @@ const ut = X(
|
|
|
5601
5603
|
onSelection: u,
|
|
5602
5604
|
minDate: d,
|
|
5603
5605
|
maxDate: m,
|
|
5604
|
-
controlled:
|
|
5606
|
+
controlled: O,
|
|
5605
5607
|
range: f
|
|
5606
|
-
} =
|
|
5608
|
+
} = gt(), w = y.fromISO(y.now().toISO(), {
|
|
5607
5609
|
zone: o
|
|
5608
5610
|
}).startOf("day"), E = (F) => {
|
|
5609
5611
|
if (s(w), !f) {
|
|
5610
5612
|
u == null || u({
|
|
5611
|
-
value: w
|
|
5612
|
-
}), !
|
|
5613
|
+
value: B(w) ?? void 0
|
|
5614
|
+
}), !O && a(w);
|
|
5613
5615
|
return;
|
|
5614
5616
|
}
|
|
5615
|
-
|
|
5616
|
-
}, g =
|
|
5617
|
+
Vt(i, w, a, u);
|
|
5618
|
+
}, g = et(w, m) || Xe(w, d) || ie(w, l, o);
|
|
5617
5619
|
return /* @__PURE__ */ S.jsx(
|
|
5618
|
-
|
|
5620
|
+
Lt,
|
|
5619
5621
|
{
|
|
5620
5622
|
ref: e,
|
|
5621
5623
|
onClick: E,
|
|
@@ -5629,10 +5631,10 @@ const ut = X(
|
|
|
5629
5631
|
);
|
|
5630
5632
|
}
|
|
5631
5633
|
);
|
|
5632
|
-
|
|
5633
|
-
const
|
|
5634
|
+
ct.displayName = "CalendarNow";
|
|
5635
|
+
const Wt = Zr(null), vr = ee(
|
|
5634
5636
|
(t, e) => {
|
|
5635
|
-
const n =
|
|
5637
|
+
const n = zr(), { layoutStyles: r, componentProps: s } = Ur(t), {
|
|
5636
5638
|
children: i,
|
|
5637
5639
|
focusedDate: a,
|
|
5638
5640
|
defaultFocusedDate: o,
|
|
@@ -5640,7 +5642,7 @@ const Vt = $r(null), Or = X(
|
|
|
5640
5642
|
defaultTimeZone: u = Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
5641
5643
|
startDay: d = "Sunday",
|
|
5642
5644
|
minDate: m,
|
|
5643
|
-
maxDate:
|
|
5645
|
+
maxDate: O,
|
|
5644
5646
|
unavailableDates: f = [],
|
|
5645
5647
|
id: w,
|
|
5646
5648
|
style: E,
|
|
@@ -5648,23 +5650,23 @@ const Vt = $r(null), Or = X(
|
|
|
5648
5650
|
defaultValue: F,
|
|
5649
5651
|
onSelection: _,
|
|
5650
5652
|
range: L,
|
|
5651
|
-
...
|
|
5652
|
-
} = s,
|
|
5653
|
+
...X
|
|
5654
|
+
} = s, le = {
|
|
5653
5655
|
...E,
|
|
5654
5656
|
...r
|
|
5655
5657
|
}, Y = g ? typeof g == "string" ? C(g, u) : {
|
|
5656
5658
|
start: g.start ? C(g.start, u) : null,
|
|
5657
5659
|
end: g.end ? C(g.end, u) : null
|
|
5658
|
-
} : null,
|
|
5660
|
+
} : null, te = F ? typeof F == "string" ? C(F, u) ?? null : {
|
|
5659
5661
|
start: F.start ? C(F.start, u) : null,
|
|
5660
5662
|
end: F != null && F.end ? C(F.end, u) : null
|
|
5661
|
-
} : null,
|
|
5663
|
+
} : null, $ = typeof g == "string" ? C(y.now().toISO(), u) : {
|
|
5662
5664
|
start: C(y.now().toISO(), u),
|
|
5663
5665
|
end: C(y.now().toISO(), u)
|
|
5664
|
-
}, [P, q] =
|
|
5665
|
-
|
|
5666
|
+
}, [P, q] = pt(Y ?? te ?? $), me = () => !y.isDateTime(Y) && !y.isDateTime(te) && !y.isDateTime($) ? (Y == null ? void 0 : Y.start) ?? (te == null ? void 0 : te.start) ?? ($ == null ? void 0 : $.start) : Y ?? te ?? $, [ye, j] = pt(me()), [Ie, ge] = pt();
|
|
5667
|
+
nt(() => {
|
|
5666
5668
|
a && a && j(C(a, u));
|
|
5667
|
-
}, [a]),
|
|
5669
|
+
}, [a]), nt(() => {
|
|
5668
5670
|
if (g) {
|
|
5669
5671
|
if (typeof g == "string") {
|
|
5670
5672
|
q(C(g, u)), j(C(g, u));
|
|
@@ -5683,18 +5685,18 @@ const Vt = $r(null), Or = X(
|
|
|
5683
5685
|
}
|
|
5684
5686
|
}
|
|
5685
5687
|
}, [g]);
|
|
5686
|
-
const Ue =
|
|
5687
|
-
const
|
|
5688
|
+
const Ue = Ar(() => {
|
|
5689
|
+
const xe = {
|
|
5688
5690
|
weekday: "long",
|
|
5689
5691
|
month: "long",
|
|
5690
5692
|
day: "2-digit",
|
|
5691
5693
|
year: "numeric"
|
|
5692
5694
|
};
|
|
5693
5695
|
return {
|
|
5694
|
-
focusedDate:
|
|
5696
|
+
focusedDate: ye,
|
|
5695
5697
|
setFocusedDate: j,
|
|
5696
|
-
hoveredDate:
|
|
5697
|
-
setHoveredDate:
|
|
5698
|
+
hoveredDate: Ie,
|
|
5699
|
+
setHoveredDate: ge,
|
|
5698
5700
|
value: P,
|
|
5699
5701
|
setValue: q,
|
|
5700
5702
|
defaultTimeZone: u,
|
|
@@ -5703,18 +5705,18 @@ const Vt = $r(null), Or = X(
|
|
|
5703
5705
|
controlled: !!g,
|
|
5704
5706
|
range: L,
|
|
5705
5707
|
minDate: m ? C(m, u) : null,
|
|
5706
|
-
maxDate:
|
|
5708
|
+
maxDate: O ? C(O, u) : null,
|
|
5707
5709
|
unavailableDates: new Set(f),
|
|
5708
5710
|
locale: l,
|
|
5709
|
-
dateFormat:
|
|
5711
|
+
dateFormat: xe,
|
|
5710
5712
|
startDay: d
|
|
5711
5713
|
};
|
|
5712
5714
|
}, [
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
+
ye,
|
|
5716
|
+
Ie,
|
|
5715
5717
|
w,
|
|
5716
5718
|
l,
|
|
5717
|
-
|
|
5719
|
+
O,
|
|
5718
5720
|
m,
|
|
5719
5721
|
g,
|
|
5720
5722
|
_,
|
|
@@ -5724,12 +5726,12 @@ const Vt = $r(null), Or = X(
|
|
|
5724
5726
|
f,
|
|
5725
5727
|
P,
|
|
5726
5728
|
d
|
|
5727
|
-
]),
|
|
5729
|
+
]), He = () => ye == null ? void 0 : ye.setLocale(l).toLocaleString({
|
|
5728
5730
|
month: "long",
|
|
5729
5731
|
year: "numeric"
|
|
5730
5732
|
});
|
|
5731
|
-
return "range" in
|
|
5732
|
-
|
|
5733
|
+
return "range" in X && X.range === !0 ? /* @__PURE__ */ S.jsx(
|
|
5734
|
+
Wt.Provider,
|
|
5733
5735
|
{
|
|
5734
5736
|
value: Ue,
|
|
5735
5737
|
children: /* @__PURE__ */ S.jsxs(
|
|
@@ -5738,79 +5740,76 @@ const Vt = $r(null), Or = X(
|
|
|
5738
5740
|
ref: e,
|
|
5739
5741
|
id: w ?? n,
|
|
5740
5742
|
className: N.calendar,
|
|
5741
|
-
style:
|
|
5743
|
+
style: le,
|
|
5742
5744
|
"data-anv": "calendar",
|
|
5743
|
-
...
|
|
5745
|
+
...X,
|
|
5744
5746
|
children: [
|
|
5745
5747
|
/* @__PURE__ */ S.jsxs("div", { className: N.header, children: [
|
|
5746
|
-
/* @__PURE__ */ S.jsx("span", { className: N.heading, children:
|
|
5748
|
+
/* @__PURE__ */ S.jsx("span", { className: N.heading, children: He() }),
|
|
5747
5749
|
/* @__PURE__ */ S.jsxs("span", { className: N.controller, children: [
|
|
5748
|
-
/* @__PURE__ */ S.jsx(
|
|
5749
|
-
/* @__PURE__ */ S.jsx(
|
|
5750
|
-
/* @__PURE__ */ S.jsx(
|
|
5750
|
+
/* @__PURE__ */ S.jsx(ct, {}),
|
|
5751
|
+
/* @__PURE__ */ S.jsx(ot, {}),
|
|
5752
|
+
/* @__PURE__ */ S.jsx(lt, {})
|
|
5751
5753
|
] })
|
|
5752
5754
|
] }),
|
|
5753
|
-
/* @__PURE__ */ S.jsx(
|
|
5755
|
+
/* @__PURE__ */ S.jsx(ut, {})
|
|
5754
5756
|
]
|
|
5755
5757
|
}
|
|
5756
5758
|
)
|
|
5757
5759
|
}
|
|
5758
|
-
) : /* @__PURE__ */ S.jsx(
|
|
5760
|
+
) : /* @__PURE__ */ S.jsx(Wt.Provider, { value: Ue, children: /* @__PURE__ */ S.jsxs(
|
|
5759
5761
|
"div",
|
|
5760
5762
|
{
|
|
5761
5763
|
ref: e,
|
|
5762
5764
|
id: w ?? n,
|
|
5763
|
-
style:
|
|
5765
|
+
style: le,
|
|
5764
5766
|
className: N.calendar,
|
|
5765
5767
|
"data-anv": "calendar",
|
|
5766
|
-
...
|
|
5768
|
+
...X,
|
|
5767
5769
|
children: [
|
|
5768
5770
|
/* @__PURE__ */ S.jsxs("div", { className: N.header, children: [
|
|
5769
|
-
/* @__PURE__ */ S.jsx("span", { className: N.heading, children:
|
|
5771
|
+
/* @__PURE__ */ S.jsx("span", { className: N.heading, children: He() }),
|
|
5770
5772
|
/* @__PURE__ */ S.jsxs("span", { className: N.controller, children: [
|
|
5771
|
-
/* @__PURE__ */ S.jsx(
|
|
5772
|
-
/* @__PURE__ */ S.jsx(
|
|
5773
|
-
/* @__PURE__ */ S.jsx(
|
|
5773
|
+
/* @__PURE__ */ S.jsx(ct, {}),
|
|
5774
|
+
/* @__PURE__ */ S.jsx(ot, {}),
|
|
5775
|
+
/* @__PURE__ */ S.jsx(lt, {})
|
|
5774
5776
|
] })
|
|
5775
5777
|
] }),
|
|
5776
|
-
/* @__PURE__ */ S.jsx(
|
|
5778
|
+
/* @__PURE__ */ S.jsx(ut, {})
|
|
5777
5779
|
]
|
|
5778
5780
|
}
|
|
5779
5781
|
) });
|
|
5780
5782
|
}
|
|
5781
5783
|
);
|
|
5782
|
-
function
|
|
5783
|
-
const t =
|
|
5784
|
+
function gt() {
|
|
5785
|
+
const t = _r(Wt);
|
|
5784
5786
|
if (!t)
|
|
5785
5787
|
throw new Error("useCalendar must be used within a <Calendar>");
|
|
5786
5788
|
return t;
|
|
5787
5789
|
}
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
}
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
),
|
|
5795
|
-
|
|
5796
|
-
),
|
|
5797
|
-
|
|
5798
|
-
),
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
Month: ia,
|
|
5805
|
-
Next: aa,
|
|
5806
|
-
Prev: oa
|
|
5790
|
+
vr.displayName = "Calendar";
|
|
5791
|
+
const sa = ee(
|
|
5792
|
+
(t, e) => /* @__PURE__ */ ze.jsx(vr, { ref: e, ...t })
|
|
5793
|
+
), ia = ee(
|
|
5794
|
+
(t, e) => /* @__PURE__ */ ze.jsx(ct, { ref: e, ...t })
|
|
5795
|
+
), aa = ee(
|
|
5796
|
+
(t, e) => /* @__PURE__ */ ze.jsx(ut, { ref: e, ...t })
|
|
5797
|
+
), oa = ee(
|
|
5798
|
+
(t, e) => /* @__PURE__ */ ze.jsx(lt, { ref: e, ...t })
|
|
5799
|
+
), la = ee(
|
|
5800
|
+
(t, e) => /* @__PURE__ */ ze.jsx(ot, { ref: e, ...t })
|
|
5801
|
+
), Sa = Object.assign(sa, {
|
|
5802
|
+
Now: ia,
|
|
5803
|
+
Month: aa,
|
|
5804
|
+
Next: oa,
|
|
5805
|
+
Prev: la
|
|
5807
5806
|
});
|
|
5808
5807
|
export {
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5808
|
+
Sa as Calendar,
|
|
5809
|
+
aa as CalendarMonth,
|
|
5810
|
+
oa as CalendarNext,
|
|
5811
|
+
ia as CalendarNow,
|
|
5812
|
+
la as CalendarPrev,
|
|
5813
|
+
Sa as default
|
|
5815
5814
|
};
|
|
5816
5815
|
//# sourceMappingURL=Calendar.js.map
|