react-semaphor 0.1.182 → 0.1.184
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/calendar-preferences-dialog-D9oF_URo.js +1 -0
- package/dist/chunks/calendar-preferences-dialog-DeXKY9JD.js +457 -0
- package/dist/chunks/common-types-CfJLrTJd.js +1 -0
- package/dist/chunks/common-types-DhqlRVrq.js +8 -0
- package/dist/chunks/{dashboard-controls-pGlGtKRR.js → dashboard-controls-CB8282ob.js} +8 -8
- package/dist/chunks/{dashboard-controls-BnBXzFOj.js → dashboard-controls-lRs5t5cg.js} +499 -484
- package/dist/chunks/{dashboard-json-UVBr47Qj.js → dashboard-json-BmzqRV5Q.js} +1 -1
- package/dist/chunks/{dashboard-json-CiIyCwJi.js → dashboard-json-Brn4hMd-.js} +1 -1
- package/dist/chunks/date-formatter-Sz6QDaM8.js +1 -0
- package/dist/chunks/{index-B4EhQdS9.js → date-formatter-Y8Za1ib3.js} +500 -544
- package/dist/chunks/{edit-dashboard-visual-DoP_x_tT.js → edit-dashboard-visual--FJBg3i3.js} +914 -914
- package/dist/chunks/{edit-dashboard-visual-CXvyi_qa.js → edit-dashboard-visual-DNq8ni5W.js} +8 -8
- package/dist/chunks/{editor-action-buttons-5UEhKl88.js → editor-action-buttons-COCkxvCM.js} +27 -27
- package/dist/chunks/{editor-action-buttons-Bftd6Bfx.js → editor-action-buttons-RPpMm3Zr.js} +1 -1
- package/dist/chunks/{index-ahdw_esL.js → index-CyYJ0bVW.js} +24904 -24743
- package/dist/chunks/{index-D59dkH2b.js → index-Dz2kwOQh.js} +229 -229
- package/dist/chunks/{notification-bell-CKI2j8jH.js → notification-bell-B86bWytX.js} +109 -109
- package/dist/chunks/{notification-bell-DtWcBdzp.js → notification-bell-Bdk-qQIx.js} +2 -2
- package/dist/chunks/{resource-management-panel-qkl060k8.js → resource-management-panel-BZKSwkRq.js} +160 -160
- package/dist/chunks/{resource-management-panel-BLiCtZZE.js → resource-management-panel-CvKBoIFQ.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-CLf3yEts.js → use-role-aware-display-preferences-D-jgaajh.js} +1 -1
- package/dist/chunks/{use-role-aware-display-preferences-JstD5WLE.js → use-role-aware-display-preferences-Kxc427Zx.js} +1 -1
- package/dist/chunks/{use-visual-utils-TGjvLx_R.js → use-visual-utils-Du4NIgMk.js} +1 -1
- package/dist/chunks/{use-visual-utils-BbN7rxtD.js → use-visual-utils-DwQQN6wI.js} +33 -33
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +3 -3
- package/dist/format-utils/index.cjs +5 -5
- package/dist/format-utils/index.js +200 -250
- package/dist/index.cjs +1 -1
- package/dist/index.js +75 -71
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +6 -4
- package/dist/types/dashboard.d.ts +6 -2
- package/dist/types/format-utils.d.ts +43 -20
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +8 -5
- package/dist/types/main.d.ts +99 -9
- package/dist/types/surfboard.d.ts +13 -2
- package/dist/types/types.d.ts +319 -2
- package/package.json +1 -1
- package/dist/chunks/index-8Crk3ROJ.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const be = {
|
|
2
2
|
lessThanXSeconds: {
|
|
3
3
|
one: "less than a second",
|
|
4
4
|
other: "less than {{count}} seconds"
|
|
@@ -60,77 +60,77 @@ const Ne = {
|
|
|
60
60
|
one: "almost 1 year",
|
|
61
61
|
other: "almost {{count}} years"
|
|
62
62
|
}
|
|
63
|
-
},
|
|
63
|
+
}, Te = (e, t, n) => {
|
|
64
64
|
let r;
|
|
65
|
-
const a =
|
|
65
|
+
const a = be[e];
|
|
66
66
|
return typeof a == "string" ? r = a : t === 1 ? r = a.one : r = a.other.replace("{{count}}", t.toString()), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "in " + r : r + " ago" : r;
|
|
67
67
|
};
|
|
68
|
-
function
|
|
68
|
+
function L(e) {
|
|
69
69
|
return (t = {}) => {
|
|
70
70
|
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
71
71
|
return e.formats[n] || e.formats[e.defaultWidth];
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
const
|
|
74
|
+
const Oe = {
|
|
75
75
|
full: "EEEE, MMMM do, y",
|
|
76
76
|
long: "MMMM do, y",
|
|
77
77
|
medium: "MMM d, y",
|
|
78
78
|
short: "MM/dd/yyyy"
|
|
79
|
-
},
|
|
79
|
+
}, xe = {
|
|
80
80
|
full: "h:mm:ss a zzzz",
|
|
81
81
|
long: "h:mm:ss a z",
|
|
82
82
|
medium: "h:mm:ss a",
|
|
83
83
|
short: "h:mm a"
|
|
84
|
-
},
|
|
84
|
+
}, Ye = {
|
|
85
85
|
full: "{{date}} 'at' {{time}}",
|
|
86
86
|
long: "{{date}} 'at' {{time}}",
|
|
87
87
|
medium: "{{date}}, {{time}}",
|
|
88
88
|
short: "{{date}}, {{time}}"
|
|
89
|
-
},
|
|
90
|
-
date:
|
|
91
|
-
formats:
|
|
89
|
+
}, Ne = {
|
|
90
|
+
date: L({
|
|
91
|
+
formats: Oe,
|
|
92
92
|
defaultWidth: "full"
|
|
93
93
|
}),
|
|
94
|
-
time:
|
|
95
|
-
formats:
|
|
94
|
+
time: L({
|
|
95
|
+
formats: xe,
|
|
96
96
|
defaultWidth: "full"
|
|
97
97
|
}),
|
|
98
|
-
dateTime:
|
|
99
|
-
formats:
|
|
98
|
+
dateTime: L({
|
|
99
|
+
formats: Ye,
|
|
100
100
|
defaultWidth: "full"
|
|
101
101
|
})
|
|
102
|
-
},
|
|
102
|
+
}, Pe = {
|
|
103
103
|
lastWeek: "'last' eeee 'at' p",
|
|
104
104
|
yesterday: "'yesterday at' p",
|
|
105
105
|
today: "'today at' p",
|
|
106
106
|
tomorrow: "'tomorrow at' p",
|
|
107
107
|
nextWeek: "eeee 'at' p",
|
|
108
108
|
other: "P"
|
|
109
|
-
},
|
|
110
|
-
function
|
|
109
|
+
}, ve = (e, t, n, r) => Pe[e];
|
|
110
|
+
function v(e) {
|
|
111
111
|
return (t, n) => {
|
|
112
112
|
const r = n != null && n.context ? String(n.context) : "standalone";
|
|
113
113
|
let a;
|
|
114
114
|
if (r === "formatting" && e.formattingValues) {
|
|
115
|
-
const
|
|
116
|
-
a = e.formattingValues[
|
|
115
|
+
const o = e.defaultFormattingWidth || e.defaultWidth, i = n != null && n.width ? String(n.width) : o;
|
|
116
|
+
a = e.formattingValues[i] || e.formattingValues[o];
|
|
117
117
|
} else {
|
|
118
|
-
const
|
|
119
|
-
a = e.values[
|
|
118
|
+
const o = e.defaultWidth, i = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
119
|
+
a = e.values[i] || e.values[o];
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
return a[
|
|
121
|
+
const s = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
122
|
+
return a[s];
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
const
|
|
125
|
+
const pe = {
|
|
126
126
|
narrow: ["B", "A"],
|
|
127
127
|
abbreviated: ["BC", "AD"],
|
|
128
128
|
wide: ["Before Christ", "Anno Domini"]
|
|
129
|
-
},
|
|
129
|
+
}, ke = {
|
|
130
130
|
narrow: ["1", "2", "3", "4"],
|
|
131
131
|
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
132
132
|
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
133
|
-
},
|
|
133
|
+
}, We = {
|
|
134
134
|
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
135
135
|
abbreviated: [
|
|
136
136
|
"Jan",
|
|
@@ -160,7 +160,7 @@ const ve = {
|
|
|
160
160
|
"November",
|
|
161
161
|
"December"
|
|
162
162
|
]
|
|
163
|
-
},
|
|
163
|
+
}, Ie = {
|
|
164
164
|
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
165
165
|
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
166
166
|
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
@@ -173,7 +173,7 @@ const ve = {
|
|
|
173
173
|
"Friday",
|
|
174
174
|
"Saturday"
|
|
175
175
|
]
|
|
176
|
-
},
|
|
176
|
+
}, Se = {
|
|
177
177
|
narrow: {
|
|
178
178
|
am: "a",
|
|
179
179
|
pm: "p",
|
|
@@ -204,7 +204,7 @@ const ve = {
|
|
|
204
204
|
evening: "evening",
|
|
205
205
|
night: "night"
|
|
206
206
|
}
|
|
207
|
-
},
|
|
207
|
+
}, Fe = {
|
|
208
208
|
narrow: {
|
|
209
209
|
am: "a",
|
|
210
210
|
pm: "p",
|
|
@@ -235,7 +235,7 @@ const ve = {
|
|
|
235
235
|
evening: "in the evening",
|
|
236
236
|
night: "at night"
|
|
237
237
|
}
|
|
238
|
-
},
|
|
238
|
+
}, Ce = (e, t) => {
|
|
239
239
|
const n = Number(e), r = n % 100;
|
|
240
240
|
if (r > 20 || r < 10)
|
|
241
241
|
switch (r % 10) {
|
|
@@ -247,89 +247,89 @@ const ve = {
|
|
|
247
247
|
return n + "rd";
|
|
248
248
|
}
|
|
249
249
|
return n + "th";
|
|
250
|
-
},
|
|
251
|
-
ordinalNumber:
|
|
252
|
-
era:
|
|
253
|
-
values:
|
|
250
|
+
}, Ee = {
|
|
251
|
+
ordinalNumber: Ce,
|
|
252
|
+
era: v({
|
|
253
|
+
values: pe,
|
|
254
254
|
defaultWidth: "wide"
|
|
255
255
|
}),
|
|
256
|
-
quarter:
|
|
257
|
-
values:
|
|
256
|
+
quarter: v({
|
|
257
|
+
values: ke,
|
|
258
258
|
defaultWidth: "wide",
|
|
259
259
|
argumentCallback: (e) => e - 1
|
|
260
260
|
}),
|
|
261
|
-
month:
|
|
262
|
-
values:
|
|
261
|
+
month: v({
|
|
262
|
+
values: We,
|
|
263
263
|
defaultWidth: "wide"
|
|
264
264
|
}),
|
|
265
|
-
day:
|
|
266
|
-
values:
|
|
265
|
+
day: v({
|
|
266
|
+
values: Ie,
|
|
267
267
|
defaultWidth: "wide"
|
|
268
268
|
}),
|
|
269
|
-
dayPeriod:
|
|
270
|
-
values:
|
|
269
|
+
dayPeriod: v({
|
|
270
|
+
values: Se,
|
|
271
271
|
defaultWidth: "wide",
|
|
272
|
-
formattingValues:
|
|
272
|
+
formattingValues: Fe,
|
|
273
273
|
defaultFormattingWidth: "wide"
|
|
274
274
|
})
|
|
275
275
|
};
|
|
276
|
-
function
|
|
276
|
+
function p(e) {
|
|
277
277
|
return (t, n = {}) => {
|
|
278
|
-
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth],
|
|
279
|
-
if (!
|
|
278
|
+
const r = n.width, a = r && e.matchPatterns[r] || e.matchPatterns[e.defaultMatchWidth], s = t.match(a);
|
|
279
|
+
if (!s)
|
|
280
280
|
return null;
|
|
281
|
-
const
|
|
281
|
+
const o = s[0], i = r && e.parsePatterns[r] || e.parsePatterns[e.defaultParseWidth], u = Array.isArray(i) ? _e(i, (y) => y.test(o)) : (
|
|
282
282
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
283
|
-
|
|
283
|
+
He(i, (y) => y.test(o))
|
|
284
284
|
);
|
|
285
285
|
let c;
|
|
286
286
|
c = e.valueCallback ? e.valueCallback(u) : u, c = n.valueCallback ? (
|
|
287
287
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- I challange you to fix the type
|
|
288
288
|
n.valueCallback(c)
|
|
289
289
|
) : c;
|
|
290
|
-
const l = t.slice(
|
|
290
|
+
const l = t.slice(o.length);
|
|
291
291
|
return { value: c, rest: l };
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function He(e, t) {
|
|
295
295
|
for (const n in e)
|
|
296
296
|
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
297
297
|
return n;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function _e(e, t) {
|
|
300
300
|
for (let n = 0; n < e.length; n++)
|
|
301
301
|
if (t(e[n]))
|
|
302
302
|
return n;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function Le(e) {
|
|
305
305
|
return (t, n = {}) => {
|
|
306
306
|
const r = t.match(e.matchPattern);
|
|
307
307
|
if (!r) return null;
|
|
308
|
-
const a = r[0],
|
|
309
|
-
if (!
|
|
310
|
-
let
|
|
311
|
-
|
|
312
|
-
const
|
|
313
|
-
return { value:
|
|
308
|
+
const a = r[0], s = t.match(e.parsePattern);
|
|
309
|
+
if (!s) return null;
|
|
310
|
+
let o = e.valueCallback ? e.valueCallback(s[0]) : s[0];
|
|
311
|
+
o = n.valueCallback ? n.valueCallback(o) : o;
|
|
312
|
+
const i = t.slice(a.length);
|
|
313
|
+
return { value: o, rest: i };
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
const
|
|
316
|
+
const Xe = /^(\d+)(th|st|nd|rd)?/i, $e = /\d+/i, Ze = {
|
|
317
317
|
narrow: /^(b|a)/i,
|
|
318
318
|
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
319
319
|
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
320
|
-
},
|
|
320
|
+
}, Ue = {
|
|
321
321
|
any: [/^b/i, /^(a|c)/i]
|
|
322
322
|
}, Ae = {
|
|
323
323
|
narrow: /^[1234]/i,
|
|
324
324
|
abbreviated: /^q[1234]/i,
|
|
325
325
|
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
326
|
-
},
|
|
326
|
+
}, qe = {
|
|
327
327
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
328
|
-
},
|
|
328
|
+
}, Re = {
|
|
329
329
|
narrow: /^[jfmasond]/i,
|
|
330
330
|
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
331
331
|
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
332
|
-
},
|
|
332
|
+
}, je = {
|
|
333
333
|
narrow: [
|
|
334
334
|
/^j/i,
|
|
335
335
|
/^f/i,
|
|
@@ -358,18 +358,18 @@ const Le = /^(\d+)(th|st|nd|rd)?/i, qe = /\d+/i, Re = {
|
|
|
358
358
|
/^n/i,
|
|
359
359
|
/^d/i
|
|
360
360
|
]
|
|
361
|
-
},
|
|
361
|
+
}, ze = {
|
|
362
362
|
narrow: /^[smtwf]/i,
|
|
363
363
|
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
364
364
|
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
365
365
|
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
366
|
-
},
|
|
366
|
+
}, Qe = {
|
|
367
367
|
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
368
368
|
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
369
|
-
},
|
|
369
|
+
}, Ge = {
|
|
370
370
|
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
371
371
|
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
372
|
-
},
|
|
372
|
+
}, Be = {
|
|
373
373
|
any: {
|
|
374
374
|
am: /^a/i,
|
|
375
375
|
pm: /^p/i,
|
|
@@ -380,69 +380,69 @@ const Le = /^(\d+)(th|st|nd|rd)?/i, qe = /\d+/i, Re = {
|
|
|
380
380
|
evening: /evening/i,
|
|
381
381
|
night: /night/i
|
|
382
382
|
}
|
|
383
|
-
},
|
|
384
|
-
ordinalNumber:
|
|
385
|
-
matchPattern:
|
|
386
|
-
parsePattern:
|
|
383
|
+
}, Ve = {
|
|
384
|
+
ordinalNumber: Le({
|
|
385
|
+
matchPattern: Xe,
|
|
386
|
+
parsePattern: $e,
|
|
387
387
|
valueCallback: (e) => parseInt(e, 10)
|
|
388
388
|
}),
|
|
389
|
-
era:
|
|
390
|
-
matchPatterns:
|
|
389
|
+
era: p({
|
|
390
|
+
matchPatterns: Ze,
|
|
391
391
|
defaultMatchWidth: "wide",
|
|
392
|
-
parsePatterns:
|
|
392
|
+
parsePatterns: Ue,
|
|
393
393
|
defaultParseWidth: "any"
|
|
394
394
|
}),
|
|
395
|
-
quarter:
|
|
395
|
+
quarter: p({
|
|
396
396
|
matchPatterns: Ae,
|
|
397
397
|
defaultMatchWidth: "wide",
|
|
398
|
-
parsePatterns:
|
|
398
|
+
parsePatterns: qe,
|
|
399
399
|
defaultParseWidth: "any",
|
|
400
400
|
valueCallback: (e) => e + 1
|
|
401
401
|
}),
|
|
402
|
-
month:
|
|
403
|
-
matchPatterns:
|
|
402
|
+
month: p({
|
|
403
|
+
matchPatterns: Re,
|
|
404
404
|
defaultMatchWidth: "wide",
|
|
405
|
-
parsePatterns:
|
|
405
|
+
parsePatterns: je,
|
|
406
406
|
defaultParseWidth: "any"
|
|
407
407
|
}),
|
|
408
|
-
day:
|
|
409
|
-
matchPatterns:
|
|
408
|
+
day: p({
|
|
409
|
+
matchPatterns: ze,
|
|
410
410
|
defaultMatchWidth: "wide",
|
|
411
|
-
parsePatterns:
|
|
411
|
+
parsePatterns: Qe,
|
|
412
412
|
defaultParseWidth: "any"
|
|
413
413
|
}),
|
|
414
|
-
dayPeriod:
|
|
415
|
-
matchPatterns:
|
|
414
|
+
dayPeriod: p({
|
|
415
|
+
matchPatterns: Ge,
|
|
416
416
|
defaultMatchWidth: "any",
|
|
417
|
-
parsePatterns:
|
|
417
|
+
parsePatterns: Be,
|
|
418
418
|
defaultParseWidth: "any"
|
|
419
419
|
})
|
|
420
|
-
},
|
|
420
|
+
}, de = {
|
|
421
421
|
code: "en-US",
|
|
422
|
-
formatDistance:
|
|
423
|
-
formatLong:
|
|
424
|
-
formatRelative:
|
|
425
|
-
localize:
|
|
426
|
-
match:
|
|
422
|
+
formatDistance: Te,
|
|
423
|
+
formatLong: Ne,
|
|
424
|
+
formatRelative: ve,
|
|
425
|
+
localize: Ee,
|
|
426
|
+
match: Ve,
|
|
427
427
|
options: {
|
|
428
428
|
weekStartsOn: 0,
|
|
429
429
|
firstWeekContainsDate: 1
|
|
430
430
|
}
|
|
431
431
|
};
|
|
432
|
-
let
|
|
433
|
-
function
|
|
434
|
-
return
|
|
432
|
+
let Je = {};
|
|
433
|
+
function P() {
|
|
434
|
+
return Je;
|
|
435
435
|
}
|
|
436
|
-
const
|
|
436
|
+
const le = 6048e5, Ke = 864e5, mn = 6e4, hn = 36e5, W = 43200, Q = 1440;
|
|
437
437
|
function d(e) {
|
|
438
438
|
const t = Object.prototype.toString.call(e);
|
|
439
439
|
return e instanceof Date || typeof e == "object" && t === "[object Date]" ? new e.constructor(+e) : typeof e == "number" || t === "[object Number]" || typeof e == "string" || t === "[object String]" ? new Date(e) : /* @__PURE__ */ new Date(NaN);
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function G(e) {
|
|
442
442
|
const t = d(e);
|
|
443
443
|
return t.setHours(0, 0, 0, 0), t;
|
|
444
444
|
}
|
|
445
|
-
function
|
|
445
|
+
function S(e) {
|
|
446
446
|
const t = d(e), n = new Date(
|
|
447
447
|
Date.UTC(
|
|
448
448
|
t.getFullYear(),
|
|
@@ -456,68 +456,68 @@ function F(e) {
|
|
|
456
456
|
);
|
|
457
457
|
return n.setUTCFullYear(t.getFullYear()), +e - +n;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
const n =
|
|
461
|
-
return Math.round((a -
|
|
459
|
+
function et(e, t) {
|
|
460
|
+
const n = G(e), r = G(t), a = +n - S(n), s = +r - S(r);
|
|
461
|
+
return Math.round((a - s) / Ke);
|
|
462
462
|
}
|
|
463
463
|
function T(e, t) {
|
|
464
464
|
return e instanceof Date ? new e.constructor(t) : new Date(t);
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function tt(e) {
|
|
467
467
|
const t = d(e), n = T(e, 0);
|
|
468
468
|
return n.setFullYear(t.getFullYear(), 0, 1), n.setHours(0, 0, 0, 0), n;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function nt(e) {
|
|
471
471
|
const t = d(e);
|
|
472
|
-
return
|
|
472
|
+
return et(t, tt(t)) + 1;
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
var
|
|
476
|
-
const n =
|
|
477
|
-
return a.setDate(a.getDate() -
|
|
474
|
+
function k(e, t) {
|
|
475
|
+
var i, u, c, l;
|
|
476
|
+
const n = P(), r = (t == null ? void 0 : t.weekStartsOn) ?? ((u = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : u.weekStartsOn) ?? n.weekStartsOn ?? ((l = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : l.weekStartsOn) ?? 0, a = d(e), s = a.getDay(), o = (s < r ? 7 : 0) + s - r;
|
|
477
|
+
return a.setDate(a.getDate() - o), a.setHours(0, 0, 0, 0), a;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
480
|
-
return
|
|
479
|
+
function F(e) {
|
|
480
|
+
return k(e, { weekStartsOn: 1 });
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function me(e) {
|
|
483
483
|
const t = d(e), n = t.getFullYear(), r = T(e, 0);
|
|
484
484
|
r.setFullYear(n + 1, 0, 4), r.setHours(0, 0, 0, 0);
|
|
485
|
-
const a =
|
|
486
|
-
|
|
487
|
-
const
|
|
488
|
-
return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >=
|
|
485
|
+
const a = F(r), s = T(e, 0);
|
|
486
|
+
s.setFullYear(n, 0, 4), s.setHours(0, 0, 0, 0);
|
|
487
|
+
const o = F(s);
|
|
488
|
+
return t.getTime() >= a.getTime() ? n + 1 : t.getTime() >= o.getTime() ? n : n - 1;
|
|
489
489
|
}
|
|
490
|
-
function
|
|
491
|
-
const t =
|
|
492
|
-
return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0),
|
|
490
|
+
function rt(e) {
|
|
491
|
+
const t = me(e), n = T(e, 0);
|
|
492
|
+
return n.setFullYear(t, 0, 4), n.setHours(0, 0, 0, 0), F(n);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
const t = d(e), n = +
|
|
496
|
-
return Math.round(n /
|
|
494
|
+
function at(e) {
|
|
495
|
+
const t = d(e), n = +F(t) - +rt(t);
|
|
496
|
+
return Math.round(n / le) + 1;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function he(e, t) {
|
|
499
499
|
var l, y, m, D;
|
|
500
|
-
const n = d(e), r = n.getFullYear(), a =
|
|
501
|
-
|
|
502
|
-
const
|
|
503
|
-
u.setFullYear(r, 0,
|
|
504
|
-
const c =
|
|
505
|
-
return n.getTime() >=
|
|
506
|
-
}
|
|
507
|
-
function
|
|
508
|
-
var
|
|
509
|
-
const n =
|
|
510
|
-
return
|
|
511
|
-
}
|
|
512
|
-
function
|
|
513
|
-
const n = d(e), r = +
|
|
514
|
-
return Math.round(r /
|
|
500
|
+
const n = d(e), r = n.getFullYear(), a = P(), s = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((y = (l = t == null ? void 0 : t.locale) == null ? void 0 : l.options) == null ? void 0 : y.firstWeekContainsDate) ?? a.firstWeekContainsDate ?? ((D = (m = a.locale) == null ? void 0 : m.options) == null ? void 0 : D.firstWeekContainsDate) ?? 1, o = T(e, 0);
|
|
501
|
+
o.setFullYear(r + 1, 0, s), o.setHours(0, 0, 0, 0);
|
|
502
|
+
const i = k(o, t), u = T(e, 0);
|
|
503
|
+
u.setFullYear(r, 0, s), u.setHours(0, 0, 0, 0);
|
|
504
|
+
const c = k(u, t);
|
|
505
|
+
return n.getTime() >= i.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
|
|
506
|
+
}
|
|
507
|
+
function st(e, t) {
|
|
508
|
+
var i, u, c, l;
|
|
509
|
+
const n = P(), r = (t == null ? void 0 : t.firstWeekContainsDate) ?? ((u = (i = t == null ? void 0 : t.locale) == null ? void 0 : i.options) == null ? void 0 : u.firstWeekContainsDate) ?? n.firstWeekContainsDate ?? ((l = (c = n.locale) == null ? void 0 : c.options) == null ? void 0 : l.firstWeekContainsDate) ?? 1, a = he(e, t), s = T(e, 0);
|
|
510
|
+
return s.setFullYear(a, 0, r), s.setHours(0, 0, 0, 0), k(s, t);
|
|
511
|
+
}
|
|
512
|
+
function ot(e, t) {
|
|
513
|
+
const n = d(e), r = +k(n, t) - +st(n, t);
|
|
514
|
+
return Math.round(r / le) + 1;
|
|
515
515
|
}
|
|
516
516
|
function f(e, t) {
|
|
517
517
|
const n = e < 0 ? "-" : "", r = Math.abs(e).toString().padStart(t, "0");
|
|
518
518
|
return n + r;
|
|
519
519
|
}
|
|
520
|
-
const
|
|
520
|
+
const b = {
|
|
521
521
|
// Year
|
|
522
522
|
y(e, t) {
|
|
523
523
|
const n = e.getFullYear(), r = n > 0 ? n : 1 - n;
|
|
@@ -571,14 +571,14 @@ const M = {
|
|
|
571
571
|
);
|
|
572
572
|
return f(a, t.length);
|
|
573
573
|
}
|
|
574
|
-
},
|
|
574
|
+
}, Y = {
|
|
575
575
|
midnight: "midnight",
|
|
576
576
|
noon: "noon",
|
|
577
577
|
morning: "morning",
|
|
578
578
|
afternoon: "afternoon",
|
|
579
579
|
evening: "evening",
|
|
580
580
|
night: "night"
|
|
581
|
-
},
|
|
581
|
+
}, B = {
|
|
582
582
|
// Era
|
|
583
583
|
G: function(e, t, n) {
|
|
584
584
|
const r = e.getFullYear() > 0 ? 1 : 0;
|
|
@@ -600,20 +600,20 @@ const M = {
|
|
|
600
600
|
const r = e.getFullYear(), a = r > 0 ? r : 1 - r;
|
|
601
601
|
return n.ordinalNumber(a, { unit: "year" });
|
|
602
602
|
}
|
|
603
|
-
return
|
|
603
|
+
return b.y(e, t);
|
|
604
604
|
},
|
|
605
605
|
// Local week-numbering year
|
|
606
606
|
Y: function(e, t, n, r) {
|
|
607
|
-
const a =
|
|
607
|
+
const a = he(e, r), s = a > 0 ? a : 1 - a;
|
|
608
608
|
if (t === "YY") {
|
|
609
|
-
const
|
|
610
|
-
return f(
|
|
609
|
+
const o = s % 100;
|
|
610
|
+
return f(o, 2);
|
|
611
611
|
}
|
|
612
|
-
return t === "Yo" ? n.ordinalNumber(
|
|
612
|
+
return t === "Yo" ? n.ordinalNumber(s, { unit: "year" }) : f(s, t.length);
|
|
613
613
|
},
|
|
614
614
|
// ISO week-numbering year
|
|
615
615
|
R: function(e, t) {
|
|
616
|
-
const n =
|
|
616
|
+
const n = me(e);
|
|
617
617
|
return f(n, t.length);
|
|
618
618
|
},
|
|
619
619
|
// Extended year. This is a single number designating the year of this calendar system.
|
|
@@ -691,7 +691,7 @@ const M = {
|
|
|
691
691
|
switch (t) {
|
|
692
692
|
case "M":
|
|
693
693
|
case "MM":
|
|
694
|
-
return
|
|
694
|
+
return b.M(e, t);
|
|
695
695
|
case "Mo":
|
|
696
696
|
return n.ordinalNumber(r + 1, { unit: "month" });
|
|
697
697
|
case "MMM":
|
|
@@ -736,21 +736,21 @@ const M = {
|
|
|
736
736
|
},
|
|
737
737
|
// Local week of year
|
|
738
738
|
w: function(e, t, n, r) {
|
|
739
|
-
const a =
|
|
739
|
+
const a = ot(e, r);
|
|
740
740
|
return t === "wo" ? n.ordinalNumber(a, { unit: "week" }) : f(a, t.length);
|
|
741
741
|
},
|
|
742
742
|
// ISO week of year
|
|
743
743
|
I: function(e, t, n) {
|
|
744
|
-
const r =
|
|
744
|
+
const r = at(e);
|
|
745
745
|
return t === "Io" ? n.ordinalNumber(r, { unit: "week" }) : f(r, t.length);
|
|
746
746
|
},
|
|
747
747
|
// Day of the month
|
|
748
748
|
d: function(e, t, n) {
|
|
749
|
-
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) :
|
|
749
|
+
return t === "do" ? n.ordinalNumber(e.getDate(), { unit: "date" }) : b.d(e, t);
|
|
750
750
|
},
|
|
751
751
|
// Day of year
|
|
752
752
|
D: function(e, t, n) {
|
|
753
|
-
const r =
|
|
753
|
+
const r = nt(e);
|
|
754
754
|
return t === "Do" ? n.ordinalNumber(r, { unit: "dayOfYear" }) : f(r, t.length);
|
|
755
755
|
},
|
|
756
756
|
// Day of week
|
|
@@ -784,14 +784,14 @@ const M = {
|
|
|
784
784
|
},
|
|
785
785
|
// Local day of week
|
|
786
786
|
e: function(e, t, n, r) {
|
|
787
|
-
const a = e.getDay(),
|
|
787
|
+
const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
788
788
|
switch (t) {
|
|
789
789
|
case "e":
|
|
790
|
-
return String(
|
|
790
|
+
return String(s);
|
|
791
791
|
case "ee":
|
|
792
|
-
return f(
|
|
792
|
+
return f(s, 2);
|
|
793
793
|
case "eo":
|
|
794
|
-
return n.ordinalNumber(
|
|
794
|
+
return n.ordinalNumber(s, { unit: "day" });
|
|
795
795
|
case "eee":
|
|
796
796
|
return n.day(a, {
|
|
797
797
|
width: "abbreviated",
|
|
@@ -817,14 +817,14 @@ const M = {
|
|
|
817
817
|
},
|
|
818
818
|
// Stand-alone local day of week
|
|
819
819
|
c: function(e, t, n, r) {
|
|
820
|
-
const a = e.getDay(),
|
|
820
|
+
const a = e.getDay(), s = (a - r.weekStartsOn + 8) % 7 || 7;
|
|
821
821
|
switch (t) {
|
|
822
822
|
case "c":
|
|
823
|
-
return String(
|
|
823
|
+
return String(s);
|
|
824
824
|
case "cc":
|
|
825
|
-
return f(
|
|
825
|
+
return f(s, t.length);
|
|
826
826
|
case "co":
|
|
827
|
-
return n.ordinalNumber(
|
|
827
|
+
return n.ordinalNumber(s, { unit: "day" });
|
|
828
828
|
case "ccc":
|
|
829
829
|
return n.day(a, {
|
|
830
830
|
width: "abbreviated",
|
|
@@ -913,7 +913,7 @@ const M = {
|
|
|
913
913
|
b: function(e, t, n) {
|
|
914
914
|
const r = e.getHours();
|
|
915
915
|
let a;
|
|
916
|
-
switch (r === 12 ? a =
|
|
916
|
+
switch (r === 12 ? a = Y.noon : r === 0 ? a = Y.midnight : a = r / 12 >= 1 ? "pm" : "am", t) {
|
|
917
917
|
case "b":
|
|
918
918
|
case "bb":
|
|
919
919
|
return n.dayPeriod(a, {
|
|
@@ -942,7 +942,7 @@ const M = {
|
|
|
942
942
|
B: function(e, t, n) {
|
|
943
943
|
const r = e.getHours();
|
|
944
944
|
let a;
|
|
945
|
-
switch (r >= 17 ? a =
|
|
945
|
+
switch (r >= 17 ? a = Y.evening : r >= 12 ? a = Y.afternoon : r >= 4 ? a = Y.morning : a = Y.night, t) {
|
|
946
946
|
case "B":
|
|
947
947
|
case "BB":
|
|
948
948
|
case "BBB":
|
|
@@ -969,11 +969,11 @@ const M = {
|
|
|
969
969
|
let r = e.getHours() % 12;
|
|
970
970
|
return r === 0 && (r = 12), n.ordinalNumber(r, { unit: "hour" });
|
|
971
971
|
}
|
|
972
|
-
return
|
|
972
|
+
return b.h(e, t);
|
|
973
973
|
},
|
|
974
974
|
// Hour [0-23]
|
|
975
975
|
H: function(e, t, n) {
|
|
976
|
-
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) :
|
|
976
|
+
return t === "Ho" ? n.ordinalNumber(e.getHours(), { unit: "hour" }) : b.H(e, t);
|
|
977
977
|
},
|
|
978
978
|
// Hour [0-11]
|
|
979
979
|
K: function(e, t, n) {
|
|
@@ -987,15 +987,15 @@ const M = {
|
|
|
987
987
|
},
|
|
988
988
|
// Minute
|
|
989
989
|
m: function(e, t, n) {
|
|
990
|
-
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) :
|
|
990
|
+
return t === "mo" ? n.ordinalNumber(e.getMinutes(), { unit: "minute" }) : b.m(e, t);
|
|
991
991
|
},
|
|
992
992
|
// Second
|
|
993
993
|
s: function(e, t, n) {
|
|
994
|
-
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) :
|
|
994
|
+
return t === "so" ? n.ordinalNumber(e.getSeconds(), { unit: "second" }) : b.s(e, t);
|
|
995
995
|
},
|
|
996
996
|
// Fraction of second
|
|
997
997
|
S: function(e, t) {
|
|
998
|
-
return
|
|
998
|
+
return b.S(e, t);
|
|
999
999
|
},
|
|
1000
1000
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1001
1001
|
X: function(e, t, n) {
|
|
@@ -1004,7 +1004,7 @@ const M = {
|
|
|
1004
1004
|
return "Z";
|
|
1005
1005
|
switch (t) {
|
|
1006
1006
|
case "X":
|
|
1007
|
-
return
|
|
1007
|
+
return J(r);
|
|
1008
1008
|
case "XXXX":
|
|
1009
1009
|
case "XX":
|
|
1010
1010
|
return O(r);
|
|
@@ -1019,7 +1019,7 @@ const M = {
|
|
|
1019
1019
|
const r = e.getTimezoneOffset();
|
|
1020
1020
|
switch (t) {
|
|
1021
1021
|
case "x":
|
|
1022
|
-
return
|
|
1022
|
+
return J(r);
|
|
1023
1023
|
case "xxxx":
|
|
1024
1024
|
case "xx":
|
|
1025
1025
|
return O(r);
|
|
@@ -1036,7 +1036,7 @@ const M = {
|
|
|
1036
1036
|
case "O":
|
|
1037
1037
|
case "OO":
|
|
1038
1038
|
case "OOO":
|
|
1039
|
-
return "GMT" +
|
|
1039
|
+
return "GMT" + V(r, ":");
|
|
1040
1040
|
case "OOOO":
|
|
1041
1041
|
default:
|
|
1042
1042
|
return "GMT" + O(r, ":");
|
|
@@ -1049,7 +1049,7 @@ const M = {
|
|
|
1049
1049
|
case "z":
|
|
1050
1050
|
case "zz":
|
|
1051
1051
|
case "zzz":
|
|
1052
|
-
return "GMT" +
|
|
1052
|
+
return "GMT" + V(r, ":");
|
|
1053
1053
|
case "zzzz":
|
|
1054
1054
|
default:
|
|
1055
1055
|
return "GMT" + O(r, ":");
|
|
@@ -1066,18 +1066,18 @@ const M = {
|
|
|
1066
1066
|
return f(r, t.length);
|
|
1067
1067
|
}
|
|
1068
1068
|
};
|
|
1069
|
-
function
|
|
1070
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60),
|
|
1071
|
-
return
|
|
1069
|
+
function V(e, t = "") {
|
|
1070
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.trunc(r / 60), s = r % 60;
|
|
1071
|
+
return s === 0 ? n + String(a) : n + String(a) + t + f(s, 2);
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function J(e, t) {
|
|
1074
1074
|
return e % 60 === 0 ? (e > 0 ? "-" : "+") + f(Math.abs(e) / 60, 2) : O(e, t);
|
|
1075
1075
|
}
|
|
1076
1076
|
function O(e, t = "") {
|
|
1077
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = f(Math.trunc(r / 60), 2),
|
|
1078
|
-
return n + a + t +
|
|
1077
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = f(Math.trunc(r / 60), 2), s = f(r % 60, 2);
|
|
1078
|
+
return n + a + t + s;
|
|
1079
1079
|
}
|
|
1080
|
-
const
|
|
1080
|
+
const K = (e, t) => {
|
|
1081
1081
|
switch (e) {
|
|
1082
1082
|
case "P":
|
|
1083
1083
|
return t.date({ width: "short" });
|
|
@@ -1089,7 +1089,7 @@ const ee = (e, t) => {
|
|
|
1089
1089
|
default:
|
|
1090
1090
|
return t.date({ width: "full" });
|
|
1091
1091
|
}
|
|
1092
|
-
},
|
|
1092
|
+
}, ge = (e, t) => {
|
|
1093
1093
|
switch (e) {
|
|
1094
1094
|
case "p":
|
|
1095
1095
|
return t.time({ width: "short" });
|
|
@@ -1101,111 +1101,111 @@ const ee = (e, t) => {
|
|
|
1101
1101
|
default:
|
|
1102
1102
|
return t.time({ width: "full" });
|
|
1103
1103
|
}
|
|
1104
|
-
},
|
|
1104
|
+
}, it = (e, t) => {
|
|
1105
1105
|
const n = e.match(/(P+)(p+)?/) || [], r = n[1], a = n[2];
|
|
1106
1106
|
if (!a)
|
|
1107
|
-
return
|
|
1108
|
-
let
|
|
1107
|
+
return K(e, t);
|
|
1108
|
+
let s;
|
|
1109
1109
|
switch (r) {
|
|
1110
1110
|
case "P":
|
|
1111
|
-
|
|
1111
|
+
s = t.dateTime({ width: "short" });
|
|
1112
1112
|
break;
|
|
1113
1113
|
case "PP":
|
|
1114
|
-
|
|
1114
|
+
s = t.dateTime({ width: "medium" });
|
|
1115
1115
|
break;
|
|
1116
1116
|
case "PPP":
|
|
1117
|
-
|
|
1117
|
+
s = t.dateTime({ width: "long" });
|
|
1118
1118
|
break;
|
|
1119
1119
|
case "PPPP":
|
|
1120
1120
|
default:
|
|
1121
|
-
|
|
1121
|
+
s = t.dateTime({ width: "full" });
|
|
1122
1122
|
break;
|
|
1123
1123
|
}
|
|
1124
|
-
return
|
|
1125
|
-
},
|
|
1126
|
-
p:
|
|
1127
|
-
P:
|
|
1128
|
-
},
|
|
1129
|
-
function
|
|
1130
|
-
return
|
|
1131
|
-
}
|
|
1132
|
-
function
|
|
1133
|
-
return
|
|
1134
|
-
}
|
|
1135
|
-
function
|
|
1136
|
-
const r =
|
|
1137
|
-
if (console.warn(r),
|
|
1138
|
-
}
|
|
1139
|
-
function
|
|
1124
|
+
return s.replace("{{date}}", K(r, t)).replace("{{time}}", ge(a, t));
|
|
1125
|
+
}, ut = {
|
|
1126
|
+
p: ge,
|
|
1127
|
+
P: it
|
|
1128
|
+
}, ct = /^D+$/, ft = /^Y+$/, dt = ["D", "DD", "YY", "YYYY"];
|
|
1129
|
+
function lt(e) {
|
|
1130
|
+
return ct.test(e);
|
|
1131
|
+
}
|
|
1132
|
+
function mt(e) {
|
|
1133
|
+
return ft.test(e);
|
|
1134
|
+
}
|
|
1135
|
+
function ht(e, t, n) {
|
|
1136
|
+
const r = gt(e, t, n);
|
|
1137
|
+
if (console.warn(r), dt.includes(e)) throw new RangeError(r);
|
|
1138
|
+
}
|
|
1139
|
+
function gt(e, t, n) {
|
|
1140
1140
|
const r = e[0] === "Y" ? "years" : "days of the month";
|
|
1141
1141
|
return `Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
1142
1142
|
}
|
|
1143
|
-
function
|
|
1143
|
+
function wt(e) {
|
|
1144
1144
|
return e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]";
|
|
1145
1145
|
}
|
|
1146
|
-
function
|
|
1147
|
-
if (!
|
|
1146
|
+
function Dt(e) {
|
|
1147
|
+
if (!wt(e) && typeof e != "number")
|
|
1148
1148
|
return !1;
|
|
1149
1149
|
const t = d(e);
|
|
1150
1150
|
return !isNaN(Number(t));
|
|
1151
1151
|
}
|
|
1152
|
-
const
|
|
1153
|
-
function
|
|
1154
|
-
var l, y, m, D,
|
|
1155
|
-
const r =
|
|
1156
|
-
if (!
|
|
1152
|
+
const yt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Mt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, bt = /^'([^]*?)'?$/, Tt = /''/g, Ot = /[a-zA-Z]/;
|
|
1153
|
+
function we(e, t, n) {
|
|
1154
|
+
var l, y, m, D, M, x, j, z;
|
|
1155
|
+
const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? de, s = (n == null ? void 0 : n.firstWeekContainsDate) ?? ((y = (l = n == null ? void 0 : n.locale) == null ? void 0 : l.options) == null ? void 0 : y.firstWeekContainsDate) ?? r.firstWeekContainsDate ?? ((D = (m = r.locale) == null ? void 0 : m.options) == null ? void 0 : D.firstWeekContainsDate) ?? 1, o = (n == null ? void 0 : n.weekStartsOn) ?? ((x = (M = n == null ? void 0 : n.locale) == null ? void 0 : M.options) == null ? void 0 : x.weekStartsOn) ?? r.weekStartsOn ?? ((z = (j = r.locale) == null ? void 0 : j.options) == null ? void 0 : z.weekStartsOn) ?? 0, i = d(e);
|
|
1156
|
+
if (!Dt(i))
|
|
1157
1157
|
throw new RangeError("Invalid time value");
|
|
1158
|
-
let u = t.match(
|
|
1158
|
+
let u = t.match(Mt).map((w) => {
|
|
1159
1159
|
const g = w[0];
|
|
1160
1160
|
if (g === "p" || g === "P") {
|
|
1161
|
-
const
|
|
1162
|
-
return
|
|
1161
|
+
const _ = ut[g];
|
|
1162
|
+
return _(w, a.formatLong);
|
|
1163
1163
|
}
|
|
1164
1164
|
return w;
|
|
1165
|
-
}).join("").match(
|
|
1165
|
+
}).join("").match(yt).map((w) => {
|
|
1166
1166
|
if (w === "''")
|
|
1167
1167
|
return { isToken: !1, value: "'" };
|
|
1168
1168
|
const g = w[0];
|
|
1169
1169
|
if (g === "'")
|
|
1170
|
-
return { isToken: !1, value:
|
|
1171
|
-
if (
|
|
1170
|
+
return { isToken: !1, value: xt(w) };
|
|
1171
|
+
if (B[g])
|
|
1172
1172
|
return { isToken: !0, value: w };
|
|
1173
|
-
if (g.match(
|
|
1173
|
+
if (g.match(Ot))
|
|
1174
1174
|
throw new RangeError(
|
|
1175
1175
|
"Format string contains an unescaped latin alphabet character `" + g + "`"
|
|
1176
1176
|
);
|
|
1177
1177
|
return { isToken: !1, value: w };
|
|
1178
1178
|
});
|
|
1179
|
-
a.localize.preprocessor && (u = a.localize.preprocessor(
|
|
1179
|
+
a.localize.preprocessor && (u = a.localize.preprocessor(i, u));
|
|
1180
1180
|
const c = {
|
|
1181
|
-
firstWeekContainsDate:
|
|
1182
|
-
weekStartsOn:
|
|
1181
|
+
firstWeekContainsDate: s,
|
|
1182
|
+
weekStartsOn: o,
|
|
1183
1183
|
locale: a
|
|
1184
1184
|
};
|
|
1185
1185
|
return u.map((w) => {
|
|
1186
1186
|
if (!w.isToken) return w.value;
|
|
1187
1187
|
const g = w.value;
|
|
1188
|
-
(!(n != null && n.useAdditionalWeekYearTokens) &&
|
|
1189
|
-
const
|
|
1190
|
-
return
|
|
1188
|
+
(!(n != null && n.useAdditionalWeekYearTokens) && mt(g) || !(n != null && n.useAdditionalDayOfYearTokens) && lt(g)) && ht(g, t, String(e));
|
|
1189
|
+
const _ = B[g[0]];
|
|
1190
|
+
return _(i, g, a.localize, c);
|
|
1191
1191
|
}).join("");
|
|
1192
1192
|
}
|
|
1193
|
-
function
|
|
1194
|
-
const t = e.match(
|
|
1195
|
-
return t ? t[1].replace(
|
|
1193
|
+
function xt(e) {
|
|
1194
|
+
const t = e.match(bt);
|
|
1195
|
+
return t ? t[1].replace(Tt, "'") : e;
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function I(e, t) {
|
|
1198
1198
|
const n = d(e), r = d(t), a = n.getTime() - r.getTime();
|
|
1199
1199
|
return a < 0 ? -1 : a > 0 ? 1 : a;
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function Yt(e) {
|
|
1202
1202
|
return T(e, Date.now());
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1205
|
-
const n = d(e), r = d(t), a = n.getFullYear() - r.getFullYear(),
|
|
1206
|
-
return a * 12 +
|
|
1204
|
+
function Nt(e, t) {
|
|
1205
|
+
const n = d(e), r = d(t), a = n.getFullYear() - r.getFullYear(), s = n.getMonth() - r.getMonth();
|
|
1206
|
+
return a * 12 + s;
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function Pt(e) {
|
|
1209
1209
|
return (t) => {
|
|
1210
1210
|
const r = (e ? Math[e] : Math.trunc)(t);
|
|
1211
1211
|
return r === 0 ? 0 : r;
|
|
@@ -1214,222 +1214,105 @@ function Wt(e) {
|
|
|
1214
1214
|
function vt(e, t) {
|
|
1215
1215
|
return +d(e) - +d(t);
|
|
1216
1216
|
}
|
|
1217
|
-
function
|
|
1217
|
+
function pt(e) {
|
|
1218
1218
|
const t = d(e);
|
|
1219
1219
|
return t.setHours(23, 59, 59, 999), t;
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1221
|
+
function kt(e) {
|
|
1222
1222
|
const t = d(e), n = t.getMonth();
|
|
1223
1223
|
return t.setFullYear(t.getFullYear(), n + 1, 0), t.setHours(23, 59, 59, 999), t;
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1225
|
+
function Wt(e) {
|
|
1226
1226
|
const t = d(e);
|
|
1227
|
-
return +
|
|
1227
|
+
return +pt(t) == +kt(t);
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1230
|
-
const n = d(e), r = d(t), a =
|
|
1231
|
-
|
|
1229
|
+
function It(e, t) {
|
|
1230
|
+
const n = d(e), r = d(t), a = I(n, r), s = Math.abs(
|
|
1231
|
+
Nt(n, r)
|
|
1232
1232
|
);
|
|
1233
|
-
let
|
|
1234
|
-
if (
|
|
1235
|
-
|
|
1233
|
+
let o;
|
|
1234
|
+
if (s < 1)
|
|
1235
|
+
o = 0;
|
|
1236
1236
|
else {
|
|
1237
|
-
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a *
|
|
1238
|
-
let
|
|
1239
|
-
|
|
1237
|
+
n.getMonth() === 1 && n.getDate() > 27 && n.setDate(30), n.setMonth(n.getMonth() - a * s);
|
|
1238
|
+
let i = I(n, r) === -a;
|
|
1239
|
+
Wt(d(e)) && s === 1 && I(e, r) === 1 && (i = !1), o = a * (s - Number(i));
|
|
1240
1240
|
}
|
|
1241
|
-
return
|
|
1241
|
+
return o === 0 ? 0 : o;
|
|
1242
1242
|
}
|
|
1243
|
-
function
|
|
1243
|
+
function St(e, t, n) {
|
|
1244
1244
|
const r = vt(e, t) / 1e3;
|
|
1245
|
-
return
|
|
1245
|
+
return Pt(n == null ? void 0 : n.roundingMethod)(r);
|
|
1246
1246
|
}
|
|
1247
|
-
function
|
|
1248
|
-
const r =
|
|
1249
|
-
if (isNaN(
|
|
1247
|
+
function Ft(e, t, n) {
|
|
1248
|
+
const r = P(), a = (n == null ? void 0 : n.locale) ?? r.locale ?? de, s = 2520, o = I(e, t);
|
|
1249
|
+
if (isNaN(o))
|
|
1250
1250
|
throw new RangeError("Invalid time value");
|
|
1251
|
-
const
|
|
1251
|
+
const i = Object.assign({}, n, {
|
|
1252
1252
|
addSuffix: n == null ? void 0 : n.addSuffix,
|
|
1253
|
-
comparison:
|
|
1253
|
+
comparison: o
|
|
1254
1254
|
});
|
|
1255
1255
|
let u, c;
|
|
1256
|
-
|
|
1257
|
-
const l =
|
|
1256
|
+
o > 0 ? (u = d(t), c = d(e)) : (u = d(e), c = d(t));
|
|
1257
|
+
const l = St(c, u), y = (S(c) - S(u)) / 1e3, m = Math.round((l - y) / 60);
|
|
1258
1258
|
let D;
|
|
1259
1259
|
if (m < 2)
|
|
1260
|
-
return n != null && n.includeSeconds ? l < 5 ? a.formatDistance("lessThanXSeconds", 5,
|
|
1260
|
+
return n != null && n.includeSeconds ? l < 5 ? a.formatDistance("lessThanXSeconds", 5, i) : l < 10 ? a.formatDistance("lessThanXSeconds", 10, i) : l < 20 ? a.formatDistance("lessThanXSeconds", 20, i) : l < 40 ? a.formatDistance("halfAMinute", 0, i) : l < 60 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", 1, i) : m === 0 ? a.formatDistance("lessThanXMinutes", 1, i) : a.formatDistance("xMinutes", m, i);
|
|
1261
1261
|
if (m < 45)
|
|
1262
|
-
return a.formatDistance("xMinutes", m,
|
|
1262
|
+
return a.formatDistance("xMinutes", m, i);
|
|
1263
1263
|
if (m < 90)
|
|
1264
|
-
return a.formatDistance("aboutXHours", 1,
|
|
1265
|
-
if (m <
|
|
1266
|
-
const
|
|
1267
|
-
return a.formatDistance("aboutXHours",
|
|
1264
|
+
return a.formatDistance("aboutXHours", 1, i);
|
|
1265
|
+
if (m < Q) {
|
|
1266
|
+
const M = Math.round(m / 60);
|
|
1267
|
+
return a.formatDistance("aboutXHours", M, i);
|
|
1268
1268
|
} else {
|
|
1269
|
-
if (m <
|
|
1270
|
-
return a.formatDistance("xDays", 1,
|
|
1271
|
-
if (m <
|
|
1272
|
-
const
|
|
1273
|
-
return a.formatDistance("xDays",
|
|
1274
|
-
} else if (m <
|
|
1275
|
-
return D = Math.round(m /
|
|
1269
|
+
if (m < s)
|
|
1270
|
+
return a.formatDistance("xDays", 1, i);
|
|
1271
|
+
if (m < W) {
|
|
1272
|
+
const M = Math.round(m / Q);
|
|
1273
|
+
return a.formatDistance("xDays", M, i);
|
|
1274
|
+
} else if (m < W * 2)
|
|
1275
|
+
return D = Math.round(m / W), a.formatDistance("aboutXMonths", D, i);
|
|
1276
1276
|
}
|
|
1277
|
-
if (D =
|
|
1278
|
-
const
|
|
1279
|
-
return a.formatDistance("xMonths",
|
|
1277
|
+
if (D = It(c, u), D < 12) {
|
|
1278
|
+
const M = Math.round(m / W);
|
|
1279
|
+
return a.formatDistance("xMonths", M, i);
|
|
1280
1280
|
} else {
|
|
1281
|
-
const
|
|
1282
|
-
return
|
|
1281
|
+
const M = D % 12, x = Math.trunc(D / 12);
|
|
1282
|
+
return M < 3 ? a.formatDistance("aboutXYears", x, i) : M < 9 ? a.formatDistance("overXYears", x, i) : a.formatDistance("almostXYears", x + 1, i);
|
|
1283
1283
|
}
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1286
|
-
return
|
|
1285
|
+
function Ct(e, t) {
|
|
1286
|
+
return Ft(e, Yt(e), t);
|
|
1287
1287
|
}
|
|
1288
|
-
function
|
|
1289
|
-
return Object.assign({},
|
|
1288
|
+
function Et() {
|
|
1289
|
+
return Object.assign({}, P());
|
|
1290
1290
|
}
|
|
1291
|
-
function
|
|
1292
|
-
const r = Lt(e);
|
|
1293
|
-
|
|
1294
|
-
if (r.date) {
|
|
1295
|
-
const u = qt(r.date, 2);
|
|
1296
|
-
a = Rt(u.restDateString, u.year);
|
|
1297
|
-
}
|
|
1298
|
-
if (!a || isNaN(a.getTime()))
|
|
1299
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
1300
|
-
const i = a.getTime();
|
|
1301
|
-
let s = 0, o;
|
|
1302
|
-
if (r.time && (s = Zt(r.time), isNaN(s)))
|
|
1303
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
1304
|
-
if (r.timezone) {
|
|
1305
|
-
if (o = At(r.timezone), isNaN(o))
|
|
1306
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
1307
|
-
} else {
|
|
1308
|
-
const u = new Date(i + s), c = /* @__PURE__ */ new Date(0);
|
|
1309
|
-
return c.setFullYear(
|
|
1310
|
-
u.getUTCFullYear(),
|
|
1311
|
-
u.getUTCMonth(),
|
|
1312
|
-
u.getUTCDate()
|
|
1313
|
-
), c.setHours(
|
|
1314
|
-
u.getUTCHours(),
|
|
1315
|
-
u.getUTCMinutes(),
|
|
1316
|
-
u.getUTCSeconds(),
|
|
1317
|
-
u.getUTCMilliseconds()
|
|
1318
|
-
), c;
|
|
1319
|
-
}
|
|
1320
|
-
return new Date(i + s + o);
|
|
1321
|
-
}
|
|
1322
|
-
const I = {
|
|
1323
|
-
dateTimeDelimiter: /[T ]/,
|
|
1324
|
-
timeZoneDelimiter: /[Z ]/i,
|
|
1325
|
-
timezone: /([Z+-].*)$/
|
|
1326
|
-
}, Ut = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, Xt = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, zt = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
1327
|
-
function Lt(e) {
|
|
1328
|
-
const t = {}, n = e.split(I.dateTimeDelimiter);
|
|
1329
|
-
let r;
|
|
1330
|
-
if (n.length > 2)
|
|
1331
|
-
return t;
|
|
1332
|
-
if (/:/.test(n[0]) ? r = n[0] : (t.date = n[0], r = n[1], I.timeZoneDelimiter.test(t.date) && (t.date = e.split(I.timeZoneDelimiter)[0], r = e.substr(
|
|
1333
|
-
t.date.length,
|
|
1334
|
-
e.length
|
|
1335
|
-
))), r) {
|
|
1336
|
-
const a = I.timezone.exec(r);
|
|
1337
|
-
a ? (t.time = r.replace(a[1], ""), t.timezone = a[1]) : t.time = r;
|
|
1338
|
-
}
|
|
1339
|
-
return t;
|
|
1291
|
+
function ee(e, t, n) {
|
|
1292
|
+
const r = Et(), a = Lt(e, n.timeZone, n.locale ?? r.locale);
|
|
1293
|
+
return "formatToParts" in a ? Ht(a, t) : _t(a, t);
|
|
1340
1294
|
}
|
|
1341
|
-
function
|
|
1342
|
-
const n = new RegExp(
|
|
1343
|
-
"^(?:(\\d{4}|[+-]\\d{" + (4 + t) + "})|(\\d{2}|[+-]\\d{" + (2 + t) + "})$)"
|
|
1344
|
-
), r = e.match(n);
|
|
1345
|
-
if (!r) return { year: NaN, restDateString: "" };
|
|
1346
|
-
const a = r[1] ? parseInt(r[1]) : null, i = r[2] ? parseInt(r[2]) : null;
|
|
1347
|
-
return {
|
|
1348
|
-
year: i === null ? a : i * 100,
|
|
1349
|
-
restDateString: e.slice((r[1] || r[2]).length)
|
|
1350
|
-
};
|
|
1351
|
-
}
|
|
1352
|
-
function Rt(e, t) {
|
|
1353
|
-
if (t === null) return /* @__PURE__ */ new Date(NaN);
|
|
1354
|
-
const n = e.match(Ut);
|
|
1355
|
-
if (!n) return /* @__PURE__ */ new Date(NaN);
|
|
1356
|
-
const r = !!n[4], a = k(n[1]), i = k(n[2]) - 1, s = k(n[3]), o = k(n[4]), u = k(n[5]) - 1;
|
|
1357
|
-
if (r)
|
|
1358
|
-
return Vt(t, o, u) ? jt(t, o, u) : /* @__PURE__ */ new Date(NaN);
|
|
1359
|
-
{
|
|
1360
|
-
const c = /* @__PURE__ */ new Date(0);
|
|
1361
|
-
return !Gt(t, i, s) || !Bt(t, a) ? /* @__PURE__ */ new Date(NaN) : (c.setUTCFullYear(t, i, Math.max(a, s)), c);
|
|
1362
|
-
}
|
|
1363
|
-
}
|
|
1364
|
-
function k(e) {
|
|
1365
|
-
return e ? parseInt(e) : 1;
|
|
1366
|
-
}
|
|
1367
|
-
function Zt(e) {
|
|
1368
|
-
const t = e.match(Xt);
|
|
1369
|
-
if (!t) return NaN;
|
|
1370
|
-
const n = U(t[1]), r = U(t[2]), a = U(t[3]);
|
|
1371
|
-
return Jt(n, r, a) ? n * ge + r * he + a * 1e3 : NaN;
|
|
1372
|
-
}
|
|
1373
|
-
function U(e) {
|
|
1374
|
-
return e && parseFloat(e.replace(",", ".")) || 0;
|
|
1375
|
-
}
|
|
1376
|
-
function At(e) {
|
|
1377
|
-
if (e === "Z") return 0;
|
|
1378
|
-
const t = e.match(zt);
|
|
1379
|
-
if (!t) return 0;
|
|
1380
|
-
const n = t[1] === "+" ? -1 : 1, r = parseInt(t[2]), a = t[3] && parseInt(t[3]) || 0;
|
|
1381
|
-
return Kt(r, a) ? n * (r * ge + a * he) : NaN;
|
|
1382
|
-
}
|
|
1383
|
-
function jt(e, t, n) {
|
|
1384
|
-
const r = /* @__PURE__ */ new Date(0);
|
|
1385
|
-
r.setUTCFullYear(e, 0, 4);
|
|
1386
|
-
const a = r.getUTCDay() || 7, i = (t - 1) * 7 + n + 1 - a;
|
|
1387
|
-
return r.setUTCDate(r.getUTCDate() + i), r;
|
|
1388
|
-
}
|
|
1389
|
-
const Qt = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1390
|
-
function be(e) {
|
|
1391
|
-
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
1392
|
-
}
|
|
1393
|
-
function Gt(e, t, n) {
|
|
1394
|
-
return t >= 0 && t <= 11 && n >= 1 && n <= (Qt[t] || (be(e) ? 29 : 28));
|
|
1395
|
-
}
|
|
1396
|
-
function Bt(e, t) {
|
|
1397
|
-
return t >= 1 && t <= (be(e) ? 366 : 365);
|
|
1398
|
-
}
|
|
1399
|
-
function Vt(e, t, n) {
|
|
1400
|
-
return t >= 1 && t <= 53 && n >= 0 && n <= 6;
|
|
1401
|
-
}
|
|
1402
|
-
function Jt(e, t, n) {
|
|
1403
|
-
return e === 24 ? t === 0 && n === 0 : n >= 0 && n < 60 && t >= 0 && t < 60 && e >= 0 && e < 25;
|
|
1404
|
-
}
|
|
1405
|
-
function Kt(e, t) {
|
|
1406
|
-
return t >= 0 && t <= 59;
|
|
1407
|
-
}
|
|
1408
|
-
function te(e, t, n) {
|
|
1409
|
-
const r = _t(), a = nn(e, n.timeZone, n.locale ?? r.locale);
|
|
1410
|
-
return "formatToParts" in a ? en(a, t) : tn(a, t);
|
|
1411
|
-
}
|
|
1412
|
-
function en(e, t) {
|
|
1295
|
+
function Ht(e, t) {
|
|
1413
1296
|
const n = e.formatToParts(t);
|
|
1414
1297
|
for (let r = n.length - 1; r >= 0; --r)
|
|
1415
1298
|
if (n[r].type === "timeZoneName")
|
|
1416
1299
|
return n[r].value;
|
|
1417
1300
|
}
|
|
1418
|
-
function
|
|
1301
|
+
function _t(e, t) {
|
|
1419
1302
|
const n = e.format(t).replace(/\u200E/g, ""), r = / [\w-+ ]+$/.exec(n);
|
|
1420
1303
|
return r ? r[0].substr(1) : "";
|
|
1421
1304
|
}
|
|
1422
|
-
function
|
|
1305
|
+
function Lt(e, t, n) {
|
|
1423
1306
|
return new Intl.DateTimeFormat(n ? [n.code, "en-US"] : void 0, {
|
|
1424
1307
|
timeZone: t,
|
|
1425
1308
|
timeZoneName: e
|
|
1426
1309
|
});
|
|
1427
1310
|
}
|
|
1428
|
-
function
|
|
1429
|
-
const n =
|
|
1430
|
-
return "formatToParts" in n ?
|
|
1311
|
+
function Xt(e, t) {
|
|
1312
|
+
const n = qt(t);
|
|
1313
|
+
return "formatToParts" in n ? Zt(n, e) : Ut(n, e);
|
|
1431
1314
|
}
|
|
1432
|
-
const
|
|
1315
|
+
const $t = {
|
|
1433
1316
|
year: 0,
|
|
1434
1317
|
month: 1,
|
|
1435
1318
|
day: 2,
|
|
@@ -1437,12 +1320,12 @@ const an = {
|
|
|
1437
1320
|
minute: 4,
|
|
1438
1321
|
second: 5
|
|
1439
1322
|
};
|
|
1440
|
-
function
|
|
1323
|
+
function Zt(e, t) {
|
|
1441
1324
|
try {
|
|
1442
1325
|
const n = e.formatToParts(t), r = [];
|
|
1443
1326
|
for (let a = 0; a < n.length; a++) {
|
|
1444
|
-
const
|
|
1445
|
-
|
|
1327
|
+
const s = $t[n[a].type];
|
|
1328
|
+
s !== void 0 && (r[s] = parseInt(n[a].value, 10));
|
|
1446
1329
|
}
|
|
1447
1330
|
return r;
|
|
1448
1331
|
} catch (n) {
|
|
@@ -1451,7 +1334,7 @@ function sn(e, t) {
|
|
|
1451
1334
|
throw n;
|
|
1452
1335
|
}
|
|
1453
1336
|
}
|
|
1454
|
-
function
|
|
1337
|
+
function Ut(e, t) {
|
|
1455
1338
|
const n = e.format(t), r = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);
|
|
1456
1339
|
return [
|
|
1457
1340
|
parseInt(r[3], 10),
|
|
@@ -1462,7 +1345,7 @@ function on(e, t) {
|
|
|
1462
1345
|
parseInt(r[6], 10)
|
|
1463
1346
|
];
|
|
1464
1347
|
}
|
|
1465
|
-
const X = {},
|
|
1348
|
+
const X = {}, te = new Intl.DateTimeFormat("en-US", {
|
|
1466
1349
|
hourCycle: "h23",
|
|
1467
1350
|
timeZone: "America/New_York",
|
|
1468
1351
|
year: "numeric",
|
|
@@ -1471,9 +1354,9 @@ const X = {}, ne = new Intl.DateTimeFormat("en-US", {
|
|
|
1471
1354
|
hour: "2-digit",
|
|
1472
1355
|
minute: "2-digit",
|
|
1473
1356
|
second: "2-digit"
|
|
1474
|
-
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")),
|
|
1475
|
-
function
|
|
1476
|
-
return X[e] || (X[e] =
|
|
1357
|
+
}).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), At = te === "06/25/2014, 00:00:00" || te === "06/25/2014 00:00:00";
|
|
1358
|
+
function qt(e) {
|
|
1359
|
+
return X[e] || (X[e] = At ? new Intl.DateTimeFormat("en-US", {
|
|
1477
1360
|
hourCycle: "h23",
|
|
1478
1361
|
timeZone: e,
|
|
1479
1362
|
year: "numeric",
|
|
@@ -1493,71 +1376,71 @@ function cn(e) {
|
|
|
1493
1376
|
second: "2-digit"
|
|
1494
1377
|
})), X[e];
|
|
1495
1378
|
}
|
|
1496
|
-
function
|
|
1497
|
-
const
|
|
1498
|
-
return
|
|
1379
|
+
function R(e, t, n, r, a, s, o) {
|
|
1380
|
+
const i = /* @__PURE__ */ new Date(0);
|
|
1381
|
+
return i.setUTCFullYear(e, t, n), i.setUTCHours(r, a, s, o), i;
|
|
1499
1382
|
}
|
|
1500
|
-
const
|
|
1383
|
+
const ne = 36e5, Rt = 6e4, $ = {
|
|
1501
1384
|
timezoneZ: /^(Z)$/,
|
|
1502
1385
|
timezoneHH: /^([+-]\d{2})$/,
|
|
1503
1386
|
timezoneHHMM: /^([+-])(\d{2}):?(\d{2})$/
|
|
1504
1387
|
};
|
|
1505
|
-
function
|
|
1388
|
+
function H(e, t, n) {
|
|
1506
1389
|
if (!e)
|
|
1507
1390
|
return 0;
|
|
1508
|
-
let r =
|
|
1391
|
+
let r = $.timezoneZ.exec(e);
|
|
1509
1392
|
if (r)
|
|
1510
1393
|
return 0;
|
|
1511
|
-
let a,
|
|
1512
|
-
if (r =
|
|
1513
|
-
return a = parseInt(r[1], 10),
|
|
1514
|
-
if (r =
|
|
1394
|
+
let a, s;
|
|
1395
|
+
if (r = $.timezoneHH.exec(e), r)
|
|
1396
|
+
return a = parseInt(r[1], 10), re(a) ? -(a * ne) : NaN;
|
|
1397
|
+
if (r = $.timezoneHHMM.exec(e), r) {
|
|
1515
1398
|
a = parseInt(r[2], 10);
|
|
1516
|
-
const
|
|
1517
|
-
return
|
|
1399
|
+
const o = parseInt(r[3], 10);
|
|
1400
|
+
return re(a, o) ? (s = Math.abs(a) * ne + o * Rt, r[1] === "+" ? -s : s) : NaN;
|
|
1518
1401
|
}
|
|
1519
|
-
if (
|
|
1402
|
+
if (Qt(e)) {
|
|
1520
1403
|
t = new Date(t || Date.now());
|
|
1521
|
-
const
|
|
1522
|
-
return -(n ?
|
|
1404
|
+
const o = n ? t : jt(t), i = q(o, e);
|
|
1405
|
+
return -(n ? i : zt(t, i, e));
|
|
1523
1406
|
}
|
|
1524
1407
|
return NaN;
|
|
1525
1408
|
}
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
1409
|
+
function jt(e) {
|
|
1410
|
+
return R(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds());
|
|
1528
1411
|
}
|
|
1529
|
-
function
|
|
1530
|
-
const n =
|
|
1412
|
+
function q(e, t) {
|
|
1413
|
+
const n = Xt(e, t), r = R(n[0], n[1] - 1, n[2], n[3] % 24, n[4], n[5], 0).getTime();
|
|
1531
1414
|
let a = e.getTime();
|
|
1532
|
-
const
|
|
1533
|
-
return a -=
|
|
1415
|
+
const s = a % 1e3;
|
|
1416
|
+
return a -= s >= 0 ? s : 1e3 + s, r - a;
|
|
1534
1417
|
}
|
|
1535
|
-
function
|
|
1418
|
+
function zt(e, t, n) {
|
|
1536
1419
|
let a = e.getTime() - t;
|
|
1537
|
-
const
|
|
1538
|
-
if (t ===
|
|
1420
|
+
const s = q(new Date(a), n);
|
|
1421
|
+
if (t === s)
|
|
1539
1422
|
return t;
|
|
1540
|
-
a -=
|
|
1541
|
-
const
|
|
1542
|
-
return
|
|
1423
|
+
a -= s - t;
|
|
1424
|
+
const o = q(new Date(a), n);
|
|
1425
|
+
return s === o ? s : Math.max(s, o);
|
|
1543
1426
|
}
|
|
1544
|
-
function
|
|
1427
|
+
function re(e, t) {
|
|
1545
1428
|
return -23 <= e && e <= 23 && (t == null || 0 <= t && t <= 59);
|
|
1546
1429
|
}
|
|
1547
|
-
const
|
|
1548
|
-
function
|
|
1549
|
-
if (
|
|
1430
|
+
const ae = {};
|
|
1431
|
+
function Qt(e) {
|
|
1432
|
+
if (ae[e])
|
|
1550
1433
|
return !0;
|
|
1551
1434
|
try {
|
|
1552
|
-
return new Intl.DateTimeFormat(void 0, { timeZone: e }),
|
|
1435
|
+
return new Intl.DateTimeFormat(void 0, { timeZone: e }), ae[e] = !0, !0;
|
|
1553
1436
|
} catch {
|
|
1554
1437
|
return !1;
|
|
1555
1438
|
}
|
|
1556
1439
|
}
|
|
1557
|
-
const
|
|
1440
|
+
const Gt = 60 * 1e3, Bt = {
|
|
1558
1441
|
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
1559
1442
|
X: function(e, t, n) {
|
|
1560
|
-
const r =
|
|
1443
|
+
const r = Z(n.timeZone, e);
|
|
1561
1444
|
if (r === 0)
|
|
1562
1445
|
return "Z";
|
|
1563
1446
|
switch (t) {
|
|
@@ -1565,39 +1448,39 @@ const hn = 60 * 1e3, gn = {
|
|
|
1565
1448
|
return se(r);
|
|
1566
1449
|
case "XXXX":
|
|
1567
1450
|
case "XX":
|
|
1568
|
-
return
|
|
1451
|
+
return N(r);
|
|
1569
1452
|
case "XXXXX":
|
|
1570
1453
|
case "XXX":
|
|
1571
1454
|
default:
|
|
1572
|
-
return
|
|
1455
|
+
return N(r, ":");
|
|
1573
1456
|
}
|
|
1574
1457
|
},
|
|
1575
1458
|
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
1576
1459
|
x: function(e, t, n) {
|
|
1577
|
-
const r =
|
|
1460
|
+
const r = Z(n.timeZone, e);
|
|
1578
1461
|
switch (t) {
|
|
1579
1462
|
case "x":
|
|
1580
1463
|
return se(r);
|
|
1581
1464
|
case "xxxx":
|
|
1582
1465
|
case "xx":
|
|
1583
|
-
return
|
|
1466
|
+
return N(r);
|
|
1584
1467
|
case "xxxxx":
|
|
1585
1468
|
case "xxx":
|
|
1586
1469
|
default:
|
|
1587
|
-
return
|
|
1470
|
+
return N(r, ":");
|
|
1588
1471
|
}
|
|
1589
1472
|
},
|
|
1590
1473
|
// Timezone (GMT)
|
|
1591
1474
|
O: function(e, t, n) {
|
|
1592
|
-
const r =
|
|
1475
|
+
const r = Z(n.timeZone, e);
|
|
1593
1476
|
switch (t) {
|
|
1594
1477
|
case "O":
|
|
1595
1478
|
case "OO":
|
|
1596
1479
|
case "OOO":
|
|
1597
|
-
return "GMT" +
|
|
1480
|
+
return "GMT" + Vt(r, ":");
|
|
1598
1481
|
case "OOOO":
|
|
1599
1482
|
default:
|
|
1600
|
-
return "GMT" +
|
|
1483
|
+
return "GMT" + N(r, ":");
|
|
1601
1484
|
}
|
|
1602
1485
|
},
|
|
1603
1486
|
// Timezone (specific non-location)
|
|
@@ -1606,42 +1489,42 @@ const hn = 60 * 1e3, gn = {
|
|
|
1606
1489
|
case "z":
|
|
1607
1490
|
case "zz":
|
|
1608
1491
|
case "zzz":
|
|
1609
|
-
return
|
|
1492
|
+
return ee("short", e, n);
|
|
1610
1493
|
case "zzzz":
|
|
1611
1494
|
default:
|
|
1612
|
-
return
|
|
1495
|
+
return ee("long", e, n);
|
|
1613
1496
|
}
|
|
1614
1497
|
}
|
|
1615
1498
|
};
|
|
1616
|
-
function
|
|
1617
|
-
const n = e ?
|
|
1499
|
+
function Z(e, t) {
|
|
1500
|
+
const n = e ? H(e, t, !0) / Gt : (t == null ? void 0 : t.getTimezoneOffset()) ?? 0;
|
|
1618
1501
|
if (Number.isNaN(n))
|
|
1619
1502
|
throw new RangeError("Invalid time zone specified: " + e);
|
|
1620
1503
|
return n;
|
|
1621
1504
|
}
|
|
1622
|
-
function
|
|
1505
|
+
function C(e, t) {
|
|
1623
1506
|
const n = e < 0 ? "-" : "";
|
|
1624
1507
|
let r = Math.abs(e).toString();
|
|
1625
1508
|
for (; r.length < t; )
|
|
1626
1509
|
r = "0" + r;
|
|
1627
1510
|
return n + r;
|
|
1628
1511
|
}
|
|
1629
|
-
function
|
|
1630
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a =
|
|
1631
|
-
return n + a + t +
|
|
1512
|
+
function N(e, t = "") {
|
|
1513
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = C(Math.floor(r / 60), 2), s = C(Math.floor(r % 60), 2);
|
|
1514
|
+
return n + a + t + s;
|
|
1632
1515
|
}
|
|
1633
1516
|
function se(e, t) {
|
|
1634
|
-
return e % 60 === 0 ? (e > 0 ? "-" : "+") +
|
|
1517
|
+
return e % 60 === 0 ? (e > 0 ? "-" : "+") + C(Math.abs(e) / 60, 2) : N(e, t);
|
|
1635
1518
|
}
|
|
1636
|
-
function
|
|
1637
|
-
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60),
|
|
1638
|
-
return
|
|
1519
|
+
function Vt(e, t = "") {
|
|
1520
|
+
const n = e > 0 ? "-" : "+", r = Math.abs(e), a = Math.floor(r / 60), s = r % 60;
|
|
1521
|
+
return s === 0 ? n + String(a) : n + String(a) + t + C(s, 2);
|
|
1639
1522
|
}
|
|
1640
1523
|
function oe(e) {
|
|
1641
1524
|
const t = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
|
|
1642
1525
|
return t.setUTCFullYear(e.getFullYear()), +e - +t;
|
|
1643
1526
|
}
|
|
1644
|
-
const
|
|
1527
|
+
const De = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/, U = 36e5, ie = 6e4, Jt = 2, h = {
|
|
1645
1528
|
dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
|
|
1646
1529
|
datePattern: /^([0-9W+-]+)(.*)/,
|
|
1647
1530
|
// year tokens
|
|
@@ -1673,14 +1556,14 @@ const Dn = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)
|
|
|
1673
1556
|
HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
1674
1557
|
HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
|
|
1675
1558
|
// time zone tokens (to identify the presence of a tz)
|
|
1676
|
-
timeZone:
|
|
1559
|
+
timeZone: De
|
|
1677
1560
|
};
|
|
1678
|
-
function
|
|
1561
|
+
function E(e, t = {}) {
|
|
1679
1562
|
if (arguments.length < 1)
|
|
1680
1563
|
throw new TypeError("1 argument required, but only " + arguments.length + " present");
|
|
1681
1564
|
if (e === null)
|
|
1682
1565
|
return /* @__PURE__ */ new Date(NaN);
|
|
1683
|
-
const n = t.additionalDigits == null ?
|
|
1566
|
+
const n = t.additionalDigits == null ? Jt : Number(t.additionalDigits);
|
|
1684
1567
|
if (n !== 2 && n !== 1 && n !== 0)
|
|
1685
1568
|
throw new RangeError("additionalDigits must be 0, 1 or 2");
|
|
1686
1569
|
if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
|
|
@@ -1689,24 +1572,24 @@ function Te(e, t = {}) {
|
|
|
1689
1572
|
return new Date(e);
|
|
1690
1573
|
if (Object.prototype.toString.call(e) !== "[object String]")
|
|
1691
1574
|
return /* @__PURE__ */ new Date(NaN);
|
|
1692
|
-
const r =
|
|
1693
|
-
if (
|
|
1575
|
+
const r = Kt(e), { year: a, restDateString: s } = en(r.date, n), o = tn(s, a);
|
|
1576
|
+
if (o === null || isNaN(o.getTime()))
|
|
1694
1577
|
return /* @__PURE__ */ new Date(NaN);
|
|
1695
|
-
if (
|
|
1696
|
-
const
|
|
1578
|
+
if (o) {
|
|
1579
|
+
const i = o.getTime();
|
|
1697
1580
|
let u = 0, c;
|
|
1698
|
-
if (r.time && (u =
|
|
1581
|
+
if (r.time && (u = nn(r.time), u === null || isNaN(u)))
|
|
1699
1582
|
return /* @__PURE__ */ new Date(NaN);
|
|
1700
1583
|
if (r.timeZone || t.timeZone) {
|
|
1701
|
-
if (c =
|
|
1584
|
+
if (c = H(r.timeZone || t.timeZone, new Date(i + u)), isNaN(c))
|
|
1702
1585
|
return /* @__PURE__ */ new Date(NaN);
|
|
1703
1586
|
} else
|
|
1704
|
-
c = oe(new Date(
|
|
1705
|
-
return new Date(
|
|
1587
|
+
c = oe(new Date(i + u)), c = oe(new Date(i + u + c));
|
|
1588
|
+
return new Date(i + u + c);
|
|
1706
1589
|
} else
|
|
1707
1590
|
return /* @__PURE__ */ new Date(NaN);
|
|
1708
1591
|
}
|
|
1709
|
-
function
|
|
1592
|
+
function Kt(e) {
|
|
1710
1593
|
const t = {};
|
|
1711
1594
|
let n = h.dateTimePattern.exec(e), r;
|
|
1712
1595
|
if (n ? (t.date = n[1], r = n[3]) : (n = h.datePattern.exec(e), n ? (t.date = n[1], r = n[2]) : (t.date = null, r = e)), r) {
|
|
@@ -1715,22 +1598,22 @@ function bn(e) {
|
|
|
1715
1598
|
}
|
|
1716
1599
|
return t;
|
|
1717
1600
|
}
|
|
1718
|
-
function
|
|
1601
|
+
function en(e, t) {
|
|
1719
1602
|
if (e) {
|
|
1720
1603
|
const n = h.YYY[t], r = h.YYYYY[t];
|
|
1721
1604
|
let a = h.YYYY.exec(e) || r.exec(e);
|
|
1722
1605
|
if (a) {
|
|
1723
|
-
const
|
|
1606
|
+
const s = a[1];
|
|
1724
1607
|
return {
|
|
1725
|
-
year: parseInt(
|
|
1726
|
-
restDateString: e.slice(
|
|
1608
|
+
year: parseInt(s, 10),
|
|
1609
|
+
restDateString: e.slice(s.length)
|
|
1727
1610
|
};
|
|
1728
1611
|
}
|
|
1729
1612
|
if (a = h.YY.exec(e) || n.exec(e), a) {
|
|
1730
|
-
const
|
|
1613
|
+
const s = a[1];
|
|
1731
1614
|
return {
|
|
1732
|
-
year: parseInt(
|
|
1733
|
-
restDateString: e.slice(
|
|
1615
|
+
year: parseInt(s, 10) * 100,
|
|
1616
|
+
restDateString: e.slice(s.length)
|
|
1734
1617
|
};
|
|
1735
1618
|
}
|
|
1736
1619
|
}
|
|
@@ -1738,120 +1621,193 @@ function Mn(e, t) {
|
|
|
1738
1621
|
year: null
|
|
1739
1622
|
};
|
|
1740
1623
|
}
|
|
1741
|
-
function
|
|
1624
|
+
function tn(e, t) {
|
|
1742
1625
|
if (t === null)
|
|
1743
1626
|
return null;
|
|
1744
1627
|
let n, r, a;
|
|
1745
1628
|
if (!e || !e.length)
|
|
1746
1629
|
return n = /* @__PURE__ */ new Date(0), n.setUTCFullYear(t), n;
|
|
1747
|
-
let
|
|
1748
|
-
if (
|
|
1749
|
-
return n = /* @__PURE__ */ new Date(0), r = parseInt(
|
|
1750
|
-
if (
|
|
1630
|
+
let s = h.MM.exec(e);
|
|
1631
|
+
if (s)
|
|
1632
|
+
return n = /* @__PURE__ */ new Date(0), r = parseInt(s[1], 10) - 1, ce(t, r) ? (n.setUTCFullYear(t, r), n) : /* @__PURE__ */ new Date(NaN);
|
|
1633
|
+
if (s = h.DDD.exec(e), s) {
|
|
1751
1634
|
n = /* @__PURE__ */ new Date(0);
|
|
1752
|
-
const
|
|
1753
|
-
return
|
|
1635
|
+
const o = parseInt(s[1], 10);
|
|
1636
|
+
return sn(t, o) ? (n.setUTCFullYear(t, 0, o), n) : /* @__PURE__ */ new Date(NaN);
|
|
1754
1637
|
}
|
|
1755
|
-
if (
|
|
1756
|
-
n = /* @__PURE__ */ new Date(0), r = parseInt(
|
|
1757
|
-
const
|
|
1758
|
-
return
|
|
1638
|
+
if (s = h.MMDD.exec(e), s) {
|
|
1639
|
+
n = /* @__PURE__ */ new Date(0), r = parseInt(s[1], 10) - 1;
|
|
1640
|
+
const o = parseInt(s[2], 10);
|
|
1641
|
+
return ce(t, r, o) ? (n.setUTCFullYear(t, r, o), n) : /* @__PURE__ */ new Date(NaN);
|
|
1759
1642
|
}
|
|
1760
|
-
if (
|
|
1761
|
-
return a = parseInt(
|
|
1762
|
-
if (
|
|
1763
|
-
a = parseInt(
|
|
1764
|
-
const
|
|
1765
|
-
return
|
|
1643
|
+
if (s = h.Www.exec(e), s)
|
|
1644
|
+
return a = parseInt(s[1], 10) - 1, fe(a) ? ue(t, a) : /* @__PURE__ */ new Date(NaN);
|
|
1645
|
+
if (s = h.WwwD.exec(e), s) {
|
|
1646
|
+
a = parseInt(s[1], 10) - 1;
|
|
1647
|
+
const o = parseInt(s[2], 10) - 1;
|
|
1648
|
+
return fe(a, o) ? ue(t, a, o) : /* @__PURE__ */ new Date(NaN);
|
|
1766
1649
|
}
|
|
1767
1650
|
return null;
|
|
1768
1651
|
}
|
|
1769
|
-
function
|
|
1652
|
+
function nn(e) {
|
|
1770
1653
|
let t, n, r = h.HH.exec(e);
|
|
1771
1654
|
if (r)
|
|
1772
|
-
return t = parseFloat(r[1].replace(",", ".")),
|
|
1655
|
+
return t = parseFloat(r[1].replace(",", ".")), A(t) ? t % 24 * U : NaN;
|
|
1773
1656
|
if (r = h.HHMM.exec(e), r)
|
|
1774
|
-
return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")),
|
|
1657
|
+
return t = parseInt(r[1], 10), n = parseFloat(r[2].replace(",", ".")), A(t, n) ? t % 24 * U + n * ie : NaN;
|
|
1775
1658
|
if (r = h.HHMMSS.exec(e), r) {
|
|
1776
1659
|
t = parseInt(r[1], 10), n = parseInt(r[2], 10);
|
|
1777
1660
|
const a = parseFloat(r[3].replace(",", "."));
|
|
1778
|
-
return
|
|
1661
|
+
return A(t, n, a) ? t % 24 * U + n * ie + a * 1e3 : NaN;
|
|
1779
1662
|
}
|
|
1780
1663
|
return null;
|
|
1781
1664
|
}
|
|
1782
|
-
function
|
|
1665
|
+
function ue(e, t, n) {
|
|
1783
1666
|
t = t || 0, n = n || 0;
|
|
1784
1667
|
const r = /* @__PURE__ */ new Date(0);
|
|
1785
1668
|
r.setUTCFullYear(e, 0, 4);
|
|
1786
|
-
const a = r.getUTCDay() || 7,
|
|
1787
|
-
return r.setUTCDate(r.getUTCDate() +
|
|
1669
|
+
const a = r.getUTCDay() || 7, s = t * 7 + n + 1 - a;
|
|
1670
|
+
return r.setUTCDate(r.getUTCDate() + s), r;
|
|
1788
1671
|
}
|
|
1789
|
-
const
|
|
1790
|
-
function
|
|
1672
|
+
const rn = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], an = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1673
|
+
function ye(e) {
|
|
1791
1674
|
return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
|
|
1792
1675
|
}
|
|
1793
|
-
function
|
|
1676
|
+
function ce(e, t, n) {
|
|
1794
1677
|
if (t < 0 || t > 11)
|
|
1795
1678
|
return !1;
|
|
1796
1679
|
if (n != null) {
|
|
1797
1680
|
if (n < 1)
|
|
1798
1681
|
return !1;
|
|
1799
|
-
const r =
|
|
1800
|
-
if (r && n >
|
|
1682
|
+
const r = ye(e);
|
|
1683
|
+
if (r && n > an[t] || !r && n > rn[t])
|
|
1801
1684
|
return !1;
|
|
1802
1685
|
}
|
|
1803
1686
|
return !0;
|
|
1804
1687
|
}
|
|
1805
|
-
function
|
|
1688
|
+
function sn(e, t) {
|
|
1806
1689
|
if (t < 1)
|
|
1807
1690
|
return !1;
|
|
1808
|
-
const n =
|
|
1691
|
+
const n = ye(e);
|
|
1809
1692
|
return !(n && t > 366 || !n && t > 365);
|
|
1810
1693
|
}
|
|
1811
|
-
function
|
|
1694
|
+
function fe(e, t) {
|
|
1812
1695
|
return !(e < 0 || e > 52 || t != null && (t < 0 || t > 6));
|
|
1813
1696
|
}
|
|
1814
|
-
function
|
|
1697
|
+
function A(e, t, n) {
|
|
1815
1698
|
return !(e < 0 || e >= 25 || t != null && (t < 0 || t >= 60) || n != null && (n < 0 || n >= 60));
|
|
1816
1699
|
}
|
|
1817
|
-
const
|
|
1818
|
-
function
|
|
1700
|
+
const on = /([xXOz]+)|''|'(''|[^'])+('|$)/g;
|
|
1701
|
+
function un(e, t, n = {}) {
|
|
1819
1702
|
t = String(t);
|
|
1820
|
-
const r = t.match(
|
|
1703
|
+
const r = t.match(on);
|
|
1821
1704
|
if (r) {
|
|
1822
|
-
const a =
|
|
1823
|
-
t = r.reduce(function(
|
|
1824
|
-
if (
|
|
1825
|
-
return
|
|
1826
|
-
const
|
|
1827
|
-
return u ? c.substring(0,
|
|
1705
|
+
const a = E(n.originalDate || e, n);
|
|
1706
|
+
t = r.reduce(function(s, o) {
|
|
1707
|
+
if (o[0] === "'")
|
|
1708
|
+
return s;
|
|
1709
|
+
const i = s.indexOf(o), u = s[i - 1] === "'", c = s.replace(o, "'" + Bt[o[0]](a, o, n) + "'");
|
|
1710
|
+
return u ? c.substring(0, i - 1) + c.substring(i + 1) : c;
|
|
1828
1711
|
}, t);
|
|
1829
1712
|
}
|
|
1830
|
-
return
|
|
1713
|
+
return we(e, t, n);
|
|
1831
1714
|
}
|
|
1832
|
-
function
|
|
1833
|
-
e =
|
|
1834
|
-
const r =
|
|
1835
|
-
return
|
|
1715
|
+
function cn(e, t, n) {
|
|
1716
|
+
e = E(e, n);
|
|
1717
|
+
const r = H(t, e, !0), a = new Date(e.getTime() - r), s = /* @__PURE__ */ new Date(0);
|
|
1718
|
+
return s.setFullYear(a.getUTCFullYear(), a.getUTCMonth(), a.getUTCDate()), s.setHours(a.getUTCHours(), a.getUTCMinutes(), a.getUTCSeconds(), a.getUTCMilliseconds()), s;
|
|
1836
1719
|
}
|
|
1837
|
-
function
|
|
1720
|
+
function fn(e, t, n, r) {
|
|
1838
1721
|
return r = {
|
|
1839
1722
|
...r,
|
|
1840
1723
|
timeZone: t,
|
|
1841
1724
|
originalDate: e
|
|
1842
|
-
},
|
|
1725
|
+
}, un(cn(e, t, { timeZone: r.timeZone }), n, r);
|
|
1726
|
+
}
|
|
1727
|
+
function dn(e, t, n) {
|
|
1728
|
+
if (typeof e == "string" && !e.match(De))
|
|
1729
|
+
return E(e, { ...n, timeZone: t });
|
|
1730
|
+
e = E(e, n);
|
|
1731
|
+
const r = R(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()).getTime(), a = H(t, new Date(r));
|
|
1732
|
+
return new Date(r + a);
|
|
1733
|
+
}
|
|
1734
|
+
function gn(e, t) {
|
|
1735
|
+
return e && e !== "auto" ? e : t;
|
|
1736
|
+
}
|
|
1737
|
+
function wn(e, t = /* @__PURE__ */ new Date()) {
|
|
1738
|
+
try {
|
|
1739
|
+
const n = {
|
|
1740
|
+
timeZone: e,
|
|
1741
|
+
timeZoneName: "short"
|
|
1742
|
+
}, a = new Intl.DateTimeFormat("en-US", n).formatToParts(t).find((s) => s.type === "timeZoneName");
|
|
1743
|
+
return (a == null ? void 0 : a.value) || e;
|
|
1744
|
+
} catch {
|
|
1745
|
+
return e;
|
|
1746
|
+
}
|
|
1747
|
+
}
|
|
1748
|
+
function Dn(e) {
|
|
1749
|
+
try {
|
|
1750
|
+
const t = {
|
|
1751
|
+
timeZone: e,
|
|
1752
|
+
timeZoneName: "long"
|
|
1753
|
+
}, r = new Intl.DateTimeFormat("en-US", t).formatToParts(
|
|
1754
|
+
/* @__PURE__ */ new Date()
|
|
1755
|
+
).find((a) => a.type === "timeZoneName");
|
|
1756
|
+
return (r == null ? void 0 : r.value) || e;
|
|
1757
|
+
} catch {
|
|
1758
|
+
return e;
|
|
1759
|
+
}
|
|
1843
1760
|
}
|
|
1761
|
+
function Me(e, t = "auto") {
|
|
1762
|
+
if (!e)
|
|
1763
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
1764
|
+
const n = e.endsWith("Z"), r = /[+-]\d{2}:?\d{2}$/.test(e), a = /\([A-Z]{3,4}\)$/.test(e);
|
|
1765
|
+
if (t === "auto")
|
|
1766
|
+
return n || r || a ? new Date(e) : /* @__PURE__ */ new Date(e + "Z");
|
|
1767
|
+
if (t === "local") {
|
|
1768
|
+
if (n || r) {
|
|
1769
|
+
const s = e.replace(/Z$/, "").replace(/[+-]\d{2}:?\d{2}$/, "");
|
|
1770
|
+
return new Date(s);
|
|
1771
|
+
}
|
|
1772
|
+
return new Date(e);
|
|
1773
|
+
} else return t === "UTC" ? n ? new Date(e) : r ? new Date(e) : /* @__PURE__ */ new Date(e + "Z") : n || r || a ? new Date(e) : dn(e, t);
|
|
1774
|
+
}
|
|
1775
|
+
const ln = "MM/dd/yyyy", yn = (e, t, n, r = "auto") => {
|
|
1776
|
+
if (!e)
|
|
1777
|
+
return "";
|
|
1778
|
+
try {
|
|
1779
|
+
const a = Me(e, r);
|
|
1780
|
+
if (isNaN(a.getTime()))
|
|
1781
|
+
return e;
|
|
1782
|
+
const o = (t && t.trim() ? t : ln).replace(/LLLL/g, "MMMM").replace(/LLL/g, "MMM");
|
|
1783
|
+
return n && n !== "auto" ? fn(a, n, o) : we(a, o);
|
|
1784
|
+
} catch (a) {
|
|
1785
|
+
return console.error("Date formatting error:", a), e;
|
|
1786
|
+
}
|
|
1787
|
+
}, Mn = (e, t = "auto") => {
|
|
1788
|
+
if (!e)
|
|
1789
|
+
return "";
|
|
1790
|
+
try {
|
|
1791
|
+
const n = Me(e, t);
|
|
1792
|
+
return isNaN(n.getTime()) ? e : Ct(n, { addSuffix: !0 });
|
|
1793
|
+
} catch (n) {
|
|
1794
|
+
return console.error("Relative time formatting error:", n), e;
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1844
1797
|
export {
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1798
|
+
yn as a,
|
|
1799
|
+
Dn as b,
|
|
1800
|
+
Ct as c,
|
|
1801
|
+
we as d,
|
|
1802
|
+
T as e,
|
|
1803
|
+
Mn as f,
|
|
1804
|
+
wn as g,
|
|
1805
|
+
mn as h,
|
|
1806
|
+
fn as i,
|
|
1807
|
+
dn as j,
|
|
1808
|
+
cn as k,
|
|
1809
|
+
hn as m,
|
|
1810
|
+
Me as p,
|
|
1811
|
+
gn as r,
|
|
1856
1812
|
d as t
|
|
1857
1813
|
};
|