temporal-polyfill-lite 1.0.0 → 1.0.2
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/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/dist/calendars/index.js +1 -1
- package/dist/calendars/shim.js +1 -1
- package/dist/calendars/{src-CLej0F_-.js → src-JimFtBws.js} +151 -180
- package/dist/index.js +1 -1
- package/dist/shim.js +1 -1
- package/dist/{src-DYpWRzuf.js → src-DIR5AiIq.js} +36 -46
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 1.0.2 (2026-11-15)
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- Preserve the names of class expressions for Temporal and Intl classes during the build process, instead of setting the names manually ([#53](https://github.com/fabon-f/temporal-polyfill-lite/pull/53)).
|
|
13
|
+
- This is not a breaking change for most users, but it may affect a small number of users who minify the polyfill and depend on the `name` property of Temporal classes or `Intl.DurationFormat`.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- Fall back to UTC when the system time zone cannot be retrieved ([#55](https://github.com/fabon-f/temporal-polyfill-lite/pull/55)).
|
|
18
|
+
|
|
19
|
+
## 1.0.1 (2026-11-09)
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- Improve performance of `Temporal.ZonedDateTime.prototype.getTimeZoneTransition` when the `ZonedDateTime` represents a recent date ([#48](https://github.com/fabon-f/temporal-polyfill-lite/pull/48))
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- Reject the `Canada/East-Saskatchewan` time zone ID, which was removed from the IANA Time Zone Database, during `Temporal.ZonedDateTime` construction ([#49](https://github.com/fabon-f/temporal-polyfill-lite/pull/49))
|
|
28
|
+
|
|
8
29
|
## 1.0.0 (2026-10-21)
|
|
9
30
|
|
|
10
31
|
### Changed
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Lightweight Temporal polyfill.
|
|
6
6
|
|
|
7
7
|
- **Small**: The bundle size is nearly 10% smaller than [temporal-polyfill](https://www.npmjs.com/package/temporal-polyfill), 60% smaller than [@js-temporal/polyfill](https://www.npmjs.com/package/@js-temporal/polyfill) if you need only Gregorian calendar (see [comparison](https://github.com/fabon-f/temporal-polyfill-comparison) for details).
|
|
8
|
-
- **Spec-compliant**: It supports the latest spec
|
|
8
|
+
- **Spec-compliant**: It supports the latest spec.
|
|
9
9
|
|
|
10
10
|
# Usage
|
|
11
11
|
|
package/dist/calendars/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as Intl, t as Temporal, i as toTemporalInstant } from "./src-
|
|
1
|
+
export { r as Intl, t as Temporal, i as toTemporalInstant } from "./src-JimFtBws.js";
|
package/dist/calendars/shim.js
CHANGED
|
@@ -4,5 +4,5 @@ function install(s) {
|
|
|
4
4
|
function setSystemTimeZoneIdCacheTtl(t) {
|
|
5
5
|
s(t);
|
|
6
6
|
}
|
|
7
|
-
import { a as t, i as a, n as s, r as e, t as l } from "./src-
|
|
7
|
+
import { a as t, i as a, n as s, r as e, t as l } from "./src-JimFtBws.js";
|
|
8
8
|
export { install, setSystemTimeZoneIdCacheTtl };
|
|
@@ -19,9 +19,6 @@ function defineStringTag(e, t) {
|
|
|
19
19
|
configurable: !0
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function renameFunction(e, t) {
|
|
23
|
-
Object.defineProperty(e, "name", { value: t });
|
|
24
|
-
}
|
|
25
22
|
function getNameFromUnit(e) {
|
|
26
23
|
return v[e];
|
|
27
24
|
}
|
|
@@ -191,8 +188,8 @@ function divideTimeDurationToFloatingPoint(e, t) {
|
|
|
191
188
|
function interpretISODateTimeOffset(e, t, o, n, r, a, i, c) {
|
|
192
189
|
if (!t) return getStartOfDay(r, e);
|
|
193
190
|
const s = combineIsoDateAndTimeRecord(e, t);
|
|
194
|
-
if (o === ne || o === te && "ignore"
|
|
195
|
-
if (o === oe || o === te && "use"
|
|
191
|
+
if (o === ne || o === te && "ignore" === i) return getEpochNanosecondsFor(r, s, a);
|
|
192
|
+
if (o === oe || o === te && "use" === i) return validateEpochNanoseconds(getUtcEpochNanoseconds(balanceIsoDateTime(s.o.t, s.o.u, s.o.T, s.p.D, s.p.I, s.p.O, s.p.F, s.p.S, s.p.$ - n)));
|
|
196
193
|
((e) => {
|
|
197
194
|
Math.abs(isoDateToEpochDays(e.t, e.u - 1, e.T)) > 1e8 && throwRangeError(P);
|
|
198
195
|
})(e);
|
|
@@ -350,7 +347,7 @@ function getNamedTimeZoneOffsetNanosecondsForEpochSecond(t, o, n) {
|
|
|
350
347
|
return n || a.B(r, s), s;
|
|
351
348
|
}
|
|
352
349
|
function getFormatterForTimeZone(e) {
|
|
353
|
-
return Re[e] ||=
|
|
350
|
+
return Re[e] ||= Zt("en-u-hc-h23", {
|
|
354
351
|
timeZone: e,
|
|
355
352
|
year: "numeric",
|
|
356
353
|
month: "numeric",
|
|
@@ -369,17 +366,17 @@ function bisectOffsetTransition(e, t, o) {
|
|
|
369
366
|
}
|
|
370
367
|
return a;
|
|
371
368
|
}
|
|
372
|
-
function
|
|
373
|
-
return e < -85e7 ?
|
|
369
|
+
function windowDaysForEpoch(e) {
|
|
370
|
+
return e < -85e7 ? 21 : isWithin(e, -77e7, 96e7) ? 16 : isWithin(e, 129e7, 179e7) ? 27 : 6.5;
|
|
374
371
|
}
|
|
375
|
-
function searchTimeZoneTransition(e, t, o,
|
|
372
|
+
function searchTimeZoneTransition(e, t, o, r) {
|
|
376
373
|
o = clamp(o, -864e10, 864e10);
|
|
377
|
-
for (let
|
|
374
|
+
for (let a = 172800 * r, i = t, c = t + a; (o - c) * r > 0; a = windowDaysForEpoch(i) * n * r, i = c, c = clamp(c + a, -864e10, 864e10)) if (getNamedTimeZoneOffsetNanosecondsForEpochSecond(e, i, !0) !== getNamedTimeZoneOffsetNanosecondsForEpochSecond(e, c, !0)) return createEpochNanosecondsFromEpochSeconds(r > 0 ? bisectOffsetTransition(e, i, c) : bisectOffsetTransition(e, c, i));
|
|
378
375
|
return null;
|
|
379
376
|
}
|
|
380
377
|
function getAvailableNamedTimeZoneIdentifier(e) {
|
|
381
378
|
return ((e) => {
|
|
382
|
-
/^(?![cemw]et|[emh]st|prc|ro[ck]|uct|utc|gmt)
|
|
379
|
+
/^(?![cemw]et|[emh]st|prc|ro[ck]|uct|utc|gmt)...$|systemv|^u.*w$|^c.*-/i.test(e) && throwRangeError(invalidTimeZone(e));
|
|
383
380
|
})(e = asciiLowerCase(e).replace(/[^/]+/g, (e) => /^(?!etc|yap).{1,3}$|\d/.test(e) ? asciiUpperCase(e) : e.replace(/baja|mc|comod|[a-z]+/g, (e) => {
|
|
384
381
|
return /^(su|gb|nz|in|chat)$/.test(e) ? asciiUpperCase(e) : /^(of|au|es)$/.test(e) ? e : (t = e, t.replace(/^[a-z]/, (e) => e.toUpperCase())).replace(/du(?=r)|n(?=or)|i(?=slan)/, asciiUpperCase);
|
|
385
382
|
var t;
|
|
@@ -604,8 +601,8 @@ function balanceTime(e, t, o, n, r, a) {
|
|
|
604
601
|
X: divFloor(e, 24)
|
|
605
602
|
};
|
|
606
603
|
}
|
|
607
|
-
function createTemporalTime(e, t = Object.create(
|
|
608
|
-
return
|
|
604
|
+
function createTemporalTime(e, t = Object.create(Ce.prototype)) {
|
|
605
|
+
return Ye.set(t, e), t;
|
|
609
606
|
}
|
|
610
607
|
function toTemporalTimeRecord(e, t = !1) {
|
|
611
608
|
const o = [
|
|
@@ -647,10 +644,10 @@ function addDurationToTime(e, t, o) {
|
|
|
647
644
|
return createTemporalTime(addTime(t, toInternalDurationRecord(applySignToDurationSlot(toTemporalDuration(o), e)).p));
|
|
648
645
|
}
|
|
649
646
|
function getInternalSlotOrThrowForPlainTime(e) {
|
|
650
|
-
return getInternalSlotOrThrow(
|
|
647
|
+
return getInternalSlotOrThrow(Ye, e);
|
|
651
648
|
}
|
|
652
649
|
function isPlainTime(e) {
|
|
653
|
-
return
|
|
650
|
+
return Ye.has(e);
|
|
654
651
|
}
|
|
655
652
|
function optionalChain(e) {
|
|
656
653
|
return e.reduceRight((e, t) => `${t}(?:${e})?`);
|
|
@@ -927,7 +924,7 @@ function calendarDateForPlainDate(e) {
|
|
|
927
924
|
return calendarIsoToDate(t.Y, t.o);
|
|
928
925
|
}
|
|
929
926
|
function formatToParts(e, t) {
|
|
930
|
-
return (pt[e] ||=
|
|
927
|
+
return (pt[e] ||= Zt("en", {
|
|
931
928
|
year: "numeric",
|
|
932
929
|
month: "numeric",
|
|
933
930
|
day: "numeric",
|
|
@@ -1003,8 +1000,7 @@ function epochDaysToDate$6(e, t) {
|
|
|
1003
1000
|
},
|
|
1004
1001
|
ae: isoDayOfWeek(epochDaysToIsoDate(t)),
|
|
1005
1002
|
get ie() {
|
|
1006
|
-
|
|
1007
|
-
return t - getNewYear(e, o) + 1;
|
|
1003
|
+
return t - getNewYear(e, yearMonthDay(e, t).t) + 1;
|
|
1008
1004
|
},
|
|
1009
1005
|
ce: {
|
|
1010
1006
|
se: void 0,
|
|
@@ -1028,7 +1024,7 @@ function epochDaysToDate$6(e, t) {
|
|
|
1028
1024
|
};
|
|
1029
1025
|
}
|
|
1030
1026
|
function epoch$1(e) {
|
|
1031
|
-
return "coptic" === e ? -615924 : "
|
|
1027
|
+
return "coptic" === e ? -615924 : "ethiopic" === e ? -716733 : -2725608;
|
|
1032
1028
|
}
|
|
1033
1029
|
function mathematicalInLeapYear$2(e) {
|
|
1034
1030
|
return +!((e + 1) % 4);
|
|
@@ -1076,13 +1072,13 @@ function isLeapYear$1(e) {
|
|
|
1076
1072
|
return modFloor(11 * (e + 4), 30) < 11;
|
|
1077
1073
|
}
|
|
1078
1074
|
function daysInMonth$2(e, t) {
|
|
1079
|
-
return 12 === t
|
|
1075
|
+
return 12 === t && isLeapYear$1(e) ? 30 : 29 + t % 2;
|
|
1080
1076
|
}
|
|
1081
1077
|
function calendarIntegersToEpochDays$2(e, t, o, n) {
|
|
1082
|
-
return epoch(e) + 354 * (t - 1) + divFloor(11 * (t + 3), 30)
|
|
1078
|
+
return epoch(e) + 354 * (t - 1) + divFloor(11 * (t + 3), 30) + Math.ceil(29.5 * (o - 1)) + n - 2;
|
|
1083
1079
|
}
|
|
1084
1080
|
function epochDaysToDate$2(e, t) {
|
|
1085
|
-
const o = divFloor(30 * (t - epoch(e)
|
|
1081
|
+
const o = divFloor(30 * (t - epoch(e)) + 15, 10631) + 1;
|
|
1086
1082
|
let n = 12;
|
|
1087
1083
|
for (; calendarIntegersToEpochDays$2(e, o, n, 1) > t; n--);
|
|
1088
1084
|
return {
|
|
@@ -1110,7 +1106,7 @@ function getYearMonthDay(e) {
|
|
|
1110
1106
|
}
|
|
1111
1107
|
function getFirstDayOfMonth(e, t) {
|
|
1112
1108
|
const o = balanceIsoYearMonth(e, t), n = calendarIntegersToEpochDays$2("islamic-civil", o.t, o.u, 1);
|
|
1113
|
-
return isWithin(
|
|
1109
|
+
return isWithin(e, 1300, 1600) ? n + 6 - getYearMonthDay(n + 5).T : n;
|
|
1114
1110
|
}
|
|
1115
1111
|
function calendarIntegersToEpochDays$1(e, t, o) {
|
|
1116
1112
|
return getFirstDayOfMonth(e, t) + o - 1;
|
|
@@ -1204,7 +1200,7 @@ function calendarDateUntil(e, t, o, n) {
|
|
|
1204
1200
|
return createDateDurationRecord(m, u, 0, isoDateRecordToEpochDays(o) - isoDateRecordToEpochDays(calendarIntegersToIso(e, h.t, h.u, constrainDay(e, h.t, h.u, a.T, _))));
|
|
1205
1201
|
}
|
|
1206
1202
|
function calendarDateToIso(e, t, o) {
|
|
1207
|
-
const n = t[wt.t], r = t[wt.u], a =
|
|
1203
|
+
const n = t[wt.t], r = t[wt.u], a = t[wt.v], i = t[wt.T];
|
|
1208
1204
|
if (isIsoLikeCalendar(e)) return ((e, t) => regulateIsoDate(e[wt.t], e[wt.u], e[wt.T], t))({
|
|
1209
1205
|
...t,
|
|
1210
1206
|
year: n + ("buddhist" === e ? -543 : "roc" === e ? 1911 : 0)
|
|
@@ -1265,27 +1261,27 @@ function nonIsoCalendarIsoToDate(e, t) {
|
|
|
1265
1261
|
Te: !!mathematicalInLeapYear$2(o)
|
|
1266
1262
|
};
|
|
1267
1263
|
})(e, o) : "indian" === e ? ((e) => {
|
|
1268
|
-
const t = epochDaysToIsoDate(e), o = firstDayOfYear(t
|
|
1269
|
-
let
|
|
1270
|
-
for (; calendarIntegersToEpochDays$3(o,
|
|
1264
|
+
const t = epochDaysToIsoDate(e).t, o = firstDayOfYear(t - 78) <= e ? t - 78 : t - 79;
|
|
1265
|
+
let n = 12;
|
|
1266
|
+
for (; calendarIntegersToEpochDays$3(o, n, 1) > e; n--);
|
|
1271
1267
|
return {
|
|
1272
1268
|
ne: "shaka",
|
|
1273
1269
|
re: o,
|
|
1274
1270
|
t: o,
|
|
1275
|
-
u:
|
|
1276
|
-
v: createMonthCode(
|
|
1277
|
-
T: e - calendarIntegersToEpochDays$3(o,
|
|
1278
|
-
ae: isoDayOfWeek(
|
|
1271
|
+
u: n,
|
|
1272
|
+
v: createMonthCode(n),
|
|
1273
|
+
T: e - calendarIntegersToEpochDays$3(o, n, 1) + 1,
|
|
1274
|
+
ae: isoDayOfWeek(epochDaysToIsoDate(e)),
|
|
1279
1275
|
ie: e - firstDayOfYear(o) + 1,
|
|
1280
1276
|
ce: {
|
|
1281
1277
|
se: void 0,
|
|
1282
1278
|
t: void 0
|
|
1283
1279
|
},
|
|
1284
1280
|
le: 7,
|
|
1285
|
-
de: daysInMonth$3(o,
|
|
1286
|
-
me: 365 +
|
|
1281
|
+
de: daysInMonth$3(o, n),
|
|
1282
|
+
me: 365 + mathematicalInLeapYear$1(o),
|
|
1287
1283
|
ue: 12,
|
|
1288
|
-
Te: !!
|
|
1284
|
+
Te: !!mathematicalInLeapYear$1(o)
|
|
1289
1285
|
};
|
|
1290
1286
|
})(o) : "persian" === e ? ((e) => ({
|
|
1291
1287
|
ne: "ap",
|
|
@@ -1318,55 +1314,52 @@ function nonIsoCalendarIsoToDate(e, t) {
|
|
|
1318
1314
|
return daysInMonth(t.t, t.u);
|
|
1319
1315
|
},
|
|
1320
1316
|
get me() {
|
|
1321
|
-
return isLeapYear(getDate(e).t)
|
|
1317
|
+
return +isLeapYear(getDate(e).t) + 365;
|
|
1322
1318
|
},
|
|
1323
1319
|
ue: 12,
|
|
1324
1320
|
get Te() {
|
|
1325
1321
|
return isLeapYear(getDate(e).t);
|
|
1326
1322
|
}
|
|
1327
|
-
}))(o) : isChineseDangi(e) ? epochDaysToDate$6(e, o) : "islamic-umalqura" === e ? ((e) => {
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
}
|
|
1368
|
-
};
|
|
1369
|
-
})(o) : "hebrew" === e ? ((e) => {
|
|
1323
|
+
}))(o) : isChineseDangi(e) ? epochDaysToDate$6(e, o) : "islamic-umalqura" === e ? ((e) => isWithin(e, -32e3, 75e3) ? {
|
|
1324
|
+
ne: "ah",
|
|
1325
|
+
get re() {
|
|
1326
|
+
return getYearMonthDay(e).t;
|
|
1327
|
+
},
|
|
1328
|
+
get t() {
|
|
1329
|
+
return getYearMonthDay(e).t;
|
|
1330
|
+
},
|
|
1331
|
+
get u() {
|
|
1332
|
+
return getYearMonthDay(e).u;
|
|
1333
|
+
},
|
|
1334
|
+
get v() {
|
|
1335
|
+
return createMonthCode(getYearMonthDay(e).u);
|
|
1336
|
+
},
|
|
1337
|
+
get T() {
|
|
1338
|
+
return getYearMonthDay(e).T;
|
|
1339
|
+
},
|
|
1340
|
+
ae: isoDayOfWeek(epochDaysToIsoDate(e)),
|
|
1341
|
+
get ie() {
|
|
1342
|
+
return e - getFirstDayOfMonth(getYearMonthDay(e).t, 1) + 1;
|
|
1343
|
+
},
|
|
1344
|
+
ce: {
|
|
1345
|
+
se: void 0,
|
|
1346
|
+
t: void 0
|
|
1347
|
+
},
|
|
1348
|
+
le: 7,
|
|
1349
|
+
get de() {
|
|
1350
|
+
const t = getYearMonthDay(e);
|
|
1351
|
+
return getFirstDayOfMonth(t.t, t.u + 1) - getFirstDayOfMonth(t.t, t.u);
|
|
1352
|
+
},
|
|
1353
|
+
get me() {
|
|
1354
|
+
const t = getYearMonthDay(e).t;
|
|
1355
|
+
return getFirstDayOfMonth(t + 1, 1) - getFirstDayOfMonth(t, 1);
|
|
1356
|
+
},
|
|
1357
|
+
ue: 12,
|
|
1358
|
+
get Te() {
|
|
1359
|
+
const t = getYearMonthDay(e).t;
|
|
1360
|
+
return getFirstDayOfMonth(t + 1, 1) - getFirstDayOfMonth(t, 1) > 354;
|
|
1361
|
+
}
|
|
1362
|
+
} : epochDaysToDate$2("islamic-civil", e))(o) : "hebrew" === e ? ((e) => {
|
|
1370
1363
|
const t = epochDaysToIsoDate(e);
|
|
1371
1364
|
let o = divFloor(e + 2092590, 365.2468222) + 2;
|
|
1372
1365
|
for (; calendarIntegersToEpochDays$4(o, 1, 1) > e; o--);
|
|
@@ -1401,11 +1394,8 @@ function canonicalizeEraInCalendar(e, t) {
|
|
|
1401
1394
|
return yt[e].has(o) ? o : throwRangeError(((e) => `invalid era: ${e}`)(t));
|
|
1402
1395
|
}
|
|
1403
1396
|
function constrainMonthCode(e, t, o, n) {
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
return o !== r && "reject" === n ? throwRangeError(b) : r;
|
|
1407
|
-
}
|
|
1408
|
-
return "hebrew" === e && o[1] && !isLeapYear$2(t) ? "reject" === n ? throwRangeError(b) : [6, !1] : o;
|
|
1397
|
+
const r = isChineseDangi(e) ? ((e, t, o) => o[1] && ordinalMonthToMonthCode(e, t, o[0] + 1) !== createMonthCode(...o) ? [o[0], !1] : o)(e, t, o) : "hebrew" === e && o[1] && !isLeapYear$2(t) ? [6, !1] : o;
|
|
1398
|
+
return o !== r && "reject" === n && throwRangeError(b), r;
|
|
1409
1399
|
}
|
|
1410
1400
|
function monthCodeToOrdinal(e, t, o) {
|
|
1411
1401
|
return "hebrew" === e ? ((e, t) => t[0] + +(isLeapYear$2(e) && t[0] + +t[1] >= 6))(t, o) : isChineseDangi(e) ? ((e, t, o) => o[1] || ordinalMonthToMonthCode(e, t, o[0]) !== createMonthCode(...o) ? o[0] + 1 : o[0])(e, t, o) : o[0];
|
|
@@ -1434,14 +1424,13 @@ function constrainMonth(e, t, o, n) {
|
|
|
1434
1424
|
return r !== o && "reject" === n && throwRangeError(b), r;
|
|
1435
1425
|
}
|
|
1436
1426
|
function balanceNonIsoYearMonth(e, t, o) {
|
|
1437
|
-
|
|
1427
|
+
return "hebrew" === e ? ((e, t) => {
|
|
1438
1428
|
const o = monthNumber(e, 1) + t - 1, n = Math.floor((19 * (o - 1) + 17) / 235) + 1;
|
|
1439
1429
|
return {
|
|
1440
1430
|
t: n,
|
|
1441
1431
|
u: o - monthNumber(n, 1) + 1
|
|
1442
1432
|
};
|
|
1443
|
-
})(t, o)
|
|
1444
|
-
if (isChineseDangi(e)) return ((e, t, o) => {
|
|
1433
|
+
})(t, o) : isChineseDangi(e) ? ((e, t, o) => {
|
|
1445
1434
|
if (isWithin(o, 1, 12)) return {
|
|
1446
1435
|
t,
|
|
1447
1436
|
u: o
|
|
@@ -1457,11 +1446,9 @@ function balanceNonIsoYearMonth(e, t, o) {
|
|
|
1457
1446
|
t: i.t,
|
|
1458
1447
|
u: i.u
|
|
1459
1448
|
};
|
|
1460
|
-
})(e, t, o)
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
t: t + divFloor(o - 1, n),
|
|
1464
|
-
u: modFloor(o - 1, n) + 1
|
|
1449
|
+
})(e, t, o) : {
|
|
1450
|
+
t: t + divFloor(o - 1, +isCopticOrEthiopic(e) + 12),
|
|
1451
|
+
u: modFloor(o - 1, +isCopticOrEthiopic(e) + 12) + 1
|
|
1465
1452
|
};
|
|
1466
1453
|
}
|
|
1467
1454
|
function parseMonthCode(e) {
|
|
@@ -1528,36 +1515,16 @@ function calendarMonthDayFromFields(e, t, o) {
|
|
|
1528
1515
|
year: mapUnlessUndefined(t.year, (t) => t + ("buddhist" === e ? -543 : "roc" === e ? 1911 : 0))
|
|
1529
1516
|
}, o, "iso8601" === e);
|
|
1530
1517
|
const n = t[wt.t];
|
|
1531
|
-
let r = t[wt.u], a =
|
|
1518
|
+
let r = t[wt.u], a = t[wt.v], i = t[wt.T];
|
|
1532
1519
|
return void 0 !== n ? (a || (r = constrainMonth(e, n, r, o)), a = a ? constrainMonthCode(e, n, a, o) : parseMonthCode(nonIsoCalendarIsoToDate(e, calendarIntegersToIso(e, n, r, 1)).v), i = constrainDay(e, n, r, i, o), validateIsoDate(calendarIntegersToIso(e, n, r, i))) : i = ((e, t, o, n) => {
|
|
1533
1520
|
if (isChineseDangi(e) || "islamic-umalqura" === e || "persian" === e) {
|
|
1534
1521
|
const r = clamp(o, 1, "persian" === e && t[0] <= 6 ? 31 : 30);
|
|
1535
1522
|
return o !== r && "reject" === n ? throwRangeError(b) : r;
|
|
1536
1523
|
}
|
|
1537
|
-
return "hebrew" === e ? t[1] ? constrainDay(e, 3, 6, o, n) : constrainDay(e, 1, t[0], o, n) : constrainDay(e, isCopticOrEthiopic(e)
|
|
1538
|
-
})(e, a, i, o), isChineseDangi(e)
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
}
|
|
1542
|
-
const o = calendarIntegersToEpochDays(1351, e, t);
|
|
1543
|
-
return o <= 1095 ? o : calendarIntegersToEpochDays(1350, e, t);
|
|
1544
|
-
})(a[0], i)) : "islamic-umalqura" === e ? epochDaysToIsoDate(((e, t) => {
|
|
1545
|
-
for (let o = 1392;; o--) if (constrainDay$2(o, e, t) === t) {
|
|
1546
|
-
const n = calendarIntegersToEpochDays$1(o, e, t);
|
|
1547
|
-
if (n <= 1095) return n;
|
|
1548
|
-
}
|
|
1549
|
-
})(a[0], i)) : "hebrew" === e ? epochDaysToIsoDate(((e, t, o) => {
|
|
1550
|
-
if (t) return calendarIntegersToEpochDays$4(5730, 6, o);
|
|
1551
|
-
if ((2 === e || 3 === e) && 30 === o) return calendarIntegersToEpochDays$4(5732, e, o);
|
|
1552
|
-
const n = calendarIntegersToEpochDays$4(5733, e, o);
|
|
1553
|
-
return n <= 1095 ? n : calendarIntegersToEpochDays$4(5732, e, o);
|
|
1554
|
-
})(a[0], a[1], i)) : isChineseDangi(e) ? epochDaysToIsoDate(((e, t, o, n) => {
|
|
1555
|
-
const r = o || 30 === n && (6 === t || 8 === t) || 12 === t ? t + 1 : t;
|
|
1556
|
-
if (11 === t && !o) {
|
|
1557
|
-
const t = calendarIntegersToEpochDays$6(e, 30 === n ? 1969 : 1972, 11, n);
|
|
1558
|
-
return t <= 1095 ? t : calendarIntegersToEpochDays$6(e, 1971, 12, n);
|
|
1559
|
-
}
|
|
1560
|
-
return calendarIntegersToEpochDays$6(e, ((e, t, o, n) => 12 === t ? 1971 : !o && (n < 30 || 2 === t || 5 === t || 7 === t || 9 === t || 10 === t) ? 1972 : o ? [
|
|
1524
|
+
return "hebrew" === e ? t[1] ? constrainDay(e, 3, 6, o, n) : constrainDay(e, 1, t[0], o, n) : constrainDay(e, +isCopticOrEthiopic(e) + 2, t[0], o, n);
|
|
1525
|
+
})(e, a, i, o), isChineseDangi(e) ? epochDaysToIsoDate(((e, t, o, n, r) => {
|
|
1526
|
+
o && (1 === t || 12 === t || 30 === n && !isWithin(t, 3, 7)) && ("reject" === r && throwRangeError(b), o = !1);
|
|
1527
|
+
const a = ((e, t, o, n) => o ? [
|
|
1561
1528
|
1947,
|
|
1562
1529
|
30 === n ? 1955 : 1966,
|
|
1563
1530
|
30 === n ? 1944 : 1963,
|
|
@@ -1568,8 +1535,24 @@ function calendarMonthDayFromFields(e, t, o) {
|
|
|
1568
1535
|
2014,
|
|
1569
1536
|
1984,
|
|
1570
1537
|
2033
|
|
1571
|
-
][t - 2] :
|
|
1572
|
-
|
|
1538
|
+
][t - 2] : n < 30 ? 30 * t + n > 356 ? 1971 : 1972 : [
|
|
1539
|
+
1970,
|
|
1540
|
+
1972,
|
|
1541
|
+
"chinese" === e ? 1966 : 1968,
|
|
1542
|
+
1970,
|
|
1543
|
+
1972,
|
|
1544
|
+
1971,
|
|
1545
|
+
1972,
|
|
1546
|
+
1971,
|
|
1547
|
+
1972,
|
|
1548
|
+
1972,
|
|
1549
|
+
1969,
|
|
1550
|
+
1971
|
|
1551
|
+
][t - 1])(e, t, o, n);
|
|
1552
|
+
return calendarIntegersToEpochDays$6(e, a, o || 1971 === a ? t + 1 : t, n);
|
|
1553
|
+
})(e, a[0], a[1], i, o)) : isCopticOrEthiopic(e) ? epochDaysToIsoDate(((e, t) => 13 === e && 6 === t ? 618 : (30 * (e - 1) + t + 252) % 365 + 731)(a[0], i)) : epochDaysToIsoDate("indian" === e ? ((e, t) => calendarIntegersToEpochDays$3(30 * e + t <= 310 ? 1894 : 1893, e, t))(a[0], i) : "persian" === e ? ((e, t) => calendarIntegersToEpochDays(+(31 * e + t < 321) + 1350, e, t))(a[0], i) : "islamic-umalqura" === e ? ((e, t) => {
|
|
1554
|
+
for (let o = +(30 * e + t < 356) + 1391;; o--) if (constrainDay$2(o, e, t) === t) return calendarIntegersToEpochDays$1(o, e, t);
|
|
1555
|
+
})(a[0], i) : "hebrew" === e ? ((e, t, o) => t ? calendarIntegersToEpochDays$4(5730, 6, o) : calendarIntegersToEpochDays$4((2 !== e && 3 !== e || 30 !== o) && 30 * e + o < 147 ? 5733 : 5732, e, o))(a[0], a[1], i) : ((e, t, o) => calendarIntegersToEpochDays$2(e, 12 === t && 30 === o ? 1390 : +(30 * t + o < 357 - ("islamic-civil" === e)) + 1391, t, o))(e, a[0], i));
|
|
1573
1556
|
})(e, t, o);
|
|
1574
1557
|
}
|
|
1575
1558
|
function formatCalendarAnnotation(e, t) {
|
|
@@ -1627,31 +1610,19 @@ function calendarExtraFields(e, t) {
|
|
|
1627
1610
|
return calendarSupportsEra(e) && t.includes("year") ? ["era", "eraYear"] : [];
|
|
1628
1611
|
}
|
|
1629
1612
|
function isoResolveFields(e, t) {
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
o && ((o[0] > 12 || o[1] || void 0 !== e[wt.u] && o[0] !== e[wt.u]) && throwRangeError(C), e[wt.u] = o[0]);
|
|
1613
|
+
const o = e[wt.v];
|
|
1614
|
+
t !== q && void 0 === e[wt.t] && throwTypeError(missingField(wt.t)), t !== H && void 0 === e[wt.T] && throwTypeError(missingField(wt.T)), void 0 === o && void 0 === e[wt.u] && throwTypeError(missingField("month, monthCode")), o && ((o[0] > 12 || o[1] || void 0 !== e[wt.u] && o[0] !== e[wt.u]) && throwRangeError(Y), e[wt.u] = o[0]);
|
|
1633
1615
|
}
|
|
1634
1616
|
function calendarResolveFields(e, t, o = z) {
|
|
1635
1617
|
"iso8601" === e ? isoResolveFields(t, o) : (function(e, t, o = z) {
|
|
1636
|
-
const n = t[wt.ne], r = t[wt.re];
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
const n = yt[e].get(canonicalizeEraInCalendar(e, t));
|
|
1642
|
-
return !1 === n ? 1 - o : n + o - 1;
|
|
1643
|
-
})(e, canonicalizeEraInCalendar(e, n), r);
|
|
1644
|
-
void 0 !== a && a !== o && throwRangeError("mismatch of `year`, `era` and `eraYear`"), t[wt.t] = o;
|
|
1645
|
-
}
|
|
1646
|
-
if (t[wt.ne] = t[wt.re] = void 0, isIsoLikeCalendar(e)) isoResolveFields(t, o);
|
|
1618
|
+
const n = t[wt.ne], r = t[wt.re], a = t[wt.t], i = t[wt.v], c = t[wt.u], s = t[wt.T];
|
|
1619
|
+
if (o === q && void 0 !== i && void 0 === c || void 0 !== a || calendarSupportsEraForNonIsoCalendars(e) && void 0 !== n && void 0 !== r || throwTypeError(missingField("year, era, eraYear")), calendarSupportsEraForNonIsoCalendars(e) && void 0 === n != (void 0 === r) && throwTypeError(), o !== H && void 0 === s && throwTypeError(missingField("day")), c === i && throwTypeError(missingField("month, monthCode")), calendarSupportsEraForNonIsoCalendars(e) && void 0 !== r && (t[wt.t] = ((e, t, o) => {
|
|
1620
|
+
const n = yt[e].get(canonicalizeEraInCalendar(e, t));
|
|
1621
|
+
return !1 === n ? 1 - o : n + o - 1;
|
|
1622
|
+
})(e, canonicalizeEraInCalendar(e, n), r), void 0 !== a && a !== t[wt.t] && throwRangeError("mismatch of `year`, `era` and `eraYear`")), t[wt.ne] = t[wt.re] = void 0, isIsoLikeCalendar(e)) isoResolveFields(t, o);
|
|
1647
1623
|
else if (i) {
|
|
1648
|
-
const o =
|
|
1649
|
-
((e, t) => isWithin(t[0], 1, 12) && !t[1] || isChineseDangi(e) && isWithin(t[0], 1, 12) || isCopticOrEthiopic(e) && 13 === t[0] && !t[1] || "hebrew" === e && 5 === t[0] && t[1])(e,
|
|
1650
|
-
const n = t[wt.t];
|
|
1651
|
-
if (void 0 !== n) {
|
|
1652
|
-
const r = monthCodeToOrdinal(e, n, constrainMonthCode(e, n, o, _));
|
|
1653
|
-
void 0 !== c && c !== r && throwRangeError(C), t[wt.u] = r;
|
|
1654
|
-
}
|
|
1624
|
+
const o = t[wt.t];
|
|
1625
|
+
((e, t) => isWithin(t[0], 1, 12) && !t[1] || isChineseDangi(e) && isWithin(t[0], 1, 12) || isCopticOrEthiopic(e) && 13 === t[0] && !t[1] || "hebrew" === e && 5 === t[0] && t[1])(e, i) || throwRangeError(invalidMonthCode(createMonthCode(...i))), void 0 !== o && (t[wt.u] = monthCodeToOrdinal(e, o, constrainMonthCode(e, o, i, _)), void 0 !== c && c !== t[wt.u] && throwRangeError(Y));
|
|
1655
1626
|
}
|
|
1656
1627
|
})(e, t, o);
|
|
1657
1628
|
}
|
|
@@ -2076,7 +2047,7 @@ function isoDateToFields(e, t, o) {
|
|
|
2076
2047
|
const n = calendarIsoToDate(e, t);
|
|
2077
2048
|
return createNullPrototypeObject({
|
|
2078
2049
|
[wt.t]: o === q ? void 0 : n.t,
|
|
2079
|
-
[wt.v]: n.v,
|
|
2050
|
+
[wt.v]: parseMonthCode(n.v),
|
|
2080
2051
|
[wt.T]: o === H ? void 0 : n.T
|
|
2081
2052
|
});
|
|
2082
2053
|
}
|
|
@@ -2127,19 +2098,19 @@ function dateStyleToMonthStyle(e) {
|
|
|
2127
2098
|
}
|
|
2128
2099
|
function amendOptionsForPlainDate(e) {
|
|
2129
2100
|
const t = createNullPrototypeObject(e);
|
|
2130
|
-
return hasAnyOptions(e,
|
|
2101
|
+
return hasAnyOptions(e, Yt) || (hasAnyOptions(e, Ct) && throwTypeError(N), t.year = t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [...Ct, "timeZoneName"]), t.timeZone = "UTC", t;
|
|
2131
2102
|
}
|
|
2132
2103
|
function amendOptionsForPlainTime(e) {
|
|
2133
2104
|
const t = createNullPrototypeObject(e);
|
|
2134
|
-
return hasAnyOptions(e,
|
|
2135
|
-
...
|
|
2105
|
+
return hasAnyOptions(e, Ct) || (hasAnyOptions(e, Yt) && throwTypeError(N), t.hour = t.minute = t.second = "numeric"), "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric"), removeDateTimeFormatOptions(t, [
|
|
2106
|
+
...Yt,
|
|
2136
2107
|
"era",
|
|
2137
2108
|
"timeZoneName"
|
|
2138
2109
|
]), t.timeZone = "UTC", t;
|
|
2139
2110
|
}
|
|
2140
2111
|
function amendOptionsForPlainDateTime(e) {
|
|
2141
2112
|
const t = createNullPrototypeObject(e);
|
|
2142
|
-
return "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric", e.dateStyle && (removeDateTimeFormatOptions(t, ["dateStyle"]), t.year = t.day = "numeric", t.month = dateStyleToMonthStyle(e.dateStyle), t.weekday = "full" === e.dateStyle ? "long" : void 0)), hasAnyOptions(e, [...
|
|
2113
|
+
return "long" !== e.timeStyle && "full" !== e.timeStyle || (removeDateTimeFormatOptions(t, ["timeStyle"]), t.hour = t.minute = t.second = "numeric", e.dateStyle && (removeDateTimeFormatOptions(t, ["dateStyle"]), t.year = t.day = "numeric", t.month = dateStyleToMonthStyle(e.dateStyle), t.weekday = "full" === e.dateStyle ? "long" : void 0)), hasAnyOptions(e, [...Yt, ...Ct]) || (t.year = t.month = t.day = t.hour = t.minute = t.second = "numeric"), removeDateTimeFormatOptions(t, ["timeZoneName"]), t.timeZone = "UTC", t;
|
|
2143
2114
|
}
|
|
2144
2115
|
function amendOptionsForPlainYearMonth(e) {
|
|
2145
2116
|
const t = createNullPrototypeObject(e);
|
|
@@ -2147,8 +2118,8 @@ function amendOptionsForPlainYearMonth(e) {
|
|
|
2147
2118
|
"year",
|
|
2148
2119
|
"month",
|
|
2149
2120
|
"dateStyle"
|
|
2150
|
-
]) || (hasAnyOptions(e, [...
|
|
2151
|
-
...
|
|
2121
|
+
]) || (hasAnyOptions(e, [...Yt, ...Ct]) && throwTypeError(N), t.year = t.month = "numeric"), removeDateTimeFormatOptions(t, [
|
|
2122
|
+
...Ct,
|
|
2152
2123
|
"day",
|
|
2153
2124
|
"weekday",
|
|
2154
2125
|
"timeZoneName"
|
|
@@ -2160,8 +2131,8 @@ function amendOptionsForPlainMonthDay(e) {
|
|
|
2160
2131
|
"month",
|
|
2161
2132
|
"day",
|
|
2162
2133
|
"dateStyle"
|
|
2163
|
-
]) || (hasAnyOptions(e, [...
|
|
2164
|
-
...
|
|
2134
|
+
]) || (hasAnyOptions(e, [...Yt, ...Ct]) && throwTypeError(N), t.month = t.day = "numeric"), removeDateTimeFormatOptions(t, [
|
|
2135
|
+
...Ct,
|
|
2165
2136
|
"era",
|
|
2166
2137
|
"year",
|
|
2167
2138
|
"weekday",
|
|
@@ -2170,7 +2141,7 @@ function amendOptionsForPlainMonthDay(e) {
|
|
|
2170
2141
|
}
|
|
2171
2142
|
function amendOptionsForInstant(e) {
|
|
2172
2143
|
const t = createNullPrototypeObject(e);
|
|
2173
|
-
return hasAnyOptions(e, [...
|
|
2144
|
+
return hasAnyOptions(e, [...Yt, ...Ct]) || (t.year = t.month = t.day = t.hour = t.minute = t.second = "numeric"), t;
|
|
2174
2145
|
}
|
|
2175
2146
|
function hasAnyOptions(e, t) {
|
|
2176
2147
|
return t.some((t) => void 0 !== e[t]);
|
|
@@ -2178,15 +2149,15 @@ function hasAnyOptions(e, t) {
|
|
|
2178
2149
|
function createDateTimeFormat(e, t = createNullPrototypeObject(), o, n) {
|
|
2179
2150
|
null === t && throwTypeError(N);
|
|
2180
2151
|
const r = createNullPrototypeObject();
|
|
2181
|
-
let a =
|
|
2152
|
+
let a = Zt(e, new Proxy({}, { get(e, o) {
|
|
2182
2153
|
const a = t[o];
|
|
2183
2154
|
return "timeZone" === o && void 0 !== n ? (void 0 !== a && throwTypeError("disallowed field: timeZone"), r[o] = n) : void 0 === a ? a : r[o] = "hour12" === o ? ((e) => !!e)(a) : "fractionalSecondDigits" === o ? Se(a) : toString(a);
|
|
2184
2155
|
} }));
|
|
2185
2156
|
return (o === z && r.timeStyle || o === V && r.dateStyle) && throwTypeError(N), r.calendar = a.resolvedOptions().calendar, void 0 === n || hasAnyOptions(r, [
|
|
2186
|
-
...Ct,
|
|
2187
2157
|
...Yt,
|
|
2158
|
+
...Ct,
|
|
2188
2159
|
"timeZoneName"
|
|
2189
|
-
]) || (r.timeZoneName = "short", a =
|
|
2160
|
+
]) || (r.timeZoneName = "short", a = Zt(a.resolvedOptions().locale, r)), createNullPrototypeObject({
|
|
2190
2161
|
Re: a,
|
|
2191
2162
|
Ne: r,
|
|
2192
2163
|
Ze: a.resolvedOptions().locale
|
|
@@ -2208,7 +2179,7 @@ function toDateTimeFormattable(e) {
|
|
|
2208
2179
|
}
|
|
2209
2180
|
function handleDateTimeValue(e, t) {
|
|
2210
2181
|
const o = getInternalSlotForPlainDate(t), n = getInternalSlotForPlainDateTime(t), r = getInternalSlotForPlainYearMonth(t), a = getInternalSlotForPlainMonthDay(t);
|
|
2211
|
-
return isPlainTime(t) ? [e.Ye ||=
|
|
2182
|
+
return isPlainTime(t) ? [e.Ye ||= Zt(e.Ze, amendOptionsForPlainTime(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(createIsoDateRecord(1970, 1, 1), getInternalSlotOrThrowForPlainTime(t))))] : o ? (o.Y !== e.Ne.calendar && "iso8601" !== o.Y && throwRangeError(Z), [e.Ce ||= Zt(e.Ze, amendOptionsForPlainDate(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(o.o, midnightTimeRecord())))]) : n ? (n.Y !== e.Ne.calendar && "iso8601" !== n.Y && throwRangeError(Z), [e.Ue ||= Zt(e.Ze, amendOptionsForPlainDateTime(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(n.K))]) : r ? (r.Y !== e.Ne.calendar && throwRangeError(Z), [e.je ||= Zt(e.Ze, amendOptionsForPlainYearMonth(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())))]) : a ? (a.Y !== e.Ne.calendar && throwRangeError(Z), [e.We ||= Zt(e.Ze, amendOptionsForPlainMonthDay(e.Ne)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(a.o, midnightTimeRecord())))]) : isInstant(t) ? [e.ke ||= Zt(e.Ze, amendOptionsForInstant(e.Ne)), epochMilliseconds(getInternalSlotOrThrowForInstant(t).U)] : (isZonedDateTime(t) && throwTypeError(C), [e.Re, t]);
|
|
2212
2183
|
}
|
|
2213
2184
|
function DateTimeFormat(e, t) {
|
|
2214
2185
|
return new Ut(e, t);
|
|
@@ -2263,7 +2234,7 @@ function clampEpochNanoseconds(e) {
|
|
|
2263
2234
|
return compareEpochNanoseconds(e, we) > 0 ? we : compareEpochNanoseconds(e, ye) < 0 ? ye : e;
|
|
2264
2235
|
}
|
|
2265
2236
|
function systemTimeZoneIdentifier() {
|
|
2266
|
-
return Ht && qt + Ht > Date.now() && xt ? xt : (qt = Date.now(), xt =
|
|
2237
|
+
return Ht && qt + Ht > Date.now() && xt ? xt : (qt = Date.now(), xt = Zt().resolvedOptions().timeZone || "UTC");
|
|
2267
2238
|
}
|
|
2268
2239
|
function setSystemTimeZoneIdCacheTtl(e) {
|
|
2269
2240
|
Ht = e, e || (xt = void 0, qt = -1 / 0);
|
|
@@ -2293,8 +2264,8 @@ const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e11, i = 146097
|
|
|
2293
2264
|
1e6,
|
|
2294
2265
|
1e3,
|
|
2295
2266
|
1
|
|
2296
|
-
], missingField = (e) => `missing field: ${e}`, invalidField = (e) => `invalid field: ${e}`, parseError = (e) => `parse error: ${e}`, b = "invalid date / time", P = "out-of-bounds date", R = "out-of-bounds duration", N = "invalid formatting options", Z = "calendar mismatch", disallowedUnit = (e) => `disallowed unit: ${"auto" === e ? e : getNameFromUnit(e)}`, invalidNumber = (e) => `invalid number: ${e}`, invalidTimeZone = (e) => `invalid time zone: ${e}`, invalidMonthCode = (e) => `invalid month code:${e}`, durationWithDateUnit = (e) => `duration has a date unit: ${getNameFromUnit(e)}`, $ = "invalid `largestUnit` and `smallestUnit` options",
|
|
2297
|
-
var k = class {
|
|
2267
|
+
], missingField = (e) => `missing field: ${e}`, invalidField = (e) => `invalid field: ${e}`, parseError = (e) => `parse error: ${e}`, b = "invalid date / time", P = "out-of-bounds date", R = "out-of-bounds duration", N = "invalid formatting options", Z = "calendar mismatch", disallowedUnit = (e) => `disallowed unit: ${"auto" === e ? e : getNameFromUnit(e)}`, invalidNumber = (e) => `invalid number: ${e}`, invalidTimeZone = (e) => `invalid time zone: ${e}`, invalidMonthCode = (e) => `invalid month code:${e}`, durationWithDateUnit = (e) => `duration has a date unit: ${getNameFromUnit(e)}`, $ = "invalid `largestUnit` and `smallestUnit` options", Y = "mismatch of `month` and `monthCode`", C = "value is not formattable", notObject = (e) => `not object: ${e}`, U = "empty fields", j = "can't convert Temporal classes to number", W = "argument is undefined", A = globalThis.Intl.DurationFormat, L = /* @__PURE__ */ new WeakMap();
|
|
2268
|
+
var k = class DurationFormat {
|
|
2298
2269
|
static supportedLocalesOf(e, t = void 0) {
|
|
2299
2270
|
return A.supportedLocalesOf(e, t);
|
|
2300
2271
|
}
|
|
@@ -2311,9 +2282,9 @@ var k = class {
|
|
|
2311
2282
|
return getInternalSlotOrThrowForDurationFormat(this).Ae.resolvedOptions();
|
|
2312
2283
|
}
|
|
2313
2284
|
};
|
|
2314
|
-
defineStringTag(k.prototype, "Intl.DurationFormat")
|
|
2285
|
+
defineStringTag(k.prototype, "Intl.DurationFormat");
|
|
2315
2286
|
const z = Symbol(), V = Symbol(), x = Symbol(), H = Symbol(), q = Symbol(), B = Symbol(), J = Symbol(), _ = "constrain", X = "reject", G = "compatible", K = "later", Q = "prefer", ee = "reject", te = Symbol(), oe = Symbol(), ne = Symbol(), re = "ceil", ae = "floor", ie = "expand", ce = "trunc", se = "halfCeil", le = "halfFloor", de = "halfExpand", me = "halfTrunc", ue = "halfEven", Te = "auto", De = "always", he = "never", pe = "critical", ge = "auto", fe = "never", Ie = "auto", Oe = "never", Fe = "critical", Se = Math.max, ye = createEpochNanosecondsFromEpochMilliseconds(-864e13), we = createEpochNanosecondsFromEpochMilliseconds(864e13), ve = [0, 0], Ee = compareEpochNanoseconds, Me = /* @__PURE__ */ new WeakMap();
|
|
2316
|
-
var be = class {
|
|
2287
|
+
var be = class ZonedDateTime {
|
|
2317
2288
|
constructor(e, t, o = "iso8601") {
|
|
2318
2289
|
const n = validateEpochNanoseconds(createEpochNanosecondsFromBigInt(toBigInt(e)));
|
|
2319
2290
|
validateString(t);
|
|
@@ -2519,9 +2490,9 @@ var be = class {
|
|
|
2519
2490
|
return createTemporalDateTime(getIsoDateTimeForZonedDateTimeSlot(e), e.Y);
|
|
2520
2491
|
}
|
|
2521
2492
|
};
|
|
2522
|
-
defineStringTag(be.prototype, "Temporal.ZonedDateTime")
|
|
2493
|
+
defineStringTag(be.prototype, "Temporal.ZonedDateTime");
|
|
2523
2494
|
const Pe = globalThis.Temporal, Re = createNullPrototypeObject(), Ne = createNullPrototypeObject(), Ze = /* @__PURE__ */ new WeakMap();
|
|
2524
|
-
var $e = class {
|
|
2495
|
+
var $e = class PlainDateTime {
|
|
2525
2496
|
constructor(e, t, o, n = 0, r = 0, a = 0, i = 0, c = 0, s = 0, l = "iso8601") {
|
|
2526
2497
|
const d = [
|
|
2527
2498
|
e,
|
|
@@ -2683,9 +2654,9 @@ var $e = class {
|
|
|
2683
2654
|
return createTemporalTime(getInternalSlotOrThrowForPlainDateTime(this).K.p);
|
|
2684
2655
|
}
|
|
2685
2656
|
};
|
|
2686
|
-
defineStringTag($e.prototype, "Temporal.PlainDateTime")
|
|
2687
|
-
const
|
|
2688
|
-
var
|
|
2657
|
+
defineStringTag($e.prototype, "Temporal.PlainDateTime");
|
|
2658
|
+
const Ye = /* @__PURE__ */ new WeakMap();
|
|
2659
|
+
var Ce = class PlainTime {
|
|
2689
2660
|
constructor(e = 0, t = 0, o = 0, n = 0, r = 0, a = 0) {
|
|
2690
2661
|
createTemporalTime(createTimeRecord(...[
|
|
2691
2662
|
e,
|
|
@@ -2766,7 +2737,7 @@ var Ye = class {
|
|
|
2766
2737
|
throwTypeError(j);
|
|
2767
2738
|
}
|
|
2768
2739
|
};
|
|
2769
|
-
defineStringTag(
|
|
2740
|
+
defineStringTag(Ce.prototype, "Temporal.PlainTime");
|
|
2770
2741
|
const Ue = "\\d{4}|[-+]\\d{6}", je = "0[1-9]|1[0-2]", We = "0[1-9]|[12]\\d|30|31", Ae = "[01]\\d|2[0-3]", Le = "[0-5]\\d", ke = `(?<a>${Ue})(?<x>-?)(?<b>${je})\\k<x>(?<c>${We})`, ze = optionalChain([
|
|
2771
2742
|
`(?<d>${Ae})`,
|
|
2772
2743
|
`(?<y>:?)(?<e>${Le})`,
|
|
@@ -2786,7 +2757,7 @@ const Ue = "\\d{4}|[-+]\\d{6}", je = "0[1-9]|1[0-2]", We = "0[1-9]|[12]\\d|30|31
|
|
|
2786
2757
|
`[ tT]${ze}`,
|
|
2787
2758
|
Be
|
|
2788
2759
|
])}${_e}${Ke}`), tt = createRegExp(`${xe}(?:${_e})?${Ke}`), ot = createRegExp(`${ke}[ tT]${ze}(?:${Be})(?:${_e})?${Ke}`), nt = createRegExp(`(${ke}[ tT]|[tT]?)${ze}(?<h>${Ve})?(?:${_e})?${Ke}`), rt = createRegExp(`(${xe}|${qe})(?:${_e})?${Ke}`), at = createRegExp(`(${xe}|${He})(?:${_e})?${Ke}`), it = [createRegExp(`${qe}(${_e})?(${Ge})*`), createRegExp(`${He}(${_e})?(${Ge})*`)], ct = createRegExp(Je), st = createRegExp(Xe), lt = createRegExp(Ve), dt = /* @__PURE__ */ new WeakMap();
|
|
2789
|
-
var mt = class {
|
|
2760
|
+
var mt = class PlainMonthDay {
|
|
2790
2761
|
constructor(e, t, o = "iso8601", n = 1972) {
|
|
2791
2762
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2792
2763
|
validateString(o);
|
|
@@ -2837,9 +2808,9 @@ var mt = class {
|
|
|
2837
2808
|
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.Y, calendarMergeFields(t.Y, isoDateToFields(t.Y, t.o, q), prepareCalendarFields(t.Y, e, [wt.t], [])), _), t.Y);
|
|
2838
2809
|
}
|
|
2839
2810
|
};
|
|
2840
|
-
defineStringTag(mt.prototype, "Temporal.PlainMonthDay")
|
|
2811
|
+
defineStringTag(mt.prototype, "Temporal.PlainMonthDay");
|
|
2841
2812
|
const ut = /* @__PURE__ */ new WeakMap();
|
|
2842
|
-
var Tt = class {
|
|
2813
|
+
var Tt = class PlainYearMonth {
|
|
2843
2814
|
constructor(e, t, o = "iso8601", n = 1) {
|
|
2844
2815
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2845
2816
|
validateString(o);
|
|
@@ -2925,9 +2896,9 @@ var Tt = class {
|
|
|
2925
2896
|
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.Y, calendarMergeFields(t.Y, isoDateToFields(t.Y, t.o, H), prepareCalendarFields(t.Y, e, [wt.T], [])), _), t.Y);
|
|
2926
2897
|
}
|
|
2927
2898
|
};
|
|
2928
|
-
defineStringTag(Tt.prototype, "Temporal.PlainYearMonth")
|
|
2899
|
+
defineStringTag(Tt.prototype, "Temporal.PlainYearMonth");
|
|
2929
2900
|
const Dt = /* @__PURE__ */ new WeakMap();
|
|
2930
|
-
var ht = class {
|
|
2901
|
+
var ht = class PlainDate {
|
|
2931
2902
|
constructor(e, t, o, n = "iso8601") {
|
|
2932
2903
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t), i = toIntegerWithTruncation(o);
|
|
2933
2904
|
validateString(n);
|
|
@@ -3052,7 +3023,7 @@ var ht = class {
|
|
|
3052
3023
|
throwTypeError(j);
|
|
3053
3024
|
}
|
|
3054
3025
|
};
|
|
3055
|
-
defineStringTag(ht.prototype, "Temporal.PlainDate")
|
|
3026
|
+
defineStringTag(ht.prototype, "Temporal.PlainDate");
|
|
3056
3027
|
const pt = createNullPrototypeObject(), gt = {
|
|
3057
3028
|
chinese: createLruCache(2e3),
|
|
3058
3029
|
dangi: createLruCache(2e3)
|
|
@@ -3119,7 +3090,7 @@ const pt = createNullPrototypeObject(), gt = {
|
|
|
3119
3090
|
[wt.re]: [toIntegerWithTruncation],
|
|
3120
3091
|
[wt.t]: [toIntegerWithTruncation],
|
|
3121
3092
|
[wt.u]: [toPositiveIntegerWithTruncation],
|
|
3122
|
-
[wt.v]: [(e) =>
|
|
3093
|
+
[wt.v]: [(e) => parseMonthCode(e)],
|
|
3123
3094
|
[wt.T]: [toPositiveIntegerWithTruncation],
|
|
3124
3095
|
[wt.D]: [toIntegerWithTruncation, 0],
|
|
3125
3096
|
[wt.I]: [toIntegerWithTruncation, 0],
|
|
@@ -3133,7 +3104,7 @@ const pt = createNullPrototypeObject(), gt = {
|
|
|
3133
3104
|
}],
|
|
3134
3105
|
[wt.P]: [toTemporalTimeZoneIdentifier]
|
|
3135
3106
|
}, Mt = /* @__PURE__ */ new WeakMap(), bt = signTimeDuration;
|
|
3136
|
-
var Pt = class {
|
|
3107
|
+
var Pt = class Duration {
|
|
3137
3108
|
constructor(e = 0, t = 0, o = 0, n = 0, r = 0, a = 0, i = 0, c = 0, s = 0, l = 0) {
|
|
3138
3109
|
createTemporalDuration(createTemporalDurationSlot([
|
|
3139
3110
|
e,
|
|
@@ -3255,7 +3226,7 @@ var Pt = class {
|
|
|
3255
3226
|
throwTypeError(j);
|
|
3256
3227
|
}
|
|
3257
3228
|
};
|
|
3258
|
-
defineStringTag(Pt.prototype, "Temporal.Duration")
|
|
3229
|
+
defineStringTag(Pt.prototype, "Temporal.Duration");
|
|
3259
3230
|
const Rt = {
|
|
3260
3231
|
[re]: Math.ceil,
|
|
3261
3232
|
[ae]: Math.floor,
|
|
@@ -3276,13 +3247,13 @@ const Rt = {
|
|
|
3276
3247
|
[de]: roundHalfCeil,
|
|
3277
3248
|
[me]: roundHalfFloor,
|
|
3278
3249
|
[ue]: roundHalfEven
|
|
3279
|
-
}, Zt = globalThis.Intl.DateTimeFormat, $t = /* @__PURE__ */ new WeakMap(),
|
|
3250
|
+
}, Zt = globalThis.Intl.DateTimeFormat, $t = /* @__PURE__ */ new WeakMap(), Yt = [
|
|
3280
3251
|
"year",
|
|
3281
3252
|
"month",
|
|
3282
3253
|
"day",
|
|
3283
3254
|
"weekday",
|
|
3284
3255
|
"dateStyle"
|
|
3285
|
-
],
|
|
3256
|
+
], Ct = [
|
|
3286
3257
|
"hour",
|
|
3287
3258
|
"minute",
|
|
3288
3259
|
"second",
|
|
@@ -3306,14 +3277,14 @@ var Ut = class {
|
|
|
3306
3277
|
})(getInternalSlotOrThrowForDateTimeFormat(this), e);
|
|
3307
3278
|
}
|
|
3308
3279
|
formatRange(e, t) {
|
|
3309
|
-
return void 0 !== e && void 0 !== t || throwTypeError(
|
|
3280
|
+
return void 0 !== e && void 0 !== t || throwTypeError(C), ((e, t, o) => {
|
|
3310
3281
|
validateSameTemporalType(t, o);
|
|
3311
3282
|
const [n, r] = handleDateTimeValue(e, t);
|
|
3312
3283
|
return n.formatRange(r, handleDateTimeValue(e, o)[1]);
|
|
3313
3284
|
})(getInternalSlotOrThrowForDateTimeFormat(this), toDateTimeFormattable(e), toDateTimeFormattable(t));
|
|
3314
3285
|
}
|
|
3315
3286
|
formatRangeToParts(e, t) {
|
|
3316
|
-
return void 0 !== e && void 0 !== t || throwTypeError(
|
|
3287
|
+
return void 0 !== e && void 0 !== t || throwTypeError(C), ((e, t, o) => {
|
|
3317
3288
|
validateSameTemporalType(t, o);
|
|
3318
3289
|
const [n, r] = handleDateTimeValue(e, t);
|
|
3319
3290
|
return n.formatRangeToParts(r, handleDateTimeValue(e, o)[1]);
|
|
@@ -3328,7 +3299,7 @@ jt.prototype.value = Wt;
|
|
|
3328
3299
|
for (const e of ["formatRange", "formatRangeToParts"]) Zt.prototype[e] || delete Wt[e];
|
|
3329
3300
|
Object.defineProperties(DateTimeFormat, jt), DateTimeFormat.prototype.constructor = DateTimeFormat, defineStringTag(DateTimeFormat.prototype, "Intl.DateTimeFormat");
|
|
3330
3301
|
const At = /* @__PURE__ */ new WeakMap();
|
|
3331
|
-
var Lt = class {
|
|
3302
|
+
var Lt = class Instant {
|
|
3332
3303
|
constructor(e) {
|
|
3333
3304
|
createTemporalInstant(validateEpochNanoseconds(createEpochNanosecondsFromBigInt(toBigInt(e))), this);
|
|
3334
3305
|
}
|
|
@@ -3388,7 +3359,7 @@ var Lt = class {
|
|
|
3388
3359
|
return createTemporalZonedDateTime(getInternalSlotOrThrowForInstant(this).U, toTemporalTimeZoneIdentifier(e), "iso8601");
|
|
3389
3360
|
}
|
|
3390
3361
|
};
|
|
3391
|
-
defineStringTag(Lt.prototype, "Temporal.Instant")
|
|
3362
|
+
defineStringTag(Lt.prototype, "Temporal.Instant");
|
|
3392
3363
|
const kt = { toTemporalInstant() {
|
|
3393
3364
|
const e = Date.prototype.valueOf.call(this);
|
|
3394
3365
|
return e != e && throwRangeError("invalid date"), createTemporalInstant(createEpochNanosecondsFromEpochMilliseconds(e));
|
|
@@ -3408,7 +3379,7 @@ const Jt = {
|
|
|
3408
3379
|
Instant: Lt,
|
|
3409
3380
|
PlainDateTime: $e,
|
|
3410
3381
|
PlainDate: ht,
|
|
3411
|
-
PlainTime:
|
|
3382
|
+
PlainTime: Ce,
|
|
3412
3383
|
PlainYearMonth: Tt,
|
|
3413
3384
|
PlainMonthDay: mt,
|
|
3414
3385
|
Duration: Pt,
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as Intl, t as Temporal, i as toTemporalInstant } from "./src-
|
|
1
|
+
export { r as Intl, t as Temporal, i as toTemporalInstant } from "./src-DIR5AiIq.js";
|
package/dist/shim.js
CHANGED
|
@@ -4,5 +4,5 @@ function install(s) {
|
|
|
4
4
|
function setSystemTimeZoneIdCacheTtl(t) {
|
|
5
5
|
s(t);
|
|
6
6
|
}
|
|
7
|
-
import { a as t, i as a, n as s, r as e, t as l } from "./src-
|
|
7
|
+
import { a as t, i as a, n as s, r as e, t as l } from "./src-DIR5AiIq.js";
|
|
8
8
|
export { install, setSystemTimeZoneIdCacheTtl };
|
|
@@ -19,9 +19,6 @@ function defineStringTag(e, t) {
|
|
|
19
19
|
configurable: !0
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
function renameFunction(e, t) {
|
|
23
|
-
Object.defineProperty(e, "name", { value: t });
|
|
24
|
-
}
|
|
25
22
|
function getNameFromUnit(e) {
|
|
26
23
|
return y[e];
|
|
27
24
|
}
|
|
@@ -191,8 +188,8 @@ function divideTimeDurationToFloatingPoint(e, t) {
|
|
|
191
188
|
function interpretISODateTimeOffset(e, t, o, n, r, a, i, l) {
|
|
192
189
|
if (!t) return getStartOfDay(r, e);
|
|
193
190
|
const c = combineIsoDateAndTimeRecord(e, t);
|
|
194
|
-
if (o === ne || o === te && "ignore"
|
|
195
|
-
if (o === oe || o === te && "use"
|
|
191
|
+
if (o === ne || o === te && "ignore" === i) return getEpochNanosecondsFor(r, c, a);
|
|
192
|
+
if (o === oe || o === te && "use" === i) return validateEpochNanoseconds(getUtcEpochNanoseconds(balanceIsoDateTime(c.o.t, c.o.u, c.o.T, c.p.D, c.p.I, c.p.O, c.p.F, c.p.S, c.p.v - n)));
|
|
196
193
|
((e) => {
|
|
197
194
|
Math.abs(isoDateToEpochDays(e.t, e.u - 1, e.T)) > 1e8 && throwRangeError(R);
|
|
198
195
|
})(e);
|
|
@@ -349,7 +346,7 @@ function getNamedTimeZoneOffsetNanosecondsForEpochSecond(t, o, n) {
|
|
|
349
346
|
return n || a.q(r, c), c;
|
|
350
347
|
}
|
|
351
348
|
function getFormatterForTimeZone(e) {
|
|
352
|
-
return Ze[e] ||=
|
|
349
|
+
return Ze[e] ||= vt("en-u-hc-h23", {
|
|
353
350
|
timeZone: e,
|
|
354
351
|
year: "numeric",
|
|
355
352
|
month: "numeric",
|
|
@@ -368,17 +365,17 @@ function bisectOffsetTransition(e, t, o) {
|
|
|
368
365
|
}
|
|
369
366
|
return a;
|
|
370
367
|
}
|
|
371
|
-
function
|
|
372
|
-
return e < -85e7 ?
|
|
368
|
+
function windowDaysForEpoch(e) {
|
|
369
|
+
return e < -85e7 ? 21 : isWithin(e, -77e7, 96e7) ? 16 : isWithin(e, 129e7, 179e7) ? 27 : 6.5;
|
|
373
370
|
}
|
|
374
|
-
function searchTimeZoneTransition(e, t, o,
|
|
371
|
+
function searchTimeZoneTransition(e, t, o, r) {
|
|
375
372
|
o = clamp(o, -864e10, 864e10);
|
|
376
|
-
for (let
|
|
373
|
+
for (let a = 172800 * r, i = t, l = t + a; (o - l) * r > 0; a = windowDaysForEpoch(i) * n * r, i = l, l = clamp(l + a, -864e10, 864e10)) if (getNamedTimeZoneOffsetNanosecondsForEpochSecond(e, i, !0) !== getNamedTimeZoneOffsetNanosecondsForEpochSecond(e, l, !0)) return createEpochNanosecondsFromEpochSeconds(r > 0 ? bisectOffsetTransition(e, i, l) : bisectOffsetTransition(e, l, i));
|
|
377
374
|
return null;
|
|
378
375
|
}
|
|
379
376
|
function getAvailableNamedTimeZoneIdentifier(e) {
|
|
380
377
|
return ((e) => {
|
|
381
|
-
/^(?![cemw]et|[emh]st|prc|ro[ck]|uct|utc|gmt)
|
|
378
|
+
/^(?![cemw]et|[emh]st|prc|ro[ck]|uct|utc|gmt)...$|systemv|^u.*w$|^c.*-/i.test(e) && throwRangeError(invalidTimeZone(e));
|
|
382
379
|
})(e = asciiLowerCase(e).replace(/[^/]+/g, (e) => /^(?!etc|yap).{1,3}$|\d/.test(e) ? asciiUpperCase(e) : e.replace(/baja|mc|comod|[a-z]+/g, (e) => {
|
|
383
380
|
return /^(su|gb|nz|in|chat)$/.test(e) ? asciiUpperCase(e) : /^(of|au|es)$/.test(e) ? e : (t = e, t.replace(/^[a-z]/, (e) => e.toUpperCase())).replace(/du(?=r)|n(?=or)|i(?=slan)/, asciiUpperCase);
|
|
384
381
|
var t;
|
|
@@ -1080,20 +1077,13 @@ function calendarExtraFields(e, t) {
|
|
|
1080
1077
|
return calendarSupportsEra(e) && t.includes("year") ? ["era", "eraYear"] : [];
|
|
1081
1078
|
}
|
|
1082
1079
|
function isoResolveFields(e, t) {
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
o && ((o[0] > 12 || o[1] || void 0 !== e[ht.u] && o[0] !== e[ht.u]) && throwRangeError(j), e[ht.u] = o[0]);
|
|
1080
|
+
const o = e[ht.P];
|
|
1081
|
+
t !== B && void 0 === e[ht.t] && throwTypeError(missingField(ht.t)), t !== x && void 0 === e[ht.T] && throwTypeError(missingField(ht.T)), void 0 === o && void 0 === e[ht.u] && throwTypeError(missingField("month, monthCode")), o && ((o[0] > 12 || o[1] || void 0 !== e[ht.u] && o[0] !== e[ht.u]) && throwRangeError(j), e[ht.u] = o[0]);
|
|
1086
1082
|
}
|
|
1087
1083
|
function calendarResolveFields(e, t, o = V) {
|
|
1088
1084
|
"iso8601" === e ? isoResolveFields(t, o) : (function(e, t, o = V) {
|
|
1089
|
-
const n = t[ht.ne], r = t[ht.re];
|
|
1090
|
-
|
|
1091
|
-
const i = t[ht.P], l = t[ht.u], c = t[ht.T];
|
|
1092
|
-
if (o === B && void 0 !== i && void 0 === l || void 0 !== a || void 0 !== n && void 0 !== r || throwTypeError(missingField("year, era, eraYear")), void 0 === n != (void 0 === r) && throwTypeError(), o !== x && void 0 === c && throwTypeError(missingField("day")), l === i && throwTypeError(missingField("month, monthCode")), void 0 !== r) {
|
|
1093
|
-
const e = ((e, t, o) => "ce" === canonicalizeEraInCalendar(0, t) ? o : 1 - o)(0, canonicalizeEraInCalendar(0, n), r);
|
|
1094
|
-
void 0 !== a && a !== e && throwRangeError("mismatch of `year`, `era` and `eraYear`"), t[ht.t] = e;
|
|
1095
|
-
}
|
|
1096
|
-
t[ht.ne] = t[ht.re] = void 0, isoResolveFields(t, o);
|
|
1085
|
+
const n = t[ht.ne], r = t[ht.re], a = t[ht.t], i = t[ht.P], l = t[ht.u], c = t[ht.T];
|
|
1086
|
+
o === B && void 0 !== i && void 0 === l || void 0 !== a || void 0 !== n && void 0 !== r || throwTypeError(missingField("year, era, eraYear")), void 0 === n != (void 0 === r) && throwTypeError(), o !== x && void 0 === c && throwTypeError(missingField("day")), l === i && throwTypeError(missingField("month, monthCode")), void 0 !== r && (t[ht.t] = ((e, t, o) => "ce" === canonicalizeEraInCalendar(0, t) ? o : 1 - o)(0, canonicalizeEraInCalendar(0, n), r), void 0 !== a && a !== t[ht.t] && throwRangeError("mismatch of `year`, `era` and `eraYear`")), t[ht.ne] = t[ht.re] = void 0, isoResolveFields(t, o);
|
|
1097
1087
|
})(0, t, o);
|
|
1098
1088
|
}
|
|
1099
1089
|
function createEmptyCalendarFieldsRecord() {
|
|
@@ -1517,7 +1507,7 @@ function isoDateToFields(e, t, o) {
|
|
|
1517
1507
|
const n = calendarIsoToDate(e, t);
|
|
1518
1508
|
return createNullPrototypeObject({
|
|
1519
1509
|
[ht.t]: o === B ? void 0 : n.t,
|
|
1520
|
-
[ht.P]: n.P,
|
|
1510
|
+
[ht.P]: parseMonthCode(n.P),
|
|
1521
1511
|
[ht.T]: o === x ? void 0 : n.T
|
|
1522
1512
|
});
|
|
1523
1513
|
}
|
|
@@ -1619,7 +1609,7 @@ function hasAnyOptions(e, t) {
|
|
|
1619
1609
|
function createDateTimeFormat(e, t = createNullPrototypeObject(), o, n) {
|
|
1620
1610
|
null === t && throwTypeError(N);
|
|
1621
1611
|
const r = createNullPrototypeObject();
|
|
1622
|
-
let a =
|
|
1612
|
+
let a = vt(e, new Proxy({}, { get(e, o) {
|
|
1623
1613
|
const a = t[o];
|
|
1624
1614
|
return "timeZone" === o && void 0 !== n ? (void 0 !== a && throwTypeError("disallowed field: timeZone"), r[o] = n) : void 0 === a ? a : r[o] = "hour12" === o ? ((e) => !!e)(a) : "fractionalSecondDigits" === o ? Se(a) : toString(a);
|
|
1625
1615
|
} }));
|
|
@@ -1627,7 +1617,7 @@ function createDateTimeFormat(e, t = createNullPrototypeObject(), o, n) {
|
|
|
1627
1617
|
...Pt,
|
|
1628
1618
|
...Et,
|
|
1629
1619
|
"timeZoneName"
|
|
1630
|
-
]) || (r.timeZoneName = "short", a =
|
|
1620
|
+
]) || (r.timeZoneName = "short", a = vt(a.resolvedOptions().locale, r)), createNullPrototypeObject({
|
|
1631
1621
|
Ze: a,
|
|
1632
1622
|
$e: r,
|
|
1633
1623
|
Ne: a.resolvedOptions().locale
|
|
@@ -1649,7 +1639,7 @@ function toDateTimeFormattable(e) {
|
|
|
1649
1639
|
}
|
|
1650
1640
|
function handleDateTimeValue(e, t) {
|
|
1651
1641
|
const o = getInternalSlotForPlainDate(t), n = getInternalSlotForPlainDateTime(t), r = getInternalSlotForPlainYearMonth(t), a = getInternalSlotForPlainMonthDay(t);
|
|
1652
|
-
return isPlainTime(t) ? [e.Me ||=
|
|
1642
|
+
return isPlainTime(t) ? [e.Me ||= vt(e.Ne, amendOptionsForPlainTime(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(createIsoDateRecord(1970, 1, 1), getInternalSlotOrThrowForPlainTime(t))))] : o ? (o.U !== e.$e.calendar && "iso8601" !== o.U && throwRangeError(M), [e.Ue ||= vt(e.Ne, amendOptionsForPlainDate(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(o.o, midnightTimeRecord())))]) : n ? (n.U !== e.$e.calendar && "iso8601" !== n.U && throwRangeError(M), [e.je ||= vt(e.Ne, amendOptionsForPlainDateTime(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(n.K))]) : r ? (r.U !== e.$e.calendar && throwRangeError(M), [e.Ce ||= vt(e.Ne, amendOptionsForPlainYearMonth(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(r.o, midnightTimeRecord())))]) : a ? (a.U !== e.$e.calendar && throwRangeError(M), [e.Ye ||= vt(e.Ne, amendOptionsForPlainMonthDay(e.$e)), epochMilliseconds(getUtcEpochNanoseconds(combineIsoDateAndTimeRecord(a.o, midnightTimeRecord())))]) : isInstant(t) ? [e.We ||= vt(e.Ne, amendOptionsForInstant(e.$e)), epochMilliseconds(getInternalSlotOrThrowForInstant(t).Y)] : (isZonedDateTime(t) && throwTypeError($), [e.Ze, t]);
|
|
1653
1643
|
}
|
|
1654
1644
|
function DateTimeFormat(e, t) {
|
|
1655
1645
|
return new bt(e, t);
|
|
@@ -1704,7 +1694,7 @@ function clampEpochNanoseconds(e) {
|
|
|
1704
1694
|
return compareEpochNanoseconds(e, ve) > 0 ? ve : compareEpochNanoseconds(e, we) < 0 ? we : e;
|
|
1705
1695
|
}
|
|
1706
1696
|
function systemTimeZoneIdentifier() {
|
|
1707
|
-
return Yt && Wt + Yt > Date.now() && Ct ? Ct : (Wt = Date.now(), Ct =
|
|
1697
|
+
return Yt && Wt + Yt > Date.now() && Ct ? Ct : (Wt = Date.now(), Ct = vt().resolvedOptions().timeZone || "UTC");
|
|
1708
1698
|
}
|
|
1709
1699
|
function setSystemTimeZoneIdCacheTtl(e) {
|
|
1710
1700
|
Yt = e, e || (Ct = void 0, Wt = -1 / 0);
|
|
@@ -1735,7 +1725,7 @@ const e = 1e6, t = 6e10, o = 36e11, n = 86400, r = 864e5, a = 864e11, i = 146097
|
|
|
1735
1725
|
1e3,
|
|
1736
1726
|
1
|
|
1737
1727
|
], missingField = (e) => `missing field: ${e}`, invalidField = (e) => `invalid field: ${e}`, parseError = (e) => `parse error: ${e}`, b = "invalid date / time", R = "out-of-bounds date", Z = "out-of-bounds duration", N = "invalid formatting options", M = "calendar mismatch", disallowedUnit = (e) => `disallowed unit: ${"auto" === e ? e : getNameFromUnit(e)}`, invalidNumber = (e) => `invalid number: ${e}`, invalidTimeZone = (e) => `invalid time zone: ${e}`, invalidMonthCode = (e) => `invalid month code:${e}`, durationWithDateUnit = (e) => `duration has a date unit: ${getNameFromUnit(e)}`, U = "invalid `largestUnit` and `smallestUnit` options", j = "mismatch of `month` and `monthCode`", $ = "value is not formattable", notObject = (e) => `not object: ${e}`, C = "empty fields", Y = "can't convert Temporal classes to number", W = "argument is undefined", A = globalThis.Intl.DurationFormat, z = /* @__PURE__ */ new WeakMap();
|
|
1738
|
-
var k = class {
|
|
1728
|
+
var k = class DurationFormat {
|
|
1739
1729
|
static supportedLocalesOf(e, t = void 0) {
|
|
1740
1730
|
return A.supportedLocalesOf(e, t);
|
|
1741
1731
|
}
|
|
@@ -1752,9 +1742,9 @@ var k = class {
|
|
|
1752
1742
|
return getInternalSlotOrThrowForDurationFormat(this).Ae.resolvedOptions();
|
|
1753
1743
|
}
|
|
1754
1744
|
};
|
|
1755
|
-
defineStringTag(k.prototype, "Intl.DurationFormat")
|
|
1745
|
+
defineStringTag(k.prototype, "Intl.DurationFormat");
|
|
1756
1746
|
const V = Symbol(), L = Symbol(), H = Symbol(), x = Symbol(), B = Symbol(), q = Symbol(), J = Symbol(), _ = "constrain", X = "reject", G = "compatible", K = "later", Q = "prefer", ee = "reject", te = Symbol(), oe = Symbol(), ne = Symbol(), re = "ceil", ae = "floor", ie = "expand", le = "trunc", ce = "halfCeil", se = "halfFloor", de = "halfExpand", me = "halfTrunc", ue = "halfEven", Te = "auto", De = "always", pe = "never", he = "critical", ge = "auto", fe = "never", Ie = "auto", Oe = "never", Fe = "critical", Se = Math.max, we = createEpochNanosecondsFromEpochMilliseconds(-864e13), ve = createEpochNanosecondsFromEpochMilliseconds(864e13), ye = [0, 0], Pe = compareEpochNanoseconds, Ee = /* @__PURE__ */ new WeakMap();
|
|
1757
|
-
var be = class {
|
|
1747
|
+
var be = class ZonedDateTime {
|
|
1758
1748
|
constructor(e, t, o = "iso8601") {
|
|
1759
1749
|
const n = validateEpochNanoseconds(createEpochNanosecondsFromBigInt(toBigInt(e)));
|
|
1760
1750
|
validateString(t);
|
|
@@ -1960,9 +1950,9 @@ var be = class {
|
|
|
1960
1950
|
return createTemporalDateTime(getIsoDateTimeForZonedDateTimeSlot(e), e.U);
|
|
1961
1951
|
}
|
|
1962
1952
|
};
|
|
1963
|
-
defineStringTag(be.prototype, "Temporal.ZonedDateTime")
|
|
1953
|
+
defineStringTag(be.prototype, "Temporal.ZonedDateTime");
|
|
1964
1954
|
const Re = globalThis.Temporal, Ze = createNullPrototypeObject(), Ne = createNullPrototypeObject(), Me = /* @__PURE__ */ new WeakMap();
|
|
1965
|
-
var Ue = class {
|
|
1955
|
+
var Ue = class PlainDateTime {
|
|
1966
1956
|
constructor(e, t, o, n = 0, r = 0, a = 0, i = 0, l = 0, c = 0, s = "iso8601") {
|
|
1967
1957
|
const d = [
|
|
1968
1958
|
e,
|
|
@@ -2124,9 +2114,9 @@ var Ue = class {
|
|
|
2124
2114
|
return createTemporalTime(getInternalSlotOrThrowForPlainDateTime(this).K.p);
|
|
2125
2115
|
}
|
|
2126
2116
|
};
|
|
2127
|
-
defineStringTag(Ue.prototype, "Temporal.PlainDateTime")
|
|
2117
|
+
defineStringTag(Ue.prototype, "Temporal.PlainDateTime");
|
|
2128
2118
|
const je = /* @__PURE__ */ new WeakMap();
|
|
2129
|
-
var $e = class {
|
|
2119
|
+
var $e = class PlainTime {
|
|
2130
2120
|
constructor(e = 0, t = 0, o = 0, n = 0, r = 0, a = 0) {
|
|
2131
2121
|
createTemporalTime(createTimeRecord(...[
|
|
2132
2122
|
e,
|
|
@@ -2207,7 +2197,7 @@ var $e = class {
|
|
|
2207
2197
|
throwTypeError(Y);
|
|
2208
2198
|
}
|
|
2209
2199
|
};
|
|
2210
|
-
defineStringTag($e.prototype, "Temporal.PlainTime")
|
|
2200
|
+
defineStringTag($e.prototype, "Temporal.PlainTime");
|
|
2211
2201
|
const Ce = "\\d{4}|[-+]\\d{6}", Ye = "0[1-9]|1[0-2]", We = "0[1-9]|[12]\\d|30|31", Ae = "[01]\\d|2[0-3]", ze = "[0-5]\\d", ke = `(?<a>${Ce})(?<x>-?)(?<b>${Ye})\\k<x>(?<c>${We})`, Ve = optionalChain([
|
|
2212
2202
|
`(?<d>${Ae})`,
|
|
2213
2203
|
`(?<y>:?)(?<e>${ze})`,
|
|
@@ -2227,7 +2217,7 @@ const Ce = "\\d{4}|[-+]\\d{6}", Ye = "0[1-9]|1[0-2]", We = "0[1-9]|[12]\\d|30|31
|
|
|
2227
2217
|
`[ tT]${Ve}`,
|
|
2228
2218
|
qe
|
|
2229
2219
|
])}${_e}${Ke}`), tt = createRegExp(`${He}(?:${_e})?${Ke}`), ot = createRegExp(`${ke}[ tT]${Ve}(?:${qe})(?:${_e})?${Ke}`), nt = createRegExp(`(${ke}[ tT]|[tT]?)${Ve}(?<h>${Le})?(?:${_e})?${Ke}`), rt = createRegExp(`(${He}|${Be})(?:${_e})?${Ke}`), at = createRegExp(`(${He}|${xe})(?:${_e})?${Ke}`), it = [createRegExp(`${Be}(${_e})?(${Ge})*`), createRegExp(`${xe}(${_e})?(${Ge})*`)], lt = createRegExp(Je), ct = createRegExp(Xe), st = createRegExp(Le), dt = /* @__PURE__ */ new WeakMap();
|
|
2230
|
-
var mt = class {
|
|
2220
|
+
var mt = class PlainMonthDay {
|
|
2231
2221
|
constructor(e, t, o = "iso8601", n = 1972) {
|
|
2232
2222
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2233
2223
|
validateString(o);
|
|
@@ -2278,9 +2268,9 @@ var mt = class {
|
|
|
2278
2268
|
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.U, calendarMergeFields(t.U, isoDateToFields(t.U, t.o, B), prepareCalendarFields(t.U, e, [ht.t], [])), _), t.U);
|
|
2279
2269
|
}
|
|
2280
2270
|
};
|
|
2281
|
-
defineStringTag(mt.prototype, "Temporal.PlainMonthDay")
|
|
2271
|
+
defineStringTag(mt.prototype, "Temporal.PlainMonthDay");
|
|
2282
2272
|
const ut = /* @__PURE__ */ new WeakMap();
|
|
2283
|
-
var Tt = class {
|
|
2273
|
+
var Tt = class PlainYearMonth {
|
|
2284
2274
|
constructor(e, t, o = "iso8601", n = 1) {
|
|
2285
2275
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t);
|
|
2286
2276
|
validateString(o);
|
|
@@ -2366,9 +2356,9 @@ var Tt = class {
|
|
|
2366
2356
|
return isObject(e) || throwTypeError(notObject(e)), createTemporalDate(calendarDateFromFields(t.U, calendarMergeFields(t.U, isoDateToFields(t.U, t.o, x), prepareCalendarFields(t.U, e, [ht.T], [])), _), t.U);
|
|
2367
2357
|
}
|
|
2368
2358
|
};
|
|
2369
|
-
defineStringTag(Tt.prototype, "Temporal.PlainYearMonth")
|
|
2359
|
+
defineStringTag(Tt.prototype, "Temporal.PlainYearMonth");
|
|
2370
2360
|
const Dt = /* @__PURE__ */ new WeakMap();
|
|
2371
|
-
var pt = class {
|
|
2361
|
+
var pt = class PlainDate {
|
|
2372
2362
|
constructor(e, t, o, n = "iso8601") {
|
|
2373
2363
|
const r = toIntegerWithTruncation(e), a = toIntegerWithTruncation(t), i = toIntegerWithTruncation(o);
|
|
2374
2364
|
validateString(n);
|
|
@@ -2493,7 +2483,7 @@ var pt = class {
|
|
|
2493
2483
|
throwTypeError(Y);
|
|
2494
2484
|
}
|
|
2495
2485
|
};
|
|
2496
|
-
defineStringTag(pt.prototype, "Temporal.PlainDate")
|
|
2486
|
+
defineStringTag(pt.prototype, "Temporal.PlainDate");
|
|
2497
2487
|
const ht = {
|
|
2498
2488
|
ne: "era",
|
|
2499
2489
|
re: "eraYear",
|
|
@@ -2529,7 +2519,7 @@ const ht = {
|
|
|
2529
2519
|
[ht.re]: [toIntegerWithTruncation],
|
|
2530
2520
|
[ht.t]: [toIntegerWithTruncation],
|
|
2531
2521
|
[ht.u]: [toPositiveIntegerWithTruncation],
|
|
2532
|
-
[ht.P]: [(e) =>
|
|
2522
|
+
[ht.P]: [(e) => parseMonthCode(e)],
|
|
2533
2523
|
[ht.T]: [toPositiveIntegerWithTruncation],
|
|
2534
2524
|
[ht.D]: [toIntegerWithTruncation, 0],
|
|
2535
2525
|
[ht.I]: [toIntegerWithTruncation, 0],
|
|
@@ -2543,7 +2533,7 @@ const ht = {
|
|
|
2543
2533
|
}],
|
|
2544
2534
|
[ht.Z]: [toTemporalTimeZoneIdentifier]
|
|
2545
2535
|
}, It = /* @__PURE__ */ new WeakMap(), Ot = signTimeDuration;
|
|
2546
|
-
var Ft = class {
|
|
2536
|
+
var Ft = class Duration {
|
|
2547
2537
|
constructor(e = 0, t = 0, o = 0, n = 0, r = 0, a = 0, i = 0, l = 0, c = 0, s = 0) {
|
|
2548
2538
|
createTemporalDuration(createTemporalDurationSlot([
|
|
2549
2539
|
e,
|
|
@@ -2665,7 +2655,7 @@ var Ft = class {
|
|
|
2665
2655
|
throwTypeError(Y);
|
|
2666
2656
|
}
|
|
2667
2657
|
};
|
|
2668
|
-
defineStringTag(Ft.prototype, "Temporal.Duration")
|
|
2658
|
+
defineStringTag(Ft.prototype, "Temporal.Duration");
|
|
2669
2659
|
const St = {
|
|
2670
2660
|
[re]: Math.ceil,
|
|
2671
2661
|
[ae]: Math.floor,
|
|
@@ -2738,7 +2728,7 @@ Rt.prototype.value = Zt;
|
|
|
2738
2728
|
for (const e of ["formatRange", "formatRangeToParts"]) vt.prototype[e] || delete Zt[e];
|
|
2739
2729
|
Object.defineProperties(DateTimeFormat, Rt), DateTimeFormat.prototype.constructor = DateTimeFormat, defineStringTag(DateTimeFormat.prototype, "Intl.DateTimeFormat");
|
|
2740
2730
|
const Nt = /* @__PURE__ */ new WeakMap();
|
|
2741
|
-
var Mt = class {
|
|
2731
|
+
var Mt = class Instant {
|
|
2742
2732
|
constructor(e) {
|
|
2743
2733
|
createTemporalInstant(validateEpochNanoseconds(createEpochNanosecondsFromBigInt(toBigInt(e))), this);
|
|
2744
2734
|
}
|
|
@@ -2798,7 +2788,7 @@ var Mt = class {
|
|
|
2798
2788
|
return createTemporalZonedDateTime(getInternalSlotOrThrowForInstant(this).Y, toTemporalTimeZoneIdentifier(e), "iso8601");
|
|
2799
2789
|
}
|
|
2800
2790
|
};
|
|
2801
|
-
defineStringTag(Mt.prototype, "Temporal.Instant")
|
|
2791
|
+
defineStringTag(Mt.prototype, "Temporal.Instant");
|
|
2802
2792
|
const Ut = { toTemporalInstant() {
|
|
2803
2793
|
const e = Date.prototype.valueOf.call(this);
|
|
2804
2794
|
return e != e && throwRangeError("invalid date"), createTemporalInstant(createEpochNanosecondsFromEpochMilliseconds(e));
|