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