@rikdotcodes/temporal-polyfill 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +214 -0
- package/chunks/classApi.cjs +587 -0
- package/chunks/classApi.js +582 -0
- package/chunks/internal.cjs +3076 -0
- package/chunks/internal.js +3280 -0
- package/global.cjs +11 -0
- package/global.d.cts +1 -0
- package/global.d.ts +1 -0
- package/global.esm.js +11 -0
- package/global.js +3422 -0
- package/global.min.js +1 -0
- package/impl.cjs +5 -0
- package/impl.d.cts +1 -0
- package/impl.d.ts +1 -0
- package/impl.js +1 -0
- package/index.cjs +5 -0
- package/index.d.cts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,582 @@
|
|
|
1
|
+
function createSlotClass(i, l, s, c, u) {
|
|
2
|
+
function Class(...t) {
|
|
3
|
+
if (!(this instanceof Class)) {
|
|
4
|
+
throw new TypeError(a);
|
|
5
|
+
}
|
|
6
|
+
un(this, l(...t));
|
|
7
|
+
}
|
|
8
|
+
function bindMethod(t, e) {
|
|
9
|
+
return Object.defineProperties((function(...e) {
|
|
10
|
+
return t.call(this, getSpecificSlots(this), ...e);
|
|
11
|
+
}), r(e));
|
|
12
|
+
}
|
|
13
|
+
function getSpecificSlots(t) {
|
|
14
|
+
const e = cn(t);
|
|
15
|
+
if (!e || e.branding !== i) {
|
|
16
|
+
throw new TypeError(a);
|
|
17
|
+
}
|
|
18
|
+
return e;
|
|
19
|
+
}
|
|
20
|
+
return Object.defineProperties(Class.prototype, {
|
|
21
|
+
...t(e(bindMethod, s)),
|
|
22
|
+
...n(e(bindMethod, c)),
|
|
23
|
+
...o("Temporal." + i)
|
|
24
|
+
}), Object.defineProperties(Class, {
|
|
25
|
+
...n(u),
|
|
26
|
+
...r(i)
|
|
27
|
+
}), [ Class, t => {
|
|
28
|
+
const e = Object.create(Class.prototype);
|
|
29
|
+
return un(e, t), e;
|
|
30
|
+
}, getSpecificSlots ];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function rejectInvalidBag(t) {
|
|
34
|
+
if (cn(t) || void 0 !== t.calendar || void 0 !== t.timeZone) {
|
|
35
|
+
throw new TypeError(i);
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function getCalendarIdFromBag(t) {
|
|
41
|
+
return extractCalendarIdFromBag(t) || l;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function extractCalendarIdFromBag(t) {
|
|
45
|
+
const {calendar: e} = t;
|
|
46
|
+
if (void 0 !== e) {
|
|
47
|
+
return refineCalendarArg(e);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function refineCalendarArg(t) {
|
|
52
|
+
if (s(t)) {
|
|
53
|
+
const {calendar: e} = cn(t) || {};
|
|
54
|
+
if (!e) {
|
|
55
|
+
throw new TypeError(c(t));
|
|
56
|
+
}
|
|
57
|
+
return e;
|
|
58
|
+
}
|
|
59
|
+
return (t => u(f(m(t))))(t);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function createCalendarGetters(t) {
|
|
63
|
+
const e = {};
|
|
64
|
+
for (const n in t) {
|
|
65
|
+
e[n] = t => {
|
|
66
|
+
const {calendar: e} = t;
|
|
67
|
+
return C(e)[n](t);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return e;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function neverValueOf() {
|
|
74
|
+
throw new TypeError(b);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function refineTimeZoneArg(t) {
|
|
78
|
+
if (s(t)) {
|
|
79
|
+
const {timeZone: e} = cn(t) || {};
|
|
80
|
+
if (!e) {
|
|
81
|
+
throw new TypeError(F(t));
|
|
82
|
+
}
|
|
83
|
+
return e;
|
|
84
|
+
}
|
|
85
|
+
return (t => M(Z(m(t))))(t);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function toDurationSlots(t) {
|
|
89
|
+
if (s(t)) {
|
|
90
|
+
const e = cn(t);
|
|
91
|
+
return e && e.branding === N ? e : q(t);
|
|
92
|
+
}
|
|
93
|
+
return R(t);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function refinePublicRelativeTo(t) {
|
|
97
|
+
if (void 0 !== t) {
|
|
98
|
+
if (s(t)) {
|
|
99
|
+
const e = cn(t) || {};
|
|
100
|
+
switch (e.branding) {
|
|
101
|
+
case z:
|
|
102
|
+
case G:
|
|
103
|
+
return e;
|
|
104
|
+
|
|
105
|
+
case x:
|
|
106
|
+
return W(e);
|
|
107
|
+
}
|
|
108
|
+
const n = getCalendarIdFromBag(t);
|
|
109
|
+
return {
|
|
110
|
+
...$(refineTimeZoneArg, L, C(n), t),
|
|
111
|
+
calendar: n
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return H(t);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function toPlainTimeSlots(t, e) {
|
|
119
|
+
if (s(t)) {
|
|
120
|
+
const n = cn(t) || {};
|
|
121
|
+
switch (n.branding) {
|
|
122
|
+
case ft:
|
|
123
|
+
return mt(e), n;
|
|
124
|
+
|
|
125
|
+
case x:
|
|
126
|
+
return mt(e), St(n);
|
|
127
|
+
|
|
128
|
+
case z:
|
|
129
|
+
return mt(e), dt(L, n);
|
|
130
|
+
}
|
|
131
|
+
return Tt(t, e);
|
|
132
|
+
}
|
|
133
|
+
const n = ht(t);
|
|
134
|
+
return mt(e), n;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function optionalToPlainTimeFields(t) {
|
|
138
|
+
return void 0 === t ? void 0 : toPlainTimeSlots(t);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function toPlainDateTimeSlots(t, e) {
|
|
142
|
+
if (s(t)) {
|
|
143
|
+
const n = cn(t) || {};
|
|
144
|
+
switch (n.branding) {
|
|
145
|
+
case x:
|
|
146
|
+
return mt(e), n;
|
|
147
|
+
|
|
148
|
+
case G:
|
|
149
|
+
return mt(e), jt({
|
|
150
|
+
...n,
|
|
151
|
+
...Nt
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
case z:
|
|
155
|
+
return mt(e), yt(L, n);
|
|
156
|
+
}
|
|
157
|
+
return At(C(getCalendarIdFromBag(t)), t, e);
|
|
158
|
+
}
|
|
159
|
+
const n = Bt(t);
|
|
160
|
+
return mt(e), n;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function toPlainMonthDaySlots(t, e) {
|
|
164
|
+
if (s(t)) {
|
|
165
|
+
const n = cn(t);
|
|
166
|
+
if (n && n.branding === qt) {
|
|
167
|
+
return mt(e), n;
|
|
168
|
+
}
|
|
169
|
+
const o = extractCalendarIdFromBag(t);
|
|
170
|
+
return Rt(C(o || l), !o, t, e);
|
|
171
|
+
}
|
|
172
|
+
const n = xt(C, t);
|
|
173
|
+
return mt(e), n;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function toPlainYearMonthSlots(t, e) {
|
|
177
|
+
if (s(t)) {
|
|
178
|
+
const n = cn(t);
|
|
179
|
+
return n && n.branding === Ut ? (mt(e), n) : Xt(C(getCalendarIdFromBag(t)), t, e);
|
|
180
|
+
}
|
|
181
|
+
const n = _t(C, t);
|
|
182
|
+
return mt(e), n;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function toPlainDateSlots(t, e) {
|
|
186
|
+
if (s(t)) {
|
|
187
|
+
const n = cn(t) || {};
|
|
188
|
+
switch (n.branding) {
|
|
189
|
+
case G:
|
|
190
|
+
return mt(e), n;
|
|
191
|
+
|
|
192
|
+
case x:
|
|
193
|
+
return mt(e), W(n);
|
|
194
|
+
|
|
195
|
+
case z:
|
|
196
|
+
return mt(e), fe(L, n);
|
|
197
|
+
}
|
|
198
|
+
return me(C(getCalendarIdFromBag(t)), t, e);
|
|
199
|
+
}
|
|
200
|
+
const n = de(t);
|
|
201
|
+
return mt(e), n;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function toZonedDateTimeSlots(t, e) {
|
|
205
|
+
if (s(t)) {
|
|
206
|
+
const n = cn(t);
|
|
207
|
+
if (n && n.branding === z) {
|
|
208
|
+
return je(e), n;
|
|
209
|
+
}
|
|
210
|
+
const o = getCalendarIdFromBag(t);
|
|
211
|
+
return Ne(refineTimeZoneArg, L, C(o), o, t, e);
|
|
212
|
+
}
|
|
213
|
+
return Ae(t, e);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function adaptDateMethods(t) {
|
|
217
|
+
return e((t => e => t(slotsToIso(e))), t);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function slotsToIso(t) {
|
|
221
|
+
return he(t, L);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function toInstantSlots(t) {
|
|
225
|
+
if (s(t)) {
|
|
226
|
+
const e = cn(t);
|
|
227
|
+
if (e) {
|
|
228
|
+
switch (e.branding) {
|
|
229
|
+
case Re:
|
|
230
|
+
return e;
|
|
231
|
+
|
|
232
|
+
case z:
|
|
233
|
+
return xe(e.epochNanoseconds);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return We(t);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function toTemporalInstant() {
|
|
241
|
+
const t = Date.prototype.valueOf.call(this);
|
|
242
|
+
return Kn(xe(Ge(ze(t), Qe)));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function createDateTimeFormatClass() {
|
|
246
|
+
function DateTimeFormatFunc(t, e) {
|
|
247
|
+
return new DateTimeFormatNew(t, e);
|
|
248
|
+
}
|
|
249
|
+
function DateTimeFormatNew(t, e = Object.create(null)) {
|
|
250
|
+
to.set(this, ((t, e) => {
|
|
251
|
+
const n = new en(t, e), o = n.resolvedOptions(), r = o.locale, a = nn(Object.keys(e), o), i = on(createFormatPrepperForBranding), prepFormat = (t, ...e) => {
|
|
252
|
+
if (t) {
|
|
253
|
+
if (2 !== e.length) {
|
|
254
|
+
throw new TypeError(ln);
|
|
255
|
+
}
|
|
256
|
+
for (const t of e) {
|
|
257
|
+
if (void 0 === t) {
|
|
258
|
+
throw new TypeError(ln);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
t || void 0 !== e[0] || (e = []);
|
|
263
|
+
const o = e.map((t => cn(t) || Number(t)));
|
|
264
|
+
let l, s = 0;
|
|
265
|
+
for (const t of o) {
|
|
266
|
+
const e = "object" == typeof t ? t.branding : void 0;
|
|
267
|
+
if (s++ && e !== l) {
|
|
268
|
+
throw new TypeError(ln);
|
|
269
|
+
}
|
|
270
|
+
l = e;
|
|
271
|
+
}
|
|
272
|
+
return l ? i(l)(r, a, ...o) : [ n, ...o ];
|
|
273
|
+
};
|
|
274
|
+
return prepFormat.o = n, prepFormat;
|
|
275
|
+
})(t, e));
|
|
276
|
+
}
|
|
277
|
+
const t = en.prototype, e = Object.getOwnPropertyDescriptors(t), n = Object.getOwnPropertyDescriptors(en);
|
|
278
|
+
for (const t in e) {
|
|
279
|
+
const n = e[t], o = t.startsWith("format") && createFormatMethod(t);
|
|
280
|
+
"function" == typeof n.value ? n.value = "constructor" === t ? DateTimeFormatFunc : o || createProxiedMethod(t) : o && (n.get = function() {
|
|
281
|
+
if (!to.has(this)) {
|
|
282
|
+
throw new TypeError(a);
|
|
283
|
+
}
|
|
284
|
+
return (...t) => o.apply(this, t);
|
|
285
|
+
}, Object.defineProperties(n.get, r(`get ${t}`)));
|
|
286
|
+
}
|
|
287
|
+
return n.prototype.value = DateTimeFormatNew.prototype = Object.create({}, e), Object.defineProperties(DateTimeFormatFunc, n),
|
|
288
|
+
DateTimeFormatFunc;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
function createFormatMethod(t) {
|
|
292
|
+
return Object.defineProperties((function(...e) {
|
|
293
|
+
const n = to.get(this), [o, ...r] = n(t.includes("Range"), ...e);
|
|
294
|
+
return o[t](...r);
|
|
295
|
+
}), r(t));
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function createProxiedMethod(t) {
|
|
299
|
+
return Object.defineProperties((function(...e) {
|
|
300
|
+
return to.get(this).o[t](...e);
|
|
301
|
+
}), r(t));
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function createFormatPrepperForBranding(t) {
|
|
305
|
+
const e = Cn[t];
|
|
306
|
+
if (!e) {
|
|
307
|
+
throw new TypeError(rn(t));
|
|
308
|
+
}
|
|
309
|
+
return Q(e, on(an), 1);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
import { createGetterDescriptors as t, mapProps as e, createPropDescriptors as n, createStringTagDescriptors as o, createNameDescriptors as r, invalidCallingContext as a, invalidBag as i, isoCalendarId as l, isObjectLike as s, invalidCalendar as c, resolveCalendarId as u, parseCalendarId as f, requireString as m, requireStringOrUndefined as d, requireIntegerOrUndefined as S, requireInteger as T, requirePositiveInteger as h, requireBoolean as D, requirePositiveIntegerOrUndefined as P, mapPropNames as g, durationFieldNamesAsc as p, timeFieldNamesAsc as O, isoTimeFieldNamesAsc as w, getEpochMilli as I, getEpochNano as v, createNativeStandardOps as C, forbiddenValueOf as b, invalidTimeZone as F, resolveTimeZoneId as M, parseTimeZoneId as Z, getDurationBlank as y, constructDurationSlots as j, DurationBranding as N, durationWithFields as A, negateDuration as B, absDuration as Y, addDurations as E, queryNativeTimeZone as L, roundDuration as V, totalDuration as J, formatDurationIso as k, refineDurationBag as q, parseDuration as R, PlainDateTimeBranding as x, createPlainDateSlots as W, PlainDateBranding as G, ZonedDateTimeBranding as z, refineMaybeZonedDateTimeBag as $, parseRelativeToSlots as H, compareDurations as K, createFormatPrepper as Q, instantConfig as U, dateTimeConfig as X, dateConfig as _, timeConfig as tt, yearMonthConfig as et, monthDayConfig as nt, zonedConfig as ot, plainTimeWithFields as rt, movePlainTime as at, diffPlainTimes as it, roundPlainTime as lt, plainTimesEqual as st, formatPlainTimeIso as ct, constructPlainTimeSlots as ut, PlainTimeBranding as ft, refineOverflowOptions as mt, zonedDateTimeToPlainTime as dt, createPlainTimeSlots as St, refinePlainTimeBag as Tt, parsePlainTime as ht, compareIsoTimeFields as Dt, bindArgs as Pt, plainDateTimeWithFields as gt, slotsWithCalendarId as pt, plainDateTimeWithPlainTime as Ot, movePlainDateTime as wt, diffPlainDateTimes as It, roundPlainDateTime as vt, plainDateTimesEqual as Ct, plainDateTimeToZonedDateTime as bt, formatPlainDateTimeIso as Ft, refineCalendarId as Mt, constructPlainDateTimeSlots as Zt, zonedDateTimeToPlainDateTime as yt, createPlainDateTimeSlots as jt, isoTimeFieldDefaults as Nt, refinePlainDateTimeBag as At, parsePlainDateTime as Bt, compareIsoDateTimeFields as Yt, plainMonthDayWithFields as Et, plainMonthDaysEqual as Lt, plainMonthDayToPlainDate as Vt, formatPlainMonthDayIso as Jt, constructPlainMonthDaySlots as kt, PlainMonthDayBranding as qt, refinePlainMonthDayBag as Rt, parsePlainMonthDay as xt, plainYearMonthWithFields as Wt, movePlainYearMonth as Gt, diffPlainYearMonth as zt, plainYearMonthsEqual as $t, plainYearMonthToPlainDate as Ht, formatPlainYearMonthIso as Kt, constructPlainYearMonthSlots as Qt, PlainYearMonthBranding as Ut, refinePlainYearMonthBag as Xt, parsePlainYearMonth as _t, compareIsoDateFields as te, plainDateWithFields as ee, movePlainDate as ne, diffPlainDates as oe, plainDatesEqual as re, plainDateToZonedDateTime as ae, plainDateToPlainDateTime as ie, plainDateToPlainYearMonth as le, plainDateToPlainMonthDay as se, formatPlainDateIso as ce, constructPlainDateSlots as ue, zonedDateTimeToPlainDate as fe, refinePlainDateBag as me, parsePlainDate as de, formatOffsetNano as Se, computeZonedHoursInDay as Te, zonedEpochSlotsToIso as he, zonedDateTimeWithFields as De, slotsWithTimeZoneId as Pe, zonedDateTimeWithPlainTime as ge, moveZonedDateTime as pe, createDurationSlots as Oe, diffZonedDateTimes as we, roundZonedDateTime as Ie, computeZonedStartOfDay as ve, zonedDateTimesEqual as Ce, zonedDateTimeToInstant as be, formatZonedDateTimeIso as Fe, refineDirectionOptions as Me, refineTimeZoneId as Ze, constructZonedDateTimeSlots as ye, refineZonedFieldOptions as je, refineZonedDateTimeBag as Ne, parseZonedDateTime as Ae, compareZonedDateTimes as Be, moveInstant as Ye, diffInstants as Ee, roundInstant as Le, instantsEqual as Ve, instantToZonedDateTime as Je, formatInstantIso as ke, constructInstantSlots as qe, InstantBranding as Re, createInstantSlots as xe, parseInstant as We, numberToBigNano as Ge, requireNumberIsInteger as ze, epochMilliToInstant as $e, epochNanoToInstant as He, compareInstants as Ke, nanoInMilli as Qe, getCurrentTimeZoneId as Ue, getCurrentEpochNano as Xe, createZonedDateTimeSlots as _e, getCurrentIsoDateTime as tn, RawDateTimeFormat as en, pluckProps as nn, memoize as on, invalidFormatType as rn, createFormatForPrep as an, mismatchingFormatTypes as ln } from "./internal.js";
|
|
313
|
+
|
|
314
|
+
const sn = /*@__PURE__*/ new WeakMap, cn = /*@__PURE__*/ sn.get.bind(sn), un = /*@__PURE__*/ sn.set.bind(sn), fn = {
|
|
315
|
+
era: d,
|
|
316
|
+
eraYear: S,
|
|
317
|
+
year: T,
|
|
318
|
+
month: h,
|
|
319
|
+
daysInMonth: h,
|
|
320
|
+
daysInYear: h,
|
|
321
|
+
inLeapYear: D,
|
|
322
|
+
monthsInYear: h
|
|
323
|
+
}, mn = {
|
|
324
|
+
monthCode: m
|
|
325
|
+
}, dn = {
|
|
326
|
+
day: h
|
|
327
|
+
}, Sn = {
|
|
328
|
+
dayOfWeek: h,
|
|
329
|
+
dayOfYear: h,
|
|
330
|
+
weekOfYear: P,
|
|
331
|
+
yearOfWeek: S,
|
|
332
|
+
daysInWeek: h
|
|
333
|
+
}, Tn = /*@__PURE__*/ createCalendarGetters(/*@__PURE__*/ Object.assign({}, fn, mn, dn, Sn)), hn = /*@__PURE__*/ createCalendarGetters({
|
|
334
|
+
...fn,
|
|
335
|
+
...mn
|
|
336
|
+
}), Dn = /*@__PURE__*/ createCalendarGetters({
|
|
337
|
+
...mn,
|
|
338
|
+
...dn
|
|
339
|
+
}), Pn = {
|
|
340
|
+
calendarId: t => t.calendar
|
|
341
|
+
}, gn = /*@__PURE__*/ g((t => e => e[t]), p.concat("sign")), pn = /*@__PURE__*/ g(((t, e) => t => t[w[e]]), O), On = {
|
|
342
|
+
epochMilliseconds: I,
|
|
343
|
+
epochNanoseconds: v
|
|
344
|
+
}, [wn, In, vn] = createSlotClass(N, j, {
|
|
345
|
+
...gn,
|
|
346
|
+
blank: y
|
|
347
|
+
}, {
|
|
348
|
+
with: (t, e) => In(A(t, e)),
|
|
349
|
+
negated: t => In(B(t)),
|
|
350
|
+
abs: t => In(Y(t)),
|
|
351
|
+
add: (t, e, n) => In(E(refinePublicRelativeTo, C, L, 0, t, toDurationSlots(e), n)),
|
|
352
|
+
subtract: (t, e, n) => In(E(refinePublicRelativeTo, C, L, 1, t, toDurationSlots(e), n)),
|
|
353
|
+
round: (t, e) => In(V(refinePublicRelativeTo, C, L, t, e)),
|
|
354
|
+
total: (t, e) => J(refinePublicRelativeTo, C, L, t, e),
|
|
355
|
+
toLocaleString(t, e, n) {
|
|
356
|
+
return Intl.DurationFormat ? new Intl.DurationFormat(e, n).format(this) : k(t);
|
|
357
|
+
},
|
|
358
|
+
toString: k,
|
|
359
|
+
toJSON: t => k(t),
|
|
360
|
+
valueOf: neverValueOf
|
|
361
|
+
}, {
|
|
362
|
+
from: t => In(toDurationSlots(t)),
|
|
363
|
+
compare: (t, e, n) => K(refinePublicRelativeTo, C, L, toDurationSlots(t), toDurationSlots(e), n)
|
|
364
|
+
}), Cn = {
|
|
365
|
+
Instant: U,
|
|
366
|
+
PlainDateTime: X,
|
|
367
|
+
PlainDate: _,
|
|
368
|
+
PlainTime: tt,
|
|
369
|
+
PlainYearMonth: et,
|
|
370
|
+
PlainMonthDay: nt
|
|
371
|
+
}, bn = /*@__PURE__*/ Q(U), Fn = /*@__PURE__*/ Q(ot), Mn = /*@__PURE__*/ Q(X), Zn = /*@__PURE__*/ Q(_), yn = /*@__PURE__*/ Q(tt), jn = /*@__PURE__*/ Q(et), Nn = /*@__PURE__*/ Q(nt), [An, Bn] = createSlotClass(ft, ut, pn, {
|
|
372
|
+
with(t, e, n) {
|
|
373
|
+
return Bn(rt(this, rejectInvalidBag(e), n));
|
|
374
|
+
},
|
|
375
|
+
add: (t, e) => Bn(at(0, t, toDurationSlots(e))),
|
|
376
|
+
subtract: (t, e) => Bn(at(1, t, toDurationSlots(e))),
|
|
377
|
+
until: (t, e, n) => In(it(0, t, toPlainTimeSlots(e), n)),
|
|
378
|
+
since: (t, e, n) => In(it(1, t, toPlainTimeSlots(e), n)),
|
|
379
|
+
round: (t, e) => Bn(lt(t, e)),
|
|
380
|
+
equals: (t, e) => st(t, toPlainTimeSlots(e)),
|
|
381
|
+
toLocaleString(t, e, n) {
|
|
382
|
+
const [o, r] = yn(e, n, t);
|
|
383
|
+
return o.format(r);
|
|
384
|
+
},
|
|
385
|
+
toString: ct,
|
|
386
|
+
toJSON: t => ct(t),
|
|
387
|
+
valueOf: neverValueOf
|
|
388
|
+
}, {
|
|
389
|
+
from: (t, e) => Bn(toPlainTimeSlots(t, e)),
|
|
390
|
+
compare: (t, e) => Dt(toPlainTimeSlots(t), toPlainTimeSlots(e))
|
|
391
|
+
}), [Yn, En] = createSlotClass(x, Pt(Zt, Mt), {
|
|
392
|
+
...Pn,
|
|
393
|
+
...Tn,
|
|
394
|
+
...pn
|
|
395
|
+
}, {
|
|
396
|
+
with: (t, e, n) => En(gt(C, t, rejectInvalidBag(e), n)),
|
|
397
|
+
withCalendar: (t, e) => En(pt(t, refineCalendarArg(e))),
|
|
398
|
+
withPlainTime: (t, e) => En(Ot(t, optionalToPlainTimeFields(e))),
|
|
399
|
+
add: (t, e, n) => En(wt(C, 0, t, toDurationSlots(e), n)),
|
|
400
|
+
subtract: (t, e, n) => En(wt(C, 1, t, toDurationSlots(e), n)),
|
|
401
|
+
until: (t, e, n) => In(It(C, 0, t, toPlainDateTimeSlots(e), n)),
|
|
402
|
+
since: (t, e, n) => In(It(C, 1, t, toPlainDateTimeSlots(e), n)),
|
|
403
|
+
round: (t, e) => En(vt(t, e)),
|
|
404
|
+
equals: (t, e) => Ct(t, toPlainDateTimeSlots(e)),
|
|
405
|
+
toZonedDateTime: (t, e, n) => $n(bt(L, t, refineTimeZoneArg(e), n)),
|
|
406
|
+
toPlainDate: t => Wn(W(t)),
|
|
407
|
+
toPlainTime: t => Bn(St(t)),
|
|
408
|
+
toLocaleString(t, e, n) {
|
|
409
|
+
const [o, r] = Mn(e, n, t);
|
|
410
|
+
return o.format(r);
|
|
411
|
+
},
|
|
412
|
+
toString: Ft,
|
|
413
|
+
toJSON: t => Ft(t),
|
|
414
|
+
valueOf: neverValueOf
|
|
415
|
+
}, {
|
|
416
|
+
from: (t, e) => En(toPlainDateTimeSlots(t, e)),
|
|
417
|
+
compare: (t, e) => Yt(toPlainDateTimeSlots(t), toPlainDateTimeSlots(e))
|
|
418
|
+
}), [Ln, Vn, Jn] = createSlotClass(qt, Pt(kt, Mt), {
|
|
419
|
+
...Pn,
|
|
420
|
+
...Dn
|
|
421
|
+
}, {
|
|
422
|
+
with: (t, e, n) => Vn(Et(C, t, rejectInvalidBag(e), n)),
|
|
423
|
+
equals: (t, e) => Lt(t, toPlainMonthDaySlots(e)),
|
|
424
|
+
toPlainDate(t, e) {
|
|
425
|
+
return Wn(Vt(C, t, this, e));
|
|
426
|
+
},
|
|
427
|
+
toLocaleString(t, e, n) {
|
|
428
|
+
const [o, r] = Nn(e, n, t);
|
|
429
|
+
return o.format(r);
|
|
430
|
+
},
|
|
431
|
+
toString: Jt,
|
|
432
|
+
toJSON: t => Jt(t),
|
|
433
|
+
valueOf: neverValueOf
|
|
434
|
+
}, {
|
|
435
|
+
from: (t, e) => Vn(toPlainMonthDaySlots(t, e))
|
|
436
|
+
}), [kn, qn, Rn] = createSlotClass(Ut, Pt(Qt, Mt), {
|
|
437
|
+
...Pn,
|
|
438
|
+
...hn
|
|
439
|
+
}, {
|
|
440
|
+
with: (t, e, n) => qn(Wt(C, t, rejectInvalidBag(e), n)),
|
|
441
|
+
add: (t, e, n) => qn(Gt(C, 0, t, toDurationSlots(e), n)),
|
|
442
|
+
subtract: (t, e, n) => qn(Gt(C, 1, t, toDurationSlots(e), n)),
|
|
443
|
+
until: (t, e, n) => In(zt(C, 0, t, toPlainYearMonthSlots(e), n)),
|
|
444
|
+
since: (t, e, n) => In(zt(C, 1, t, toPlainYearMonthSlots(e), n)),
|
|
445
|
+
equals: (t, e) => $t(t, toPlainYearMonthSlots(e)),
|
|
446
|
+
toPlainDate(t, e) {
|
|
447
|
+
return Wn(Ht(C, t, this, e));
|
|
448
|
+
},
|
|
449
|
+
toLocaleString(t, e, n) {
|
|
450
|
+
const [o, r] = jn(e, n, t);
|
|
451
|
+
return o.format(r);
|
|
452
|
+
},
|
|
453
|
+
toString: Kt,
|
|
454
|
+
toJSON: t => Kt(t),
|
|
455
|
+
valueOf: neverValueOf
|
|
456
|
+
}, {
|
|
457
|
+
from: (t, e) => qn(toPlainYearMonthSlots(t, e)),
|
|
458
|
+
compare: (t, e) => te(toPlainYearMonthSlots(t), toPlainYearMonthSlots(e))
|
|
459
|
+
}), [xn, Wn, Gn] = createSlotClass(G, Pt(ue, Mt), {
|
|
460
|
+
...Pn,
|
|
461
|
+
...Tn
|
|
462
|
+
}, {
|
|
463
|
+
with: (t, e, n) => Wn(ee(C, t, rejectInvalidBag(e), n)),
|
|
464
|
+
withCalendar: (t, e) => Wn(pt(t, refineCalendarArg(e))),
|
|
465
|
+
add: (t, e, n) => Wn(ne(C, 0, t, toDurationSlots(e), n)),
|
|
466
|
+
subtract: (t, e, n) => Wn(ne(C, 1, t, toDurationSlots(e), n)),
|
|
467
|
+
until: (t, e, n) => In(oe(C, 0, t, toPlainDateSlots(e), n)),
|
|
468
|
+
since: (t, e, n) => In(oe(C, 1, t, toPlainDateSlots(e), n)),
|
|
469
|
+
equals: (t, e) => re(t, toPlainDateSlots(e)),
|
|
470
|
+
toZonedDateTime(t, e) {
|
|
471
|
+
const n = s(e) ? e : {
|
|
472
|
+
timeZone: e
|
|
473
|
+
};
|
|
474
|
+
return $n(ae(refineTimeZoneArg, toPlainTimeSlots, L, t, n));
|
|
475
|
+
},
|
|
476
|
+
toPlainDateTime: (t, e) => En(ie(t, optionalToPlainTimeFields(e))),
|
|
477
|
+
toPlainYearMonth(t) {
|
|
478
|
+
return qn(le(C, t, this));
|
|
479
|
+
},
|
|
480
|
+
toPlainMonthDay(t) {
|
|
481
|
+
return Vn(se(C, t, this));
|
|
482
|
+
},
|
|
483
|
+
toLocaleString(t, e, n) {
|
|
484
|
+
const [o, r] = Zn(e, n, t);
|
|
485
|
+
return o.format(r);
|
|
486
|
+
},
|
|
487
|
+
toString: ce,
|
|
488
|
+
toJSON: t => ce(t),
|
|
489
|
+
valueOf: neverValueOf
|
|
490
|
+
}, {
|
|
491
|
+
from: (t, e) => Wn(toPlainDateSlots(t, e)),
|
|
492
|
+
compare: (t, e) => te(toPlainDateSlots(t), toPlainDateSlots(e))
|
|
493
|
+
}), [zn, $n] = createSlotClass(z, Pt(ye, Mt, Ze), {
|
|
494
|
+
...On,
|
|
495
|
+
...Pn,
|
|
496
|
+
...adaptDateMethods(Tn),
|
|
497
|
+
...adaptDateMethods(pn),
|
|
498
|
+
offset: t => Se(slotsToIso(t).offsetNanoseconds),
|
|
499
|
+
offsetNanoseconds: t => slotsToIso(t).offsetNanoseconds,
|
|
500
|
+
timeZoneId: t => t.timeZone,
|
|
501
|
+
hoursInDay: t => Te(L, t)
|
|
502
|
+
}, {
|
|
503
|
+
with: (t, e, n) => $n(De(C, L, t, rejectInvalidBag(e), n)),
|
|
504
|
+
withCalendar: (t, e) => $n(pt(t, refineCalendarArg(e))),
|
|
505
|
+
withTimeZone: (t, e) => $n(Pe(t, refineTimeZoneArg(e))),
|
|
506
|
+
withPlainTime: (t, e) => $n(ge(L, t, optionalToPlainTimeFields(e))),
|
|
507
|
+
add: (t, e, n) => $n(pe(C, L, 0, t, toDurationSlots(e), n)),
|
|
508
|
+
subtract: (t, e, n) => $n(pe(C, L, 1, t, toDurationSlots(e), n)),
|
|
509
|
+
until: (t, e, n) => In(Oe(we(C, L, 0, t, toZonedDateTimeSlots(e), n))),
|
|
510
|
+
since: (t, e, n) => In(Oe(we(C, L, 1, t, toZonedDateTimeSlots(e), n))),
|
|
511
|
+
round: (t, e) => $n(Ie(L, t, e)),
|
|
512
|
+
startOfDay: t => $n(ve(L, t)),
|
|
513
|
+
equals: (t, e) => Ce(t, toZonedDateTimeSlots(e)),
|
|
514
|
+
toInstant: t => Kn(be(t)),
|
|
515
|
+
toPlainDateTime: t => En(yt(L, t)),
|
|
516
|
+
toPlainDate: t => Wn(fe(L, t)),
|
|
517
|
+
toPlainTime: t => Bn(dt(L, t)),
|
|
518
|
+
toLocaleString(t, e, n = {}) {
|
|
519
|
+
const [o, r] = Fn(e, n, t);
|
|
520
|
+
return o.format(r);
|
|
521
|
+
},
|
|
522
|
+
toString: (t, e) => Fe(L, t, e),
|
|
523
|
+
toJSON: t => Fe(L, t),
|
|
524
|
+
valueOf: neverValueOf,
|
|
525
|
+
getTimeZoneTransition(t, e) {
|
|
526
|
+
const {timeZone: n, epochNanoseconds: o} = t, r = Me(e), a = L(n).i(o, r);
|
|
527
|
+
return a ? $n({
|
|
528
|
+
...t,
|
|
529
|
+
epochNanoseconds: a
|
|
530
|
+
}) : null;
|
|
531
|
+
}
|
|
532
|
+
}, {
|
|
533
|
+
from: (t, e) => $n(toZonedDateTimeSlots(t, e)),
|
|
534
|
+
compare: (t, e) => Be(toZonedDateTimeSlots(t), toZonedDateTimeSlots(e))
|
|
535
|
+
}), [Hn, Kn, Qn] = createSlotClass(Re, qe, On, {
|
|
536
|
+
add: (t, e) => Kn(Ye(0, t, toDurationSlots(e))),
|
|
537
|
+
subtract: (t, e) => Kn(Ye(1, t, toDurationSlots(e))),
|
|
538
|
+
until: (t, e, n) => In(Ee(0, t, toInstantSlots(e), n)),
|
|
539
|
+
since: (t, e, n) => In(Ee(1, t, toInstantSlots(e), n)),
|
|
540
|
+
round: (t, e) => Kn(Le(t, e)),
|
|
541
|
+
equals: (t, e) => Ve(t, toInstantSlots(e)),
|
|
542
|
+
toZonedDateTimeISO: (t, e) => $n(Je(t, refineTimeZoneArg(e))),
|
|
543
|
+
toLocaleString(t, e, n) {
|
|
544
|
+
const [o, r] = bn(e, n, t);
|
|
545
|
+
return o.format(r);
|
|
546
|
+
},
|
|
547
|
+
toString: (t, e) => ke(refineTimeZoneArg, L, t, e),
|
|
548
|
+
toJSON: t => ke(refineTimeZoneArg, L, t),
|
|
549
|
+
valueOf: neverValueOf
|
|
550
|
+
}, {
|
|
551
|
+
from: t => Kn(toInstantSlots(t)),
|
|
552
|
+
fromEpochMilliseconds: t => Kn($e(t)),
|
|
553
|
+
fromEpochNanoseconds: t => Kn(He(t)),
|
|
554
|
+
compare: (t, e) => Ke(toInstantSlots(t), toInstantSlots(e))
|
|
555
|
+
}), Un = /*@__PURE__*/ Object.defineProperties({}, {
|
|
556
|
+
...o("Temporal.Now"),
|
|
557
|
+
...n({
|
|
558
|
+
timeZoneId: () => Ue(),
|
|
559
|
+
instant: () => Kn(xe(Xe())),
|
|
560
|
+
zonedDateTimeISO: (t = Ue()) => $n(_e(Xe(), refineTimeZoneArg(t), l)),
|
|
561
|
+
plainDateTimeISO: (t = Ue()) => En(jt(tn(L(refineTimeZoneArg(t))), l)),
|
|
562
|
+
plainDateISO: (t = Ue()) => Wn(W(tn(L(refineTimeZoneArg(t))), l)),
|
|
563
|
+
plainTimeISO: (t = Ue()) => Bn(St(tn(L(refineTimeZoneArg(t)))))
|
|
564
|
+
})
|
|
565
|
+
}), Xn = /*@__PURE__*/ Object.defineProperties({}, {
|
|
566
|
+
...o("Temporal"),
|
|
567
|
+
...n({
|
|
568
|
+
PlainYearMonth: kn,
|
|
569
|
+
PlainMonthDay: Ln,
|
|
570
|
+
PlainDate: xn,
|
|
571
|
+
PlainTime: An,
|
|
572
|
+
PlainDateTime: Yn,
|
|
573
|
+
ZonedDateTime: zn,
|
|
574
|
+
Instant: Hn,
|
|
575
|
+
Duration: wn,
|
|
576
|
+
Now: Un
|
|
577
|
+
})
|
|
578
|
+
}), _n = /*@__PURE__*/ createDateTimeFormatClass(), to = /*@__PURE__*/ new WeakMap, eo = /*@__PURE__*/ Object.defineProperties(Object.create(Intl), n({
|
|
579
|
+
DateTimeFormat: _n
|
|
580
|
+
}));
|
|
581
|
+
|
|
582
|
+
export { _n as DateTimeFormat, eo as IntlExtended, Xn as Temporal, toTemporalInstant };
|