@servicetitan/anvil2 1.2.1 → 1.2.3
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-6336e146.cjs +2 -0
- package/Alert-6336e146.cjs.map +1 -0
- package/Alert-6faa0b05.js +88 -0
- package/Alert-6faa0b05.js.map +1 -0
- package/Alert.cjs +1 -1
- package/Alert.css +1 -1
- package/Alert.js +1 -1
- package/{Announcement-0ef0c8f7.js → Announcement-d04009ea.js} +26 -26
- package/Announcement-d04009ea.js.map +1 -0
- package/Announcement-fff87b68.cjs +2 -0
- package/Announcement-fff87b68.cjs.map +1 -0
- package/Announcement.cjs +1 -1
- package/Announcement.css +1 -1
- package/Announcement.js +1 -1
- package/AnvilProvider.cjs +1 -1
- package/AnvilProvider.js +1 -1
- package/Avatar.cjs +1 -1
- package/Avatar.js +7 -7
- package/Badge-0073b5a1.cjs +2 -0
- package/{Badge-29ed0c9e.cjs.map → Badge-0073b5a1.cjs.map} +1 -1
- package/Badge-f761458c.js +35 -0
- package/Badge-f761458c.js.map +1 -0
- package/Badge.cjs +1 -1
- package/Badge.css +1 -1
- package/Badge.js +1 -1
- package/Button-268ba8a9.cjs +2 -0
- package/Button-268ba8a9.cjs.map +1 -0
- package/Button-d05507c5.js +289 -0
- package/Button-d05507c5.js.map +1 -0
- package/Button.cjs +1 -1
- package/Button.cjs.map +1 -1
- package/Button.css +1 -1
- package/Button.js +46 -14
- package/Button.js.map +1 -1
- package/ButtonCompound.cjs +1 -1
- package/ButtonCompound.cjs.map +1 -1
- package/ButtonCompound.js +45 -13
- package/ButtonCompound.js.map +1 -1
- package/ButtonLink.cjs +1 -1
- package/ButtonLink.cjs.map +1 -1
- package/ButtonLink.js +46 -14
- package/ButtonLink.js.map +1 -1
- package/ButtonToggle.cjs +1 -1
- package/ButtonToggle.cjs.map +1 -1
- package/ButtonToggle.js +46 -14
- package/ButtonToggle.js.map +1 -1
- package/{Calendar-fc2373b7.js → Calendar-073dc10d.js} +821 -821
- package/{Calendar-fc2373b7.js.map → Calendar-073dc10d.js.map} +1 -1
- package/{Calendar-e0743dcf.cjs → Calendar-706f41ff.cjs} +2 -2
- package/{Calendar-e0743dcf.cjs.map → Calendar-706f41ff.cjs.map} +1 -1
- package/Calendar.cjs +1 -1
- package/Calendar.css +1 -1
- package/Calendar.js +1 -1
- package/Card-33f3ad0a.js +51 -0
- package/Card-33f3ad0a.js.map +1 -0
- package/Card-92ebca1f.cjs +2 -0
- package/Card-92ebca1f.cjs.map +1 -0
- package/Card.cjs +1 -1
- package/Card.css +1 -1
- package/Card.js +1 -1
- package/{Checkbox-e2b0e7d0.js → Checkbox-d503c3b6.js} +41 -41
- package/Checkbox-d503c3b6.js.map +1 -0
- package/Checkbox-edf070c3.cjs +2 -0
- package/Checkbox-edf070c3.cjs.map +1 -0
- package/Checkbox.cjs +1 -1
- package/Checkbox.css +1 -1
- package/Checkbox.d.ts +25 -4
- package/Checkbox.js +4 -4
- package/{Chip-dbc470f4.js → Chip-a8eb2656.js} +31 -31
- package/Chip-a8eb2656.js.map +1 -0
- package/Chip-b52e1bd7.cjs +2 -0
- package/Chip-b52e1bd7.cjs.map +1 -0
- package/Chip.cjs +1 -1
- package/Chip.css +1 -1
- package/Chip.js +1 -1
- package/Combobox.cjs +1 -1
- package/Combobox.cjs.map +1 -1
- package/Combobox.js +65 -32
- package/Combobox.js.map +1 -1
- package/Details.cjs +1 -1
- package/Details.cjs.map +1 -1
- package/Details.js +54 -22
- package/Details.js.map +1 -1
- package/Dialog.cjs +1 -1
- package/Dialog.cjs.map +1 -1
- package/Dialog.js +70 -38
- package/Dialog.js.map +1 -1
- package/Divider-86c1f4ea.cjs +2 -0
- package/Divider-86c1f4ea.cjs.map +1 -0
- package/Divider-edca965e.js +74 -0
- package/Divider-edca965e.js.map +1 -0
- package/Divider.cjs +1 -1
- package/Divider.css +1 -1
- package/Divider.js +1 -1
- package/Drawer-6c2a6e0c.cjs +2 -0
- package/{Drawer-989d1d8a.cjs.map → Drawer-6c2a6e0c.cjs.map} +1 -1
- package/{Drawer-b81924d3.js → Drawer-f68286e8.js} +56 -56
- package/Drawer-f68286e8.js.map +1 -0
- package/Drawer.cjs +1 -1
- package/Drawer.css +1 -1
- package/Drawer.js +1 -1
- package/Flex-4b128a0e.cjs +2 -0
- package/{Flex-740ea6ba.cjs.map → Flex-4b128a0e.cjs.map} +1 -1
- package/{Flex-15fbb5a2.js → Flex-f6e67921.js} +2 -2
- package/{Flex-15fbb5a2.js.map → Flex-f6e67921.js.map} +1 -1
- package/Flex.cjs +1 -1
- package/Flex.css +1 -1
- package/Flex.js +1 -1
- package/{Grid-674805a9.cjs → Grid-8226f7a1.cjs} +2 -2
- package/{Grid-674805a9.cjs.map → Grid-8226f7a1.cjs.map} +1 -1
- package/{Grid-043bde66.js → Grid-992de375.js} +15 -15
- package/{Grid-043bde66.js.map → Grid-992de375.js.map} +1 -1
- package/Grid.cjs +1 -1
- package/Grid.css +1 -1
- package/Grid.js +1 -1
- package/{Helper-74a1f07f-18441e16.js → Helper-74a1f07f-067ae3f7.js} +2 -2
- package/{Helper-74a1f07f-18441e16.js.map → Helper-74a1f07f-067ae3f7.js.map} +1 -1
- package/{Helper-74a1f07f-2aeadeae.cjs → Helper-74a1f07f-6cf9865b.cjs} +2 -2
- package/{Helper-74a1f07f-2aeadeae.cjs.map → Helper-74a1f07f-6cf9865b.cjs.map} +1 -1
- package/Icon-ae9b951b.cjs +2 -0
- package/Icon-ae9b951b.cjs.map +1 -0
- package/Icon-fa8f3dc8.js +47 -0
- package/Icon-fa8f3dc8.js.map +1 -0
- package/Icon.cjs +1 -1
- package/Icon.css +1 -1
- package/Icon.js +1 -1
- package/Link.cjs +1 -1
- package/Link.cjs.map +1 -1
- package/Link.d.ts +2 -1
- package/Link.js +49 -17
- package/Link.js.map +1 -1
- package/{ListView-b33a9948.cjs → ListView-14d80585.cjs} +2 -2
- package/{ListView-b33a9948.cjs.map → ListView-14d80585.cjs.map} +1 -1
- package/{ListView-dac3c924.js → ListView-1f75e2de.js} +26 -26
- package/{ListView-dac3c924.js.map → ListView-1f75e2de.js.map} +1 -1
- package/ListView.cjs +1 -1
- package/ListView.css +1 -1
- package/ListView.js +1 -1
- package/Listbox-306a8d62.cjs +2 -0
- package/{Listbox-873403e9.cjs.map → Listbox-306a8d62.cjs.map} +1 -1
- package/{Listbox-7a43984b.js → Listbox-cdf02568.js} +81 -81
- package/{Listbox-7a43984b.js.map → Listbox-cdf02568.js.map} +1 -1
- package/Listbox.cjs +1 -1
- package/Listbox.css +1 -1
- package/Listbox.js +1 -1
- package/Menu.cjs +1 -1
- package/Menu.cjs.map +1 -1
- package/Menu.d.ts +7 -2
- package/Menu.js +3 -3
- package/Overflow.cjs +1 -1
- package/Overflow.cjs.map +1 -1
- package/Overflow.js +56 -24
- package/Overflow.js.map +1 -1
- package/Page.cjs +1 -1
- package/Page.js +2 -2
- package/Popover.cjs +1 -1
- package/Popover.cjs.map +1 -1
- package/Popover.d.ts +22 -1
- package/Popover.js +68 -36
- package/Popover.js.map +1 -1
- package/ProgressBar-29d21945.cjs +2 -0
- package/ProgressBar-29d21945.cjs.map +1 -0
- package/{ProgressBar-f9325dbe.js → ProgressBar-5f350a3f.js} +93 -93
- package/ProgressBar-5f350a3f.js.map +1 -0
- package/ProgressBar.cjs +1 -1
- package/ProgressBar.css +1 -1
- package/ProgressBar.js +1 -1
- package/Radio-4189b000.js +124 -0
- package/Radio-4189b000.js.map +1 -0
- package/Radio-abd4d3fd.cjs +2 -0
- package/Radio-abd4d3fd.cjs.map +1 -0
- package/Radio.cjs +1 -1
- package/Radio.cjs.map +1 -1
- package/Radio.css +1 -1
- package/Radio.d.ts +18 -4
- package/Radio.js +1 -1
- package/Radio.js.map +1 -1
- package/{SideNav-369bf761.cjs → SideNav-6de704fd.cjs} +6 -6
- package/{SideNav-369bf761.cjs.map → SideNav-6de704fd.cjs.map} +1 -1
- package/{SideNav-94ab00f0.js → SideNav-e92d850f.js} +136 -136
- package/{SideNav-94ab00f0.js.map → SideNav-e92d850f.js.map} +1 -1
- package/SideNav.cjs +5 -5
- package/SideNav.cjs.map +1 -1
- package/SideNav.css +1 -1
- package/SideNav.d.ts +5 -35
- package/SideNav.js +524 -585
- package/SideNav.js.map +1 -1
- package/Stepper-e776cc28.cjs +2 -0
- package/Stepper-e776cc28.cjs.map +1 -0
- package/{Stepper-54e47376.js → Stepper-fa554908.js} +140 -140
- package/Stepper-fa554908.js.map +1 -0
- package/Stepper.cjs +1 -1
- package/Stepper.css +1 -1
- package/Stepper.js +1 -1
- package/Switch-285b3272.cjs +2 -0
- package/Switch-285b3272.cjs.map +1 -0
- package/Switch-b0a37fc1.js +54 -0
- package/Switch-b0a37fc1.js.map +1 -0
- package/Switch.cjs +1 -1
- package/Switch.css +1 -1
- package/Switch.js +1 -1
- package/{Tab-120468a3.js → Tab-1934a4ca.js} +80 -80
- package/{Tab-120468a3.js.map → Tab-1934a4ca.js.map} +1 -1
- package/Tab-ad70a0a5.cjs +10 -0
- package/{Tab-3de6894a.cjs.map → Tab-ad70a0a5.cjs.map} +1 -1
- package/Tab.cjs +1 -1
- package/Tab.css +1 -1
- package/Tab.js +1 -1
- package/{Text-a7747376.js → Text-4c30916c.js} +31 -31
- package/Text-4c30916c.js.map +1 -0
- package/Text-ed02cc62.cjs +2 -0
- package/Text-ed02cc62.cjs.map +1 -0
- package/Text.cjs +1 -1
- package/Text.css +1 -1
- package/Text.js +1 -1
- package/TextField.cjs +1 -1
- package/TextField.cjs.map +1 -1
- package/TextField.js +47 -15
- package/TextField.js.map +1 -1
- package/Textarea.cjs +1 -1
- package/Textarea.cjs.map +1 -1
- package/Textarea.js +51 -19
- package/Textarea.js.map +1 -1
- package/ThemeProvider.cjs +1 -1
- package/ThemeProvider.js +1 -1
- package/{Toast-4bab713a.cjs → Toast-834c85cd.cjs} +6 -6
- package/{Toast-4bab713a.cjs.map → Toast-834c85cd.cjs.map} +1 -1
- package/{Toast-5b02b7c0.js → Toast-f15e9d36.js} +141 -141
- package/Toast-f15e9d36.js.map +1 -0
- package/Toast.cjs +1 -1
- package/Toast.css +1 -1
- package/Toast.js +1 -1
- package/Tooltip.cjs +1 -1
- package/Tooltip.cjs.map +1 -1
- package/Tooltip.d.ts +2 -1
- package/Tooltip.js +47 -17
- package/Tooltip.js.map +1 -1
- package/anvil2.cjs +1 -1
- package/anvil2.d.ts +68 -47
- package/anvil2.js +40 -40
- package/floating-ui.react-5347095a.cjs +178 -0
- package/floating-ui.react-5347095a.cjs.map +1 -0
- package/{floating-ui.react-3f85fcd1.js → floating-ui.react-8d61182d.js} +5666 -5654
- package/floating-ui.react-8d61182d.js.map +1 -0
- package/index-098ca719-3c14c40c.js +307 -0
- package/index-098ca719-3c14c40c.js.map +1 -0
- package/index-098ca719-8e068129.cjs +2 -0
- package/index-098ca719-8e068129.cjs.map +1 -0
- package/index-098ca719.css +1 -0
- package/{index-5654965e.js → index-439b5871.js} +4 -4
- package/{index-5654965e.js.map → index-439b5871.js.map} +1 -1
- package/{index-a6d2f789.js → index-8ee9499c.js} +682 -673
- package/{index-a6d2f789.js.map → index-8ee9499c.js.map} +1 -1
- package/{index-ebc2776c.js → index-ab05dabf.js} +2 -2
- package/{index-ebc2776c.js.map → index-ab05dabf.js.map} +1 -1
- package/{index-0c3dd58b.cjs → index-acdc415f.cjs} +2 -2
- package/{index-0c3dd58b.cjs.map → index-acdc415f.cjs.map} +1 -1
- package/{index-d46fa8de-cc49032b.cjs → index-d46fa8de-08092573.cjs} +2 -2
- package/{index-d46fa8de-cc49032b.cjs.map → index-d46fa8de-08092573.cjs.map} +1 -1
- package/{index-d46fa8de-997b6b08.js → index-d46fa8de-8695742b.js} +15 -15
- package/{index-d46fa8de-997b6b08.js.map → index-d46fa8de-8695742b.js.map} +1 -1
- package/index-da56edbc-372336bd.js +120 -0
- package/index-da56edbc-372336bd.js.map +1 -0
- package/index-da56edbc-53f59f54.cjs +2 -0
- package/index-da56edbc-53f59f54.cjs.map +1 -0
- package/index-da56edbc.css +1 -0
- package/{index-51c8d206.cjs → index-dfb6272f.cjs} +5 -5
- package/{index-51c8d206.cjs.map → index-dfb6272f.cjs.map} +1 -1
- package/{index-30317fba.cjs → index-f6c22572.cjs} +2 -2
- package/{index-30317fba.cjs.map → index-f6c22572.cjs.map} +1 -1
- package/index3.css +1 -1
- package/package.json +33 -33
- package/token.cjs +1 -1
- package/token.js +1 -1
- package/useAccessibleColor.cjs +1 -1
- package/useAccessibleColor.js +29 -29
- package/useLinkStyles.cjs +1 -1
- package/useLinkStyles.js +29 -29
- package/useMergeRefs.cjs +1 -1
- package/useMergeRefs.js +30 -30
- package/usePrefersColorScheme.cjs +1 -1
- package/usePrefersColorScheme.js +29 -29
- package/useSwipe.cjs +1 -1
- package/useSwipe.js +29 -29
- package/Alert-017471de.js +0 -88
- package/Alert-017471de.js.map +0 -1
- package/Alert-3ae85e66.cjs +0 -2
- package/Alert-3ae85e66.cjs.map +0 -1
- package/Announcement-0ef0c8f7.js.map +0 -1
- package/Announcement-3540ab95.cjs +0 -2
- package/Announcement-3540ab95.cjs.map +0 -1
- package/Badge-29ed0c9e.cjs +0 -2
- package/Badge-2dc92a40.js +0 -35
- package/Badge-2dc92a40.js.map +0 -1
- package/Button-dbbb8dc0.js +0 -289
- package/Button-dbbb8dc0.js.map +0 -1
- package/Button-df4be721.cjs +0 -2
- package/Button-df4be721.cjs.map +0 -1
- package/Card-42198f6c.cjs +0 -2
- package/Card-42198f6c.cjs.map +0 -1
- package/Card-d7d23388.js +0 -51
- package/Card-d7d23388.js.map +0 -1
- package/Checkbox-949d5f00.cjs +0 -2
- package/Checkbox-949d5f00.cjs.map +0 -1
- package/Checkbox-e2b0e7d0.js.map +0 -1
- package/Chip-c1c9ff14.cjs +0 -2
- package/Chip-c1c9ff14.cjs.map +0 -1
- package/Chip-dbc470f4.js.map +0 -1
- package/Divider-6e94652c.js +0 -74
- package/Divider-6e94652c.js.map +0 -1
- package/Divider-9719b490.cjs +0 -2
- package/Divider-9719b490.cjs.map +0 -1
- package/Drawer-989d1d8a.cjs +0 -2
- package/Drawer-b81924d3.js.map +0 -1
- package/Flex-740ea6ba.cjs +0 -2
- package/Icon-7dc0db59.js +0 -47
- package/Icon-7dc0db59.js.map +0 -1
- package/Icon-d02abfdd.cjs +0 -2
- package/Icon-d02abfdd.cjs.map +0 -1
- package/Listbox-873403e9.cjs +0 -2
- package/Menu-0a24f1ba.js +0 -284
- package/Menu-0a24f1ba.js.map +0 -1
- package/Menu-869a24e2.cjs +0 -2
- package/Menu-869a24e2.cjs.map +0 -1
- package/Menu.css +0 -1
- package/ProgressBar-2589ad1b.cjs +0 -2
- package/ProgressBar-2589ad1b.cjs.map +0 -1
- package/ProgressBar-f9325dbe.js.map +0 -1
- package/Radio-c81308ef.js +0 -124
- package/Radio-c81308ef.js.map +0 -1
- package/Radio-e11ee699.cjs +0 -2
- package/Radio-e11ee699.cjs.map +0 -1
- package/Stepper-54e47376.js.map +0 -1
- package/Stepper-e26d5bac.cjs +0 -2
- package/Stepper-e26d5bac.cjs.map +0 -1
- package/Switch-c4977b9b.js +0 -54
- package/Switch-c4977b9b.js.map +0 -1
- package/Switch-f1d54e52.cjs +0 -2
- package/Switch-f1d54e52.cjs.map +0 -1
- package/Tab-3de6894a.cjs +0 -10
- package/Text-a7747376.js.map +0 -1
- package/Text-eefa573a.cjs +0 -2
- package/Text-eefa573a.cjs.map +0 -1
- package/Toast-5b02b7c0.js.map +0 -1
- package/floating-ui.react-3f85fcd1.js.map +0 -1
- package/floating-ui.react-518bb704.cjs +0 -178
- package/floating-ui.react-518bb704.cjs.map +0 -1
- package/index-f3ce3681-94450aba.js +0 -120
- package/index-f3ce3681-94450aba.js.map +0 -1
- package/index-f3ce3681-b0bee9d9.cjs +0 -2
- package/index-f3ce3681-b0bee9d9.cjs.map +0 -1
- package/index-f3ce3681.css +0 -1
- package/ui-react-7152d718.js +0 -53
- package/ui-react-7152d718.js.map +0 -1
- package/ui-react-7f005f46.cjs +0 -2
- package/ui-react-7f005f46.cjs.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import "./Calendar.css";
|
|
2
2
|
import { f as S } from "./jsx-runtime-944c88e2-e73fa629.js";
|
|
3
3
|
import * as et from "react";
|
|
4
|
-
import { forwardRef as Ze, useRef as
|
|
5
|
-
import {
|
|
4
|
+
import { forwardRef as Ze, useRef as Cr, useCallback as Vr, useEffect as Ce, createContext as Wr, useId as Lr, useState as ft, useMemo as $r, useContext as Zr } from "react";
|
|
5
|
+
import { k as Vt } from "./Button-d05507c5.js";
|
|
6
6
|
import { c as Ve } from "./index-e0f6271a.js";
|
|
7
|
-
import { J as
|
|
8
|
-
import { E as
|
|
9
|
-
import { p as
|
|
7
|
+
import { J as zr } from "./useLayoutPropsUtil-e307abc7-cbe2fb6d.js";
|
|
8
|
+
import { E as Ar } from "./useSwipe-82769b09-835234e6.js";
|
|
9
|
+
import { p as _r } from "./SrOnly-0c13a721.js";
|
|
10
10
|
class de extends Error {
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class qr extends de {
|
|
13
13
|
constructor(e) {
|
|
14
14
|
super(`Invalid DateTime: ${e.toMessage()}`);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
class
|
|
17
|
+
class Ur extends de {
|
|
18
18
|
constructor(e) {
|
|
19
19
|
super(`Invalid Interval: ${e.toMessage()}`);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
class
|
|
22
|
+
class Rr extends de {
|
|
23
23
|
constructor(e) {
|
|
24
24
|
super(`Invalid Duration: ${e.toMessage()}`);
|
|
25
25
|
}
|
|
@@ -38,7 +38,7 @@ class te extends de {
|
|
|
38
38
|
super("Zone is an abstract class");
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const c = "numeric", B = "short",
|
|
41
|
+
const c = "numeric", B = "short", A = "long", tt = {
|
|
42
42
|
year: c,
|
|
43
43
|
month: c,
|
|
44
44
|
day: c
|
|
@@ -46,20 +46,20 @@ const c = "numeric", B = "short", z = "long", tt = {
|
|
|
46
46
|
year: c,
|
|
47
47
|
month: B,
|
|
48
48
|
day: c
|
|
49
|
-
},
|
|
49
|
+
}, Hr = {
|
|
50
50
|
year: c,
|
|
51
51
|
month: B,
|
|
52
52
|
day: c,
|
|
53
53
|
weekday: B
|
|
54
54
|
}, vn = {
|
|
55
55
|
year: c,
|
|
56
|
-
month:
|
|
56
|
+
month: A,
|
|
57
57
|
day: c
|
|
58
58
|
}, Mn = {
|
|
59
59
|
year: c,
|
|
60
|
-
month:
|
|
60
|
+
month: A,
|
|
61
61
|
day: c,
|
|
62
|
-
weekday:
|
|
62
|
+
weekday: A
|
|
63
63
|
}, Dn = {
|
|
64
64
|
hour: c,
|
|
65
65
|
minute: c
|
|
@@ -67,17 +67,17 @@ const c = "numeric", B = "short", z = "long", tt = {
|
|
|
67
67
|
hour: c,
|
|
68
68
|
minute: c,
|
|
69
69
|
second: c
|
|
70
|
-
},
|
|
70
|
+
}, In = {
|
|
71
71
|
hour: c,
|
|
72
72
|
minute: c,
|
|
73
73
|
second: c,
|
|
74
74
|
timeZoneName: B
|
|
75
|
-
},
|
|
75
|
+
}, En = {
|
|
76
76
|
hour: c,
|
|
77
77
|
minute: c,
|
|
78
78
|
second: c,
|
|
79
|
-
timeZoneName:
|
|
80
|
-
},
|
|
79
|
+
timeZoneName: A
|
|
80
|
+
}, xn = {
|
|
81
81
|
hour: c,
|
|
82
82
|
minute: c,
|
|
83
83
|
hourCycle: "h23"
|
|
@@ -97,7 +97,7 @@ const c = "numeric", B = "short", z = "long", tt = {
|
|
|
97
97
|
minute: c,
|
|
98
98
|
second: c,
|
|
99
99
|
hourCycle: "h23",
|
|
100
|
-
timeZoneName:
|
|
100
|
+
timeZoneName: A
|
|
101
101
|
}, Vn = {
|
|
102
102
|
year: c,
|
|
103
103
|
month: c,
|
|
@@ -124,7 +124,7 @@ const c = "numeric", B = "short", z = "long", tt = {
|
|
|
124
124
|
hour: c,
|
|
125
125
|
minute: c,
|
|
126
126
|
second: c
|
|
127
|
-
},
|
|
127
|
+
}, Yr = {
|
|
128
128
|
year: c,
|
|
129
129
|
month: B,
|
|
130
130
|
day: c,
|
|
@@ -133,38 +133,38 @@ const c = "numeric", B = "short", z = "long", tt = {
|
|
|
133
133
|
minute: c
|
|
134
134
|
}, Zn = {
|
|
135
135
|
year: c,
|
|
136
|
-
month:
|
|
136
|
+
month: A,
|
|
137
137
|
day: c,
|
|
138
138
|
hour: c,
|
|
139
139
|
minute: c,
|
|
140
140
|
timeZoneName: B
|
|
141
|
-
},
|
|
141
|
+
}, zn = {
|
|
142
142
|
year: c,
|
|
143
|
-
month:
|
|
143
|
+
month: A,
|
|
144
144
|
day: c,
|
|
145
145
|
hour: c,
|
|
146
146
|
minute: c,
|
|
147
147
|
second: c,
|
|
148
148
|
timeZoneName: B
|
|
149
|
-
},
|
|
149
|
+
}, An = {
|
|
150
150
|
year: c,
|
|
151
|
-
month:
|
|
151
|
+
month: A,
|
|
152
152
|
day: c,
|
|
153
|
-
weekday:
|
|
153
|
+
weekday: A,
|
|
154
154
|
hour: c,
|
|
155
155
|
minute: c,
|
|
156
|
-
timeZoneName:
|
|
156
|
+
timeZoneName: A
|
|
157
157
|
}, _n = {
|
|
158
158
|
year: c,
|
|
159
|
-
month:
|
|
159
|
+
month: A,
|
|
160
160
|
day: c,
|
|
161
|
-
weekday:
|
|
161
|
+
weekday: A,
|
|
162
162
|
hour: c,
|
|
163
163
|
minute: c,
|
|
164
164
|
second: c,
|
|
165
|
-
timeZoneName:
|
|
165
|
+
timeZoneName: A
|
|
166
166
|
};
|
|
167
|
-
class
|
|
167
|
+
class ze {
|
|
168
168
|
/**
|
|
169
169
|
* The type of zone
|
|
170
170
|
* @abstract
|
|
@@ -243,7 +243,7 @@ class Ae {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
let ht = null;
|
|
246
|
-
class it extends
|
|
246
|
+
class it extends ze {
|
|
247
247
|
/**
|
|
248
248
|
* Get a singleton instance of the local zone
|
|
249
249
|
* @return {SystemZone}
|
|
@@ -264,8 +264,8 @@ class it extends Ae {
|
|
|
264
264
|
return !1;
|
|
265
265
|
}
|
|
266
266
|
/** @override **/
|
|
267
|
-
offsetName(e, { format: n, locale:
|
|
268
|
-
return Jn(e, n,
|
|
267
|
+
offsetName(e, { format: n, locale: r }) {
|
|
268
|
+
return Jn(e, n, r);
|
|
269
269
|
}
|
|
270
270
|
/** @override **/
|
|
271
271
|
formatOffset(e, n) {
|
|
@@ -285,7 +285,7 @@ class it extends Ae {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
let Be = {};
|
|
288
|
-
function
|
|
288
|
+
function Pr(t) {
|
|
289
289
|
return Be[t] || (Be[t] = new Intl.DateTimeFormat("en-US", {
|
|
290
290
|
hour12: !1,
|
|
291
291
|
timeZone: t,
|
|
@@ -298,7 +298,7 @@ function Ps(t) {
|
|
|
298
298
|
era: "short"
|
|
299
299
|
})), Be[t];
|
|
300
300
|
}
|
|
301
|
-
const
|
|
301
|
+
const jr = {
|
|
302
302
|
year: 0,
|
|
303
303
|
month: 1,
|
|
304
304
|
day: 2,
|
|
@@ -307,33 +307,33 @@ const js = {
|
|
|
307
307
|
minute: 5,
|
|
308
308
|
second: 6
|
|
309
309
|
};
|
|
310
|
-
function
|
|
311
|
-
const n = t.format(e).replace(/\u200E/g, ""),
|
|
312
|
-
return [a,
|
|
310
|
+
function Gr(t, e) {
|
|
311
|
+
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;
|
|
312
|
+
return [a, s, i, o, l, u, d];
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
const n = t.formatToParts(e),
|
|
316
|
-
for (let
|
|
317
|
-
const { type: i, value: a } = n[
|
|
318
|
-
i === "era" ?
|
|
314
|
+
function Jr(t, e) {
|
|
315
|
+
const n = t.formatToParts(e), r = [];
|
|
316
|
+
for (let s = 0; s < n.length; s++) {
|
|
317
|
+
const { type: i, value: a } = n[s], o = jr[i];
|
|
318
|
+
i === "era" ? r[o] = a : w(o) || (r[o] = parseInt(a, 10));
|
|
319
319
|
}
|
|
320
|
-
return
|
|
320
|
+
return r;
|
|
321
321
|
}
|
|
322
|
-
let
|
|
323
|
-
class X extends
|
|
322
|
+
let He = {};
|
|
323
|
+
class X extends ze {
|
|
324
324
|
/**
|
|
325
325
|
* @param {string} name - Zone name
|
|
326
326
|
* @return {IANAZone}
|
|
327
327
|
*/
|
|
328
328
|
static create(e) {
|
|
329
|
-
return
|
|
329
|
+
return He[e] || (He[e] = new X(e)), He[e];
|
|
330
330
|
}
|
|
331
331
|
/**
|
|
332
332
|
* Reset local caches. Should only be necessary in testing scenarios.
|
|
333
333
|
* @return {void}
|
|
334
334
|
*/
|
|
335
335
|
static resetCache() {
|
|
336
|
-
|
|
336
|
+
He = {}, Be = {};
|
|
337
337
|
}
|
|
338
338
|
/**
|
|
339
339
|
* 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.
|
|
@@ -379,8 +379,8 @@ class X extends Ae {
|
|
|
379
379
|
return !1;
|
|
380
380
|
}
|
|
381
381
|
/** @override **/
|
|
382
|
-
offsetName(e, { format: n, locale:
|
|
383
|
-
return Jn(e, n,
|
|
382
|
+
offsetName(e, { format: n, locale: r }) {
|
|
383
|
+
return Jn(e, n, r, this.name);
|
|
384
384
|
}
|
|
385
385
|
/** @override **/
|
|
386
386
|
formatOffset(e, n) {
|
|
@@ -391,11 +391,11 @@ class X extends Ae {
|
|
|
391
391
|
const n = new Date(e);
|
|
392
392
|
if (isNaN(n))
|
|
393
393
|
return NaN;
|
|
394
|
-
const
|
|
395
|
-
let [
|
|
396
|
-
o === "BC" && (
|
|
394
|
+
const r = Pr(this.name);
|
|
395
|
+
let [s, i, a, o, l, u, d] = r.formatToParts ? Jr(r, n) : Gr(r, n);
|
|
396
|
+
o === "BC" && (s = -Math.abs(s) + 1);
|
|
397
397
|
const v = ot({
|
|
398
|
-
year:
|
|
398
|
+
year: s,
|
|
399
399
|
month: i,
|
|
400
400
|
day: a,
|
|
401
401
|
hour: l === 24 ? 0 : l,
|
|
@@ -416,36 +416,36 @@ class X extends Ae {
|
|
|
416
416
|
return this.valid;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
|
-
let
|
|
420
|
-
function
|
|
419
|
+
let Ht = {};
|
|
420
|
+
function Br(t, e = {}) {
|
|
421
421
|
const n = JSON.stringify([t, e]);
|
|
422
|
-
let
|
|
423
|
-
return
|
|
422
|
+
let r = Ht[n];
|
|
423
|
+
return r || (r = new Intl.ListFormat(t, e), Ht[n] = r), r;
|
|
424
424
|
}
|
|
425
425
|
let Ot = {};
|
|
426
426
|
function Tt(t, e = {}) {
|
|
427
427
|
const n = JSON.stringify([t, e]);
|
|
428
|
-
let
|
|
429
|
-
return
|
|
428
|
+
let r = Ot[n];
|
|
429
|
+
return r || (r = new Intl.DateTimeFormat(t, e), Ot[n] = r), r;
|
|
430
430
|
}
|
|
431
431
|
let vt = {};
|
|
432
|
-
function
|
|
432
|
+
function Kr(t, e = {}) {
|
|
433
433
|
const n = JSON.stringify([t, e]);
|
|
434
|
-
let
|
|
435
|
-
return
|
|
434
|
+
let r = vt[n];
|
|
435
|
+
return r || (r = new Intl.NumberFormat(t, e), vt[n] = r), r;
|
|
436
436
|
}
|
|
437
437
|
let Mt = {};
|
|
438
|
-
function
|
|
439
|
-
const { base: n, ...
|
|
440
|
-
let i = Mt[
|
|
441
|
-
return i || (i = new Intl.RelativeTimeFormat(t, e), Mt[
|
|
438
|
+
function Qr(t, e = {}) {
|
|
439
|
+
const { base: n, ...r } = e, s = JSON.stringify([t, r]);
|
|
440
|
+
let i = Mt[s];
|
|
441
|
+
return i || (i = new Intl.RelativeTimeFormat(t, e), Mt[s] = i), i;
|
|
442
442
|
}
|
|
443
443
|
let be = null;
|
|
444
|
-
function
|
|
444
|
+
function Xr() {
|
|
445
445
|
return be || (be = new Intl.DateTimeFormat().resolvedOptions().locale, be);
|
|
446
446
|
}
|
|
447
447
|
let Yt = {};
|
|
448
|
-
function
|
|
448
|
+
function es(t) {
|
|
449
449
|
let e = Yt[t];
|
|
450
450
|
if (!e) {
|
|
451
451
|
const n = new Intl.Locale(t);
|
|
@@ -453,57 +453,57 @@ function er(t) {
|
|
|
453
453
|
}
|
|
454
454
|
return e;
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function ts(t) {
|
|
457
457
|
const e = t.indexOf("-x-");
|
|
458
458
|
e !== -1 && (t = t.substring(0, e));
|
|
459
459
|
const n = t.indexOf("-u-");
|
|
460
460
|
if (n === -1)
|
|
461
461
|
return [t];
|
|
462
462
|
{
|
|
463
|
-
let
|
|
463
|
+
let r, s;
|
|
464
464
|
try {
|
|
465
|
-
|
|
465
|
+
r = Tt(t).resolvedOptions(), s = t;
|
|
466
466
|
} catch {
|
|
467
467
|
const l = t.substring(0, n);
|
|
468
|
-
|
|
468
|
+
r = Tt(l).resolvedOptions(), s = l;
|
|
469
469
|
}
|
|
470
|
-
const { numberingSystem: i, calendar: a } =
|
|
471
|
-
return [
|
|
470
|
+
const { numberingSystem: i, calendar: a } = r;
|
|
471
|
+
return [s, i, a];
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
function
|
|
474
|
+
function ns(t, e, n) {
|
|
475
475
|
return (n || e) && (t.includes("-u-") || (t += "-u"), n && (t += `-ca-${n}`), e && (t += `-nu-${e}`)), t;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function rs(t) {
|
|
478
478
|
const e = [];
|
|
479
479
|
for (let n = 1; n <= 12; n++) {
|
|
480
|
-
const
|
|
481
|
-
e.push(t(
|
|
480
|
+
const r = y.utc(2009, n, 1);
|
|
481
|
+
e.push(t(r));
|
|
482
482
|
}
|
|
483
483
|
return e;
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function ss(t) {
|
|
486
486
|
const e = [];
|
|
487
487
|
for (let n = 1; n <= 7; n++) {
|
|
488
|
-
const
|
|
489
|
-
e.push(t(
|
|
488
|
+
const r = y.utc(2016, 11, 13 + n);
|
|
489
|
+
e.push(t(r));
|
|
490
490
|
}
|
|
491
491
|
return e;
|
|
492
492
|
}
|
|
493
|
-
function Ye(t, e, n,
|
|
494
|
-
const
|
|
495
|
-
return
|
|
493
|
+
function Ye(t, e, n, r) {
|
|
494
|
+
const s = t.listingMode();
|
|
495
|
+
return s === "error" ? null : s === "en" ? n(e) : r(e);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function is(t) {
|
|
498
498
|
return t.numberingSystem && t.numberingSystem !== "latn" ? !1 : t.numberingSystem === "latn" || !t.locale || t.locale.startsWith("en") || new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem === "latn";
|
|
499
499
|
}
|
|
500
|
-
class
|
|
501
|
-
constructor(e, n,
|
|
502
|
-
this.padTo =
|
|
503
|
-
const { padTo:
|
|
500
|
+
class as {
|
|
501
|
+
constructor(e, n, r) {
|
|
502
|
+
this.padTo = r.padTo || 0, this.floor = r.floor || !1;
|
|
503
|
+
const { padTo: s, floor: i, ...a } = r;
|
|
504
504
|
if (!n || Object.keys(a).length > 0) {
|
|
505
|
-
const o = { useGrouping: !1, ...
|
|
506
|
-
|
|
505
|
+
const o = { useGrouping: !1, ...r };
|
|
506
|
+
r.padTo > 0 && (o.minimumIntegerDigits = r.padTo), this.inf = Kr(e, o);
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
509
|
format(e) {
|
|
@@ -516,19 +516,19 @@ class ar {
|
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
|
-
class
|
|
520
|
-
constructor(e, n,
|
|
521
|
-
this.opts =
|
|
522
|
-
let
|
|
519
|
+
class os {
|
|
520
|
+
constructor(e, n, r) {
|
|
521
|
+
this.opts = r, this.originalZone = void 0;
|
|
522
|
+
let s;
|
|
523
523
|
if (this.opts.timeZone)
|
|
524
524
|
this.dt = e;
|
|
525
525
|
else if (e.zone.type === "fixed") {
|
|
526
526
|
const a = -1 * (e.offset / 60), o = a >= 0 ? `Etc/GMT+${a}` : `Etc/GMT${a}`;
|
|
527
|
-
e.offset !== 0 && X.create(o).valid ? (
|
|
527
|
+
e.offset !== 0 && X.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);
|
|
528
528
|
} else
|
|
529
|
-
e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e,
|
|
529
|
+
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);
|
|
530
530
|
const i = { ...this.opts };
|
|
531
|
-
i.timeZone = i.timeZone ||
|
|
531
|
+
i.timeZone = i.timeZone || s, this.dtf = Tt(n, i);
|
|
532
532
|
}
|
|
533
533
|
format() {
|
|
534
534
|
return this.originalZone ? this.formatToParts().map(({ value: e }) => e).join("") : this.dtf.format(this.dt.toJSDate());
|
|
@@ -537,13 +537,13 @@ class or {
|
|
|
537
537
|
const e = this.dtf.formatToParts(this.dt.toJSDate());
|
|
538
538
|
return this.originalZone ? e.map((n) => {
|
|
539
539
|
if (n.type === "timeZoneName") {
|
|
540
|
-
const
|
|
540
|
+
const r = this.originalZone.offsetName(this.dt.ts, {
|
|
541
541
|
locale: this.dt.locale,
|
|
542
542
|
format: this.opts.timeZoneName
|
|
543
543
|
});
|
|
544
544
|
return {
|
|
545
545
|
...n,
|
|
546
|
-
value:
|
|
546
|
+
value: r
|
|
547
547
|
};
|
|
548
548
|
} else
|
|
549
549
|
return n;
|
|
@@ -553,18 +553,18 @@ class or {
|
|
|
553
553
|
return this.dtf.resolvedOptions();
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
|
-
class
|
|
557
|
-
constructor(e, n,
|
|
558
|
-
this.opts = { style: "long", ...
|
|
556
|
+
class ls {
|
|
557
|
+
constructor(e, n, r) {
|
|
558
|
+
this.opts = { style: "long", ...r }, !n && jn() && (this.rtf = Qr(e, r));
|
|
559
559
|
}
|
|
560
560
|
format(e, n) {
|
|
561
|
-
return this.rtf ? this.rtf.format(e, n) :
|
|
561
|
+
return this.rtf ? this.rtf.format(e, n) : Es(n, e, this.opts.numeric, this.opts.style !== "long");
|
|
562
562
|
}
|
|
563
563
|
formatToParts(e, n) {
|
|
564
564
|
return this.rtf ? this.rtf.formatToParts(e, n) : [];
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
|
-
const
|
|
567
|
+
const us = {
|
|
568
568
|
firstDay: 1,
|
|
569
569
|
minimalDays: 4,
|
|
570
570
|
weekend: [6, 7]
|
|
@@ -579,22 +579,22 @@ class D {
|
|
|
579
579
|
e.defaultToEN
|
|
580
580
|
);
|
|
581
581
|
}
|
|
582
|
-
static create(e, n,
|
|
583
|
-
const a = e ||
|
|
582
|
+
static create(e, n, r, s, i = !1) {
|
|
583
|
+
const a = e || E.defaultLocale, o = a || (i ? "en-US" : Xr()), l = n || E.defaultNumberingSystem, u = r || E.defaultOutputCalendar, d = Dt(s) || E.defaultWeekSettings;
|
|
584
584
|
return new D(o, l, u, d, a);
|
|
585
585
|
}
|
|
586
586
|
static resetCache() {
|
|
587
587
|
be = null, Ot = {}, vt = {}, Mt = {};
|
|
588
588
|
}
|
|
589
|
-
static fromObject({ locale: e, numberingSystem: n, outputCalendar:
|
|
590
|
-
return D.create(e, n,
|
|
589
|
+
static fromObject({ locale: e, numberingSystem: n, outputCalendar: r, weekSettings: s } = {}) {
|
|
590
|
+
return D.create(e, n, r, s);
|
|
591
591
|
}
|
|
592
|
-
constructor(e, n,
|
|
593
|
-
const [a, o, l] =
|
|
594
|
-
this.locale = a, this.numberingSystem = n || o || null, this.outputCalendar =
|
|
592
|
+
constructor(e, n, r, s, i) {
|
|
593
|
+
const [a, o, l] = ts(e);
|
|
594
|
+
this.locale = a, this.numberingSystem = n || o || null, this.outputCalendar = r || l || null, this.weekSettings = s, this.intl = ns(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;
|
|
595
595
|
}
|
|
596
596
|
get fastNumbers() {
|
|
597
|
-
return this.fastNumbersCached == null && (this.fastNumbersCached =
|
|
597
|
+
return this.fastNumbersCached == null && (this.fastNumbersCached = is(this)), this.fastNumbersCached;
|
|
598
598
|
}
|
|
599
599
|
listingMode() {
|
|
600
600
|
const e = this.isEnglish(), n = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
|
|
@@ -617,23 +617,23 @@ class D {
|
|
|
617
617
|
}
|
|
618
618
|
months(e, n = !1) {
|
|
619
619
|
return Ye(this, e, Qn, () => {
|
|
620
|
-
const
|
|
621
|
-
return this.monthsCache[
|
|
620
|
+
const r = n ? { month: e, day: "numeric" } : { month: e }, s = n ? "format" : "standalone";
|
|
621
|
+
return this.monthsCache[s][e] || (this.monthsCache[s][e] = rs((i) => this.extract(i, r, "month"))), this.monthsCache[s][e];
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
624
|
weekdays(e, n = !1) {
|
|
625
|
-
return Ye(this, e,
|
|
626
|
-
const
|
|
627
|
-
return this.weekdaysCache[
|
|
628
|
-
(i) => this.extract(i,
|
|
629
|
-
)), this.weekdaysCache[
|
|
625
|
+
return Ye(this, e, tr, () => {
|
|
626
|
+
const r = n ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = n ? "format" : "standalone";
|
|
627
|
+
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = ss(
|
|
628
|
+
(i) => this.extract(i, r, "weekday")
|
|
629
|
+
)), this.weekdaysCache[s][e];
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
meridiems() {
|
|
633
633
|
return Ye(
|
|
634
634
|
this,
|
|
635
635
|
void 0,
|
|
636
|
-
() =>
|
|
636
|
+
() => nr,
|
|
637
637
|
() => {
|
|
638
638
|
if (!this.meridiemCache) {
|
|
639
639
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -646,34 +646,34 @@ class D {
|
|
|
646
646
|
);
|
|
647
647
|
}
|
|
648
648
|
eras(e) {
|
|
649
|
-
return Ye(this, e,
|
|
649
|
+
return Ye(this, e, rr, () => {
|
|
650
650
|
const n = { era: e };
|
|
651
651
|
return this.eraCache[e] || (this.eraCache[e] = [y.utc(-40, 1, 1), y.utc(2017, 1, 1)].map(
|
|
652
|
-
(
|
|
652
|
+
(r) => this.extract(r, n, "era")
|
|
653
653
|
)), this.eraCache[e];
|
|
654
654
|
});
|
|
655
655
|
}
|
|
656
|
-
extract(e, n,
|
|
657
|
-
const
|
|
656
|
+
extract(e, n, r) {
|
|
657
|
+
const s = this.dtFormatter(e, n), i = s.formatToParts(), a = i.find((o) => o.type.toLowerCase() === r);
|
|
658
658
|
return a ? a.value : null;
|
|
659
659
|
}
|
|
660
660
|
numberFormatter(e = {}) {
|
|
661
|
-
return new
|
|
661
|
+
return new as(this.intl, e.forceSimple || this.fastNumbers, e);
|
|
662
662
|
}
|
|
663
663
|
dtFormatter(e, n = {}) {
|
|
664
|
-
return new
|
|
664
|
+
return new os(e, this.intl, n);
|
|
665
665
|
}
|
|
666
666
|
relFormatter(e = {}) {
|
|
667
|
-
return new
|
|
667
|
+
return new ls(this.intl, this.isEnglish(), e);
|
|
668
668
|
}
|
|
669
669
|
listFormatter(e = {}) {
|
|
670
|
-
return
|
|
670
|
+
return Br(this.intl, e);
|
|
671
671
|
}
|
|
672
672
|
isEnglish() {
|
|
673
673
|
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
|
|
674
674
|
}
|
|
675
675
|
getWeekSettings() {
|
|
676
|
-
return this.weekSettings ? this.weekSettings : Gn() ?
|
|
676
|
+
return this.weekSettings ? this.weekSettings : Gn() ? es(this.locale) : us;
|
|
677
677
|
}
|
|
678
678
|
getStartOfWeek() {
|
|
679
679
|
return this.getWeekSettings().firstDay;
|
|
@@ -689,7 +689,7 @@ class D {
|
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
let mt = null;
|
|
692
|
-
class W extends
|
|
692
|
+
class W extends ze {
|
|
693
693
|
/**
|
|
694
694
|
* Get a singleton instance of UTC
|
|
695
695
|
* @return {FixedOffsetZone}
|
|
@@ -760,7 +760,7 @@ class W extends Ae {
|
|
|
760
760
|
return !0;
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
|
-
class
|
|
763
|
+
class cs extends ze {
|
|
764
764
|
constructor(e) {
|
|
765
765
|
super(), this.zoneName = e;
|
|
766
766
|
}
|
|
@@ -800,16 +800,16 @@ class cr extends Ae {
|
|
|
800
800
|
function ie(t, e) {
|
|
801
801
|
if (w(t) || t === null)
|
|
802
802
|
return e;
|
|
803
|
-
if (t instanceof
|
|
803
|
+
if (t instanceof ze)
|
|
804
804
|
return t;
|
|
805
|
-
if (
|
|
805
|
+
if (hs(t)) {
|
|
806
806
|
const n = t.toLowerCase();
|
|
807
807
|
return n === "default" ? e : n === "local" || n === "system" ? it.instance : n === "utc" || n === "gmt" ? W.utcInstance : W.parseSpecifier(n) || X.create(t);
|
|
808
808
|
} else
|
|
809
|
-
return ce(t) ? W.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new
|
|
809
|
+
return ce(t) ? W.instance(t) : typeof t == "object" && "offset" in t && typeof t.offset == "function" ? t : new cs(t);
|
|
810
810
|
}
|
|
811
811
|
let Pt = () => Date.now(), jt = "system", Gt = null, Jt = null, Bt = null, Kt = 60, Qt, Xt = null;
|
|
812
|
-
class
|
|
812
|
+
class E {
|
|
813
813
|
/**
|
|
814
814
|
* Get the callback for returning the current timestamp.
|
|
815
815
|
* @type {function}
|
|
@@ -955,7 +955,7 @@ class J {
|
|
|
955
955
|
return this.explanation ? `${this.reason}: ${this.explanation}` : this.reason;
|
|
956
956
|
}
|
|
957
957
|
}
|
|
958
|
-
const
|
|
958
|
+
const qn = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Un = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
|
|
959
959
|
function U(t, e) {
|
|
960
960
|
return new J(
|
|
961
961
|
"unit out of range",
|
|
@@ -963,40 +963,40 @@ function U(t, e) {
|
|
|
963
963
|
);
|
|
964
964
|
}
|
|
965
965
|
function Wt(t, e, n) {
|
|
966
|
-
const
|
|
967
|
-
t < 100 && t >= 0 &&
|
|
968
|
-
const
|
|
969
|
-
return
|
|
966
|
+
const r = new Date(Date.UTC(t, e - 1, n));
|
|
967
|
+
t < 100 && t >= 0 && r.setUTCFullYear(r.getUTCFullYear() - 1900);
|
|
968
|
+
const s = r.getUTCDay();
|
|
969
|
+
return s === 0 ? 7 : s;
|
|
970
970
|
}
|
|
971
|
-
function
|
|
972
|
-
return n + (
|
|
971
|
+
function Rn(t, e, n) {
|
|
972
|
+
return n + (Ae(t) ? Un : qn)[e - 1];
|
|
973
973
|
}
|
|
974
|
-
function
|
|
975
|
-
const n =
|
|
976
|
-
return { month:
|
|
974
|
+
function Hn(t, e) {
|
|
975
|
+
const n = Ae(t) ? Un : qn, r = n.findIndex((i) => i < e), s = e - n[r];
|
|
976
|
+
return { month: r + 1, day: s };
|
|
977
977
|
}
|
|
978
978
|
function Lt(t, e) {
|
|
979
979
|
return (t - e + 7) % 7 + 1;
|
|
980
980
|
}
|
|
981
981
|
function nt(t, e = 4, n = 1) {
|
|
982
|
-
const { year:
|
|
982
|
+
const { year: r, month: s, day: i } = t, a = Rn(r, s, i), o = Lt(Wt(r, s, i), n);
|
|
983
983
|
let l = Math.floor((a - o + 14 - e) / 7), u;
|
|
984
|
-
return l < 1 ? (u =
|
|
984
|
+
return l < 1 ? (u = r - 1, l = $e(u, e, n)) : l > $e(r, e, n) ? (u = r + 1, l = 1) : u = r, { weekYear: u, weekNumber: l, weekday: o, ...ut(t) };
|
|
985
985
|
}
|
|
986
986
|
function en(t, e = 4, n = 1) {
|
|
987
|
-
const { weekYear:
|
|
988
|
-
let l =
|
|
989
|
-
l < 1 ? (u =
|
|
990
|
-
const { month: d, day: m } =
|
|
987
|
+
const { weekYear: r, weekNumber: s, weekday: i } = t, a = Lt(Wt(r, 1, e), n), o = we(r);
|
|
988
|
+
let l = s * 7 + i - a - 7 + e, u;
|
|
989
|
+
l < 1 ? (u = r - 1, l += we(u)) : l > o ? (u = r + 1, l -= we(r)) : u = r;
|
|
990
|
+
const { month: d, day: m } = Hn(u, l);
|
|
991
991
|
return { year: u, month: d, day: m, ...ut(t) };
|
|
992
992
|
}
|
|
993
993
|
function yt(t) {
|
|
994
|
-
const { year: e, month: n, day:
|
|
995
|
-
return { year: e, ordinal:
|
|
994
|
+
const { year: e, month: n, day: r } = t, s = Rn(e, n, r);
|
|
995
|
+
return { year: e, ordinal: s, ...ut(t) };
|
|
996
996
|
}
|
|
997
997
|
function tn(t) {
|
|
998
|
-
const { year: e, ordinal: n } = t, { month:
|
|
999
|
-
return { year: e, month:
|
|
998
|
+
const { year: e, ordinal: n } = t, { month: r, day: s } = Hn(e, n);
|
|
999
|
+
return { year: e, month: r, day: s, ...ut(t) };
|
|
1000
1000
|
}
|
|
1001
1001
|
function nn(t, e) {
|
|
1002
1002
|
if (!w(t.localWeekday) || !w(t.localWeekNumber) || !w(t.localWeekYear)) {
|
|
@@ -1011,25 +1011,25 @@ function nn(t, e) {
|
|
|
1011
1011
|
} else
|
|
1012
1012
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1015
|
-
const
|
|
1014
|
+
function ds(t, e = 4, n = 1) {
|
|
1015
|
+
const r = at(t.weekYear), s = R(
|
|
1016
1016
|
t.weekNumber,
|
|
1017
1017
|
1,
|
|
1018
1018
|
$e(t.weekYear, e, n)
|
|
1019
|
-
), i =
|
|
1020
|
-
return
|
|
1019
|
+
), i = R(t.weekday, 1, 7);
|
|
1020
|
+
return r ? s ? i ? !1 : U("weekday", t.weekday) : U("week", t.weekNumber) : U("weekYear", t.weekYear);
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1023
|
-
const e = at(t.year), n =
|
|
1022
|
+
function fs(t) {
|
|
1023
|
+
const e = at(t.year), n = R(t.ordinal, 1, we(t.year));
|
|
1024
1024
|
return e ? n ? !1 : U("ordinal", t.ordinal) : U("year", t.year);
|
|
1025
1025
|
}
|
|
1026
1026
|
function Yn(t) {
|
|
1027
|
-
const e = at(t.year), n =
|
|
1028
|
-
return e ? n ?
|
|
1027
|
+
const e = at(t.year), n = R(t.month, 1, 12), r = R(t.day, 1, rt(t.year, t.month));
|
|
1028
|
+
return e ? n ? r ? !1 : U("day", t.day) : U("month", t.month) : U("year", t.year);
|
|
1029
1029
|
}
|
|
1030
1030
|
function Pn(t) {
|
|
1031
|
-
const { hour: e, minute: n, second:
|
|
1032
|
-
return i ? a ? o ? l ? !1 : U("millisecond",
|
|
1031
|
+
const { hour: e, minute: n, second: r, millisecond: s } = t, i = R(e, 0, 23) || e === 24 && n === 0 && r === 0 && s === 0, a = R(n, 0, 59), o = R(r, 0, 59), l = R(s, 0, 999);
|
|
1032
|
+
return i ? a ? o ? l ? !1 : U("millisecond", s) : U("second", r) : U("minute", n) : U("hour", e);
|
|
1033
1033
|
}
|
|
1034
1034
|
function w(t) {
|
|
1035
1035
|
return typeof t > "u";
|
|
@@ -1040,10 +1040,10 @@ function ce(t) {
|
|
|
1040
1040
|
function at(t) {
|
|
1041
1041
|
return typeof t == "number" && t % 1 === 0;
|
|
1042
1042
|
}
|
|
1043
|
-
function
|
|
1043
|
+
function hs(t) {
|
|
1044
1044
|
return typeof t == "string";
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1046
|
+
function ms(t) {
|
|
1047
1047
|
return Object.prototype.toString.call(t) === "[object Date]";
|
|
1048
1048
|
}
|
|
1049
1049
|
function jn() {
|
|
@@ -1060,18 +1060,18 @@ function Gn() {
|
|
|
1060
1060
|
return !1;
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1063
|
+
function ys(t) {
|
|
1064
1064
|
return Array.isArray(t) ? t : [t];
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function rn(t, e, n) {
|
|
1067
1067
|
if (t.length !== 0)
|
|
1068
|
-
return t.reduce((
|
|
1069
|
-
const i = [e(
|
|
1070
|
-
return
|
|
1068
|
+
return t.reduce((r, s) => {
|
|
1069
|
+
const i = [e(s), s];
|
|
1070
|
+
return r && n(r[0], i[0]) === r[0] ? r : i;
|
|
1071
1071
|
}, null)[1];
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1074
|
-
return e.reduce((n,
|
|
1073
|
+
function gs(t, e) {
|
|
1074
|
+
return e.reduce((n, r) => (n[r] = t[r], n), {});
|
|
1075
1075
|
}
|
|
1076
1076
|
function ke(t, e) {
|
|
1077
1077
|
return Object.prototype.hasOwnProperty.call(t, e);
|
|
@@ -1081,7 +1081,7 @@ function Dt(t) {
|
|
|
1081
1081
|
return null;
|
|
1082
1082
|
if (typeof t != "object")
|
|
1083
1083
|
throw new $("Week settings must be an object");
|
|
1084
|
-
if (!
|
|
1084
|
+
if (!R(t.firstDay, 1, 7) || !R(t.minimalDays, 1, 7) || !Array.isArray(t.weekend) || t.weekend.some((e) => !R(e, 1, 7)))
|
|
1085
1085
|
throw new $("Invalid week settings");
|
|
1086
1086
|
return {
|
|
1087
1087
|
firstDay: t.firstDay,
|
|
@@ -1089,18 +1089,18 @@ function Dt(t) {
|
|
|
1089
1089
|
weekend: Array.from(t.weekend)
|
|
1090
1090
|
};
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1092
|
+
function R(t, e, n) {
|
|
1093
1093
|
return at(t) && t >= e && t <= n;
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function ws(t, e) {
|
|
1096
1096
|
return t - e * Math.floor(t / e);
|
|
1097
1097
|
}
|
|
1098
1098
|
function b(t, e = 2) {
|
|
1099
1099
|
const n = t < 0;
|
|
1100
|
-
let
|
|
1101
|
-
return n ?
|
|
1100
|
+
let r;
|
|
1101
|
+
return n ? r = "-" + ("" + -t).padStart(e, "0") : r = ("" + t).padStart(e, "0"), r;
|
|
1102
1102
|
}
|
|
1103
|
-
function
|
|
1103
|
+
function se(t) {
|
|
1104
1104
|
if (!(w(t) || t === null || t === ""))
|
|
1105
1105
|
return parseInt(t, 10);
|
|
1106
1106
|
}
|
|
@@ -1115,18 +1115,18 @@ function $t(t) {
|
|
|
1115
1115
|
}
|
|
1116
1116
|
}
|
|
1117
1117
|
function Zt(t, e, n = !1) {
|
|
1118
|
-
const
|
|
1119
|
-
return (n ? Math.trunc : Math.round)(t *
|
|
1118
|
+
const r = 10 ** e;
|
|
1119
|
+
return (n ? Math.trunc : Math.round)(t * r) / r;
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1121
|
+
function Ae(t) {
|
|
1122
1122
|
return t % 4 === 0 && (t % 100 !== 0 || t % 400 === 0);
|
|
1123
1123
|
}
|
|
1124
1124
|
function we(t) {
|
|
1125
|
-
return
|
|
1125
|
+
return Ae(t) ? 366 : 365;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1128
|
-
const n =
|
|
1129
|
-
return n === 2 ?
|
|
1127
|
+
function rt(t, e) {
|
|
1128
|
+
const n = ws(e - 1, 12) + 1, r = t + (e - n) / 12;
|
|
1129
|
+
return n === 2 ? Ae(r) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][n - 1];
|
|
1130
1130
|
}
|
|
1131
1131
|
function ot(t) {
|
|
1132
1132
|
let e = Date.UTC(
|
|
@@ -1140,18 +1140,18 @@ function ot(t) {
|
|
|
1140
1140
|
);
|
|
1141
1141
|
return t.year < 100 && t.year >= 0 && (e = new Date(e), e.setUTCFullYear(t.year, t.month - 1, t.day)), +e;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function sn(t, e, n) {
|
|
1144
1144
|
return -Lt(Wt(t, 1, e), n) + e - 1;
|
|
1145
1145
|
}
|
|
1146
1146
|
function $e(t, e = 4, n = 1) {
|
|
1147
|
-
const
|
|
1148
|
-
return (we(t) -
|
|
1147
|
+
const r = sn(t, e, n), s = sn(t + 1, e, n);
|
|
1148
|
+
return (we(t) - r + s) / 7;
|
|
1149
1149
|
}
|
|
1150
1150
|
function Nt(t) {
|
|
1151
|
-
return t > 99 ? t : t >
|
|
1151
|
+
return t > 99 ? t : t > E.twoDigitCutoffYear ? 1900 + t : 2e3 + t;
|
|
1152
1152
|
}
|
|
1153
|
-
function Jn(t, e, n,
|
|
1154
|
-
const
|
|
1153
|
+
function Jn(t, e, n, r = null) {
|
|
1154
|
+
const s = new Date(t), i = {
|
|
1155
1155
|
hourCycle: "h23",
|
|
1156
1156
|
year: "numeric",
|
|
1157
1157
|
month: "2-digit",
|
|
@@ -1159,15 +1159,15 @@ function Jn(t, e, n, s = null) {
|
|
|
1159
1159
|
hour: "2-digit",
|
|
1160
1160
|
minute: "2-digit"
|
|
1161
1161
|
};
|
|
1162
|
-
|
|
1163
|
-
const a = { timeZoneName: e, ...i }, o = new Intl.DateTimeFormat(n, a).formatToParts(
|
|
1162
|
+
r && (i.timeZone = r);
|
|
1163
|
+
const a = { timeZoneName: e, ...i }, o = new Intl.DateTimeFormat(n, a).formatToParts(s).find((l) => l.type.toLowerCase() === "timezonename");
|
|
1164
1164
|
return o ? o.value : null;
|
|
1165
1165
|
}
|
|
1166
1166
|
function lt(t, e) {
|
|
1167
1167
|
let n = parseInt(t, 10);
|
|
1168
1168
|
Number.isNaN(n) && (n = 0);
|
|
1169
|
-
const
|
|
1170
|
-
return n * 60 +
|
|
1169
|
+
const r = parseInt(e, 10) || 0, s = n < 0 || Object.is(n, -0) ? -r : r;
|
|
1170
|
+
return n * 60 + s;
|
|
1171
1171
|
}
|
|
1172
1172
|
function Bn(t) {
|
|
1173
1173
|
const e = Number(t);
|
|
@@ -1175,34 +1175,34 @@ function Bn(t) {
|
|
|
1175
1175
|
throw new $(`Invalid unit value ${t}`);
|
|
1176
1176
|
return e;
|
|
1177
1177
|
}
|
|
1178
|
-
function
|
|
1178
|
+
function st(t, e) {
|
|
1179
1179
|
const n = {};
|
|
1180
|
-
for (const
|
|
1181
|
-
if (ke(t,
|
|
1182
|
-
const
|
|
1183
|
-
if (
|
|
1180
|
+
for (const r in t)
|
|
1181
|
+
if (ke(t, r)) {
|
|
1182
|
+
const s = t[r];
|
|
1183
|
+
if (s == null)
|
|
1184
1184
|
continue;
|
|
1185
|
-
n[e(
|
|
1185
|
+
n[e(r)] = Bn(s);
|
|
1186
1186
|
}
|
|
1187
1187
|
return n;
|
|
1188
1188
|
}
|
|
1189
1189
|
function We(t, e) {
|
|
1190
|
-
const n = Math.trunc(Math.abs(t / 60)),
|
|
1190
|
+
const n = Math.trunc(Math.abs(t / 60)), r = Math.trunc(Math.abs(t % 60)), s = t >= 0 ? "+" : "-";
|
|
1191
1191
|
switch (e) {
|
|
1192
1192
|
case "short":
|
|
1193
|
-
return `${
|
|
1193
|
+
return `${s}${b(n, 2)}:${b(r, 2)}`;
|
|
1194
1194
|
case "narrow":
|
|
1195
|
-
return `${
|
|
1195
|
+
return `${s}${n}${r > 0 ? `:${r}` : ""}`;
|
|
1196
1196
|
case "techie":
|
|
1197
|
-
return `${
|
|
1197
|
+
return `${s}${b(n, 2)}${b(r, 2)}`;
|
|
1198
1198
|
default:
|
|
1199
1199
|
throw new RangeError(`Value format ${e} is out of range for property format`);
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
1202
1202
|
function ut(t) {
|
|
1203
|
-
return
|
|
1203
|
+
return gs(t, ["hour", "minute", "second", "millisecond"]);
|
|
1204
1204
|
}
|
|
1205
|
-
const
|
|
1205
|
+
const ps = [
|
|
1206
1206
|
"January",
|
|
1207
1207
|
"February",
|
|
1208
1208
|
"March",
|
|
@@ -1228,15 +1228,15 @@ const pr = [
|
|
|
1228
1228
|
"Oct",
|
|
1229
1229
|
"Nov",
|
|
1230
1230
|
"Dec"
|
|
1231
|
-
],
|
|
1231
|
+
], ks = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
|
|
1232
1232
|
function Qn(t) {
|
|
1233
1233
|
switch (t) {
|
|
1234
1234
|
case "narrow":
|
|
1235
|
-
return [...
|
|
1235
|
+
return [...ks];
|
|
1236
1236
|
case "short":
|
|
1237
1237
|
return [...Kn];
|
|
1238
1238
|
case "long":
|
|
1239
|
-
return [...
|
|
1239
|
+
return [...ps];
|
|
1240
1240
|
case "numeric":
|
|
1241
1241
|
return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
|
|
1242
1242
|
case "2-digit":
|
|
@@ -1253,13 +1253,13 @@ const Xn = [
|
|
|
1253
1253
|
"Friday",
|
|
1254
1254
|
"Saturday",
|
|
1255
1255
|
"Sunday"
|
|
1256
|
-
],
|
|
1257
|
-
function
|
|
1256
|
+
], er = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], Ss = ["M", "T", "W", "T", "F", "S", "S"];
|
|
1257
|
+
function tr(t) {
|
|
1258
1258
|
switch (t) {
|
|
1259
1259
|
case "narrow":
|
|
1260
|
-
return [...
|
|
1260
|
+
return [...Ss];
|
|
1261
1261
|
case "short":
|
|
1262
|
-
return [...
|
|
1262
|
+
return [...er];
|
|
1263
1263
|
case "long":
|
|
1264
1264
|
return [...Xn];
|
|
1265
1265
|
case "numeric":
|
|
@@ -1268,33 +1268,33 @@ function ts(t) {
|
|
|
1268
1268
|
return null;
|
|
1269
1269
|
}
|
|
1270
1270
|
}
|
|
1271
|
-
const
|
|
1272
|
-
function
|
|
1271
|
+
const nr = ["AM", "PM"], Os = ["Before Christ", "Anno Domini"], Ts = ["BC", "AD"], vs = ["B", "A"];
|
|
1272
|
+
function rr(t) {
|
|
1273
1273
|
switch (t) {
|
|
1274
1274
|
case "narrow":
|
|
1275
|
-
return [...
|
|
1275
|
+
return [...vs];
|
|
1276
1276
|
case "short":
|
|
1277
|
-
return [...
|
|
1277
|
+
return [...Ts];
|
|
1278
1278
|
case "long":
|
|
1279
|
-
return [...
|
|
1279
|
+
return [...Os];
|
|
1280
1280
|
default:
|
|
1281
1281
|
return null;
|
|
1282
1282
|
}
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return
|
|
1284
|
+
function Ms(t) {
|
|
1285
|
+
return nr[t.hour < 12 ? 0 : 1];
|
|
1286
1286
|
}
|
|
1287
|
-
function
|
|
1288
|
-
return
|
|
1287
|
+
function Ds(t, e) {
|
|
1288
|
+
return tr(e)[t.weekday - 1];
|
|
1289
1289
|
}
|
|
1290
|
-
function
|
|
1290
|
+
function Ns(t, e) {
|
|
1291
1291
|
return Qn(e)[t.month - 1];
|
|
1292
1292
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return
|
|
1293
|
+
function Is(t, e) {
|
|
1294
|
+
return rr(e)[t.year < 0 ? 0 : 1];
|
|
1295
1295
|
}
|
|
1296
|
-
function
|
|
1297
|
-
const
|
|
1296
|
+
function Es(t, e, n = "always", r = !1) {
|
|
1297
|
+
const s = {
|
|
1298
1298
|
years: ["year", "yr."],
|
|
1299
1299
|
quarters: ["quarter", "qtr."],
|
|
1300
1300
|
months: ["month", "mo."],
|
|
@@ -1308,42 +1308,42 @@ function Ir(t, e, n = "always", s = !1) {
|
|
|
1308
1308
|
const m = t === "days";
|
|
1309
1309
|
switch (e) {
|
|
1310
1310
|
case 1:
|
|
1311
|
-
return m ? "tomorrow" : `next ${
|
|
1311
|
+
return m ? "tomorrow" : `next ${s[t][0]}`;
|
|
1312
1312
|
case -1:
|
|
1313
|
-
return m ? "yesterday" : `last ${
|
|
1313
|
+
return m ? "yesterday" : `last ${s[t][0]}`;
|
|
1314
1314
|
case 0:
|
|
1315
|
-
return m ? "today" : `this ${
|
|
1315
|
+
return m ? "today" : `this ${s[t][0]}`;
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
const a = Object.is(e, -0) || e < 0, o = Math.abs(e), l = o === 1, u =
|
|
1318
|
+
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;
|
|
1319
1319
|
return a ? `${o} ${d} ago` : `in ${o} ${d}`;
|
|
1320
1320
|
}
|
|
1321
1321
|
function an(t, e) {
|
|
1322
1322
|
let n = "";
|
|
1323
|
-
for (const
|
|
1324
|
-
|
|
1323
|
+
for (const r of t)
|
|
1324
|
+
r.literal ? n += r.val : n += e(r.val);
|
|
1325
1325
|
return n;
|
|
1326
1326
|
}
|
|
1327
|
-
const
|
|
1327
|
+
const xs = {
|
|
1328
1328
|
D: tt,
|
|
1329
1329
|
DD: Tn,
|
|
1330
1330
|
DDD: vn,
|
|
1331
1331
|
DDDD: Mn,
|
|
1332
1332
|
t: Dn,
|
|
1333
1333
|
tt: Nn,
|
|
1334
|
-
ttt:
|
|
1335
|
-
tttt:
|
|
1336
|
-
T:
|
|
1334
|
+
ttt: In,
|
|
1335
|
+
tttt: En,
|
|
1336
|
+
T: xn,
|
|
1337
1337
|
TT: bn,
|
|
1338
1338
|
TTT: Fn,
|
|
1339
1339
|
TTTT: Cn,
|
|
1340
1340
|
f: Vn,
|
|
1341
1341
|
ff: Ln,
|
|
1342
1342
|
fff: Zn,
|
|
1343
|
-
ffff:
|
|
1343
|
+
ffff: An,
|
|
1344
1344
|
F: Wn,
|
|
1345
1345
|
FF: $n,
|
|
1346
|
-
FFF:
|
|
1346
|
+
FFF: zn,
|
|
1347
1347
|
FFFF: _n
|
|
1348
1348
|
};
|
|
1349
1349
|
class C {
|
|
@@ -1351,16 +1351,16 @@ class C {
|
|
|
1351
1351
|
return new C(e, n);
|
|
1352
1352
|
}
|
|
1353
1353
|
static parseFormat(e) {
|
|
1354
|
-
let n = null,
|
|
1354
|
+
let n = null, r = "", s = !1;
|
|
1355
1355
|
const i = [];
|
|
1356
1356
|
for (let a = 0; a < e.length; a++) {
|
|
1357
1357
|
const o = e.charAt(a);
|
|
1358
|
-
o === "'" ? (
|
|
1358
|
+
o === "'" ? (r.length > 0 && i.push({ literal: s || /^\s+$/.test(r), val: r }), n = null, r = "", s = !s) : s || o === n ? r += o : (r.length > 0 && i.push({ literal: /^\s+$/.test(r), val: r }), r = o, n = o);
|
|
1359
1359
|
}
|
|
1360
|
-
return
|
|
1360
|
+
return r.length > 0 && i.push({ literal: s || /^\s+$/.test(r), val: r }), i;
|
|
1361
1361
|
}
|
|
1362
1362
|
static macroTokenToFormatOpts(e) {
|
|
1363
|
-
return
|
|
1363
|
+
return xs[e];
|
|
1364
1364
|
}
|
|
1365
1365
|
constructor(e, n) {
|
|
1366
1366
|
this.opts = n, this.loc = e, this.systemLoc = null;
|
|
@@ -1386,17 +1386,17 @@ class C {
|
|
|
1386
1386
|
num(e, n = 0) {
|
|
1387
1387
|
if (this.opts.forceSimple)
|
|
1388
1388
|
return b(e, n);
|
|
1389
|
-
const
|
|
1390
|
-
return n > 0 && (
|
|
1389
|
+
const r = { ...this.opts };
|
|
1390
|
+
return n > 0 && (r.padTo = n), this.loc.numberFormatter(r).format(e);
|
|
1391
1391
|
}
|
|
1392
1392
|
formatDateTimeFromString(e, n) {
|
|
1393
|
-
const
|
|
1393
|
+
const r = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", i = (f, g) => this.loc.extract(e, f, g), a = (f) => e.isOffsetFixed && e.offset === 0 && f.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, f.format) : "", o = () => r ? Ms(e) : i({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), l = (f, g) => r ? Ns(e, f) : i(g ? { month: f } : { month: f, day: "numeric" }, "month"), u = (f, g) => r ? Ds(e, f) : i(
|
|
1394
1394
|
g ? { weekday: f } : { weekday: f, month: "long", day: "numeric" },
|
|
1395
1395
|
"weekday"
|
|
1396
1396
|
), d = (f) => {
|
|
1397
1397
|
const g = C.macroTokenToFormatOpts(f);
|
|
1398
1398
|
return g ? this.formatWithSystemDefault(e, g) : f;
|
|
1399
|
-
}, m = (f) =>
|
|
1399
|
+
}, m = (f) => r ? Is(e, f) : i({ era: f }, "era"), v = (f) => {
|
|
1400
1400
|
switch (f) {
|
|
1401
1401
|
case "S":
|
|
1402
1402
|
return this.num(e.millisecond);
|
|
@@ -1438,9 +1438,9 @@ class C {
|
|
|
1438
1438
|
case "a":
|
|
1439
1439
|
return o();
|
|
1440
1440
|
case "d":
|
|
1441
|
-
return
|
|
1441
|
+
return s ? i({ day: "numeric" }, "day") : this.num(e.day);
|
|
1442
1442
|
case "dd":
|
|
1443
|
-
return
|
|
1443
|
+
return s ? i({ day: "2-digit" }, "day") : this.num(e.day, 2);
|
|
1444
1444
|
case "c":
|
|
1445
1445
|
return this.num(e.weekday);
|
|
1446
1446
|
case "ccc":
|
|
@@ -1458,9 +1458,9 @@ class C {
|
|
|
1458
1458
|
case "EEEEE":
|
|
1459
1459
|
return u("narrow", !1);
|
|
1460
1460
|
case "L":
|
|
1461
|
-
return
|
|
1461
|
+
return s ? i({ month: "numeric", day: "numeric" }, "month") : this.num(e.month);
|
|
1462
1462
|
case "LL":
|
|
1463
|
-
return
|
|
1463
|
+
return s ? i({ month: "2-digit", day: "numeric" }, "month") : this.num(e.month, 2);
|
|
1464
1464
|
case "LLL":
|
|
1465
1465
|
return l("short", !0);
|
|
1466
1466
|
case "LLLL":
|
|
@@ -1468,9 +1468,9 @@ class C {
|
|
|
1468
1468
|
case "LLLLL":
|
|
1469
1469
|
return l("narrow", !0);
|
|
1470
1470
|
case "M":
|
|
1471
|
-
return
|
|
1471
|
+
return s ? i({ month: "numeric" }, "month") : this.num(e.month);
|
|
1472
1472
|
case "MM":
|
|
1473
|
-
return
|
|
1473
|
+
return s ? i({ month: "2-digit" }, "month") : this.num(e.month, 2);
|
|
1474
1474
|
case "MMM":
|
|
1475
1475
|
return l("short", !1);
|
|
1476
1476
|
case "MMMM":
|
|
@@ -1478,13 +1478,13 @@ class C {
|
|
|
1478
1478
|
case "MMMMM":
|
|
1479
1479
|
return l("narrow", !1);
|
|
1480
1480
|
case "y":
|
|
1481
|
-
return
|
|
1481
|
+
return s ? i({ year: "numeric" }, "year") : this.num(e.year);
|
|
1482
1482
|
case "yy":
|
|
1483
|
-
return
|
|
1483
|
+
return s ? i({ year: "2-digit" }, "year") : this.num(e.year.toString().slice(-2), 2);
|
|
1484
1484
|
case "yyyy":
|
|
1485
|
-
return
|
|
1485
|
+
return s ? i({ year: "numeric" }, "year") : this.num(e.year, 4);
|
|
1486
1486
|
case "yyyyyy":
|
|
1487
|
-
return
|
|
1487
|
+
return s ? i({ year: "numeric" }, "year") : this.num(e.year, 6);
|
|
1488
1488
|
case "G":
|
|
1489
1489
|
return m("short");
|
|
1490
1490
|
case "GG":
|
|
@@ -1526,7 +1526,7 @@ class C {
|
|
|
1526
1526
|
return an(C.parseFormat(n), v);
|
|
1527
1527
|
}
|
|
1528
1528
|
formatDurationFromString(e, n) {
|
|
1529
|
-
const
|
|
1529
|
+
const r = (l) => {
|
|
1530
1530
|
switch (l[0]) {
|
|
1531
1531
|
case "S":
|
|
1532
1532
|
return "millisecond";
|
|
@@ -1547,26 +1547,26 @@ class C {
|
|
|
1547
1547
|
default:
|
|
1548
1548
|
return null;
|
|
1549
1549
|
}
|
|
1550
|
-
},
|
|
1551
|
-
const d =
|
|
1550
|
+
}, s = (l) => (u) => {
|
|
1551
|
+
const d = r(u);
|
|
1552
1552
|
return d ? this.num(l.get(d), u.length) : u;
|
|
1553
1553
|
}, i = C.parseFormat(n), a = i.reduce(
|
|
1554
1554
|
(l, { literal: u, val: d }) => u ? l : l.concat(d),
|
|
1555
1555
|
[]
|
|
1556
|
-
), o = e.shiftTo(...a.map(
|
|
1557
|
-
return an(i,
|
|
1556
|
+
), o = e.shiftTo(...a.map(r).filter((l) => l));
|
|
1557
|
+
return an(i, s(o));
|
|
1558
1558
|
}
|
|
1559
1559
|
}
|
|
1560
|
-
const
|
|
1560
|
+
const sr = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
1561
1561
|
function Se(...t) {
|
|
1562
|
-
const e = t.reduce((n,
|
|
1562
|
+
const e = t.reduce((n, r) => n + r.source, "");
|
|
1563
1563
|
return RegExp(`^${e}$`);
|
|
1564
1564
|
}
|
|
1565
1565
|
function Oe(...t) {
|
|
1566
1566
|
return (e) => t.reduce(
|
|
1567
|
-
([n,
|
|
1568
|
-
const [a, o, l] = i(e,
|
|
1569
|
-
return [{ ...n, ...a }, o ||
|
|
1567
|
+
([n, r, s], i) => {
|
|
1568
|
+
const [a, o, l] = i(e, s);
|
|
1569
|
+
return [{ ...n, ...a }, o || r, l];
|
|
1570
1570
|
},
|
|
1571
1571
|
[{}, null, 1]
|
|
1572
1572
|
).slice(0, 2);
|
|
@@ -1574,30 +1574,30 @@ function Oe(...t) {
|
|
|
1574
1574
|
function Te(t, ...e) {
|
|
1575
1575
|
if (t == null)
|
|
1576
1576
|
return [null, null];
|
|
1577
|
-
for (const [n,
|
|
1578
|
-
const
|
|
1579
|
-
if (
|
|
1580
|
-
return s
|
|
1577
|
+
for (const [n, r] of e) {
|
|
1578
|
+
const s = n.exec(t);
|
|
1579
|
+
if (s)
|
|
1580
|
+
return r(s);
|
|
1581
1581
|
}
|
|
1582
1582
|
return [null, null];
|
|
1583
1583
|
}
|
|
1584
|
-
function
|
|
1584
|
+
function ir(...t) {
|
|
1585
1585
|
return (e, n) => {
|
|
1586
|
-
const
|
|
1587
|
-
let
|
|
1588
|
-
for (
|
|
1589
|
-
|
|
1590
|
-
return [
|
|
1586
|
+
const r = {};
|
|
1587
|
+
let s;
|
|
1588
|
+
for (s = 0; s < t.length; s++)
|
|
1589
|
+
r[t[s]] = se(e[n + s]);
|
|
1590
|
+
return [r, null, n + s];
|
|
1591
1591
|
};
|
|
1592
1592
|
}
|
|
1593
|
-
const
|
|
1594
|
-
`${
|
|
1595
|
-
),
|
|
1593
|
+
const ar = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/, bs = `(?:${ar.source}?(?:\\[(${sr.source})\\])?)?`, zt = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, or = RegExp(`${zt.source}${bs}`), At = RegExp(`(?:T${or.source})?`), Fs = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, Cs = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Vs = /(\d{4})-?(\d{3})/, Ws = ir("weekYear", "weekNumber", "weekDay"), Ls = ir("year", "ordinal"), $s = /(\d{4})-(\d\d)-(\d\d)/, lr = RegExp(
|
|
1594
|
+
`${zt.source} ?(?:${ar.source}|(${sr.source}))?`
|
|
1595
|
+
), Zs = RegExp(`(?: ${lr.source})?`);
|
|
1596
1596
|
function pe(t, e, n) {
|
|
1597
|
-
const
|
|
1598
|
-
return w(
|
|
1597
|
+
const r = t[e];
|
|
1598
|
+
return w(r) ? n : se(r);
|
|
1599
1599
|
}
|
|
1600
|
-
function
|
|
1600
|
+
function zs(t, e) {
|
|
1601
1601
|
return [{
|
|
1602
1602
|
year: pe(t, e),
|
|
1603
1603
|
month: pe(t, e + 1, 1),
|
|
@@ -1613,21 +1613,21 @@ function ve(t, e) {
|
|
|
1613
1613
|
}, null, e + 4];
|
|
1614
1614
|
}
|
|
1615
1615
|
function _e(t, e) {
|
|
1616
|
-
const n = !t[e] && !t[e + 1],
|
|
1617
|
-
return [{},
|
|
1616
|
+
const n = !t[e] && !t[e + 1], r = lt(t[e + 1], t[e + 2]), s = n ? null : W.instance(r);
|
|
1617
|
+
return [{}, s, e + 3];
|
|
1618
1618
|
}
|
|
1619
|
-
function
|
|
1619
|
+
function qe(t, e) {
|
|
1620
1620
|
const n = t[e] ? X.create(t[e]) : null;
|
|
1621
1621
|
return [{}, n, e + 1];
|
|
1622
1622
|
}
|
|
1623
|
-
const
|
|
1624
|
-
function
|
|
1625
|
-
const [e, n,
|
|
1623
|
+
const As = RegExp(`^T?${zt.source}$`), _s = /^-?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)?)?)$/;
|
|
1624
|
+
function qs(t) {
|
|
1625
|
+
const [e, n, r, s, i, a, o, l, u] = t, d = e[0] === "-", m = l && l[0] === "-", v = (f, g = !1) => f !== void 0 && (g || f && d) ? -f : f;
|
|
1626
1626
|
return [
|
|
1627
1627
|
{
|
|
1628
1628
|
years: v(oe(n)),
|
|
1629
|
-
months: v(oe(
|
|
1630
|
-
weeks: v(oe(
|
|
1629
|
+
months: v(oe(r)),
|
|
1630
|
+
weeks: v(oe(s)),
|
|
1631
1631
|
days: v(oe(i)),
|
|
1632
1632
|
hours: v(oe(a)),
|
|
1633
1633
|
minutes: v(oe(o)),
|
|
@@ -1636,7 +1636,7 @@ function Rr(t) {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
];
|
|
1638
1638
|
}
|
|
1639
|
-
const
|
|
1639
|
+
const Us = {
|
|
1640
1640
|
GMT: 0,
|
|
1641
1641
|
EDT: -4 * 60,
|
|
1642
1642
|
EST: -5 * 60,
|
|
@@ -1647,24 +1647,24 @@ const Ur = {
|
|
|
1647
1647
|
PDT: -7 * 60,
|
|
1648
1648
|
PST: -8 * 60
|
|
1649
1649
|
};
|
|
1650
|
-
function _t(t, e, n,
|
|
1650
|
+
function _t(t, e, n, r, s, i, a) {
|
|
1651
1651
|
const o = {
|
|
1652
|
-
year: e.length === 2 ? Nt(
|
|
1652
|
+
year: e.length === 2 ? Nt(se(e)) : se(e),
|
|
1653
1653
|
month: Kn.indexOf(n) + 1,
|
|
1654
|
-
day:
|
|
1655
|
-
hour:
|
|
1656
|
-
minute:
|
|
1654
|
+
day: se(r),
|
|
1655
|
+
hour: se(s),
|
|
1656
|
+
minute: se(i)
|
|
1657
1657
|
};
|
|
1658
|
-
return a && (o.second =
|
|
1658
|
+
return a && (o.second = se(a)), t && (o.weekday = t.length > 3 ? Xn.indexOf(t) + 1 : er.indexOf(t) + 1), o;
|
|
1659
1659
|
}
|
|
1660
|
-
const
|
|
1661
|
-
function
|
|
1660
|
+
const Rs = /^(?:(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)))$/;
|
|
1661
|
+
function Hs(t) {
|
|
1662
1662
|
const [
|
|
1663
1663
|
,
|
|
1664
1664
|
e,
|
|
1665
1665
|
n,
|
|
1666
|
-
s,
|
|
1667
1666
|
r,
|
|
1667
|
+
s,
|
|
1668
1668
|
i,
|
|
1669
1669
|
a,
|
|
1670
1670
|
o,
|
|
@@ -1672,82 +1672,82 @@ function qr(t) {
|
|
|
1672
1672
|
u,
|
|
1673
1673
|
d,
|
|
1674
1674
|
m
|
|
1675
|
-
] = t, v = _t(e,
|
|
1675
|
+
] = t, v = _t(e, s, r, n, i, a, o);
|
|
1676
1676
|
let f;
|
|
1677
|
-
return l ? f =
|
|
1677
|
+
return l ? f = Us[l] : u ? f = 0 : f = lt(d, m), [v, new W(f)];
|
|
1678
1678
|
}
|
|
1679
|
-
function
|
|
1679
|
+
function Ys(t) {
|
|
1680
1680
|
return t.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
1681
1681
|
}
|
|
1682
|
-
const
|
|
1682
|
+
const Ps = /^(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$/, js = /^(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$/, Gs = /^(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})$/;
|
|
1683
1683
|
function on(t) {
|
|
1684
|
-
const [, e, n,
|
|
1685
|
-
return [_t(e,
|
|
1684
|
+
const [, e, n, r, s, i, a, o] = t;
|
|
1685
|
+
return [_t(e, s, r, n, i, a, o), W.utcInstance];
|
|
1686
1686
|
}
|
|
1687
|
-
function
|
|
1688
|
-
const [, e, n,
|
|
1689
|
-
return [_t(e, o, n,
|
|
1687
|
+
function Js(t) {
|
|
1688
|
+
const [, e, n, r, s, i, a, o] = t;
|
|
1689
|
+
return [_t(e, o, n, r, s, i, a), W.utcInstance];
|
|
1690
1690
|
}
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1691
|
+
const Bs = Se(Fs, At), Ks = Se(Cs, At), Qs = Se(Vs, At), Xs = Se(or), ur = Oe(
|
|
1692
|
+
zs,
|
|
1693
1693
|
ve,
|
|
1694
1694
|
_e,
|
|
1695
|
-
|
|
1695
|
+
qe
|
|
1696
1696
|
), ei = Oe(
|
|
1697
|
-
|
|
1697
|
+
Ws,
|
|
1698
1698
|
ve,
|
|
1699
1699
|
_e,
|
|
1700
|
-
|
|
1700
|
+
qe
|
|
1701
1701
|
), ti = Oe(
|
|
1702
|
-
|
|
1702
|
+
Ls,
|
|
1703
1703
|
ve,
|
|
1704
1704
|
_e,
|
|
1705
|
-
|
|
1705
|
+
qe
|
|
1706
1706
|
), ni = Oe(
|
|
1707
1707
|
ve,
|
|
1708
1708
|
_e,
|
|
1709
|
-
|
|
1709
|
+
qe
|
|
1710
1710
|
);
|
|
1711
|
-
function
|
|
1711
|
+
function ri(t) {
|
|
1712
1712
|
return Te(
|
|
1713
1713
|
t,
|
|
1714
|
-
[
|
|
1715
|
-
[
|
|
1716
|
-
[
|
|
1717
|
-
[
|
|
1714
|
+
[Bs, ur],
|
|
1715
|
+
[Ks, ei],
|
|
1716
|
+
[Qs, ti],
|
|
1717
|
+
[Xs, ni]
|
|
1718
1718
|
);
|
|
1719
1719
|
}
|
|
1720
|
-
function
|
|
1721
|
-
return Te(
|
|
1720
|
+
function si(t) {
|
|
1721
|
+
return Te(Ys(t), [Rs, Hs]);
|
|
1722
1722
|
}
|
|
1723
1723
|
function ii(t) {
|
|
1724
1724
|
return Te(
|
|
1725
1725
|
t,
|
|
1726
|
-
[
|
|
1727
|
-
[
|
|
1728
|
-
[
|
|
1726
|
+
[Ps, on],
|
|
1727
|
+
[js, on],
|
|
1728
|
+
[Gs, Js]
|
|
1729
1729
|
);
|
|
1730
1730
|
}
|
|
1731
1731
|
function ai(t) {
|
|
1732
|
-
return Te(t, [
|
|
1732
|
+
return Te(t, [_s, qs]);
|
|
1733
1733
|
}
|
|
1734
1734
|
const oi = Oe(ve);
|
|
1735
1735
|
function li(t) {
|
|
1736
|
-
return Te(t, [
|
|
1736
|
+
return Te(t, [As, oi]);
|
|
1737
1737
|
}
|
|
1738
|
-
const ui = Se($
|
|
1738
|
+
const ui = Se($s, Zs), ci = Se(lr), di = Oe(
|
|
1739
1739
|
ve,
|
|
1740
1740
|
_e,
|
|
1741
|
-
|
|
1741
|
+
qe
|
|
1742
1742
|
);
|
|
1743
1743
|
function fi(t) {
|
|
1744
1744
|
return Te(
|
|
1745
1745
|
t,
|
|
1746
|
-
[ui,
|
|
1746
|
+
[ui, ur],
|
|
1747
1747
|
[ci, di]
|
|
1748
1748
|
);
|
|
1749
1749
|
}
|
|
1750
|
-
const ln = "Invalid Duration",
|
|
1750
|
+
const ln = "Invalid Duration", cr = {
|
|
1751
1751
|
weeks: {
|
|
1752
1752
|
days: 7,
|
|
1753
1753
|
hours: 7 * 24,
|
|
@@ -1792,26 +1792,26 @@ const ln = "Invalid Duration", cs = {
|
|
|
1792
1792
|
seconds: 30 * 24 * 60 * 60,
|
|
1793
1793
|
milliseconds: 30 * 24 * 60 * 60 * 1e3
|
|
1794
1794
|
},
|
|
1795
|
-
...
|
|
1796
|
-
},
|
|
1795
|
+
...cr
|
|
1796
|
+
}, q = 146097 / 400, me = 146097 / 4800, mi = {
|
|
1797
1797
|
years: {
|
|
1798
1798
|
quarters: 4,
|
|
1799
1799
|
months: 12,
|
|
1800
|
-
weeks:
|
|
1801
|
-
days:
|
|
1802
|
-
hours:
|
|
1803
|
-
minutes:
|
|
1804
|
-
seconds:
|
|
1805
|
-
milliseconds:
|
|
1800
|
+
weeks: q / 7,
|
|
1801
|
+
days: q,
|
|
1802
|
+
hours: q * 24,
|
|
1803
|
+
minutes: q * 24 * 60,
|
|
1804
|
+
seconds: q * 24 * 60 * 60,
|
|
1805
|
+
milliseconds: q * 24 * 60 * 60 * 1e3
|
|
1806
1806
|
},
|
|
1807
1807
|
quarters: {
|
|
1808
1808
|
months: 3,
|
|
1809
|
-
weeks:
|
|
1810
|
-
days:
|
|
1811
|
-
hours:
|
|
1812
|
-
minutes:
|
|
1813
|
-
seconds:
|
|
1814
|
-
milliseconds:
|
|
1809
|
+
weeks: q / 28,
|
|
1810
|
+
days: q / 4,
|
|
1811
|
+
hours: q * 24 / 4,
|
|
1812
|
+
minutes: q * 24 * 60 / 4,
|
|
1813
|
+
seconds: q * 24 * 60 * 60 / 4,
|
|
1814
|
+
milliseconds: q * 24 * 60 * 60 * 1e3 / 4
|
|
1815
1815
|
},
|
|
1816
1816
|
months: {
|
|
1817
1817
|
weeks: me / 7,
|
|
@@ -1821,7 +1821,7 @@ const ln = "Invalid Duration", cs = {
|
|
|
1821
1821
|
seconds: me * 24 * 60 * 60,
|
|
1822
1822
|
milliseconds: me * 24 * 60 * 60 * 1e3
|
|
1823
1823
|
},
|
|
1824
|
-
...
|
|
1824
|
+
...cr
|
|
1825
1825
|
}, ue = [
|
|
1826
1826
|
"years",
|
|
1827
1827
|
"quarters",
|
|
@@ -1834,44 +1834,44 @@ const ln = "Invalid Duration", cs = {
|
|
|
1834
1834
|
"milliseconds"
|
|
1835
1835
|
], yi = ue.slice(0).reverse();
|
|
1836
1836
|
function ne(t, e, n = !1) {
|
|
1837
|
-
const
|
|
1837
|
+
const r = {
|
|
1838
1838
|
values: n ? e.values : { ...t.values, ...e.values || {} },
|
|
1839
1839
|
loc: t.loc.clone(e.loc),
|
|
1840
1840
|
conversionAccuracy: e.conversionAccuracy || t.conversionAccuracy,
|
|
1841
1841
|
matrix: e.matrix || t.matrix
|
|
1842
1842
|
};
|
|
1843
|
-
return new T(
|
|
1843
|
+
return new T(r);
|
|
1844
1844
|
}
|
|
1845
|
-
function
|
|
1845
|
+
function dr(t, e) {
|
|
1846
1846
|
let n = e.milliseconds ?? 0;
|
|
1847
|
-
for (const
|
|
1848
|
-
e[
|
|
1847
|
+
for (const r of yi.slice(1))
|
|
1848
|
+
e[r] && (n += e[r] * t[r].milliseconds);
|
|
1849
1849
|
return n;
|
|
1850
1850
|
}
|
|
1851
1851
|
function un(t, e) {
|
|
1852
|
-
const n =
|
|
1853
|
-
ue.reduceRight((
|
|
1854
|
-
if (w(e[
|
|
1855
|
-
return
|
|
1856
|
-
if (
|
|
1857
|
-
const i = e[
|
|
1858
|
-
e[
|
|
1852
|
+
const n = dr(t, e) < 0 ? -1 : 1;
|
|
1853
|
+
ue.reduceRight((r, s) => {
|
|
1854
|
+
if (w(e[s]))
|
|
1855
|
+
return r;
|
|
1856
|
+
if (r) {
|
|
1857
|
+
const i = e[r] * n, a = t[s][r], o = Math.floor(i / a);
|
|
1858
|
+
e[s] += o * n, e[r] -= o * a * n;
|
|
1859
1859
|
}
|
|
1860
|
-
return
|
|
1861
|
-
}, null), ue.reduce((
|
|
1862
|
-
if (w(e[
|
|
1863
|
-
return
|
|
1864
|
-
if (
|
|
1865
|
-
const i = e[
|
|
1866
|
-
e[
|
|
1860
|
+
return s;
|
|
1861
|
+
}, null), ue.reduce((r, s) => {
|
|
1862
|
+
if (w(e[s]))
|
|
1863
|
+
return r;
|
|
1864
|
+
if (r) {
|
|
1865
|
+
const i = e[r] % 1;
|
|
1866
|
+
e[r] -= i, e[s] += i * t[r][s];
|
|
1867
1867
|
}
|
|
1868
|
-
return
|
|
1868
|
+
return s;
|
|
1869
1869
|
}, null);
|
|
1870
1870
|
}
|
|
1871
1871
|
function gi(t) {
|
|
1872
1872
|
const e = {};
|
|
1873
|
-
for (const [n,
|
|
1874
|
-
|
|
1873
|
+
for (const [n, r] of Object.entries(t))
|
|
1874
|
+
r !== 0 && (e[n] = r);
|
|
1875
1875
|
return e;
|
|
1876
1876
|
}
|
|
1877
1877
|
class T {
|
|
@@ -1880,8 +1880,8 @@ class T {
|
|
|
1880
1880
|
*/
|
|
1881
1881
|
constructor(e) {
|
|
1882
1882
|
const n = e.conversionAccuracy === "longterm" || !1;
|
|
1883
|
-
let
|
|
1884
|
-
e.matrix && (
|
|
1883
|
+
let r = n ? mi : hi;
|
|
1884
|
+
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;
|
|
1885
1885
|
}
|
|
1886
1886
|
/**
|
|
1887
1887
|
* Create Duration from a number of milliseconds.
|
|
@@ -1921,7 +1921,7 @@ class T {
|
|
|
1921
1921
|
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
|
|
1922
1922
|
);
|
|
1923
1923
|
return new T({
|
|
1924
|
-
values:
|
|
1924
|
+
values: st(e, T.normalizeUnit),
|
|
1925
1925
|
loc: D.fromObject(n),
|
|
1926
1926
|
conversionAccuracy: n.conversionAccuracy,
|
|
1927
1927
|
matrix: n.matrix
|
|
@@ -1963,8 +1963,8 @@ class T {
|
|
|
1963
1963
|
* @return {Duration}
|
|
1964
1964
|
*/
|
|
1965
1965
|
static fromISO(e, n) {
|
|
1966
|
-
const [
|
|
1967
|
-
return
|
|
1966
|
+
const [r] = ai(e);
|
|
1967
|
+
return r ? T.fromObject(r, n) : T.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
1968
1968
|
}
|
|
1969
1969
|
/**
|
|
1970
1970
|
* Create a Duration from an ISO 8601 time string.
|
|
@@ -1983,8 +1983,8 @@ class T {
|
|
|
1983
1983
|
* @return {Duration}
|
|
1984
1984
|
*/
|
|
1985
1985
|
static fromISOTime(e, n) {
|
|
1986
|
-
const [
|
|
1987
|
-
return
|
|
1986
|
+
const [r] = li(e);
|
|
1987
|
+
return r ? T.fromObject(r, n) : T.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
1988
1988
|
}
|
|
1989
1989
|
/**
|
|
1990
1990
|
* Create an invalid Duration.
|
|
@@ -1995,10 +1995,10 @@ class T {
|
|
|
1995
1995
|
static invalid(e, n = null) {
|
|
1996
1996
|
if (!e)
|
|
1997
1997
|
throw new $("need to specify a reason the Duration is invalid");
|
|
1998
|
-
const
|
|
1999
|
-
if (
|
|
2000
|
-
throw new
|
|
2001
|
-
return new T({ invalid:
|
|
1998
|
+
const r = e instanceof J ? e : new J(e, n);
|
|
1999
|
+
if (E.throwOnInvalid)
|
|
2000
|
+
throw new Rr(r);
|
|
2001
|
+
return new T({ invalid: r });
|
|
2002
2002
|
}
|
|
2003
2003
|
/**
|
|
2004
2004
|
* @private
|
|
@@ -2074,11 +2074,11 @@ class T {
|
|
|
2074
2074
|
* @return {string}
|
|
2075
2075
|
*/
|
|
2076
2076
|
toFormat(e, n = {}) {
|
|
2077
|
-
const
|
|
2077
|
+
const r = {
|
|
2078
2078
|
...n,
|
|
2079
2079
|
floor: n.round !== !1 && n.floor !== !1
|
|
2080
2080
|
};
|
|
2081
|
-
return this.isValid ? C.create(this.loc,
|
|
2081
|
+
return this.isValid ? C.create(this.loc, r).formatDurationFromString(this, e) : ln;
|
|
2082
2082
|
}
|
|
2083
2083
|
/**
|
|
2084
2084
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -2097,10 +2097,10 @@ class T {
|
|
|
2097
2097
|
toHuman(e = {}) {
|
|
2098
2098
|
if (!this.isValid)
|
|
2099
2099
|
return ln;
|
|
2100
|
-
const n = ue.map((
|
|
2101
|
-
const
|
|
2102
|
-
return w(
|
|
2103
|
-
}).filter((
|
|
2100
|
+
const n = ue.map((r) => {
|
|
2101
|
+
const s = this.values[r];
|
|
2102
|
+
return w(s) ? null : this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...e, unit: r.slice(0, -1) }).format(s);
|
|
2103
|
+
}).filter((r) => r);
|
|
2104
2104
|
return this.loc.listFormatter({ type: "conjunction", style: e.listStyle || "narrow", ...e }).format(n);
|
|
2105
2105
|
}
|
|
2106
2106
|
/**
|
|
@@ -2182,7 +2182,7 @@ class T {
|
|
|
2182
2182
|
* @return {number}
|
|
2183
2183
|
*/
|
|
2184
2184
|
toMillis() {
|
|
2185
|
-
return this.isValid ?
|
|
2185
|
+
return this.isValid ? dr(this.matrix, this.values) : NaN;
|
|
2186
2186
|
}
|
|
2187
2187
|
/**
|
|
2188
2188
|
* Returns an milliseconds value of this Duration. Alias of {@link toMillis}
|
|
@@ -2199,10 +2199,10 @@ class T {
|
|
|
2199
2199
|
plus(e) {
|
|
2200
2200
|
if (!this.isValid)
|
|
2201
2201
|
return this;
|
|
2202
|
-
const n = T.fromDurationLike(e),
|
|
2203
|
-
for (const
|
|
2204
|
-
(ke(n.values,
|
|
2205
|
-
return ne(this, { values:
|
|
2202
|
+
const n = T.fromDurationLike(e), r = {};
|
|
2203
|
+
for (const s of ue)
|
|
2204
|
+
(ke(n.values, s) || ke(this.values, s)) && (r[s] = n.get(s) + this.get(s));
|
|
2205
|
+
return ne(this, { values: r }, !0);
|
|
2206
2206
|
}
|
|
2207
2207
|
/**
|
|
2208
2208
|
* Make this Duration shorter by the specified amount. Return a newly-constructed Duration.
|
|
@@ -2226,8 +2226,8 @@ class T {
|
|
|
2226
2226
|
if (!this.isValid)
|
|
2227
2227
|
return this;
|
|
2228
2228
|
const n = {};
|
|
2229
|
-
for (const
|
|
2230
|
-
n[
|
|
2229
|
+
for (const r of Object.keys(this.values))
|
|
2230
|
+
n[r] = Bn(e(this.values[r], r));
|
|
2231
2231
|
return ne(this, { values: n }, !0);
|
|
2232
2232
|
}
|
|
2233
2233
|
/**
|
|
@@ -2251,7 +2251,7 @@ class T {
|
|
|
2251
2251
|
set(e) {
|
|
2252
2252
|
if (!this.isValid)
|
|
2253
2253
|
return this;
|
|
2254
|
-
const n = { ...this.values, ...
|
|
2254
|
+
const n = { ...this.values, ...st(e, T.normalizeUnit) };
|
|
2255
2255
|
return ne(this, { values: n });
|
|
2256
2256
|
}
|
|
2257
2257
|
/**
|
|
@@ -2259,8 +2259,8 @@ class T {
|
|
|
2259
2259
|
* @example dur.reconfigure({ locale: 'en-GB' })
|
|
2260
2260
|
* @return {Duration}
|
|
2261
2261
|
*/
|
|
2262
|
-
reconfigure({ locale: e, numberingSystem: n, conversionAccuracy:
|
|
2263
|
-
const a = { loc: this.loc.clone({ locale: e, numberingSystem: n }), matrix:
|
|
2262
|
+
reconfigure({ locale: e, numberingSystem: n, conversionAccuracy: r, matrix: s } = {}) {
|
|
2263
|
+
const a = { loc: this.loc.clone({ locale: e, numberingSystem: n }), matrix: s, conversionAccuracy: r };
|
|
2264
2264
|
return ne(this, a);
|
|
2265
2265
|
}
|
|
2266
2266
|
/**
|
|
@@ -2317,21 +2317,21 @@ class T {
|
|
|
2317
2317
|
if (e.length === 0)
|
|
2318
2318
|
return this;
|
|
2319
2319
|
e = e.map((a) => T.normalizeUnit(a));
|
|
2320
|
-
const n = {},
|
|
2320
|
+
const n = {}, r = {}, s = this.toObject();
|
|
2321
2321
|
let i;
|
|
2322
2322
|
for (const a of ue)
|
|
2323
2323
|
if (e.indexOf(a) >= 0) {
|
|
2324
2324
|
i = a;
|
|
2325
2325
|
let o = 0;
|
|
2326
|
-
for (const u in
|
|
2327
|
-
o += this.matrix[u][a] *
|
|
2328
|
-
ce(
|
|
2326
|
+
for (const u in r)
|
|
2327
|
+
o += this.matrix[u][a] * r[u], r[u] = 0;
|
|
2328
|
+
ce(s[a]) && (o += s[a]);
|
|
2329
2329
|
const l = Math.trunc(o);
|
|
2330
|
-
n[a] = l,
|
|
2330
|
+
n[a] = l, r[a] = (o * 1e3 - l * 1e3) / 1e3;
|
|
2331
2331
|
} else
|
|
2332
|
-
ce(
|
|
2333
|
-
for (const a in
|
|
2334
|
-
|
|
2332
|
+
ce(s[a]) && (r[a] = s[a]);
|
|
2333
|
+
for (const a in r)
|
|
2334
|
+
r[a] !== 0 && (n[i] += a === i ? r[a] : r[a] / this.matrix[i][a]);
|
|
2335
2335
|
return un(this.matrix, n), ne(this, { values: n }, !0);
|
|
2336
2336
|
}
|
|
2337
2337
|
/**
|
|
@@ -2458,23 +2458,23 @@ class T {
|
|
|
2458
2458
|
equals(e) {
|
|
2459
2459
|
if (!this.isValid || !e.isValid || !this.loc.equals(e.loc))
|
|
2460
2460
|
return !1;
|
|
2461
|
-
function n(
|
|
2462
|
-
return
|
|
2461
|
+
function n(r, s) {
|
|
2462
|
+
return r === void 0 || r === 0 ? s === void 0 || s === 0 : r === s;
|
|
2463
2463
|
}
|
|
2464
|
-
for (const
|
|
2465
|
-
if (!n(this.values[
|
|
2464
|
+
for (const r of ue)
|
|
2465
|
+
if (!n(this.values[r], e.values[r]))
|
|
2466
2466
|
return !1;
|
|
2467
2467
|
return !0;
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
2470
|
const ye = "Invalid Interval";
|
|
2471
2471
|
function wi(t, e) {
|
|
2472
|
-
return !t || !t.isValid ?
|
|
2472
|
+
return !t || !t.isValid ? I.invalid("missing or invalid start") : !e || !e.isValid ? I.invalid("missing or invalid end") : e < t ? I.invalid(
|
|
2473
2473
|
"end before start",
|
|
2474
2474
|
`The end of an interval must be after its start, but you had start=${t.toISO()} and end=${e.toISO()}`
|
|
2475
2475
|
) : null;
|
|
2476
2476
|
}
|
|
2477
|
-
class
|
|
2477
|
+
class I {
|
|
2478
2478
|
/**
|
|
2479
2479
|
* @private
|
|
2480
2480
|
*/
|
|
@@ -2490,10 +2490,10 @@ class x {
|
|
|
2490
2490
|
static invalid(e, n = null) {
|
|
2491
2491
|
if (!e)
|
|
2492
2492
|
throw new $("need to specify a reason the Interval is invalid");
|
|
2493
|
-
const
|
|
2494
|
-
if (
|
|
2495
|
-
throw new
|
|
2496
|
-
return new
|
|
2493
|
+
const r = e instanceof J ? e : new J(e, n);
|
|
2494
|
+
if (E.throwOnInvalid)
|
|
2495
|
+
throw new Ur(r);
|
|
2496
|
+
return new I({ invalid: r });
|
|
2497
2497
|
}
|
|
2498
2498
|
/**
|
|
2499
2499
|
* Create an Interval from a start DateTime and an end DateTime. Inclusive of the start but not the end.
|
|
@@ -2502,10 +2502,10 @@ class x {
|
|
|
2502
2502
|
* @return {Interval}
|
|
2503
2503
|
*/
|
|
2504
2504
|
static fromDateTimes(e, n) {
|
|
2505
|
-
const
|
|
2506
|
-
return i ?? new
|
|
2507
|
-
start:
|
|
2508
|
-
end:
|
|
2505
|
+
const r = xe(e), s = xe(n), i = wi(r, s);
|
|
2506
|
+
return i ?? new I({
|
|
2507
|
+
start: r,
|
|
2508
|
+
end: s
|
|
2509
2509
|
});
|
|
2510
2510
|
}
|
|
2511
2511
|
/**
|
|
@@ -2515,8 +2515,8 @@ class x {
|
|
|
2515
2515
|
* @return {Interval}
|
|
2516
2516
|
*/
|
|
2517
2517
|
static after(e, n) {
|
|
2518
|
-
const
|
|
2519
|
-
return
|
|
2518
|
+
const r = T.fromDurationLike(n), s = xe(e);
|
|
2519
|
+
return I.fromDateTimes(s, s.plus(r));
|
|
2520
2520
|
}
|
|
2521
2521
|
/**
|
|
2522
2522
|
* Create an Interval from an end DateTime and a Duration to extend backwards to.
|
|
@@ -2525,8 +2525,8 @@ class x {
|
|
|
2525
2525
|
* @return {Interval}
|
|
2526
2526
|
*/
|
|
2527
2527
|
static before(e, n) {
|
|
2528
|
-
const
|
|
2529
|
-
return
|
|
2528
|
+
const r = T.fromDurationLike(n), s = xe(e);
|
|
2529
|
+
return I.fromDateTimes(s.minus(r), s);
|
|
2530
2530
|
}
|
|
2531
2531
|
/**
|
|
2532
2532
|
* Create an Interval from an ISO 8601 string.
|
|
@@ -2537,33 +2537,33 @@ class x {
|
|
|
2537
2537
|
* @return {Interval}
|
|
2538
2538
|
*/
|
|
2539
2539
|
static fromISO(e, n) {
|
|
2540
|
-
const [
|
|
2541
|
-
if (
|
|
2540
|
+
const [r, s] = (e || "").split("/", 2);
|
|
2541
|
+
if (r && s) {
|
|
2542
2542
|
let i, a;
|
|
2543
2543
|
try {
|
|
2544
|
-
i = y.fromISO(
|
|
2544
|
+
i = y.fromISO(r, n), a = i.isValid;
|
|
2545
2545
|
} catch {
|
|
2546
2546
|
a = !1;
|
|
2547
2547
|
}
|
|
2548
2548
|
let o, l;
|
|
2549
2549
|
try {
|
|
2550
|
-
o = y.fromISO(
|
|
2550
|
+
o = y.fromISO(s, n), l = o.isValid;
|
|
2551
2551
|
} catch {
|
|
2552
2552
|
l = !1;
|
|
2553
2553
|
}
|
|
2554
2554
|
if (a && l)
|
|
2555
|
-
return
|
|
2555
|
+
return I.fromDateTimes(i, o);
|
|
2556
2556
|
if (a) {
|
|
2557
|
-
const u = T.fromISO(
|
|
2557
|
+
const u = T.fromISO(s, n);
|
|
2558
2558
|
if (u.isValid)
|
|
2559
|
-
return
|
|
2559
|
+
return I.after(i, u);
|
|
2560
2560
|
} else if (l) {
|
|
2561
|
-
const u = T.fromISO(
|
|
2561
|
+
const u = T.fromISO(r, n);
|
|
2562
2562
|
if (u.isValid)
|
|
2563
|
-
return
|
|
2563
|
+
return I.before(o, u);
|
|
2564
2564
|
}
|
|
2565
2565
|
}
|
|
2566
|
-
return
|
|
2566
|
+
return I.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
2567
2567
|
}
|
|
2568
2568
|
/**
|
|
2569
2569
|
* Check if an object is an Interval. Works across context boundaries
|
|
@@ -2628,9 +2628,9 @@ class x {
|
|
|
2628
2628
|
count(e = "milliseconds", n) {
|
|
2629
2629
|
if (!this.isValid)
|
|
2630
2630
|
return NaN;
|
|
2631
|
-
const
|
|
2632
|
-
let
|
|
2633
|
-
return n != null && n.useLocaleWeeks ?
|
|
2631
|
+
const r = this.start.startOf(e, n);
|
|
2632
|
+
let s;
|
|
2633
|
+
return n != null && n.useLocaleWeeks ? s = this.end.reconfigure({ locale: r.locale }) : s = this.end, s = s.startOf(e, n), Math.floor(s.diff(r, e).get(e)) + (s.valueOf() !== this.end.valueOf());
|
|
2634
2634
|
}
|
|
2635
2635
|
/**
|
|
2636
2636
|
* Returns whether this Interval's start and end are both in the same unit of time
|
|
@@ -2679,7 +2679,7 @@ class x {
|
|
|
2679
2679
|
* @return {Interval}
|
|
2680
2680
|
*/
|
|
2681
2681
|
set({ start: e, end: n } = {}) {
|
|
2682
|
-
return this.isValid ?
|
|
2682
|
+
return this.isValid ? I.fromDateTimes(e || this.s, n || this.e) : this;
|
|
2683
2683
|
}
|
|
2684
2684
|
/**
|
|
2685
2685
|
* Split this Interval at each of the specified DateTimes
|
|
@@ -2689,13 +2689,13 @@ class x {
|
|
|
2689
2689
|
splitAt(...e) {
|
|
2690
2690
|
if (!this.isValid)
|
|
2691
2691
|
return [];
|
|
2692
|
-
const n = e.map(
|
|
2693
|
-
let { s
|
|
2694
|
-
for (;
|
|
2692
|
+
const n = e.map(xe).filter((a) => this.contains(a)).sort((a, o) => a.toMillis() - o.toMillis()), r = [];
|
|
2693
|
+
let { s } = this, i = 0;
|
|
2694
|
+
for (; s < this.e; ) {
|
|
2695
2695
|
const a = n[i] || this.e, o = +a > +this.e ? this.e : a;
|
|
2696
|
-
|
|
2696
|
+
r.push(I.fromDateTimes(s, o)), s = o, i += 1;
|
|
2697
2697
|
}
|
|
2698
|
-
return
|
|
2698
|
+
return r;
|
|
2699
2699
|
}
|
|
2700
2700
|
/**
|
|
2701
2701
|
* Split this Interval into smaller Intervals, each of the specified length.
|
|
@@ -2707,11 +2707,11 @@ class x {
|
|
|
2707
2707
|
const n = T.fromDurationLike(e);
|
|
2708
2708
|
if (!this.isValid || !n.isValid || n.as("milliseconds") === 0)
|
|
2709
2709
|
return [];
|
|
2710
|
-
let { s } = this,
|
|
2710
|
+
let { s: r } = this, s = 1, i;
|
|
2711
2711
|
const a = [];
|
|
2712
|
-
for (;
|
|
2713
|
-
const o = this.start.plus(n.mapUnits((l) => l *
|
|
2714
|
-
i = +o > +this.e ? this.e : o, a.push(
|
|
2712
|
+
for (; r < this.e; ) {
|
|
2713
|
+
const o = this.start.plus(n.mapUnits((l) => l * s));
|
|
2714
|
+
i = +o > +this.e ? this.e : o, a.push(I.fromDateTimes(r, i)), r = i, s += 1;
|
|
2715
2715
|
}
|
|
2716
2716
|
return a;
|
|
2717
2717
|
}
|
|
@@ -2773,8 +2773,8 @@ class x {
|
|
|
2773
2773
|
intersection(e) {
|
|
2774
2774
|
if (!this.isValid)
|
|
2775
2775
|
return this;
|
|
2776
|
-
const n = this.s > e.s ? this.s : e.s,
|
|
2777
|
-
return n >=
|
|
2776
|
+
const n = this.s > e.s ? this.s : e.s, r = this.e < e.e ? this.e : e.e;
|
|
2777
|
+
return n >= r ? null : I.fromDateTimes(n, r);
|
|
2778
2778
|
}
|
|
2779
2779
|
/**
|
|
2780
2780
|
* Return an Interval representing the union of this Interval and the specified Interval.
|
|
@@ -2785,8 +2785,8 @@ class x {
|
|
|
2785
2785
|
union(e) {
|
|
2786
2786
|
if (!this.isValid)
|
|
2787
2787
|
return this;
|
|
2788
|
-
const n = this.s < e.s ? this.s : e.s,
|
|
2789
|
-
return
|
|
2788
|
+
const n = this.s < e.s ? this.s : e.s, r = this.e > e.e ? this.e : e.e;
|
|
2789
|
+
return I.fromDateTimes(n, r);
|
|
2790
2790
|
}
|
|
2791
2791
|
/**
|
|
2792
2792
|
* Merge an array of Intervals into a equivalent minimal set of Intervals.
|
|
@@ -2795,11 +2795,11 @@ class x {
|
|
|
2795
2795
|
* @return {Array}
|
|
2796
2796
|
*/
|
|
2797
2797
|
static merge(e) {
|
|
2798
|
-
const [n,
|
|
2799
|
-
([
|
|
2798
|
+
const [n, r] = e.sort((s, i) => s.s - i.s).reduce(
|
|
2799
|
+
([s, i], a) => i ? i.overlaps(a) || i.abutsStart(a) ? [s, i.union(a)] : [s.concat([i]), a] : [s, a],
|
|
2800
2800
|
[[], null]
|
|
2801
2801
|
);
|
|
2802
|
-
return
|
|
2802
|
+
return r && n.push(r), n;
|
|
2803
2803
|
}
|
|
2804
2804
|
/**
|
|
2805
2805
|
* Return an array of Intervals representing the spans of time that only appear in one of the specified Intervals.
|
|
@@ -2807,14 +2807,14 @@ class x {
|
|
|
2807
2807
|
* @return {Array}
|
|
2808
2808
|
*/
|
|
2809
2809
|
static xor(e) {
|
|
2810
|
-
let n = null,
|
|
2811
|
-
const
|
|
2810
|
+
let n = null, r = 0;
|
|
2811
|
+
const s = [], i = e.map((l) => [
|
|
2812
2812
|
{ time: l.s, type: "s" },
|
|
2813
2813
|
{ time: l.e, type: "e" }
|
|
2814
2814
|
]), a = Array.prototype.concat(...i), o = a.sort((l, u) => l.time - u.time);
|
|
2815
2815
|
for (const l of o)
|
|
2816
|
-
|
|
2817
|
-
return
|
|
2816
|
+
r += l.type === "s" ? 1 : -1, r === 1 ? n = l.time : (n && +n != +l.time && s.push(I.fromDateTimes(n, l.time)), n = null);
|
|
2817
|
+
return I.merge(s);
|
|
2818
2818
|
}
|
|
2819
2819
|
/**
|
|
2820
2820
|
* Return an Interval representing the span of time in this Interval that doesn't overlap with any of the specified Intervals.
|
|
@@ -2822,7 +2822,7 @@ class x {
|
|
|
2822
2822
|
* @return {Array}
|
|
2823
2823
|
*/
|
|
2824
2824
|
difference(...e) {
|
|
2825
|
-
return
|
|
2825
|
+
return I.xor([this].concat(e)).map((n) => this.intersection(n)).filter((n) => n && !n.isEmpty());
|
|
2826
2826
|
}
|
|
2827
2827
|
/**
|
|
2828
2828
|
* Returns a string representation of this Interval appropriate for debugging.
|
|
@@ -2924,7 +2924,7 @@ class x {
|
|
|
2924
2924
|
* @example Interval.fromDateTimes(dt1, dt2).mapEndpoints(endpoint => endpoint.plus({ hours: 2 }))
|
|
2925
2925
|
*/
|
|
2926
2926
|
mapEndpoints(e) {
|
|
2927
|
-
return
|
|
2927
|
+
return I.fromDateTimes(e(this.s), e(this.e));
|
|
2928
2928
|
}
|
|
2929
2929
|
}
|
|
2930
2930
|
class Fe {
|
|
@@ -2933,7 +2933,7 @@ class Fe {
|
|
|
2933
2933
|
* @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.
|
|
2934
2934
|
* @return {boolean}
|
|
2935
2935
|
*/
|
|
2936
|
-
static hasDST(e =
|
|
2936
|
+
static hasDST(e = E.defaultZone) {
|
|
2937
2937
|
const n = y.now().setZone(e).set({ month: 12 });
|
|
2938
2938
|
return !e.isUniversal && n.offset !== n.set({ month: 6 }).offset;
|
|
2939
2939
|
}
|
|
@@ -2960,7 +2960,7 @@ class Fe {
|
|
|
2960
2960
|
* @return {Zone}
|
|
2961
2961
|
*/
|
|
2962
2962
|
static normalizeZone(e) {
|
|
2963
|
-
return ie(e,
|
|
2963
|
+
return ie(e, E.defaultZone);
|
|
2964
2964
|
}
|
|
2965
2965
|
/**
|
|
2966
2966
|
* Get the weekday on which the week starts according to the given locale.
|
|
@@ -3010,8 +3010,8 @@ class Fe {
|
|
|
3010
3010
|
* @example Info.months('long', { outputCalendar: 'islamic' })[0] //=> 'Rabiʻ I'
|
|
3011
3011
|
* @return {Array}
|
|
3012
3012
|
*/
|
|
3013
|
-
static months(e = "long", { locale: n = null, numberingSystem:
|
|
3014
|
-
return (
|
|
3013
|
+
static months(e = "long", { locale: n = null, numberingSystem: r = null, locObj: s = null, outputCalendar: i = "gregory" } = {}) {
|
|
3014
|
+
return (s || D.create(n, r, i)).months(e);
|
|
3015
3015
|
}
|
|
3016
3016
|
/**
|
|
3017
3017
|
* Return an array of format month names.
|
|
@@ -3026,8 +3026,8 @@ class Fe {
|
|
|
3026
3026
|
* @param {string} [opts.outputCalendar='gregory'] - the calendar
|
|
3027
3027
|
* @return {Array}
|
|
3028
3028
|
*/
|
|
3029
|
-
static monthsFormat(e = "long", { locale: n = null, numberingSystem:
|
|
3030
|
-
return (
|
|
3029
|
+
static monthsFormat(e = "long", { locale: n = null, numberingSystem: r = null, locObj: s = null, outputCalendar: i = "gregory" } = {}) {
|
|
3030
|
+
return (s || D.create(n, r, i)).months(e, !0);
|
|
3031
3031
|
}
|
|
3032
3032
|
/**
|
|
3033
3033
|
* Return an array of standalone week names.
|
|
@@ -3043,8 +3043,8 @@ class Fe {
|
|
|
3043
3043
|
* @example Info.weekdays('short', { locale: 'ar' })[0] //=> 'الاثنين'
|
|
3044
3044
|
* @return {Array}
|
|
3045
3045
|
*/
|
|
3046
|
-
static weekdays(e = "long", { locale: n = null, numberingSystem:
|
|
3047
|
-
return (
|
|
3046
|
+
static weekdays(e = "long", { locale: n = null, numberingSystem: r = null, locObj: s = null } = {}) {
|
|
3047
|
+
return (s || D.create(n, r, null)).weekdays(e);
|
|
3048
3048
|
}
|
|
3049
3049
|
/**
|
|
3050
3050
|
* Return an array of format week names.
|
|
@@ -3058,8 +3058,8 @@ class Fe {
|
|
|
3058
3058
|
* @param {string} [opts.locObj=null] - an existing locale object to use
|
|
3059
3059
|
* @return {Array}
|
|
3060
3060
|
*/
|
|
3061
|
-
static weekdaysFormat(e = "long", { locale: n = null, numberingSystem:
|
|
3062
|
-
return (
|
|
3061
|
+
static weekdaysFormat(e = "long", { locale: n = null, numberingSystem: r = null, locObj: s = null } = {}) {
|
|
3062
|
+
return (s || D.create(n, r, null)).weekdays(e, !0);
|
|
3063
3063
|
}
|
|
3064
3064
|
/**
|
|
3065
3065
|
* Return an array of meridiems.
|
|
@@ -3099,11 +3099,11 @@ class Fe {
|
|
|
3099
3099
|
}
|
|
3100
3100
|
}
|
|
3101
3101
|
function cn(t, e) {
|
|
3102
|
-
const n = (
|
|
3103
|
-
return Math.floor(T.fromMillis(
|
|
3102
|
+
const n = (s) => s.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), r = n(e) - n(t);
|
|
3103
|
+
return Math.floor(T.fromMillis(r).as("days"));
|
|
3104
3104
|
}
|
|
3105
3105
|
function pi(t, e, n) {
|
|
3106
|
-
const
|
|
3106
|
+
const r = [
|
|
3107
3107
|
["years", (l, u) => u.year - l.year],
|
|
3108
3108
|
["quarters", (l, u) => u.quarter - l.quarter + (u.year - l.year) * 4],
|
|
3109
3109
|
["months", (l, u) => u.month - l.month + (u.year - l.year) * 12],
|
|
@@ -3115,22 +3115,22 @@ function pi(t, e, n) {
|
|
|
3115
3115
|
}
|
|
3116
3116
|
],
|
|
3117
3117
|
["days", cn]
|
|
3118
|
-
],
|
|
3118
|
+
], s = {}, i = t;
|
|
3119
3119
|
let a, o;
|
|
3120
|
-
for (const [l, u] of
|
|
3121
|
-
n.indexOf(l) >= 0 && (a = l,
|
|
3122
|
-
return [t,
|
|
3120
|
+
for (const [l, u] of r)
|
|
3121
|
+
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);
|
|
3122
|
+
return [t, s, o, a];
|
|
3123
3123
|
}
|
|
3124
|
-
function ki(t, e, n,
|
|
3125
|
-
let [
|
|
3126
|
-
const l = e -
|
|
3124
|
+
function ki(t, e, n, r) {
|
|
3125
|
+
let [s, i, a, o] = pi(t, e, n);
|
|
3126
|
+
const l = e - s, u = n.filter(
|
|
3127
3127
|
(m) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(m) >= 0
|
|
3128
3128
|
);
|
|
3129
|
-
u.length === 0 && (a < e && (a =
|
|
3130
|
-
const d = T.fromObject(i,
|
|
3131
|
-
return u.length > 0 ? T.fromMillis(l,
|
|
3129
|
+
u.length === 0 && (a < e && (a = s.plus({ [o]: 1 })), a !== s && (i[o] = (i[o] || 0) + l / (a - s)));
|
|
3130
|
+
const d = T.fromObject(i, r);
|
|
3131
|
+
return u.length > 0 ? T.fromMillis(l, r).shiftTo(...u).plus(d) : d;
|
|
3132
3132
|
}
|
|
3133
|
-
const
|
|
3133
|
+
const qt = {
|
|
3134
3134
|
arab: "[٠-٩]",
|
|
3135
3135
|
arabext: "[۰-۹]",
|
|
3136
3136
|
bali: "[᭐-᭙]",
|
|
@@ -3172,19 +3172,19 @@ const Rt = {
|
|
|
3172
3172
|
telu: [3174, 3183],
|
|
3173
3173
|
thai: [3664, 3673],
|
|
3174
3174
|
tibt: [3872, 3881]
|
|
3175
|
-
}, Si =
|
|
3175
|
+
}, Si = qt.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
3176
3176
|
function Oi(t) {
|
|
3177
3177
|
let e = parseInt(t, 10);
|
|
3178
3178
|
if (isNaN(e)) {
|
|
3179
3179
|
e = "";
|
|
3180
3180
|
for (let n = 0; n < t.length; n++) {
|
|
3181
|
-
const
|
|
3182
|
-
if (t[n].search(
|
|
3181
|
+
const r = t.charCodeAt(n);
|
|
3182
|
+
if (t[n].search(qt.hanidec) !== -1)
|
|
3183
3183
|
e += Si.indexOf(t[n]);
|
|
3184
3184
|
else
|
|
3185
|
-
for (const
|
|
3186
|
-
const [i, a] = dn[
|
|
3187
|
-
|
|
3185
|
+
for (const s in dn) {
|
|
3186
|
+
const [i, a] = dn[s];
|
|
3187
|
+
r >= i && r <= a && (e += r - i);
|
|
3188
3188
|
}
|
|
3189
3189
|
}
|
|
3190
3190
|
return parseInt(e, 10);
|
|
@@ -3192,27 +3192,27 @@ function Oi(t) {
|
|
|
3192
3192
|
return e;
|
|
3193
3193
|
}
|
|
3194
3194
|
function j({ numberingSystem: t }, e = "") {
|
|
3195
|
-
return new RegExp(`${
|
|
3195
|
+
return new RegExp(`${qt[t || "latn"]}${e}`);
|
|
3196
3196
|
}
|
|
3197
3197
|
const Ti = "missing Intl.DateTimeFormat.formatToParts support";
|
|
3198
3198
|
function M(t, e = (n) => n) {
|
|
3199
3199
|
return { regex: t, deser: ([n]) => e(Oi(n)) };
|
|
3200
3200
|
}
|
|
3201
|
-
const vi = String.fromCharCode(160),
|
|
3201
|
+
const vi = String.fromCharCode(160), fr = `[ ${vi}]`, hr = new RegExp(fr, "g");
|
|
3202
3202
|
function Mi(t) {
|
|
3203
|
-
return t.replace(/\./g, "\\.?").replace(
|
|
3203
|
+
return t.replace(/\./g, "\\.?").replace(hr, fr);
|
|
3204
3204
|
}
|
|
3205
3205
|
function fn(t) {
|
|
3206
|
-
return t.replace(/\./g, "").replace(
|
|
3206
|
+
return t.replace(/\./g, "").replace(hr, " ").toLowerCase();
|
|
3207
3207
|
}
|
|
3208
3208
|
function G(t, e) {
|
|
3209
3209
|
return t === null ? null : {
|
|
3210
3210
|
regex: RegExp(t.map(Mi).join("|")),
|
|
3211
|
-
deser: ([n]) => t.findIndex((
|
|
3211
|
+
deser: ([n]) => t.findIndex((r) => fn(n) === fn(r)) + e
|
|
3212
3212
|
};
|
|
3213
3213
|
}
|
|
3214
3214
|
function hn(t, e) {
|
|
3215
|
-
return { regex: t, deser: ([, n,
|
|
3215
|
+
return { regex: t, deser: ([, n, r]) => lt(n, r), groups: e };
|
|
3216
3216
|
}
|
|
3217
3217
|
function Pe(t) {
|
|
3218
3218
|
return { regex: t, deser: ([e]) => e };
|
|
@@ -3221,7 +3221,7 @@ function Di(t) {
|
|
|
3221
3221
|
return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
3222
3222
|
}
|
|
3223
3223
|
function Ni(t, e) {
|
|
3224
|
-
const n = j(e),
|
|
3224
|
+
const n = j(e), r = j(e, "{2}"), s = j(e, "{3}"), i = j(e, "{4}"), a = j(e, "{6}"), o = j(e, "{1,2}"), l = j(e, "{1,3}"), u = j(e, "{1,6}"), d = j(e, "{1,9}"), m = j(e, "{2,4}"), v = j(e, "{4,6}"), f = (p) => ({ regex: RegExp(Di(p.val)), deser: ([F]) => F, literal: !0 }), x = ((p) => {
|
|
3225
3225
|
if (t.literal)
|
|
3226
3226
|
return f(p);
|
|
3227
3227
|
switch (p.val) {
|
|
@@ -3242,7 +3242,7 @@ function Ni(t, e) {
|
|
|
3242
3242
|
case "M":
|
|
3243
3243
|
return M(o);
|
|
3244
3244
|
case "MM":
|
|
3245
|
-
return M(
|
|
3245
|
+
return M(r);
|
|
3246
3246
|
case "MMM":
|
|
3247
3247
|
return G(e.months("short", !0), 1);
|
|
3248
3248
|
case "MMMM":
|
|
@@ -3250,7 +3250,7 @@ function Ni(t, e) {
|
|
|
3250
3250
|
case "L":
|
|
3251
3251
|
return M(o);
|
|
3252
3252
|
case "LL":
|
|
3253
|
-
return M(
|
|
3253
|
+
return M(r);
|
|
3254
3254
|
case "LLL":
|
|
3255
3255
|
return G(e.months("short", !1), 1);
|
|
3256
3256
|
case "LLLL":
|
|
@@ -3258,35 +3258,35 @@ function Ni(t, e) {
|
|
|
3258
3258
|
case "d":
|
|
3259
3259
|
return M(o);
|
|
3260
3260
|
case "dd":
|
|
3261
|
-
return M(
|
|
3261
|
+
return M(r);
|
|
3262
3262
|
case "o":
|
|
3263
3263
|
return M(l);
|
|
3264
3264
|
case "ooo":
|
|
3265
|
-
return M(r);
|
|
3266
|
-
case "HH":
|
|
3267
3265
|
return M(s);
|
|
3266
|
+
case "HH":
|
|
3267
|
+
return M(r);
|
|
3268
3268
|
case "H":
|
|
3269
3269
|
return M(o);
|
|
3270
3270
|
case "hh":
|
|
3271
|
-
return M(
|
|
3271
|
+
return M(r);
|
|
3272
3272
|
case "h":
|
|
3273
3273
|
return M(o);
|
|
3274
3274
|
case "mm":
|
|
3275
|
-
return M(
|
|
3275
|
+
return M(r);
|
|
3276
3276
|
case "m":
|
|
3277
3277
|
return M(o);
|
|
3278
3278
|
case "q":
|
|
3279
3279
|
return M(o);
|
|
3280
3280
|
case "qq":
|
|
3281
|
-
return M(
|
|
3281
|
+
return M(r);
|
|
3282
3282
|
case "s":
|
|
3283
3283
|
return M(o);
|
|
3284
3284
|
case "ss":
|
|
3285
|
-
return M(
|
|
3285
|
+
return M(r);
|
|
3286
3286
|
case "S":
|
|
3287
3287
|
return M(l);
|
|
3288
3288
|
case "SSS":
|
|
3289
|
-
return M(
|
|
3289
|
+
return M(s);
|
|
3290
3290
|
case "u":
|
|
3291
3291
|
return Pe(d);
|
|
3292
3292
|
case "uu":
|
|
@@ -3302,7 +3302,7 @@ function Ni(t, e) {
|
|
|
3302
3302
|
case "W":
|
|
3303
3303
|
return M(o);
|
|
3304
3304
|
case "WW":
|
|
3305
|
-
return M(
|
|
3305
|
+
return M(r);
|
|
3306
3306
|
case "E":
|
|
3307
3307
|
case "c":
|
|
3308
3308
|
return M(n);
|
|
@@ -3316,9 +3316,9 @@ function Ni(t, e) {
|
|
|
3316
3316
|
return G(e.weekdays("long", !0), 1);
|
|
3317
3317
|
case "Z":
|
|
3318
3318
|
case "ZZ":
|
|
3319
|
-
return hn(new RegExp(`([+-]${o.source})(?::(${
|
|
3319
|
+
return hn(new RegExp(`([+-]${o.source})(?::(${r.source}))?`), 2);
|
|
3320
3320
|
case "ZZZ":
|
|
3321
|
-
return hn(new RegExp(`([+-]${o.source})(${
|
|
3321
|
+
return hn(new RegExp(`([+-]${o.source})(${r.source})?`), 2);
|
|
3322
3322
|
case "z":
|
|
3323
3323
|
return Pe(/[a-z_+-/]{1,256}?/i);
|
|
3324
3324
|
case " ":
|
|
@@ -3329,9 +3329,9 @@ function Ni(t, e) {
|
|
|
3329
3329
|
})(t) || {
|
|
3330
3330
|
invalidReason: Ti
|
|
3331
3331
|
};
|
|
3332
|
-
return
|
|
3332
|
+
return x.token = t, x;
|
|
3333
3333
|
}
|
|
3334
|
-
const
|
|
3334
|
+
const Ii = {
|
|
3335
3335
|
year: {
|
|
3336
3336
|
"2-digit": "yy",
|
|
3337
3337
|
numeric: "yyyyy"
|
|
@@ -3373,41 +3373,41 @@ const xi = {
|
|
|
3373
3373
|
short: "ZZZ"
|
|
3374
3374
|
}
|
|
3375
3375
|
};
|
|
3376
|
-
function
|
|
3377
|
-
const { type:
|
|
3378
|
-
if (
|
|
3379
|
-
const l = /^\s+$/.test(
|
|
3376
|
+
function Ei(t, e, n) {
|
|
3377
|
+
const { type: r, value: s } = t;
|
|
3378
|
+
if (r === "literal") {
|
|
3379
|
+
const l = /^\s+$/.test(s);
|
|
3380
3380
|
return {
|
|
3381
3381
|
literal: !l,
|
|
3382
|
-
val: l ? " " :
|
|
3382
|
+
val: l ? " " : s
|
|
3383
3383
|
};
|
|
3384
3384
|
}
|
|
3385
|
-
const i = e[
|
|
3386
|
-
let a =
|
|
3387
|
-
|
|
3388
|
-
let o =
|
|
3385
|
+
const i = e[r];
|
|
3386
|
+
let a = r;
|
|
3387
|
+
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");
|
|
3388
|
+
let o = Ii[a];
|
|
3389
3389
|
if (typeof o == "object" && (o = o[i]), o)
|
|
3390
3390
|
return {
|
|
3391
3391
|
literal: !1,
|
|
3392
3392
|
val: o
|
|
3393
3393
|
};
|
|
3394
3394
|
}
|
|
3395
|
-
function
|
|
3396
|
-
return [`^${t.map((n) => n.regex).reduce((n,
|
|
3395
|
+
function xi(t) {
|
|
3396
|
+
return [`^${t.map((n) => n.regex).reduce((n, r) => `${n}(${r.source})`, "")}$`, t];
|
|
3397
3397
|
}
|
|
3398
3398
|
function bi(t, e, n) {
|
|
3399
|
-
const
|
|
3400
|
-
if (
|
|
3401
|
-
const
|
|
3399
|
+
const r = t.match(e);
|
|
3400
|
+
if (r) {
|
|
3401
|
+
const s = {};
|
|
3402
3402
|
let i = 1;
|
|
3403
3403
|
for (const a in n)
|
|
3404
3404
|
if (ke(n, a)) {
|
|
3405
3405
|
const o = n[a], l = o.groups ? o.groups + 1 : 1;
|
|
3406
|
-
!o.literal && o.token && (
|
|
3406
|
+
!o.literal && o.token && (s[o.token.val[0]] = o.deser(r.slice(i, i + l))), i += l;
|
|
3407
3407
|
}
|
|
3408
|
-
return [
|
|
3408
|
+
return [r, s];
|
|
3409
3409
|
} else
|
|
3410
|
-
return [
|
|
3410
|
+
return [r, {}];
|
|
3411
3411
|
}
|
|
3412
3412
|
function Fi(t) {
|
|
3413
3413
|
const e = (i) => {
|
|
@@ -3443,11 +3443,11 @@ function Fi(t) {
|
|
|
3443
3443
|
return null;
|
|
3444
3444
|
}
|
|
3445
3445
|
};
|
|
3446
|
-
let n = null,
|
|
3447
|
-
return w(t.z) || (n = X.create(t.z)), w(t.Z) || (n || (n = new W(t.Z)),
|
|
3446
|
+
let n = null, r;
|
|
3447
|
+
return w(t.z) || (n = X.create(t.z)), w(t.Z) || (n || (n = new W(t.Z)), r = t.Z), w(t.q) || (t.M = (t.q - 1) * 3 + 1), w(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), w(t.u) || (t.S = $t(t.u)), [Object.keys(t).reduce((i, a) => {
|
|
3448
3448
|
const o = e(a);
|
|
3449
3449
|
return o && (i[o] = t[a]), i;
|
|
3450
|
-
}, {}), n,
|
|
3450
|
+
}, {}), n, r];
|
|
3451
3451
|
}
|
|
3452
3452
|
let gt = null;
|
|
3453
3453
|
function Ci() {
|
|
@@ -3456,34 +3456,34 @@ function Ci() {
|
|
|
3456
3456
|
function Vi(t, e) {
|
|
3457
3457
|
if (t.literal)
|
|
3458
3458
|
return t;
|
|
3459
|
-
const n = C.macroTokenToFormatOpts(t.val),
|
|
3460
|
-
return
|
|
3459
|
+
const n = C.macroTokenToFormatOpts(t.val), r = gr(n, e);
|
|
3460
|
+
return r == null || r.includes(void 0) ? t : r;
|
|
3461
3461
|
}
|
|
3462
|
-
function
|
|
3462
|
+
function mr(t, e) {
|
|
3463
3463
|
return Array.prototype.concat(...t.map((n) => Vi(n, e)));
|
|
3464
3464
|
}
|
|
3465
|
-
function
|
|
3466
|
-
const
|
|
3465
|
+
function yr(t, e, n) {
|
|
3466
|
+
const r = mr(C.parseFormat(n), t), s = r.map((a) => Ni(a, t)), i = s.find((a) => a.invalidReason);
|
|
3467
3467
|
if (i)
|
|
3468
|
-
return { input: e, tokens:
|
|
3468
|
+
return { input: e, tokens: r, invalidReason: i.invalidReason };
|
|
3469
3469
|
{
|
|
3470
|
-
const [a, o] =
|
|
3470
|
+
const [a, o] = xi(s), l = RegExp(a, "i"), [u, d] = bi(e, l, o), [m, v, f] = d ? Fi(d) : [null, null, void 0];
|
|
3471
3471
|
if (ke(d, "a") && ke(d, "H"))
|
|
3472
3472
|
throw new ge(
|
|
3473
3473
|
"Can't include meridiem when specifying 24-hour format"
|
|
3474
3474
|
);
|
|
3475
|
-
return { input: e, tokens:
|
|
3475
|
+
return { input: e, tokens: r, regex: l, rawMatches: u, matches: d, result: m, zone: v, specificOffset: f };
|
|
3476
3476
|
}
|
|
3477
3477
|
}
|
|
3478
3478
|
function Wi(t, e, n) {
|
|
3479
|
-
const { result:
|
|
3480
|
-
return [
|
|
3479
|
+
const { result: r, zone: s, specificOffset: i, invalidReason: a } = yr(t, e, n);
|
|
3480
|
+
return [r, s, i, a];
|
|
3481
3481
|
}
|
|
3482
|
-
function
|
|
3482
|
+
function gr(t, e) {
|
|
3483
3483
|
if (!t)
|
|
3484
3484
|
return null;
|
|
3485
|
-
const
|
|
3486
|
-
return
|
|
3485
|
+
const r = C.create(e, t).dtFormatter(Ci()), s = r.formatToParts(), i = r.resolvedOptions();
|
|
3486
|
+
return s.map((a) => Ei(a, t, i));
|
|
3487
3487
|
}
|
|
3488
3488
|
const wt = "Invalid DateTime", mn = 864e13;
|
|
3489
3489
|
function je(t) {
|
|
@@ -3510,14 +3510,14 @@ function le(t, e) {
|
|
|
3510
3510
|
};
|
|
3511
3511
|
return new y({ ...n, ...e, old: n });
|
|
3512
3512
|
}
|
|
3513
|
-
function
|
|
3514
|
-
let
|
|
3515
|
-
const
|
|
3516
|
-
if (e ===
|
|
3517
|
-
return [
|
|
3518
|
-
|
|
3519
|
-
const i = n.offset(
|
|
3520
|
-
return
|
|
3513
|
+
function wr(t, e, n) {
|
|
3514
|
+
let r = t - e * 60 * 1e3;
|
|
3515
|
+
const s = n.offset(r);
|
|
3516
|
+
if (e === s)
|
|
3517
|
+
return [r, e];
|
|
3518
|
+
r -= (s - e) * 60 * 1e3;
|
|
3519
|
+
const i = n.offset(r);
|
|
3520
|
+
return s === i ? [r, s] : [t - Math.min(s, i) * 60 * 1e3, Math.max(s, i)];
|
|
3521
3521
|
}
|
|
3522
3522
|
function Ge(t, e) {
|
|
3523
3523
|
t += e * 60 * 1e3;
|
|
@@ -3533,14 +3533,14 @@ function Ge(t, e) {
|
|
|
3533
3533
|
};
|
|
3534
3534
|
}
|
|
3535
3535
|
function Ke(t, e, n) {
|
|
3536
|
-
return
|
|
3536
|
+
return wr(ot(t), e, n);
|
|
3537
3537
|
}
|
|
3538
3538
|
function yn(t, e) {
|
|
3539
|
-
const n = t.o,
|
|
3539
|
+
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 = {
|
|
3540
3540
|
...t.c,
|
|
3541
|
-
year:
|
|
3542
|
-
month:
|
|
3543
|
-
day: Math.min(t.c.day,
|
|
3541
|
+
year: r,
|
|
3542
|
+
month: s,
|
|
3543
|
+
day: Math.min(t.c.day, rt(r, s)) + Math.trunc(e.days) + Math.trunc(e.weeks) * 7
|
|
3544
3544
|
}, a = T.fromObject({
|
|
3545
3545
|
years: e.years - Math.trunc(e.years),
|
|
3546
3546
|
quarters: e.quarters - Math.trunc(e.quarters),
|
|
@@ -3552,10 +3552,10 @@ function yn(t, e) {
|
|
|
3552
3552
|
seconds: e.seconds,
|
|
3553
3553
|
milliseconds: e.milliseconds
|
|
3554
3554
|
}).as("milliseconds"), o = ot(i);
|
|
3555
|
-
let [l, u] =
|
|
3555
|
+
let [l, u] = wr(o, n, t.zone);
|
|
3556
3556
|
return a !== 0 && (l += a, u = t.zone.offset(l)), { ts: l, o: u };
|
|
3557
3557
|
}
|
|
3558
|
-
function
|
|
3558
|
+
function Ee(t, e, n, r, s, i) {
|
|
3559
3559
|
const { setZone: a, zone: o } = n;
|
|
3560
3560
|
if (t && Object.keys(t).length !== 0 || e) {
|
|
3561
3561
|
const l = e || o, u = y.fromObject(t, {
|
|
@@ -3566,7 +3566,7 @@ function Ie(t, e, n, s, r, i) {
|
|
|
3566
3566
|
return a ? u : u.setZone(o);
|
|
3567
3567
|
} else
|
|
3568
3568
|
return y.invalid(
|
|
3569
|
-
new J("unparsable", `the input "${
|
|
3569
|
+
new J("unparsable", `the input "${s}" can't be parsed as ${r}`)
|
|
3570
3570
|
);
|
|
3571
3571
|
}
|
|
3572
3572
|
function Je(t, e, n = !0) {
|
|
@@ -3577,14 +3577,14 @@ function Je(t, e, n = !0) {
|
|
|
3577
3577
|
}
|
|
3578
3578
|
function St(t, e) {
|
|
3579
3579
|
const n = t.c.year > 9999 || t.c.year < 0;
|
|
3580
|
-
let
|
|
3581
|
-
return n && t.c.year >= 0 && (
|
|
3580
|
+
let r = "";
|
|
3581
|
+
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;
|
|
3582
3582
|
}
|
|
3583
|
-
function gn(t, e, n,
|
|
3583
|
+
function gn(t, e, n, r, s, i) {
|
|
3584
3584
|
let a = b(t.c.hour);
|
|
3585
|
-
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 || !
|
|
3585
|
+
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;
|
|
3586
3586
|
}
|
|
3587
|
-
const
|
|
3587
|
+
const pr = {
|
|
3588
3588
|
month: 1,
|
|
3589
3589
|
day: 1,
|
|
3590
3590
|
hour: 0,
|
|
@@ -3604,7 +3604,7 @@ const ps = {
|
|
|
3604
3604
|
minute: 0,
|
|
3605
3605
|
second: 0,
|
|
3606
3606
|
millisecond: 0
|
|
3607
|
-
},
|
|
3607
|
+
}, kr = ["year", "month", "day", "hour", "minute", "second", "millisecond"], Zi = [
|
|
3608
3608
|
"weekYear",
|
|
3609
3609
|
"weekNumber",
|
|
3610
3610
|
"weekday",
|
|
@@ -3612,8 +3612,8 @@ const ps = {
|
|
|
3612
3612
|
"minute",
|
|
3613
3613
|
"second",
|
|
3614
3614
|
"millisecond"
|
|
3615
|
-
],
|
|
3616
|
-
function
|
|
3615
|
+
], zi = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
|
|
3616
|
+
function Ai(t) {
|
|
3617
3617
|
const e = {
|
|
3618
3618
|
year: "year",
|
|
3619
3619
|
years: "year",
|
|
@@ -3656,35 +3656,35 @@ function wn(t) {
|
|
|
3656
3656
|
case "localweekyears":
|
|
3657
3657
|
return "localWeekYear";
|
|
3658
3658
|
default:
|
|
3659
|
-
return
|
|
3659
|
+
return Ai(t);
|
|
3660
3660
|
}
|
|
3661
3661
|
}
|
|
3662
3662
|
function pn(t, e) {
|
|
3663
|
-
const n = ie(e.zone,
|
|
3663
|
+
const n = ie(e.zone, E.defaultZone), r = D.fromObject(e), s = E.now();
|
|
3664
3664
|
let i, a;
|
|
3665
3665
|
if (w(t.year))
|
|
3666
|
-
i =
|
|
3666
|
+
i = s;
|
|
3667
3667
|
else {
|
|
3668
|
-
for (const u of
|
|
3669
|
-
w(t[u]) && (t[u] =
|
|
3668
|
+
for (const u of kr)
|
|
3669
|
+
w(t[u]) && (t[u] = pr[u]);
|
|
3670
3670
|
const o = Yn(t) || Pn(t);
|
|
3671
3671
|
if (o)
|
|
3672
3672
|
return y.invalid(o);
|
|
3673
|
-
const l = n.offset(
|
|
3673
|
+
const l = n.offset(s);
|
|
3674
3674
|
[i, a] = Ke(t, l, n);
|
|
3675
3675
|
}
|
|
3676
|
-
return new y({ ts: i, zone: n, loc:
|
|
3676
|
+
return new y({ ts: i, zone: n, loc: r, o: a });
|
|
3677
3677
|
}
|
|
3678
3678
|
function kn(t, e, n) {
|
|
3679
|
-
const
|
|
3679
|
+
const r = w(n.round) ? !0 : n.round, s = (a, o) => (a = Zt(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);
|
|
3680
3680
|
if (n.unit)
|
|
3681
|
-
return
|
|
3681
|
+
return s(i(n.unit), n.unit);
|
|
3682
3682
|
for (const a of n.units) {
|
|
3683
3683
|
const o = i(a);
|
|
3684
3684
|
if (Math.abs(o) >= 1)
|
|
3685
|
-
return
|
|
3685
|
+
return s(o, a);
|
|
3686
3686
|
}
|
|
3687
|
-
return
|
|
3687
|
+
return s(t > e ? -0 : 0, n.units[n.units.length - 1]);
|
|
3688
3688
|
}
|
|
3689
3689
|
function Sn(t) {
|
|
3690
3690
|
let e = {}, n;
|
|
@@ -3695,18 +3695,18 @@ class y {
|
|
|
3695
3695
|
* @access private
|
|
3696
3696
|
*/
|
|
3697
3697
|
constructor(e) {
|
|
3698
|
-
const n = e.zone ||
|
|
3699
|
-
let
|
|
3700
|
-
this.ts = w(e.ts) ?
|
|
3701
|
-
let
|
|
3702
|
-
if (!
|
|
3698
|
+
const n = e.zone || E.defaultZone;
|
|
3699
|
+
let r = e.invalid || (Number.isNaN(e.ts) ? new J("invalid input") : null) || (n.isValid ? null : je(n));
|
|
3700
|
+
this.ts = w(e.ts) ? E.now() : e.ts;
|
|
3701
|
+
let s = null, i = null;
|
|
3702
|
+
if (!r)
|
|
3703
3703
|
if (e.old && e.old.ts === this.ts && e.old.zone.equals(n))
|
|
3704
|
-
[
|
|
3704
|
+
[s, i] = [e.old.c, e.old.o];
|
|
3705
3705
|
else {
|
|
3706
3706
|
const o = n.offset(this.ts);
|
|
3707
|
-
|
|
3707
|
+
s = Ge(this.ts, o), r = Number.isNaN(s.year) ? new J("invalid input") : null, s = r ? null : s, i = r ? null : o;
|
|
3708
3708
|
}
|
|
3709
|
-
this._zone = n, this.loc = e.loc || D.create(), this.invalid =
|
|
3709
|
+
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;
|
|
3710
3710
|
}
|
|
3711
3711
|
// CONSTRUCT
|
|
3712
3712
|
/**
|
|
@@ -3741,8 +3741,8 @@ class y {
|
|
|
3741
3741
|
* @return {DateTime}
|
|
3742
3742
|
*/
|
|
3743
3743
|
static local() {
|
|
3744
|
-
const [e, n] = Sn(arguments), [
|
|
3745
|
-
return pn({ year:
|
|
3744
|
+
const [e, n] = Sn(arguments), [r, s, i, a, o, l, u] = n;
|
|
3745
|
+
return pn({ year: r, month: s, day: i, hour: a, minute: o, second: l, millisecond: u }, e);
|
|
3746
3746
|
}
|
|
3747
3747
|
/**
|
|
3748
3748
|
* Create a DateTime in UTC
|
|
@@ -3769,8 +3769,8 @@ class y {
|
|
|
3769
3769
|
* @return {DateTime}
|
|
3770
3770
|
*/
|
|
3771
3771
|
static utc() {
|
|
3772
|
-
const [e, n] = Sn(arguments), [
|
|
3773
|
-
return e.zone = W.utcInstance, pn({ year:
|
|
3772
|
+
const [e, n] = Sn(arguments), [r, s, i, a, o, l, u] = n;
|
|
3773
|
+
return e.zone = W.utcInstance, pn({ year: r, month: s, day: i, hour: a, minute: o, second: l, millisecond: u }, e);
|
|
3774
3774
|
}
|
|
3775
3775
|
/**
|
|
3776
3776
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -3780,15 +3780,15 @@ class y {
|
|
|
3780
3780
|
* @return {DateTime}
|
|
3781
3781
|
*/
|
|
3782
3782
|
static fromJSDate(e, n = {}) {
|
|
3783
|
-
const
|
|
3784
|
-
if (Number.isNaN(
|
|
3783
|
+
const r = ms(e) ? e.valueOf() : NaN;
|
|
3784
|
+
if (Number.isNaN(r))
|
|
3785
3785
|
return y.invalid("invalid input");
|
|
3786
|
-
const
|
|
3787
|
-
return
|
|
3788
|
-
ts:
|
|
3789
|
-
zone:
|
|
3786
|
+
const s = ie(n.zone, E.defaultZone);
|
|
3787
|
+
return s.isValid ? new y({
|
|
3788
|
+
ts: r,
|
|
3789
|
+
zone: s,
|
|
3790
3790
|
loc: D.fromObject(n)
|
|
3791
|
-
}) : y.invalid(je(
|
|
3791
|
+
}) : y.invalid(je(s));
|
|
3792
3792
|
}
|
|
3793
3793
|
/**
|
|
3794
3794
|
* Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
|
|
@@ -3804,7 +3804,7 @@ class y {
|
|
|
3804
3804
|
if (ce(e))
|
|
3805
3805
|
return e < -mn || e > mn ? y.invalid("Timestamp out of range") : new y({
|
|
3806
3806
|
ts: e,
|
|
3807
|
-
zone: ie(n.zone,
|
|
3807
|
+
zone: ie(n.zone, E.defaultZone),
|
|
3808
3808
|
loc: D.fromObject(n)
|
|
3809
3809
|
});
|
|
3810
3810
|
throw new $(
|
|
@@ -3825,7 +3825,7 @@ class y {
|
|
|
3825
3825
|
if (ce(e))
|
|
3826
3826
|
return new y({
|
|
3827
3827
|
ts: e * 1e3,
|
|
3828
|
-
zone: ie(n.zone,
|
|
3828
|
+
zone: ie(n.zone, E.defaultZone),
|
|
3829
3829
|
loc: D.fromObject(n)
|
|
3830
3830
|
});
|
|
3831
3831
|
throw new $("fromSeconds requires a numerical input");
|
|
@@ -3864,32 +3864,32 @@ class y {
|
|
|
3864
3864
|
*/
|
|
3865
3865
|
static fromObject(e, n = {}) {
|
|
3866
3866
|
e = e || {};
|
|
3867
|
-
const
|
|
3868
|
-
if (!
|
|
3869
|
-
return y.invalid(je(
|
|
3870
|
-
const
|
|
3867
|
+
const r = ie(n.zone, E.defaultZone);
|
|
3868
|
+
if (!r.isValid)
|
|
3869
|
+
return y.invalid(je(r));
|
|
3870
|
+
const s = D.fromObject(n), i = st(e, wn), { minDaysInFirstWeek: a, startOfWeek: o } = nn(i, s), l = E.now(), u = w(n.specificOffset) ? r.offset(l) : n.specificOffset, d = !w(i.ordinal), m = !w(i.year), v = !w(i.month) || !w(i.day), f = m || v, g = i.weekYear || i.weekNumber;
|
|
3871
3871
|
if ((f || d) && g)
|
|
3872
3872
|
throw new ge(
|
|
3873
3873
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
3874
3874
|
);
|
|
3875
3875
|
if (v && d)
|
|
3876
3876
|
throw new ge("Can't mix ordinal dates with month/day");
|
|
3877
|
-
const
|
|
3877
|
+
const x = g || i.weekday && !f;
|
|
3878
3878
|
let p, F, _ = Ge(l, u);
|
|
3879
|
-
|
|
3879
|
+
x ? (p = Zi, F = Li, _ = nt(_, a, o)) : d ? (p = zi, F = $i, _ = yt(_)) : (p = kr, F = pr);
|
|
3880
3880
|
let L = !1;
|
|
3881
3881
|
for (const P of p) {
|
|
3882
3882
|
const fe = i[P];
|
|
3883
3883
|
w(fe) ? L ? i[P] = F[P] : i[P] = _[P] : L = !0;
|
|
3884
3884
|
}
|
|
3885
|
-
const K =
|
|
3885
|
+
const K = x ? ds(i, a, o) : d ? fs(i) : Yn(i), ae = K || Pn(i);
|
|
3886
3886
|
if (ae)
|
|
3887
3887
|
return y.invalid(ae);
|
|
3888
|
-
const
|
|
3888
|
+
const H = x ? en(i, a, o) : d ? tn(i) : i, [Q, Z] = Ke(H, u, r), Y = new y({
|
|
3889
3889
|
ts: Q,
|
|
3890
|
-
zone:
|
|
3890
|
+
zone: r,
|
|
3891
3891
|
o: Z,
|
|
3892
|
-
loc:
|
|
3892
|
+
loc: s
|
|
3893
3893
|
});
|
|
3894
3894
|
return i.weekday && f && e.weekday !== Y.weekday ? y.invalid(
|
|
3895
3895
|
"mismatched weekday",
|
|
@@ -3913,8 +3913,8 @@ class y {
|
|
|
3913
3913
|
* @return {DateTime}
|
|
3914
3914
|
*/
|
|
3915
3915
|
static fromISO(e, n = {}) {
|
|
3916
|
-
const [
|
|
3917
|
-
return
|
|
3916
|
+
const [r, s] = ri(e);
|
|
3917
|
+
return Ee(r, s, n, "ISO 8601", e);
|
|
3918
3918
|
}
|
|
3919
3919
|
/**
|
|
3920
3920
|
* Create a DateTime from an RFC 2822 string
|
|
@@ -3931,8 +3931,8 @@ class y {
|
|
|
3931
3931
|
* @return {DateTime}
|
|
3932
3932
|
*/
|
|
3933
3933
|
static fromRFC2822(e, n = {}) {
|
|
3934
|
-
const [
|
|
3935
|
-
return
|
|
3934
|
+
const [r, s] = si(e);
|
|
3935
|
+
return Ee(r, s, n, "RFC 2822", e);
|
|
3936
3936
|
}
|
|
3937
3937
|
/**
|
|
3938
3938
|
* Create a DateTime from an HTTP header date
|
|
@@ -3950,8 +3950,8 @@ class y {
|
|
|
3950
3950
|
* @return {DateTime}
|
|
3951
3951
|
*/
|
|
3952
3952
|
static fromHTTP(e, n = {}) {
|
|
3953
|
-
const [
|
|
3954
|
-
return
|
|
3953
|
+
const [r, s] = ii(e);
|
|
3954
|
+
return Ee(r, s, n, "HTTP", n);
|
|
3955
3955
|
}
|
|
3956
3956
|
/**
|
|
3957
3957
|
* Create a DateTime from an input string and format string.
|
|
@@ -3966,21 +3966,21 @@ class y {
|
|
|
3966
3966
|
* @param {string} opts.outputCalendar - the output calendar to set on the resulting DateTime instance
|
|
3967
3967
|
* @return {DateTime}
|
|
3968
3968
|
*/
|
|
3969
|
-
static fromFormat(e, n,
|
|
3969
|
+
static fromFormat(e, n, r = {}) {
|
|
3970
3970
|
if (w(e) || w(n))
|
|
3971
3971
|
throw new $("fromFormat requires an input string and a format");
|
|
3972
|
-
const { locale:
|
|
3973
|
-
locale:
|
|
3972
|
+
const { locale: s = null, numberingSystem: i = null } = r, a = D.fromOpts({
|
|
3973
|
+
locale: s,
|
|
3974
3974
|
numberingSystem: i,
|
|
3975
3975
|
defaultToEN: !0
|
|
3976
3976
|
}), [o, l, u, d] = Wi(a, e, n);
|
|
3977
|
-
return d ? y.invalid(d) :
|
|
3977
|
+
return d ? y.invalid(d) : Ee(o, l, r, `format ${n}`, e, u);
|
|
3978
3978
|
}
|
|
3979
3979
|
/**
|
|
3980
3980
|
* @deprecated use fromFormat instead
|
|
3981
3981
|
*/
|
|
3982
|
-
static fromString(e, n,
|
|
3983
|
-
return y.fromFormat(e, n,
|
|
3982
|
+
static fromString(e, n, r = {}) {
|
|
3983
|
+
return y.fromFormat(e, n, r);
|
|
3984
3984
|
}
|
|
3985
3985
|
/**
|
|
3986
3986
|
* Create a DateTime from a SQL date, time, or datetime
|
|
@@ -4003,8 +4003,8 @@ class y {
|
|
|
4003
4003
|
* @return {DateTime}
|
|
4004
4004
|
*/
|
|
4005
4005
|
static fromSQL(e, n = {}) {
|
|
4006
|
-
const [
|
|
4007
|
-
return
|
|
4006
|
+
const [r, s] = fi(e);
|
|
4007
|
+
return Ee(r, s, n, "SQL", e);
|
|
4008
4008
|
}
|
|
4009
4009
|
/**
|
|
4010
4010
|
* Create an invalid DateTime.
|
|
@@ -4015,10 +4015,10 @@ class y {
|
|
|
4015
4015
|
static invalid(e, n = null) {
|
|
4016
4016
|
if (!e)
|
|
4017
4017
|
throw new $("need to specify a reason the DateTime is invalid");
|
|
4018
|
-
const
|
|
4019
|
-
if (
|
|
4020
|
-
throw new
|
|
4021
|
-
return new y({ invalid:
|
|
4018
|
+
const r = e instanceof J ? e : new J(e, n);
|
|
4019
|
+
if (E.throwOnInvalid)
|
|
4020
|
+
throw new qr(r);
|
|
4021
|
+
return new y({ invalid: r });
|
|
4022
4022
|
}
|
|
4023
4023
|
/**
|
|
4024
4024
|
* Check if an object is an instance of DateTime. Works across context boundaries
|
|
@@ -4035,8 +4035,8 @@ class y {
|
|
|
4035
4035
|
* @returns {string}
|
|
4036
4036
|
*/
|
|
4037
4037
|
static parseFormatForOpts(e, n = {}) {
|
|
4038
|
-
const
|
|
4039
|
-
return
|
|
4038
|
+
const r = gr(e, D.fromObject(n));
|
|
4039
|
+
return r ? r.map((s) => s ? s.val : null).join("") : null;
|
|
4040
4040
|
}
|
|
4041
4041
|
/**
|
|
4042
4042
|
* Produce the the fully expanded format token for the locale
|
|
@@ -4046,7 +4046,7 @@ class y {
|
|
|
4046
4046
|
* @returns {string}
|
|
4047
4047
|
*/
|
|
4048
4048
|
static expandFormat(e, n = {}) {
|
|
4049
|
-
return
|
|
4049
|
+
return mr(C.parseFormat(e), D.fromObject(n)).map((s) => s.val).join("");
|
|
4050
4050
|
}
|
|
4051
4051
|
// INFO
|
|
4052
4052
|
/**
|
|
@@ -4344,10 +4344,10 @@ class y {
|
|
|
4344
4344
|
getPossibleOffsets() {
|
|
4345
4345
|
if (!this.isValid || this.isOffsetFixed)
|
|
4346
4346
|
return [this];
|
|
4347
|
-
const e = 864e5, n = 6e4,
|
|
4347
|
+
const e = 864e5, n = 6e4, r = ot(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);
|
|
4348
4348
|
if (a === o)
|
|
4349
4349
|
return [this];
|
|
4350
|
-
const l =
|
|
4350
|
+
const l = r - a * n, u = r - o * n, d = Ge(l, a), m = Ge(u, o);
|
|
4351
4351
|
return d.hour === m.hour && d.minute === m.minute && d.second === m.second && d.millisecond === m.millisecond ? [le(this, { ts: l }), le(this, { ts: u })] : [this];
|
|
4352
4352
|
}
|
|
4353
4353
|
/**
|
|
@@ -4357,7 +4357,7 @@ class y {
|
|
|
4357
4357
|
* @type {boolean}
|
|
4358
4358
|
*/
|
|
4359
4359
|
get isInLeapYear() {
|
|
4360
|
-
return
|
|
4360
|
+
return Ae(this.year);
|
|
4361
4361
|
}
|
|
4362
4362
|
/**
|
|
4363
4363
|
* Returns the number of days in this DateTime's month
|
|
@@ -4366,7 +4366,7 @@ class y {
|
|
|
4366
4366
|
* @type {number}
|
|
4367
4367
|
*/
|
|
4368
4368
|
get daysInMonth() {
|
|
4369
|
-
return
|
|
4369
|
+
return rt(this.year, this.month);
|
|
4370
4370
|
}
|
|
4371
4371
|
/**
|
|
4372
4372
|
* Returns the number of days in this DateTime's year
|
|
@@ -4407,11 +4407,11 @@ class y {
|
|
|
4407
4407
|
* @return {Object}
|
|
4408
4408
|
*/
|
|
4409
4409
|
resolvedLocaleOptions(e = {}) {
|
|
4410
|
-
const { locale: n, numberingSystem:
|
|
4410
|
+
const { locale: n, numberingSystem: r, calendar: s } = C.create(
|
|
4411
4411
|
this.loc.clone(e),
|
|
4412
4412
|
e
|
|
4413
4413
|
).resolvedOptions(this);
|
|
4414
|
-
return { locale: n, numberingSystem:
|
|
4414
|
+
return { locale: n, numberingSystem: r, outputCalendar: s };
|
|
4415
4415
|
}
|
|
4416
4416
|
// TRANSFORM
|
|
4417
4417
|
/**
|
|
@@ -4432,7 +4432,7 @@ class y {
|
|
|
4432
4432
|
* @return {DateTime}
|
|
4433
4433
|
*/
|
|
4434
4434
|
toLocal() {
|
|
4435
|
-
return this.setZone(
|
|
4435
|
+
return this.setZone(E.defaultZone);
|
|
4436
4436
|
}
|
|
4437
4437
|
/**
|
|
4438
4438
|
* "Set" the DateTime's zone to specified zone. Returns a newly-constructed DateTime.
|
|
@@ -4443,16 +4443,16 @@ class y {
|
|
|
4443
4443
|
* @param {boolean} [opts.keepLocalTime=false] - If true, adjust the underlying time so that the local time stays the same, but in the target zone. You should rarely need this.
|
|
4444
4444
|
* @return {DateTime}
|
|
4445
4445
|
*/
|
|
4446
|
-
setZone(e, { keepLocalTime: n = !1, keepCalendarTime:
|
|
4447
|
-
if (e = ie(e,
|
|
4446
|
+
setZone(e, { keepLocalTime: n = !1, keepCalendarTime: r = !1 } = {}) {
|
|
4447
|
+
if (e = ie(e, E.defaultZone), e.equals(this.zone))
|
|
4448
4448
|
return this;
|
|
4449
4449
|
if (e.isValid) {
|
|
4450
|
-
let
|
|
4451
|
-
if (n ||
|
|
4450
|
+
let s = this.ts;
|
|
4451
|
+
if (n || r) {
|
|
4452
4452
|
const i = e.offset(this.ts), a = this.toObject();
|
|
4453
|
-
[
|
|
4453
|
+
[s] = Ke(a, i, e);
|
|
4454
4454
|
}
|
|
4455
|
-
return le(this, { ts:
|
|
4455
|
+
return le(this, { ts: s, zone: e });
|
|
4456
4456
|
} else
|
|
4457
4457
|
return y.invalid(je(e));
|
|
4458
4458
|
}
|
|
@@ -4462,9 +4462,9 @@ class y {
|
|
|
4462
4462
|
* @example DateTime.local(2017, 5, 25).reconfigure({ locale: 'en-GB' })
|
|
4463
4463
|
* @return {DateTime}
|
|
4464
4464
|
*/
|
|
4465
|
-
reconfigure({ locale: e, numberingSystem: n, outputCalendar:
|
|
4466
|
-
const
|
|
4467
|
-
return le(this, { loc:
|
|
4465
|
+
reconfigure({ locale: e, numberingSystem: n, outputCalendar: r } = {}) {
|
|
4466
|
+
const s = this.loc.clone({ locale: e, numberingSystem: n, outputCalendar: r });
|
|
4467
|
+
return le(this, { loc: s });
|
|
4468
4468
|
}
|
|
4469
4469
|
/**
|
|
4470
4470
|
* "Set" the locale. Returns a newly-constructed DateTime.
|
|
@@ -4491,7 +4491,7 @@ class y {
|
|
|
4491
4491
|
set(e) {
|
|
4492
4492
|
if (!this.isValid)
|
|
4493
4493
|
return this;
|
|
4494
|
-
const n =
|
|
4494
|
+
const n = st(e, wn), { minDaysInFirstWeek: r, startOfWeek: s } = nn(n, this.loc), i = !w(n.weekYear) || !w(n.weekNumber) || !w(n.weekday), a = !w(n.ordinal), o = !w(n.year), l = !w(n.month) || !w(n.day), u = o || l, d = n.weekYear || n.weekNumber;
|
|
4495
4495
|
if ((u || a) && d)
|
|
4496
4496
|
throw new ge(
|
|
4497
4497
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
@@ -4500,10 +4500,10 @@ class y {
|
|
|
4500
4500
|
throw new ge("Can't mix ordinal dates with month/day");
|
|
4501
4501
|
let m;
|
|
4502
4502
|
i ? m = en(
|
|
4503
|
-
{ ...nt(this.c,
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
) : w(n.ordinal) ? (m = { ...this.toObject(), ...n }, w(n.day) && (m.day = Math.min(
|
|
4503
|
+
{ ...nt(this.c, r, s), ...n },
|
|
4504
|
+
r,
|
|
4505
|
+
s
|
|
4506
|
+
) : w(n.ordinal) ? (m = { ...this.toObject(), ...n }, w(n.day) && (m.day = Math.min(rt(m.year, m.month), m.day))) : m = tn({ ...yt(this.c), ...n });
|
|
4507
4507
|
const [v, f] = Ke(m, this.o, this.zone);
|
|
4508
4508
|
return le(this, { ts: v, o: f });
|
|
4509
4509
|
}
|
|
@@ -4553,35 +4553,35 @@ class y {
|
|
|
4553
4553
|
startOf(e, { useLocaleWeeks: n = !1 } = {}) {
|
|
4554
4554
|
if (!this.isValid)
|
|
4555
4555
|
return this;
|
|
4556
|
-
const
|
|
4557
|
-
switch (
|
|
4556
|
+
const r = {}, s = T.normalizeUnit(e);
|
|
4557
|
+
switch (s) {
|
|
4558
4558
|
case "years":
|
|
4559
|
-
|
|
4559
|
+
r.month = 1;
|
|
4560
4560
|
case "quarters":
|
|
4561
4561
|
case "months":
|
|
4562
|
-
|
|
4562
|
+
r.day = 1;
|
|
4563
4563
|
case "weeks":
|
|
4564
4564
|
case "days":
|
|
4565
|
-
|
|
4565
|
+
r.hour = 0;
|
|
4566
4566
|
case "hours":
|
|
4567
|
-
|
|
4567
|
+
r.minute = 0;
|
|
4568
4568
|
case "minutes":
|
|
4569
|
-
|
|
4569
|
+
r.second = 0;
|
|
4570
4570
|
case "seconds":
|
|
4571
|
-
|
|
4571
|
+
r.millisecond = 0;
|
|
4572
4572
|
break;
|
|
4573
4573
|
}
|
|
4574
|
-
if (
|
|
4574
|
+
if (s === "weeks")
|
|
4575
4575
|
if (n) {
|
|
4576
4576
|
const i = this.loc.getStartOfWeek(), { weekday: a } = this;
|
|
4577
|
-
a < i && (
|
|
4577
|
+
a < i && (r.weekNumber = this.weekNumber - 1), r.weekday = i;
|
|
4578
4578
|
} else
|
|
4579
|
-
|
|
4580
|
-
if (
|
|
4579
|
+
r.weekday = 1;
|
|
4580
|
+
if (s === "quarters") {
|
|
4581
4581
|
const i = Math.ceil(this.month / 3);
|
|
4582
|
-
|
|
4582
|
+
r.month = (i - 1) * 3 + 1;
|
|
4583
4583
|
}
|
|
4584
|
-
return this.set(
|
|
4584
|
+
return this.set(r);
|
|
4585
4585
|
}
|
|
4586
4586
|
/**
|
|
4587
4587
|
* "Set" this DateTime to the end (meaning the last millisecond) of a unit of time
|
|
@@ -4669,15 +4669,15 @@ class y {
|
|
|
4669
4669
|
toISO({
|
|
4670
4670
|
format: e = "extended",
|
|
4671
4671
|
suppressSeconds: n = !1,
|
|
4672
|
-
suppressMilliseconds:
|
|
4673
|
-
includeOffset:
|
|
4672
|
+
suppressMilliseconds: r = !1,
|
|
4673
|
+
includeOffset: s = !0,
|
|
4674
4674
|
extendedZone: i = !1
|
|
4675
4675
|
} = {}) {
|
|
4676
4676
|
if (!this.isValid)
|
|
4677
4677
|
return null;
|
|
4678
4678
|
const a = e === "extended";
|
|
4679
4679
|
let o = St(this, a);
|
|
4680
|
-
return o += "T", o += gn(this, a, n,
|
|
4680
|
+
return o += "T", o += gn(this, a, n, r, s, i), o;
|
|
4681
4681
|
}
|
|
4682
4682
|
/**
|
|
4683
4683
|
* Returns an ISO 8601-compliant string representation of this DateTime's date component
|
|
@@ -4716,17 +4716,17 @@ class y {
|
|
|
4716
4716
|
toISOTime({
|
|
4717
4717
|
suppressMilliseconds: e = !1,
|
|
4718
4718
|
suppressSeconds: n = !1,
|
|
4719
|
-
includeOffset:
|
|
4720
|
-
includePrefix:
|
|
4719
|
+
includeOffset: r = !0,
|
|
4720
|
+
includePrefix: s = !1,
|
|
4721
4721
|
extendedZone: i = !1,
|
|
4722
4722
|
format: a = "extended"
|
|
4723
4723
|
} = {}) {
|
|
4724
|
-
return this.isValid ? (
|
|
4724
|
+
return this.isValid ? (s ? "T" : "") + gn(
|
|
4725
4725
|
this,
|
|
4726
4726
|
a === "extended",
|
|
4727
4727
|
n,
|
|
4728
4728
|
e,
|
|
4729
|
-
|
|
4729
|
+
r,
|
|
4730
4730
|
i
|
|
4731
4731
|
) : null;
|
|
4732
4732
|
}
|
|
@@ -4770,9 +4770,9 @@ class y {
|
|
|
4770
4770
|
* @example DateTime.now().toSQL({ includeZone: false }) //=> '05:15:16.345 America/New_York'
|
|
4771
4771
|
* @return {string}
|
|
4772
4772
|
*/
|
|
4773
|
-
toSQLTime({ includeOffset: e = !0, includeZone: n = !1, includeOffsetSpace:
|
|
4774
|
-
let
|
|
4775
|
-
return (n || e) && (
|
|
4773
|
+
toSQLTime({ includeOffset: e = !0, includeZone: n = !1, includeOffsetSpace: r = !0 } = {}) {
|
|
4774
|
+
let s = "HH:mm:ss.SSS";
|
|
4775
|
+
return (n || e) && (r && (s += " "), n ? s += "z" : e && (s += "ZZ")), Je(this, s, !0);
|
|
4776
4776
|
}
|
|
4777
4777
|
/**
|
|
4778
4778
|
* Returns a string representation of this DateTime appropriate for use in SQL DateTime
|
|
@@ -4881,10 +4881,10 @@ class y {
|
|
|
4881
4881
|
* i2.diff(i1, ['months', 'days', 'hours']).toObject() //=> { months: 16, days: 19, hours: 0.75 }
|
|
4882
4882
|
* @return {Duration}
|
|
4883
4883
|
*/
|
|
4884
|
-
diff(e, n = "milliseconds",
|
|
4884
|
+
diff(e, n = "milliseconds", r = {}) {
|
|
4885
4885
|
if (!this.isValid || !e.isValid)
|
|
4886
4886
|
return T.invalid("created by diffing an invalid DateTime");
|
|
4887
|
-
const
|
|
4887
|
+
const s = { locale: this.locale, numberingSystem: this.numberingSystem, ...r }, i = ys(n).map(T.normalizeUnit), a = e.valueOf() > this.valueOf(), o = a ? this : e, l = a ? e : this, u = ki(o, l, i, s);
|
|
4888
4888
|
return a ? u.negate() : u;
|
|
4889
4889
|
}
|
|
4890
4890
|
/**
|
|
@@ -4904,7 +4904,7 @@ class y {
|
|
|
4904
4904
|
* @return {Interval}
|
|
4905
4905
|
*/
|
|
4906
4906
|
until(e) {
|
|
4907
|
-
return this.isValid ?
|
|
4907
|
+
return this.isValid ? I.fromDateTimes(this, e) : this;
|
|
4908
4908
|
}
|
|
4909
4909
|
/**
|
|
4910
4910
|
* Return whether this DateTime is in the same unit of time as another DateTime.
|
|
@@ -4917,11 +4917,11 @@ class y {
|
|
|
4917
4917
|
* @example DateTime.now().hasSame(otherDT, 'day'); //~> true if otherDT is in the same current calendar day
|
|
4918
4918
|
* @return {boolean}
|
|
4919
4919
|
*/
|
|
4920
|
-
hasSame(e, n,
|
|
4920
|
+
hasSame(e, n, r) {
|
|
4921
4921
|
if (!this.isValid)
|
|
4922
4922
|
return !1;
|
|
4923
|
-
const
|
|
4924
|
-
return i.startOf(n,
|
|
4923
|
+
const s = e.valueOf(), i = this.setZone(e.zone, { keepLocalTime: !0 });
|
|
4924
|
+
return i.startOf(n, r) <= s && s <= i.endOf(n, r);
|
|
4925
4925
|
}
|
|
4926
4926
|
/**
|
|
4927
4927
|
* Equality check
|
|
@@ -4954,12 +4954,12 @@ class y {
|
|
|
4954
4954
|
toRelative(e = {}) {
|
|
4955
4955
|
if (!this.isValid)
|
|
4956
4956
|
return null;
|
|
4957
|
-
const n = e.base || y.fromObject({}, { zone: this.zone }),
|
|
4958
|
-
let
|
|
4959
|
-
return Array.isArray(e.unit) && (
|
|
4957
|
+
const n = e.base || y.fromObject({}, { zone: this.zone }), r = e.padding ? this < n ? -e.padding : e.padding : 0;
|
|
4958
|
+
let s = ["years", "months", "days", "hours", "minutes", "seconds"], i = e.unit;
|
|
4959
|
+
return Array.isArray(e.unit) && (s = e.unit, i = void 0), kn(n, this.plus(r), {
|
|
4960
4960
|
...e,
|
|
4961
4961
|
numeric: "always",
|
|
4962
|
-
units:
|
|
4962
|
+
units: s,
|
|
4963
4963
|
unit: i
|
|
4964
4964
|
});
|
|
4965
4965
|
}
|
|
@@ -4992,7 +4992,7 @@ class y {
|
|
|
4992
4992
|
static min(...e) {
|
|
4993
4993
|
if (!e.every(y.isDateTime))
|
|
4994
4994
|
throw new $("min requires all arguments be DateTimes");
|
|
4995
|
-
return
|
|
4995
|
+
return rn(e, (n) => n.valueOf(), Math.min);
|
|
4996
4996
|
}
|
|
4997
4997
|
/**
|
|
4998
4998
|
* Return the max of several date times
|
|
@@ -5002,7 +5002,7 @@ class y {
|
|
|
5002
5002
|
static max(...e) {
|
|
5003
5003
|
if (!e.every(y.isDateTime))
|
|
5004
5004
|
throw new $("max requires all arguments be DateTimes");
|
|
5005
|
-
return
|
|
5005
|
+
return rn(e, (n) => n.valueOf(), Math.max);
|
|
5006
5006
|
}
|
|
5007
5007
|
// MISC
|
|
5008
5008
|
/**
|
|
@@ -5012,19 +5012,19 @@ class y {
|
|
|
5012
5012
|
* @param {Object} options - options taken by fromFormat()
|
|
5013
5013
|
* @return {Object}
|
|
5014
5014
|
*/
|
|
5015
|
-
static fromFormatExplain(e, n,
|
|
5016
|
-
const { locale:
|
|
5017
|
-
locale:
|
|
5015
|
+
static fromFormatExplain(e, n, r = {}) {
|
|
5016
|
+
const { locale: s = null, numberingSystem: i = null } = r, a = D.fromOpts({
|
|
5017
|
+
locale: s,
|
|
5018
5018
|
numberingSystem: i,
|
|
5019
5019
|
defaultToEN: !0
|
|
5020
5020
|
});
|
|
5021
|
-
return
|
|
5021
|
+
return yr(a, e, n);
|
|
5022
5022
|
}
|
|
5023
5023
|
/**
|
|
5024
5024
|
* @deprecated use fromFormatExplain instead
|
|
5025
5025
|
*/
|
|
5026
|
-
static fromStringExplain(e, n,
|
|
5027
|
-
return y.fromFormatExplain(e, n,
|
|
5026
|
+
static fromStringExplain(e, n, r = {}) {
|
|
5027
|
+
return y.fromFormatExplain(e, n, r);
|
|
5028
5028
|
}
|
|
5029
5029
|
// FORMAT PRESETS
|
|
5030
5030
|
/**
|
|
@@ -5046,7 +5046,7 @@ class y {
|
|
|
5046
5046
|
* @type {Object}
|
|
5047
5047
|
*/
|
|
5048
5048
|
static get DATE_MED_WITH_WEEKDAY() {
|
|
5049
|
-
return
|
|
5049
|
+
return Hr;
|
|
5050
5050
|
}
|
|
5051
5051
|
/**
|
|
5052
5052
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983'
|
|
@@ -5081,21 +5081,21 @@ class y {
|
|
|
5081
5081
|
* @type {Object}
|
|
5082
5082
|
*/
|
|
5083
5083
|
static get TIME_WITH_SHORT_OFFSET() {
|
|
5084
|
-
return
|
|
5084
|
+
return In;
|
|
5085
5085
|
}
|
|
5086
5086
|
/**
|
|
5087
5087
|
* {@link DateTime#toLocaleString} format like '09:30:23 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
5088
5088
|
* @type {Object}
|
|
5089
5089
|
*/
|
|
5090
5090
|
static get TIME_WITH_LONG_OFFSET() {
|
|
5091
|
-
return
|
|
5091
|
+
return En;
|
|
5092
5092
|
}
|
|
5093
5093
|
/**
|
|
5094
5094
|
* {@link DateTime#toLocaleString} format like '09:30', always 24-hour.
|
|
5095
5095
|
* @type {Object}
|
|
5096
5096
|
*/
|
|
5097
5097
|
static get TIME_24_SIMPLE() {
|
|
5098
|
-
return
|
|
5098
|
+
return xn;
|
|
5099
5099
|
}
|
|
5100
5100
|
/**
|
|
5101
5101
|
* {@link DateTime#toLocaleString} format like '09:30:23', always 24-hour.
|
|
@@ -5151,7 +5151,7 @@ class y {
|
|
|
5151
5151
|
* @type {Object}
|
|
5152
5152
|
*/
|
|
5153
5153
|
static get DATETIME_MED_WITH_WEEKDAY() {
|
|
5154
|
-
return
|
|
5154
|
+
return Yr;
|
|
5155
5155
|
}
|
|
5156
5156
|
/**
|
|
5157
5157
|
* {@link DateTime#toLocaleString} format like 'October 14, 1983, 9:30 AM EDT'. Only 12-hour if the locale is.
|
|
@@ -5165,14 +5165,14 @@ class y {
|
|
|
5165
5165
|
* @type {Object}
|
|
5166
5166
|
*/
|
|
5167
5167
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
5168
|
-
return
|
|
5168
|
+
return zn;
|
|
5169
5169
|
}
|
|
5170
5170
|
/**
|
|
5171
5171
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
5172
5172
|
* @type {Object}
|
|
5173
5173
|
*/
|
|
5174
5174
|
static get DATETIME_HUGE() {
|
|
5175
|
-
return
|
|
5175
|
+
return An;
|
|
5176
5176
|
}
|
|
5177
5177
|
/**
|
|
5178
5178
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
@@ -5182,7 +5182,7 @@ class y {
|
|
|
5182
5182
|
return _n;
|
|
5183
5183
|
}
|
|
5184
5184
|
}
|
|
5185
|
-
function
|
|
5185
|
+
function xe(t) {
|
|
5186
5186
|
if (y.isDateTime(t))
|
|
5187
5187
|
return t;
|
|
5188
5188
|
if (t && t.valueOf && ce(t.valueOf()))
|
|
@@ -5193,46 +5193,46 @@ function Ee(t) {
|
|
|
5193
5193
|
`Unknown datetime argument: ${t}, of type ${typeof t}`
|
|
5194
5194
|
);
|
|
5195
5195
|
}
|
|
5196
|
-
const _i = "
|
|
5196
|
+
const _i = "_calendar_1qrsz_4", qi = "_header_1qrsz_17", Ui = "_heading_1qrsz_42", Ri = "_controller_1qrsz_48", Hi = "_spacer_1qrsz_56", Yi = "_fadein_1qrsz_1", Pi = "_cell_1qrsz_69", ji = "_overflow_1qrsz_99", Gi = "_content_1qrsz_102", Ji = "_weekday_1qrsz_105", Bi = "_range_1qrsz_130", Ki = "_selected_1qrsz_140", Qi = "_unavailable_1qrsz_148", N = {
|
|
5197
5197
|
calendar: _i,
|
|
5198
|
-
header:
|
|
5198
|
+
header: qi,
|
|
5199
5199
|
heading: Ui,
|
|
5200
|
-
controller:
|
|
5201
|
-
spacer:
|
|
5202
|
-
"day-grid": "_day-
|
|
5200
|
+
controller: Ri,
|
|
5201
|
+
spacer: Hi,
|
|
5202
|
+
"day-grid": "_day-grid_1qrsz_59",
|
|
5203
5203
|
fadein: Yi,
|
|
5204
5204
|
cell: Pi,
|
|
5205
5205
|
overflow: ji,
|
|
5206
5206
|
content: Gi,
|
|
5207
5207
|
weekday: Ji,
|
|
5208
|
-
"range-first": "_range-
|
|
5209
|
-
"range-last": "_range-
|
|
5208
|
+
"range-first": "_range-first_1qrsz_130",
|
|
5209
|
+
"range-last": "_range-last_1qrsz_130",
|
|
5210
5210
|
range: Bi,
|
|
5211
5211
|
selected: Ki,
|
|
5212
5212
|
unavailable: Qi,
|
|
5213
|
-
"hover-last": "_hover-
|
|
5214
|
-
"range-fill": "_range-
|
|
5215
|
-
"range-disabled": "_range-
|
|
5216
|
-
"controller-button": "_controller-
|
|
5217
|
-
}, Xi = (t) => /* @__PURE__ */ et.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t }, /* @__PURE__ */ et.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" })),
|
|
5213
|
+
"hover-last": "_hover-last_1qrsz_206",
|
|
5214
|
+
"range-fill": "_range-fill_1qrsz_210",
|
|
5215
|
+
"range-disabled": "_range-disabled_1qrsz_220",
|
|
5216
|
+
"controller-button": "_controller-button_1qrsz_228"
|
|
5217
|
+
}, Xi = (t) => /* @__PURE__ */ et.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t }, /* @__PURE__ */ et.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) => {
|
|
5218
5218
|
if (!(!t || !e))
|
|
5219
5219
|
return !!(t.hasSame(e, "month") && t.hasSame(e, "year") && t.hasSame(e, "day"));
|
|
5220
5220
|
}, Le = (t, e) => {
|
|
5221
5221
|
if (!(!t || !e))
|
|
5222
5222
|
return !!(t.hasSame(e, "month") && t.hasSame(e, "year"));
|
|
5223
|
-
},
|
|
5224
|
-
const
|
|
5225
|
-
return e.forEach((
|
|
5226
|
-
|
|
5227
|
-
y.fromISO(
|
|
5223
|
+
}, re = (t, e, n) => {
|
|
5224
|
+
const r = /* @__PURE__ */ new Set();
|
|
5225
|
+
return e.forEach((s) => {
|
|
5226
|
+
r.add(
|
|
5227
|
+
y.fromISO(s, { zone: n }).startOf("day").toISO()
|
|
5228
5228
|
);
|
|
5229
|
-
}),
|
|
5229
|
+
}), r.has(
|
|
5230
5230
|
y.fromISO(t.toISO(), { zone: n }).startOf("day").toISO()
|
|
5231
5231
|
);
|
|
5232
5232
|
}, Qe = (t, e) => e && e.toMillis() > t.toMillis(), Xe = (t, e) => e && e.toMillis() < t.toMillis();
|
|
5233
|
-
function
|
|
5234
|
-
if (t.start &&
|
|
5235
|
-
n((
|
|
5233
|
+
function It(t, e, n, r) {
|
|
5234
|
+
if (t.start && z(t.start, e) && !t.end) {
|
|
5235
|
+
n((s) => ({ ...s, end: e })), r == null || r({
|
|
5236
5236
|
value: {
|
|
5237
5237
|
start: t.start.startOf("day").toISO() ?? void 0,
|
|
5238
5238
|
end: e.startOf("day").toISO() ?? void 0
|
|
@@ -5241,7 +5241,7 @@ function xt(t, e, n, s) {
|
|
|
5241
5241
|
return;
|
|
5242
5242
|
}
|
|
5243
5243
|
if (!t.start && !t.end || t.start && t.end || t.start && !t.end && t.start.startOf("day").toMillis() > e.startOf("day").toMillis()) {
|
|
5244
|
-
n({ start: e, end: null }),
|
|
5244
|
+
n({ start: e, end: null }), r == null || r({
|
|
5245
5245
|
value: {
|
|
5246
5246
|
start: e.startOf("day").toISO() ?? void 0,
|
|
5247
5247
|
end: void 0
|
|
@@ -5250,7 +5250,7 @@ function xt(t, e, n, s) {
|
|
|
5250
5250
|
return;
|
|
5251
5251
|
}
|
|
5252
5252
|
if (t.start && !t.end && t.start.startOf("day").toMillis() < e.startOf("day").toMillis()) {
|
|
5253
|
-
n((
|
|
5253
|
+
n((s) => ({ ...s, end: e })), r == null || r({
|
|
5254
5254
|
value: {
|
|
5255
5255
|
start: t.start.startOf("day").toISO() ?? void 0,
|
|
5256
5256
|
end: e.startOf("day").toISO() ?? void 0
|
|
@@ -5259,7 +5259,7 @@ function xt(t, e, n, s) {
|
|
|
5259
5259
|
return;
|
|
5260
5260
|
}
|
|
5261
5261
|
if (!t.start && t.end) {
|
|
5262
|
-
n((
|
|
5262
|
+
n((s) => ({ ...s, start: e })), r == null || r({
|
|
5263
5263
|
value: {
|
|
5264
5264
|
start: e.startOf("day").toISO() ?? void 0,
|
|
5265
5265
|
end: t.end.startOf("day").toISO() ?? void 0
|
|
@@ -5268,9 +5268,9 @@ function xt(t, e, n, s) {
|
|
|
5268
5268
|
return;
|
|
5269
5269
|
}
|
|
5270
5270
|
}
|
|
5271
|
-
const
|
|
5271
|
+
const Et = Ze(
|
|
5272
5272
|
(t, e) => {
|
|
5273
|
-
const { onClick: n, className:
|
|
5273
|
+
const { onClick: n, className: r, ...s } = t, { focusedDate: i, setFocusedDate: a, minDate: o } = ct(), l = (u) => {
|
|
5274
5274
|
n == null || n(u);
|
|
5275
5275
|
const d = i.minus({ month: 1 }).endOf("month"), m = i.minus({ month: 1 });
|
|
5276
5276
|
if (o !== null) {
|
|
@@ -5288,20 +5288,20 @@ const It = Ze(
|
|
|
5288
5288
|
{
|
|
5289
5289
|
ref: e,
|
|
5290
5290
|
onClick: l,
|
|
5291
|
-
className: Ve(N["controller-button"],
|
|
5291
|
+
className: Ve(N["controller-button"], r),
|
|
5292
5292
|
appearance: "ghost",
|
|
5293
5293
|
size: "small",
|
|
5294
5294
|
icon: Xi,
|
|
5295
5295
|
"aria-label": "Previous Month",
|
|
5296
|
-
...
|
|
5296
|
+
...s
|
|
5297
5297
|
}
|
|
5298
5298
|
);
|
|
5299
5299
|
}
|
|
5300
5300
|
);
|
|
5301
|
-
|
|
5302
|
-
const ea = (t) => /* @__PURE__ */ et.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t }, /* @__PURE__ */ et.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" })),
|
|
5301
|
+
Et.displayName = "CalendarPrev";
|
|
5302
|
+
const ea = (t) => /* @__PURE__ */ et.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: "1em", height: "1em", viewBox: "0 0 24 24", ...t }, /* @__PURE__ */ et.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" })), xt = Ze(
|
|
5303
5303
|
(t, e) => {
|
|
5304
|
-
const { onClick: n, className:
|
|
5304
|
+
const { onClick: n, className: r, ...s } = t, { focusedDate: i, setFocusedDate: a, maxDate: o } = ct(), l = (u) => {
|
|
5305
5305
|
n == null || n(u);
|
|
5306
5306
|
const d = i.plus({ month: 1 }).startOf("month"), m = i.plus({ month: 1 });
|
|
5307
5307
|
if (o !== null) {
|
|
@@ -5320,19 +5320,19 @@ const ea = (t) => /* @__PURE__ */ et.createElement("svg", { xmlns: "http://www.w
|
|
|
5320
5320
|
onClick: l,
|
|
5321
5321
|
appearance: "ghost",
|
|
5322
5322
|
size: "small",
|
|
5323
|
-
className: Ve(N["controller-button"],
|
|
5323
|
+
className: Ve(N["controller-button"], r),
|
|
5324
5324
|
icon: ea,
|
|
5325
5325
|
"aria-label": "Next Month",
|
|
5326
5326
|
ref: e,
|
|
5327
|
-
...
|
|
5327
|
+
...s
|
|
5328
5328
|
}
|
|
5329
5329
|
);
|
|
5330
5330
|
}
|
|
5331
5331
|
);
|
|
5332
|
-
|
|
5332
|
+
xt.displayName = "CalendarNext";
|
|
5333
5333
|
const bt = Ze(
|
|
5334
5334
|
(t, e) => {
|
|
5335
|
-
const { className: n, ...
|
|
5335
|
+
const { className: n, ...r } = t, s = ct(), {
|
|
5336
5336
|
value: i,
|
|
5337
5337
|
setValue: a,
|
|
5338
5338
|
focusedDate: o,
|
|
@@ -5343,20 +5343,20 @@ const bt = Ze(
|
|
|
5343
5343
|
locale: v,
|
|
5344
5344
|
minDate: f,
|
|
5345
5345
|
maxDate: g,
|
|
5346
|
-
unavailableDates:
|
|
5346
|
+
unavailableDates: x,
|
|
5347
5347
|
timeZone: p,
|
|
5348
5348
|
controlled: F,
|
|
5349
5349
|
id: _,
|
|
5350
5350
|
range: L,
|
|
5351
5351
|
dateFormat: K,
|
|
5352
5352
|
startDay: ae
|
|
5353
|
-
} =
|
|
5353
|
+
} = s, H = Cr(!1), Q = Ve(N.grid, n), Z = Vr(
|
|
5354
5354
|
(h) => {
|
|
5355
5355
|
if (!(g !== null && h.toMillis() > (g == null ? void 0 : g.toMillis()))) {
|
|
5356
|
-
if (
|
|
5356
|
+
if (re(h, x, p)) {
|
|
5357
5357
|
let k = h.plus({ days: 1 });
|
|
5358
5358
|
for (let O = 0; O < 365 && !(g !== null && k.toMillis() > (g == null ? void 0 : g.toMillis())); O++)
|
|
5359
|
-
if (
|
|
5359
|
+
if (re(k, x, p))
|
|
5360
5360
|
k = k.plus({ days: 1 });
|
|
5361
5361
|
else {
|
|
5362
5362
|
l(k);
|
|
@@ -5367,13 +5367,13 @@ const bt = Ze(
|
|
|
5367
5367
|
l(h);
|
|
5368
5368
|
}
|
|
5369
5369
|
},
|
|
5370
|
-
[g, l, p,
|
|
5370
|
+
[g, l, p, x]
|
|
5371
5371
|
), Y = (h) => {
|
|
5372
5372
|
if (!(f !== null && h.toMillis() < (f == null ? void 0 : f.toMillis()))) {
|
|
5373
|
-
if (
|
|
5373
|
+
if (re(h, x, p)) {
|
|
5374
5374
|
let k = h.minus({ days: 1 });
|
|
5375
5375
|
for (let O = 0; O < 365 && !(f !== null && k.toMillis() < (f == null ? void 0 : f.toMillis())); O++)
|
|
5376
|
-
if (
|
|
5376
|
+
if (re(k, x, p))
|
|
5377
5377
|
k = k.minus({ days: 1 });
|
|
5378
5378
|
else {
|
|
5379
5379
|
l(k);
|
|
@@ -5383,17 +5383,17 @@ const bt = Ze(
|
|
|
5383
5383
|
}
|
|
5384
5384
|
l(h);
|
|
5385
5385
|
}
|
|
5386
|
-
}, P = (h, k) => L ? i.start && i.end ? h.toMillis() >= i.start.startOf("day").toMillis() && h.toMillis() <= i.end.endOf("day").toMillis() :
|
|
5386
|
+
}, P = (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), fe = (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, Me = (h) => {
|
|
5387
5387
|
switch (h.code) {
|
|
5388
5388
|
case "Space":
|
|
5389
5389
|
case "Enter":
|
|
5390
5390
|
if (h.preventDefault(), !L) {
|
|
5391
|
-
!F && a(
|
|
5392
|
-
value:
|
|
5391
|
+
!F && a(z(i, o) ? null : o), m == null || m({
|
|
5392
|
+
value: z(i, o) ? void 0 : o.setZone(p).startOf("day").toISO() ?? void 0
|
|
5393
5393
|
});
|
|
5394
5394
|
break;
|
|
5395
5395
|
}
|
|
5396
|
-
|
|
5396
|
+
It(i, o, a, m);
|
|
5397
5397
|
break;
|
|
5398
5398
|
case "ArrowLeft":
|
|
5399
5399
|
h.preventDefault(), Y(o.minus({ days: 1 }));
|
|
@@ -5437,7 +5437,7 @@ const bt = Ze(
|
|
|
5437
5437
|
const k = (ee + h) % 7;
|
|
5438
5438
|
De.push(Fe.weekdays("narrow", { locale: v })[k]);
|
|
5439
5439
|
}
|
|
5440
|
-
const he = o.startOf("month"), Ue = o.endOf("month"),
|
|
5440
|
+
const he = o.startOf("month"), Ue = o.endOf("month"), Re = Array.from(new Array(he.daysInMonth)).map((h, k) => he.plus({ days: k })), Ne = [];
|
|
5441
5441
|
if (he.weekday !== ee + 1)
|
|
5442
5442
|
for (let h = 1; h < 8; h++) {
|
|
5443
5443
|
const k = he.minus({ days: h });
|
|
@@ -5445,23 +5445,23 @@ const bt = Ze(
|
|
|
5445
5445
|
break;
|
|
5446
5446
|
}
|
|
5447
5447
|
Ne.reverse();
|
|
5448
|
-
const
|
|
5448
|
+
const Sr = Array.from(new Array(14)).map((h, k) => Ue.plus({ days: k + 1 })), Ut = [...Ne, ...Re, ...Sr], Or = [...Array(Math.ceil(Ut.length / 7))].map((h, k) => Ut.slice(7 * k, 7 + 7 * k)).slice(0, 6), Tr = (h) => {
|
|
5449
5449
|
if (l(h), !L) {
|
|
5450
5450
|
m == null || m({
|
|
5451
5451
|
value: h.setZone(p).startOf("day").toISO() ?? void 0
|
|
5452
5452
|
}), !F && a(h);
|
|
5453
5453
|
return;
|
|
5454
5454
|
}
|
|
5455
|
-
|
|
5456
|
-
},
|
|
5455
|
+
It(i, h, a, m);
|
|
5456
|
+
}, vr = (h) => {
|
|
5457
5457
|
d(h);
|
|
5458
|
-
},
|
|
5458
|
+
}, Mr = () => {
|
|
5459
5459
|
d(void 0);
|
|
5460
|
-
},
|
|
5460
|
+
}, Dr = (h) => {
|
|
5461
5461
|
d(h), l(h);
|
|
5462
|
-
},
|
|
5462
|
+
}, Nr = () => {
|
|
5463
5463
|
d(void 0);
|
|
5464
|
-
},
|
|
5464
|
+
}, Ir = (h) => {
|
|
5465
5465
|
if (h === "left") {
|
|
5466
5466
|
const k = o.plus({ month: 1 });
|
|
5467
5467
|
if (Qe(k, f) || Xe(k, g))
|
|
@@ -5476,32 +5476,32 @@ const bt = Ze(
|
|
|
5476
5476
|
l(k);
|
|
5477
5477
|
return;
|
|
5478
5478
|
}
|
|
5479
|
-
}, { direction: na, ...
|
|
5479
|
+
}, { direction: na, ...Er } = Ar(Ir);
|
|
5480
5480
|
return Ce(() => {
|
|
5481
|
-
|
|
5481
|
+
H.current && setTimeout(() => {
|
|
5482
5482
|
const h = document.getElementById(
|
|
5483
5483
|
`${_}-${o.toISODate()}`
|
|
5484
5484
|
);
|
|
5485
5485
|
h == null || h.focus();
|
|
5486
5486
|
}, 100);
|
|
5487
5487
|
}, [o, _]), Ce(() => {
|
|
5488
|
-
|
|
5489
|
-
}, [o, Z, p,
|
|
5488
|
+
re(o, x, p) && Z(o.plus({ days: 1 }));
|
|
5489
|
+
}, [o, Z, p, x]), /* @__PURE__ */ S.jsxs(S.Fragment, { children: [
|
|
5490
5490
|
/* @__PURE__ */ S.jsxs(
|
|
5491
5491
|
"table",
|
|
5492
5492
|
{
|
|
5493
5493
|
ref: e,
|
|
5494
5494
|
onFocus: () => {
|
|
5495
|
-
|
|
5495
|
+
H.current = !0;
|
|
5496
5496
|
},
|
|
5497
5497
|
onBlur: () => {
|
|
5498
|
-
|
|
5498
|
+
H.current = !1;
|
|
5499
5499
|
},
|
|
5500
5500
|
className: Q,
|
|
5501
|
-
onMouseLeave:
|
|
5501
|
+
onMouseLeave: Nr,
|
|
5502
5502
|
role: "grid",
|
|
5503
|
-
...
|
|
5504
|
-
...
|
|
5503
|
+
...r,
|
|
5504
|
+
...Er,
|
|
5505
5505
|
children: [
|
|
5506
5506
|
/* @__PURE__ */ S.jsxs("thead", { "aria-hidden": !0, className: N.weekdays, children: [
|
|
5507
5507
|
/* @__PURE__ */ S.jsx("tr", { children: De.map((h, k) => /* @__PURE__ */ S.jsx(
|
|
@@ -5519,48 +5519,48 @@ const bt = Ze(
|
|
|
5519
5519
|
"tbody",
|
|
5520
5520
|
{
|
|
5521
5521
|
className: N["day-grid"],
|
|
5522
|
-
children:
|
|
5523
|
-
const
|
|
5522
|
+
children: Or.map((h, k) => /* @__PURE__ */ S.jsx("tr", { children: h.map((O) => {
|
|
5523
|
+
const Rt = !Le(O, o) || Qe(O, f) || Xe(O, g) || re(O, x, p), dt = re(
|
|
5524
5524
|
O,
|
|
5525
|
-
|
|
5525
|
+
x,
|
|
5526
5526
|
p
|
|
5527
|
-
),
|
|
5527
|
+
), Ie = L && u && i.start && !i.end && O.toMillis() > i.start.toMillis() && O.toMillis() <= u.toMillis(), xr = Ve(N.cell, {
|
|
5528
5528
|
[N.selected]: !dt && P(O),
|
|
5529
|
-
[N["range-first"]]: L && i.start && (i.end || u) &&
|
|
5530
|
-
[N["range-last"]]: L && (i.start && i.end &&
|
|
5531
|
-
[N.range]: fe(O) ||
|
|
5529
|
+
[N["range-first"]]: L && i.start && (i.end || u) && z(O, i.start),
|
|
5530
|
+
[N["range-last"]]: L && (i.start && i.end && z(O, i.end) || Ie && z(O, u)),
|
|
5531
|
+
[N.range]: fe(O) || Ie,
|
|
5532
5532
|
[N.unavailable]: dt,
|
|
5533
5533
|
[N.overflow]: !Le(O, o),
|
|
5534
|
-
[N["hover-last"]]:
|
|
5535
|
-
}),
|
|
5534
|
+
[N["hover-last"]]: Ie && z(O, u)
|
|
5535
|
+
}), br = f !== null && O.toMillis() <= (f == null ? void 0 : f.toMillis()), Fr = g !== null && O.toMillis() >= (g == null ? void 0 : g.toMillis());
|
|
5536
5536
|
return /* @__PURE__ */ S.jsxs(
|
|
5537
5537
|
"td",
|
|
5538
5538
|
{
|
|
5539
5539
|
"aria-disabled": !Le(O, o),
|
|
5540
5540
|
role: "gridcell",
|
|
5541
5541
|
children: [
|
|
5542
|
-
!dt && (fe(O) ||
|
|
5542
|
+
!dt && (fe(O) || Ie) ? /* @__PURE__ */ S.jsx(
|
|
5543
5543
|
"div",
|
|
5544
5544
|
{
|
|
5545
5545
|
role: "presentation",
|
|
5546
5546
|
className: Ve(N["range-fill"], {
|
|
5547
|
-
[N["range-disabled"]]:
|
|
5548
|
-
[N["hover-last"]]:
|
|
5547
|
+
[N["range-disabled"]]: Rt,
|
|
5548
|
+
[N["hover-last"]]: Ie && z(O, u)
|
|
5549
5549
|
})
|
|
5550
5550
|
}
|
|
5551
5551
|
) : null,
|
|
5552
5552
|
/* @__PURE__ */ S.jsx(
|
|
5553
5553
|
"button",
|
|
5554
5554
|
{
|
|
5555
|
-
onClick: () =>
|
|
5556
|
-
onFocus: () =>
|
|
5557
|
-
onBlur: () =>
|
|
5558
|
-
className:
|
|
5555
|
+
onClick: () => Tr(O),
|
|
5556
|
+
onFocus: () => vr(O),
|
|
5557
|
+
onBlur: () => Mr(),
|
|
5558
|
+
className: xr,
|
|
5559
5559
|
onKeyDown: Me,
|
|
5560
|
-
onMouseEnter: () =>
|
|
5561
|
-
tabIndex:
|
|
5562
|
-
disabled:
|
|
5563
|
-
"aria-label": `${O.toLocaleString(K)}${P(O) ? " selected" : ""}${
|
|
5560
|
+
onMouseEnter: () => Dr(O),
|
|
5561
|
+
tabIndex: z(O, o) ? 0 : -1,
|
|
5562
|
+
disabled: Rt ? !0 : void 0,
|
|
5563
|
+
"aria-label": `${O.toLocaleString(K)}${P(O) ? " selected" : ""}${br ? ", You are on the first available date" : ""}${Fr ? ", You are on the last available date" : ""}`,
|
|
5564
5564
|
id: `${_}-${O.toISODate()}`,
|
|
5565
5565
|
children: O.day
|
|
5566
5566
|
}
|
|
@@ -5576,15 +5576,15 @@ const bt = Ze(
|
|
|
5576
5576
|
]
|
|
5577
5577
|
}
|
|
5578
5578
|
),
|
|
5579
|
-
L && i ? /* @__PURE__ */ S.jsx(
|
|
5579
|
+
L && i ? /* @__PURE__ */ S.jsx(_r, { "aria-live": "polite", children: `Range starts at ${i.start && i.start.toLocaleString(K)}, ${i.end ? `ends at ${i.end.toLocaleString(K)}` : "select an end date"}` }) : null
|
|
5580
5580
|
] });
|
|
5581
5581
|
}
|
|
5582
5582
|
);
|
|
5583
5583
|
bt.displayName = "CalendarMonth";
|
|
5584
5584
|
const Ft = Ze(
|
|
5585
5585
|
(t, e) => {
|
|
5586
|
-
const { onClick: n, ...
|
|
5587
|
-
setFocusedDate:
|
|
5586
|
+
const { onClick: n, ...r } = t, {
|
|
5587
|
+
setFocusedDate: s,
|
|
5588
5588
|
value: i,
|
|
5589
5589
|
setValue: a,
|
|
5590
5590
|
timeZone: o,
|
|
@@ -5596,33 +5596,33 @@ const Ft = Ze(
|
|
|
5596
5596
|
range: f
|
|
5597
5597
|
} = ct(), g = y.fromISO(y.now().toISO(), {
|
|
5598
5598
|
zone: o
|
|
5599
|
-
}).startOf("day"),
|
|
5600
|
-
if (
|
|
5599
|
+
}).startOf("day"), x = (F) => {
|
|
5600
|
+
if (s(g), !f) {
|
|
5601
5601
|
u == null || u({
|
|
5602
5602
|
value: g.startOf("day").toISO() ?? void 0
|
|
5603
5603
|
}), !v && a(g);
|
|
5604
5604
|
return;
|
|
5605
5605
|
}
|
|
5606
|
-
|
|
5607
|
-
}, p = Xe(g, m) || Qe(g, d) ||
|
|
5606
|
+
It(i, g, a, u);
|
|
5607
|
+
}, p = Xe(g, m) || Qe(g, d) || re(g, l, o);
|
|
5608
5608
|
return /* @__PURE__ */ S.jsx(
|
|
5609
5609
|
Vt,
|
|
5610
5610
|
{
|
|
5611
5611
|
ref: e,
|
|
5612
|
-
onClick:
|
|
5612
|
+
onClick: x,
|
|
5613
5613
|
appearance: "secondary",
|
|
5614
5614
|
disabled: p,
|
|
5615
5615
|
size: "small",
|
|
5616
|
-
...
|
|
5616
|
+
...r,
|
|
5617
5617
|
children: "Today"
|
|
5618
5618
|
}
|
|
5619
5619
|
);
|
|
5620
5620
|
}
|
|
5621
5621
|
);
|
|
5622
5622
|
Ft.displayName = "CalendarNow";
|
|
5623
|
-
const Ct =
|
|
5623
|
+
const Ct = Wr(null), ta = Ze(
|
|
5624
5624
|
(t, e) => {
|
|
5625
|
-
const n =
|
|
5625
|
+
const n = Lr(), { layoutStyles: r, componentProps: s } = zr(t), {
|
|
5626
5626
|
children: i,
|
|
5627
5627
|
focusedDate: a,
|
|
5628
5628
|
defaultFocusedDate: o,
|
|
@@ -5633,16 +5633,16 @@ const Ct = Ws(null), ta = Ze(
|
|
|
5633
5633
|
maxDate: v,
|
|
5634
5634
|
unavailableDates: f = [],
|
|
5635
5635
|
id: g,
|
|
5636
|
-
style:
|
|
5636
|
+
style: x,
|
|
5637
5637
|
value: p,
|
|
5638
5638
|
defaultValue: F,
|
|
5639
5639
|
onSelection: _,
|
|
5640
5640
|
range: L,
|
|
5641
5641
|
...K
|
|
5642
|
-
} =
|
|
5643
|
-
...
|
|
5644
|
-
...
|
|
5645
|
-
},
|
|
5642
|
+
} = s, ae = {
|
|
5643
|
+
...x,
|
|
5644
|
+
...r
|
|
5645
|
+
}, H = p ? typeof p == "string" ? V(p, u) : {
|
|
5646
5646
|
start: p.start ? V(p.start, u) : null,
|
|
5647
5647
|
end: p.end ? V(p.end, u) : null
|
|
5648
5648
|
} : null, Q = F ? typeof F == "string" ? V(F, u) ?? null : {
|
|
@@ -5651,7 +5651,7 @@ const Ct = Ws(null), ta = Ze(
|
|
|
5651
5651
|
} : null, Z = typeof p == "string" ? V(y.now().toISO(), u) : {
|
|
5652
5652
|
start: V(y.now().toISO(), u),
|
|
5653
5653
|
end: V(y.now().toISO(), u)
|
|
5654
|
-
}, [Y, P] = ft(
|
|
5654
|
+
}, [Y, P] = ft(H ?? Q ?? Z), fe = () => !y.isDateTime(H) && !y.isDateTime(Q) && !y.isDateTime(Z) ? (H == null ? void 0 : H.start) ?? (Q == null ? void 0 : Q.start) ?? Z.start : H ?? Q ?? Z, [Me, ee] = ft(fe()), [De, he] = ft();
|
|
5655
5655
|
Ce(() => {
|
|
5656
5656
|
a && ee(V(a, u));
|
|
5657
5657
|
}, [a, u]), Ce(() => {
|
|
@@ -5661,7 +5661,7 @@ const Ct = Ws(null), ta = Ze(
|
|
|
5661
5661
|
end: p.end ? V(p.end, u) : null
|
|
5662
5662
|
});
|
|
5663
5663
|
}, [p, u]);
|
|
5664
|
-
const Ue = $
|
|
5664
|
+
const Ue = $r(() => {
|
|
5665
5665
|
const Ne = {
|
|
5666
5666
|
weekday: "long",
|
|
5667
5667
|
month: "long",
|
|
@@ -5702,7 +5702,7 @@ const Ct = Ws(null), ta = Ze(
|
|
|
5702
5702
|
f,
|
|
5703
5703
|
Y,
|
|
5704
5704
|
d
|
|
5705
|
-
]),
|
|
5705
|
+
]), Re = () => Me.setLocale(l).toLocaleString({
|
|
5706
5706
|
month: "long",
|
|
5707
5707
|
year: "numeric"
|
|
5708
5708
|
});
|
|
@@ -5720,11 +5720,11 @@ const Ct = Ws(null), ta = Ze(
|
|
|
5720
5720
|
...K,
|
|
5721
5721
|
children: [
|
|
5722
5722
|
/* @__PURE__ */ S.jsxs("div", { className: N.header, children: [
|
|
5723
|
-
/* @__PURE__ */ S.jsx("span", { className: N.heading, children:
|
|
5723
|
+
/* @__PURE__ */ S.jsx("span", { className: N.heading, children: Re() }),
|
|
5724
5724
|
/* @__PURE__ */ S.jsxs("span", { className: N.controller, children: [
|
|
5725
5725
|
/* @__PURE__ */ S.jsx(Ft, {}),
|
|
5726
|
-
/* @__PURE__ */ S.jsx(
|
|
5727
|
-
/* @__PURE__ */ S.jsx(
|
|
5726
|
+
/* @__PURE__ */ S.jsx(Et, {}),
|
|
5727
|
+
/* @__PURE__ */ S.jsx(xt, {})
|
|
5728
5728
|
] })
|
|
5729
5729
|
] }),
|
|
5730
5730
|
/* @__PURE__ */ S.jsx(bt, {})
|
|
@@ -5742,11 +5742,11 @@ const Ct = Ws(null), ta = Ze(
|
|
|
5742
5742
|
...K,
|
|
5743
5743
|
children: [
|
|
5744
5744
|
/* @__PURE__ */ S.jsxs("div", { className: N.header, children: [
|
|
5745
|
-
/* @__PURE__ */ S.jsx("span", { className: N.heading, children:
|
|
5745
|
+
/* @__PURE__ */ S.jsx("span", { className: N.heading, children: Re() }),
|
|
5746
5746
|
/* @__PURE__ */ S.jsxs("span", { className: N.controller, children: [
|
|
5747
5747
|
/* @__PURE__ */ S.jsx(Ft, {}),
|
|
5748
|
-
/* @__PURE__ */ S.jsx(
|
|
5749
|
-
/* @__PURE__ */ S.jsx(
|
|
5748
|
+
/* @__PURE__ */ S.jsx(Et, {}),
|
|
5749
|
+
/* @__PURE__ */ S.jsx(xt, {})
|
|
5750
5750
|
] })
|
|
5751
5751
|
] }),
|
|
5752
5752
|
/* @__PURE__ */ S.jsx(bt, {})
|
|
@@ -5756,7 +5756,7 @@ const Ct = Ws(null), ta = Ze(
|
|
|
5756
5756
|
}
|
|
5757
5757
|
);
|
|
5758
5758
|
function ct() {
|
|
5759
|
-
const t =
|
|
5759
|
+
const t = Zr(Ct);
|
|
5760
5760
|
if (!t)
|
|
5761
5761
|
throw new Error("useCalendar must be used within a <Calendar>");
|
|
5762
5762
|
return t;
|
|
@@ -5766,10 +5766,10 @@ function V(t, e) {
|
|
|
5766
5766
|
}
|
|
5767
5767
|
ta.displayName = "Calendar";
|
|
5768
5768
|
export {
|
|
5769
|
-
ta as
|
|
5769
|
+
ta as V,
|
|
5770
5770
|
bt as a,
|
|
5771
5771
|
Ft as n,
|
|
5772
|
-
|
|
5773
|
-
|
|
5772
|
+
xt as r,
|
|
5773
|
+
Et as s
|
|
5774
5774
|
};
|
|
5775
|
-
//# sourceMappingURL=Calendar-
|
|
5775
|
+
//# sourceMappingURL=Calendar-073dc10d.js.map
|