@evolver-fi/evolver-basics-admin-components 0.0.12 → 0.0.19-beta.1
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/ConfirmButton-jayUa8_J.js.map +1 -1
- package/dist/{ExpandMore-CCOUGfS4.js → ExpandMore-CFLBmfHS.js} +2 -2
- package/dist/{ExpandMore-CCOUGfS4.js.map → ExpandMore-CFLBmfHS.js.map} +1 -1
- package/dist/{JwtTokensRoute-DKaxXWe8.js → JwtTokensRoute-CavNQu9F.js} +3 -3
- package/dist/JwtTokensRoute-CavNQu9F.js.map +1 -0
- package/dist/{ScheduledTaskFormRoute-BpHIsRQr.js → ScheduledTaskFormRoute-CnVsqh-c.js} +11 -10
- package/dist/ScheduledTaskFormRoute-CnVsqh-c.js.map +1 -0
- package/dist/SingleLogMessageRoute-B6hkr7rG.js +305 -0
- package/dist/SingleLogMessageRoute-B6hkr7rG.js.map +1 -0
- package/dist/SingleMessageRoute-Bxix2rv7.js +320 -0
- package/dist/SingleMessageRoute-Bxix2rv7.js.map +1 -0
- package/dist/TableMetadataDisplay-DTDUH1KY.js +330 -0
- package/dist/TableMetadataDisplay-DTDUH1KY.js.map +1 -0
- package/dist/{TriggerablesRoute-CHtOEVBR.js → TriggerablesRoute-BY72XS5U.js} +3 -3
- package/dist/TriggerablesRoute-BY72XS5U.js.map +1 -0
- package/dist/{createSvgIcon-DHqCx8A0.js → createSvgIcon-DCKQGUI3.js} +963 -953
- package/dist/createSvgIcon-DCKQGUI3.js.map +1 -0
- package/dist/jwt-tokens/index.js +1 -1
- package/dist/main/index.js +5 -5
- package/dist/message-log/index.js +1 -1
- package/dist/message-sending/index.js +1 -1
- package/dist/{validation-C1lKYJJR.js → parser-CI353PAC.js} +470 -486
- package/dist/parser-CI353PAC.js.map +1 -0
- package/dist/scheduled-tasks/index.js +1 -1
- package/dist/triggerables/index.js +1 -1
- package/dist/types/admin-components/src/common/format.d.ts +1 -0
- package/dist/types/admin-components/src/common/types.d.ts +27 -0
- package/dist/types/admin-components/src/common/validation.d.ts +5 -0
- package/dist/types/admin-components/src/components/filter/EnumSelectFilter.d.ts +11 -0
- package/dist/types/admin-components/src/components/filter/FilterHelperTexts.d.ts +4 -0
- package/dist/types/admin-components/src/components/filter/FilterLink.d.ts +2 -0
- package/dist/types/admin-components/src/components/filter/TextFilter.d.ts +2 -0
- package/dist/types/admin-components/src/components/filter/types.d.ts +20 -0
- package/dist/types/admin-components/src/components/metadata/TableMetadataDisplay.d.ts +2 -0
- package/dist/types/admin-components/src/components/metadata/utils.d.ts +1 -0
- package/dist/types/admin-components/src/components/table/Pagination.d.ts +7 -0
- package/dist/types/admin-components/src/components/table/Table.d.ts +3 -0
- package/dist/types/admin-components/src/components/table/types.d.ts +48 -0
- package/dist/types/admin-components/src/routes/message-log/messageLogColumns.d.ts +3 -0
- package/dist/types/admin-components/src/routes/message-log/types.d.ts +35 -0
- package/dist/types/admin-components/src/routes/message-sending/loader.d.ts +1 -1
- package/dist/types/admin-components/src/routes/message-sending/messageSendingColumns.d.ts +3 -0
- package/dist/types/admin-components/src/routes/message-sending/types.d.ts +41 -0
- package/dist/validation-BRENvwZ0.js +22 -0
- package/dist/validation-BRENvwZ0.js.map +1 -0
- package/package.json +6 -3
- package/dist/ArrowBack-C8PcQDeL.js +0 -161
- package/dist/ArrowBack-C8PcQDeL.js.map +0 -1
- package/dist/JwtTokensRoute-DKaxXWe8.js.map +0 -1
- package/dist/ScheduledTaskFormRoute-BpHIsRQr.js.map +0 -1
- package/dist/SingleLogMessageRoute-i_AbkS5G.js +0 -245
- package/dist/SingleLogMessageRoute-i_AbkS5G.js.map +0 -1
- package/dist/SingleMessageRoute-Dh7BWlPt.js +0 -254
- package/dist/SingleMessageRoute-Dh7BWlPt.js.map +0 -1
- package/dist/TriggerablesRoute-CHtOEVBR.js.map +0 -1
- package/dist/createSvgIcon-DHqCx8A0.js.map +0 -1
- package/dist/validation-C1lKYJJR.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as Jt, b as en } from "./createSvgIcon-
|
|
1
|
+
import { A as Jt, b as en } from "./createSvgIcon-DCKQGUI3.js";
|
|
2
2
|
class ne extends Error {
|
|
3
3
|
}
|
|
4
4
|
class tn extends ne {
|
|
@@ -23,7 +23,7 @@ class jt extends ne {
|
|
|
23
23
|
super(`Invalid unit ${e}`);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
class
|
|
26
|
+
class C extends ne {
|
|
27
27
|
}
|
|
28
28
|
class Y extends ne {
|
|
29
29
|
constructor() {
|
|
@@ -130,7 +130,7 @@ const f = "numeric", R = "short", V = "long", ze = {
|
|
|
130
130
|
hour: f,
|
|
131
131
|
minute: f,
|
|
132
132
|
timeZoneName: R
|
|
133
|
-
},
|
|
133
|
+
}, hr = {
|
|
134
134
|
year: f,
|
|
135
135
|
month: V,
|
|
136
136
|
day: f,
|
|
@@ -138,7 +138,7 @@ const f = "numeric", R = "short", V = "long", ze = {
|
|
|
138
138
|
minute: f,
|
|
139
139
|
second: f,
|
|
140
140
|
timeZoneName: R
|
|
141
|
-
},
|
|
141
|
+
}, dr = {
|
|
142
142
|
year: f,
|
|
143
143
|
month: V,
|
|
144
144
|
day: f,
|
|
@@ -156,7 +156,7 @@ const f = "numeric", R = "short", V = "long", ze = {
|
|
|
156
156
|
second: f,
|
|
157
157
|
timeZoneName: V
|
|
158
158
|
};
|
|
159
|
-
class
|
|
159
|
+
class he {
|
|
160
160
|
/**
|
|
161
161
|
* The type of zone
|
|
162
162
|
* @abstract
|
|
@@ -241,13 +241,13 @@ class de {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
let Ge = null;
|
|
244
|
-
class
|
|
244
|
+
class De extends he {
|
|
245
245
|
/**
|
|
246
246
|
* Get a singleton instance of the local zone
|
|
247
247
|
* @return {SystemZone}
|
|
248
248
|
*/
|
|
249
249
|
static get instance() {
|
|
250
|
-
return Ge === null && (Ge = new
|
|
250
|
+
return Ge === null && (Ge = new De()), Ge;
|
|
251
251
|
}
|
|
252
252
|
/** @override **/
|
|
253
253
|
get type() {
|
|
@@ -263,7 +263,7 @@ class Ne extends de {
|
|
|
263
263
|
}
|
|
264
264
|
/** @override **/
|
|
265
265
|
offsetName(e, { format: t, locale: n }) {
|
|
266
|
-
return
|
|
266
|
+
return Nr(e, t, n);
|
|
267
267
|
}
|
|
268
268
|
/** @override **/
|
|
269
269
|
formatOffset(e, t) {
|
|
@@ -317,21 +317,21 @@ function cn(r, e) {
|
|
|
317
317
|
}
|
|
318
318
|
return n;
|
|
319
319
|
}
|
|
320
|
-
let
|
|
321
|
-
class
|
|
320
|
+
let _e = {};
|
|
321
|
+
class H extends he {
|
|
322
322
|
/**
|
|
323
323
|
* @param {string} name - Zone name
|
|
324
324
|
* @return {IANAZone}
|
|
325
325
|
*/
|
|
326
326
|
static create(e) {
|
|
327
|
-
return
|
|
327
|
+
return _e[e] || (_e[e] = new H(e)), _e[e];
|
|
328
328
|
}
|
|
329
329
|
/**
|
|
330
330
|
* Reset local caches. Should only be necessary in testing scenarios.
|
|
331
331
|
* @return {void}
|
|
332
332
|
*/
|
|
333
333
|
static resetCache() {
|
|
334
|
-
|
|
334
|
+
_e = {}, Ve = {};
|
|
335
335
|
}
|
|
336
336
|
/**
|
|
337
337
|
* Returns whether the provided string is a valid specifier. This only checks the string's format, not that the specifier identifies a known zone; see isValidZone for that.
|
|
@@ -362,7 +362,7 @@ class q extends de {
|
|
|
362
362
|
}
|
|
363
363
|
}
|
|
364
364
|
constructor(e) {
|
|
365
|
-
super(), this.zoneName = e, this.valid =
|
|
365
|
+
super(), this.zoneName = e, this.valid = H.isValidZone(e);
|
|
366
366
|
}
|
|
367
367
|
/**
|
|
368
368
|
* The type of zone. `iana` for all instances of `IANAZone`.
|
|
@@ -399,7 +399,7 @@ class q extends de {
|
|
|
399
399
|
* @return {string}
|
|
400
400
|
*/
|
|
401
401
|
offsetName(e, { format: t, locale: n }) {
|
|
402
|
-
return
|
|
402
|
+
return Nr(e, t, n, this.name);
|
|
403
403
|
}
|
|
404
404
|
/**
|
|
405
405
|
* Returns the offset's value as a string
|
|
@@ -424,7 +424,7 @@ class q extends de {
|
|
|
424
424
|
const n = on(this.name);
|
|
425
425
|
let [s, a, i, o, u, l, c] = n.formatToParts ? cn(n, t) : ln(n, t);
|
|
426
426
|
o === "BC" && (s = -Math.abs(s) + 1);
|
|
427
|
-
const g =
|
|
427
|
+
const g = qe({
|
|
428
428
|
year: s,
|
|
429
429
|
month: a,
|
|
430
430
|
day: i,
|
|
@@ -433,9 +433,9 @@ class q extends de {
|
|
|
433
433
|
second: c,
|
|
434
434
|
millisecond: 0
|
|
435
435
|
});
|
|
436
|
-
let
|
|
437
|
-
const y =
|
|
438
|
-
return
|
|
436
|
+
let h = +t;
|
|
437
|
+
const y = h % 1e3;
|
|
438
|
+
return h -= y >= 0 ? y : 1e3 + y, (g - h) / (60 * 1e3);
|
|
439
439
|
}
|
|
440
440
|
/**
|
|
441
441
|
* Return whether this Zone is equal to another zone
|
|
@@ -468,20 +468,20 @@ function nt(r, e = {}) {
|
|
|
468
468
|
return n || (n = new Intl.DateTimeFormat(r, e), rt[t] = n), n;
|
|
469
469
|
}
|
|
470
470
|
let st = {};
|
|
471
|
-
function
|
|
471
|
+
function hn(r, e = {}) {
|
|
472
472
|
const t = JSON.stringify([r, e]);
|
|
473
473
|
let n = st[t];
|
|
474
474
|
return n || (n = new Intl.NumberFormat(r, e), st[t] = n), n;
|
|
475
475
|
}
|
|
476
476
|
let it = {};
|
|
477
|
-
function
|
|
477
|
+
function dn(r, e = {}) {
|
|
478
478
|
const { base: t, ...n } = e, s = JSON.stringify([r, n]);
|
|
479
479
|
let a = it[s];
|
|
480
480
|
return a || (a = new Intl.RelativeTimeFormat(r, e), it[s] = a), a;
|
|
481
481
|
}
|
|
482
|
-
let
|
|
482
|
+
let ke = null;
|
|
483
483
|
function mn() {
|
|
484
|
-
return
|
|
484
|
+
return ke || (ke = new Intl.DateTimeFormat().resolvedOptions().locale, ke);
|
|
485
485
|
}
|
|
486
486
|
let pt = {};
|
|
487
487
|
function yn(r) {
|
|
@@ -529,20 +529,20 @@ function Tn(r) {
|
|
|
529
529
|
}
|
|
530
530
|
return e;
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function xe(r, e, t, n) {
|
|
533
533
|
const s = r.listingMode();
|
|
534
534
|
return s === "error" ? null : s === "en" ? t(e) : n(e);
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function kn(r) {
|
|
537
537
|
return r.numberingSystem && r.numberingSystem !== "latn" ? !1 : r.numberingSystem === "latn" || !r.locale || r.locale.startsWith("en") || new Intl.DateTimeFormat(r.intl).resolvedOptions().numberingSystem === "latn";
|
|
538
538
|
}
|
|
539
|
-
class
|
|
539
|
+
class On {
|
|
540
540
|
constructor(e, t, n) {
|
|
541
541
|
this.padTo = n.padTo || 0, this.floor = n.floor || !1;
|
|
542
542
|
const { padTo: s, floor: a, ...i } = n;
|
|
543
543
|
if (!t || Object.keys(i).length > 0) {
|
|
544
544
|
const o = { useGrouping: !1, ...n };
|
|
545
|
-
n.padTo > 0 && (o.minimumIntegerDigits = n.padTo), this.inf =
|
|
545
|
+
n.padTo > 0 && (o.minimumIntegerDigits = n.padTo), this.inf = hn(e, o);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
548
|
format(e) {
|
|
@@ -550,12 +550,12 @@ class kn {
|
|
|
550
550
|
const t = this.floor ? Math.floor(e) : e;
|
|
551
551
|
return this.inf.format(t);
|
|
552
552
|
} else {
|
|
553
|
-
const t = this.floor ? Math.floor(e) :
|
|
554
|
-
return
|
|
553
|
+
const t = this.floor ? Math.floor(e) : ht(e, 3);
|
|
554
|
+
return _(t, this.padTo);
|
|
555
555
|
}
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
|
-
class
|
|
558
|
+
class Sn {
|
|
559
559
|
constructor(e, t, n) {
|
|
560
560
|
this.opts = n, this.originalZone = void 0;
|
|
561
561
|
let s;
|
|
@@ -563,7 +563,7 @@ class On {
|
|
|
563
563
|
this.dt = e;
|
|
564
564
|
else if (e.zone.type === "fixed") {
|
|
565
565
|
const i = -1 * (e.offset / 60), o = i >= 0 ? `Etc/GMT+${i}` : `Etc/GMT${i}`;
|
|
566
|
-
e.offset !== 0 &&
|
|
566
|
+
e.offset !== 0 && H.create(o).valid ? (s = o, this.dt = e) : (s = "UTC", this.dt = e.offset === 0 ? e : e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
567
567
|
} else e.zone.type === "system" ? this.dt = e : e.zone.type === "iana" ? (this.dt = e, s = e.zone.name) : (s = "UTC", this.dt = e.setZone("UTC").plus({ minutes: e.offset }), this.originalZone = e.zone);
|
|
568
568
|
const a = { ...this.opts };
|
|
569
569
|
a.timeZone = a.timeZone || s, this.dtf = nt(t, a);
|
|
@@ -593,7 +593,7 @@ class On {
|
|
|
593
593
|
}
|
|
594
594
|
class vn {
|
|
595
595
|
constructor(e, t, n) {
|
|
596
|
-
this.opts = { style: "long", ...n }, !t &&
|
|
596
|
+
this.opts = { style: "long", ...n }, !t && Sr() && (this.rtf = dn(e, n));
|
|
597
597
|
}
|
|
598
598
|
format(e, t) {
|
|
599
599
|
return this.rtf ? this.rtf.format(e, t) : Yn(t, e, this.opts.numeric, this.opts.style !== "long");
|
|
@@ -602,14 +602,14 @@ class vn {
|
|
|
602
602
|
return this.rtf ? this.rtf.formatToParts(e, t) : [];
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
|
-
const
|
|
605
|
+
const Nn = {
|
|
606
606
|
firstDay: 1,
|
|
607
607
|
minimalDays: 4,
|
|
608
608
|
weekend: [6, 7]
|
|
609
609
|
};
|
|
610
|
-
class
|
|
610
|
+
class N {
|
|
611
611
|
static fromOpts(e) {
|
|
612
|
-
return
|
|
612
|
+
return N.create(
|
|
613
613
|
e.locale,
|
|
614
614
|
e.numberingSystem,
|
|
615
615
|
e.outputCalendar,
|
|
@@ -619,27 +619,27 @@ class D {
|
|
|
619
619
|
}
|
|
620
620
|
static create(e, t, n, s, a = !1) {
|
|
621
621
|
const i = e || I.defaultLocale, o = i || (a ? "en-US" : mn()), u = t || I.defaultNumberingSystem, l = n || I.defaultOutputCalendar, c = at(s) || I.defaultWeekSettings;
|
|
622
|
-
return new
|
|
622
|
+
return new N(o, u, l, c, i);
|
|
623
623
|
}
|
|
624
624
|
static resetCache() {
|
|
625
|
-
|
|
625
|
+
ke = null, rt = {}, st = {}, it = {};
|
|
626
626
|
}
|
|
627
627
|
static fromObject({ locale: e, numberingSystem: t, outputCalendar: n, weekSettings: s } = {}) {
|
|
628
|
-
return
|
|
628
|
+
return N.create(e, t, n, s);
|
|
629
629
|
}
|
|
630
630
|
constructor(e, t, n, s, a) {
|
|
631
631
|
const [i, o, u] = gn(e);
|
|
632
632
|
this.locale = i, this.numberingSystem = t || o || null, this.outputCalendar = n || u || null, this.weekSettings = s, this.intl = pn(this.locale, this.numberingSystem, this.outputCalendar), this.weekdaysCache = { format: {}, standalone: {} }, this.monthsCache = { format: {}, standalone: {} }, this.meridiemCache = null, this.eraCache = {}, this.specifiedLocale = a, this.fastNumbersCached = null;
|
|
633
633
|
}
|
|
634
634
|
get fastNumbers() {
|
|
635
|
-
return this.fastNumbersCached == null && (this.fastNumbersCached =
|
|
635
|
+
return this.fastNumbersCached == null && (this.fastNumbersCached = kn(this)), this.fastNumbersCached;
|
|
636
636
|
}
|
|
637
637
|
listingMode() {
|
|
638
638
|
const e = this.isEnglish(), t = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
|
|
639
639
|
return e && t ? "en" : "intl";
|
|
640
640
|
}
|
|
641
641
|
clone(e) {
|
|
642
|
-
return !e || Object.getOwnPropertyNames(e).length === 0 ? this :
|
|
642
|
+
return !e || Object.getOwnPropertyNames(e).length === 0 ? this : N.create(
|
|
643
643
|
e.locale || this.specifiedLocale,
|
|
644
644
|
e.numberingSystem || this.numberingSystem,
|
|
645
645
|
e.outputCalendar || this.outputCalendar,
|
|
@@ -654,13 +654,13 @@ class D {
|
|
|
654
654
|
return this.clone({ ...e, defaultToEN: !1 });
|
|
655
655
|
}
|
|
656
656
|
months(e, t = !1) {
|
|
657
|
-
return
|
|
657
|
+
return xe(this, e, Mr, () => {
|
|
658
658
|
const n = t ? { month: e, day: "numeric" } : { month: e }, s = t ? "format" : "standalone";
|
|
659
659
|
return this.monthsCache[s][e] || (this.monthsCache[s][e] = wn((a) => this.extract(a, n, "month"))), this.monthsCache[s][e];
|
|
660
660
|
});
|
|
661
661
|
}
|
|
662
662
|
weekdays(e, t = !1) {
|
|
663
|
-
return
|
|
663
|
+
return xe(this, e, xr, () => {
|
|
664
664
|
const n = t ? { weekday: e, year: "numeric", month: "long", day: "numeric" } : { weekday: e }, s = t ? "format" : "standalone";
|
|
665
665
|
return this.weekdaysCache[s][e] || (this.weekdaysCache[s][e] = Tn(
|
|
666
666
|
(a) => this.extract(a, n, "weekday")
|
|
@@ -668,10 +668,10 @@ class D {
|
|
|
668
668
|
});
|
|
669
669
|
}
|
|
670
670
|
meridiems() {
|
|
671
|
-
return
|
|
671
|
+
return xe(
|
|
672
672
|
this,
|
|
673
673
|
void 0,
|
|
674
|
-
() =>
|
|
674
|
+
() => Cr,
|
|
675
675
|
() => {
|
|
676
676
|
if (!this.meridiemCache) {
|
|
677
677
|
const e = { hour: "numeric", hourCycle: "h12" };
|
|
@@ -684,7 +684,7 @@ class D {
|
|
|
684
684
|
);
|
|
685
685
|
}
|
|
686
686
|
eras(e) {
|
|
687
|
-
return
|
|
687
|
+
return xe(this, e, br, () => {
|
|
688
688
|
const t = { era: e };
|
|
689
689
|
return this.eraCache[e] || (this.eraCache[e] = [p.utc(-40, 1, 1), p.utc(2017, 1, 1)].map(
|
|
690
690
|
(n) => this.extract(n, t, "era")
|
|
@@ -696,10 +696,10 @@ class D {
|
|
|
696
696
|
return i ? i.value : null;
|
|
697
697
|
}
|
|
698
698
|
numberFormatter(e = {}) {
|
|
699
|
-
return new
|
|
699
|
+
return new On(this.intl, e.forceSimple || this.fastNumbers, e);
|
|
700
700
|
}
|
|
701
701
|
dtFormatter(e, t = {}) {
|
|
702
|
-
return new
|
|
702
|
+
return new Sn(e, this.intl, t);
|
|
703
703
|
}
|
|
704
704
|
relFormatter(e = {}) {
|
|
705
705
|
return new vn(this.intl, this.isEnglish(), e);
|
|
@@ -711,7 +711,7 @@ class D {
|
|
|
711
711
|
return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
|
|
712
712
|
}
|
|
713
713
|
getWeekSettings() {
|
|
714
|
-
return this.weekSettings ? this.weekSettings : vr() ? yn(this.locale) :
|
|
714
|
+
return this.weekSettings ? this.weekSettings : vr() ? yn(this.locale) : Nn;
|
|
715
715
|
}
|
|
716
716
|
getStartOfWeek() {
|
|
717
717
|
return this.getWeekSettings().firstDay;
|
|
@@ -730,7 +730,7 @@ class D {
|
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
732
|
let Je = null;
|
|
733
|
-
class F extends
|
|
733
|
+
class F extends he {
|
|
734
734
|
/**
|
|
735
735
|
* Get a singleton instance of UTC
|
|
736
736
|
* @return {FixedOffsetZone}
|
|
@@ -849,7 +849,7 @@ class F extends de {
|
|
|
849
849
|
return !0;
|
|
850
850
|
}
|
|
851
851
|
}
|
|
852
|
-
class yr extends
|
|
852
|
+
class yr extends he {
|
|
853
853
|
constructor(e) {
|
|
854
854
|
super(), this.zoneName = e;
|
|
855
855
|
}
|
|
@@ -889,11 +889,11 @@ class yr extends de {
|
|
|
889
889
|
function J(r, e) {
|
|
890
890
|
if (w(r) || r === null)
|
|
891
891
|
return e;
|
|
892
|
-
if (r instanceof
|
|
892
|
+
if (r instanceof he)
|
|
893
893
|
return r;
|
|
894
|
-
if (
|
|
894
|
+
if (xn(r)) {
|
|
895
895
|
const t = r.toLowerCase();
|
|
896
|
-
return t === "default" ? e : t === "local" || t === "system" ?
|
|
896
|
+
return t === "default" ? e : t === "local" || t === "system" ? De.instance : t === "utc" || t === "gmt" ? F.utcInstance : F.parseSpecifier(t) || H.create(r);
|
|
897
897
|
} else return j(r) ? F.instance(r) : typeof r == "object" && "offset" in r && typeof r.offset == "function" ? r : new yr(r);
|
|
898
898
|
}
|
|
899
899
|
const ut = {
|
|
@@ -938,7 +938,7 @@ const ut = {
|
|
|
938
938
|
telu: [3174, 3183],
|
|
939
939
|
thai: [3664, 3673],
|
|
940
940
|
tibt: [3872, 3881]
|
|
941
|
-
},
|
|
941
|
+
}, Dn = ut.hanidec.replace(/[\[|\]]/g, "").split("");
|
|
942
942
|
function En(r) {
|
|
943
943
|
let e = parseInt(r, 10);
|
|
944
944
|
if (isNaN(e)) {
|
|
@@ -946,7 +946,7 @@ function En(r) {
|
|
|
946
946
|
for (let t = 0; t < r.length; t++) {
|
|
947
947
|
const n = r.charCodeAt(t);
|
|
948
948
|
if (r[t].search(ut.hanidec) !== -1)
|
|
949
|
-
e +=
|
|
949
|
+
e += Dn.indexOf(r[t]);
|
|
950
950
|
else
|
|
951
951
|
for (const s in wt) {
|
|
952
952
|
const [a, i] = wt[s];
|
|
@@ -965,7 +965,7 @@ function Z({ numberingSystem: r }, e = "") {
|
|
|
965
965
|
const t = r || "latn";
|
|
966
966
|
return oe[t] || (oe[t] = {}), oe[t][e] || (oe[t][e] = new RegExp(`${ut[t]}${e}`)), oe[t][e];
|
|
967
967
|
}
|
|
968
|
-
let Tt = () => Date.now(),
|
|
968
|
+
let Tt = () => Date.now(), kt = "system", Ot = null, St = null, vt = null, Nt = 60, Dt, Et = null;
|
|
969
969
|
class I {
|
|
970
970
|
/**
|
|
971
971
|
* Get the callback for returning the current timestamp.
|
|
@@ -990,7 +990,7 @@ class I {
|
|
|
990
990
|
* @type {string}
|
|
991
991
|
*/
|
|
992
992
|
static set defaultZone(e) {
|
|
993
|
-
|
|
993
|
+
kt = e;
|
|
994
994
|
}
|
|
995
995
|
/**
|
|
996
996
|
* Get the default time zone object currently used to create DateTimes. Does not affect existing instances.
|
|
@@ -998,35 +998,35 @@ class I {
|
|
|
998
998
|
* @type {Zone}
|
|
999
999
|
*/
|
|
1000
1000
|
static get defaultZone() {
|
|
1001
|
-
return J(
|
|
1001
|
+
return J(kt, De.instance);
|
|
1002
1002
|
}
|
|
1003
1003
|
/**
|
|
1004
1004
|
* Get the default locale to create DateTimes with. Does not affect existing instances.
|
|
1005
1005
|
* @type {string}
|
|
1006
1006
|
*/
|
|
1007
1007
|
static get defaultLocale() {
|
|
1008
|
-
return
|
|
1008
|
+
return Ot;
|
|
1009
1009
|
}
|
|
1010
1010
|
/**
|
|
1011
1011
|
* Set the default locale to create DateTimes with. Does not affect existing instances.
|
|
1012
1012
|
* @type {string}
|
|
1013
1013
|
*/
|
|
1014
1014
|
static set defaultLocale(e) {
|
|
1015
|
-
|
|
1015
|
+
Ot = e;
|
|
1016
1016
|
}
|
|
1017
1017
|
/**
|
|
1018
1018
|
* Get the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
1019
1019
|
* @type {string}
|
|
1020
1020
|
*/
|
|
1021
1021
|
static get defaultNumberingSystem() {
|
|
1022
|
-
return
|
|
1022
|
+
return St;
|
|
1023
1023
|
}
|
|
1024
1024
|
/**
|
|
1025
1025
|
* Set the default numbering system to create DateTimes with. Does not affect existing instances.
|
|
1026
1026
|
* @type {string}
|
|
1027
1027
|
*/
|
|
1028
1028
|
static set defaultNumberingSystem(e) {
|
|
1029
|
-
|
|
1029
|
+
St = e;
|
|
1030
1030
|
}
|
|
1031
1031
|
/**
|
|
1032
1032
|
* Get the default output calendar to create DateTimes with. Does not affect existing instances.
|
|
@@ -1069,7 +1069,7 @@ class I {
|
|
|
1069
1069
|
* @type {number}
|
|
1070
1070
|
*/
|
|
1071
1071
|
static get twoDigitCutoffYear() {
|
|
1072
|
-
return
|
|
1072
|
+
return Nt;
|
|
1073
1073
|
}
|
|
1074
1074
|
/**
|
|
1075
1075
|
* Set the cutoff year for whether a 2-digit year string is interpreted in the current or previous century. Numbers higher than the cutoff will be considered to mean 19xx and numbers lower or equal to the cutoff will be considered 20xx.
|
|
@@ -1081,28 +1081,28 @@ class I {
|
|
|
1081
1081
|
* @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50
|
|
1082
1082
|
*/
|
|
1083
1083
|
static set twoDigitCutoffYear(e) {
|
|
1084
|
-
|
|
1084
|
+
Nt = e % 100;
|
|
1085
1085
|
}
|
|
1086
1086
|
/**
|
|
1087
1087
|
* Get whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
1088
1088
|
* @type {boolean}
|
|
1089
1089
|
*/
|
|
1090
1090
|
static get throwOnInvalid() {
|
|
1091
|
-
return
|
|
1091
|
+
return Dt;
|
|
1092
1092
|
}
|
|
1093
1093
|
/**
|
|
1094
1094
|
* Set whether Luxon will throw when it encounters invalid DateTimes, Durations, or Intervals
|
|
1095
1095
|
* @type {boolean}
|
|
1096
1096
|
*/
|
|
1097
1097
|
static set throwOnInvalid(e) {
|
|
1098
|
-
|
|
1098
|
+
Dt = e;
|
|
1099
1099
|
}
|
|
1100
1100
|
/**
|
|
1101
1101
|
* Reset Luxon's global caches. Should only be necessary in testing scenarios.
|
|
1102
1102
|
* @return {void}
|
|
1103
1103
|
*/
|
|
1104
1104
|
static resetCaches() {
|
|
1105
|
-
|
|
1105
|
+
N.resetCache(), H.resetCache(), p.resetCache(), Mn();
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
1108
|
class A {
|
|
@@ -1139,7 +1139,7 @@ function ct(r, e) {
|
|
|
1139
1139
|
function Ze(r, e = 4, t = 1) {
|
|
1140
1140
|
const { year: n, month: s, day: a } = r, i = wr(n, s, a), o = ct(lt(n, s, a), t);
|
|
1141
1141
|
let u = Math.floor((i - o + 14 - e) / 7), l;
|
|
1142
|
-
return u < 1 ? (l = n - 1, u =
|
|
1142
|
+
return u < 1 ? (l = n - 1, u = Ne(l, e, t)) : u > Ne(n, e, t) ? (l = n + 1, u = 1) : l = n, { weekYear: l, weekNumber: u, weekday: o, ...Pe(r) };
|
|
1143
1143
|
}
|
|
1144
1144
|
function Mt(r, e = 4, t = 1) {
|
|
1145
1145
|
const { weekYear: n, weekNumber: s, weekday: a } = r, i = ct(lt(n, 1, e), t), o = le(n);
|
|
@@ -1156,7 +1156,7 @@ function It(r) {
|
|
|
1156
1156
|
const { year: e, ordinal: t } = r, { month: n, day: s } = Tr(e, t);
|
|
1157
1157
|
return { year: e, month: n, day: s, ...Pe(r) };
|
|
1158
1158
|
}
|
|
1159
|
-
function
|
|
1159
|
+
function _t(r, e) {
|
|
1160
1160
|
if (!w(r.localWeekday) || !w(r.localWeekNumber) || !w(r.localWeekYear)) {
|
|
1161
1161
|
if (!w(r.weekday) || !w(r.weekNumber) || !w(r.weekYear))
|
|
1162
1162
|
throw new ue(
|
|
@@ -1170,22 +1170,22 @@ function xt(r, e) {
|
|
|
1170
1170
|
return { minDaysInFirstWeek: 4, startOfWeek: 1 };
|
|
1171
1171
|
}
|
|
1172
1172
|
function In(r, e = 4, t = 1) {
|
|
1173
|
-
const n =
|
|
1173
|
+
const n = He(r.weekYear), s = $(
|
|
1174
1174
|
r.weekNumber,
|
|
1175
1175
|
1,
|
|
1176
|
-
|
|
1176
|
+
Ne(r.weekYear, e, t)
|
|
1177
1177
|
), a = $(r.weekday, 1, 7);
|
|
1178
1178
|
return n ? s ? a ? !1 : L("weekday", r.weekday) : L("week", r.weekNumber) : L("weekYear", r.weekYear);
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1181
|
-
const e =
|
|
1180
|
+
function _n(r) {
|
|
1181
|
+
const e = He(r.year), t = $(r.ordinal, 1, le(r.year));
|
|
1182
1182
|
return e ? t ? !1 : L("ordinal", r.ordinal) : L("year", r.year);
|
|
1183
1183
|
}
|
|
1184
|
-
function
|
|
1185
|
-
const e =
|
|
1184
|
+
function kr(r) {
|
|
1185
|
+
const e = He(r.year), t = $(r.month, 1, 12), n = $(r.day, 1, Ue(r.year, r.month));
|
|
1186
1186
|
return e ? t ? n ? !1 : L("day", r.day) : L("month", r.month) : L("year", r.year);
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1188
|
+
function Or(r) {
|
|
1189
1189
|
const { hour: e, minute: t, second: n, millisecond: s } = r, a = $(e, 0, 23) || e === 24 && t === 0 && n === 0 && s === 0, i = $(t, 0, 59), o = $(n, 0, 59), u = $(s, 0, 999);
|
|
1190
1190
|
return a ? i ? o ? u ? !1 : L("millisecond", s) : L("second", n) : L("minute", t) : L("hour", e);
|
|
1191
1191
|
}
|
|
@@ -1195,16 +1195,16 @@ function w(r) {
|
|
|
1195
1195
|
function j(r) {
|
|
1196
1196
|
return typeof r == "number";
|
|
1197
1197
|
}
|
|
1198
|
-
function
|
|
1198
|
+
function He(r) {
|
|
1199
1199
|
return typeof r == "number" && r % 1 === 0;
|
|
1200
1200
|
}
|
|
1201
|
-
function
|
|
1201
|
+
function xn(r) {
|
|
1202
1202
|
return typeof r == "string";
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function Cn(r) {
|
|
1205
1205
|
return Object.prototype.toString.call(r) === "[object Date]";
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function Sr() {
|
|
1208
1208
|
try {
|
|
1209
1209
|
return typeof Intl < "u" && !!Intl.RelativeTimeFormat;
|
|
1210
1210
|
} catch {
|
|
@@ -1218,10 +1218,10 @@ function vr() {
|
|
|
1218
1218
|
return !1;
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
|
-
function
|
|
1221
|
+
function bn(r) {
|
|
1222
1222
|
return Array.isArray(r) ? r : [r];
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function xt(r, e, t) {
|
|
1225
1225
|
if (r.length !== 0)
|
|
1226
1226
|
return r.reduce((n, s) => {
|
|
1227
1227
|
const a = [e(s), s];
|
|
@@ -1238,9 +1238,9 @@ function at(r) {
|
|
|
1238
1238
|
if (r == null)
|
|
1239
1239
|
return null;
|
|
1240
1240
|
if (typeof r != "object")
|
|
1241
|
-
throw new
|
|
1241
|
+
throw new C("Week settings must be an object");
|
|
1242
1242
|
if (!$(r.firstDay, 1, 7) || !$(r.minimalDays, 1, 7) || !Array.isArray(r.weekend) || r.weekend.some((e) => !$(e, 1, 7)))
|
|
1243
|
-
throw new
|
|
1243
|
+
throw new C("Invalid week settings");
|
|
1244
1244
|
return {
|
|
1245
1245
|
firstDay: r.firstDay,
|
|
1246
1246
|
minimalDays: r.minimalDays,
|
|
@@ -1248,12 +1248,12 @@ function at(r) {
|
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
1250
|
function $(r, e, t) {
|
|
1251
|
-
return
|
|
1251
|
+
return He(r) && r >= e && r <= t;
|
|
1252
1252
|
}
|
|
1253
1253
|
function Vn(r, e) {
|
|
1254
1254
|
return r - e * Math.floor(r / e);
|
|
1255
1255
|
}
|
|
1256
|
-
function
|
|
1256
|
+
function _(r, e = 2) {
|
|
1257
1257
|
const t = r < 0;
|
|
1258
1258
|
let n;
|
|
1259
1259
|
return t ? n = "-" + ("" + -r).padStart(e, "0") : n = ("" + r).padStart(e, "0"), n;
|
|
@@ -1272,7 +1272,7 @@ function ft(r) {
|
|
|
1272
1272
|
return Math.floor(e);
|
|
1273
1273
|
}
|
|
1274
1274
|
}
|
|
1275
|
-
function
|
|
1275
|
+
function ht(r, e, t = !1) {
|
|
1276
1276
|
const n = 10 ** e;
|
|
1277
1277
|
return (t ? Math.trunc : Math.round)(r * n) / n;
|
|
1278
1278
|
}
|
|
@@ -1286,7 +1286,7 @@ function Ue(r, e) {
|
|
|
1286
1286
|
const t = Vn(e - 1, 12) + 1, n = r + (e - t) / 12;
|
|
1287
1287
|
return t === 2 ? Ee(n) ? 29 : 28 : [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][t - 1];
|
|
1288
1288
|
}
|
|
1289
|
-
function
|
|
1289
|
+
function qe(r) {
|
|
1290
1290
|
let e = Date.UTC(
|
|
1291
1291
|
r.year,
|
|
1292
1292
|
r.month - 1,
|
|
@@ -1298,17 +1298,17 @@ function He(r) {
|
|
|
1298
1298
|
);
|
|
1299
1299
|
return r.year < 100 && r.year >= 0 && (e = new Date(e), e.setUTCFullYear(r.year, r.month - 1, r.day)), +e;
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function Ct(r, e, t) {
|
|
1302
1302
|
return -ct(lt(r, 1, e), t) + e - 1;
|
|
1303
1303
|
}
|
|
1304
|
-
function
|
|
1305
|
-
const n =
|
|
1304
|
+
function Ne(r, e = 4, t = 1) {
|
|
1305
|
+
const n = Ct(r, e, t), s = Ct(r + 1, e, t);
|
|
1306
1306
|
return (le(r) - n + s) / 7;
|
|
1307
1307
|
}
|
|
1308
1308
|
function ot(r) {
|
|
1309
1309
|
return r > 99 ? r : r > I.twoDigitCutoffYear ? 1900 + r : 2e3 + r;
|
|
1310
1310
|
}
|
|
1311
|
-
function
|
|
1311
|
+
function Nr(r, e, t, n = null) {
|
|
1312
1312
|
const s = new Date(r), a = {
|
|
1313
1313
|
hourCycle: "h23",
|
|
1314
1314
|
year: "numeric",
|
|
@@ -1327,10 +1327,10 @@ function Ye(r, e) {
|
|
|
1327
1327
|
const n = parseInt(e, 10) || 0, s = t < 0 || Object.is(t, -0) ? -n : n;
|
|
1328
1328
|
return t * 60 + s;
|
|
1329
1329
|
}
|
|
1330
|
-
function
|
|
1330
|
+
function Dr(r) {
|
|
1331
1331
|
const e = Number(r);
|
|
1332
1332
|
if (typeof r == "boolean" || r === "" || Number.isNaN(e))
|
|
1333
|
-
throw new
|
|
1333
|
+
throw new C(`Invalid unit value ${r}`);
|
|
1334
1334
|
return e;
|
|
1335
1335
|
}
|
|
1336
1336
|
function Ae(r, e) {
|
|
@@ -1339,7 +1339,7 @@ function Ae(r, e) {
|
|
|
1339
1339
|
if (fe(r, n)) {
|
|
1340
1340
|
const s = r[n];
|
|
1341
1341
|
if (s == null) continue;
|
|
1342
|
-
t[e(n)] =
|
|
1342
|
+
t[e(n)] = Dr(s);
|
|
1343
1343
|
}
|
|
1344
1344
|
return t;
|
|
1345
1345
|
}
|
|
@@ -1347,11 +1347,11 @@ function ve(r, e) {
|
|
|
1347
1347
|
const t = Math.trunc(Math.abs(r / 60)), n = Math.trunc(Math.abs(r % 60)), s = r >= 0 ? "+" : "-";
|
|
1348
1348
|
switch (e) {
|
|
1349
1349
|
case "short":
|
|
1350
|
-
return `${s}${
|
|
1350
|
+
return `${s}${_(t, 2)}:${_(n, 2)}`;
|
|
1351
1351
|
case "narrow":
|
|
1352
1352
|
return `${s}${t}${n > 0 ? `:${n}` : ""}`;
|
|
1353
1353
|
case "techie":
|
|
1354
|
-
return `${s}${
|
|
1354
|
+
return `${s}${_(t, 2)}${_(n, 2)}`;
|
|
1355
1355
|
default:
|
|
1356
1356
|
throw new RangeError(`Value format ${e} is out of range for property format`);
|
|
1357
1357
|
}
|
|
@@ -1410,13 +1410,13 @@ const Ir = [
|
|
|
1410
1410
|
"Friday",
|
|
1411
1411
|
"Saturday",
|
|
1412
1412
|
"Sunday"
|
|
1413
|
-
],
|
|
1414
|
-
function
|
|
1413
|
+
], _r = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], $n = ["M", "T", "W", "T", "F", "S", "S"];
|
|
1414
|
+
function xr(r) {
|
|
1415
1415
|
switch (r) {
|
|
1416
1416
|
case "narrow":
|
|
1417
1417
|
return [...$n];
|
|
1418
1418
|
case "short":
|
|
1419
|
-
return [...
|
|
1419
|
+
return [..._r];
|
|
1420
1420
|
case "long":
|
|
1421
1421
|
return [...Ir];
|
|
1422
1422
|
case "numeric":
|
|
@@ -1425,8 +1425,8 @@ function _r(r) {
|
|
|
1425
1425
|
return null;
|
|
1426
1426
|
}
|
|
1427
1427
|
}
|
|
1428
|
-
const
|
|
1429
|
-
function
|
|
1428
|
+
const Cr = ["AM", "PM"], zn = ["Before Christ", "Anno Domini"], Zn = ["BC", "AD"], Un = ["B", "A"];
|
|
1429
|
+
function br(r) {
|
|
1430
1430
|
switch (r) {
|
|
1431
1431
|
case "narrow":
|
|
1432
1432
|
return [...Un];
|
|
@@ -1439,16 +1439,16 @@ function Cr(r) {
|
|
|
1439
1439
|
}
|
|
1440
1440
|
}
|
|
1441
1441
|
function An(r) {
|
|
1442
|
-
return
|
|
1442
|
+
return Cr[r.hour < 12 ? 0 : 1];
|
|
1443
1443
|
}
|
|
1444
1444
|
function Rn(r, e) {
|
|
1445
|
-
return
|
|
1445
|
+
return xr(e)[r.weekday - 1];
|
|
1446
1446
|
}
|
|
1447
|
-
function
|
|
1447
|
+
function Hn(r, e) {
|
|
1448
1448
|
return Mr(e)[r.month - 1];
|
|
1449
1449
|
}
|
|
1450
|
-
function
|
|
1451
|
-
return
|
|
1450
|
+
function qn(r, e) {
|
|
1451
|
+
return br(e)[r.year < 0 ? 0 : 1];
|
|
1452
1452
|
}
|
|
1453
1453
|
function Yn(r, e, t = "always", n = !1) {
|
|
1454
1454
|
const s = {
|
|
@@ -1475,7 +1475,7 @@ function Yn(r, e, t = "always", n = !1) {
|
|
|
1475
1475
|
const i = Object.is(e, -0) || e < 0, o = Math.abs(e), u = o === 1, l = s[r], c = n ? u ? l[1] : l[2] || l[1] : u ? s[r][0] : r;
|
|
1476
1476
|
return i ? `${o} ${c} ago` : `in ${o} ${c}`;
|
|
1477
1477
|
}
|
|
1478
|
-
function
|
|
1478
|
+
function bt(r, e) {
|
|
1479
1479
|
let t = "";
|
|
1480
1480
|
for (const n of r)
|
|
1481
1481
|
n.literal ? t += n.val : t += e(n.val);
|
|
@@ -1497,15 +1497,15 @@ const Pn = {
|
|
|
1497
1497
|
f: or,
|
|
1498
1498
|
ff: lr,
|
|
1499
1499
|
fff: fr,
|
|
1500
|
-
ffff:
|
|
1500
|
+
ffff: dr,
|
|
1501
1501
|
F: ur,
|
|
1502
1502
|
FF: cr,
|
|
1503
|
-
FFF:
|
|
1503
|
+
FFF: hr,
|
|
1504
1504
|
FFFF: mr
|
|
1505
1505
|
};
|
|
1506
|
-
class
|
|
1506
|
+
class b {
|
|
1507
1507
|
static create(e, t = {}) {
|
|
1508
|
-
return new
|
|
1508
|
+
return new b(e, t);
|
|
1509
1509
|
}
|
|
1510
1510
|
static parseFormat(e) {
|
|
1511
1511
|
let t = null, n = "", s = !1;
|
|
@@ -1542,19 +1542,19 @@ class C {
|
|
|
1542
1542
|
}
|
|
1543
1543
|
num(e, t = 0) {
|
|
1544
1544
|
if (this.opts.forceSimple)
|
|
1545
|
-
return
|
|
1545
|
+
return _(e, t);
|
|
1546
1546
|
const n = { ...this.opts };
|
|
1547
1547
|
return t > 0 && (n.padTo = t), this.loc.numberFormatter(n).format(e);
|
|
1548
1548
|
}
|
|
1549
1549
|
formatDateTimeFromString(e, t) {
|
|
1550
|
-
const n = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", a = (
|
|
1551
|
-
y ? { weekday:
|
|
1550
|
+
const n = this.loc.listingMode() === "en", s = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", a = (h, y) => this.loc.extract(e, h, y), i = (h) => e.isOffsetFixed && e.offset === 0 && h.allowZ ? "Z" : e.isValid ? e.zone.formatOffset(e.ts, h.format) : "", o = () => n ? An(e) : a({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), u = (h, y) => n ? Hn(e, h) : a(y ? { month: h } : { month: h, day: "numeric" }, "month"), l = (h, y) => n ? Rn(e, h) : a(
|
|
1551
|
+
y ? { weekday: h } : { weekday: h, month: "long", day: "numeric" },
|
|
1552
1552
|
"weekday"
|
|
1553
|
-
), c = (
|
|
1554
|
-
const y =
|
|
1555
|
-
return y ? this.formatWithSystemDefault(e, y) :
|
|
1556
|
-
}, m = (
|
|
1557
|
-
switch (
|
|
1553
|
+
), c = (h) => {
|
|
1554
|
+
const y = b.macroTokenToFormatOpts(h);
|
|
1555
|
+
return y ? this.formatWithSystemDefault(e, y) : h;
|
|
1556
|
+
}, m = (h) => n ? qn(e, h) : a({ era: h }, "era"), g = (h) => {
|
|
1557
|
+
switch (h) {
|
|
1558
1558
|
case "S":
|
|
1559
1559
|
return this.num(e.millisecond);
|
|
1560
1560
|
case "u":
|
|
@@ -1677,10 +1677,10 @@ class C {
|
|
|
1677
1677
|
case "x":
|
|
1678
1678
|
return this.num(e.ts);
|
|
1679
1679
|
default:
|
|
1680
|
-
return c(
|
|
1680
|
+
return c(h);
|
|
1681
1681
|
}
|
|
1682
1682
|
};
|
|
1683
|
-
return
|
|
1683
|
+
return bt(b.parseFormat(t), g);
|
|
1684
1684
|
}
|
|
1685
1685
|
formatDurationFromString(e, t) {
|
|
1686
1686
|
const n = (u) => {
|
|
@@ -1707,15 +1707,15 @@ class C {
|
|
|
1707
1707
|
}, s = (u) => (l) => {
|
|
1708
1708
|
const c = n(l);
|
|
1709
1709
|
return c ? this.num(u.get(c), l.length) : l;
|
|
1710
|
-
}, a =
|
|
1710
|
+
}, a = b.parseFormat(t), i = a.reduce(
|
|
1711
1711
|
(u, { literal: l, val: c }) => l ? u : u.concat(c),
|
|
1712
1712
|
[]
|
|
1713
1713
|
), o = e.shiftTo(...i.map(n).filter((u) => u));
|
|
1714
|
-
return
|
|
1714
|
+
return bt(a, s(o));
|
|
1715
1715
|
}
|
|
1716
1716
|
}
|
|
1717
1717
|
const Fr = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
|
|
1718
|
-
function
|
|
1718
|
+
function de(...r) {
|
|
1719
1719
|
const e = r.reduce((t, n) => t + n.source, "");
|
|
1720
1720
|
return RegExp(`^${e}$`);
|
|
1721
1721
|
}
|
|
@@ -1747,8 +1747,8 @@ function Vr(...r) {
|
|
|
1747
1747
|
return [n, null, t + s];
|
|
1748
1748
|
};
|
|
1749
1749
|
}
|
|
1750
|
-
const Wr = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/, Gn = `(?:${Wr.source}?(?:\\[(${Fr.source})\\])?)?`,
|
|
1751
|
-
`${
|
|
1750
|
+
const Wr = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/, Gn = `(?:${Wr.source}?(?:\\[(${Fr.source})\\])?)?`, dt = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/, Lr = RegExp(`${dt.source}${Gn}`), mt = RegExp(`(?:T${Lr.source})?`), Jn = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/, jn = /(\d{4})-?W(\d\d)(?:-?(\d))?/, Bn = /(\d{4})-?(\d{3})/, Qn = Vr("weekYear", "weekNumber", "weekDay"), Kn = Vr("year", "ordinal"), Xn = /(\d{4})-(\d\d)-(\d\d)/, $r = RegExp(
|
|
1751
|
+
`${dt.source} ?(?:${Wr.source}|(${Fr.source}))?`
|
|
1752
1752
|
), es = RegExp(`(?: ${$r.source})?`);
|
|
1753
1753
|
function ce(r, e, t) {
|
|
1754
1754
|
const n = r[e];
|
|
@@ -1774,12 +1774,12 @@ function Me(r, e) {
|
|
|
1774
1774
|
return [{}, s, e + 3];
|
|
1775
1775
|
}
|
|
1776
1776
|
function Ie(r, e) {
|
|
1777
|
-
const t = r[e] ?
|
|
1777
|
+
const t = r[e] ? H.create(r[e]) : null;
|
|
1778
1778
|
return [{}, t, e + 1];
|
|
1779
1779
|
}
|
|
1780
|
-
const rs = RegExp(`^T?${
|
|
1780
|
+
const rs = RegExp(`^T?${dt.source}$`), ns = /^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;
|
|
1781
1781
|
function ss(r) {
|
|
1782
|
-
const [e, t, n, s, a, i, o, u, l] = r, c = e[0] === "-", m = u && u[0] === "-", g = (
|
|
1782
|
+
const [e, t, n, s, a, i, o, u, l] = r, c = e[0] === "-", m = u && u[0] === "-", g = (h, y = !1) => h !== void 0 && (y || h && c) ? -h : h;
|
|
1783
1783
|
return [
|
|
1784
1784
|
{
|
|
1785
1785
|
years: g(Q(t)),
|
|
@@ -1812,7 +1812,7 @@ function yt(r, e, t, n, s, a, i) {
|
|
|
1812
1812
|
hour: G(s),
|
|
1813
1813
|
minute: G(a)
|
|
1814
1814
|
};
|
|
1815
|
-
return i && (o.second = G(i)), r && (o.weekday = r.length > 3 ? Ir.indexOf(r) + 1 :
|
|
1815
|
+
return i && (o.second = G(i)), r && (o.weekday = r.length > 3 ? Ir.indexOf(r) + 1 : _r.indexOf(r) + 1), o;
|
|
1816
1816
|
}
|
|
1817
1817
|
const as = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
|
|
1818
1818
|
function os(r) {
|
|
@@ -1830,8 +1830,8 @@ function os(r) {
|
|
|
1830
1830
|
c,
|
|
1831
1831
|
m
|
|
1832
1832
|
] = r, g = yt(e, s, n, t, a, i, o);
|
|
1833
|
-
let
|
|
1834
|
-
return u ?
|
|
1833
|
+
let h;
|
|
1834
|
+
return u ? h = is[u] : l ? h = 0 : h = Ye(c, m), [g, new F(h)];
|
|
1835
1835
|
}
|
|
1836
1836
|
function us(r) {
|
|
1837
1837
|
return r.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
|
|
@@ -1841,11 +1841,11 @@ function Ft(r) {
|
|
|
1841
1841
|
const [, e, t, n, s, a, i, o] = r;
|
|
1842
1842
|
return [yt(e, s, n, t, a, i, o), F.utcInstance];
|
|
1843
1843
|
}
|
|
1844
|
-
function
|
|
1844
|
+
function hs(r) {
|
|
1845
1845
|
const [, e, t, n, s, a, i, o] = r;
|
|
1846
1846
|
return [yt(e, o, t, n, s, a, i), F.utcInstance];
|
|
1847
1847
|
}
|
|
1848
|
-
const
|
|
1848
|
+
const ds = de(Jn, mt), ms = de(jn, mt), ys = de(Bn, mt), gs = de(Lr), zr = me(
|
|
1849
1849
|
ts,
|
|
1850
1850
|
ge,
|
|
1851
1851
|
Me,
|
|
@@ -1865,39 +1865,39 @@ const hs = he(Jn, mt), ms = he(jn, mt), ys = he(Bn, mt), gs = he(Lr), zr = me(
|
|
|
1865
1865
|
Me,
|
|
1866
1866
|
Ie
|
|
1867
1867
|
);
|
|
1868
|
-
function
|
|
1868
|
+
function ks(r) {
|
|
1869
1869
|
return ye(
|
|
1870
1870
|
r,
|
|
1871
|
-
[
|
|
1871
|
+
[ds, zr],
|
|
1872
1872
|
[ms, ps],
|
|
1873
1873
|
[ys, ws],
|
|
1874
1874
|
[gs, Ts]
|
|
1875
1875
|
);
|
|
1876
1876
|
}
|
|
1877
|
-
function
|
|
1877
|
+
function Os(r) {
|
|
1878
1878
|
return ye(us(r), [as, os]);
|
|
1879
1879
|
}
|
|
1880
|
-
function
|
|
1880
|
+
function Ss(r) {
|
|
1881
1881
|
return ye(
|
|
1882
1882
|
r,
|
|
1883
1883
|
[ls, Ft],
|
|
1884
1884
|
[cs, Ft],
|
|
1885
|
-
[fs,
|
|
1885
|
+
[fs, hs]
|
|
1886
1886
|
);
|
|
1887
1887
|
}
|
|
1888
1888
|
function vs(r) {
|
|
1889
1889
|
return ye(r, [ns, ss]);
|
|
1890
1890
|
}
|
|
1891
|
-
const
|
|
1892
|
-
function
|
|
1893
|
-
return ye(r, [rs,
|
|
1891
|
+
const Ns = me(ge);
|
|
1892
|
+
function Ds(r) {
|
|
1893
|
+
return ye(r, [rs, Ns]);
|
|
1894
1894
|
}
|
|
1895
|
-
const Es =
|
|
1895
|
+
const Es = de(Xn, es), Ms = de($r), Is = me(
|
|
1896
1896
|
ge,
|
|
1897
1897
|
Me,
|
|
1898
1898
|
Ie
|
|
1899
1899
|
);
|
|
1900
|
-
function
|
|
1900
|
+
function _s(r) {
|
|
1901
1901
|
return ye(
|
|
1902
1902
|
r,
|
|
1903
1903
|
[Es, zr],
|
|
@@ -1921,7 +1921,7 @@ const Vt = "Invalid Duration", Zr = {
|
|
|
1921
1921
|
hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
|
|
1922
1922
|
minutes: { seconds: 60, milliseconds: 60 * 1e3 },
|
|
1923
1923
|
seconds: { milliseconds: 1e3 }
|
|
1924
|
-
},
|
|
1924
|
+
}, xs = {
|
|
1925
1925
|
years: {
|
|
1926
1926
|
quarters: 4,
|
|
1927
1927
|
months: 12,
|
|
@@ -1950,7 +1950,7 @@ const Vt = "Invalid Duration", Zr = {
|
|
|
1950
1950
|
milliseconds: 30 * 24 * 60 * 60 * 1e3
|
|
1951
1951
|
},
|
|
1952
1952
|
...Zr
|
|
1953
|
-
}, W = 146097 / 400, se = 146097 / 4800,
|
|
1953
|
+
}, W = 146097 / 400, se = 146097 / 4800, Cs = {
|
|
1954
1954
|
years: {
|
|
1955
1955
|
quarters: 4,
|
|
1956
1956
|
months: 12,
|
|
@@ -1989,7 +1989,7 @@ const Vt = "Invalid Duration", Zr = {
|
|
|
1989
1989
|
"minutes",
|
|
1990
1990
|
"seconds",
|
|
1991
1991
|
"milliseconds"
|
|
1992
|
-
],
|
|
1992
|
+
], bs = te.slice(0).reverse();
|
|
1993
1993
|
function P(r, e, t = !1) {
|
|
1994
1994
|
const n = {
|
|
1995
1995
|
values: t ? e.values : { ...r.values, ...e.values || {} },
|
|
@@ -1997,11 +1997,11 @@ function P(r, e, t = !1) {
|
|
|
1997
1997
|
conversionAccuracy: e.conversionAccuracy || r.conversionAccuracy,
|
|
1998
1998
|
matrix: e.matrix || r.matrix
|
|
1999
1999
|
};
|
|
2000
|
-
return new
|
|
2000
|
+
return new O(n);
|
|
2001
2001
|
}
|
|
2002
2002
|
function Ur(r, e) {
|
|
2003
2003
|
let t = e.milliseconds ?? 0;
|
|
2004
|
-
for (const n of
|
|
2004
|
+
for (const n of bs.slice(1))
|
|
2005
2005
|
e[n] && (t += e[n] * r[n].milliseconds);
|
|
2006
2006
|
return t;
|
|
2007
2007
|
}
|
|
@@ -2031,14 +2031,14 @@ function Fs(r) {
|
|
|
2031
2031
|
n !== 0 && (e[t] = n);
|
|
2032
2032
|
return e;
|
|
2033
2033
|
}
|
|
2034
|
-
class
|
|
2034
|
+
class O {
|
|
2035
2035
|
/**
|
|
2036
2036
|
* @private
|
|
2037
2037
|
*/
|
|
2038
2038
|
constructor(e) {
|
|
2039
2039
|
const t = e.conversionAccuracy === "longterm" || !1;
|
|
2040
|
-
let n = t ?
|
|
2041
|
-
e.matrix && (n = e.matrix), this.values = e.values, this.loc = e.loc ||
|
|
2040
|
+
let n = t ? Cs : xs;
|
|
2041
|
+
e.matrix && (n = e.matrix), this.values = e.values, this.loc = e.loc || N.create(), this.conversionAccuracy = t ? "longterm" : "casual", this.invalid = e.invalid || null, this.matrix = n, this.isLuxonDuration = !0;
|
|
2042
2042
|
}
|
|
2043
2043
|
/**
|
|
2044
2044
|
* Create Duration from a number of milliseconds.
|
|
@@ -2050,7 +2050,7 @@ class k {
|
|
|
2050
2050
|
* @return {Duration}
|
|
2051
2051
|
*/
|
|
2052
2052
|
static fromMillis(e, t) {
|
|
2053
|
-
return
|
|
2053
|
+
return O.fromObject({ milliseconds: e }, t);
|
|
2054
2054
|
}
|
|
2055
2055
|
/**
|
|
2056
2056
|
* Create a Duration from a JavaScript object with keys like 'years' and 'hours'.
|
|
@@ -2074,12 +2074,12 @@ class k {
|
|
|
2074
2074
|
*/
|
|
2075
2075
|
static fromObject(e, t = {}) {
|
|
2076
2076
|
if (e == null || typeof e != "object")
|
|
2077
|
-
throw new
|
|
2077
|
+
throw new C(
|
|
2078
2078
|
`Duration.fromObject: argument expected to be an object, got ${e === null ? "null" : typeof e}`
|
|
2079
2079
|
);
|
|
2080
|
-
return new
|
|
2081
|
-
values: Ae(e,
|
|
2082
|
-
loc:
|
|
2080
|
+
return new O({
|
|
2081
|
+
values: Ae(e, O.normalizeUnit),
|
|
2082
|
+
loc: N.fromObject(t),
|
|
2083
2083
|
conversionAccuracy: t.conversionAccuracy,
|
|
2084
2084
|
matrix: t.matrix
|
|
2085
2085
|
});
|
|
@@ -2096,12 +2096,12 @@ class k {
|
|
|
2096
2096
|
*/
|
|
2097
2097
|
static fromDurationLike(e) {
|
|
2098
2098
|
if (j(e))
|
|
2099
|
-
return
|
|
2100
|
-
if (
|
|
2099
|
+
return O.fromMillis(e);
|
|
2100
|
+
if (O.isDuration(e))
|
|
2101
2101
|
return e;
|
|
2102
2102
|
if (typeof e == "object")
|
|
2103
|
-
return
|
|
2104
|
-
throw new
|
|
2103
|
+
return O.fromObject(e);
|
|
2104
|
+
throw new C(
|
|
2105
2105
|
`Unknown duration argument ${e} of type ${typeof e}`
|
|
2106
2106
|
);
|
|
2107
2107
|
}
|
|
@@ -2121,7 +2121,7 @@ class k {
|
|
|
2121
2121
|
*/
|
|
2122
2122
|
static fromISO(e, t) {
|
|
2123
2123
|
const [n] = vs(e);
|
|
2124
|
-
return n ?
|
|
2124
|
+
return n ? O.fromObject(n, t) : O.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
2125
2125
|
}
|
|
2126
2126
|
/**
|
|
2127
2127
|
* Create a Duration from an ISO 8601 time string.
|
|
@@ -2140,8 +2140,8 @@ class k {
|
|
|
2140
2140
|
* @return {Duration}
|
|
2141
2141
|
*/
|
|
2142
2142
|
static fromISOTime(e, t) {
|
|
2143
|
-
const [n] =
|
|
2144
|
-
return n ?
|
|
2143
|
+
const [n] = Ds(e);
|
|
2144
|
+
return n ? O.fromObject(n, t) : O.invalid("unparsable", `the input "${e}" can't be parsed as ISO 8601`);
|
|
2145
2145
|
}
|
|
2146
2146
|
/**
|
|
2147
2147
|
* Create an invalid Duration.
|
|
@@ -2151,11 +2151,11 @@ class k {
|
|
|
2151
2151
|
*/
|
|
2152
2152
|
static invalid(e, t = null) {
|
|
2153
2153
|
if (!e)
|
|
2154
|
-
throw new
|
|
2154
|
+
throw new C("need to specify a reason the Duration is invalid");
|
|
2155
2155
|
const n = e instanceof A ? e : new A(e, t);
|
|
2156
2156
|
if (I.throwOnInvalid)
|
|
2157
2157
|
throw new nn(n);
|
|
2158
|
-
return new
|
|
2158
|
+
return new O({ invalid: n });
|
|
2159
2159
|
}
|
|
2160
2160
|
/**
|
|
2161
2161
|
* @private
|
|
@@ -2234,7 +2234,7 @@ class k {
|
|
|
2234
2234
|
...t,
|
|
2235
2235
|
floor: t.round !== !1 && t.floor !== !1
|
|
2236
2236
|
};
|
|
2237
|
-
return this.isValid ?
|
|
2237
|
+
return this.isValid ? b.create(this.loc, n).formatDurationFromString(this, e) : Vt;
|
|
2238
2238
|
}
|
|
2239
2239
|
/**
|
|
2240
2240
|
* Returns a string representation of a Duration with all units included.
|
|
@@ -2279,7 +2279,7 @@ class k {
|
|
|
2279
2279
|
toISO() {
|
|
2280
2280
|
if (!this.isValid) return null;
|
|
2281
2281
|
let e = "P";
|
|
2282
|
-
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e +=
|
|
2282
|
+
return this.years !== 0 && (e += this.years + "Y"), (this.months !== 0 || this.quarters !== 0) && (e += this.months + this.quarters * 3 + "M"), this.weeks !== 0 && (e += this.weeks + "W"), this.days !== 0 && (e += this.days + "D"), (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) && (e += "T"), this.hours !== 0 && (e += this.hours + "H"), this.minutes !== 0 && (e += this.minutes + "M"), (this.seconds !== 0 || this.milliseconds !== 0) && (e += ht(this.seconds + this.milliseconds / 1e3, 3) + "S"), e === "P" && (e += "T0S"), e;
|
|
2283
2283
|
}
|
|
2284
2284
|
/**
|
|
2285
2285
|
* Returns an ISO 8601-compliant string representation of this Duration, formatted as a time of day.
|
|
@@ -2351,7 +2351,7 @@ class k {
|
|
|
2351
2351
|
*/
|
|
2352
2352
|
plus(e) {
|
|
2353
2353
|
if (!this.isValid) return this;
|
|
2354
|
-
const t =
|
|
2354
|
+
const t = O.fromDurationLike(e), n = {};
|
|
2355
2355
|
for (const s of te)
|
|
2356
2356
|
(fe(t.values, s) || fe(this.values, s)) && (n[s] = t.get(s) + this.get(s));
|
|
2357
2357
|
return P(this, { values: n }, !0);
|
|
@@ -2363,7 +2363,7 @@ class k {
|
|
|
2363
2363
|
*/
|
|
2364
2364
|
minus(e) {
|
|
2365
2365
|
if (!this.isValid) return this;
|
|
2366
|
-
const t =
|
|
2366
|
+
const t = O.fromDurationLike(e);
|
|
2367
2367
|
return this.plus(t.negate());
|
|
2368
2368
|
}
|
|
2369
2369
|
/**
|
|
@@ -2377,7 +2377,7 @@ class k {
|
|
|
2377
2377
|
if (!this.isValid) return this;
|
|
2378
2378
|
const t = {};
|
|
2379
2379
|
for (const n of Object.keys(this.values))
|
|
2380
|
-
t[n] =
|
|
2380
|
+
t[n] = Dr(e(this.values[n], n));
|
|
2381
2381
|
return P(this, { values: t }, !0);
|
|
2382
2382
|
}
|
|
2383
2383
|
/**
|
|
@@ -2389,7 +2389,7 @@ class k {
|
|
|
2389
2389
|
* @return {number}
|
|
2390
2390
|
*/
|
|
2391
2391
|
get(e) {
|
|
2392
|
-
return this[
|
|
2392
|
+
return this[O.normalizeUnit(e)];
|
|
2393
2393
|
}
|
|
2394
2394
|
/**
|
|
2395
2395
|
* "Set" the values of specified units. Return a newly-constructed Duration.
|
|
@@ -2400,7 +2400,7 @@ class k {
|
|
|
2400
2400
|
*/
|
|
2401
2401
|
set(e) {
|
|
2402
2402
|
if (!this.isValid) return this;
|
|
2403
|
-
const t = { ...this.values, ...Ae(e,
|
|
2403
|
+
const t = { ...this.values, ...Ae(e, O.normalizeUnit) };
|
|
2404
2404
|
return P(this, { values: t });
|
|
2405
2405
|
}
|
|
2406
2406
|
/**
|
|
@@ -2462,7 +2462,7 @@ class k {
|
|
|
2462
2462
|
if (!this.isValid) return this;
|
|
2463
2463
|
if (e.length === 0)
|
|
2464
2464
|
return this;
|
|
2465
|
-
e = e.map((i) =>
|
|
2465
|
+
e = e.map((i) => O.normalizeUnit(i));
|
|
2466
2466
|
const t = {}, n = {}, s = this.toObject();
|
|
2467
2467
|
let a;
|
|
2468
2468
|
for (const i of te)
|
|
@@ -2633,7 +2633,7 @@ class M {
|
|
|
2633
2633
|
*/
|
|
2634
2634
|
static invalid(e, t = null) {
|
|
2635
2635
|
if (!e)
|
|
2636
|
-
throw new
|
|
2636
|
+
throw new C("need to specify a reason the Interval is invalid");
|
|
2637
2637
|
const n = e instanceof A ? e : new A(e, t);
|
|
2638
2638
|
if (I.throwOnInvalid)
|
|
2639
2639
|
throw new rn(n);
|
|
@@ -2659,7 +2659,7 @@ class M {
|
|
|
2659
2659
|
* @return {Interval}
|
|
2660
2660
|
*/
|
|
2661
2661
|
static after(e, t) {
|
|
2662
|
-
const n =
|
|
2662
|
+
const n = O.fromDurationLike(t), s = Te(e);
|
|
2663
2663
|
return M.fromDateTimes(s, s.plus(n));
|
|
2664
2664
|
}
|
|
2665
2665
|
/**
|
|
@@ -2669,7 +2669,7 @@ class M {
|
|
|
2669
2669
|
* @return {Interval}
|
|
2670
2670
|
*/
|
|
2671
2671
|
static before(e, t) {
|
|
2672
|
-
const n =
|
|
2672
|
+
const n = O.fromDurationLike(t), s = Te(e);
|
|
2673
2673
|
return M.fromDateTimes(s.minus(n), s);
|
|
2674
2674
|
}
|
|
2675
2675
|
/**
|
|
@@ -2698,11 +2698,11 @@ class M {
|
|
|
2698
2698
|
if (i && u)
|
|
2699
2699
|
return M.fromDateTimes(a, o);
|
|
2700
2700
|
if (i) {
|
|
2701
|
-
const l =
|
|
2701
|
+
const l = O.fromISO(s, t);
|
|
2702
2702
|
if (l.isValid)
|
|
2703
2703
|
return M.after(a, l);
|
|
2704
2704
|
} else if (u) {
|
|
2705
|
-
const l =
|
|
2705
|
+
const l = O.fromISO(n, t);
|
|
2706
2706
|
if (l.isValid)
|
|
2707
2707
|
return M.before(o, l);
|
|
2708
2708
|
}
|
|
@@ -2846,7 +2846,7 @@ class M {
|
|
|
2846
2846
|
* @return {Array}
|
|
2847
2847
|
*/
|
|
2848
2848
|
splitBy(e) {
|
|
2849
|
-
const t =
|
|
2849
|
+
const t = O.fromDurationLike(e);
|
|
2850
2850
|
if (!this.isValid || !t.isValid || t.as("milliseconds") === 0)
|
|
2851
2851
|
return [];
|
|
2852
2852
|
let { s: n } = this, s = 1, a;
|
|
@@ -2997,7 +2997,7 @@ class M {
|
|
|
2997
2997
|
* @return {string}
|
|
2998
2998
|
*/
|
|
2999
2999
|
toLocaleString(e = ze, t = {}) {
|
|
3000
|
-
return this.isValid ?
|
|
3000
|
+
return this.isValid ? b.create(this.s.loc.clone(t), e).formatInterval(this) : ie;
|
|
3001
3001
|
}
|
|
3002
3002
|
/**
|
|
3003
3003
|
* Returns an ISO 8601-compliant string representation of this Interval.
|
|
@@ -3054,7 +3054,7 @@ class M {
|
|
|
3054
3054
|
* @return {Duration}
|
|
3055
3055
|
*/
|
|
3056
3056
|
toDuration(e, t) {
|
|
3057
|
-
return this.isValid ? this.e.diff(this.s, e, t) :
|
|
3057
|
+
return this.isValid ? this.e.diff(this.s, e, t) : O.invalid(this.invalidReason);
|
|
3058
3058
|
}
|
|
3059
3059
|
/**
|
|
3060
3060
|
* Run mapFn on the interval start and end, returning a new Interval from the resulting DateTimes
|
|
@@ -3067,7 +3067,7 @@ class M {
|
|
|
3067
3067
|
return M.fromDateTimes(e(this.s), e(this.e));
|
|
3068
3068
|
}
|
|
3069
3069
|
}
|
|
3070
|
-
class
|
|
3070
|
+
class Oe {
|
|
3071
3071
|
/**
|
|
3072
3072
|
* Return whether the specified zone contains a DST.
|
|
3073
3073
|
* @param {string|Zone} [zone='local'] - Zone to check. Defaults to the environment's local zone.
|
|
@@ -3083,7 +3083,7 @@ class ke {
|
|
|
3083
3083
|
* @return {boolean}
|
|
3084
3084
|
*/
|
|
3085
3085
|
static isValidIANAZone(e) {
|
|
3086
|
-
return
|
|
3086
|
+
return H.isValidZone(e);
|
|
3087
3087
|
}
|
|
3088
3088
|
/**
|
|
3089
3089
|
* Converts the input into a {@link Zone} instance.
|
|
@@ -3110,7 +3110,7 @@ class ke {
|
|
|
3110
3110
|
* @returns {number} the start of the week, 1 for Monday through 7 for Sunday
|
|
3111
3111
|
*/
|
|
3112
3112
|
static getStartOfWeek({ locale: e = null, locObj: t = null } = {}) {
|
|
3113
|
-
return (t ||
|
|
3113
|
+
return (t || N.create(e)).getStartOfWeek();
|
|
3114
3114
|
}
|
|
3115
3115
|
/**
|
|
3116
3116
|
* Get the minimum number of days necessary in a week before it is considered part of the next year according
|
|
@@ -3121,7 +3121,7 @@ class ke {
|
|
|
3121
3121
|
* @returns {number}
|
|
3122
3122
|
*/
|
|
3123
3123
|
static getMinimumDaysInFirstWeek({ locale: e = null, locObj: t = null } = {}) {
|
|
3124
|
-
return (t ||
|
|
3124
|
+
return (t || N.create(e)).getMinDaysInFirstWeek();
|
|
3125
3125
|
}
|
|
3126
3126
|
/**
|
|
3127
3127
|
* Get the weekdays, which are considered the weekend according to the given locale
|
|
@@ -3131,7 +3131,7 @@ class ke {
|
|
|
3131
3131
|
* @returns {number[]} an array of weekdays, 1 for Monday through 7 for Sunday
|
|
3132
3132
|
*/
|
|
3133
3133
|
static getWeekendWeekdays({ locale: e = null, locObj: t = null } = {}) {
|
|
3134
|
-
return (t ||
|
|
3134
|
+
return (t || N.create(e)).getWeekendDays().slice();
|
|
3135
3135
|
}
|
|
3136
3136
|
/**
|
|
3137
3137
|
* Return an array of standalone month names.
|
|
@@ -3151,7 +3151,7 @@ class ke {
|
|
|
3151
3151
|
* @return {Array}
|
|
3152
3152
|
*/
|
|
3153
3153
|
static months(e = "long", { locale: t = null, numberingSystem: n = null, locObj: s = null, outputCalendar: a = "gregory" } = {}) {
|
|
3154
|
-
return (s ||
|
|
3154
|
+
return (s || N.create(t, n, a)).months(e);
|
|
3155
3155
|
}
|
|
3156
3156
|
/**
|
|
3157
3157
|
* Return an array of format month names.
|
|
@@ -3167,7 +3167,7 @@ class ke {
|
|
|
3167
3167
|
* @return {Array}
|
|
3168
3168
|
*/
|
|
3169
3169
|
static monthsFormat(e = "long", { locale: t = null, numberingSystem: n = null, locObj: s = null, outputCalendar: a = "gregory" } = {}) {
|
|
3170
|
-
return (s ||
|
|
3170
|
+
return (s || N.create(t, n, a)).months(e, !0);
|
|
3171
3171
|
}
|
|
3172
3172
|
/**
|
|
3173
3173
|
* Return an array of standalone week names.
|
|
@@ -3184,7 +3184,7 @@ class ke {
|
|
|
3184
3184
|
* @return {Array}
|
|
3185
3185
|
*/
|
|
3186
3186
|
static weekdays(e = "long", { locale: t = null, numberingSystem: n = null, locObj: s = null } = {}) {
|
|
3187
|
-
return (s ||
|
|
3187
|
+
return (s || N.create(t, n, null)).weekdays(e);
|
|
3188
3188
|
}
|
|
3189
3189
|
/**
|
|
3190
3190
|
* Return an array of format week names.
|
|
@@ -3199,7 +3199,7 @@ class ke {
|
|
|
3199
3199
|
* @return {Array}
|
|
3200
3200
|
*/
|
|
3201
3201
|
static weekdaysFormat(e = "long", { locale: t = null, numberingSystem: n = null, locObj: s = null } = {}) {
|
|
3202
|
-
return (s ||
|
|
3202
|
+
return (s || N.create(t, n, null)).weekdays(e, !0);
|
|
3203
3203
|
}
|
|
3204
3204
|
/**
|
|
3205
3205
|
* Return an array of meridiems.
|
|
@@ -3210,7 +3210,7 @@ class ke {
|
|
|
3210
3210
|
* @return {Array}
|
|
3211
3211
|
*/
|
|
3212
3212
|
static meridiems({ locale: e = null } = {}) {
|
|
3213
|
-
return
|
|
3213
|
+
return N.create(e).meridiems();
|
|
3214
3214
|
}
|
|
3215
3215
|
/**
|
|
3216
3216
|
* Return an array of eras, such as ['BC', 'AD']. The locale can be specified, but the calendar system is always Gregorian.
|
|
@@ -3223,7 +3223,7 @@ class ke {
|
|
|
3223
3223
|
* @return {Array}
|
|
3224
3224
|
*/
|
|
3225
3225
|
static eras(e = "short", { locale: t = null } = {}) {
|
|
3226
|
-
return
|
|
3226
|
+
return N.create(t, null, "gregory").eras(e);
|
|
3227
3227
|
}
|
|
3228
3228
|
/**
|
|
3229
3229
|
* Return the set of available features in this environment.
|
|
@@ -3235,12 +3235,12 @@ class ke {
|
|
|
3235
3235
|
* @return {Object}
|
|
3236
3236
|
*/
|
|
3237
3237
|
static features() {
|
|
3238
|
-
return { relative:
|
|
3238
|
+
return { relative: Sr(), localeWeek: vr() };
|
|
3239
3239
|
}
|
|
3240
3240
|
}
|
|
3241
3241
|
function Lt(r, e) {
|
|
3242
3242
|
const t = (s) => s.toUTC(0, { keepLocalTime: !0 }).startOf("day").valueOf(), n = t(e) - t(r);
|
|
3243
|
-
return Math.floor(
|
|
3243
|
+
return Math.floor(O.fromMillis(n).as("days"));
|
|
3244
3244
|
}
|
|
3245
3245
|
function Ws(r, e, t) {
|
|
3246
3246
|
const n = [
|
|
@@ -3267,11 +3267,11 @@ function Ls(r, e, t, n) {
|
|
|
3267
3267
|
(m) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(m) >= 0
|
|
3268
3268
|
);
|
|
3269
3269
|
l.length === 0 && (i < e && (i = s.plus({ [o]: 1 })), i !== s && (a[o] = (a[o] || 0) + u / (i - s)));
|
|
3270
|
-
const c =
|
|
3271
|
-
return l.length > 0 ?
|
|
3270
|
+
const c = O.fromObject(a, n);
|
|
3271
|
+
return l.length > 0 ? O.fromMillis(u, n).shiftTo(...l).plus(c) : c;
|
|
3272
3272
|
}
|
|
3273
3273
|
const $s = "missing Intl.DateTimeFormat.formatToParts support";
|
|
3274
|
-
function
|
|
3274
|
+
function S(r, e = (t) => t) {
|
|
3275
3275
|
return { regex: r, deser: ([t]) => e(En(t)) };
|
|
3276
3276
|
}
|
|
3277
3277
|
const zs = " ", Ar = `[ ${zs}]`, Rr = new RegExp(Ar, "g");
|
|
@@ -3290,98 +3290,98 @@ function U(r, e) {
|
|
|
3290
3290
|
function zt(r, e) {
|
|
3291
3291
|
return { regex: r, deser: ([, t, n]) => Ye(t, n), groups: e };
|
|
3292
3292
|
}
|
|
3293
|
-
function
|
|
3293
|
+
function Ce(r) {
|
|
3294
3294
|
return { regex: r, deser: ([e]) => e };
|
|
3295
3295
|
}
|
|
3296
3296
|
function Us(r) {
|
|
3297
3297
|
return r.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
|
|
3298
3298
|
}
|
|
3299
3299
|
function As(r, e) {
|
|
3300
|
-
const t = Z(e), n = Z(e, "{2}"), s = Z(e, "{3}"), a = Z(e, "{4}"), i = Z(e, "{6}"), o = Z(e, "{1,2}"), u = Z(e, "{1,3}"), l = Z(e, "{1,6}"), c = Z(e, "{1,9}"), m = Z(e, "{2,4}"), g = Z(e, "{4,6}"),
|
|
3300
|
+
const t = Z(e), n = Z(e, "{2}"), s = Z(e, "{3}"), a = Z(e, "{4}"), i = Z(e, "{6}"), o = Z(e, "{1,2}"), u = Z(e, "{1,3}"), l = Z(e, "{1,6}"), c = Z(e, "{1,9}"), m = Z(e, "{2,4}"), g = Z(e, "{4,6}"), h = (E) => ({ regex: RegExp(Us(E.val)), deser: ([k]) => k, literal: !0 }), D = ((E) => {
|
|
3301
3301
|
if (r.literal)
|
|
3302
|
-
return
|
|
3302
|
+
return h(E);
|
|
3303
3303
|
switch (E.val) {
|
|
3304
3304
|
case "G":
|
|
3305
3305
|
return U(e.eras("short"), 0);
|
|
3306
3306
|
case "GG":
|
|
3307
3307
|
return U(e.eras("long"), 0);
|
|
3308
3308
|
case "y":
|
|
3309
|
-
return
|
|
3309
|
+
return S(l);
|
|
3310
3310
|
case "yy":
|
|
3311
|
-
return
|
|
3311
|
+
return S(m, ot);
|
|
3312
3312
|
case "yyyy":
|
|
3313
|
-
return
|
|
3313
|
+
return S(a);
|
|
3314
3314
|
case "yyyyy":
|
|
3315
|
-
return
|
|
3315
|
+
return S(g);
|
|
3316
3316
|
case "yyyyyy":
|
|
3317
|
-
return
|
|
3317
|
+
return S(i);
|
|
3318
3318
|
case "M":
|
|
3319
|
-
return
|
|
3319
|
+
return S(o);
|
|
3320
3320
|
case "MM":
|
|
3321
|
-
return
|
|
3321
|
+
return S(n);
|
|
3322
3322
|
case "MMM":
|
|
3323
3323
|
return U(e.months("short", !0), 1);
|
|
3324
3324
|
case "MMMM":
|
|
3325
3325
|
return U(e.months("long", !0), 1);
|
|
3326
3326
|
case "L":
|
|
3327
|
-
return
|
|
3327
|
+
return S(o);
|
|
3328
3328
|
case "LL":
|
|
3329
|
-
return
|
|
3329
|
+
return S(n);
|
|
3330
3330
|
case "LLL":
|
|
3331
3331
|
return U(e.months("short", !1), 1);
|
|
3332
3332
|
case "LLLL":
|
|
3333
3333
|
return U(e.months("long", !1), 1);
|
|
3334
3334
|
case "d":
|
|
3335
|
-
return
|
|
3335
|
+
return S(o);
|
|
3336
3336
|
case "dd":
|
|
3337
|
-
return
|
|
3337
|
+
return S(n);
|
|
3338
3338
|
case "o":
|
|
3339
|
-
return
|
|
3339
|
+
return S(u);
|
|
3340
3340
|
case "ooo":
|
|
3341
|
-
return
|
|
3341
|
+
return S(s);
|
|
3342
3342
|
case "HH":
|
|
3343
|
-
return
|
|
3343
|
+
return S(n);
|
|
3344
3344
|
case "H":
|
|
3345
|
-
return
|
|
3345
|
+
return S(o);
|
|
3346
3346
|
case "hh":
|
|
3347
|
-
return
|
|
3347
|
+
return S(n);
|
|
3348
3348
|
case "h":
|
|
3349
|
-
return
|
|
3349
|
+
return S(o);
|
|
3350
3350
|
case "mm":
|
|
3351
|
-
return
|
|
3351
|
+
return S(n);
|
|
3352
3352
|
case "m":
|
|
3353
|
-
return
|
|
3353
|
+
return S(o);
|
|
3354
3354
|
case "q":
|
|
3355
|
-
return
|
|
3355
|
+
return S(o);
|
|
3356
3356
|
case "qq":
|
|
3357
|
-
return
|
|
3357
|
+
return S(n);
|
|
3358
3358
|
case "s":
|
|
3359
|
-
return
|
|
3359
|
+
return S(o);
|
|
3360
3360
|
case "ss":
|
|
3361
|
-
return
|
|
3361
|
+
return S(n);
|
|
3362
3362
|
case "S":
|
|
3363
|
-
return
|
|
3363
|
+
return S(u);
|
|
3364
3364
|
case "SSS":
|
|
3365
|
-
return
|
|
3365
|
+
return S(s);
|
|
3366
3366
|
case "u":
|
|
3367
|
-
return
|
|
3367
|
+
return Ce(c);
|
|
3368
3368
|
case "uu":
|
|
3369
|
-
return
|
|
3369
|
+
return Ce(o);
|
|
3370
3370
|
case "uuu":
|
|
3371
|
-
return
|
|
3371
|
+
return S(t);
|
|
3372
3372
|
case "a":
|
|
3373
3373
|
return U(e.meridiems(), 0);
|
|
3374
3374
|
case "kkkk":
|
|
3375
|
-
return
|
|
3375
|
+
return S(a);
|
|
3376
3376
|
case "kk":
|
|
3377
|
-
return
|
|
3377
|
+
return S(m, ot);
|
|
3378
3378
|
case "W":
|
|
3379
|
-
return
|
|
3379
|
+
return S(o);
|
|
3380
3380
|
case "WW":
|
|
3381
|
-
return
|
|
3381
|
+
return S(n);
|
|
3382
3382
|
case "E":
|
|
3383
3383
|
case "c":
|
|
3384
|
-
return
|
|
3384
|
+
return S(t);
|
|
3385
3385
|
case "EEE":
|
|
3386
3386
|
return U(e.weekdays("short", !1), 1);
|
|
3387
3387
|
case "EEEE":
|
|
@@ -3396,16 +3396,16 @@ function As(r, e) {
|
|
|
3396
3396
|
case "ZZZ":
|
|
3397
3397
|
return zt(new RegExp(`([+-]${o.source})(${n.source})?`), 2);
|
|
3398
3398
|
case "z":
|
|
3399
|
-
return
|
|
3399
|
+
return Ce(/[a-z_+-/]{1,256}?/i);
|
|
3400
3400
|
case " ":
|
|
3401
|
-
return
|
|
3401
|
+
return Ce(/[^\S\n\r]/);
|
|
3402
3402
|
default:
|
|
3403
|
-
return
|
|
3403
|
+
return h(E);
|
|
3404
3404
|
}
|
|
3405
3405
|
})(r) || {
|
|
3406
3406
|
invalidReason: $s
|
|
3407
3407
|
};
|
|
3408
|
-
return
|
|
3408
|
+
return D.token = r, D;
|
|
3409
3409
|
}
|
|
3410
3410
|
const Rs = {
|
|
3411
3411
|
year: {
|
|
@@ -3449,7 +3449,7 @@ const Rs = {
|
|
|
3449
3449
|
short: "ZZZ"
|
|
3450
3450
|
}
|
|
3451
3451
|
};
|
|
3452
|
-
function
|
|
3452
|
+
function Hs(r, e, t) {
|
|
3453
3453
|
const { type: n, value: s } = r;
|
|
3454
3454
|
if (n === "literal") {
|
|
3455
3455
|
const u = /^\s+$/.test(s);
|
|
@@ -3468,7 +3468,7 @@ function qs(r, e, t) {
|
|
|
3468
3468
|
val: o
|
|
3469
3469
|
};
|
|
3470
3470
|
}
|
|
3471
|
-
function
|
|
3471
|
+
function qs(r) {
|
|
3472
3472
|
return [`^${r.map((t) => t.regex).reduce((t, n) => `${t}(${n.source})`, "")}$`, r];
|
|
3473
3473
|
}
|
|
3474
3474
|
function Ys(r, e, t) {
|
|
@@ -3520,7 +3520,7 @@ function Ps(r) {
|
|
|
3520
3520
|
}
|
|
3521
3521
|
};
|
|
3522
3522
|
let t = null, n;
|
|
3523
|
-
return w(r.z) || (t =
|
|
3523
|
+
return w(r.z) || (t = H.create(r.z)), w(r.Z) || (t || (t = new F(r.Z)), n = r.Z), w(r.q) || (r.M = (r.q - 1) * 3 + 1), w(r.h) || (r.h < 12 && r.a === 1 ? r.h += 12 : r.h === 12 && r.a === 0 && (r.h = 0)), r.G === 0 && r.y && (r.y = -r.y), w(r.u) || (r.S = ft(r.u)), [Object.keys(r).reduce((a, i) => {
|
|
3524
3524
|
const o = e(i);
|
|
3525
3525
|
return o && (a[o] = r[i]), a;
|
|
3526
3526
|
}, {}), t, n];
|
|
@@ -3532,16 +3532,16 @@ function Gs() {
|
|
|
3532
3532
|
function Js(r, e) {
|
|
3533
3533
|
if (r.literal)
|
|
3534
3534
|
return r;
|
|
3535
|
-
const t =
|
|
3535
|
+
const t = b.macroTokenToFormatOpts(r.val), n = Pr(t, e);
|
|
3536
3536
|
return n == null || n.includes(void 0) ? r : n;
|
|
3537
3537
|
}
|
|
3538
|
-
function
|
|
3538
|
+
function Hr(r, e) {
|
|
3539
3539
|
return Array.prototype.concat(...r.map((t) => Js(t, e)));
|
|
3540
3540
|
}
|
|
3541
|
-
class
|
|
3541
|
+
class qr {
|
|
3542
3542
|
constructor(e, t) {
|
|
3543
|
-
if (this.locale = e, this.format = t, this.tokens =
|
|
3544
|
-
const [n, s] =
|
|
3543
|
+
if (this.locale = e, this.format = t, this.tokens = Hr(b.parseFormat(t), e), this.units = this.tokens.map((n) => As(n, e)), this.disqualifyingUnit = this.units.find((n) => n.invalidReason), !this.disqualifyingUnit) {
|
|
3544
|
+
const [n, s] = qs(this.units);
|
|
3545
3545
|
this.regex = RegExp(n, "i"), this.handlers = s;
|
|
3546
3546
|
}
|
|
3547
3547
|
}
|
|
@@ -3573,7 +3573,7 @@ class Hr {
|
|
|
3573
3573
|
}
|
|
3574
3574
|
}
|
|
3575
3575
|
function Yr(r, e, t) {
|
|
3576
|
-
return new
|
|
3576
|
+
return new qr(r, t).explainFromTokens(e);
|
|
3577
3577
|
}
|
|
3578
3578
|
function js(r, e, t) {
|
|
3579
3579
|
const { result: n, zone: s, specificOffset: a, invalidReason: i } = Yr(r, e, t);
|
|
@@ -3582,11 +3582,11 @@ function js(r, e, t) {
|
|
|
3582
3582
|
function Pr(r, e) {
|
|
3583
3583
|
if (!r)
|
|
3584
3584
|
return null;
|
|
3585
|
-
const n =
|
|
3586
|
-
return s.map((i) =>
|
|
3585
|
+
const n = b.create(e, r).dtFormatter(Gs()), s = n.formatToParts(), a = n.resolvedOptions();
|
|
3586
|
+
return s.map((i) => Hs(i, r, a));
|
|
3587
3587
|
}
|
|
3588
3588
|
const Qe = "Invalid DateTime", Zt = 864e13;
|
|
3589
|
-
function
|
|
3589
|
+
function Se(r) {
|
|
3590
3590
|
return new A("unsupported zone", `the zone "${r.name}" is not supported`);
|
|
3591
3591
|
}
|
|
3592
3592
|
function Ke(r) {
|
|
@@ -3619,7 +3619,7 @@ function Gr(r, e, t) {
|
|
|
3619
3619
|
const a = t.offset(n);
|
|
3620
3620
|
return s === a ? [n, s] : [r - Math.min(s, a) * 60 * 1e3, Math.max(s, a)];
|
|
3621
3621
|
}
|
|
3622
|
-
function
|
|
3622
|
+
function be(r, e) {
|
|
3623
3623
|
r += e * 60 * 1e3;
|
|
3624
3624
|
const t = new Date(r);
|
|
3625
3625
|
return {
|
|
@@ -3633,7 +3633,7 @@ function Ce(r, e) {
|
|
|
3633
3633
|
};
|
|
3634
3634
|
}
|
|
3635
3635
|
function We(r, e, t) {
|
|
3636
|
-
return Gr(
|
|
3636
|
+
return Gr(qe(r), e, t);
|
|
3637
3637
|
}
|
|
3638
3638
|
function Ut(r, e) {
|
|
3639
3639
|
const t = r.o, n = r.c.year + Math.trunc(e.years), s = r.c.month + Math.trunc(e.months) + Math.trunc(e.quarters) * 3, a = {
|
|
@@ -3641,7 +3641,7 @@ function Ut(r, e) {
|
|
|
3641
3641
|
year: n,
|
|
3642
3642
|
month: s,
|
|
3643
3643
|
day: Math.min(r.c.day, Ue(n, s)) + Math.trunc(e.days) + Math.trunc(e.weeks) * 7
|
|
3644
|
-
}, i =
|
|
3644
|
+
}, i = O.fromObject({
|
|
3645
3645
|
years: e.years - Math.trunc(e.years),
|
|
3646
3646
|
quarters: e.quarters - Math.trunc(e.quarters),
|
|
3647
3647
|
months: e.months - Math.trunc(e.months),
|
|
@@ -3651,7 +3651,7 @@ function Ut(r, e) {
|
|
|
3651
3651
|
minutes: e.minutes,
|
|
3652
3652
|
seconds: e.seconds,
|
|
3653
3653
|
milliseconds: e.milliseconds
|
|
3654
|
-
}).as("milliseconds"), o =
|
|
3654
|
+
}).as("milliseconds"), o = qe(a);
|
|
3655
3655
|
let [u, l] = Gr(o, t, r.zone);
|
|
3656
3656
|
return i !== 0 && (u += i, l = r.zone.offset(u)), { ts: u, o: l };
|
|
3657
3657
|
}
|
|
@@ -3670,7 +3670,7 @@ function ae(r, e, t, n, s, a) {
|
|
|
3670
3670
|
);
|
|
3671
3671
|
}
|
|
3672
3672
|
function Fe(r, e, t = !0) {
|
|
3673
|
-
return r.isValid ?
|
|
3673
|
+
return r.isValid ? b.create(N.create("en-US"), {
|
|
3674
3674
|
allowZ: t,
|
|
3675
3675
|
forceSimple: !0
|
|
3676
3676
|
}).formatDateTimeFromString(r, e) : null;
|
|
@@ -3678,11 +3678,11 @@ function Fe(r, e, t = !0) {
|
|
|
3678
3678
|
function et(r, e) {
|
|
3679
3679
|
const t = r.c.year > 9999 || r.c.year < 0;
|
|
3680
3680
|
let n = "";
|
|
3681
|
-
return t && r.c.year >= 0 && (n += "+"), n +=
|
|
3681
|
+
return t && r.c.year >= 0 && (n += "+"), n += _(r.c.year, t ? 6 : 4), e ? (n += "-", n += _(r.c.month), n += "-", n += _(r.c.day)) : (n += _(r.c.month), n += _(r.c.day)), n;
|
|
3682
3682
|
}
|
|
3683
3683
|
function At(r, e, t, n, s, a) {
|
|
3684
|
-
let i =
|
|
3685
|
-
return e ? (i += ":", i +=
|
|
3684
|
+
let i = _(r.c.hour);
|
|
3685
|
+
return e ? (i += ":", i += _(r.c.minute), (r.c.millisecond !== 0 || r.c.second !== 0 || !t) && (i += ":")) : i += _(r.c.minute), (r.c.millisecond !== 0 || r.c.second !== 0 || !t) && (i += _(r.c.second), (r.c.millisecond !== 0 || !n) && (i += ".", i += _(r.c.millisecond, 3))), s && (r.isOffsetFixed && r.offset === 0 && !a ? i += "Z" : r.o < 0 ? (i += "-", i += _(Math.trunc(-r.o / 60)), i += ":", i += _(Math.trunc(-r.o % 60))) : (i += "+", i += _(Math.trunc(r.o / 60)), i += ":", i += _(Math.trunc(r.o % 60)))), a && (i += "[" + r.zone.ianaName + "]"), i;
|
|
3686
3686
|
}
|
|
3687
3687
|
const Jr = {
|
|
3688
3688
|
month: 1,
|
|
@@ -3761,18 +3761,18 @@ function Rt(r) {
|
|
|
3761
3761
|
function ti(r) {
|
|
3762
3762
|
return $e[r] || (Le === void 0 && (Le = I.now()), $e[r] = r.offset(Le)), $e[r];
|
|
3763
3763
|
}
|
|
3764
|
-
function
|
|
3764
|
+
function Ht(r, e) {
|
|
3765
3765
|
const t = J(e.zone, I.defaultZone);
|
|
3766
3766
|
if (!t.isValid)
|
|
3767
|
-
return p.invalid(
|
|
3768
|
-
const n =
|
|
3767
|
+
return p.invalid(Se(t));
|
|
3768
|
+
const n = N.fromObject(e);
|
|
3769
3769
|
let s, a;
|
|
3770
3770
|
if (w(r.year))
|
|
3771
3771
|
s = I.now();
|
|
3772
3772
|
else {
|
|
3773
3773
|
for (const u of jr)
|
|
3774
3774
|
w(r[u]) && (r[u] = Jr[u]);
|
|
3775
|
-
const i =
|
|
3775
|
+
const i = kr(r) || Or(r);
|
|
3776
3776
|
if (i)
|
|
3777
3777
|
return p.invalid(i);
|
|
3778
3778
|
const o = ti(t);
|
|
@@ -3780,8 +3780,8 @@ function qt(r, e) {
|
|
|
3780
3780
|
}
|
|
3781
3781
|
return new p({ ts: s, zone: t, loc: n, o: a });
|
|
3782
3782
|
}
|
|
3783
|
-
function
|
|
3784
|
-
const n = w(t.round) ? !0 : t.round, s = (i, o) => (i =
|
|
3783
|
+
function qt(r, e, t) {
|
|
3784
|
+
const n = w(t.round) ? !0 : t.round, s = (i, o) => (i = ht(i, n || t.calendary ? 0 : 2, !0), e.loc.clone(t).relFormatter(t).format(i, o)), a = (i) => t.calendary ? e.hasSame(r, i) ? 0 : e.startOf(i).diff(r.startOf(i), i).get(i) : e.diff(r, i).get(i);
|
|
3785
3785
|
if (t.unit)
|
|
3786
3786
|
return s(a(t.unit), t.unit);
|
|
3787
3787
|
for (const i of t.units) {
|
|
@@ -3802,7 +3802,7 @@ class p {
|
|
|
3802
3802
|
*/
|
|
3803
3803
|
constructor(e) {
|
|
3804
3804
|
const t = e.zone || I.defaultZone;
|
|
3805
|
-
let n = e.invalid || (Number.isNaN(e.ts) ? new A("invalid input") : null) || (t.isValid ? null :
|
|
3805
|
+
let n = e.invalid || (Number.isNaN(e.ts) ? new A("invalid input") : null) || (t.isValid ? null : Se(t));
|
|
3806
3806
|
this.ts = w(e.ts) ? I.now() : e.ts;
|
|
3807
3807
|
let s = null, a = null;
|
|
3808
3808
|
if (!n)
|
|
@@ -3810,9 +3810,9 @@ class p {
|
|
|
3810
3810
|
[s, a] = [e.old.c, e.old.o];
|
|
3811
3811
|
else {
|
|
3812
3812
|
const o = j(e.o) && !e.old ? e.o : t.offset(this.ts);
|
|
3813
|
-
s =
|
|
3813
|
+
s = be(this.ts, o), n = Number.isNaN(s.year) ? new A("invalid input") : null, s = n ? null : s, a = n ? null : o;
|
|
3814
3814
|
}
|
|
3815
|
-
this._zone = t, this.loc = e.loc ||
|
|
3815
|
+
this._zone = t, this.loc = e.loc || N.create(), this.invalid = n, this.weekData = null, this.localWeekData = null, this.c = s, this.o = a, this.isLuxonDateTime = !0;
|
|
3816
3816
|
}
|
|
3817
3817
|
// CONSTRUCT
|
|
3818
3818
|
/**
|
|
@@ -3848,7 +3848,7 @@ class p {
|
|
|
3848
3848
|
*/
|
|
3849
3849
|
static local() {
|
|
3850
3850
|
const [e, t] = Yt(arguments), [n, s, a, i, o, u, l] = t;
|
|
3851
|
-
return
|
|
3851
|
+
return Ht({ year: n, month: s, day: a, hour: i, minute: o, second: u, millisecond: l }, e);
|
|
3852
3852
|
}
|
|
3853
3853
|
/**
|
|
3854
3854
|
* Create a DateTime in UTC
|
|
@@ -3877,7 +3877,7 @@ class p {
|
|
|
3877
3877
|
*/
|
|
3878
3878
|
static utc() {
|
|
3879
3879
|
const [e, t] = Yt(arguments), [n, s, a, i, o, u, l] = t;
|
|
3880
|
-
return e.zone = F.utcInstance,
|
|
3880
|
+
return e.zone = F.utcInstance, Ht({ year: n, month: s, day: a, hour: i, minute: o, second: u, millisecond: l }, e);
|
|
3881
3881
|
}
|
|
3882
3882
|
/**
|
|
3883
3883
|
* Create a DateTime from a JavaScript Date object. Uses the default zone.
|
|
@@ -3887,15 +3887,15 @@ class p {
|
|
|
3887
3887
|
* @return {DateTime}
|
|
3888
3888
|
*/
|
|
3889
3889
|
static fromJSDate(e, t = {}) {
|
|
3890
|
-
const n =
|
|
3890
|
+
const n = Cn(e) ? e.valueOf() : NaN;
|
|
3891
3891
|
if (Number.isNaN(n))
|
|
3892
3892
|
return p.invalid("invalid input");
|
|
3893
3893
|
const s = J(t.zone, I.defaultZone);
|
|
3894
3894
|
return s.isValid ? new p({
|
|
3895
3895
|
ts: n,
|
|
3896
3896
|
zone: s,
|
|
3897
|
-
loc:
|
|
3898
|
-
}) : p.invalid(
|
|
3897
|
+
loc: N.fromObject(t)
|
|
3898
|
+
}) : p.invalid(Se(s));
|
|
3899
3899
|
}
|
|
3900
3900
|
/**
|
|
3901
3901
|
* Create a DateTime from a number of milliseconds since the epoch (meaning since 1 January 1970 00:00:00 UTC). Uses the default zone.
|
|
@@ -3913,9 +3913,9 @@ class p {
|
|
|
3913
3913
|
return e < -Zt || e > Zt ? p.invalid("Timestamp out of range") : new p({
|
|
3914
3914
|
ts: e,
|
|
3915
3915
|
zone: J(t.zone, I.defaultZone),
|
|
3916
|
-
loc:
|
|
3916
|
+
loc: N.fromObject(t)
|
|
3917
3917
|
});
|
|
3918
|
-
throw new
|
|
3918
|
+
throw new C(
|
|
3919
3919
|
`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`
|
|
3920
3920
|
);
|
|
3921
3921
|
}
|
|
@@ -3935,9 +3935,9 @@ class p {
|
|
|
3935
3935
|
return new p({
|
|
3936
3936
|
ts: e * 1e3,
|
|
3937
3937
|
zone: J(t.zone, I.defaultZone),
|
|
3938
|
-
loc:
|
|
3938
|
+
loc: N.fromObject(t)
|
|
3939
3939
|
});
|
|
3940
|
-
throw new
|
|
3940
|
+
throw new C("fromSeconds requires a numerical input");
|
|
3941
3941
|
}
|
|
3942
3942
|
/**
|
|
3943
3943
|
* Create a DateTime from a JavaScript object with keys like 'year' and 'hour' with reasonable defaults.
|
|
@@ -3976,32 +3976,32 @@ class p {
|
|
|
3976
3976
|
e = e || {};
|
|
3977
3977
|
const n = J(t.zone, I.defaultZone);
|
|
3978
3978
|
if (!n.isValid)
|
|
3979
|
-
return p.invalid(
|
|
3980
|
-
const s =
|
|
3981
|
-
if ((
|
|
3979
|
+
return p.invalid(Se(n));
|
|
3980
|
+
const s = N.fromObject(t), a = Ae(e, Rt), { minDaysInFirstWeek: i, startOfWeek: o } = _t(a, s), u = I.now(), l = w(t.specificOffset) ? n.offset(u) : t.specificOffset, c = !w(a.ordinal), m = !w(a.year), g = !w(a.month) || !w(a.day), h = m || g, y = a.weekYear || a.weekNumber;
|
|
3981
|
+
if ((h || c) && y)
|
|
3982
3982
|
throw new ue(
|
|
3983
3983
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
3984
3984
|
);
|
|
3985
3985
|
if (g && c)
|
|
3986
3986
|
throw new ue("Can't mix ordinal dates with month/day");
|
|
3987
|
-
const
|
|
3988
|
-
let E,
|
|
3989
|
-
|
|
3990
|
-
let
|
|
3987
|
+
const D = y || a.weekday && !h;
|
|
3988
|
+
let E, k, v = be(u, l);
|
|
3989
|
+
D ? (E = Ks, k = Bs, v = Ze(v, i, o)) : c ? (E = Xs, k = Qs, v = je(v)) : (E = jr, k = Jr);
|
|
3990
|
+
let x = !1;
|
|
3991
3991
|
for (const we of E) {
|
|
3992
3992
|
const Xr = a[we];
|
|
3993
|
-
w(Xr) ?
|
|
3993
|
+
w(Xr) ? x ? a[we] = k[we] : a[we] = v[we] : x = !0;
|
|
3994
3994
|
}
|
|
3995
|
-
const z =
|
|
3996
|
-
if (
|
|
3997
|
-
return p.invalid(
|
|
3998
|
-
const Br =
|
|
3995
|
+
const z = D ? In(a, i, o) : c ? _n(a) : kr(a), q = z || Or(a);
|
|
3996
|
+
if (q)
|
|
3997
|
+
return p.invalid(q);
|
|
3998
|
+
const Br = D ? Mt(a, i, o) : c ? It(a) : a, [Qr, Kr] = We(Br, l, n), pe = new p({
|
|
3999
3999
|
ts: Qr,
|
|
4000
4000
|
zone: n,
|
|
4001
4001
|
o: Kr,
|
|
4002
4002
|
loc: s
|
|
4003
4003
|
});
|
|
4004
|
-
return a.weekday &&
|
|
4004
|
+
return a.weekday && h && e.weekday !== pe.weekday ? p.invalid(
|
|
4005
4005
|
"mismatched weekday",
|
|
4006
4006
|
`you can't specify both a weekday of ${a.weekday} and a date of ${pe.toISO()}`
|
|
4007
4007
|
) : pe.isValid ? pe : p.invalid(pe.invalid);
|
|
@@ -4024,7 +4024,7 @@ class p {
|
|
|
4024
4024
|
* @return {DateTime}
|
|
4025
4025
|
*/
|
|
4026
4026
|
static fromISO(e, t = {}) {
|
|
4027
|
-
const [n, s] =
|
|
4027
|
+
const [n, s] = ks(e);
|
|
4028
4028
|
return ae(n, s, t, "ISO 8601", e);
|
|
4029
4029
|
}
|
|
4030
4030
|
/**
|
|
@@ -4043,7 +4043,7 @@ class p {
|
|
|
4043
4043
|
* @return {DateTime}
|
|
4044
4044
|
*/
|
|
4045
4045
|
static fromRFC2822(e, t = {}) {
|
|
4046
|
-
const [n, s] =
|
|
4046
|
+
const [n, s] = Os(e);
|
|
4047
4047
|
return ae(n, s, t, "RFC 2822", e);
|
|
4048
4048
|
}
|
|
4049
4049
|
/**
|
|
@@ -4063,7 +4063,7 @@ class p {
|
|
|
4063
4063
|
* @return {DateTime}
|
|
4064
4064
|
*/
|
|
4065
4065
|
static fromHTTP(e, t = {}) {
|
|
4066
|
-
const [n, s] =
|
|
4066
|
+
const [n, s] = Ss(e);
|
|
4067
4067
|
return ae(n, s, t, "HTTP", t);
|
|
4068
4068
|
}
|
|
4069
4069
|
/**
|
|
@@ -4082,8 +4082,8 @@ class p {
|
|
|
4082
4082
|
*/
|
|
4083
4083
|
static fromFormat(e, t, n = {}) {
|
|
4084
4084
|
if (w(e) || w(t))
|
|
4085
|
-
throw new
|
|
4086
|
-
const { locale: s = null, numberingSystem: a = null } = n, i =
|
|
4085
|
+
throw new C("fromFormat requires an input string and a format");
|
|
4086
|
+
const { locale: s = null, numberingSystem: a = null } = n, i = N.fromOpts({
|
|
4087
4087
|
locale: s,
|
|
4088
4088
|
numberingSystem: a,
|
|
4089
4089
|
defaultToEN: !0
|
|
@@ -4118,7 +4118,7 @@ class p {
|
|
|
4118
4118
|
* @return {DateTime}
|
|
4119
4119
|
*/
|
|
4120
4120
|
static fromSQL(e, t = {}) {
|
|
4121
|
-
const [n, s] =
|
|
4121
|
+
const [n, s] = _s(e);
|
|
4122
4122
|
return ae(n, s, t, "SQL", e);
|
|
4123
4123
|
}
|
|
4124
4124
|
/**
|
|
@@ -4129,7 +4129,7 @@ class p {
|
|
|
4129
4129
|
*/
|
|
4130
4130
|
static invalid(e, t = null) {
|
|
4131
4131
|
if (!e)
|
|
4132
|
-
throw new
|
|
4132
|
+
throw new C("need to specify a reason the DateTime is invalid");
|
|
4133
4133
|
const n = e instanceof A ? e : new A(e, t);
|
|
4134
4134
|
if (I.throwOnInvalid)
|
|
4135
4135
|
throw new tn(n);
|
|
@@ -4150,7 +4150,7 @@ class p {
|
|
|
4150
4150
|
* @returns {string}
|
|
4151
4151
|
*/
|
|
4152
4152
|
static parseFormatForOpts(e, t = {}) {
|
|
4153
|
-
const n = Pr(e,
|
|
4153
|
+
const n = Pr(e, N.fromObject(t));
|
|
4154
4154
|
return n ? n.map((s) => s ? s.val : null).join("") : null;
|
|
4155
4155
|
}
|
|
4156
4156
|
/**
|
|
@@ -4161,7 +4161,7 @@ class p {
|
|
|
4161
4161
|
* @returns {string}
|
|
4162
4162
|
*/
|
|
4163
4163
|
static expandFormat(e, t = {}) {
|
|
4164
|
-
return
|
|
4164
|
+
return Hr(b.parseFormat(e), N.fromObject(t)).map((s) => s.val).join("");
|
|
4165
4165
|
}
|
|
4166
4166
|
static resetCache() {
|
|
4167
4167
|
Le = void 0, $e = {};
|
|
@@ -4378,7 +4378,7 @@ class p {
|
|
|
4378
4378
|
* @type {string}
|
|
4379
4379
|
*/
|
|
4380
4380
|
get monthShort() {
|
|
4381
|
-
return this.isValid ?
|
|
4381
|
+
return this.isValid ? Oe.months("short", { locObj: this.loc })[this.month - 1] : null;
|
|
4382
4382
|
}
|
|
4383
4383
|
/**
|
|
4384
4384
|
* Get the human readable long month name, such as 'October'.
|
|
@@ -4387,7 +4387,7 @@ class p {
|
|
|
4387
4387
|
* @type {string}
|
|
4388
4388
|
*/
|
|
4389
4389
|
get monthLong() {
|
|
4390
|
-
return this.isValid ?
|
|
4390
|
+
return this.isValid ? Oe.months("long", { locObj: this.loc })[this.month - 1] : null;
|
|
4391
4391
|
}
|
|
4392
4392
|
/**
|
|
4393
4393
|
* Get the human readable short weekday, such as 'Mon'.
|
|
@@ -4396,7 +4396,7 @@ class p {
|
|
|
4396
4396
|
* @type {string}
|
|
4397
4397
|
*/
|
|
4398
4398
|
get weekdayShort() {
|
|
4399
|
-
return this.isValid ?
|
|
4399
|
+
return this.isValid ? Oe.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
|
|
4400
4400
|
}
|
|
4401
4401
|
/**
|
|
4402
4402
|
* Get the human readable long weekday, such as 'Monday'.
|
|
@@ -4405,7 +4405,7 @@ class p {
|
|
|
4405
4405
|
* @type {string}
|
|
4406
4406
|
*/
|
|
4407
4407
|
get weekdayLong() {
|
|
4408
|
-
return this.isValid ?
|
|
4408
|
+
return this.isValid ? Oe.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
|
|
4409
4409
|
}
|
|
4410
4410
|
/**
|
|
4411
4411
|
* Get the UTC offset of this DateTime in minutes
|
|
@@ -4462,10 +4462,10 @@ class p {
|
|
|
4462
4462
|
getPossibleOffsets() {
|
|
4463
4463
|
if (!this.isValid || this.isOffsetFixed)
|
|
4464
4464
|
return [this];
|
|
4465
|
-
const e = 864e5, t = 6e4, n =
|
|
4465
|
+
const e = 864e5, t = 6e4, n = qe(this.c), s = this.zone.offset(n - e), a = this.zone.offset(n + e), i = this.zone.offset(n - s * t), o = this.zone.offset(n - a * t);
|
|
4466
4466
|
if (i === o)
|
|
4467
4467
|
return [this];
|
|
4468
|
-
const u = n - i * t, l = n - o * t, c =
|
|
4468
|
+
const u = n - i * t, l = n - o * t, c = be(u, i), m = be(l, o);
|
|
4469
4469
|
return c.hour === m.hour && c.minute === m.minute && c.second === m.second && c.millisecond === m.millisecond ? [K(this, { ts: u }), K(this, { ts: l })] : [this];
|
|
4470
4470
|
}
|
|
4471
4471
|
/**
|
|
@@ -4503,7 +4503,7 @@ class p {
|
|
|
4503
4503
|
* @type {number}
|
|
4504
4504
|
*/
|
|
4505
4505
|
get weeksInWeekYear() {
|
|
4506
|
-
return this.isValid ?
|
|
4506
|
+
return this.isValid ? Ne(this.weekYear) : NaN;
|
|
4507
4507
|
}
|
|
4508
4508
|
/**
|
|
4509
4509
|
* Returns the number of weeks in this DateTime's local week year
|
|
@@ -4512,7 +4512,7 @@ class p {
|
|
|
4512
4512
|
* @type {number}
|
|
4513
4513
|
*/
|
|
4514
4514
|
get weeksInLocalWeekYear() {
|
|
4515
|
-
return this.isValid ?
|
|
4515
|
+
return this.isValid ? Ne(
|
|
4516
4516
|
this.localWeekYear,
|
|
4517
4517
|
this.loc.getMinDaysInFirstWeek(),
|
|
4518
4518
|
this.loc.getStartOfWeek()
|
|
@@ -4525,7 +4525,7 @@ class p {
|
|
|
4525
4525
|
* @return {Object}
|
|
4526
4526
|
*/
|
|
4527
4527
|
resolvedLocaleOptions(e = {}) {
|
|
4528
|
-
const { locale: t, numberingSystem: n, calendar: s } =
|
|
4528
|
+
const { locale: t, numberingSystem: n, calendar: s } = b.create(
|
|
4529
4529
|
this.loc.clone(e),
|
|
4530
4530
|
e
|
|
4531
4531
|
).resolvedOptions(this);
|
|
@@ -4572,7 +4572,7 @@ class p {
|
|
|
4572
4572
|
}
|
|
4573
4573
|
return K(this, { ts: s, zone: e });
|
|
4574
4574
|
} else
|
|
4575
|
-
return p.invalid(
|
|
4575
|
+
return p.invalid(Se(e));
|
|
4576
4576
|
}
|
|
4577
4577
|
/**
|
|
4578
4578
|
* "Set" the locale, numberingSystem, or outputCalendar. Returns a newly-constructed DateTime.
|
|
@@ -4608,7 +4608,7 @@ class p {
|
|
|
4608
4608
|
*/
|
|
4609
4609
|
set(e) {
|
|
4610
4610
|
if (!this.isValid) return this;
|
|
4611
|
-
const t = Ae(e, Rt), { minDaysInFirstWeek: n, startOfWeek: s } =
|
|
4611
|
+
const t = Ae(e, Rt), { minDaysInFirstWeek: n, startOfWeek: s } = _t(t, this.loc), a = !w(t.weekYear) || !w(t.weekNumber) || !w(t.weekday), i = !w(t.ordinal), o = !w(t.year), u = !w(t.month) || !w(t.day), l = o || u, c = t.weekYear || t.weekNumber;
|
|
4612
4612
|
if ((l || i) && c)
|
|
4613
4613
|
throw new ue(
|
|
4614
4614
|
"Can't mix weekYear/weekNumber units with year/month/day or ordinals"
|
|
@@ -4621,8 +4621,8 @@ class p {
|
|
|
4621
4621
|
n,
|
|
4622
4622
|
s
|
|
4623
4623
|
) : w(t.ordinal) ? (m = { ...this.toObject(), ...t }, w(t.day) && (m.day = Math.min(Ue(m.year, m.month), m.day))) : m = It({ ...je(this.c), ...t });
|
|
4624
|
-
const [g,
|
|
4625
|
-
return K(this, { ts: g, o:
|
|
4624
|
+
const [g, h] = We(m, this.o, this.zone);
|
|
4625
|
+
return K(this, { ts: g, o: h });
|
|
4626
4626
|
}
|
|
4627
4627
|
/**
|
|
4628
4628
|
* Add a period of time to this DateTime and return the resulting DateTime
|
|
@@ -4639,7 +4639,7 @@ class p {
|
|
|
4639
4639
|
*/
|
|
4640
4640
|
plus(e) {
|
|
4641
4641
|
if (!this.isValid) return this;
|
|
4642
|
-
const t =
|
|
4642
|
+
const t = O.fromDurationLike(e);
|
|
4643
4643
|
return K(this, Ut(this, t));
|
|
4644
4644
|
}
|
|
4645
4645
|
/**
|
|
@@ -4650,7 +4650,7 @@ class p {
|
|
|
4650
4650
|
*/
|
|
4651
4651
|
minus(e) {
|
|
4652
4652
|
if (!this.isValid) return this;
|
|
4653
|
-
const t =
|
|
4653
|
+
const t = O.fromDurationLike(e).negate();
|
|
4654
4654
|
return K(this, Ut(this, t));
|
|
4655
4655
|
}
|
|
4656
4656
|
/**
|
|
@@ -4667,7 +4667,7 @@ class p {
|
|
|
4667
4667
|
*/
|
|
4668
4668
|
startOf(e, { useLocaleWeeks: t = !1 } = {}) {
|
|
4669
4669
|
if (!this.isValid) return this;
|
|
4670
|
-
const n = {}, s =
|
|
4670
|
+
const n = {}, s = O.normalizeUnit(e);
|
|
4671
4671
|
switch (s) {
|
|
4672
4672
|
case "years":
|
|
4673
4673
|
n.month = 1;
|
|
@@ -4726,7 +4726,7 @@ class p {
|
|
|
4726
4726
|
* @return {string}
|
|
4727
4727
|
*/
|
|
4728
4728
|
toFormat(e, t = {}) {
|
|
4729
|
-
return this.isValid ?
|
|
4729
|
+
return this.isValid ? b.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this, e) : Qe;
|
|
4730
4730
|
}
|
|
4731
4731
|
/**
|
|
4732
4732
|
* Returns a localized string representing this date. Accepts the same options as the Intl.DateTimeFormat constructor and any presets defined by Luxon, such as `DateTime.DATE_FULL` or `DateTime.TIME_SIMPLE`.
|
|
@@ -4748,7 +4748,7 @@ class p {
|
|
|
4748
4748
|
* @return {string}
|
|
4749
4749
|
*/
|
|
4750
4750
|
toLocaleString(e = ze, t = {}) {
|
|
4751
|
-
return this.isValid ?
|
|
4751
|
+
return this.isValid ? b.create(this.loc.clone(t), e).formatDateTime(this) : Qe;
|
|
4752
4752
|
}
|
|
4753
4753
|
/**
|
|
4754
4754
|
* Returns an array of format "parts", meaning individual tokens along with metadata. This is allows callers to post-process individual sections of the formatted output.
|
|
@@ -4764,7 +4764,7 @@ class p {
|
|
|
4764
4764
|
* //=> ]
|
|
4765
4765
|
*/
|
|
4766
4766
|
toLocaleParts(e = {}) {
|
|
4767
|
-
return this.isValid ?
|
|
4767
|
+
return this.isValid ? b.create(this.loc.clone(e), e).formatDateTimeParts(this) : [];
|
|
4768
4768
|
}
|
|
4769
4769
|
/**
|
|
4770
4770
|
* Returns an ISO 8601-compliant string representation of this DateTime
|
|
@@ -4996,8 +4996,8 @@ class p {
|
|
|
4996
4996
|
*/
|
|
4997
4997
|
diff(e, t = "milliseconds", n = {}) {
|
|
4998
4998
|
if (!this.isValid || !e.isValid)
|
|
4999
|
-
return
|
|
5000
|
-
const s = { locale: this.locale, numberingSystem: this.numberingSystem, ...n }, a =
|
|
4999
|
+
return O.invalid("created by diffing an invalid DateTime");
|
|
5000
|
+
const s = { locale: this.locale, numberingSystem: this.numberingSystem, ...n }, a = bn(t).map(O.normalizeUnit), i = e.valueOf() > this.valueOf(), o = i ? this : e, u = i ? e : this, l = Ls(o, u, a, s);
|
|
5001
5001
|
return i ? l.negate() : l;
|
|
5002
5002
|
}
|
|
5003
5003
|
/**
|
|
@@ -5067,7 +5067,7 @@ class p {
|
|
|
5067
5067
|
if (!this.isValid) return null;
|
|
5068
5068
|
const t = e.base || p.fromObject({}, { zone: this.zone }), n = e.padding ? this < t ? -e.padding : e.padding : 0;
|
|
5069
5069
|
let s = ["years", "months", "days", "hours", "minutes", "seconds"], a = e.unit;
|
|
5070
|
-
return Array.isArray(e.unit) && (s = e.unit, a = void 0),
|
|
5070
|
+
return Array.isArray(e.unit) && (s = e.unit, a = void 0), qt(t, this.plus(n), {
|
|
5071
5071
|
...e,
|
|
5072
5072
|
numeric: "always",
|
|
5073
5073
|
units: s,
|
|
@@ -5088,7 +5088,7 @@ class p {
|
|
|
5088
5088
|
* @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago"
|
|
5089
5089
|
*/
|
|
5090
5090
|
toRelativeCalendar(e = {}) {
|
|
5091
|
-
return this.isValid ?
|
|
5091
|
+
return this.isValid ? qt(e.base || p.fromObject({}, { zone: this.zone }), this, {
|
|
5092
5092
|
...e,
|
|
5093
5093
|
numeric: "auto",
|
|
5094
5094
|
units: ["years", "months", "days"],
|
|
@@ -5102,8 +5102,8 @@ class p {
|
|
|
5102
5102
|
*/
|
|
5103
5103
|
static min(...e) {
|
|
5104
5104
|
if (!e.every(p.isDateTime))
|
|
5105
|
-
throw new
|
|
5106
|
-
return
|
|
5105
|
+
throw new C("min requires all arguments be DateTimes");
|
|
5106
|
+
return xt(e, (t) => t.valueOf(), Math.min);
|
|
5107
5107
|
}
|
|
5108
5108
|
/**
|
|
5109
5109
|
* Return the max of several date times
|
|
@@ -5112,8 +5112,8 @@ class p {
|
|
|
5112
5112
|
*/
|
|
5113
5113
|
static max(...e) {
|
|
5114
5114
|
if (!e.every(p.isDateTime))
|
|
5115
|
-
throw new
|
|
5116
|
-
return
|
|
5115
|
+
throw new C("max requires all arguments be DateTimes");
|
|
5116
|
+
return xt(e, (t) => t.valueOf(), Math.max);
|
|
5117
5117
|
}
|
|
5118
5118
|
// MISC
|
|
5119
5119
|
/**
|
|
@@ -5124,7 +5124,7 @@ class p {
|
|
|
5124
5124
|
* @return {Object}
|
|
5125
5125
|
*/
|
|
5126
5126
|
static fromFormatExplain(e, t, n = {}) {
|
|
5127
|
-
const { locale: s = null, numberingSystem: a = null } = n, i =
|
|
5127
|
+
const { locale: s = null, numberingSystem: a = null } = n, i = N.fromOpts({
|
|
5128
5128
|
locale: s,
|
|
5129
5129
|
numberingSystem: a,
|
|
5130
5130
|
defaultToEN: !0
|
|
@@ -5150,12 +5150,12 @@ class p {
|
|
|
5150
5150
|
* @returns {TokenParser} - opaque object to be used
|
|
5151
5151
|
*/
|
|
5152
5152
|
static buildFormatParser(e, t = {}) {
|
|
5153
|
-
const { locale: n = null, numberingSystem: s = null } = t, a =
|
|
5153
|
+
const { locale: n = null, numberingSystem: s = null } = t, a = N.fromOpts({
|
|
5154
5154
|
locale: n,
|
|
5155
5155
|
numberingSystem: s,
|
|
5156
5156
|
defaultToEN: !0
|
|
5157
5157
|
});
|
|
5158
|
-
return new
|
|
5158
|
+
return new qr(a, e);
|
|
5159
5159
|
}
|
|
5160
5160
|
/**
|
|
5161
5161
|
* Create a DateTime from an input string and format parser.
|
|
@@ -5169,16 +5169,16 @@ class p {
|
|
|
5169
5169
|
*/
|
|
5170
5170
|
static fromFormatParser(e, t, n = {}) {
|
|
5171
5171
|
if (w(e) || w(t))
|
|
5172
|
-
throw new
|
|
5172
|
+
throw new C(
|
|
5173
5173
|
"fromFormatParser requires an input string and a format parser"
|
|
5174
5174
|
);
|
|
5175
|
-
const { locale: s = null, numberingSystem: a = null } = n, i =
|
|
5175
|
+
const { locale: s = null, numberingSystem: a = null } = n, i = N.fromOpts({
|
|
5176
5176
|
locale: s,
|
|
5177
5177
|
numberingSystem: a,
|
|
5178
5178
|
defaultToEN: !0
|
|
5179
5179
|
});
|
|
5180
5180
|
if (!i.equals(t.locale))
|
|
5181
|
-
throw new
|
|
5181
|
+
throw new C(
|
|
5182
5182
|
`fromFormatParser called with a locale of ${i}, but the format parser was created for ${t.locale}`
|
|
5183
5183
|
);
|
|
5184
5184
|
const { result: o, zone: u, specificOffset: l, invalidReason: c } = t.explainFromTokens(e);
|
|
@@ -5330,14 +5330,14 @@ class p {
|
|
|
5330
5330
|
* @type {Object}
|
|
5331
5331
|
*/
|
|
5332
5332
|
static get DATETIME_FULL_WITH_SECONDS() {
|
|
5333
|
-
return
|
|
5333
|
+
return hr;
|
|
5334
5334
|
}
|
|
5335
5335
|
/**
|
|
5336
5336
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
5337
5337
|
* @type {Object}
|
|
5338
5338
|
*/
|
|
5339
5339
|
static get DATETIME_HUGE() {
|
|
5340
|
-
return
|
|
5340
|
+
return dr;
|
|
5341
5341
|
}
|
|
5342
5342
|
/**
|
|
5343
5343
|
* {@link DateTime#toLocaleString} format like 'Friday, October 14, 1983, 9:30:33 AM Eastern Daylight Time'. Only 12-hour if the locale is.
|
|
@@ -5354,23 +5354,23 @@ function Te(r) {
|
|
|
5354
5354
|
return p.fromJSDate(r);
|
|
5355
5355
|
if (r && typeof r == "object")
|
|
5356
5356
|
return p.fromObject(r);
|
|
5357
|
-
throw new
|
|
5357
|
+
throw new C(
|
|
5358
5358
|
`Unknown datetime argument: ${r}, of type ${typeof r}`
|
|
5359
5359
|
);
|
|
5360
5360
|
}
|
|
5361
5361
|
const ri = "3.5.0", ni = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5362
5362
|
__proto__: null,
|
|
5363
5363
|
DateTime: p,
|
|
5364
|
-
Duration:
|
|
5364
|
+
Duration: O,
|
|
5365
5365
|
FixedOffsetZone: F,
|
|
5366
|
-
IANAZone:
|
|
5367
|
-
Info:
|
|
5366
|
+
IANAZone: H,
|
|
5367
|
+
Info: Oe,
|
|
5368
5368
|
Interval: M,
|
|
5369
5369
|
InvalidZone: yr,
|
|
5370
5370
|
Settings: I,
|
|
5371
|
-
SystemZone:
|
|
5371
|
+
SystemZone: De,
|
|
5372
5372
|
VERSION: ri,
|
|
5373
|
-
Zone:
|
|
5373
|
+
Zone: he
|
|
5374
5374
|
}, Symbol.toStringTag, { value: "Module" })), si = /* @__PURE__ */ Jt(ni);
|
|
5375
5375
|
var X = si;
|
|
5376
5376
|
T.prototype.addYear = function() {
|
|
@@ -5561,8 +5561,8 @@ function li(r, e, t) {
|
|
|
5561
5561
|
}
|
|
5562
5562
|
var c = l.start == 0 ? l.count - 1 : l.count;
|
|
5563
5563
|
l.step * c > l.end ? i = i.concat(
|
|
5564
|
-
Array.from({ length: l.end - l.start + 1 }).map(function(g,
|
|
5565
|
-
var y = l.start +
|
|
5564
|
+
Array.from({ length: l.end - l.start + 1 }).map(function(g, h) {
|
|
5565
|
+
var y = l.start + h;
|
|
5566
5566
|
return (y - l.start) % l.step === 0 ? y : null;
|
|
5567
5567
|
}).filter(function(g) {
|
|
5568
5568
|
return g != null;
|
|
@@ -5572,18 +5572,18 @@ function li(r, e, t) {
|
|
|
5572
5572
|
return i.join(",");
|
|
5573
5573
|
}
|
|
5574
5574
|
var ci = li, re = ii, fi = ci, Gt = 1e4;
|
|
5575
|
-
function
|
|
5576
|
-
this._options = e, this._utc = e.utc || !1, this._tz = this._utc ? "UTC" : e.tz, this._currentDate = new re(e.currentDate, this._tz), this._startDate = e.startDate ? new re(e.startDate, this._tz) : null, this._endDate = e.endDate ? new re(e.endDate, this._tz) : null, this._isIterator = e.iterator || !1, this._hasIterated = !1, this._nthDayOfWeek = e.nthDayOfWeek || 0, this.fields =
|
|
5575
|
+
function d(r, e) {
|
|
5576
|
+
this._options = e, this._utc = e.utc || !1, this._tz = this._utc ? "UTC" : e.tz, this._currentDate = new re(e.currentDate, this._tz), this._startDate = e.startDate ? new re(e.startDate, this._tz) : null, this._endDate = e.endDate ? new re(e.endDate, this._tz) : null, this._isIterator = e.iterator || !1, this._hasIterated = !1, this._nthDayOfWeek = e.nthDayOfWeek || 0, this.fields = d._freezeFields(r);
|
|
5577
5577
|
}
|
|
5578
|
-
|
|
5579
|
-
|
|
5578
|
+
d.map = ["second", "minute", "hour", "dayOfMonth", "month", "dayOfWeek"];
|
|
5579
|
+
d.predefined = {
|
|
5580
5580
|
"@yearly": "0 0 1 1 *",
|
|
5581
5581
|
"@monthly": "0 0 1 * *",
|
|
5582
5582
|
"@weekly": "0 0 * * 0",
|
|
5583
5583
|
"@daily": "0 0 * * *",
|
|
5584
5584
|
"@hourly": "0 * * * *"
|
|
5585
5585
|
};
|
|
5586
|
-
|
|
5586
|
+
d.constraints = [
|
|
5587
5587
|
{ min: 0, max: 59, chars: [] },
|
|
5588
5588
|
// Second
|
|
5589
5589
|
{ min: 0, max: 59, chars: [] },
|
|
@@ -5597,7 +5597,7 @@ h.constraints = [
|
|
|
5597
5597
|
{ min: 0, max: 7, chars: ["L"] }
|
|
5598
5598
|
// Day of week
|
|
5599
5599
|
];
|
|
5600
|
-
|
|
5600
|
+
d.daysInMonth = [
|
|
5601
5601
|
31,
|
|
5602
5602
|
29,
|
|
5603
5603
|
31,
|
|
@@ -5611,7 +5611,7 @@ h.daysInMonth = [
|
|
|
5611
5611
|
30,
|
|
5612
5612
|
31
|
|
5613
5613
|
];
|
|
5614
|
-
|
|
5614
|
+
d.aliases = {
|
|
5615
5615
|
month: {
|
|
5616
5616
|
jan: 1,
|
|
5617
5617
|
feb: 2,
|
|
@@ -5636,28 +5636,28 @@ h.aliases = {
|
|
|
5636
5636
|
sat: 6
|
|
5637
5637
|
}
|
|
5638
5638
|
};
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
second:
|
|
5645
|
-
minute:
|
|
5646
|
-
hour:
|
|
5647
|
-
dayOfMonth:
|
|
5648
|
-
month:
|
|
5649
|
-
dayOfWeek:
|
|
5639
|
+
d.parseDefaults = ["0", "*", "*", "*", "*", "*"];
|
|
5640
|
+
d.standardValidCharacters = /^[,*\d/-]+$/;
|
|
5641
|
+
d.dayOfWeekValidCharacters = /^[?,*\dL#/-]+$/;
|
|
5642
|
+
d.dayOfMonthValidCharacters = /^[?,*\dL/-]+$/;
|
|
5643
|
+
d.validCharacters = {
|
|
5644
|
+
second: d.standardValidCharacters,
|
|
5645
|
+
minute: d.standardValidCharacters,
|
|
5646
|
+
hour: d.standardValidCharacters,
|
|
5647
|
+
dayOfMonth: d.dayOfMonthValidCharacters,
|
|
5648
|
+
month: d.standardValidCharacters,
|
|
5649
|
+
dayOfWeek: d.dayOfWeekValidCharacters
|
|
5650
5650
|
};
|
|
5651
|
-
|
|
5651
|
+
d._isValidConstraintChar = function(e, t) {
|
|
5652
5652
|
return typeof t != "string" ? !1 : e.chars.some(function(n) {
|
|
5653
5653
|
return t.indexOf(n) > -1;
|
|
5654
5654
|
});
|
|
5655
5655
|
};
|
|
5656
|
-
|
|
5656
|
+
d._parseField = function(e, t, n) {
|
|
5657
5657
|
switch (e) {
|
|
5658
5658
|
case "month":
|
|
5659
5659
|
case "dayOfWeek":
|
|
5660
|
-
var s =
|
|
5660
|
+
var s = d.aliases[e];
|
|
5661
5661
|
t = t.replace(/[a-z]{3}/gi, function(u) {
|
|
5662
5662
|
if (u = u.toLowerCase(), typeof s[u] < "u")
|
|
5663
5663
|
return s[u];
|
|
@@ -5665,27 +5665,27 @@ h._parseField = function(e, t, n) {
|
|
|
5665
5665
|
});
|
|
5666
5666
|
break;
|
|
5667
5667
|
}
|
|
5668
|
-
if (!
|
|
5668
|
+
if (!d.validCharacters[e].test(t))
|
|
5669
5669
|
throw new Error("Invalid characters, got value: " + t);
|
|
5670
5670
|
t.indexOf("*") !== -1 ? t = t.replace(/\*/g, n.min + "-" + n.max) : t.indexOf("?") !== -1 && (t = t.replace(/\?/g, n.min + "-" + n.max));
|
|
5671
5671
|
function a(u) {
|
|
5672
5672
|
var l = [];
|
|
5673
5673
|
function c(y) {
|
|
5674
5674
|
if (y instanceof Array)
|
|
5675
|
-
for (var
|
|
5676
|
-
var
|
|
5677
|
-
if (
|
|
5678
|
-
l.push(
|
|
5675
|
+
for (var D = 0, E = y.length; D < E; D++) {
|
|
5676
|
+
var k = y[D];
|
|
5677
|
+
if (d._isValidConstraintChar(n, k)) {
|
|
5678
|
+
l.push(k);
|
|
5679
5679
|
continue;
|
|
5680
5680
|
}
|
|
5681
|
-
if (typeof
|
|
5681
|
+
if (typeof k != "number" || Number.isNaN(k) || k < n.min || k > n.max)
|
|
5682
5682
|
throw new Error(
|
|
5683
|
-
"Constraint error, got value " +
|
|
5683
|
+
"Constraint error, got value " + k + " expected range " + n.min + "-" + n.max
|
|
5684
5684
|
);
|
|
5685
|
-
l.push(
|
|
5685
|
+
l.push(k);
|
|
5686
5686
|
}
|
|
5687
5687
|
else {
|
|
5688
|
-
if (
|
|
5688
|
+
if (d._isValidConstraintChar(n, y)) {
|
|
5689
5689
|
l.push(y);
|
|
5690
5690
|
return;
|
|
5691
5691
|
}
|
|
@@ -5703,11 +5703,11 @@ h._parseField = function(e, t, n) {
|
|
|
5703
5703
|
}))
|
|
5704
5704
|
throw new Error("Invalid list value format");
|
|
5705
5705
|
if (m.length > 1)
|
|
5706
|
-
for (var g = 0,
|
|
5706
|
+
for (var g = 0, h = m.length; g < h; g++)
|
|
5707
5707
|
c(i(m[g]));
|
|
5708
5708
|
else
|
|
5709
5709
|
c(i(u));
|
|
5710
|
-
return l.sort(
|
|
5710
|
+
return l.sort(d._sortCompareFn), l;
|
|
5711
5711
|
}
|
|
5712
5712
|
function i(u) {
|
|
5713
5713
|
var l = 1, c = u.split("/");
|
|
@@ -5725,20 +5725,20 @@ h._parseField = function(e, t, n) {
|
|
|
5725
5725
|
throw new Error("Invalid range: " + u);
|
|
5726
5726
|
return +u;
|
|
5727
5727
|
}
|
|
5728
|
-
var g = +m[0],
|
|
5729
|
-
if (Number.isNaN(g) || Number.isNaN(
|
|
5728
|
+
var g = +m[0], h = +m[1];
|
|
5729
|
+
if (Number.isNaN(g) || Number.isNaN(h) || g < n.min || h > n.max)
|
|
5730
5730
|
throw new Error(
|
|
5731
|
-
"Constraint error, got range " + g + "-" +
|
|
5731
|
+
"Constraint error, got range " + g + "-" + h + " expected range " + n.min + "-" + n.max
|
|
5732
5732
|
);
|
|
5733
|
-
if (g >
|
|
5733
|
+
if (g > h)
|
|
5734
5734
|
throw new Error("Invalid range: " + u);
|
|
5735
5735
|
var y = +l;
|
|
5736
5736
|
if (Number.isNaN(y) || y <= 0)
|
|
5737
5737
|
throw new Error("Constraint error, cannot repeat at every " + y + " time.");
|
|
5738
|
-
e === "dayOfWeek" &&
|
|
5739
|
-
for (var
|
|
5740
|
-
var
|
|
5741
|
-
!
|
|
5738
|
+
e === "dayOfWeek" && h % 7 === 0 && c.push(0);
|
|
5739
|
+
for (var D = g, E = h; D <= E; D++) {
|
|
5740
|
+
var k = c.indexOf(D) !== -1;
|
|
5741
|
+
!k && y > 0 && y % l === 0 ? (y = 1, c.push(D)) : y++;
|
|
5742
5742
|
}
|
|
5743
5743
|
return c;
|
|
5744
5744
|
}
|
|
@@ -5746,28 +5746,28 @@ h._parseField = function(e, t, n) {
|
|
|
5746
5746
|
}
|
|
5747
5747
|
return a(t);
|
|
5748
5748
|
};
|
|
5749
|
-
|
|
5749
|
+
d._sortCompareFn = function(r, e) {
|
|
5750
5750
|
var t = typeof r == "number", n = typeof e == "number";
|
|
5751
5751
|
return t && n ? r - e : !t && n ? 1 : t && !n ? -1 : r.localeCompare(e);
|
|
5752
5752
|
};
|
|
5753
|
-
|
|
5753
|
+
d._handleMaxDaysInMonth = function(r) {
|
|
5754
5754
|
if (r.month.length === 1) {
|
|
5755
|
-
var e =
|
|
5755
|
+
var e = d.daysInMonth[r.month[0] - 1];
|
|
5756
5756
|
if (r.dayOfMonth[0] > e)
|
|
5757
5757
|
throw new Error("Invalid explicit day of month definition");
|
|
5758
5758
|
return r.dayOfMonth.filter(function(t) {
|
|
5759
5759
|
return t === "L" ? !0 : t <= e;
|
|
5760
|
-
}).sort(
|
|
5760
|
+
}).sort(d._sortCompareFn);
|
|
5761
5761
|
}
|
|
5762
5762
|
};
|
|
5763
|
-
|
|
5764
|
-
for (var e = 0, t =
|
|
5765
|
-
var n =
|
|
5763
|
+
d._freezeFields = function(r) {
|
|
5764
|
+
for (var e = 0, t = d.map.length; e < t; ++e) {
|
|
5765
|
+
var n = d.map[e], s = r[n];
|
|
5766
5766
|
r[n] = Object.freeze(s);
|
|
5767
5767
|
}
|
|
5768
5768
|
return Object.freeze(r);
|
|
5769
5769
|
};
|
|
5770
|
-
|
|
5770
|
+
d.prototype._applyTimezoneShift = function(r, e, t) {
|
|
5771
5771
|
if (t === "Month" || t === "Day") {
|
|
5772
5772
|
var n = r.getTime();
|
|
5773
5773
|
r[e + t]();
|
|
@@ -5780,37 +5780,37 @@ h.prototype._applyTimezoneShift = function(r, e, t) {
|
|
|
5780
5780
|
o === 2 ? this.fields.hour.length !== 24 && (this._dstStart = i) : o === 0 && r.getMinutes() === 0 && r.getSeconds() === 0 && this.fields.hour.length !== 24 && (this._dstEnd = i);
|
|
5781
5781
|
}
|
|
5782
5782
|
};
|
|
5783
|
-
|
|
5784
|
-
function t(
|
|
5785
|
-
for (var
|
|
5786
|
-
if (v[
|
|
5787
|
-
return v[
|
|
5788
|
-
return v[0] ===
|
|
5789
|
-
}
|
|
5790
|
-
function n(
|
|
5783
|
+
d.prototype._findSchedule = function(e) {
|
|
5784
|
+
function t(k, v) {
|
|
5785
|
+
for (var x = 0, z = v.length; x < z; x++)
|
|
5786
|
+
if (v[x] >= k)
|
|
5787
|
+
return v[x] === k;
|
|
5788
|
+
return v[0] === k;
|
|
5789
|
+
}
|
|
5790
|
+
function n(k, v) {
|
|
5791
5791
|
if (v < 6) {
|
|
5792
|
-
if (
|
|
5792
|
+
if (k.getDate() < 8 && v === 1)
|
|
5793
5793
|
return !0;
|
|
5794
|
-
var
|
|
5795
|
-
return
|
|
5794
|
+
var x = k.getDate() % 7 ? 1 : 0, z = k.getDate() - k.getDate() % 7, q = Math.floor(z / 7) + x;
|
|
5795
|
+
return q === v;
|
|
5796
5796
|
}
|
|
5797
5797
|
return !1;
|
|
5798
5798
|
}
|
|
5799
|
-
function s(
|
|
5800
|
-
return
|
|
5799
|
+
function s(k) {
|
|
5800
|
+
return k.length > 0 && k.some(function(v) {
|
|
5801
5801
|
return typeof v == "string" && v.indexOf("L") >= 0;
|
|
5802
5802
|
});
|
|
5803
5803
|
}
|
|
5804
5804
|
e = e || !1;
|
|
5805
5805
|
var a = e ? "subtract" : "add", i = new re(this._currentDate, this._tz), o = this._startDate, u = this._endDate, l = i.getTime(), c = 0;
|
|
5806
|
-
function m(
|
|
5807
|
-
return
|
|
5806
|
+
function m(k) {
|
|
5807
|
+
return k.some(function(v) {
|
|
5808
5808
|
if (!s([v]))
|
|
5809
5809
|
return !1;
|
|
5810
|
-
var
|
|
5811
|
-
if (Number.isNaN(
|
|
5810
|
+
var x = Number.parseInt(v[0]) % 7;
|
|
5811
|
+
if (Number.isNaN(x))
|
|
5812
5812
|
throw new Error("Invalid last weekday of the month expression: " + v);
|
|
5813
|
-
return i.getDay() ===
|
|
5813
|
+
return i.getDay() === x && i.isLastWeekdayOfMonth();
|
|
5814
5814
|
});
|
|
5815
5815
|
}
|
|
5816
5816
|
for (; c < Gt; ) {
|
|
@@ -5821,18 +5821,18 @@ h.prototype._findSchedule = function(e) {
|
|
|
5821
5821
|
throw new Error("Out of the timespan range");
|
|
5822
5822
|
var g = t(i.getDate(), this.fields.dayOfMonth);
|
|
5823
5823
|
s(this.fields.dayOfMonth) && (g = g || i.isLastDayOfMonth());
|
|
5824
|
-
var
|
|
5825
|
-
s(this.fields.dayOfWeek) && (
|
|
5826
|
-
var y = this.fields.dayOfMonth.length >=
|
|
5827
|
-
if (!g && (!
|
|
5824
|
+
var h = t(i.getDay(), this.fields.dayOfWeek);
|
|
5825
|
+
s(this.fields.dayOfWeek) && (h = h || m(this.fields.dayOfWeek));
|
|
5826
|
+
var y = this.fields.dayOfMonth.length >= d.daysInMonth[i.getMonth()], D = this.fields.dayOfWeek.length === d.constraints[5].max - d.constraints[5].min + 1, E = i.getHours();
|
|
5827
|
+
if (!g && (!h || D)) {
|
|
5828
5828
|
this._applyTimezoneShift(i, a, "Day");
|
|
5829
5829
|
continue;
|
|
5830
5830
|
}
|
|
5831
|
-
if (!y &&
|
|
5831
|
+
if (!y && D && !g) {
|
|
5832
5832
|
this._applyTimezoneShift(i, a, "Day");
|
|
5833
5833
|
continue;
|
|
5834
5834
|
}
|
|
5835
|
-
if (y && !
|
|
5835
|
+
if (y && !D && !h) {
|
|
5836
5836
|
this._applyTimezoneShift(i, a, "Day");
|
|
5837
5837
|
continue;
|
|
5838
5838
|
}
|
|
@@ -5874,21 +5874,21 @@ h.prototype._findSchedule = function(e) {
|
|
|
5874
5874
|
throw new Error("Invalid expression, loop limit exceeded");
|
|
5875
5875
|
return this._currentDate = new re(i, this._tz), this._hasIterated = !0, i;
|
|
5876
5876
|
};
|
|
5877
|
-
|
|
5877
|
+
d.prototype.next = function() {
|
|
5878
5878
|
var e = this._findSchedule();
|
|
5879
5879
|
return this._isIterator ? {
|
|
5880
5880
|
value: e,
|
|
5881
5881
|
done: !this.hasNext()
|
|
5882
5882
|
} : e;
|
|
5883
5883
|
};
|
|
5884
|
-
|
|
5884
|
+
d.prototype.prev = function() {
|
|
5885
5885
|
var e = this._findSchedule(!0);
|
|
5886
5886
|
return this._isIterator ? {
|
|
5887
5887
|
value: e,
|
|
5888
5888
|
done: !this.hasPrev()
|
|
5889
5889
|
} : e;
|
|
5890
5890
|
};
|
|
5891
|
-
|
|
5891
|
+
d.prototype.hasNext = function() {
|
|
5892
5892
|
var r = this._currentDate, e = this._hasIterated;
|
|
5893
5893
|
try {
|
|
5894
5894
|
return this._findSchedule(), !0;
|
|
@@ -5898,7 +5898,7 @@ h.prototype.hasNext = function() {
|
|
|
5898
5898
|
this._currentDate = r, this._hasIterated = e;
|
|
5899
5899
|
}
|
|
5900
5900
|
};
|
|
5901
|
-
|
|
5901
|
+
d.prototype.hasPrev = function() {
|
|
5902
5902
|
var r = this._currentDate, e = this._hasIterated;
|
|
5903
5903
|
try {
|
|
5904
5904
|
return this._findSchedule(!0), !0;
|
|
@@ -5908,7 +5908,7 @@ h.prototype.hasPrev = function() {
|
|
|
5908
5908
|
this._currentDate = r, this._hasIterated = e;
|
|
5909
5909
|
}
|
|
5910
5910
|
};
|
|
5911
|
-
|
|
5911
|
+
d.prototype.iterate = function(e, t) {
|
|
5912
5912
|
var n = [];
|
|
5913
5913
|
if (e >= 0)
|
|
5914
5914
|
for (var s = 0, a = e; s < a; s++)
|
|
@@ -5928,108 +5928,108 @@ h.prototype.iterate = function(e, t) {
|
|
|
5928
5928
|
}
|
|
5929
5929
|
return n;
|
|
5930
5930
|
};
|
|
5931
|
-
|
|
5931
|
+
d.prototype.reset = function(e) {
|
|
5932
5932
|
this._currentDate = new re(e || this._options.currentDate);
|
|
5933
5933
|
};
|
|
5934
|
-
|
|
5935
|
-
for (var t = [], n = e ? 0 : 1, s =
|
|
5936
|
-
var a =
|
|
5937
|
-
a === "dayOfMonth" && this.fields.month.length === 1 ? o = { min: 1, max:
|
|
5934
|
+
d.prototype.stringify = function(e) {
|
|
5935
|
+
for (var t = [], n = e ? 0 : 1, s = d.map.length; n < s; ++n) {
|
|
5936
|
+
var a = d.map[n], i = this.fields[a], o = d.constraints[n];
|
|
5937
|
+
a === "dayOfMonth" && this.fields.month.length === 1 ? o = { min: 1, max: d.daysInMonth[this.fields.month[0] - 1] } : a === "dayOfWeek" && (o = { min: 0, max: 6 }, i = i[i.length - 1] === 7 ? i.slice(0, -1) : i), t.push(fi(i, o.min, o.max));
|
|
5938
5938
|
}
|
|
5939
5939
|
return t.join(" ");
|
|
5940
5940
|
};
|
|
5941
|
-
|
|
5941
|
+
d.parse = function(e, t) {
|
|
5942
5942
|
var n = this;
|
|
5943
5943
|
typeof t == "function" && (t = {});
|
|
5944
5944
|
function s(a, i) {
|
|
5945
|
-
i || (i = {}), typeof i.currentDate > "u" && (i.currentDate = new re(void 0, n._tz)),
|
|
5945
|
+
i || (i = {}), typeof i.currentDate > "u" && (i.currentDate = new re(void 0, n._tz)), d.predefined[a] && (a = d.predefined[a]);
|
|
5946
5946
|
var o = [], u = (a + "").trim().split(/\s+/);
|
|
5947
5947
|
if (u.length > 6)
|
|
5948
5948
|
throw new Error("Invalid cron expression");
|
|
5949
|
-
for (var l =
|
|
5950
|
-
var g =
|
|
5951
|
-
if (c < l || !
|
|
5949
|
+
for (var l = d.map.length - u.length, c = 0, m = d.map.length; c < m; ++c) {
|
|
5950
|
+
var g = d.map[c], h = u[u.length > m ? c : c - l];
|
|
5951
|
+
if (c < l || !h)
|
|
5952
5952
|
o.push(
|
|
5953
|
-
|
|
5953
|
+
d._parseField(
|
|
5954
5954
|
g,
|
|
5955
|
-
|
|
5956
|
-
|
|
5955
|
+
d.parseDefaults[c],
|
|
5956
|
+
d.constraints[c]
|
|
5957
5957
|
)
|
|
5958
5958
|
);
|
|
5959
5959
|
else {
|
|
5960
|
-
var y = g === "dayOfWeek" ? v(
|
|
5960
|
+
var y = g === "dayOfWeek" ? v(h) : h;
|
|
5961
5961
|
o.push(
|
|
5962
|
-
|
|
5962
|
+
d._parseField(
|
|
5963
5963
|
g,
|
|
5964
5964
|
y,
|
|
5965
|
-
|
|
5965
|
+
d.constraints[c]
|
|
5966
5966
|
)
|
|
5967
5967
|
);
|
|
5968
5968
|
}
|
|
5969
5969
|
}
|
|
5970
|
-
for (var
|
|
5971
|
-
var E =
|
|
5972
|
-
|
|
5970
|
+
for (var D = {}, c = 0, m = d.map.length; c < m; c++) {
|
|
5971
|
+
var E = d.map[c];
|
|
5972
|
+
D[E] = o[c];
|
|
5973
5973
|
}
|
|
5974
|
-
var
|
|
5975
|
-
return
|
|
5976
|
-
function v(
|
|
5977
|
-
var z =
|
|
5974
|
+
var k = d._handleMaxDaysInMonth(D);
|
|
5975
|
+
return D.dayOfMonth = k || D.dayOfMonth, new d(D, i);
|
|
5976
|
+
function v(x) {
|
|
5977
|
+
var z = x.split("#");
|
|
5978
5978
|
if (z.length > 1) {
|
|
5979
|
-
var
|
|
5980
|
-
if (/,/.test(
|
|
5979
|
+
var q = +z[z.length - 1];
|
|
5980
|
+
if (/,/.test(x))
|
|
5981
5981
|
throw new Error("Constraint error, invalid dayOfWeek `#` and `,` special characters are incompatible");
|
|
5982
|
-
if (/\//.test(
|
|
5982
|
+
if (/\//.test(x))
|
|
5983
5983
|
throw new Error("Constraint error, invalid dayOfWeek `#` and `/` special characters are incompatible");
|
|
5984
|
-
if (/-/.test(
|
|
5984
|
+
if (/-/.test(x))
|
|
5985
5985
|
throw new Error("Constraint error, invalid dayOfWeek `#` and `-` special characters are incompatible");
|
|
5986
|
-
if (z.length > 2 || Number.isNaN(
|
|
5986
|
+
if (z.length > 2 || Number.isNaN(q) || q < 1 || q > 5)
|
|
5987
5987
|
throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");
|
|
5988
|
-
return i.nthDayOfWeek =
|
|
5988
|
+
return i.nthDayOfWeek = q, z[0];
|
|
5989
5989
|
}
|
|
5990
|
-
return
|
|
5990
|
+
return x;
|
|
5991
5991
|
}
|
|
5992
5992
|
}
|
|
5993
5993
|
return s(e, t);
|
|
5994
5994
|
};
|
|
5995
|
-
|
|
5996
|
-
function n(g,
|
|
5997
|
-
if (!
|
|
5995
|
+
d.fieldsToExpression = function(e, t) {
|
|
5996
|
+
function n(g, h, y) {
|
|
5997
|
+
if (!h)
|
|
5998
5998
|
throw new Error("Validation error, Field " + g + " is missing");
|
|
5999
|
-
if (
|
|
5999
|
+
if (h.length === 0)
|
|
6000
6000
|
throw new Error("Validation error, Field " + g + " contains no values");
|
|
6001
|
-
for (var
|
|
6002
|
-
var
|
|
6003
|
-
if (!
|
|
6001
|
+
for (var D = 0, E = h.length; D < E; D++) {
|
|
6002
|
+
var k = h[D];
|
|
6003
|
+
if (!d._isValidConstraintChar(y, k) && (typeof k != "number" || Number.isNaN(k) || k < y.min || k > y.max))
|
|
6004
6004
|
throw new Error(
|
|
6005
|
-
"Constraint error, got value " +
|
|
6005
|
+
"Constraint error, got value " + k + " expected range " + y.min + "-" + y.max
|
|
6006
6006
|
);
|
|
6007
6007
|
}
|
|
6008
6008
|
}
|
|
6009
|
-
for (var s = {}, a = 0, i =
|
|
6010
|
-
var o =
|
|
6009
|
+
for (var s = {}, a = 0, i = d.map.length; a < i; ++a) {
|
|
6010
|
+
var o = d.map[a], u = e[o];
|
|
6011
6011
|
n(
|
|
6012
6012
|
o,
|
|
6013
6013
|
u,
|
|
6014
|
-
|
|
6014
|
+
d.constraints[a]
|
|
6015
6015
|
);
|
|
6016
6016
|
for (var l = [], c = -1; ++c < u.length; )
|
|
6017
6017
|
l[c] = u[c];
|
|
6018
|
-
if (u = l.sort(
|
|
6019
|
-
return !
|
|
6018
|
+
if (u = l.sort(d._sortCompareFn).filter(function(g, h, y) {
|
|
6019
|
+
return !h || g !== y[h - 1];
|
|
6020
6020
|
}), u.length !== l.length)
|
|
6021
6021
|
throw new Error("Validation error, Field " + o + " contains duplicate values");
|
|
6022
6022
|
s[o] = u;
|
|
6023
6023
|
}
|
|
6024
|
-
var m =
|
|
6025
|
-
return s.dayOfMonth = m || s.dayOfMonth, new
|
|
6024
|
+
var m = d._handleMaxDaysInMonth(s);
|
|
6025
|
+
return s.dayOfMonth = m || s.dayOfMonth, new d(s, t || {});
|
|
6026
6026
|
};
|
|
6027
|
-
var
|
|
6028
|
-
const
|
|
6027
|
+
var hi = d;
|
|
6028
|
+
const di = {}, mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
6029
6029
|
__proto__: null,
|
|
6030
|
-
default:
|
|
6030
|
+
default: di
|
|
6031
6031
|
}, Symbol.toStringTag, { value: "Module" })), yi = /* @__PURE__ */ Jt(mi);
|
|
6032
|
-
var Re =
|
|
6032
|
+
var Re = hi;
|
|
6033
6033
|
function B() {
|
|
6034
6034
|
}
|
|
6035
6035
|
B._parseEntry = function(e) {
|
|
@@ -6088,25 +6088,9 @@ B.parseFile = function(e, t) {
|
|
|
6088
6088
|
});
|
|
6089
6089
|
};
|
|
6090
6090
|
var gi = B;
|
|
6091
|
-
const
|
|
6092
|
-
try {
|
|
6093
|
-
const n = { ...{ utc: !0 }, ...e }, s = r.trim().split(/\s/).filter((i) => i !== "").length;
|
|
6094
|
-
if (s === 6 && !n.allowSeconds && !n.requireSeconds)
|
|
6095
|
-
return "Seconds field is not allowed!";
|
|
6096
|
-
if (s === 5 && n.requireSeconds)
|
|
6097
|
-
return "Seconds field is required!";
|
|
6098
|
-
if (s < 5 || s > 6)
|
|
6099
|
-
return "Invalid number of fields, expected 5 or 6!";
|
|
6100
|
-
const a = pi.parseExpression(r, n);
|
|
6101
|
-
} catch (t) {
|
|
6102
|
-
return "Invalid cron expression: " + (t instanceof Error ? t.message : "");
|
|
6103
|
-
}
|
|
6104
|
-
};
|
|
6091
|
+
const wi = /* @__PURE__ */ en(gi);
|
|
6105
6092
|
export {
|
|
6106
6093
|
p as D,
|
|
6107
|
-
|
|
6108
|
-
Oi as c,
|
|
6109
|
-
ki as d,
|
|
6110
|
-
Si as n
|
|
6094
|
+
wi as p
|
|
6111
6095
|
};
|
|
6112
|
-
//# sourceMappingURL=
|
|
6096
|
+
//# sourceMappingURL=parser-CI353PAC.js.map
|