@gobolt/genesis 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/AntdIcon-c395a1c4.js +204 -0
- package/dist/CheckOutlined-52d9ac25.js +29 -0
- package/dist/{CloseCircleFilled-ZIY-u-27.js → CloseCircleFilled-ddc51e7e.js} +11 -8
- package/dist/CloseOutlined-14b8bba1.js +16 -0
- package/dist/Compact-c39ed20d.js +179 -0
- package/dist/ContextIsolator-b09b2c52.js +20 -0
- package/dist/DownOutlined-64a4732a.js +206 -0
- package/dist/EllipsisOutlined-60122660.js +1115 -0
- package/dist/{ExclamationCircleFilled-BICVVQIg.js → ExclamationCircleFilled-23ef9812.js} +22 -16
- package/dist/InfoCircleFilled-c5f90c20.js +16 -0
- package/dist/Overflow-a570fa69.js +361 -0
- package/dist/RightOutlined-83515eb4.js +16 -0
- package/dist/SearchOutlined-a9014e08.js +16 -0
- package/dist/{TextArea-3MOYYuAQ.js → TextArea-20825221.js} +597 -582
- package/dist/{button-BNV2qdrP.js → button-fa1c119c.js} +287 -280
- package/dist/collapse-345bc884.js +20 -0
- package/dist/compact-item-b8f85aa6.js +75 -0
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/Badge.js +102 -0
- package/dist/components/Badge/__stories__/Badge.stories.d.ts +13 -0
- package/dist/components/Badge/__tests__/Badge.test.js +72 -0
- package/dist/components/Badge/icons/ASN.d.ts +2 -0
- package/dist/components/Badge/icons/ASN.js +23 -0
- package/dist/components/Badge/icons/Appointment.d.ts +2 -0
- package/dist/components/Badge/icons/Appointment.js +23 -0
- package/dist/components/Badge/icons/Inventory.d.ts +2 -0
- package/dist/components/Badge/icons/Inventory.js +23 -0
- package/dist/components/Badge/icons/Parcel.d.ts +2 -0
- package/dist/components/Badge/icons/Parcel.js +23 -0
- package/dist/components/Badge/icons/Product.d.ts +2 -0
- package/dist/components/Badge/icons/Product.js +23 -0
- package/dist/components/Badge/icons/Route.d.ts +2 -0
- package/dist/components/Badge/icons/Route.js +23 -0
- package/dist/components/Badge/icons/Shipment.d.ts +2 -0
- package/dist/components/Badge/icons/Shipment.js +23 -0
- package/dist/components/Badge/icons/ShoppingCart.d.ts +2 -0
- package/dist/components/Badge/icons/ShoppingCart.js +23 -0
- package/dist/components/Badge/icons/System.d.ts +2 -0
- package/dist/components/Badge/icons/System.js +23 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +23 -0
- package/dist/components/Badge/styles.d.ts +3 -0
- package/dist/components/Badge/styles.js +35 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +27 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
- package/dist/components/Breadcrumb/__stories__/Breadcrumb.stories.d.ts +10 -0
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +70 -0
- package/dist/components/Breadcrumb/index.d.ts +3 -0
- package/dist/components/Breadcrumb/index.js +27 -0
- package/dist/components/Breadcrumb/styles.d.ts +23 -0
- package/dist/components/Breadcrumb/styles.js +2457 -0
- package/dist/components/Button/Button.js +42 -0
- package/dist/components/Button/__tests__/Button.test.js +61 -0
- package/dist/components/Button/index.js +22 -0
- package/dist/components/{atoms/button → Button}/styles.js +30 -19
- package/dist/components/{atoms/checkbox → Checkbox}/Checkbox.d.ts +2 -1
- package/dist/components/Checkbox/Checkbox.js +70 -0
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +64 -0
- package/dist/components/Checkbox/index.js +49 -0
- package/dist/components/{atoms/checkbox → Checkbox}/styles.d.ts +1 -3
- package/dist/components/{atoms/checkbox → Checkbox}/styles.js +165 -157
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +72 -0
- package/dist/components/ErrorBoundaryFallback/index.js +51 -0
- package/dist/components/ErrorBoundaryFallback/styles.d.ts +3 -0
- package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/styles.js +38 -34
- package/dist/components/{molecules/form → Form}/Form.d.ts +2 -4
- package/dist/components/Form/Form.js +49 -0
- package/dist/components/Form/__stories__/FormStory.js +130 -0
- package/dist/components/Form/index.js +48 -0
- package/dist/components/{atoms/input → Input}/Input.d.ts +1 -3
- package/dist/components/Input/Input.js +42 -0
- package/dist/components/{atoms/input → Input}/__stories__/Input.stories.d.ts +5 -1
- package/dist/components/Input/__tests__/Input.test.d.ts +1 -0
- package/dist/components/Input/__tests__/Input.test.js +69 -0
- package/dist/components/Input/index.js +31 -0
- package/dist/components/{atoms/input → Input}/styles.d.ts +2 -3
- package/dist/components/Input/styles.js +542 -0
- package/dist/components/Message/Message.d.ts +13 -0
- package/dist/components/Message/Message.js +105 -0
- package/dist/components/Message/__stories__/Message.stories.d.ts +15 -0
- package/dist/components/Message/__tests__/Message.test.d.ts +1 -0
- package/dist/components/Message/__tests__/Message.test.js +88 -0
- package/dist/components/Message/index.d.ts +2 -0
- package/dist/components/Message/index.js +50 -0
- package/dist/components/Message/styles.d.ts +5 -0
- package/dist/components/Message/styles.js +35 -0
- package/dist/components/Notification/Notification.d.ts +16 -0
- package/dist/components/Notification/Notification.js +1436 -0
- package/dist/components/Notification/__stories__/Notification.stories.d.ts +10 -0
- package/dist/components/Notification/__tests__/Notification.test.d.ts +1 -0
- package/dist/components/Notification/__tests__/Notification.test.js +76 -0
- package/dist/components/Notification/index.d.ts +2 -0
- package/dist/components/Notification/index.js +61 -0
- package/dist/components/Notification/styles.d.ts +6 -0
- package/dist/components/Notification/styles.js +49 -0
- package/dist/components/Radio/Radio.d.ts +14 -0
- package/dist/components/Radio/Radio.js +114 -0
- package/dist/components/Radio/RadioGroup.d.ts +12 -0
- package/dist/components/Radio/RadioGroup.js +86 -0
- package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +9 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.d.ts +1 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.js +85 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +58 -0
- package/dist/components/Radio/states/RadioChecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioChecked.js +18 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.js +18 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.js +30 -0
- package/dist/components/Radio/states/RadioCheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedHover.js +18 -0
- package/dist/components/Radio/states/RadioUnchecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioUnchecked.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.js +29 -0
- package/dist/components/Radio/states/RadioUncheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedHover.js +18 -0
- package/dist/components/{atoms/select → Select}/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{atoms/select → Select}/__stories__/Select.stories.d.ts +3 -1
- package/dist/components/Select/__tests__/Select.test.d.ts +1 -0
- package/dist/components/Select/__tests__/Select.test.js +101 -0
- package/dist/components/Select/index.js +30 -0
- package/dist/components/{atoms/select → Select}/styles.d.ts +4 -1
- package/dist/components/Select/styles.js +3723 -0
- package/dist/components/Toast/Toast.d.ts +14 -0
- package/dist/components/Toast/Toast.js +48 -0
- package/dist/components/Toast/__stories__/Toast.stories.d.ts +15 -0
- package/dist/components/Toast/__tests__/Toast.test.d.ts +1 -0
- package/dist/components/Toast/__tests__/Toast.test.js +63 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.js +48 -0
- package/dist/components/Toast/styles.d.ts +5 -0
- package/dist/components/Toast/styles.js +39 -0
- package/dist/components/{atoms/typography → Typography}/Typography.d.ts +2 -1
- package/dist/components/Typography/Typography.js +48 -0
- package/dist/components/Typography/__tests__/Typography.test.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.js +60 -0
- package/dist/components/Typography/index.js +48 -0
- package/dist/components/Typography/styles.d.ts +7 -0
- package/dist/components/Typography/styles.js +55 -0
- package/dist/components/index.d.ts +18 -14
- package/dist/components/index.js +70 -14
- package/dist/constants/index.d.ts +104 -0
- package/dist/constants/index.js +41 -7
- package/dist/{context-CZsFJmh6.js → context-3b8a39af.js} +547 -536
- package/dist/genesis/GenesisThemeBreakdown.js +69 -22
- package/dist/genesis/GenesisThemeDemo.d.ts +0 -2
- package/dist/genesis/GenesisThemeDemo.js +53 -4
- package/dist/genesis/styles.d.ts +2 -6
- package/dist/genesis/styles.js +1144 -2210
- package/dist/index-0a886e53.js +100 -0
- package/dist/{index-SAAXFt-P.js → index-0b9ee239.js} +347 -338
- package/dist/index-1a33c134.js +1389 -0
- package/dist/index-4003d75b.js +3748 -0
- package/dist/{index-D1v_7IIx.js → index-501fc13d.js} +369 -343
- package/dist/index-89035ea5.js +3242 -0
- package/dist/{index-BQO27mgE.js → index-8c8d2d0c.js} +123 -122
- package/dist/{index-C7kFNqp2.js → index-e2b72ca8.js} +107 -102
- package/dist/index.d.ts +1 -0
- package/dist/index.js +77 -18
- package/dist/{isVisible-CNQjrJPN.js → isVisible-729780f5.js} +110 -82
- package/dist/{magic-string.es-BkUFmFT4.js → magic-string.es-b7491176.js} +103 -56
- package/dist/{SearchOutlined-DuzJkIiQ.js → pickAttrs-00ba4687.js} +16 -26
- package/dist/presets-83ccb923.js +787 -0
- package/dist/providers/GenesisProvider.d.ts +5 -0
- package/dist/providers/GenesisProvider.js +59 -5
- package/dist/providers/ThemeProvider.d.ts +2 -1
- package/dist/providers/ThemeProvider.js +16 -11
- package/dist/providers/ToastProvider.d.ts +6 -0
- package/dist/providers/ToastProvider.js +49 -0
- package/dist/providers/ToastWrapper.d.ts +7 -0
- package/dist/providers/ToastWrapper.js +56 -0
- package/dist/providers/__stories__/GenesisProvider.stories.d.ts +6 -0
- package/dist/providers/index.d.ts +3 -2
- package/dist/providers/index.js +51 -4
- package/dist/setup-aaca7b6f.js +21158 -0
- package/dist/{styled-components.browser.esm-CZ1XM4o4.js → styled-components.browser.esm-02f500bc.js} +134 -72
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +54 -18
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +51 -15
- package/dist/styles/design-tokens/variables.d.ts +7 -7
- package/dist/styles/design-tokens/variables.js +48 -48
- package/dist/styles/global-styles.js +4 -3
- package/dist/styles/theme/genesis-theme.d.ts +3 -0
- package/dist/styles/theme/genesis-theme.js +402 -263
- package/dist/styles/theme/global-styles.js +4 -3
- package/dist/styles/theme/index.js +5 -4
- package/dist/test/setup.js +46 -2
- package/dist/useVariants-a0d64298.js +30 -0
- package/dist/utils/isAllEnglishString.js +2 -1
- package/package.json +34 -28
- package/dist/AntdIcon-Bsnbyy6g.js +0 -200
- package/dist/CheckOutlined-DAynWe12.js +0 -527
- package/dist/Compact-CJBo3f0u.js +0 -185
- package/dist/ContextIsolator-CGkdKtc3.js +0 -20
- package/dist/Form-Cylpi4M4.js +0 -1815
- package/dist/Overflow-CP1M4Z0s.js +0 -369
- package/dist/compact-item-DH13cl8A.js +0 -61
- package/dist/components/atoms/button/Button.js +0 -27
- package/dist/components/atoms/button/index.js +0 -4
- package/dist/components/atoms/checkbox/Checkbox.js +0 -13
- package/dist/components/atoms/checkbox/__tests__/Checkbox.test.js +0 -18
- package/dist/components/atoms/checkbox/index.js +0 -4
- package/dist/components/atoms/index.d.ts +0 -1
- package/dist/components/atoms/index.js +0 -3
- package/dist/components/atoms/input/Input.js +0 -12
- package/dist/components/atoms/input/__tests__/Input.test.js +0 -28
- package/dist/components/atoms/input/index.js +0 -4
- package/dist/components/atoms/input/styles.js +0 -415
- package/dist/components/atoms/select/Select.js +0 -24
- package/dist/components/atoms/select/__tests__/Select.test.js +0 -10735
- package/dist/components/atoms/select/index.js +0 -4
- package/dist/components/atoms/select/styles.js +0 -3868
- package/dist/components/atoms/typography/Typography.js +0 -44
- package/dist/components/atoms/typography/__tests__/Typography.test.js +0 -16
- package/dist/components/atoms/typography/index.js +0 -4
- package/dist/components/atoms/typography/styles.d.ts +0 -11
- package/dist/components/atoms/typography/styles.js +0 -28
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.js +0 -35
- package/dist/components/molecules/error-boundary-fallback/index.js +0 -4
- package/dist/components/molecules/error-boundary-fallback/styles.d.ts +0 -1
- package/dist/components/molecules/form/Form.js +0 -7
- package/dist/components/molecules/form/__stories__/FormStory.js +0 -90
- package/dist/components/molecules/form/index.js +0 -4
- package/dist/index-3MWkSVA1.js +0 -96
- package/dist/index-BPtFqhcp.js +0 -19110
- package/dist/index-BWys7dkb.js +0 -4462
- package/dist/index-VDH3iLaC.js +0 -884
- package/dist/setup-CMYVZCPF.js +0 -33883
- package/dist/useVariants-CEpw6Ww6.js +0 -29
- /package/dist/components/{atoms/checkbox/__tests__/Checkbox.test.d.ts → Badge/__tests__/Badge.test.d.ts} +0 -0
- /package/dist/components/{atoms/input/__tests__/Input.test.d.ts → Breadcrumb/__tests__/Breadcrumb.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/Button.d.ts +0 -0
- /package/dist/components/{atoms/button → Button}/__stories__/Button.stories.d.ts +0 -0
- /package/dist/components/{atoms/select/__tests__/Select.test.d.ts → Button/__tests__/Button.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/index.d.ts +0 -0
- /package/dist/components/{atoms/button → Button}/styles.d.ts +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/__stories__/Checkbox.stories.d.ts +0 -0
- /package/dist/components/{atoms/typography/__tests__/Typography.test.d.ts → Checkbox/__tests__/Checkbox.test.d.ts} +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/index.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/ErrorBoundaryFallback.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/__stories__/ErrorBoundaryFallback.stories.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/index.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/Form.stories.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/FormStory.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/index.d.ts +0 -0
- /package/dist/components/{atoms/input → Input}/index.d.ts +0 -0
- /package/dist/components/{atoms/select → Select}/index.d.ts +0 -0
- /package/dist/components/{atoms/typography → Typography}/__stories__/Typography.stories.d.ts +0 -0
- /package/dist/components/{atoms/typography → Typography}/index.d.ts +0 -0
- /package/dist/{presetColors-Cl8UP3Nw.js → presetColors-ccf8cb4c.js} +0 -0
- /package/dist/{reactNode-sKPeiqPL.js → reactNode-f4391605.js} +0 -0
|
@@ -0,0 +1,1436 @@
|
|
|
1
|
+
import { jsxs as L, jsx as M } from "react/jsx-runtime";
|
|
2
|
+
import { SIZE as B, TYPOGRAPHY_VARIANT as Y, STATE as k } from "../../constants/index.js";
|
|
3
|
+
import "../Button/styles.js";
|
|
4
|
+
import "../../providers/ThemeProvider.js";
|
|
5
|
+
import "../Checkbox/styles.js";
|
|
6
|
+
import "../ErrorBoundaryFallback/styles.js";
|
|
7
|
+
import { T as R } from "../../index-89035ea5.js";
|
|
8
|
+
import "../Input/styles.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "../Select/styles.js";
|
|
11
|
+
import z from "../Badge/Badge.js";
|
|
12
|
+
import "../Toast/styles.js";
|
|
13
|
+
import { n as tt } from "../../styled-components.browser.esm-02f500bc.js";
|
|
14
|
+
import { NotificationRow as et, NotificationUnread as nt, NotificationContent as rt } from "./styles.js";
|
|
15
|
+
import { R as at } from "../../RightOutlined-83515eb4.js";
|
|
16
|
+
import "../../button-fa1c119c.js";
|
|
17
|
+
import "../../presets-83ccb923.js";
|
|
18
|
+
import "../../isVisible-729780f5.js";
|
|
19
|
+
import "../../index-4003d75b.js";
|
|
20
|
+
import "react-dom";
|
|
21
|
+
import "../../index-e2b72ca8.js";
|
|
22
|
+
import "../../reactNode-f4391605.js";
|
|
23
|
+
import "../../Compact-c39ed20d.js";
|
|
24
|
+
import "../../presetColors-ccf8cb4c.js";
|
|
25
|
+
import "../../compact-item-b8f85aa6.js";
|
|
26
|
+
import "../../AntdIcon-c395a1c4.js";
|
|
27
|
+
import "../../styles/theme/genesis-theme.js";
|
|
28
|
+
import "../../styles/design-tokens/variables.js";
|
|
29
|
+
import "../../context-3b8a39af.js";
|
|
30
|
+
import "../../ExclamationCircleFilled-23ef9812.js";
|
|
31
|
+
import "../../CloseCircleFilled-ddc51e7e.js";
|
|
32
|
+
import "../Typography/styles.js";
|
|
33
|
+
import "../../index-501fc13d.js";
|
|
34
|
+
import "../../index-8c8d2d0c.js";
|
|
35
|
+
import "../../CheckOutlined-52d9ac25.js";
|
|
36
|
+
import "../../index-0b9ee239.js";
|
|
37
|
+
import "../../index-1a33c134.js";
|
|
38
|
+
import "../../ContextIsolator-b09b2c52.js";
|
|
39
|
+
import "../../TextArea-20825221.js";
|
|
40
|
+
import "../../useVariants-a0d64298.js";
|
|
41
|
+
import "../Badge/styles.js";
|
|
42
|
+
import "../../CloseOutlined-14b8bba1.js";
|
|
43
|
+
import "../../InfoCircleFilled-c5f90c20.js";
|
|
44
|
+
import "../../pickAttrs-00ba4687.js";
|
|
45
|
+
import "../../collapse-345bc884.js";
|
|
46
|
+
import "../../SearchOutlined-a9014e08.js";
|
|
47
|
+
import "../../Overflow-a570fa69.js";
|
|
48
|
+
import "../../DownOutlined-64a4732a.js";
|
|
49
|
+
import "../Badge/icons/Appointment.js";
|
|
50
|
+
import "../Badge/icons/ASN.js";
|
|
51
|
+
import "../Badge/icons/Inventory.js";
|
|
52
|
+
import "../Badge/icons/Parcel.js";
|
|
53
|
+
import "../Badge/icons/Product.js";
|
|
54
|
+
import "../Badge/icons/Route.js";
|
|
55
|
+
import "../Badge/icons/Shipment.js";
|
|
56
|
+
import "../Badge/icons/ShoppingCart.js";
|
|
57
|
+
import "../Badge/icons/System.js";
|
|
58
|
+
function d(t) {
|
|
59
|
+
const e = Object.prototype.toString.call(t);
|
|
60
|
+
return t instanceof Date || typeof t == "object" && e === "[object Date]" ? new t.constructor(+t) : typeof t == "number" || e === "[object Number]" || typeof t == "string" || e === "[object String]" ? new Date(t) : /* @__PURE__ */ new Date(NaN);
|
|
61
|
+
}
|
|
62
|
+
function O(t, e) {
|
|
63
|
+
return t instanceof Date ? new t.constructor(e) : new Date(e);
|
|
64
|
+
}
|
|
65
|
+
const $ = 6048e5, ot = 864e5, E = 43200, j = 1440;
|
|
66
|
+
let it = {};
|
|
67
|
+
function W() {
|
|
68
|
+
return it;
|
|
69
|
+
}
|
|
70
|
+
function T(t, e) {
|
|
71
|
+
var i, c, f, m;
|
|
72
|
+
const n = W(), r = (e == null ? void 0 : e.weekStartsOn) ?? ((c = (i = e == null ? void 0 : e.locale) == null ? void 0 : i.options) == null ? void 0 : c.weekStartsOn) ?? n.weekStartsOn ?? ((m = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : m.weekStartsOn) ?? 0, a = d(t), o = a.getDay(), s = (o < r ? 7 : 0) + o - r;
|
|
73
|
+
return a.setDate(a.getDate() - s), a.setHours(0, 0, 0, 0), a;
|
|
74
|
+
}
|
|
75
|
+
function N(t) {
|
|
76
|
+
return T(t, { weekStartsOn: 1 });
|
|
77
|
+
}
|
|
78
|
+
function J(t) {
|
|
79
|
+
const e = d(t), n = e.getFullYear(), r = O(t, 0);
|
|
80
|
+
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
81
|
+
const a = N(r), o = O(t, 0);
|
|
82
|
+
o.setFullYear(n, 0, 4), o.setHours(0, 0, 0, 0);
|
|
83
|
+
const s = N(o);
|
|
84
|
+
return e.getTime() >= a.getTime() ? n + 1 : e.getTime() >= s.getTime() ? n : n - 1;
|
|
85
|
+
}
|
|
86
|
+
function I(t) {
|
|
87
|
+
const e = d(t);
|
|
88
|
+
return e.setHours(0, 0, 0, 0), e;
|
|
89
|
+
}
|
|
90
|
+
function C(t) {
|
|
91
|
+
const e = d(t), n = new Date(
|
|
92
|
+
Date.UTC(
|
|
93
|
+
e.getFullYear(),
|
|
94
|
+
e.getMonth(),
|
|
95
|
+
e.getDate(),
|
|
96
|
+
e.getHours(),
|
|
97
|
+
e.getMinutes(),
|
|
98
|
+
e.getSeconds(),
|
|
99
|
+
e.getMilliseconds()
|
|
100
|
+
)
|
|
101
|
+
);
|
|
102
|
+
return n.setUTCFullYear(e.getFullYear()), +t - +n;
|
|
103
|
+
}
|
|
104
|
+
function st(t, e) {
|
|
105
|
+
const n = I(t), r = I(e), a = +n - C(n), o = +r - C(r);
|
|
106
|
+
return Math.round((a - o) / ot);
|
|
107
|
+
}
|
|
108
|
+
function ct(t) {
|
|
109
|
+
const e = J(t), n = O(t, 0);
|
|
110
|
+
return n.setFullYear(e, 0, 4), n.setHours(0, 0, 0, 0), N(n);
|
|
111
|
+
}
|
|
112
|
+
function F(t, e) {
|
|
113
|
+
const n = d(t), r = d(e), a = n.getTime() - r.getTime();
|
|
114
|
+
return a < 0 ? -1 : a > 0 ? 1 : a;
|
|
115
|
+
}
|
|
116
|
+
function ut(t) {
|
|
117
|
+
return O(t, Date.now());
|
|
118
|
+
}
|
|
119
|
+
function dt(t) {
|
|
120
|
+
return t instanceof Date || typeof t == "object" && Object.prototype.toString.call(t) === "[object Date]";
|
|
121
|
+
}
|
|
122
|
+
function ft(t) {
|
|
123
|
+
if (!dt(t) && typeof t != "number")
|
|
124
|
+
return !1;
|
|
125
|
+
const e = d(t);
|
|
126
|
+
return !isNaN(Number(e));
|
|
127
|
+
}
|
|
128
|
+
function mt(t, e) {
|
|
129
|
+
const n = d(t), r = d(e), a = n.getFullYear() - r.getFullYear(), o = n.getMonth() - r.getMonth();
|
|
130
|
+
return a * 12 + o;
|
|
131
|
+
}
|
|
132
|
+
function lt(t) {
|
|
133
|
+
return (e) => {
|
|
134
|
+
const r = (t ? Math[t] : Math.trunc)(e);
|
|
135
|
+
return r === 0 ? 0 : r;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
function ht(t, e) {
|
|
139
|
+
return +d(t) - +d(e);
|
|
140
|
+
}
|
|
141
|
+
function gt(t) {
|
|
142
|
+
const e = d(t);
|
|
143
|
+
return e.setHours(23, 59, 59, 999), e;
|
|
144
|
+
}
|
|
145
|
+
function wt(t) {
|
|
146
|
+
const e = d(t), n = e.getMonth();
|
|
147
|
+
return e.setFullYear(e.getFullYear(), n + 1, 0), e.setHours(23, 59, 59, 999), e;
|
|
148
|
+
}
|
|
149
|
+
function yt(t) {
|
|
150
|
+
const e = d(t);
|
|
151
|
+
return +gt(e) == +wt(e);
|
|
152
|
+
}
|
|
153
|
+
function bt(t, e) {
|
|
154
|
+
const n = d(t), r = d(e), a = F(n, r), o = Math.abs(
|
|
155
|
+
mt(n, r)
|
|
156
|
+
);
|
|
157
|
+
let s;
|
|
158
|
+
if (o < 1)
|
|
159
|
+
s = 0;
|
|
160
|
+
else {
|
|
161
|
+
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * o);
|
|
162
|
+
let i = F(n, r) === -a;
|
|
163
|
+
yt(d(t)) && o === 1 && F(t, r) === 1 && (i = !1), s = a * (o - Number(i));
|
|
164
|
+
}
|
|
165
|
+
return s === 0 ? 0 : s;
|
|
166
|
+
}
|
|
167
|
+
function Mt(t, e, n) {
|
|
168
|
+
const r = ht(t, e) / 1e3;
|
|
169
|
+
return lt(n == null ? void 0 : n.roundingMethod)(r);
|
|
170
|
+
}
|
|
171
|
+
function Dt(t) {
|
|
172
|
+
const e = d(t), n = O(t, 0);
|
|
173
|
+
return n.setFullYear(e.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
174
|
+
}
|
|
175
|
+
const pt = {
|
|
176
|
+
lessThanXSeconds: {
|
|
177
|
+
one: "less than a second",
|
|
178
|
+
other: "less than {{count}} seconds"
|
|
179
|
+
},
|
|
180
|
+
xSeconds: {
|
|
181
|
+
one: "1 second",
|
|
182
|
+
other: "{{count}} seconds"
|
|
183
|
+
},
|
|
184
|
+
halfAMinute: "half a minute",
|
|
185
|
+
lessThanXMinutes: {
|
|
186
|
+
one: "less than a minute",
|
|
187
|
+
other: "less than {{count}} minutes"
|
|
188
|
+
},
|
|
189
|
+
xMinutes: {
|
|
190
|
+
one: "1 minute",
|
|
191
|
+
other: "{{count}} minutes"
|
|
192
|
+
},
|
|
193
|
+
aboutXHours: {
|
|
194
|
+
one: "about 1 hour",
|
|
195
|
+
other: "about {{count}} hours"
|
|
196
|
+
},
|
|
197
|
+
xHours: {
|
|
198
|
+
one: "1 hour",
|
|
199
|
+
other: "{{count}} hours"
|
|
200
|
+
},
|
|
201
|
+
xDays: {
|
|
202
|
+
one: "1 day",
|
|
203
|
+
other: "{{count}} days"
|
|
204
|
+
},
|
|
205
|
+
aboutXWeeks: {
|
|
206
|
+
one: "about 1 week",
|
|
207
|
+
other: "about {{count}} weeks"
|
|
208
|
+
},
|
|
209
|
+
xWeeks: {
|
|
210
|
+
one: "1 week",
|
|
211
|
+
other: "{{count}} weeks"
|
|
212
|
+
},
|
|
213
|
+
aboutXMonths: {
|
|
214
|
+
one: "about 1 month",
|
|
215
|
+
other: "about {{count}} months"
|
|
216
|
+
},
|
|
217
|
+
xMonths: {
|
|
218
|
+
one: "1 month",
|
|
219
|
+
other: "{{count}} months"
|
|
220
|
+
},
|
|
221
|
+
aboutXYears: {
|
|
222
|
+
one: "about 1 year",
|
|
223
|
+
other: "about {{count}} years"
|
|
224
|
+
},
|
|
225
|
+
xYears: {
|
|
226
|
+
one: "1 year",
|
|
227
|
+
other: "{{count}} years"
|
|
228
|
+
},
|
|
229
|
+
overXYears: {
|
|
230
|
+
one: "over 1 year",
|
|
231
|
+
other: "over {{count}} years"
|
|
232
|
+
},
|
|
233
|
+
almostXYears: {
|
|
234
|
+
one: "almost 1 year",
|
|
235
|
+
other: "almost {{count}} years"
|
|
236
|
+
}
|
|
237
|
+
}, Ot = (t, e, n) => {
|
|
238
|
+
let r;
|
|
239
|
+
const a = pt[t];
|
|
240
|
+
return typeof a == "string" ? r = a : e === 1 ? r = a.one : r = a.other.replace("{{count}}", e.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
241
|
+
};
|
|
242
|
+
function X(t) {
|
|
243
|
+
return (e = {}) => {
|
|
244
|
+
const n = e.width ? String(e.width) : t.defaultWidth;
|
|
245
|
+
return t.formats[n] || t.formats[t.defaultWidth];
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
const Pt = {
|
|
249
|
+
full: "EEEE, MMMM do, y",
|
|
250
|
+
long: "MMMM do, y",
|
|
251
|
+
medium: "MMM d, y",
|
|
252
|
+
short: "MM/dd/yyyy"
|
|
253
|
+
}, xt = {
|
|
254
|
+
full: "h:mm:ss a zzzz",
|
|
255
|
+
long: "h:mm:ss a z",
|
|
256
|
+
medium: "h:mm:ss a",
|
|
257
|
+
short: "h:mm a"
|
|
258
|
+
}, kt = {
|
|
259
|
+
full: "{{date}} 'at' {{time}}",
|
|
260
|
+
long: "{{date}} 'at' {{time}}",
|
|
261
|
+
medium: "{{date}}, {{time}}",
|
|
262
|
+
short: "{{date}}, {{time}}"
|
|
263
|
+
}, vt = {
|
|
264
|
+
date: X({
|
|
265
|
+
formats: Pt,
|
|
266
|
+
defaultWidth: "full"
|
|
267
|
+
}),
|
|
268
|
+
time: X({
|
|
269
|
+
formats: xt,
|
|
270
|
+
defaultWidth: "full"
|
|
271
|
+
}),
|
|
272
|
+
dateTime: X({
|
|
273
|
+
formats: kt,
|
|
274
|
+
defaultWidth: "full"
|
|
275
|
+
})
|
|
276
|
+
}, St = {
|
|
277
|
+
lastWeek: "'last' eeee 'at' p",
|
|
278
|
+
yesterday: "'yesterday at' p",
|
|
279
|
+
today: "'today at' p",
|
|
280
|
+
tomorrow: "'tomorrow at' p",
|
|
281
|
+
nextWeek: "eeee 'at' p",
|
|
282
|
+
other: "P"
|
|
283
|
+
}, Tt = (t, e, n, r) => St[t];
|
|
284
|
+
function v(t) {
|
|
285
|
+
return (e, n) => {
|
|
286
|
+
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
287
|
+
let a;
|
|
288
|
+
if (r === "formatting" && t.formattingValues) {
|
|
289
|
+
const s = t.defaultFormattingWidth || t.defaultWidth, i = n != null && n.width ? String(n.width) : s;
|
|
290
|
+
a = t.formattingValues[i] || t.formattingValues[s];
|
|
291
|
+
} else {
|
|
292
|
+
const s = t.defaultWidth, i = n != null && n.width ? String(n.width) : t.defaultWidth;
|
|
293
|
+
a = t.values[i] || t.values[s];
|
|
294
|
+
}
|
|
295
|
+
const o = t.argumentCallback ? t.argumentCallback(e) : e;
|
|
296
|
+
return a[o];
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
const Wt = {
|
|
300
|
+
narrow: ["B", "A"],
|
|
301
|
+
abbreviated: ["BC", "AD"],
|
|
302
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
303
|
+
}, Yt = {
|
|
304
|
+
narrow: ["1", "2", "3", "4"],
|
|
305
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
306
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
307
|
+
}, Et = {
|
|
308
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
309
|
+
abbreviated: [
|
|
310
|
+
"Jan",
|
|
311
|
+
"Feb",
|
|
312
|
+
"Mar",
|
|
313
|
+
"Apr",
|
|
314
|
+
"May",
|
|
315
|
+
"Jun",
|
|
316
|
+
"Jul",
|
|
317
|
+
"Aug",
|
|
318
|
+
"Sep",
|
|
319
|
+
"Oct",
|
|
320
|
+
"Nov",
|
|
321
|
+
"Dec"
|
|
322
|
+
],
|
|
323
|
+
wide: [
|
|
324
|
+
"January",
|
|
325
|
+
"February",
|
|
326
|
+
"March",
|
|
327
|
+
"April",
|
|
328
|
+
"May",
|
|
329
|
+
"June",
|
|
330
|
+
"July",
|
|
331
|
+
"August",
|
|
332
|
+
"September",
|
|
333
|
+
"October",
|
|
334
|
+
"November",
|
|
335
|
+
"December"
|
|
336
|
+
]
|
|
337
|
+
}, Ft = {
|
|
338
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
339
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
340
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
341
|
+
wide: [
|
|
342
|
+
"Sunday",
|
|
343
|
+
"Monday",
|
|
344
|
+
"Tuesday",
|
|
345
|
+
"Wednesday",
|
|
346
|
+
"Thursday",
|
|
347
|
+
"Friday",
|
|
348
|
+
"Saturday"
|
|
349
|
+
]
|
|
350
|
+
}, Nt = {
|
|
351
|
+
narrow: {
|
|
352
|
+
am: "a",
|
|
353
|
+
pm: "p",
|
|
354
|
+
midnight: "mi",
|
|
355
|
+
noon: "n",
|
|
356
|
+
morning: "morning",
|
|
357
|
+
afternoon: "afternoon",
|
|
358
|
+
evening: "evening",
|
|
359
|
+
night: "night"
|
|
360
|
+
},
|
|
361
|
+
abbreviated: {
|
|
362
|
+
am: "AM",
|
|
363
|
+
pm: "PM",
|
|
364
|
+
midnight: "midnight",
|
|
365
|
+
noon: "noon",
|
|
366
|
+
morning: "morning",
|
|
367
|
+
afternoon: "afternoon",
|
|
368
|
+
evening: "evening",
|
|
369
|
+
night: "night"
|
|
370
|
+
},
|
|
371
|
+
wide: {
|
|
372
|
+
am: "a.m.",
|
|
373
|
+
pm: "p.m.",
|
|
374
|
+
midnight: "midnight",
|
|
375
|
+
noon: "noon",
|
|
376
|
+
morning: "morning",
|
|
377
|
+
afternoon: "afternoon",
|
|
378
|
+
evening: "evening",
|
|
379
|
+
night: "night"
|
|
380
|
+
}
|
|
381
|
+
}, Ct = {
|
|
382
|
+
narrow: {
|
|
383
|
+
am: "a",
|
|
384
|
+
pm: "p",
|
|
385
|
+
midnight: "mi",
|
|
386
|
+
noon: "n",
|
|
387
|
+
morning: "in the morning",
|
|
388
|
+
afternoon: "in the afternoon",
|
|
389
|
+
evening: "in the evening",
|
|
390
|
+
night: "at night"
|
|
391
|
+
},
|
|
392
|
+
abbreviated: {
|
|
393
|
+
am: "AM",
|
|
394
|
+
pm: "PM",
|
|
395
|
+
midnight: "midnight",
|
|
396
|
+
noon: "noon",
|
|
397
|
+
morning: "in the morning",
|
|
398
|
+
afternoon: "in the afternoon",
|
|
399
|
+
evening: "in the evening",
|
|
400
|
+
night: "at night"
|
|
401
|
+
},
|
|
402
|
+
wide: {
|
|
403
|
+
am: "a.m.",
|
|
404
|
+
pm: "p.m.",
|
|
405
|
+
midnight: "midnight",
|
|
406
|
+
noon: "noon",
|
|
407
|
+
morning: "in the morning",
|
|
408
|
+
afternoon: "in the afternoon",
|
|
409
|
+
evening: "in the evening",
|
|
410
|
+
night: "at night"
|
|
411
|
+
}
|
|
412
|
+
}, qt = (t, e) => {
|
|
413
|
+
const n = Number(t), r = n % 100;
|
|
414
|
+
if (r > 20 || r < 10)
|
|
415
|
+
switch (r % 10) {
|
|
416
|
+
case 1:
|
|
417
|
+
return n + "st";
|
|
418
|
+
case 2:
|
|
419
|
+
return n + "nd";
|
|
420
|
+
case 3:
|
|
421
|
+
return n + "rd";
|
|
422
|
+
}
|
|
423
|
+
return n + "th";
|
|
424
|
+
}, Rt = {
|
|
425
|
+
ordinalNumber: qt,
|
|
426
|
+
era: v({
|
|
427
|
+
values: Wt,
|
|
428
|
+
defaultWidth: "wide"
|
|
429
|
+
}),
|
|
430
|
+
quarter: v({
|
|
431
|
+
values: Yt,
|
|
432
|
+
defaultWidth: "wide",
|
|
433
|
+
argumentCallback: (t) => t - 1
|
|
434
|
+
}),
|
|
435
|
+
month: v({
|
|
436
|
+
values: Et,
|
|
437
|
+
defaultWidth: "wide"
|
|
438
|
+
}),
|
|
439
|
+
day: v({
|
|
440
|
+
values: Ft,
|
|
441
|
+
defaultWidth: "wide"
|
|
442
|
+
}),
|
|
443
|
+
dayPeriod: v({
|
|
444
|
+
values: Nt,
|
|
445
|
+
defaultWidth: "wide",
|
|
446
|
+
formattingValues: Ct,
|
|
447
|
+
defaultFormattingWidth: "wide"
|
|
448
|
+
})
|
|
449
|
+
};
|
|
450
|
+
function S(t) {
|
|
451
|
+
return (e, n = {}) => {
|
|
452
|
+
const r = n.width, a = r && t.matchPatterns[r] || t.matchPatterns[t.defaultMatchWidth], o = e.match(a);
|
|
453
|
+
if (!o)
|
|
454
|
+
return null;
|
|
455
|
+
const s = o[0], i = r && t.parsePatterns[r] || t.parsePatterns[t.defaultParseWidth], c = Array.isArray(i) ? _t(i, (w) => w.test(s)) : (
|
|
456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
457
|
+
Xt(i, (w) => w.test(s))
|
|
458
|
+
);
|
|
459
|
+
let f;
|
|
460
|
+
f = t.valueCallback ? t.valueCallback(c) : c, f = n.valueCallback ? (
|
|
461
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
462
|
+
n.valueCallback(f)
|
|
463
|
+
) : f;
|
|
464
|
+
const m = e.slice(s.length);
|
|
465
|
+
return { value: f, rest: m };
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
function Xt(t, e) {
|
|
469
|
+
for (const n in t)
|
|
470
|
+
if (Object.prototype.hasOwnProperty.call(t, n) && e(t[n]))
|
|
471
|
+
return n;
|
|
472
|
+
}
|
|
473
|
+
function _t(t, e) {
|
|
474
|
+
for (let n = 0; n < t.length; n++)
|
|
475
|
+
if (e(t[n]))
|
|
476
|
+
return n;
|
|
477
|
+
}
|
|
478
|
+
function Ht(t) {
|
|
479
|
+
return (e, n = {}) => {
|
|
480
|
+
const r = e.match(t.matchPattern);
|
|
481
|
+
if (!r)
|
|
482
|
+
return null;
|
|
483
|
+
const a = r[0], o = e.match(t.parsePattern);
|
|
484
|
+
if (!o)
|
|
485
|
+
return null;
|
|
486
|
+
let s = t.valueCallback ? t.valueCallback(o[0]) : o[0];
|
|
487
|
+
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
488
|
+
const i = e.slice(a.length);
|
|
489
|
+
return { value: s, rest: i };
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
const Lt = /^(\d+)(th|st|nd|rd)?/i, Bt = /\d+/i, jt = {
|
|
493
|
+
narrow: /^(b|a)/i,
|
|
494
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
495
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
496
|
+
}, It = {
|
|
497
|
+
any: [/^b/i, /^(a|c)/i]
|
|
498
|
+
}, At = {
|
|
499
|
+
narrow: /^[1234]/i,
|
|
500
|
+
abbreviated: /^q[1234]/i,
|
|
501
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
502
|
+
}, Qt = {
|
|
503
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
504
|
+
}, Gt = {
|
|
505
|
+
narrow: /^[jfmasond]/i,
|
|
506
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
507
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
508
|
+
}, Vt = {
|
|
509
|
+
narrow: [
|
|
510
|
+
/^j/i,
|
|
511
|
+
/^f/i,
|
|
512
|
+
/^m/i,
|
|
513
|
+
/^a/i,
|
|
514
|
+
/^m/i,
|
|
515
|
+
/^j/i,
|
|
516
|
+
/^j/i,
|
|
517
|
+
/^a/i,
|
|
518
|
+
/^s/i,
|
|
519
|
+
/^o/i,
|
|
520
|
+
/^n/i,
|
|
521
|
+
/^d/i
|
|
522
|
+
],
|
|
523
|
+
any: [
|
|
524
|
+
/^ja/i,
|
|
525
|
+
/^f/i,
|
|
526
|
+
/^mar/i,
|
|
527
|
+
/^ap/i,
|
|
528
|
+
/^may/i,
|
|
529
|
+
/^jun/i,
|
|
530
|
+
/^jul/i,
|
|
531
|
+
/^au/i,
|
|
532
|
+
/^s/i,
|
|
533
|
+
/^o/i,
|
|
534
|
+
/^n/i,
|
|
535
|
+
/^d/i
|
|
536
|
+
]
|
|
537
|
+
}, $t = {
|
|
538
|
+
narrow: /^[smtwf]/i,
|
|
539
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
540
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
541
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
542
|
+
}, Jt = {
|
|
543
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
544
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
545
|
+
}, Ut = {
|
|
546
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
547
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
548
|
+
}, Kt = {
|
|
549
|
+
any: {
|
|
550
|
+
am: /^a/i,
|
|
551
|
+
pm: /^p/i,
|
|
552
|
+
midnight: /^mi/i,
|
|
553
|
+
noon: /^no/i,
|
|
554
|
+
morning: /morning/i,
|
|
555
|
+
afternoon: /afternoon/i,
|
|
556
|
+
evening: /evening/i,
|
|
557
|
+
night: /night/i
|
|
558
|
+
}
|
|
559
|
+
}, Zt = {
|
|
560
|
+
ordinalNumber: Ht({
|
|
561
|
+
matchPattern: Lt,
|
|
562
|
+
parsePattern: Bt,
|
|
563
|
+
valueCallback: (t) => parseInt(t, 10)
|
|
564
|
+
}),
|
|
565
|
+
era: S({
|
|
566
|
+
matchPatterns: jt,
|
|
567
|
+
defaultMatchWidth: "wide",
|
|
568
|
+
parsePatterns: It,
|
|
569
|
+
defaultParseWidth: "any"
|
|
570
|
+
}),
|
|
571
|
+
quarter: S({
|
|
572
|
+
matchPatterns: At,
|
|
573
|
+
defaultMatchWidth: "wide",
|
|
574
|
+
parsePatterns: Qt,
|
|
575
|
+
defaultParseWidth: "any",
|
|
576
|
+
valueCallback: (t) => t + 1
|
|
577
|
+
}),
|
|
578
|
+
month: S({
|
|
579
|
+
matchPatterns: Gt,
|
|
580
|
+
defaultMatchWidth: "wide",
|
|
581
|
+
parsePatterns: Vt,
|
|
582
|
+
defaultParseWidth: "any"
|
|
583
|
+
}),
|
|
584
|
+
day: S({
|
|
585
|
+
matchPatterns: $t,
|
|
586
|
+
defaultMatchWidth: "wide",
|
|
587
|
+
parsePatterns: Jt,
|
|
588
|
+
defaultParseWidth: "any"
|
|
589
|
+
}),
|
|
590
|
+
dayPeriod: S({
|
|
591
|
+
matchPatterns: Ut,
|
|
592
|
+
defaultMatchWidth: "any",
|
|
593
|
+
parsePatterns: Kt,
|
|
594
|
+
defaultParseWidth: "any"
|
|
595
|
+
})
|
|
596
|
+
}, U = {
|
|
597
|
+
code: "en-US",
|
|
598
|
+
formatDistance: Ot,
|
|
599
|
+
formatLong: vt,
|
|
600
|
+
formatRelative: Tt,
|
|
601
|
+
localize: Rt,
|
|
602
|
+
match: Zt,
|
|
603
|
+
options: {
|
|
604
|
+
weekStartsOn: 0,
|
|
605
|
+
firstWeekContainsDate: 1
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
function zt(t) {
|
|
609
|
+
const e = d(t);
|
|
610
|
+
return st(e, Dt(e)) + 1;
|
|
611
|
+
}
|
|
612
|
+
function te(t) {
|
|
613
|
+
const e = d(t), n = +N(e) - +ct(e);
|
|
614
|
+
return Math.round(n / $) + 1;
|
|
615
|
+
}
|
|
616
|
+
function K(t, e) {
|
|
617
|
+
var m, w, l, h;
|
|
618
|
+
const n = d(t), r = n.getFullYear(), a = W(), o = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((w = (m = e == null ? void 0 : e.locale) == null ? void 0 : m.options) == null ? void 0 : w.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((h = (l = a.locale) == null ? void 0 : l.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, s = O(t, 0);
|
|
619
|
+
s.setFullYear(r + 1, 0, o), s.setHours(0, 0, 0, 0);
|
|
620
|
+
const i = T(s, e), c = O(t, 0);
|
|
621
|
+
c.setFullYear(r, 0, o), c.setHours(0, 0, 0, 0);
|
|
622
|
+
const f = T(c, e);
|
|
623
|
+
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= f.getTime() ? r : r - 1;
|
|
624
|
+
}
|
|
625
|
+
function ee(t, e) {
|
|
626
|
+
var i, c, f, m;
|
|
627
|
+
const n = W(), r = (e == null ? void 0 : e.firstWeekContainsDate) ?? ((c = (i = e == null ? void 0 : e.locale) == null ? void 0 : i.options) == null ? void 0 : c.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((m = (f = n.locale) == null ? void 0 : f.options) == null ? void 0 : m.firstWeekContainsDate) ?? 1, a = K(t, e), o = O(t, 0);
|
|
628
|
+
return o.setFullYear(a, 0, r), o.setHours(0, 0, 0, 0), T(o, e);
|
|
629
|
+
}
|
|
630
|
+
function ne(t, e) {
|
|
631
|
+
const n = d(t), r = +T(n, e) - +ee(n, e);
|
|
632
|
+
return Math.round(r / $) + 1;
|
|
633
|
+
}
|
|
634
|
+
function u(t, e) {
|
|
635
|
+
const n = t < 0 ? "-" : "", r = Math.abs(t).toString().padStart(e, "0");
|
|
636
|
+
return n + r;
|
|
637
|
+
}
|
|
638
|
+
const p = {
|
|
639
|
+
// Year
|
|
640
|
+
y(t, e) {
|
|
641
|
+
const n = t.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
642
|
+
return u(e === "yy" ? r % 100 : r, e.length);
|
|
643
|
+
},
|
|
644
|
+
// Month
|
|
645
|
+
M(t, e) {
|
|
646
|
+
const n = t.getMonth();
|
|
647
|
+
return e === "M" ? String(n + 1) : u(n + 1, 2);
|
|
648
|
+
},
|
|
649
|
+
// Day of the month
|
|
650
|
+
d(t, e) {
|
|
651
|
+
return u(t.getDate(), e.length);
|
|
652
|
+
},
|
|
653
|
+
// AM or PM
|
|
654
|
+
a(t, e) {
|
|
655
|
+
const n = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
656
|
+
switch (e) {
|
|
657
|
+
case "a":
|
|
658
|
+
case "aa":
|
|
659
|
+
return n.toUpperCase();
|
|
660
|
+
case "aaa":
|
|
661
|
+
return n;
|
|
662
|
+
case "aaaaa":
|
|
663
|
+
return n[0];
|
|
664
|
+
case "aaaa":
|
|
665
|
+
default:
|
|
666
|
+
return n === "am" ? "a.m." : "p.m.";
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
// Hour [1-12]
|
|
670
|
+
h(t, e) {
|
|
671
|
+
return u(t.getHours() % 12 || 12, e.length);
|
|
672
|
+
},
|
|
673
|
+
// Hour [0-23]
|
|
674
|
+
H(t, e) {
|
|
675
|
+
return u(t.getHours(), e.length);
|
|
676
|
+
},
|
|
677
|
+
// Minute
|
|
678
|
+
m(t, e) {
|
|
679
|
+
return u(t.getMinutes(), e.length);
|
|
680
|
+
},
|
|
681
|
+
// Second
|
|
682
|
+
s(t, e) {
|
|
683
|
+
return u(t.getSeconds(), e.length);
|
|
684
|
+
},
|
|
685
|
+
// Fraction of second
|
|
686
|
+
S(t, e) {
|
|
687
|
+
const n = e.length, r = t.getMilliseconds(), a = Math.trunc(
|
|
688
|
+
r * Math.pow(10, n - 3)
|
|
689
|
+
);
|
|
690
|
+
return u(a, e.length);
|
|
691
|
+
}
|
|
692
|
+
}, x = {
|
|
693
|
+
am: "am",
|
|
694
|
+
pm: "pm",
|
|
695
|
+
midnight: "midnight",
|
|
696
|
+
noon: "noon",
|
|
697
|
+
morning: "morning",
|
|
698
|
+
afternoon: "afternoon",
|
|
699
|
+
evening: "evening",
|
|
700
|
+
night: "night"
|
|
701
|
+
}, A = {
|
|
702
|
+
// Era
|
|
703
|
+
G: function(t, e, n) {
|
|
704
|
+
const r = t.getFullYear() > 0 ? 1 : 0;
|
|
705
|
+
switch (e) {
|
|
706
|
+
case "G":
|
|
707
|
+
case "GG":
|
|
708
|
+
case "GGG":
|
|
709
|
+
return n.era(r, { width: "abbreviated" });
|
|
710
|
+
case "GGGGG":
|
|
711
|
+
return n.era(r, { width: "narrow" });
|
|
712
|
+
case "GGGG":
|
|
713
|
+
default:
|
|
714
|
+
return n.era(r, { width: "wide" });
|
|
715
|
+
}
|
|
716
|
+
},
|
|
717
|
+
// Year
|
|
718
|
+
y: function(t, e, n) {
|
|
719
|
+
if (e === "yo") {
|
|
720
|
+
const r = t.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
721
|
+
return n.ordinalNumber(a, { unit: "year" });
|
|
722
|
+
}
|
|
723
|
+
return p.y(t, e);
|
|
724
|
+
},
|
|
725
|
+
// Local week-numbering year
|
|
726
|
+
Y: function(t, e, n, r) {
|
|
727
|
+
const a = K(t, r), o = a > 0 ? a : 1 - a;
|
|
728
|
+
if (e === "YY") {
|
|
729
|
+
const s = o % 100;
|
|
730
|
+
return u(s, 2);
|
|
731
|
+
}
|
|
732
|
+
return e === "Yo" ? n.ordinalNumber(o, { unit: "year" }) : u(o, e.length);
|
|
733
|
+
},
|
|
734
|
+
// ISO week-numbering year
|
|
735
|
+
R: function(t, e) {
|
|
736
|
+
const n = J(t);
|
|
737
|
+
return u(n, e.length);
|
|
738
|
+
},
|
|
739
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
740
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
741
|
+
// | Year | `y` | `u` |
|
|
742
|
+
// |------|-----|-----|
|
|
743
|
+
// | AC 1 | 1 | 1 |
|
|
744
|
+
// | BC 1 | 1 | 0 |
|
|
745
|
+
// | BC 2 | 2 | -1 |
|
|
746
|
+
// Also `yy` always returns the last two digits of a year,
|
|
747
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
748
|
+
u: function(t, e) {
|
|
749
|
+
const n = t.getFullYear();
|
|
750
|
+
return u(n, e.length);
|
|
751
|
+
},
|
|
752
|
+
// Quarter
|
|
753
|
+
Q: function(t, e, n) {
|
|
754
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
755
|
+
switch (e) {
|
|
756
|
+
case "Q":
|
|
757
|
+
return String(r);
|
|
758
|
+
case "QQ":
|
|
759
|
+
return u(r, 2);
|
|
760
|
+
case "Qo":
|
|
761
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
762
|
+
case "QQQ":
|
|
763
|
+
return n.quarter(r, {
|
|
764
|
+
width: "abbreviated",
|
|
765
|
+
context: "formatting"
|
|
766
|
+
});
|
|
767
|
+
case "QQQQQ":
|
|
768
|
+
return n.quarter(r, {
|
|
769
|
+
width: "narrow",
|
|
770
|
+
context: "formatting"
|
|
771
|
+
});
|
|
772
|
+
case "QQQQ":
|
|
773
|
+
default:
|
|
774
|
+
return n.quarter(r, {
|
|
775
|
+
width: "wide",
|
|
776
|
+
context: "formatting"
|
|
777
|
+
});
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
// Stand-alone quarter
|
|
781
|
+
q: function(t, e, n) {
|
|
782
|
+
const r = Math.ceil((t.getMonth() + 1) / 3);
|
|
783
|
+
switch (e) {
|
|
784
|
+
case "q":
|
|
785
|
+
return String(r);
|
|
786
|
+
case "qq":
|
|
787
|
+
return u(r, 2);
|
|
788
|
+
case "qo":
|
|
789
|
+
return n.ordinalNumber(r, { unit: "quarter" });
|
|
790
|
+
case "qqq":
|
|
791
|
+
return n.quarter(r, {
|
|
792
|
+
width: "abbreviated",
|
|
793
|
+
context: "standalone"
|
|
794
|
+
});
|
|
795
|
+
case "qqqqq":
|
|
796
|
+
return n.quarter(r, {
|
|
797
|
+
width: "narrow",
|
|
798
|
+
context: "standalone"
|
|
799
|
+
});
|
|
800
|
+
case "qqqq":
|
|
801
|
+
default:
|
|
802
|
+
return n.quarter(r, {
|
|
803
|
+
width: "wide",
|
|
804
|
+
context: "standalone"
|
|
805
|
+
});
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
// Month
|
|
809
|
+
M: function(t, e, n) {
|
|
810
|
+
const r = t.getMonth();
|
|
811
|
+
switch (e) {
|
|
812
|
+
case "M":
|
|
813
|
+
case "MM":
|
|
814
|
+
return p.M(t, e);
|
|
815
|
+
case "Mo":
|
|
816
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
817
|
+
case "MMM":
|
|
818
|
+
return n.month(r, {
|
|
819
|
+
width: "abbreviated",
|
|
820
|
+
context: "formatting"
|
|
821
|
+
});
|
|
822
|
+
case "MMMMM":
|
|
823
|
+
return n.month(r, {
|
|
824
|
+
width: "narrow",
|
|
825
|
+
context: "formatting"
|
|
826
|
+
});
|
|
827
|
+
case "MMMM":
|
|
828
|
+
default:
|
|
829
|
+
return n.month(r, { width: "wide", context: "formatting" });
|
|
830
|
+
}
|
|
831
|
+
},
|
|
832
|
+
// Stand-alone month
|
|
833
|
+
L: function(t, e, n) {
|
|
834
|
+
const r = t.getMonth();
|
|
835
|
+
switch (e) {
|
|
836
|
+
case "L":
|
|
837
|
+
return String(r + 1);
|
|
838
|
+
case "LL":
|
|
839
|
+
return u(r + 1, 2);
|
|
840
|
+
case "Lo":
|
|
841
|
+
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
842
|
+
case "LLL":
|
|
843
|
+
return n.month(r, {
|
|
844
|
+
width: "abbreviated",
|
|
845
|
+
context: "standalone"
|
|
846
|
+
});
|
|
847
|
+
case "LLLLL":
|
|
848
|
+
return n.month(r, {
|
|
849
|
+
width: "narrow",
|
|
850
|
+
context: "standalone"
|
|
851
|
+
});
|
|
852
|
+
case "LLLL":
|
|
853
|
+
default:
|
|
854
|
+
return n.month(r, { width: "wide", context: "standalone" });
|
|
855
|
+
}
|
|
856
|
+
},
|
|
857
|
+
// Local week of year
|
|
858
|
+
w: function(t, e, n, r) {
|
|
859
|
+
const a = ne(t, r);
|
|
860
|
+
return e === "wo" ? n.ordinalNumber(a, { unit: "week" }) : u(a, e.length);
|
|
861
|
+
},
|
|
862
|
+
// ISO week of year
|
|
863
|
+
I: function(t, e, n) {
|
|
864
|
+
const r = te(t);
|
|
865
|
+
return e === "Io" ? n.ordinalNumber(r, { unit: "week" }) : u(r, e.length);
|
|
866
|
+
},
|
|
867
|
+
// Day of the month
|
|
868
|
+
d: function(t, e, n) {
|
|
869
|
+
return e === "do" ? n.ordinalNumber(t.getDate(), { unit: "date" }) : p.d(t, e);
|
|
870
|
+
},
|
|
871
|
+
// Day of year
|
|
872
|
+
D: function(t, e, n) {
|
|
873
|
+
const r = zt(t);
|
|
874
|
+
return e === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : u(r, e.length);
|
|
875
|
+
},
|
|
876
|
+
// Day of week
|
|
877
|
+
E: function(t, e, n) {
|
|
878
|
+
const r = t.getDay();
|
|
879
|
+
switch (e) {
|
|
880
|
+
case "E":
|
|
881
|
+
case "EE":
|
|
882
|
+
case "EEE":
|
|
883
|
+
return n.day(r, {
|
|
884
|
+
width: "abbreviated",
|
|
885
|
+
context: "formatting"
|
|
886
|
+
});
|
|
887
|
+
case "EEEEE":
|
|
888
|
+
return n.day(r, {
|
|
889
|
+
width: "narrow",
|
|
890
|
+
context: "formatting"
|
|
891
|
+
});
|
|
892
|
+
case "EEEEEE":
|
|
893
|
+
return n.day(r, {
|
|
894
|
+
width: "short",
|
|
895
|
+
context: "formatting"
|
|
896
|
+
});
|
|
897
|
+
case "EEEE":
|
|
898
|
+
default:
|
|
899
|
+
return n.day(r, {
|
|
900
|
+
width: "wide",
|
|
901
|
+
context: "formatting"
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
},
|
|
905
|
+
// Local day of week
|
|
906
|
+
e: function(t, e, n, r) {
|
|
907
|
+
const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
908
|
+
switch (e) {
|
|
909
|
+
case "e":
|
|
910
|
+
return String(o);
|
|
911
|
+
case "ee":
|
|
912
|
+
return u(o, 2);
|
|
913
|
+
case "eo":
|
|
914
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
915
|
+
case "eee":
|
|
916
|
+
return n.day(a, {
|
|
917
|
+
width: "abbreviated",
|
|
918
|
+
context: "formatting"
|
|
919
|
+
});
|
|
920
|
+
case "eeeee":
|
|
921
|
+
return n.day(a, {
|
|
922
|
+
width: "narrow",
|
|
923
|
+
context: "formatting"
|
|
924
|
+
});
|
|
925
|
+
case "eeeeee":
|
|
926
|
+
return n.day(a, {
|
|
927
|
+
width: "short",
|
|
928
|
+
context: "formatting"
|
|
929
|
+
});
|
|
930
|
+
case "eeee":
|
|
931
|
+
default:
|
|
932
|
+
return n.day(a, {
|
|
933
|
+
width: "wide",
|
|
934
|
+
context: "formatting"
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
},
|
|
938
|
+
// Stand-alone local day of week
|
|
939
|
+
c: function(t, e, n, r) {
|
|
940
|
+
const a = t.getDay(), o = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
941
|
+
switch (e) {
|
|
942
|
+
case "c":
|
|
943
|
+
return String(o);
|
|
944
|
+
case "cc":
|
|
945
|
+
return u(o, e.length);
|
|
946
|
+
case "co":
|
|
947
|
+
return n.ordinalNumber(o, { unit: "day" });
|
|
948
|
+
case "ccc":
|
|
949
|
+
return n.day(a, {
|
|
950
|
+
width: "abbreviated",
|
|
951
|
+
context: "standalone"
|
|
952
|
+
});
|
|
953
|
+
case "ccccc":
|
|
954
|
+
return n.day(a, {
|
|
955
|
+
width: "narrow",
|
|
956
|
+
context: "standalone"
|
|
957
|
+
});
|
|
958
|
+
case "cccccc":
|
|
959
|
+
return n.day(a, {
|
|
960
|
+
width: "short",
|
|
961
|
+
context: "standalone"
|
|
962
|
+
});
|
|
963
|
+
case "cccc":
|
|
964
|
+
default:
|
|
965
|
+
return n.day(a, {
|
|
966
|
+
width: "wide",
|
|
967
|
+
context: "standalone"
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
// ISO day of week
|
|
972
|
+
i: function(t, e, n) {
|
|
973
|
+
const r = t.getDay(), a = r === 0 ? 7 : r;
|
|
974
|
+
switch (e) {
|
|
975
|
+
case "i":
|
|
976
|
+
return String(a);
|
|
977
|
+
case "ii":
|
|
978
|
+
return u(a, e.length);
|
|
979
|
+
case "io":
|
|
980
|
+
return n.ordinalNumber(a, { unit: "day" });
|
|
981
|
+
case "iii":
|
|
982
|
+
return n.day(r, {
|
|
983
|
+
width: "abbreviated",
|
|
984
|
+
context: "formatting"
|
|
985
|
+
});
|
|
986
|
+
case "iiiii":
|
|
987
|
+
return n.day(r, {
|
|
988
|
+
width: "narrow",
|
|
989
|
+
context: "formatting"
|
|
990
|
+
});
|
|
991
|
+
case "iiiiii":
|
|
992
|
+
return n.day(r, {
|
|
993
|
+
width: "short",
|
|
994
|
+
context: "formatting"
|
|
995
|
+
});
|
|
996
|
+
case "iiii":
|
|
997
|
+
default:
|
|
998
|
+
return n.day(r, {
|
|
999
|
+
width: "wide",
|
|
1000
|
+
context: "formatting"
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
},
|
|
1004
|
+
// AM or PM
|
|
1005
|
+
a: function(t, e, n) {
|
|
1006
|
+
const a = t.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1007
|
+
switch (e) {
|
|
1008
|
+
case "a":
|
|
1009
|
+
case "aa":
|
|
1010
|
+
return n.dayPeriod(a, {
|
|
1011
|
+
width: "abbreviated",
|
|
1012
|
+
context: "formatting"
|
|
1013
|
+
});
|
|
1014
|
+
case "aaa":
|
|
1015
|
+
return n.dayPeriod(a, {
|
|
1016
|
+
width: "abbreviated",
|
|
1017
|
+
context: "formatting"
|
|
1018
|
+
}).toLowerCase();
|
|
1019
|
+
case "aaaaa":
|
|
1020
|
+
return n.dayPeriod(a, {
|
|
1021
|
+
width: "narrow",
|
|
1022
|
+
context: "formatting"
|
|
1023
|
+
});
|
|
1024
|
+
case "aaaa":
|
|
1025
|
+
default:
|
|
1026
|
+
return n.dayPeriod(a, {
|
|
1027
|
+
width: "wide",
|
|
1028
|
+
context: "formatting"
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
1031
|
+
},
|
|
1032
|
+
// AM, PM, midnight, noon
|
|
1033
|
+
b: function(t, e, n) {
|
|
1034
|
+
const r = t.getHours();
|
|
1035
|
+
let a;
|
|
1036
|
+
switch (r === 12 ? a = x.noon : r === 0 ? a = x.midnight : a = r / 12 >= 1 ? "pm" : "am", e) {
|
|
1037
|
+
case "b":
|
|
1038
|
+
case "bb":
|
|
1039
|
+
return n.dayPeriod(a, {
|
|
1040
|
+
width: "abbreviated",
|
|
1041
|
+
context: "formatting"
|
|
1042
|
+
});
|
|
1043
|
+
case "bbb":
|
|
1044
|
+
return n.dayPeriod(a, {
|
|
1045
|
+
width: "abbreviated",
|
|
1046
|
+
context: "formatting"
|
|
1047
|
+
}).toLowerCase();
|
|
1048
|
+
case "bbbbb":
|
|
1049
|
+
return n.dayPeriod(a, {
|
|
1050
|
+
width: "narrow",
|
|
1051
|
+
context: "formatting"
|
|
1052
|
+
});
|
|
1053
|
+
case "bbbb":
|
|
1054
|
+
default:
|
|
1055
|
+
return n.dayPeriod(a, {
|
|
1056
|
+
width: "wide",
|
|
1057
|
+
context: "formatting"
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
1062
|
+
B: function(t, e, n) {
|
|
1063
|
+
const r = t.getHours();
|
|
1064
|
+
let a;
|
|
1065
|
+
switch (r >= 17 ? a = x.evening : r >= 12 ? a = x.afternoon : r >= 4 ? a = x.morning : a = x.night, e) {
|
|
1066
|
+
case "B":
|
|
1067
|
+
case "BB":
|
|
1068
|
+
case "BBB":
|
|
1069
|
+
return n.dayPeriod(a, {
|
|
1070
|
+
width: "abbreviated",
|
|
1071
|
+
context: "formatting"
|
|
1072
|
+
});
|
|
1073
|
+
case "BBBBB":
|
|
1074
|
+
return n.dayPeriod(a, {
|
|
1075
|
+
width: "narrow",
|
|
1076
|
+
context: "formatting"
|
|
1077
|
+
});
|
|
1078
|
+
case "BBBB":
|
|
1079
|
+
default:
|
|
1080
|
+
return n.dayPeriod(a, {
|
|
1081
|
+
width: "wide",
|
|
1082
|
+
context: "formatting"
|
|
1083
|
+
});
|
|
1084
|
+
}
|
|
1085
|
+
},
|
|
1086
|
+
// Hour [1-12]
|
|
1087
|
+
h: function(t, e, n) {
|
|
1088
|
+
if (e === "ho") {
|
|
1089
|
+
let r = t.getHours() % 12;
|
|
1090
|
+
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
1091
|
+
}
|
|
1092
|
+
return p.h(t, e);
|
|
1093
|
+
},
|
|
1094
|
+
// Hour [0-23]
|
|
1095
|
+
H: function(t, e, n) {
|
|
1096
|
+
return e === "Ho" ? n.ordinalNumber(t.getHours(), { unit: "hour" }) : p.H(t, e);
|
|
1097
|
+
},
|
|
1098
|
+
// Hour [0-11]
|
|
1099
|
+
K: function(t, e, n) {
|
|
1100
|
+
const r = t.getHours() % 12;
|
|
1101
|
+
return e === "Ko" ? n.ordinalNumber(r, { unit: "hour" }) : u(r, e.length);
|
|
1102
|
+
},
|
|
1103
|
+
// Hour [1-24]
|
|
1104
|
+
k: function(t, e, n) {
|
|
1105
|
+
let r = t.getHours();
|
|
1106
|
+
return r === 0 && (r = 24), e === "ko" ? n.ordinalNumber(r, { unit: "hour" }) : u(r, e.length);
|
|
1107
|
+
},
|
|
1108
|
+
// Minute
|
|
1109
|
+
m: function(t, e, n) {
|
|
1110
|
+
return e === "mo" ? n.ordinalNumber(t.getMinutes(), { unit: "minute" }) : p.m(t, e);
|
|
1111
|
+
},
|
|
1112
|
+
// Second
|
|
1113
|
+
s: function(t, e, n) {
|
|
1114
|
+
return e === "so" ? n.ordinalNumber(t.getSeconds(), { unit: "second" }) : p.s(t, e);
|
|
1115
|
+
},
|
|
1116
|
+
// Fraction of second
|
|
1117
|
+
S: function(t, e) {
|
|
1118
|
+
return p.S(t, e);
|
|
1119
|
+
},
|
|
1120
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1121
|
+
X: function(t, e, n) {
|
|
1122
|
+
const r = t.getTimezoneOffset();
|
|
1123
|
+
if (r === 0)
|
|
1124
|
+
return "Z";
|
|
1125
|
+
switch (e) {
|
|
1126
|
+
case "X":
|
|
1127
|
+
return G(r);
|
|
1128
|
+
case "XXXX":
|
|
1129
|
+
case "XX":
|
|
1130
|
+
return P(r);
|
|
1131
|
+
case "XXXXX":
|
|
1132
|
+
case "XXX":
|
|
1133
|
+
default:
|
|
1134
|
+
return P(r, ":");
|
|
1135
|
+
}
|
|
1136
|
+
},
|
|
1137
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1138
|
+
x: function(t, e, n) {
|
|
1139
|
+
const r = t.getTimezoneOffset();
|
|
1140
|
+
switch (e) {
|
|
1141
|
+
case "x":
|
|
1142
|
+
return G(r);
|
|
1143
|
+
case "xxxx":
|
|
1144
|
+
case "xx":
|
|
1145
|
+
return P(r);
|
|
1146
|
+
case "xxxxx":
|
|
1147
|
+
case "xxx":
|
|
1148
|
+
default:
|
|
1149
|
+
return P(r, ":");
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
// Timezone (GMT)
|
|
1153
|
+
O: function(t, e, n) {
|
|
1154
|
+
const r = t.getTimezoneOffset();
|
|
1155
|
+
switch (e) {
|
|
1156
|
+
case "O":
|
|
1157
|
+
case "OO":
|
|
1158
|
+
case "OOO":
|
|
1159
|
+
return "GMT" + Q(r, ":");
|
|
1160
|
+
case "OOOO":
|
|
1161
|
+
default:
|
|
1162
|
+
return "GMT" + P(r, ":");
|
|
1163
|
+
}
|
|
1164
|
+
},
|
|
1165
|
+
// Timezone (specific non-location)
|
|
1166
|
+
z: function(t, e, n) {
|
|
1167
|
+
const r = t.getTimezoneOffset();
|
|
1168
|
+
switch (e) {
|
|
1169
|
+
case "z":
|
|
1170
|
+
case "zz":
|
|
1171
|
+
case "zzz":
|
|
1172
|
+
return "GMT" + Q(r, ":");
|
|
1173
|
+
case "zzzz":
|
|
1174
|
+
default:
|
|
1175
|
+
return "GMT" + P(r, ":");
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
// Seconds timestamp
|
|
1179
|
+
t: function(t, e, n) {
|
|
1180
|
+
const r = Math.trunc(t.getTime() / 1e3);
|
|
1181
|
+
return u(r, e.length);
|
|
1182
|
+
},
|
|
1183
|
+
// Milliseconds timestamp
|
|
1184
|
+
T: function(t, e, n) {
|
|
1185
|
+
const r = t.getTime();
|
|
1186
|
+
return u(r, e.length);
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
function Q(t, e = "") {
|
|
1190
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = Math.trunc(r / 60), o = r % 60;
|
|
1191
|
+
return o === 0 ? n + String(a) : n + String(a) + e + u(o, 2);
|
|
1192
|
+
}
|
|
1193
|
+
function G(t, e) {
|
|
1194
|
+
return t % 60 === 0 ? (t > 0 ? "-" : "+") + u(Math.abs(t) / 60, 2) : P(t, e);
|
|
1195
|
+
}
|
|
1196
|
+
function P(t, e = "") {
|
|
1197
|
+
const n = t > 0 ? "-" : "+", r = Math.abs(t), a = u(Math.trunc(r / 60), 2), o = u(r % 60, 2);
|
|
1198
|
+
return n + a + e + o;
|
|
1199
|
+
}
|
|
1200
|
+
const V = (t, e) => {
|
|
1201
|
+
switch (t) {
|
|
1202
|
+
case "P":
|
|
1203
|
+
return e.date({ width: "short" });
|
|
1204
|
+
case "PP":
|
|
1205
|
+
return e.date({ width: "medium" });
|
|
1206
|
+
case "PPP":
|
|
1207
|
+
return e.date({ width: "long" });
|
|
1208
|
+
case "PPPP":
|
|
1209
|
+
default:
|
|
1210
|
+
return e.date({ width: "full" });
|
|
1211
|
+
}
|
|
1212
|
+
}, Z = (t, e) => {
|
|
1213
|
+
switch (t) {
|
|
1214
|
+
case "p":
|
|
1215
|
+
return e.time({ width: "short" });
|
|
1216
|
+
case "pp":
|
|
1217
|
+
return e.time({ width: "medium" });
|
|
1218
|
+
case "ppp":
|
|
1219
|
+
return e.time({ width: "long" });
|
|
1220
|
+
case "pppp":
|
|
1221
|
+
default:
|
|
1222
|
+
return e.time({ width: "full" });
|
|
1223
|
+
}
|
|
1224
|
+
}, re = (t, e) => {
|
|
1225
|
+
const n = t.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1226
|
+
if (!a)
|
|
1227
|
+
return V(t, e);
|
|
1228
|
+
let o;
|
|
1229
|
+
switch (r) {
|
|
1230
|
+
case "P":
|
|
1231
|
+
o = e.dateTime({ width: "short" });
|
|
1232
|
+
break;
|
|
1233
|
+
case "PP":
|
|
1234
|
+
o = e.dateTime({ width: "medium" });
|
|
1235
|
+
break;
|
|
1236
|
+
case "PPP":
|
|
1237
|
+
o = e.dateTime({ width: "long" });
|
|
1238
|
+
break;
|
|
1239
|
+
case "PPPP":
|
|
1240
|
+
default:
|
|
1241
|
+
o = e.dateTime({ width: "full" });
|
|
1242
|
+
break;
|
|
1243
|
+
}
|
|
1244
|
+
return o.replace("{{date}}", V(r, e)).replace("{{time}}", Z(a, e));
|
|
1245
|
+
}, ae = {
|
|
1246
|
+
p: Z,
|
|
1247
|
+
P: re
|
|
1248
|
+
}, oe = /^D+$/, ie = /^Y+$/, se = ["D", "DD", "YY", "YYYY"];
|
|
1249
|
+
function ce(t) {
|
|
1250
|
+
return oe.test(t);
|
|
1251
|
+
}
|
|
1252
|
+
function ue(t) {
|
|
1253
|
+
return ie.test(t);
|
|
1254
|
+
}
|
|
1255
|
+
function de(t, e, n) {
|
|
1256
|
+
const r = fe(t, e, n);
|
|
1257
|
+
if (console.warn(r), se.includes(t))
|
|
1258
|
+
throw new RangeError(r);
|
|
1259
|
+
}
|
|
1260
|
+
function fe(t, e, n) {
|
|
1261
|
+
const r = t[0] === "Y" ? "years" : "days of the month";
|
|
1262
|
+
return `Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1263
|
+
}
|
|
1264
|
+
const me = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, le = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, he = /^'([^]*?)'?$/, ge = /''/g, we = /[a-zA-Z]/;
|
|
1265
|
+
function ye(t, e, n) {
|
|
1266
|
+
var m, w, l, h, y, D, _, H;
|
|
1267
|
+
const r = W(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? U, o = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((w = (m = n == null ? void 0 : n.locale) == null ? void 0 : m.options) == null ? void 0 : w.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((h = (l = r.locale) == null ? void 0 : l.options) == null ? void 0 : h.firstWeekContainsDate) ?? 1, s = (n == null ? void 0 : n.weekStartsOn) ?? ((D = (y = n == null ? void 0 : n.locale) == null ? void 0 : y.options) == null ? void 0 : D.weekStartsOn) ?? r.weekStartsOn ?? ((H = (_ = r.locale) == null ? void 0 : _.options) == null ? void 0 : H.weekStartsOn) ?? 0, i = d(t);
|
|
1268
|
+
if (!ft(i))
|
|
1269
|
+
throw new RangeError("Invalid time value");
|
|
1270
|
+
let c = e.match(le).map((b) => {
|
|
1271
|
+
const g = b[0];
|
|
1272
|
+
if (g === "p" || g === "P") {
|
|
1273
|
+
const q = ae[g];
|
|
1274
|
+
return q(b, a.formatLong);
|
|
1275
|
+
}
|
|
1276
|
+
return b;
|
|
1277
|
+
}).join("").match(me).map((b) => {
|
|
1278
|
+
if (b === "''")
|
|
1279
|
+
return { isToken: !1, value: "'" };
|
|
1280
|
+
const g = b[0];
|
|
1281
|
+
if (g === "'")
|
|
1282
|
+
return { isToken: !1, value: be(b) };
|
|
1283
|
+
if (A[g])
|
|
1284
|
+
return { isToken: !0, value: b };
|
|
1285
|
+
if (g.match(we))
|
|
1286
|
+
throw new RangeError(
|
|
1287
|
+
"Format string contains an unescaped latin alphabet character `" + g + "`"
|
|
1288
|
+
);
|
|
1289
|
+
return { isToken: !1, value: b };
|
|
1290
|
+
});
|
|
1291
|
+
a.localize.preprocessor && (c = a.localize.preprocessor(i, c));
|
|
1292
|
+
const f = {
|
|
1293
|
+
firstWeekContainsDate: o,
|
|
1294
|
+
weekStartsOn: s,
|
|
1295
|
+
locale: a
|
|
1296
|
+
};
|
|
1297
|
+
return c.map((b) => {
|
|
1298
|
+
if (!b.isToken)
|
|
1299
|
+
return b.value;
|
|
1300
|
+
const g = b.value;
|
|
1301
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && ue(g) || !(n != null && n.useAdditionalDayOfYearTokens) && ce(g)) && de(g, e, String(t));
|
|
1302
|
+
const q = A[g[0]];
|
|
1303
|
+
return q(i, g, a.localize, f);
|
|
1304
|
+
}).join("");
|
|
1305
|
+
}
|
|
1306
|
+
function be(t) {
|
|
1307
|
+
const e = t.match(he);
|
|
1308
|
+
return e ? e[1].replace(ge, "'") : t;
|
|
1309
|
+
}
|
|
1310
|
+
function Me(t, e, n) {
|
|
1311
|
+
const r = W(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? U, o = 2520, s = F(t, e);
|
|
1312
|
+
if (isNaN(s))
|
|
1313
|
+
throw new RangeError("Invalid time value");
|
|
1314
|
+
const i = Object.assign({}, n, {
|
|
1315
|
+
addSuffix: n == null ? void 0 : n.addSuffix,
|
|
1316
|
+
comparison: s
|
|
1317
|
+
});
|
|
1318
|
+
let c, f;
|
|
1319
|
+
s > 0 ? (c = d(e), f = d(t)) : (c = d(t), f = d(e));
|
|
1320
|
+
const m = Mt(f, c), w = (C(f) - C(c)) / 1e3, l = Math.round((m - w) / 60);
|
|
1321
|
+
let h;
|
|
1322
|
+
if (l < 2)
|
|
1323
|
+
return n != null && n.includeSeconds ? m < 5 ? a.formatDistance("lessThanXSeconds", 5, i) : m < 10 ? a.formatDistance("lessThanXSeconds", 10, i) : m < 20 ? a.formatDistance("lessThanXSeconds", 20, i) : m < 40 ? a.formatDistance("halfAMinute", 0, i) : m < 60 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", 1, i) : l === 0 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", l, i);
|
|
1324
|
+
if (l < 45)
|
|
1325
|
+
return a.formatDistance("xMinutes", l, i);
|
|
1326
|
+
if (l < 90)
|
|
1327
|
+
return a.formatDistance("aboutXHours", 1, i);
|
|
1328
|
+
if (l < j) {
|
|
1329
|
+
const y = Math.round(l / 60);
|
|
1330
|
+
return a.formatDistance("aboutXHours", y, i);
|
|
1331
|
+
} else {
|
|
1332
|
+
if (l < o)
|
|
1333
|
+
return a.formatDistance("xDays", 1, i);
|
|
1334
|
+
if (l < E) {
|
|
1335
|
+
const y = Math.round(l / j);
|
|
1336
|
+
return a.formatDistance("xDays", y, i);
|
|
1337
|
+
} else if (l < E * 2)
|
|
1338
|
+
return h = Math.round(l / E), a.formatDistance("aboutXMonths", h, i);
|
|
1339
|
+
}
|
|
1340
|
+
if (h = bt(f, c), h < 12) {
|
|
1341
|
+
const y = Math.round(l / E);
|
|
1342
|
+
return a.formatDistance("xMonths", y, i);
|
|
1343
|
+
} else {
|
|
1344
|
+
const y = h % 12, D = Math.trunc(h / 12);
|
|
1345
|
+
return y < 3 ? a.formatDistance("aboutXYears", D, i) : y < 9 ? a.formatDistance("overXYears", D, i) : a.formatDistance("almostXYears", D + 1, i);
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
function De(t, e) {
|
|
1349
|
+
return Me(t, ut(t), e);
|
|
1350
|
+
}
|
|
1351
|
+
const pe = (t, e) => {
|
|
1352
|
+
switch (t) {
|
|
1353
|
+
case k.error:
|
|
1354
|
+
return e.colors.status.error.onsurface;
|
|
1355
|
+
case k.success:
|
|
1356
|
+
return e.colors.status.success.onsurface;
|
|
1357
|
+
case k.warning:
|
|
1358
|
+
return e.colors.status.warning.onsurface;
|
|
1359
|
+
case k.generic:
|
|
1360
|
+
return e.colors.status.generic.onsurface;
|
|
1361
|
+
case k.info:
|
|
1362
|
+
default:
|
|
1363
|
+
return e.colors.status.info.onsurface;
|
|
1364
|
+
}
|
|
1365
|
+
}, vn = ({
|
|
1366
|
+
message: t,
|
|
1367
|
+
state: e = k.info,
|
|
1368
|
+
date: n,
|
|
1369
|
+
action: r,
|
|
1370
|
+
onArrowClick: a,
|
|
1371
|
+
size: o = B.standard,
|
|
1372
|
+
isUnread: s = !0,
|
|
1373
|
+
hasFormattedDate: i = !1
|
|
1374
|
+
}) => {
|
|
1375
|
+
const c = tt();
|
|
1376
|
+
pe(e, c);
|
|
1377
|
+
const f = c.colors.interactive.utility.border, m = c.colors.interactive.utility.onsurface, w = " • ", l = n ? ye(new Date(n), "MMM d, h:mma") : "", h = n ? De(new Date(n), { addSuffix: !0 }) : "", y = i ? `${h}${w}${l}` : h, D = o === B.small ? Y.body1 : Y.body2;
|
|
1378
|
+
return /* @__PURE__ */ L(et, { state: e, size: o, children: [
|
|
1379
|
+
s ? /* @__PURE__ */ M(nt, { state: e, size: o }) : /* @__PURE__ */ M("div", { style: { width: 8 } }),
|
|
1380
|
+
/* @__PURE__ */ M(z, { state: e }),
|
|
1381
|
+
/* @__PURE__ */ M(rt, { size: o, children: /* @__PURE__ */ L("div", { children: [
|
|
1382
|
+
/* @__PURE__ */ M(
|
|
1383
|
+
R,
|
|
1384
|
+
{
|
|
1385
|
+
variant: Y.body3,
|
|
1386
|
+
color: c.colors.onsurface["copy-dark"],
|
|
1387
|
+
children: t
|
|
1388
|
+
}
|
|
1389
|
+
),
|
|
1390
|
+
/* @__PURE__ */ M("div", { style: { marginTop: 8 }, children: /* @__PURE__ */ M(
|
|
1391
|
+
R,
|
|
1392
|
+
{
|
|
1393
|
+
variant: D,
|
|
1394
|
+
color: c.colors.onsurface["copy-light"],
|
|
1395
|
+
children: y
|
|
1396
|
+
}
|
|
1397
|
+
) })
|
|
1398
|
+
] }) }),
|
|
1399
|
+
r ? /* @__PURE__ */ M(
|
|
1400
|
+
"button",
|
|
1401
|
+
{
|
|
1402
|
+
onClick: r.onClick,
|
|
1403
|
+
style: {
|
|
1404
|
+
border: `1px solid ${f}`,
|
|
1405
|
+
background: "none",
|
|
1406
|
+
cursor: "pointer",
|
|
1407
|
+
cursorEvents: "all",
|
|
1408
|
+
color: m,
|
|
1409
|
+
borderRadius: c.borderRadius.BorderRadiusSm,
|
|
1410
|
+
paddingTop: "2px",
|
|
1411
|
+
paddingBottom: "2px",
|
|
1412
|
+
paddingLeft: c.components.utilityButton.padding.horPadding,
|
|
1413
|
+
paddingRight: c.components.utilityButton.padding.horPadding
|
|
1414
|
+
},
|
|
1415
|
+
children: /* @__PURE__ */ M(R, { variant: Y.body1, children: r.text })
|
|
1416
|
+
}
|
|
1417
|
+
) : null,
|
|
1418
|
+
a ? /* @__PURE__ */ M(
|
|
1419
|
+
"button",
|
|
1420
|
+
{
|
|
1421
|
+
onClick: a,
|
|
1422
|
+
style: {
|
|
1423
|
+
textDecoration: "underline",
|
|
1424
|
+
border: "none",
|
|
1425
|
+
background: "none",
|
|
1426
|
+
cursor: "pointer",
|
|
1427
|
+
cursorEvents: "all"
|
|
1428
|
+
},
|
|
1429
|
+
children: /* @__PURE__ */ M(at, { style: { fontSize: 18 } })
|
|
1430
|
+
}
|
|
1431
|
+
) : null
|
|
1432
|
+
] });
|
|
1433
|
+
};
|
|
1434
|
+
export {
|
|
1435
|
+
vn as default
|
|
1436
|
+
};
|