@strapi/plugin-users-permissions 5.5.2 → 5.7.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{index-DabA66Yf.mjs → index-BHbc3Ink.mjs} +3 -3
- package/dist/_chunks/{index-DabA66Yf.mjs.map → index-BHbc3Ink.mjs.map} +1 -1
- package/dist/_chunks/{index-pdc-kLHC.mjs → index-BJYiV54p.mjs} +3 -3
- package/dist/_chunks/{index-pdc-kLHC.mjs.map → index-BJYiV54p.mjs.map} +1 -1
- package/dist/_chunks/{index-k6KOwMF-.js → index-Bq-9NUpk.js} +2 -2
- package/dist/_chunks/{index-k6KOwMF-.js.map → index-Bq-9NUpk.js.map} +1 -1
- package/dist/_chunks/{index-CV0X429t-Be9Y8EXt.js → index-CMdgTmC0-CvJvlZwK.js} +27 -820
- package/dist/_chunks/index-CMdgTmC0-CvJvlZwK.js.map +1 -0
- package/dist/_chunks/{index-CV0X429t-CkJgvpmE.mjs → index-CMdgTmC0-Dku5eOkP.mjs} +27 -820
- package/dist/_chunks/index-CMdgTmC0-Dku5eOkP.mjs.map +1 -0
- package/dist/_chunks/{index-CvGkTmmM.mjs → index-CWcXkgDB.mjs} +2 -2
- package/dist/_chunks/{index-CvGkTmmM.mjs.map → index-CWcXkgDB.mjs.map} +1 -1
- package/dist/_chunks/{index-iA7YEHAe.js → index-CebHI5wz.js} +7 -7
- package/dist/_chunks/{index-iA7YEHAe.js.map → index-CebHI5wz.js.map} +1 -1
- package/dist/_chunks/{index-BizuINlB.js → index-CinbOZDa.js} +8 -8
- package/dist/_chunks/{index-BizuINlB.js.map → index-CinbOZDa.js.map} +1 -1
- package/dist/_chunks/{index-DIireyZN.js → index-DS-ZCPvz.js} +4 -4
- package/dist/_chunks/{index-DIireyZN.js.map → index-DS-ZCPvz.js.map} +1 -1
- package/dist/_chunks/{index-DkoAEmxi.mjs → index-Ds4W1yYl.mjs} +8 -8
- package/dist/_chunks/{index-DkoAEmxi.mjs.map → index-Ds4W1yYl.mjs.map} +1 -1
- package/dist/_chunks/{index-Ug631g2_.mjs → index-EGuMzv65.mjs} +2 -2
- package/dist/_chunks/{index-Ug631g2_.mjs.map → index-EGuMzv65.mjs.map} +1 -1
- package/dist/_chunks/{index-C87o690X.js → index-lwGc_PiF.js} +2 -2
- package/dist/_chunks/{index-C87o690X.js.map → index-lwGc_PiF.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/package.json +5 -4
- package/dist/_chunks/index-CV0X429t-Be9Y8EXt.js.map +0 -1
- package/dist/_chunks/index-CV0X429t-CkJgvpmE.mjs.map +0 -1
|
@@ -9502,814 +9502,6 @@ function generateNKeysBetween(a2, b, n, digits = BASE_62_DIGITS) {
|
|
|
9502
9502
|
return [generateKeyBetween(a2, b, digits)];
|
|
9503
9503
|
}
|
|
9504
9504
|
}
|
|
9505
|
-
function $2b4dce13dd5a17fa$export$842a2cf37af977e1(amount, numerator) {
|
|
9506
|
-
return amount - numerator * Math.floor(amount / numerator);
|
|
9507
|
-
}
|
|
9508
|
-
const $3b62074eb05584b2$var$EPOCH = 1721426;
|
|
9509
|
-
function $3b62074eb05584b2$export$f297eb839006d339(era, year, month, day) {
|
|
9510
|
-
year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year);
|
|
9511
|
-
let y1 = year - 1;
|
|
9512
|
-
let monthOffset = -2;
|
|
9513
|
-
if (month <= 2) monthOffset = 0;
|
|
9514
|
-
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) monthOffset = -1;
|
|
9515
|
-
return $3b62074eb05584b2$var$EPOCH - 1 + 365 * y1 + Math.floor(y1 / 4) - Math.floor(y1 / 100) + Math.floor(y1 / 400) + Math.floor((367 * month - 362) / 12 + monthOffset + day);
|
|
9516
|
-
}
|
|
9517
|
-
function $3b62074eb05584b2$export$553d7fa8e3805fc0(year) {
|
|
9518
|
-
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
9519
|
-
}
|
|
9520
|
-
function $3b62074eb05584b2$export$c36e0ecb2d4fa69d(era, year) {
|
|
9521
|
-
return era === "BC" ? 1 - year : year;
|
|
9522
|
-
}
|
|
9523
|
-
function $3b62074eb05584b2$export$4475b7e617eb123c(year) {
|
|
9524
|
-
let era = "AD";
|
|
9525
|
-
if (year <= 0) {
|
|
9526
|
-
era = "BC";
|
|
9527
|
-
year = 1 - year;
|
|
9528
|
-
}
|
|
9529
|
-
return [
|
|
9530
|
-
era,
|
|
9531
|
-
year
|
|
9532
|
-
];
|
|
9533
|
-
}
|
|
9534
|
-
const $3b62074eb05584b2$var$daysInMonth = {
|
|
9535
|
-
standard: [
|
|
9536
|
-
31,
|
|
9537
|
-
28,
|
|
9538
|
-
31,
|
|
9539
|
-
30,
|
|
9540
|
-
31,
|
|
9541
|
-
30,
|
|
9542
|
-
31,
|
|
9543
|
-
31,
|
|
9544
|
-
30,
|
|
9545
|
-
31,
|
|
9546
|
-
30,
|
|
9547
|
-
31
|
|
9548
|
-
],
|
|
9549
|
-
leapyear: [
|
|
9550
|
-
31,
|
|
9551
|
-
29,
|
|
9552
|
-
31,
|
|
9553
|
-
30,
|
|
9554
|
-
31,
|
|
9555
|
-
30,
|
|
9556
|
-
31,
|
|
9557
|
-
31,
|
|
9558
|
-
30,
|
|
9559
|
-
31,
|
|
9560
|
-
30,
|
|
9561
|
-
31
|
|
9562
|
-
]
|
|
9563
|
-
};
|
|
9564
|
-
class $3b62074eb05584b2$export$80ee6245ec4f29ec {
|
|
9565
|
-
fromJulianDay(jd) {
|
|
9566
|
-
let jd0 = jd;
|
|
9567
|
-
let depoch = jd0 - $3b62074eb05584b2$var$EPOCH;
|
|
9568
|
-
let quadricent = Math.floor(depoch / 146097);
|
|
9569
|
-
let dqc = $2b4dce13dd5a17fa$export$842a2cf37af977e1(depoch, 146097);
|
|
9570
|
-
let cent = Math.floor(dqc / 36524);
|
|
9571
|
-
let dcent = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dqc, 36524);
|
|
9572
|
-
let quad = Math.floor(dcent / 1461);
|
|
9573
|
-
let dquad = $2b4dce13dd5a17fa$export$842a2cf37af977e1(dcent, 1461);
|
|
9574
|
-
let yindex = Math.floor(dquad / 365);
|
|
9575
|
-
let extendedYear = quadricent * 400 + cent * 100 + quad * 4 + yindex + (cent !== 4 && yindex !== 4 ? 1 : 0);
|
|
9576
|
-
let [era, year] = $3b62074eb05584b2$export$4475b7e617eb123c(extendedYear);
|
|
9577
|
-
let yearDay = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, 1, 1);
|
|
9578
|
-
let leapAdj = 2;
|
|
9579
|
-
if (jd0 < $3b62074eb05584b2$export$f297eb839006d339(era, year, 3, 1)) leapAdj = 0;
|
|
9580
|
-
else if ($3b62074eb05584b2$export$553d7fa8e3805fc0(year)) leapAdj = 1;
|
|
9581
|
-
let month = Math.floor(((yearDay + leapAdj) * 12 + 373) / 367);
|
|
9582
|
-
let day = jd0 - $3b62074eb05584b2$export$f297eb839006d339(era, year, month, 1) + 1;
|
|
9583
|
-
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(era, year, month, day);
|
|
9584
|
-
}
|
|
9585
|
-
toJulianDay(date) {
|
|
9586
|
-
return $3b62074eb05584b2$export$f297eb839006d339(date.era, date.year, date.month, date.day);
|
|
9587
|
-
}
|
|
9588
|
-
getDaysInMonth(date) {
|
|
9589
|
-
return $3b62074eb05584b2$var$daysInMonth[$3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? "leapyear" : "standard"][date.month - 1];
|
|
9590
|
-
}
|
|
9591
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9592
|
-
getMonthsInYear(date) {
|
|
9593
|
-
return 12;
|
|
9594
|
-
}
|
|
9595
|
-
getDaysInYear(date) {
|
|
9596
|
-
return $3b62074eb05584b2$export$553d7fa8e3805fc0(date.year) ? 366 : 365;
|
|
9597
|
-
}
|
|
9598
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
9599
|
-
getYearsInEra(date) {
|
|
9600
|
-
return 9999;
|
|
9601
|
-
}
|
|
9602
|
-
getEras() {
|
|
9603
|
-
return [
|
|
9604
|
-
"BC",
|
|
9605
|
-
"AD"
|
|
9606
|
-
];
|
|
9607
|
-
}
|
|
9608
|
-
isInverseEra(date) {
|
|
9609
|
-
return date.era === "BC";
|
|
9610
|
-
}
|
|
9611
|
-
balanceDate(date) {
|
|
9612
|
-
if (date.year <= 0) {
|
|
9613
|
-
date.era = date.era === "BC" ? "AD" : "BC";
|
|
9614
|
-
date.year = 1 - date.year;
|
|
9615
|
-
}
|
|
9616
|
-
}
|
|
9617
|
-
constructor() {
|
|
9618
|
-
this.identifier = "gregory";
|
|
9619
|
-
}
|
|
9620
|
-
}
|
|
9621
|
-
function $14e0f24ef4ac5c92$export$68781ddf31c0090f(a2, b) {
|
|
9622
|
-
return a2.calendar.toJulianDay(a2) - b.calendar.toJulianDay(b);
|
|
9623
|
-
}
|
|
9624
|
-
function $14e0f24ef4ac5c92$export$c19a80a9721b80f6(a2, b) {
|
|
9625
|
-
return $14e0f24ef4ac5c92$var$timeToMs(a2) - $14e0f24ef4ac5c92$var$timeToMs(b);
|
|
9626
|
-
}
|
|
9627
|
-
function $14e0f24ef4ac5c92$var$timeToMs(a2) {
|
|
9628
|
-
return a2.hour * 36e5 + a2.minute * 6e4 + a2.second * 1e3 + a2.millisecond;
|
|
9629
|
-
}
|
|
9630
|
-
let $14e0f24ef4ac5c92$var$localTimeZone = null;
|
|
9631
|
-
function $14e0f24ef4ac5c92$export$aa8b41735afcabd2() {
|
|
9632
|
-
if ($14e0f24ef4ac5c92$var$localTimeZone == null) $14e0f24ef4ac5c92$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
9633
|
-
return $14e0f24ef4ac5c92$var$localTimeZone;
|
|
9634
|
-
}
|
|
9635
|
-
function $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) {
|
|
9636
|
-
date = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9637
|
-
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(date.era, date.year);
|
|
9638
|
-
return $11d87f3f76e88657$var$epochFromParts(year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond);
|
|
9639
|
-
}
|
|
9640
|
-
function $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, millisecond) {
|
|
9641
|
-
let date = /* @__PURE__ */ new Date();
|
|
9642
|
-
date.setUTCHours(hour, minute, second, millisecond);
|
|
9643
|
-
date.setUTCFullYear(year, month - 1, day);
|
|
9644
|
-
return date.getTime();
|
|
9645
|
-
}
|
|
9646
|
-
function $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone) {
|
|
9647
|
-
if (timeZone === "UTC") return 0;
|
|
9648
|
-
if (ms > 0 && timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2()) return new Date(ms).getTimezoneOffset() * -6e4;
|
|
9649
|
-
let { year, month, day, hour, minute, second } = $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone);
|
|
9650
|
-
let utc = $11d87f3f76e88657$var$epochFromParts(year, month, day, hour, minute, second, 0);
|
|
9651
|
-
return utc - Math.floor(ms / 1e3) * 1e3;
|
|
9652
|
-
}
|
|
9653
|
-
const $11d87f3f76e88657$var$formattersByTimeZone = /* @__PURE__ */ new Map();
|
|
9654
|
-
function $11d87f3f76e88657$var$getTimeZoneParts(ms, timeZone) {
|
|
9655
|
-
let formatter = $11d87f3f76e88657$var$formattersByTimeZone.get(timeZone);
|
|
9656
|
-
if (!formatter) {
|
|
9657
|
-
formatter = new Intl.DateTimeFormat("en-US", {
|
|
9658
|
-
timeZone,
|
|
9659
|
-
hour12: false,
|
|
9660
|
-
era: "short",
|
|
9661
|
-
year: "numeric",
|
|
9662
|
-
month: "numeric",
|
|
9663
|
-
day: "numeric",
|
|
9664
|
-
hour: "numeric",
|
|
9665
|
-
minute: "numeric",
|
|
9666
|
-
second: "numeric"
|
|
9667
|
-
});
|
|
9668
|
-
$11d87f3f76e88657$var$formattersByTimeZone.set(timeZone, formatter);
|
|
9669
|
-
}
|
|
9670
|
-
let parts = formatter.formatToParts(new Date(ms));
|
|
9671
|
-
let namedParts = {};
|
|
9672
|
-
for (let part of parts) if (part.type !== "literal") namedParts[part.type] = part.value;
|
|
9673
|
-
return {
|
|
9674
|
-
// Firefox returns B instead of BC... https://bugzilla.mozilla.org/show_bug.cgi?id=1752253
|
|
9675
|
-
year: namedParts.era === "BC" || namedParts.era === "B" ? -namedParts.year + 1 : +namedParts.year,
|
|
9676
|
-
month: +namedParts.month,
|
|
9677
|
-
day: +namedParts.day,
|
|
9678
|
-
hour: namedParts.hour === "24" ? 0 : +namedParts.hour,
|
|
9679
|
-
minute: +namedParts.minute,
|
|
9680
|
-
second: +namedParts.second
|
|
9681
|
-
};
|
|
9682
|
-
}
|
|
9683
|
-
const $11d87f3f76e88657$var$DAYMILLIS = 864e5;
|
|
9684
|
-
function $11d87f3f76e88657$var$getValidWallTimes(date, timeZone, earlier, later) {
|
|
9685
|
-
let found = earlier === later ? [
|
|
9686
|
-
earlier
|
|
9687
|
-
] : [
|
|
9688
|
-
earlier,
|
|
9689
|
-
later
|
|
9690
|
-
];
|
|
9691
|
-
return found.filter((absolute) => $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute));
|
|
9692
|
-
}
|
|
9693
|
-
function $11d87f3f76e88657$var$isValidWallTime(date, timeZone, absolute) {
|
|
9694
|
-
let parts = $11d87f3f76e88657$var$getTimeZoneParts(absolute, timeZone);
|
|
9695
|
-
return date.year === parts.year && date.month === parts.month && date.day === parts.day && date.hour === parts.hour && date.minute === parts.minute && date.second === parts.second;
|
|
9696
|
-
}
|
|
9697
|
-
function $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation = "compatible") {
|
|
9698
|
-
let dateTime = $11d87f3f76e88657$export$b21e0b124e224484(date);
|
|
9699
|
-
if (timeZone === "UTC") return $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
|
|
9700
|
-
if (timeZone === $14e0f24ef4ac5c92$export$aa8b41735afcabd2() && disambiguation === "compatible") {
|
|
9701
|
-
dateTime = $11d87f3f76e88657$export$b4a036af3fc0b032(dateTime, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
9702
|
-
let date2 = /* @__PURE__ */ new Date();
|
|
9703
|
-
let year = $3b62074eb05584b2$export$c36e0ecb2d4fa69d(dateTime.era, dateTime.year);
|
|
9704
|
-
date2.setFullYear(year, dateTime.month - 1, dateTime.day);
|
|
9705
|
-
date2.setHours(dateTime.hour, dateTime.minute, dateTime.second, dateTime.millisecond);
|
|
9706
|
-
return date2.getTime();
|
|
9707
|
-
}
|
|
9708
|
-
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime);
|
|
9709
|
-
let offsetBefore = $11d87f3f76e88657$export$59c99f3515d3493f(ms - $11d87f3f76e88657$var$DAYMILLIS, timeZone);
|
|
9710
|
-
let offsetAfter = $11d87f3f76e88657$export$59c99f3515d3493f(ms + $11d87f3f76e88657$var$DAYMILLIS, timeZone);
|
|
9711
|
-
let valid = $11d87f3f76e88657$var$getValidWallTimes(dateTime, timeZone, ms - offsetBefore, ms - offsetAfter);
|
|
9712
|
-
if (valid.length === 1) return valid[0];
|
|
9713
|
-
if (valid.length > 1) switch (disambiguation) {
|
|
9714
|
-
case "compatible":
|
|
9715
|
-
case "earlier":
|
|
9716
|
-
return valid[0];
|
|
9717
|
-
case "later":
|
|
9718
|
-
return valid[valid.length - 1];
|
|
9719
|
-
case "reject":
|
|
9720
|
-
throw new RangeError("Multiple possible absolute times found");
|
|
9721
|
-
}
|
|
9722
|
-
switch (disambiguation) {
|
|
9723
|
-
case "earlier":
|
|
9724
|
-
return Math.min(ms - offsetBefore, ms - offsetAfter);
|
|
9725
|
-
case "compatible":
|
|
9726
|
-
case "later":
|
|
9727
|
-
return Math.max(ms - offsetBefore, ms - offsetAfter);
|
|
9728
|
-
case "reject":
|
|
9729
|
-
throw new RangeError("No such absolute time found");
|
|
9730
|
-
}
|
|
9731
|
-
}
|
|
9732
|
-
function $11d87f3f76e88657$export$e67a095c620b86fe(dateTime, timeZone, disambiguation = "compatible") {
|
|
9733
|
-
return new Date($11d87f3f76e88657$export$5107c82f94518f5c(dateTime, timeZone, disambiguation));
|
|
9734
|
-
}
|
|
9735
|
-
function $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone) {
|
|
9736
|
-
let offset = $11d87f3f76e88657$export$59c99f3515d3493f(ms, timeZone);
|
|
9737
|
-
let date = new Date(ms + offset);
|
|
9738
|
-
let year = date.getUTCFullYear();
|
|
9739
|
-
let month = date.getUTCMonth() + 1;
|
|
9740
|
-
let day = date.getUTCDate();
|
|
9741
|
-
let hour = date.getUTCHours();
|
|
9742
|
-
let minute = date.getUTCMinutes();
|
|
9743
|
-
let second = date.getUTCSeconds();
|
|
9744
|
-
let millisecond = date.getUTCMilliseconds();
|
|
9745
|
-
return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(year, month, day, timeZone, offset, hour, minute, second, millisecond);
|
|
9746
|
-
}
|
|
9747
|
-
function $11d87f3f76e88657$export$93522d1a439f3617(dateTime) {
|
|
9748
|
-
return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(dateTime.calendar, dateTime.era, dateTime.year, dateTime.month, dateTime.day);
|
|
9749
|
-
}
|
|
9750
|
-
function $11d87f3f76e88657$export$b21e0b124e224484(date, time) {
|
|
9751
|
-
let hour = 0, minute = 0, second = 0, millisecond = 0;
|
|
9752
|
-
if ("timeZone" in date) ({ hour, minute, second, millisecond } = date);
|
|
9753
|
-
else if ("hour" in date && !time) return date;
|
|
9754
|
-
if (time) ({ hour, minute, second, millisecond } = time);
|
|
9755
|
-
return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(date.calendar, date.era, date.year, date.month, date.day, hour, minute, second, millisecond);
|
|
9756
|
-
}
|
|
9757
|
-
function $11d87f3f76e88657$export$b4a036af3fc0b032(date, calendar) {
|
|
9758
|
-
if (date.calendar.identifier === calendar.identifier) return date;
|
|
9759
|
-
let calendarDate = calendar.fromJulianDay(date.calendar.toJulianDay(date));
|
|
9760
|
-
let copy = date.copy();
|
|
9761
|
-
copy.calendar = calendar;
|
|
9762
|
-
copy.era = calendarDate.era;
|
|
9763
|
-
copy.year = calendarDate.year;
|
|
9764
|
-
copy.month = calendarDate.month;
|
|
9765
|
-
copy.day = calendarDate.day;
|
|
9766
|
-
$735220c2d4774dd3$export$c4e2ecac49351ef2(copy);
|
|
9767
|
-
return copy;
|
|
9768
|
-
}
|
|
9769
|
-
function $11d87f3f76e88657$export$84c95a83c799e074(date, timeZone, disambiguation) {
|
|
9770
|
-
if (date instanceof $35ea8db9cb2ccb90$export$d3b7288e7994edea) {
|
|
9771
|
-
if (date.timeZone === timeZone) return date;
|
|
9772
|
-
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
9773
|
-
}
|
|
9774
|
-
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(date, timeZone, disambiguation);
|
|
9775
|
-
return $11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone);
|
|
9776
|
-
}
|
|
9777
|
-
function $11d87f3f76e88657$export$83aac07b4c37b25(date) {
|
|
9778
|
-
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
9779
|
-
return new Date(ms);
|
|
9780
|
-
}
|
|
9781
|
-
function $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone) {
|
|
9782
|
-
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(date) - date.offset;
|
|
9783
|
-
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, timeZone), date.calendar);
|
|
9784
|
-
}
|
|
9785
|
-
const $735220c2d4774dd3$var$ONE_HOUR = 36e5;
|
|
9786
|
-
function $735220c2d4774dd3$export$e16d8520af44a096(date, duration) {
|
|
9787
|
-
let mutableDate = date.copy();
|
|
9788
|
-
let days = "hour" in mutableDate ? $735220c2d4774dd3$var$addTimeFields(mutableDate, duration) : 0;
|
|
9789
|
-
$735220c2d4774dd3$var$addYears(mutableDate, duration.years || 0);
|
|
9790
|
-
if (mutableDate.calendar.balanceYearMonth) mutableDate.calendar.balanceYearMonth(mutableDate, date);
|
|
9791
|
-
mutableDate.month += duration.months || 0;
|
|
9792
|
-
$735220c2d4774dd3$var$balanceYearMonth(mutableDate);
|
|
9793
|
-
$735220c2d4774dd3$var$constrainMonthDay(mutableDate);
|
|
9794
|
-
mutableDate.day += (duration.weeks || 0) * 7;
|
|
9795
|
-
mutableDate.day += duration.days || 0;
|
|
9796
|
-
mutableDate.day += days;
|
|
9797
|
-
$735220c2d4774dd3$var$balanceDay(mutableDate);
|
|
9798
|
-
if (mutableDate.calendar.balanceDate) mutableDate.calendar.balanceDate(mutableDate);
|
|
9799
|
-
if (mutableDate.year < 1) {
|
|
9800
|
-
mutableDate.year = 1;
|
|
9801
|
-
mutableDate.month = 1;
|
|
9802
|
-
mutableDate.day = 1;
|
|
9803
|
-
}
|
|
9804
|
-
let maxYear = mutableDate.calendar.getYearsInEra(mutableDate);
|
|
9805
|
-
if (mutableDate.year > maxYear) {
|
|
9806
|
-
var _mutableDate_calendar_isInverseEra, _mutableDate_calendar;
|
|
9807
|
-
let isInverseEra = (_mutableDate_calendar_isInverseEra = (_mutableDate_calendar = mutableDate.calendar).isInverseEra) === null || _mutableDate_calendar_isInverseEra === void 0 ? void 0 : _mutableDate_calendar_isInverseEra.call(_mutableDate_calendar, mutableDate);
|
|
9808
|
-
mutableDate.year = maxYear;
|
|
9809
|
-
mutableDate.month = isInverseEra ? 1 : mutableDate.calendar.getMonthsInYear(mutableDate);
|
|
9810
|
-
mutableDate.day = isInverseEra ? 1 : mutableDate.calendar.getDaysInMonth(mutableDate);
|
|
9811
|
-
}
|
|
9812
|
-
if (mutableDate.month < 1) {
|
|
9813
|
-
mutableDate.month = 1;
|
|
9814
|
-
mutableDate.day = 1;
|
|
9815
|
-
}
|
|
9816
|
-
let maxMonth = mutableDate.calendar.getMonthsInYear(mutableDate);
|
|
9817
|
-
if (mutableDate.month > maxMonth) {
|
|
9818
|
-
mutableDate.month = maxMonth;
|
|
9819
|
-
mutableDate.day = mutableDate.calendar.getDaysInMonth(mutableDate);
|
|
9820
|
-
}
|
|
9821
|
-
mutableDate.day = Math.max(1, Math.min(mutableDate.calendar.getDaysInMonth(mutableDate), mutableDate.day));
|
|
9822
|
-
return mutableDate;
|
|
9823
|
-
}
|
|
9824
|
-
function $735220c2d4774dd3$var$addYears(date, years) {
|
|
9825
|
-
var _date_calendar_isInverseEra, _date_calendar;
|
|
9826
|
-
if ((_date_calendar_isInverseEra = (_date_calendar = date.calendar).isInverseEra) === null || _date_calendar_isInverseEra === void 0 ? void 0 : _date_calendar_isInverseEra.call(_date_calendar, date)) years = -years;
|
|
9827
|
-
date.year += years;
|
|
9828
|
-
}
|
|
9829
|
-
function $735220c2d4774dd3$var$balanceYearMonth(date) {
|
|
9830
|
-
while (date.month < 1) {
|
|
9831
|
-
$735220c2d4774dd3$var$addYears(date, -1);
|
|
9832
|
-
date.month += date.calendar.getMonthsInYear(date);
|
|
9833
|
-
}
|
|
9834
|
-
let monthsInYear = 0;
|
|
9835
|
-
while (date.month > (monthsInYear = date.calendar.getMonthsInYear(date))) {
|
|
9836
|
-
date.month -= monthsInYear;
|
|
9837
|
-
$735220c2d4774dd3$var$addYears(date, 1);
|
|
9838
|
-
}
|
|
9839
|
-
}
|
|
9840
|
-
function $735220c2d4774dd3$var$balanceDay(date) {
|
|
9841
|
-
while (date.day < 1) {
|
|
9842
|
-
date.month--;
|
|
9843
|
-
$735220c2d4774dd3$var$balanceYearMonth(date);
|
|
9844
|
-
date.day += date.calendar.getDaysInMonth(date);
|
|
9845
|
-
}
|
|
9846
|
-
while (date.day > date.calendar.getDaysInMonth(date)) {
|
|
9847
|
-
date.day -= date.calendar.getDaysInMonth(date);
|
|
9848
|
-
date.month++;
|
|
9849
|
-
$735220c2d4774dd3$var$balanceYearMonth(date);
|
|
9850
|
-
}
|
|
9851
|
-
}
|
|
9852
|
-
function $735220c2d4774dd3$var$constrainMonthDay(date) {
|
|
9853
|
-
date.month = Math.max(1, Math.min(date.calendar.getMonthsInYear(date), date.month));
|
|
9854
|
-
date.day = Math.max(1, Math.min(date.calendar.getDaysInMonth(date), date.day));
|
|
9855
|
-
}
|
|
9856
|
-
function $735220c2d4774dd3$export$c4e2ecac49351ef2(date) {
|
|
9857
|
-
if (date.calendar.constrainDate) date.calendar.constrainDate(date);
|
|
9858
|
-
date.year = Math.max(1, Math.min(date.calendar.getYearsInEra(date), date.year));
|
|
9859
|
-
$735220c2d4774dd3$var$constrainMonthDay(date);
|
|
9860
|
-
}
|
|
9861
|
-
function $735220c2d4774dd3$export$3e2544e88a25bff8(duration) {
|
|
9862
|
-
let inverseDuration = {};
|
|
9863
|
-
for (let key in duration) if (typeof duration[key] === "number") inverseDuration[key] = -duration[key];
|
|
9864
|
-
return inverseDuration;
|
|
9865
|
-
}
|
|
9866
|
-
function $735220c2d4774dd3$export$4e2d2ead65e5f7e3(date, duration) {
|
|
9867
|
-
return $735220c2d4774dd3$export$e16d8520af44a096(date, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
9868
|
-
}
|
|
9869
|
-
function $735220c2d4774dd3$export$adaa4cf7ef1b65be(date, fields) {
|
|
9870
|
-
let mutableDate = date.copy();
|
|
9871
|
-
if (fields.era != null) mutableDate.era = fields.era;
|
|
9872
|
-
if (fields.year != null) mutableDate.year = fields.year;
|
|
9873
|
-
if (fields.month != null) mutableDate.month = fields.month;
|
|
9874
|
-
if (fields.day != null) mutableDate.day = fields.day;
|
|
9875
|
-
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutableDate);
|
|
9876
|
-
return mutableDate;
|
|
9877
|
-
}
|
|
9878
|
-
function $735220c2d4774dd3$export$e5d5e1c1822b6e56(value, fields) {
|
|
9879
|
-
let mutableValue = value.copy();
|
|
9880
|
-
if (fields.hour != null) mutableValue.hour = fields.hour;
|
|
9881
|
-
if (fields.minute != null) mutableValue.minute = fields.minute;
|
|
9882
|
-
if (fields.second != null) mutableValue.second = fields.second;
|
|
9883
|
-
if (fields.millisecond != null) mutableValue.millisecond = fields.millisecond;
|
|
9884
|
-
$735220c2d4774dd3$export$7555de1e070510cb(mutableValue);
|
|
9885
|
-
return mutableValue;
|
|
9886
|
-
}
|
|
9887
|
-
function $735220c2d4774dd3$var$balanceTime(time) {
|
|
9888
|
-
time.second += Math.floor(time.millisecond / 1e3);
|
|
9889
|
-
time.millisecond = $735220c2d4774dd3$var$nonNegativeMod(time.millisecond, 1e3);
|
|
9890
|
-
time.minute += Math.floor(time.second / 60);
|
|
9891
|
-
time.second = $735220c2d4774dd3$var$nonNegativeMod(time.second, 60);
|
|
9892
|
-
time.hour += Math.floor(time.minute / 60);
|
|
9893
|
-
time.minute = $735220c2d4774dd3$var$nonNegativeMod(time.minute, 60);
|
|
9894
|
-
let days = Math.floor(time.hour / 24);
|
|
9895
|
-
time.hour = $735220c2d4774dd3$var$nonNegativeMod(time.hour, 24);
|
|
9896
|
-
return days;
|
|
9897
|
-
}
|
|
9898
|
-
function $735220c2d4774dd3$export$7555de1e070510cb(time) {
|
|
9899
|
-
time.millisecond = Math.max(0, Math.min(time.millisecond, 1e3));
|
|
9900
|
-
time.second = Math.max(0, Math.min(time.second, 59));
|
|
9901
|
-
time.minute = Math.max(0, Math.min(time.minute, 59));
|
|
9902
|
-
time.hour = Math.max(0, Math.min(time.hour, 23));
|
|
9903
|
-
}
|
|
9904
|
-
function $735220c2d4774dd3$var$nonNegativeMod(a2, b) {
|
|
9905
|
-
let result = a2 % b;
|
|
9906
|
-
if (result < 0) result += b;
|
|
9907
|
-
return result;
|
|
9908
|
-
}
|
|
9909
|
-
function $735220c2d4774dd3$var$addTimeFields(time, duration) {
|
|
9910
|
-
time.hour += duration.hours || 0;
|
|
9911
|
-
time.minute += duration.minutes || 0;
|
|
9912
|
-
time.second += duration.seconds || 0;
|
|
9913
|
-
time.millisecond += duration.milliseconds || 0;
|
|
9914
|
-
return $735220c2d4774dd3$var$balanceTime(time);
|
|
9915
|
-
}
|
|
9916
|
-
function $735220c2d4774dd3$export$d52ced6badfb9a4c(value, field, amount, options) {
|
|
9917
|
-
let mutable = value.copy();
|
|
9918
|
-
switch (field) {
|
|
9919
|
-
case "era": {
|
|
9920
|
-
let eras = value.calendar.getEras();
|
|
9921
|
-
let eraIndex = eras.indexOf(value.era);
|
|
9922
|
-
if (eraIndex < 0) throw new Error("Invalid era: " + value.era);
|
|
9923
|
-
eraIndex = $735220c2d4774dd3$var$cycleValue(eraIndex, amount, 0, eras.length - 1, options === null || options === void 0 ? void 0 : options.round);
|
|
9924
|
-
mutable.era = eras[eraIndex];
|
|
9925
|
-
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
|
|
9926
|
-
break;
|
|
9927
|
-
}
|
|
9928
|
-
case "year":
|
|
9929
|
-
var _mutable_calendar_isInverseEra, _mutable_calendar;
|
|
9930
|
-
if ((_mutable_calendar_isInverseEra = (_mutable_calendar = mutable.calendar).isInverseEra) === null || _mutable_calendar_isInverseEra === void 0 ? void 0 : _mutable_calendar_isInverseEra.call(_mutable_calendar, mutable)) amount = -amount;
|
|
9931
|
-
mutable.year = $735220c2d4774dd3$var$cycleValue(value.year, amount, -Infinity, 9999, options === null || options === void 0 ? void 0 : options.round);
|
|
9932
|
-
if (mutable.year === -Infinity) mutable.year = 1;
|
|
9933
|
-
if (mutable.calendar.balanceYearMonth) mutable.calendar.balanceYearMonth(mutable, value);
|
|
9934
|
-
break;
|
|
9935
|
-
case "month":
|
|
9936
|
-
mutable.month = $735220c2d4774dd3$var$cycleValue(value.month, amount, 1, value.calendar.getMonthsInYear(value), options === null || options === void 0 ? void 0 : options.round);
|
|
9937
|
-
break;
|
|
9938
|
-
case "day":
|
|
9939
|
-
mutable.day = $735220c2d4774dd3$var$cycleValue(value.day, amount, 1, value.calendar.getDaysInMonth(value), options === null || options === void 0 ? void 0 : options.round);
|
|
9940
|
-
break;
|
|
9941
|
-
default:
|
|
9942
|
-
throw new Error("Unsupported field " + field);
|
|
9943
|
-
}
|
|
9944
|
-
if (value.calendar.balanceDate) value.calendar.balanceDate(mutable);
|
|
9945
|
-
$735220c2d4774dd3$export$c4e2ecac49351ef2(mutable);
|
|
9946
|
-
return mutable;
|
|
9947
|
-
}
|
|
9948
|
-
function $735220c2d4774dd3$export$dd02b3e0007dfe28(value, field, amount, options) {
|
|
9949
|
-
let mutable = value.copy();
|
|
9950
|
-
switch (field) {
|
|
9951
|
-
case "hour": {
|
|
9952
|
-
let hours = value.hour;
|
|
9953
|
-
let min = 0;
|
|
9954
|
-
let max2 = 23;
|
|
9955
|
-
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
9956
|
-
let isPM = hours >= 12;
|
|
9957
|
-
min = isPM ? 12 : 0;
|
|
9958
|
-
max2 = isPM ? 23 : 11;
|
|
9959
|
-
}
|
|
9960
|
-
mutable.hour = $735220c2d4774dd3$var$cycleValue(hours, amount, min, max2, options === null || options === void 0 ? void 0 : options.round);
|
|
9961
|
-
break;
|
|
9962
|
-
}
|
|
9963
|
-
case "minute":
|
|
9964
|
-
mutable.minute = $735220c2d4774dd3$var$cycleValue(value.minute, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
9965
|
-
break;
|
|
9966
|
-
case "second":
|
|
9967
|
-
mutable.second = $735220c2d4774dd3$var$cycleValue(value.second, amount, 0, 59, options === null || options === void 0 ? void 0 : options.round);
|
|
9968
|
-
break;
|
|
9969
|
-
case "millisecond":
|
|
9970
|
-
mutable.millisecond = $735220c2d4774dd3$var$cycleValue(value.millisecond, amount, 0, 999, options === null || options === void 0 ? void 0 : options.round);
|
|
9971
|
-
break;
|
|
9972
|
-
default:
|
|
9973
|
-
throw new Error("Unsupported field " + field);
|
|
9974
|
-
}
|
|
9975
|
-
return mutable;
|
|
9976
|
-
}
|
|
9977
|
-
function $735220c2d4774dd3$var$cycleValue(value, amount, min, max2, round = false) {
|
|
9978
|
-
if (round) {
|
|
9979
|
-
value += Math.sign(amount);
|
|
9980
|
-
if (value < min) value = max2;
|
|
9981
|
-
let div = Math.abs(amount);
|
|
9982
|
-
if (amount > 0) value = Math.ceil(value / div) * div;
|
|
9983
|
-
else value = Math.floor(value / div) * div;
|
|
9984
|
-
if (value > max2) value = min;
|
|
9985
|
-
} else {
|
|
9986
|
-
value += amount;
|
|
9987
|
-
if (value < min) value = max2 - (min - value - 1);
|
|
9988
|
-
else if (value > max2) value = min + (value - max2 - 1);
|
|
9989
|
-
}
|
|
9990
|
-
return value;
|
|
9991
|
-
}
|
|
9992
|
-
function $735220c2d4774dd3$export$96b1d28349274637(dateTime, duration) {
|
|
9993
|
-
let ms;
|
|
9994
|
-
if (duration.years != null && duration.years !== 0 || duration.months != null && duration.months !== 0 || duration.weeks != null && duration.weeks !== 0 || duration.days != null && duration.days !== 0) {
|
|
9995
|
-
let res2 = $735220c2d4774dd3$export$e16d8520af44a096($11d87f3f76e88657$export$b21e0b124e224484(dateTime), {
|
|
9996
|
-
years: duration.years,
|
|
9997
|
-
months: duration.months,
|
|
9998
|
-
weeks: duration.weeks,
|
|
9999
|
-
days: duration.days
|
|
10000
|
-
});
|
|
10001
|
-
ms = $11d87f3f76e88657$export$5107c82f94518f5c(res2, dateTime.timeZone);
|
|
10002
|
-
} else
|
|
10003
|
-
ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
10004
|
-
ms += duration.milliseconds || 0;
|
|
10005
|
-
ms += (duration.seconds || 0) * 1e3;
|
|
10006
|
-
ms += (duration.minutes || 0) * 6e4;
|
|
10007
|
-
ms += (duration.hours || 0) * 36e5;
|
|
10008
|
-
let res = $11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone);
|
|
10009
|
-
return $11d87f3f76e88657$export$b4a036af3fc0b032(res, dateTime.calendar);
|
|
10010
|
-
}
|
|
10011
|
-
function $735220c2d4774dd3$export$6814caac34ca03c7(dateTime, duration) {
|
|
10012
|
-
return $735220c2d4774dd3$export$96b1d28349274637(dateTime, $735220c2d4774dd3$export$3e2544e88a25bff8(duration));
|
|
10013
|
-
}
|
|
10014
|
-
function $735220c2d4774dd3$export$9a297d111fc86b79(dateTime, field, amount, options) {
|
|
10015
|
-
switch (field) {
|
|
10016
|
-
case "hour": {
|
|
10017
|
-
let min = 0;
|
|
10018
|
-
let max2 = 23;
|
|
10019
|
-
if ((options === null || options === void 0 ? void 0 : options.hourCycle) === 12) {
|
|
10020
|
-
let isPM = dateTime.hour >= 12;
|
|
10021
|
-
min = isPM ? 12 : 0;
|
|
10022
|
-
max2 = isPM ? 23 : 11;
|
|
10023
|
-
}
|
|
10024
|
-
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
|
|
10025
|
-
let minDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
10026
|
-
hour: min
|
|
10027
|
-
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
10028
|
-
let minAbsolute = [
|
|
10029
|
-
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "earlier"),
|
|
10030
|
-
$11d87f3f76e88657$export$5107c82f94518f5c(minDate, dateTime.timeZone, "later")
|
|
10031
|
-
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === minDate.day)[0];
|
|
10032
|
-
let maxDate = $11d87f3f76e88657$export$b4a036af3fc0b032($735220c2d4774dd3$export$e5d5e1c1822b6e56(plainDateTime, {
|
|
10033
|
-
hour: max2
|
|
10034
|
-
}), new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
10035
|
-
let maxAbsolute = [
|
|
10036
|
-
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "earlier"),
|
|
10037
|
-
$11d87f3f76e88657$export$5107c82f94518f5c(maxDate, dateTime.timeZone, "later")
|
|
10038
|
-
].filter((ms2) => $11d87f3f76e88657$export$1b96692a1ba042ac(ms2, dateTime.timeZone).day === maxDate.day).pop();
|
|
10039
|
-
let ms = $11d87f3f76e88657$export$bd4fb2bc8bb06fb(dateTime) - dateTime.offset;
|
|
10040
|
-
let hours = Math.floor(ms / $735220c2d4774dd3$var$ONE_HOUR);
|
|
10041
|
-
let remainder = ms % $735220c2d4774dd3$var$ONE_HOUR;
|
|
10042
|
-
ms = $735220c2d4774dd3$var$cycleValue(hours, amount, Math.floor(minAbsolute / $735220c2d4774dd3$var$ONE_HOUR), Math.floor(maxAbsolute / $735220c2d4774dd3$var$ONE_HOUR), options === null || options === void 0 ? void 0 : options.round) * $735220c2d4774dd3$var$ONE_HOUR + remainder;
|
|
10043
|
-
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
10044
|
-
}
|
|
10045
|
-
case "minute":
|
|
10046
|
-
case "second":
|
|
10047
|
-
case "millisecond":
|
|
10048
|
-
return $735220c2d4774dd3$export$dd02b3e0007dfe28(dateTime, field, amount, options);
|
|
10049
|
-
case "era":
|
|
10050
|
-
case "year":
|
|
10051
|
-
case "month":
|
|
10052
|
-
case "day": {
|
|
10053
|
-
let res = $735220c2d4774dd3$export$d52ced6badfb9a4c($11d87f3f76e88657$export$b21e0b124e224484(dateTime), field, amount, options);
|
|
10054
|
-
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone);
|
|
10055
|
-
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
10056
|
-
}
|
|
10057
|
-
default:
|
|
10058
|
-
throw new Error("Unsupported field " + field);
|
|
10059
|
-
}
|
|
10060
|
-
}
|
|
10061
|
-
function $735220c2d4774dd3$export$31b5430eb18be4f8(dateTime, fields, disambiguation) {
|
|
10062
|
-
let plainDateTime = $11d87f3f76e88657$export$b21e0b124e224484(dateTime);
|
|
10063
|
-
let res = $735220c2d4774dd3$export$e5d5e1c1822b6e56($735220c2d4774dd3$export$adaa4cf7ef1b65be(plainDateTime, fields), fields);
|
|
10064
|
-
if (res.compare(plainDateTime) === 0) return dateTime;
|
|
10065
|
-
let ms = $11d87f3f76e88657$export$5107c82f94518f5c(res, dateTime.timeZone, disambiguation);
|
|
10066
|
-
return $11d87f3f76e88657$export$b4a036af3fc0b032($11d87f3f76e88657$export$1b96692a1ba042ac(ms, dateTime.timeZone), dateTime.calendar);
|
|
10067
|
-
}
|
|
10068
|
-
const $fae977aafc393c5c$var$ABSOLUTE_RE = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
|
|
10069
|
-
function $fae977aafc393c5c$export$5adfdab05168c219(value, timeZone) {
|
|
10070
|
-
let m = value.match($fae977aafc393c5c$var$ABSOLUTE_RE);
|
|
10071
|
-
if (!m) throw new Error("Invalid ISO 8601 date time string: " + value);
|
|
10072
|
-
let date = new $35ea8db9cb2ccb90$export$d3b7288e7994edea($fae977aafc393c5c$var$parseNumber(m[1], 1, 9999), $fae977aafc393c5c$var$parseNumber(m[2], 1, 12), 1, timeZone, 0, m[4] ? $fae977aafc393c5c$var$parseNumber(m[4], 0, 23) : 0, m[5] ? $fae977aafc393c5c$var$parseNumber(m[5], 0, 59) : 0, m[6] ? $fae977aafc393c5c$var$parseNumber(m[6], 0, 59) : 0, m[7] ? $fae977aafc393c5c$var$parseNumber(m[7], 0, Infinity) * 1e3 : 0);
|
|
10073
|
-
date.day = $fae977aafc393c5c$var$parseNumber(m[3], 0, date.calendar.getDaysInMonth(date));
|
|
10074
|
-
var _m_;
|
|
10075
|
-
if (m[8]) date.offset = $fae977aafc393c5c$var$parseNumber(m[8], -23, 23) * 36e5 + $fae977aafc393c5c$var$parseNumber((_m_ = m[9]) !== null && _m_ !== void 0 ? _m_ : "0", 0, 59) * 6e4;
|
|
10076
|
-
return $11d87f3f76e88657$export$538b00033cc11c75(date, timeZone);
|
|
10077
|
-
}
|
|
10078
|
-
function $fae977aafc393c5c$var$parseNumber(value, min, max2) {
|
|
10079
|
-
let val = Number(value);
|
|
10080
|
-
if (val < min || val > max2) throw new RangeError(`Value out of range: ${min} <= ${val} <= ${max2}`);
|
|
10081
|
-
return val;
|
|
10082
|
-
}
|
|
10083
|
-
function $fae977aafc393c5c$export$f59dee82248f5ad4(time) {
|
|
10084
|
-
return `${String(time.hour).padStart(2, "0")}:${String(time.minute).padStart(2, "0")}:${String(time.second).padStart(2, "0")}${time.millisecond ? String(time.millisecond / 1e3).slice(1) : ""}`;
|
|
10085
|
-
}
|
|
10086
|
-
function $fae977aafc393c5c$export$60dfd74aa96791bd(date) {
|
|
10087
|
-
let gregorianDate = $11d87f3f76e88657$export$b4a036af3fc0b032(date, new $3b62074eb05584b2$export$80ee6245ec4f29ec());
|
|
10088
|
-
return `${String(gregorianDate.year).padStart(4, "0")}-${String(gregorianDate.month).padStart(2, "0")}-${String(gregorianDate.day).padStart(2, "0")}`;
|
|
10089
|
-
}
|
|
10090
|
-
function $fae977aafc393c5c$export$4223de14708adc63(date) {
|
|
10091
|
-
return `${$fae977aafc393c5c$export$60dfd74aa96791bd(date)}T${$fae977aafc393c5c$export$f59dee82248f5ad4(date)}`;
|
|
10092
|
-
}
|
|
10093
|
-
function $fae977aafc393c5c$var$offsetToString(offset) {
|
|
10094
|
-
let sign = Math.sign(offset) < 0 ? "-" : "+";
|
|
10095
|
-
offset = Math.abs(offset);
|
|
10096
|
-
let offsetHours = Math.floor(offset / 36e5);
|
|
10097
|
-
let offsetMinutes = offset % 36e5 / 6e4;
|
|
10098
|
-
return `${sign}${String(offsetHours).padStart(2, "0")}:${String(offsetMinutes).padStart(2, "0")}`;
|
|
10099
|
-
}
|
|
10100
|
-
function $fae977aafc393c5c$export$bf79f1ebf4b18792(date) {
|
|
10101
|
-
return `${$fae977aafc393c5c$export$4223de14708adc63(date)}${$fae977aafc393c5c$var$offsetToString(date.offset)}[${date.timeZone}]`;
|
|
10102
|
-
}
|
|
10103
|
-
function _check_private_redeclaration(obj, privateCollection) {
|
|
10104
|
-
if (privateCollection.has(obj)) {
|
|
10105
|
-
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
10106
|
-
}
|
|
10107
|
-
}
|
|
10108
|
-
function _class_private_field_init(obj, privateMap, value) {
|
|
10109
|
-
_check_private_redeclaration(obj, privateMap);
|
|
10110
|
-
privateMap.set(obj, value);
|
|
10111
|
-
}
|
|
10112
|
-
function $35ea8db9cb2ccb90$var$shiftArgs(args) {
|
|
10113
|
-
let calendar = typeof args[0] === "object" ? args.shift() : new $3b62074eb05584b2$export$80ee6245ec4f29ec();
|
|
10114
|
-
let era;
|
|
10115
|
-
if (typeof args[0] === "string") era = args.shift();
|
|
10116
|
-
else {
|
|
10117
|
-
let eras = calendar.getEras();
|
|
10118
|
-
era = eras[eras.length - 1];
|
|
10119
|
-
}
|
|
10120
|
-
let year = args.shift();
|
|
10121
|
-
let month = args.shift();
|
|
10122
|
-
let day = args.shift();
|
|
10123
|
-
return [
|
|
10124
|
-
calendar,
|
|
10125
|
-
era,
|
|
10126
|
-
year,
|
|
10127
|
-
month,
|
|
10128
|
-
day
|
|
10129
|
-
];
|
|
10130
|
-
}
|
|
10131
|
-
var $35ea8db9cb2ccb90$var$_type = /* @__PURE__ */ new WeakMap();
|
|
10132
|
-
class $35ea8db9cb2ccb90$export$99faa760c7908e4f {
|
|
10133
|
-
/** Returns a copy of this date. */
|
|
10134
|
-
copy() {
|
|
10135
|
-
if (this.era) return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.era, this.year, this.month, this.day);
|
|
10136
|
-
else return new $35ea8db9cb2ccb90$export$99faa760c7908e4f(this.calendar, this.year, this.month, this.day);
|
|
10137
|
-
}
|
|
10138
|
-
/** Returns a new `CalendarDate` with the given duration added to it. */
|
|
10139
|
-
add(duration) {
|
|
10140
|
-
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
|
|
10141
|
-
}
|
|
10142
|
-
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
|
|
10143
|
-
subtract(duration) {
|
|
10144
|
-
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
|
|
10145
|
-
}
|
|
10146
|
-
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
10147
|
-
set(fields) {
|
|
10148
|
-
return $735220c2d4774dd3$export$adaa4cf7ef1b65be(this, fields);
|
|
10149
|
-
}
|
|
10150
|
-
/**
|
|
10151
|
-
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
10152
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
10153
|
-
*/
|
|
10154
|
-
cycle(field, amount, options) {
|
|
10155
|
-
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
10156
|
-
}
|
|
10157
|
-
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
|
|
10158
|
-
toDate(timeZone) {
|
|
10159
|
-
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone);
|
|
10160
|
-
}
|
|
10161
|
-
/** Converts the date to an ISO 8601 formatted string. */
|
|
10162
|
-
toString() {
|
|
10163
|
-
return $fae977aafc393c5c$export$60dfd74aa96791bd(this);
|
|
10164
|
-
}
|
|
10165
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
10166
|
-
compare(b) {
|
|
10167
|
-
return $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
|
|
10168
|
-
}
|
|
10169
|
-
constructor(...args) {
|
|
10170
|
-
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type, {
|
|
10171
|
-
writable: true,
|
|
10172
|
-
value: void 0
|
|
10173
|
-
});
|
|
10174
|
-
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
10175
|
-
this.calendar = calendar;
|
|
10176
|
-
this.era = era;
|
|
10177
|
-
this.year = year;
|
|
10178
|
-
this.month = month;
|
|
10179
|
-
this.day = day;
|
|
10180
|
-
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
10181
|
-
}
|
|
10182
|
-
}
|
|
10183
|
-
var $35ea8db9cb2ccb90$var$_type2 = /* @__PURE__ */ new WeakMap();
|
|
10184
|
-
class $35ea8db9cb2ccb90$export$ca871e8dbb80966f {
|
|
10185
|
-
/** Returns a copy of this date. */
|
|
10186
|
-
copy() {
|
|
10187
|
-
if (this.era) return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
10188
|
-
else return new $35ea8db9cb2ccb90$export$ca871e8dbb80966f(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
10189
|
-
}
|
|
10190
|
-
/** Returns a new `CalendarDateTime` with the given duration added to it. */
|
|
10191
|
-
add(duration) {
|
|
10192
|
-
return $735220c2d4774dd3$export$e16d8520af44a096(this, duration);
|
|
10193
|
-
}
|
|
10194
|
-
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
|
|
10195
|
-
subtract(duration) {
|
|
10196
|
-
return $735220c2d4774dd3$export$4e2d2ead65e5f7e3(this, duration);
|
|
10197
|
-
}
|
|
10198
|
-
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
10199
|
-
set(fields) {
|
|
10200
|
-
return $735220c2d4774dd3$export$adaa4cf7ef1b65be($735220c2d4774dd3$export$e5d5e1c1822b6e56(this, fields), fields);
|
|
10201
|
-
}
|
|
10202
|
-
/**
|
|
10203
|
-
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
10204
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
10205
|
-
*/
|
|
10206
|
-
cycle(field, amount, options) {
|
|
10207
|
-
switch (field) {
|
|
10208
|
-
case "era":
|
|
10209
|
-
case "year":
|
|
10210
|
-
case "month":
|
|
10211
|
-
case "day":
|
|
10212
|
-
return $735220c2d4774dd3$export$d52ced6badfb9a4c(this, field, amount, options);
|
|
10213
|
-
default:
|
|
10214
|
-
return $735220c2d4774dd3$export$dd02b3e0007dfe28(this, field, amount, options);
|
|
10215
|
-
}
|
|
10216
|
-
}
|
|
10217
|
-
/** Converts the date to a native JavaScript Date object in the given time zone. */
|
|
10218
|
-
toDate(timeZone, disambiguation) {
|
|
10219
|
-
return $11d87f3f76e88657$export$e67a095c620b86fe(this, timeZone, disambiguation);
|
|
10220
|
-
}
|
|
10221
|
-
/** Converts the date to an ISO 8601 formatted string. */
|
|
10222
|
-
toString() {
|
|
10223
|
-
return $fae977aafc393c5c$export$4223de14708adc63(this);
|
|
10224
|
-
}
|
|
10225
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
10226
|
-
compare(b) {
|
|
10227
|
-
let res = $14e0f24ef4ac5c92$export$68781ddf31c0090f(this, b);
|
|
10228
|
-
if (res === 0) return $14e0f24ef4ac5c92$export$c19a80a9721b80f6(this, $11d87f3f76e88657$export$b21e0b124e224484(b));
|
|
10229
|
-
return res;
|
|
10230
|
-
}
|
|
10231
|
-
constructor(...args) {
|
|
10232
|
-
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type2, {
|
|
10233
|
-
writable: true,
|
|
10234
|
-
value: void 0
|
|
10235
|
-
});
|
|
10236
|
-
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
10237
|
-
this.calendar = calendar;
|
|
10238
|
-
this.era = era;
|
|
10239
|
-
this.year = year;
|
|
10240
|
-
this.month = month;
|
|
10241
|
-
this.day = day;
|
|
10242
|
-
this.hour = args.shift() || 0;
|
|
10243
|
-
this.minute = args.shift() || 0;
|
|
10244
|
-
this.second = args.shift() || 0;
|
|
10245
|
-
this.millisecond = args.shift() || 0;
|
|
10246
|
-
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
10247
|
-
}
|
|
10248
|
-
}
|
|
10249
|
-
var $35ea8db9cb2ccb90$var$_type3 = /* @__PURE__ */ new WeakMap();
|
|
10250
|
-
class $35ea8db9cb2ccb90$export$d3b7288e7994edea {
|
|
10251
|
-
/** Returns a copy of this date. */
|
|
10252
|
-
copy() {
|
|
10253
|
-
if (this.era) return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
10254
|
-
else return new $35ea8db9cb2ccb90$export$d3b7288e7994edea(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
10255
|
-
}
|
|
10256
|
-
/** Returns a new `ZonedDateTime` with the given duration added to it. */
|
|
10257
|
-
add(duration) {
|
|
10258
|
-
return $735220c2d4774dd3$export$96b1d28349274637(this, duration);
|
|
10259
|
-
}
|
|
10260
|
-
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
|
|
10261
|
-
subtract(duration) {
|
|
10262
|
-
return $735220c2d4774dd3$export$6814caac34ca03c7(this, duration);
|
|
10263
|
-
}
|
|
10264
|
-
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
10265
|
-
set(fields, disambiguation) {
|
|
10266
|
-
return $735220c2d4774dd3$export$31b5430eb18be4f8(this, fields, disambiguation);
|
|
10267
|
-
}
|
|
10268
|
-
/**
|
|
10269
|
-
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
10270
|
-
* When the resulting value reaches the limits of the field, it wraps around.
|
|
10271
|
-
*/
|
|
10272
|
-
cycle(field, amount, options) {
|
|
10273
|
-
return $735220c2d4774dd3$export$9a297d111fc86b79(this, field, amount, options);
|
|
10274
|
-
}
|
|
10275
|
-
/** Converts the date to a native JavaScript Date object. */
|
|
10276
|
-
toDate() {
|
|
10277
|
-
return $11d87f3f76e88657$export$83aac07b4c37b25(this);
|
|
10278
|
-
}
|
|
10279
|
-
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
|
|
10280
|
-
toString() {
|
|
10281
|
-
return $fae977aafc393c5c$export$bf79f1ebf4b18792(this);
|
|
10282
|
-
}
|
|
10283
|
-
/** Converts the date to an ISO 8601 formatted string in UTC. */
|
|
10284
|
-
toAbsoluteString() {
|
|
10285
|
-
return this.toDate().toISOString();
|
|
10286
|
-
}
|
|
10287
|
-
/** Compares this date with another. A negative result indicates that this date is before the given one, and a positive date indicates that it is after. */
|
|
10288
|
-
compare(b) {
|
|
10289
|
-
return this.toDate().getTime() - $11d87f3f76e88657$export$84c95a83c799e074(b, this.timeZone).toDate().getTime();
|
|
10290
|
-
}
|
|
10291
|
-
constructor(...args) {
|
|
10292
|
-
_class_private_field_init(this, $35ea8db9cb2ccb90$var$_type3, {
|
|
10293
|
-
writable: true,
|
|
10294
|
-
value: void 0
|
|
10295
|
-
});
|
|
10296
|
-
let [calendar, era, year, month, day] = $35ea8db9cb2ccb90$var$shiftArgs(args);
|
|
10297
|
-
let timeZone = args.shift();
|
|
10298
|
-
let offset = args.shift();
|
|
10299
|
-
this.calendar = calendar;
|
|
10300
|
-
this.era = era;
|
|
10301
|
-
this.year = year;
|
|
10302
|
-
this.month = month;
|
|
10303
|
-
this.day = day;
|
|
10304
|
-
this.timeZone = timeZone;
|
|
10305
|
-
this.offset = offset;
|
|
10306
|
-
this.hour = args.shift() || 0;
|
|
10307
|
-
this.minute = args.shift() || 0;
|
|
10308
|
-
this.second = args.shift() || 0;
|
|
10309
|
-
this.millisecond = args.shift() || 0;
|
|
10310
|
-
$735220c2d4774dd3$export$c4e2ecac49351ef2(this);
|
|
10311
|
-
}
|
|
10312
|
-
}
|
|
10313
9505
|
const [Provider, useHistory] = createContext("History", {
|
|
10314
9506
|
history: [],
|
|
10315
9507
|
currentLocationIndex: 0,
|
|
@@ -11044,13 +10236,24 @@ const CheckboxInput = forwardRef(
|
|
|
11044
10236
|
}
|
|
11045
10237
|
);
|
|
11046
10238
|
const MemoizedCheckboxInput = memo(CheckboxInput);
|
|
11047
|
-
const DateInput = forwardRef(
|
|
10239
|
+
const DateInput = React.forwardRef(
|
|
11048
10240
|
({ name, required, label, hint, labelAction, type: _type, ...props }, ref2) => {
|
|
11049
10241
|
const { formatMessage } = useIntl();
|
|
11050
10242
|
const field = useField(name);
|
|
11051
10243
|
const fieldRef = useFocusInputField(name);
|
|
11052
10244
|
const composedRefs = useComposedRefs(ref2, fieldRef);
|
|
10245
|
+
const [lastValidDate, setLastValidDate] = React.useState(null);
|
|
11053
10246
|
const value = typeof field.value === "string" ? new Date(field.value) : field.value;
|
|
10247
|
+
const handleDateChange = (date) => {
|
|
10248
|
+
if (!date) {
|
|
10249
|
+
field.onChange(name, null);
|
|
10250
|
+
setLastValidDate(null);
|
|
10251
|
+
return;
|
|
10252
|
+
}
|
|
10253
|
+
const utcDate = toUTCMidnight(date);
|
|
10254
|
+
field.onChange(name, utcDate.toISOString());
|
|
10255
|
+
setLastValidDate(utcDate);
|
|
10256
|
+
};
|
|
11054
10257
|
return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, name, hint, required, children: [
|
|
11055
10258
|
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
|
|
11056
10259
|
/* @__PURE__ */ jsx(
|
|
@@ -11058,11 +10261,18 @@ const DateInput = forwardRef(
|
|
|
11058
10261
|
{
|
|
11059
10262
|
ref: composedRefs,
|
|
11060
10263
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
11061
|
-
onChange:
|
|
11062
|
-
|
|
10264
|
+
onChange: handleDateChange,
|
|
10265
|
+
onClear: () => {
|
|
10266
|
+
field.onChange(name, null);
|
|
10267
|
+
setLastValidDate(null);
|
|
10268
|
+
return;
|
|
11063
10269
|
},
|
|
11064
|
-
|
|
11065
|
-
|
|
10270
|
+
onBlur: () => {
|
|
10271
|
+
if (field.value && !value) {
|
|
10272
|
+
field.onChange(name, lastValidDate?.toISOString() ?? null);
|
|
10273
|
+
}
|
|
10274
|
+
},
|
|
10275
|
+
value,
|
|
11066
10276
|
...props
|
|
11067
10277
|
}
|
|
11068
10278
|
),
|
|
@@ -11071,13 +10281,10 @@ const DateInput = forwardRef(
|
|
|
11071
10281
|
] });
|
|
11072
10282
|
}
|
|
11073
10283
|
);
|
|
11074
|
-
const
|
|
11075
|
-
|
|
11076
|
-
const timeZone = $14e0f24ef4ac5c92$export$aa8b41735afcabd2();
|
|
11077
|
-
const zonedDateTime = $fae977aafc393c5c$export$5adfdab05168c219(utcDateString, timeZone);
|
|
11078
|
-
return $11d87f3f76e88657$export$93522d1a439f3617(zonedDateTime).toDate("UTC");
|
|
10284
|
+
const toUTCMidnight = (date) => {
|
|
10285
|
+
return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
|
11079
10286
|
};
|
|
11080
|
-
const MemoizedDateInput = memo(DateInput);
|
|
10287
|
+
const MemoizedDateInput = React.memo(DateInput);
|
|
11081
10288
|
const DateTimeInput = forwardRef(
|
|
11082
10289
|
({ name, required, label, hint, labelAction, ...props }, ref2) => {
|
|
11083
10290
|
const { formatMessage } = useIntl();
|
|
@@ -11880,4 +11087,4 @@ export {
|
|
|
11880
11087
|
Layouts as L,
|
|
11881
11088
|
useTracking as u
|
|
11882
11089
|
};
|
|
11883
|
-
//# sourceMappingURL=index-
|
|
11090
|
+
//# sourceMappingURL=index-CMdgTmC0-Dku5eOkP.mjs.map
|