@oneclick.dev/cms-core-modules 0.0.64 → 0.0.66
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/{Create-Cf7pvh5G.mjs → Create-Lnus48i-.mjs} +1 -1
- package/dist/{Create-Bh4g6QW4.js → Create-Up0iauPG.js} +1 -1
- package/dist/{DateFormatter-DsmlAuYV.mjs → DateFormatter-CxPCk9KT.mjs} +268 -400
- package/dist/DateFormatter-DKlDa1Jq.js +1 -0
- package/dist/{Detail-CtbWzq-R.js → Detail-BPSuxN2J.js} +1 -1
- package/dist/{Detail-D10shmpK.mjs → Detail-Bz2rvLw7.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-DkgDWC2i.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-CZmLnut_.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-DRVxQswt.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-DMnulmdl.js} +1 -1
- package/dist/{TableView-Dbl8qcUy.mjs → TableView-DnQLQHx6.mjs} +35211 -33718
- package/dist/{TableView-BqhL_P45.js → TableView-ifyIKxNm.js} +118 -101
- package/dist/{agenda-DFNJ8C1N.mjs → agenda-By_hEZ4I.mjs} +2 -2
- package/dist/{agenda-MjkwV63A.js → agenda-D4jdNRbI.js} +1 -1
- package/dist/{exceptions-BFchkR06.mjs → exceptions-B0kOmB-_.mjs} +1 -1
- package/dist/{exceptions-C-DPRNQa.js → exceptions-DGnziH-3.js} +1 -1
- package/dist/{index-X0L4AHBR.mjs → index--0-qy_7x.mjs} +1924 -1953
- package/dist/{index-CgfL8UKf-DUUg9HDA.mjs → index-CzoYAqKd-iAfM7ky8.mjs} +1178 -1239
- package/dist/index-CzoYAqKd-rheC_QgC.js +88 -0
- package/dist/index-DIg9ePkI.js +245 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +6 -6
- package/package.json +2 -2
- package/dist/DateFormatter-BPPBZp1j.js +0 -1
- package/dist/index-CgfL8UKf-DAN7RkzR.js +0 -88
- package/dist/index-DBDq-h4j.js +0 -245
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
function
|
|
1
|
+
function B(e, t) {
|
|
2
2
|
return e - t * Math.floor(e / t);
|
|
3
3
|
}
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
t =
|
|
4
|
+
const X = 1721426;
|
|
5
|
+
function E(e, t, r, n) {
|
|
6
|
+
t = q(e, t);
|
|
7
7
|
let a = t - 1, o = -2;
|
|
8
|
-
return r <= 2 ? o = 0 :
|
|
8
|
+
return r <= 2 ? o = 0 : T(t) && (o = -1), X - 1 + 365 * a + Math.floor(a / 4) - Math.floor(a / 100) + Math.floor(a / 400) + Math.floor((367 * r - 362) / 12 + o + n);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function T(e) {
|
|
11
11
|
return e % 4 === 0 && (e % 100 !== 0 || e % 400 === 0);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function q(e, t) {
|
|
14
14
|
return e === "BC" ? 1 - t : t;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function me(e) {
|
|
17
17
|
let t = "AD";
|
|
18
18
|
return e <= 0 && (t = "BC", e = 1 - e), [
|
|
19
19
|
t,
|
|
20
20
|
e
|
|
21
21
|
];
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const be = {
|
|
24
24
|
standard: [
|
|
25
25
|
31,
|
|
26
26
|
28,
|
|
@@ -50,25 +50,25 @@ const pe = {
|
|
|
50
50
|
31
|
|
51
51
|
]
|
|
52
52
|
};
|
|
53
|
-
class
|
|
53
|
+
class g {
|
|
54
54
|
fromJulianDay(t) {
|
|
55
|
-
let r = t, n = r -
|
|
56
|
-
r <
|
|
57
|
-
let
|
|
58
|
-
return new
|
|
55
|
+
let r = t, n = r - X, a = Math.floor(n / 146097), o = B(n, 146097), c = Math.floor(o / 36524), i = B(o, 36524), l = Math.floor(i / 1461), h = B(i, 1461), p = Math.floor(h / 365), w = a * 400 + c * 100 + l * 4 + p + (c !== 4 && p !== 4 ? 1 : 0), [M, m] = me(w), y = r - E(M, m, 1, 1), A = 2;
|
|
56
|
+
r < E(M, m, 3, 1) ? A = 0 : T(m) && (A = 1);
|
|
57
|
+
let z = Math.floor(((y + A) * 12 + 373) / 367), ye = r - E(M, m, z, 1) + 1;
|
|
58
|
+
return new x(M, m, z, ye);
|
|
59
59
|
}
|
|
60
60
|
toJulianDay(t) {
|
|
61
|
-
return
|
|
61
|
+
return E(t.era, t.year, t.month, t.day);
|
|
62
62
|
}
|
|
63
63
|
getDaysInMonth(t) {
|
|
64
|
-
return
|
|
64
|
+
return be[T(t.year) ? "leapyear" : "standard"][t.month - 1];
|
|
65
65
|
}
|
|
66
66
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
67
67
|
getMonthsInYear(t) {
|
|
68
68
|
return 12;
|
|
69
69
|
}
|
|
70
70
|
getDaysInYear(t) {
|
|
71
|
-
return
|
|
71
|
+
return T(t.year) ? 366 : 365;
|
|
72
72
|
}
|
|
73
73
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
74
74
|
getYearsInEra(t) {
|
|
@@ -90,217 +90,85 @@ class w {
|
|
|
90
90
|
this.identifier = "gregory";
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
AD: 1,
|
|
96
|
-
AE: 6,
|
|
97
|
-
AF: 6,
|
|
98
|
-
AI: 1,
|
|
99
|
-
AL: 1,
|
|
100
|
-
AM: 1,
|
|
101
|
-
AN: 1,
|
|
102
|
-
AR: 1,
|
|
103
|
-
AT: 1,
|
|
104
|
-
AU: 1,
|
|
105
|
-
AX: 1,
|
|
106
|
-
AZ: 1,
|
|
107
|
-
BA: 1,
|
|
108
|
-
BE: 1,
|
|
109
|
-
BG: 1,
|
|
110
|
-
BH: 6,
|
|
111
|
-
BM: 1,
|
|
112
|
-
BN: 1,
|
|
113
|
-
BY: 1,
|
|
114
|
-
CH: 1,
|
|
115
|
-
CL: 1,
|
|
116
|
-
CM: 1,
|
|
117
|
-
CN: 1,
|
|
118
|
-
CR: 1,
|
|
119
|
-
CY: 1,
|
|
120
|
-
CZ: 1,
|
|
121
|
-
DE: 1,
|
|
122
|
-
DJ: 6,
|
|
123
|
-
DK: 1,
|
|
124
|
-
DZ: 6,
|
|
125
|
-
EC: 1,
|
|
126
|
-
EE: 1,
|
|
127
|
-
EG: 6,
|
|
128
|
-
ES: 1,
|
|
129
|
-
FI: 1,
|
|
130
|
-
FJ: 1,
|
|
131
|
-
FO: 1,
|
|
132
|
-
FR: 1,
|
|
133
|
-
GB: 1,
|
|
134
|
-
GE: 1,
|
|
135
|
-
GF: 1,
|
|
136
|
-
GP: 1,
|
|
137
|
-
GR: 1,
|
|
138
|
-
HR: 1,
|
|
139
|
-
HU: 1,
|
|
140
|
-
IE: 1,
|
|
141
|
-
IQ: 6,
|
|
142
|
-
IR: 6,
|
|
143
|
-
IS: 1,
|
|
144
|
-
IT: 1,
|
|
145
|
-
JO: 6,
|
|
146
|
-
KG: 1,
|
|
147
|
-
KW: 6,
|
|
148
|
-
KZ: 1,
|
|
149
|
-
LB: 1,
|
|
150
|
-
LI: 1,
|
|
151
|
-
LK: 1,
|
|
152
|
-
LT: 1,
|
|
153
|
-
LU: 1,
|
|
154
|
-
LV: 1,
|
|
155
|
-
LY: 6,
|
|
156
|
-
MC: 1,
|
|
157
|
-
MD: 1,
|
|
158
|
-
ME: 1,
|
|
159
|
-
MK: 1,
|
|
160
|
-
MN: 1,
|
|
161
|
-
MQ: 1,
|
|
162
|
-
MV: 5,
|
|
163
|
-
MY: 1,
|
|
164
|
-
NL: 1,
|
|
165
|
-
NO: 1,
|
|
166
|
-
NZ: 1,
|
|
167
|
-
OM: 6,
|
|
168
|
-
PL: 1,
|
|
169
|
-
QA: 6,
|
|
170
|
-
RE: 1,
|
|
171
|
-
RO: 1,
|
|
172
|
-
RS: 1,
|
|
173
|
-
RU: 1,
|
|
174
|
-
SD: 6,
|
|
175
|
-
SE: 1,
|
|
176
|
-
SI: 1,
|
|
177
|
-
SK: 1,
|
|
178
|
-
SM: 1,
|
|
179
|
-
SY: 6,
|
|
180
|
-
TJ: 1,
|
|
181
|
-
TM: 1,
|
|
182
|
-
TR: 1,
|
|
183
|
-
UA: 1,
|
|
184
|
-
UY: 1,
|
|
185
|
-
UZ: 1,
|
|
186
|
-
VA: 1,
|
|
187
|
-
VN: 1,
|
|
188
|
-
XK: 1
|
|
189
|
-
};
|
|
190
|
-
function re(e, t) {
|
|
191
|
-
return t = l(t, e.calendar), e.era === t.era && e.year === t.year && e.month === t.month && e.day === t.day;
|
|
93
|
+
function ee(e, t) {
|
|
94
|
+
return t = s(t, e.calendar), e.era === t.era && e.year === t.year && e.month === t.month && e.day === t.day;
|
|
192
95
|
}
|
|
193
|
-
function
|
|
194
|
-
return t =
|
|
96
|
+
function pe(e, t) {
|
|
97
|
+
return t = s(t, e.calendar), e = K(e), t = K(t), e.era === t.era && e.year === t.year && e.month === t.month;
|
|
195
98
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
99
|
+
function Le(e, t) {
|
|
100
|
+
return _(e.calendar, t.calendar) && ee(e, t);
|
|
198
101
|
}
|
|
199
|
-
function
|
|
200
|
-
return
|
|
102
|
+
function Ke(e, t) {
|
|
103
|
+
return _(e.calendar, t.calendar) && pe(e, t);
|
|
201
104
|
}
|
|
202
|
-
function
|
|
105
|
+
function _(e, t) {
|
|
203
106
|
var r, n, a, o;
|
|
204
107
|
return (o = (a = (r = e.isEqual) === null || r === void 0 ? void 0 : r.call(e, t)) !== null && a !== void 0 ? a : (n = t.isEqual) === null || n === void 0 ? void 0 : n.call(t, e)) !== null && o !== void 0 ? o : e.identifier === t.identifier;
|
|
205
108
|
}
|
|
206
|
-
function
|
|
207
|
-
return
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
109
|
+
function Ge(e, t) {
|
|
110
|
+
return ee(e, ge(t));
|
|
111
|
+
}
|
|
112
|
+
const we = {
|
|
113
|
+
sun: 0,
|
|
114
|
+
mon: 1,
|
|
115
|
+
tue: 2,
|
|
116
|
+
wed: 3,
|
|
117
|
+
thu: 4,
|
|
118
|
+
fri: 5,
|
|
119
|
+
sat: 6
|
|
120
|
+
};
|
|
121
|
+
function Qe(e, t, r) {
|
|
122
|
+
let n = e.calendar.toJulianDay(e), a = we[r], o = Math.ceil(n + 1 - a) % 7;
|
|
211
123
|
return o < 0 && (o += 7), o;
|
|
212
124
|
}
|
|
213
|
-
function
|
|
125
|
+
function Me(e) {
|
|
214
126
|
return d(Date.now(), e);
|
|
215
127
|
}
|
|
216
|
-
function
|
|
217
|
-
return
|
|
128
|
+
function ge(e) {
|
|
129
|
+
return Ie(Me(e));
|
|
218
130
|
}
|
|
219
|
-
function
|
|
131
|
+
function te(e, t) {
|
|
220
132
|
return e.calendar.toJulianDay(e) - t.calendar.toJulianDay(t);
|
|
221
133
|
}
|
|
222
|
-
function
|
|
223
|
-
return
|
|
134
|
+
function ve(e, t) {
|
|
135
|
+
return L(e) - L(t);
|
|
224
136
|
}
|
|
225
|
-
function
|
|
137
|
+
function L(e) {
|
|
226
138
|
return e.hour * 36e5 + e.minute * 6e4 + e.second * 1e3 + e.millisecond;
|
|
227
139
|
}
|
|
228
|
-
let
|
|
229
|
-
function
|
|
230
|
-
return
|
|
140
|
+
let O = null;
|
|
141
|
+
function re() {
|
|
142
|
+
return O == null && (O = new Intl.DateTimeFormat().resolvedOptions().timeZone), O;
|
|
231
143
|
}
|
|
232
|
-
function
|
|
144
|
+
function K(e) {
|
|
233
145
|
return e.subtract({
|
|
234
146
|
days: e.day - 1
|
|
235
147
|
});
|
|
236
148
|
}
|
|
237
|
-
function
|
|
149
|
+
function Xe(e) {
|
|
238
150
|
return e.add({
|
|
239
151
|
days: e.calendar.getDaysInMonth(e) - e.day
|
|
240
152
|
});
|
|
241
153
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return r || (r = new Intl.Locale(e).maximize().region, r && Q.set(e, r)), r;
|
|
247
|
-
}
|
|
248
|
-
let t = e.split("-")[1];
|
|
249
|
-
return t === "u" ? void 0 : t;
|
|
250
|
-
}
|
|
251
|
-
function Ee(e) {
|
|
252
|
-
let t = O.get(e);
|
|
253
|
-
if (!t) {
|
|
254
|
-
if (Intl.Locale) {
|
|
255
|
-
let n = new Intl.Locale(e);
|
|
256
|
-
if ("getWeekInfo" in n && (t = n.getWeekInfo(), t))
|
|
257
|
-
return O.set(e, t), t.firstDay;
|
|
258
|
-
}
|
|
259
|
-
let r = xe(e);
|
|
260
|
-
if (e.includes("-fw-")) {
|
|
261
|
-
let n = e.split("-fw-")[1].split("-")[0];
|
|
262
|
-
n === "mon" ? t = {
|
|
263
|
-
firstDay: 1
|
|
264
|
-
} : n === "tue" ? t = {
|
|
265
|
-
firstDay: 2
|
|
266
|
-
} : n === "wed" ? t = {
|
|
267
|
-
firstDay: 3
|
|
268
|
-
} : n === "thu" ? t = {
|
|
269
|
-
firstDay: 4
|
|
270
|
-
} : n === "fri" ? t = {
|
|
271
|
-
firstDay: 5
|
|
272
|
-
} : n === "sat" ? t = {
|
|
273
|
-
firstDay: 6
|
|
274
|
-
} : t = {
|
|
275
|
-
firstDay: 0
|
|
276
|
-
};
|
|
277
|
-
} else e.includes("-ca-iso8601") ? t = {
|
|
278
|
-
firstDay: 1
|
|
279
|
-
} : t = {
|
|
280
|
-
firstDay: r && ge[r] || 0
|
|
281
|
-
};
|
|
282
|
-
O.set(e, t);
|
|
283
|
-
}
|
|
284
|
-
return t.firstDay;
|
|
285
|
-
}
|
|
286
|
-
function D(e) {
|
|
287
|
-
e = l(e, new w());
|
|
288
|
-
let t = W(e.era, e.year);
|
|
289
|
-
return oe(t, e.month, e.day, e.hour, e.minute, e.second, e.millisecond);
|
|
154
|
+
function v(e) {
|
|
155
|
+
e = s(e, new g());
|
|
156
|
+
let t = q(e.era, e.year);
|
|
157
|
+
return ne(t, e.month, e.day, e.hour, e.minute, e.second, e.millisecond);
|
|
290
158
|
}
|
|
291
|
-
function
|
|
292
|
-
let
|
|
293
|
-
return
|
|
159
|
+
function ne(e, t, r, n, a, o, c) {
|
|
160
|
+
let i = /* @__PURE__ */ new Date();
|
|
161
|
+
return i.setUTCHours(n, a, o, c), i.setUTCFullYear(e, t - 1, r), i.getTime();
|
|
294
162
|
}
|
|
295
|
-
function
|
|
163
|
+
function Z(e, t) {
|
|
296
164
|
if (t === "UTC") return 0;
|
|
297
|
-
if (e > 0 && t ===
|
|
298
|
-
let { year: r, month: n, day: a, hour: o, minute:
|
|
299
|
-
return
|
|
165
|
+
if (e > 0 && t === re()) return new Date(e).getTimezoneOffset() * -6e4;
|
|
166
|
+
let { year: r, month: n, day: a, hour: o, minute: c, second: i } = ae(e, t);
|
|
167
|
+
return ne(r, n, a, o, c, i, 0) - Math.floor(e / 1e3) * 1e3;
|
|
300
168
|
}
|
|
301
|
-
const
|
|
302
|
-
function
|
|
303
|
-
let r =
|
|
169
|
+
const G = /* @__PURE__ */ new Map();
|
|
170
|
+
function ae(e, t) {
|
|
171
|
+
let r = G.get(t);
|
|
304
172
|
r || (r = new Intl.DateTimeFormat("en-US", {
|
|
305
173
|
timeZone: t,
|
|
306
174
|
hour12: !1,
|
|
@@ -311,7 +179,7 @@ function ie(e, t) {
|
|
|
311
179
|
hour: "numeric",
|
|
312
180
|
minute: "numeric",
|
|
313
181
|
second: "numeric"
|
|
314
|
-
}),
|
|
182
|
+
}), G.set(t, r));
|
|
315
183
|
let n = r.formatToParts(new Date(e)), a = {};
|
|
316
184
|
for (let o of n) o.type !== "literal" && (a[o.type] = o.value);
|
|
317
185
|
return {
|
|
@@ -324,165 +192,165 @@ function ie(e, t) {
|
|
|
324
192
|
second: +a.second
|
|
325
193
|
};
|
|
326
194
|
}
|
|
327
|
-
const
|
|
328
|
-
function
|
|
195
|
+
const Q = 864e5;
|
|
196
|
+
function De(e, t, r, n) {
|
|
329
197
|
return (r === n ? [
|
|
330
198
|
r
|
|
331
199
|
] : [
|
|
332
200
|
r,
|
|
333
201
|
n
|
|
334
|
-
]).filter((o) =>
|
|
202
|
+
]).filter((o) => xe(e, t, o));
|
|
335
203
|
}
|
|
336
|
-
function
|
|
337
|
-
let n =
|
|
204
|
+
function xe(e, t, r) {
|
|
205
|
+
let n = ae(r, t);
|
|
338
206
|
return e.year === n.year && e.month === n.month && e.day === n.day && e.hour === n.hour && e.minute === n.minute && e.second === n.second;
|
|
339
207
|
}
|
|
340
208
|
function u(e, t, r = "compatible") {
|
|
341
|
-
let n =
|
|
342
|
-
if (t === "UTC") return
|
|
343
|
-
if (t ===
|
|
344
|
-
n =
|
|
345
|
-
let
|
|
346
|
-
return
|
|
347
|
-
}
|
|
348
|
-
let a =
|
|
349
|
-
if (
|
|
350
|
-
if (
|
|
209
|
+
let n = D(e);
|
|
210
|
+
if (t === "UTC") return v(n);
|
|
211
|
+
if (t === re() && r === "compatible") {
|
|
212
|
+
n = s(n, new g());
|
|
213
|
+
let l = /* @__PURE__ */ new Date(), h = q(n.era, n.year);
|
|
214
|
+
return l.setFullYear(h, n.month - 1, n.day), l.setHours(n.hour, n.minute, n.second, n.millisecond), l.getTime();
|
|
215
|
+
}
|
|
216
|
+
let a = v(n), o = Z(a - Q, t), c = Z(a + Q, t), i = De(n, t, a - o, a - c);
|
|
217
|
+
if (i.length === 1) return i[0];
|
|
218
|
+
if (i.length > 1) switch (r) {
|
|
351
219
|
// 'compatible' means 'earlier' for "fall back" transitions
|
|
352
220
|
case "compatible":
|
|
353
221
|
case "earlier":
|
|
354
|
-
return
|
|
222
|
+
return i[0];
|
|
355
223
|
case "later":
|
|
356
|
-
return
|
|
224
|
+
return i[i.length - 1];
|
|
357
225
|
case "reject":
|
|
358
226
|
throw new RangeError("Multiple possible absolute times found");
|
|
359
227
|
}
|
|
360
228
|
switch (r) {
|
|
361
229
|
case "earlier":
|
|
362
|
-
return Math.min(a - o, a -
|
|
230
|
+
return Math.min(a - o, a - c);
|
|
363
231
|
// 'compatible' means 'later' for "spring forward" transitions
|
|
364
232
|
case "compatible":
|
|
365
233
|
case "later":
|
|
366
|
-
return Math.max(a - o, a -
|
|
234
|
+
return Math.max(a - o, a - c);
|
|
367
235
|
case "reject":
|
|
368
236
|
throw new RangeError("No such absolute time found");
|
|
369
237
|
}
|
|
370
238
|
}
|
|
371
|
-
function
|
|
239
|
+
function oe(e, t, r = "compatible") {
|
|
372
240
|
return new Date(u(e, t, r));
|
|
373
241
|
}
|
|
374
242
|
function d(e, t) {
|
|
375
|
-
let r =
|
|
376
|
-
return new
|
|
243
|
+
let r = Z(e, t), n = new Date(e + r), a = n.getUTCFullYear(), o = n.getUTCMonth() + 1, c = n.getUTCDate(), i = n.getUTCHours(), l = n.getUTCMinutes(), h = n.getUTCSeconds(), p = n.getUTCMilliseconds();
|
|
244
|
+
return new C(a < 1 ? "BC" : "AD", a < 1 ? -a + 1 : a, o, c, t, r, i, l, h, p);
|
|
377
245
|
}
|
|
378
|
-
function
|
|
379
|
-
return new
|
|
246
|
+
function Ie(e) {
|
|
247
|
+
return new x(e.calendar, e.era, e.year, e.month, e.day);
|
|
380
248
|
}
|
|
381
|
-
function
|
|
249
|
+
function D(e, t) {
|
|
382
250
|
let r = 0, n = 0, a = 0, o = 0;
|
|
383
251
|
if ("timeZone" in e) ({ hour: r, minute: n, second: a, millisecond: o } = e);
|
|
384
252
|
else if ("hour" in e && !t) return e;
|
|
385
|
-
return t && ({ hour: r, minute: n, second: a, millisecond: o } = t), new
|
|
253
|
+
return t && ({ hour: r, minute: n, second: a, millisecond: o } = t), new S(e.calendar, e.era, e.year, e.month, e.day, r, n, a, o);
|
|
386
254
|
}
|
|
387
|
-
function
|
|
388
|
-
if (
|
|
255
|
+
function s(e, t) {
|
|
256
|
+
if (_(e.calendar, t)) return e;
|
|
389
257
|
let r = t.fromJulianDay(e.calendar.toJulianDay(e)), n = e.copy();
|
|
390
258
|
return n.calendar = t, n.era = r.era, n.year = r.year, n.month = r.month, n.day = r.day, b(n), n;
|
|
391
259
|
}
|
|
392
|
-
function
|
|
393
|
-
if (e instanceof
|
|
394
|
-
return e.timeZone === t ? e :
|
|
260
|
+
function Se(e, t, r) {
|
|
261
|
+
if (e instanceof C)
|
|
262
|
+
return e.timeZone === t ? e : Ee(e, t);
|
|
395
263
|
let n = u(e, t, r);
|
|
396
264
|
return d(n, t);
|
|
397
265
|
}
|
|
398
|
-
function
|
|
399
|
-
let t =
|
|
266
|
+
function Ce(e) {
|
|
267
|
+
let t = v(e) - e.offset;
|
|
400
268
|
return new Date(t);
|
|
401
269
|
}
|
|
402
|
-
function
|
|
403
|
-
let r =
|
|
404
|
-
return
|
|
270
|
+
function Ee(e, t) {
|
|
271
|
+
let r = v(e) - e.offset;
|
|
272
|
+
return s(d(r, t), e.calendar);
|
|
405
273
|
}
|
|
406
|
-
const
|
|
407
|
-
function
|
|
408
|
-
let r = e.copy(), n = "hour" in r ?
|
|
409
|
-
|
|
274
|
+
const I = 36e5;
|
|
275
|
+
function U(e, t) {
|
|
276
|
+
let r = e.copy(), n = "hour" in r ? Ue(r, t) : 0;
|
|
277
|
+
F(r, t.years || 0), r.calendar.balanceYearMonth && r.calendar.balanceYearMonth(r, e), r.month += t.months || 0, j(r), ce(r), r.day += (t.weeks || 0) * 7, r.day += t.days || 0, r.day += n, Ye(r), r.calendar.balanceDate && r.calendar.balanceDate(r), r.year < 1 && (r.year = 1, r.month = 1, r.day = 1);
|
|
410
278
|
let a = r.calendar.getYearsInEra(r);
|
|
411
279
|
if (r.year > a) {
|
|
412
|
-
var o,
|
|
413
|
-
let
|
|
414
|
-
r.year = a, r.month =
|
|
280
|
+
var o, c;
|
|
281
|
+
let l = (o = (c = r.calendar).isInverseEra) === null || o === void 0 ? void 0 : o.call(c, r);
|
|
282
|
+
r.year = a, r.month = l ? 1 : r.calendar.getMonthsInYear(r), r.day = l ? 1 : r.calendar.getDaysInMonth(r);
|
|
415
283
|
}
|
|
416
284
|
r.month < 1 && (r.month = 1, r.day = 1);
|
|
417
|
-
let
|
|
418
|
-
return r.month >
|
|
285
|
+
let i = r.calendar.getMonthsInYear(r);
|
|
286
|
+
return r.month > i && (r.month = i, r.day = r.calendar.getDaysInMonth(r)), r.day = Math.max(1, Math.min(r.calendar.getDaysInMonth(r), r.day)), r;
|
|
419
287
|
}
|
|
420
|
-
function
|
|
288
|
+
function F(e, t) {
|
|
421
289
|
var r, n;
|
|
422
290
|
!((r = (n = e.calendar).isInverseEra) === null || r === void 0) && r.call(n, e) && (t = -t), e.year += t;
|
|
423
291
|
}
|
|
424
|
-
function
|
|
292
|
+
function j(e) {
|
|
425
293
|
for (; e.month < 1; )
|
|
426
|
-
|
|
294
|
+
F(e, -1), e.month += e.calendar.getMonthsInYear(e);
|
|
427
295
|
let t = 0;
|
|
428
296
|
for (; e.month > (t = e.calendar.getMonthsInYear(e)); )
|
|
429
|
-
e.month -= t,
|
|
297
|
+
e.month -= t, F(e, 1);
|
|
430
298
|
}
|
|
431
|
-
function
|
|
299
|
+
function Ye(e) {
|
|
432
300
|
for (; e.day < 1; )
|
|
433
|
-
e.month--,
|
|
301
|
+
e.month--, j(e), e.day += e.calendar.getDaysInMonth(e);
|
|
434
302
|
for (; e.day > e.calendar.getDaysInMonth(e); )
|
|
435
|
-
e.day -= e.calendar.getDaysInMonth(e), e.month++,
|
|
303
|
+
e.day -= e.calendar.getDaysInMonth(e), e.month++, j(e);
|
|
436
304
|
}
|
|
437
|
-
function
|
|
305
|
+
function ce(e) {
|
|
438
306
|
e.month = Math.max(1, Math.min(e.calendar.getMonthsInYear(e), e.month)), e.day = Math.max(1, Math.min(e.calendar.getDaysInMonth(e), e.day));
|
|
439
307
|
}
|
|
440
308
|
function b(e) {
|
|
441
|
-
e.calendar.constrainDate && e.calendar.constrainDate(e), e.year = Math.max(1, Math.min(e.calendar.getYearsInEra(e), e.year)),
|
|
309
|
+
e.calendar.constrainDate && e.calendar.constrainDate(e), e.year = Math.max(1, Math.min(e.calendar.getYearsInEra(e), e.year)), ce(e);
|
|
442
310
|
}
|
|
443
|
-
function
|
|
311
|
+
function ie(e) {
|
|
444
312
|
let t = {};
|
|
445
313
|
for (let r in e) typeof e[r] == "number" && (t[r] = -e[r]);
|
|
446
314
|
return t;
|
|
447
315
|
}
|
|
448
|
-
function
|
|
449
|
-
return
|
|
316
|
+
function le(e, t) {
|
|
317
|
+
return U(e, ie(t));
|
|
450
318
|
}
|
|
451
|
-
function
|
|
319
|
+
function J(e, t) {
|
|
452
320
|
let r = e.copy();
|
|
453
321
|
return t.era != null && (r.era = t.era), t.year != null && (r.year = t.year), t.month != null && (r.month = t.month), t.day != null && (r.day = t.day), b(r), r;
|
|
454
322
|
}
|
|
455
|
-
function
|
|
323
|
+
function k(e, t) {
|
|
456
324
|
let r = e.copy();
|
|
457
325
|
return t.hour != null && (r.hour = t.hour), t.minute != null && (r.minute = t.minute), t.second != null && (r.second = t.second), t.millisecond != null && (r.millisecond = t.millisecond), ke(r), r;
|
|
458
326
|
}
|
|
459
|
-
function
|
|
460
|
-
e.second += Math.floor(e.millisecond / 1e3), e.millisecond =
|
|
327
|
+
function Te(e) {
|
|
328
|
+
e.second += Math.floor(e.millisecond / 1e3), e.millisecond = Y(e.millisecond, 1e3), e.minute += Math.floor(e.second / 60), e.second = Y(e.second, 60), e.hour += Math.floor(e.minute / 60), e.minute = Y(e.minute, 60);
|
|
461
329
|
let t = Math.floor(e.hour / 24);
|
|
462
|
-
return e.hour =
|
|
330
|
+
return e.hour = Y(e.hour, 24), t;
|
|
463
331
|
}
|
|
464
332
|
function ke(e) {
|
|
465
333
|
e.millisecond = Math.max(0, Math.min(e.millisecond, 1e3)), e.second = Math.max(0, Math.min(e.second, 59)), e.minute = Math.max(0, Math.min(e.minute, 59)), e.hour = Math.max(0, Math.min(e.hour, 23));
|
|
466
334
|
}
|
|
467
|
-
function
|
|
335
|
+
function Y(e, t) {
|
|
468
336
|
let r = e % t;
|
|
469
337
|
return r < 0 && (r += t), r;
|
|
470
338
|
}
|
|
471
|
-
function
|
|
472
|
-
return e.hour += t.hours || 0, e.minute += t.minutes || 0, e.second += t.seconds || 0, e.millisecond += t.milliseconds || 0,
|
|
339
|
+
function Ue(e, t) {
|
|
340
|
+
return e.hour += t.hours || 0, e.minute += t.minutes || 0, e.second += t.seconds || 0, e.millisecond += t.milliseconds || 0, Te(e);
|
|
473
341
|
}
|
|
474
|
-
function
|
|
342
|
+
function W(e, t, r, n) {
|
|
475
343
|
let a = e.copy();
|
|
476
344
|
switch (t) {
|
|
477
345
|
case "era": {
|
|
478
|
-
let
|
|
479
|
-
if (
|
|
480
|
-
|
|
346
|
+
let i = e.calendar.getEras(), l = i.indexOf(e.era);
|
|
347
|
+
if (l < 0) throw new Error("Invalid era: " + e.era);
|
|
348
|
+
l = $(l, r, 0, i.length - 1, n?.round), a.era = i[l], b(a);
|
|
481
349
|
break;
|
|
482
350
|
}
|
|
483
351
|
case "year":
|
|
484
|
-
var o,
|
|
485
|
-
!((o = (
|
|
352
|
+
var o, c;
|
|
353
|
+
!((o = (c = a.calendar).isInverseEra) === null || o === void 0) && o.call(c, a) && (r = -r), a.year = $(e.year, r, -1 / 0, 9999, n?.round), a.year === -1 / 0 && (a.year = 1), a.calendar.balanceYearMonth && a.calendar.balanceYearMonth(a, e);
|
|
486
354
|
break;
|
|
487
355
|
case "month":
|
|
488
356
|
a.month = $(e.month, r, 1, e.calendar.getMonthsInYear(e), n?.round);
|
|
@@ -495,16 +363,16 @@ function q(e, t, r, n) {
|
|
|
495
363
|
}
|
|
496
364
|
return e.calendar.balanceDate && e.calendar.balanceDate(a), b(a), a;
|
|
497
365
|
}
|
|
498
|
-
function
|
|
366
|
+
function se(e, t, r, n) {
|
|
499
367
|
let a = e.copy();
|
|
500
368
|
switch (t) {
|
|
501
369
|
case "hour": {
|
|
502
|
-
let o = e.hour,
|
|
370
|
+
let o = e.hour, c = 0, i = 23;
|
|
503
371
|
if (n?.hourCycle === 12) {
|
|
504
|
-
let
|
|
505
|
-
|
|
372
|
+
let l = o >= 12;
|
|
373
|
+
c = l ? 12 : 0, i = l ? 23 : 11;
|
|
506
374
|
}
|
|
507
|
-
a.hour = $(o, r,
|
|
375
|
+
a.hour = $(o, r, c, i, n?.round);
|
|
508
376
|
break;
|
|
509
377
|
}
|
|
510
378
|
case "minute":
|
|
@@ -530,10 +398,10 @@ function $(e, t, r, n, a = !1) {
|
|
|
530
398
|
e += t, e < r ? e = n - (r - e - 1) : e > n && (e = r + (e - n - 1));
|
|
531
399
|
return e;
|
|
532
400
|
}
|
|
533
|
-
function
|
|
401
|
+
function fe(e, t) {
|
|
534
402
|
let r;
|
|
535
403
|
if (t.years != null && t.years !== 0 || t.months != null && t.months !== 0 || t.weeks != null && t.weeks !== 0 || t.days != null && t.days !== 0) {
|
|
536
|
-
let a =
|
|
404
|
+
let a = U(D(e), {
|
|
537
405
|
years: t.years,
|
|
538
406
|
months: t.months,
|
|
539
407
|
weeks: t.weeks,
|
|
@@ -541,15 +409,15 @@ function ue(e, t) {
|
|
|
541
409
|
});
|
|
542
410
|
r = u(a, e.timeZone);
|
|
543
411
|
} else
|
|
544
|
-
r =
|
|
412
|
+
r = v(e) - e.offset;
|
|
545
413
|
r += t.milliseconds || 0, r += (t.seconds || 0) * 1e3, r += (t.minutes || 0) * 6e4, r += (t.hours || 0) * 36e5;
|
|
546
414
|
let n = d(r, e.timeZone);
|
|
547
|
-
return
|
|
415
|
+
return s(n, e.calendar);
|
|
548
416
|
}
|
|
549
|
-
function
|
|
550
|
-
return
|
|
417
|
+
function Ae(e, t) {
|
|
418
|
+
return fe(e, ie(t));
|
|
551
419
|
}
|
|
552
|
-
function
|
|
420
|
+
function Be(e, t, r, n) {
|
|
553
421
|
switch (t) {
|
|
554
422
|
case "hour": {
|
|
555
423
|
let a = 0, o = 23;
|
|
@@ -557,53 +425,53 @@ function He(e, t, r, n) {
|
|
|
557
425
|
let y = e.hour >= 12;
|
|
558
426
|
a = y ? 12 : 0, o = y ? 23 : 11;
|
|
559
427
|
}
|
|
560
|
-
let
|
|
428
|
+
let c = D(e), i = s(k(c, {
|
|
561
429
|
hour: a
|
|
562
|
-
}), new
|
|
563
|
-
u(
|
|
564
|
-
u(
|
|
565
|
-
].filter((y) => d(y, e.timeZone).day ===
|
|
430
|
+
}), new g()), l = [
|
|
431
|
+
u(i, e.timeZone, "earlier"),
|
|
432
|
+
u(i, e.timeZone, "later")
|
|
433
|
+
].filter((y) => d(y, e.timeZone).day === i.day)[0], h = s(k(c, {
|
|
566
434
|
hour: o
|
|
567
|
-
}), new
|
|
435
|
+
}), new g()), p = [
|
|
568
436
|
u(h, e.timeZone, "earlier"),
|
|
569
437
|
u(h, e.timeZone, "later")
|
|
570
|
-
].filter((y) => d(y, e.timeZone).day === h.day).pop(),
|
|
571
|
-
return
|
|
438
|
+
].filter((y) => d(y, e.timeZone).day === h.day).pop(), w = v(e) - e.offset, M = Math.floor(w / I), m = w % I;
|
|
439
|
+
return w = $(M, r, Math.floor(l / I), Math.floor(p / I), n?.round) * I + m, s(d(w, e.timeZone), e.calendar);
|
|
572
440
|
}
|
|
573
441
|
case "minute":
|
|
574
442
|
case "second":
|
|
575
443
|
case "millisecond":
|
|
576
|
-
return
|
|
444
|
+
return se(e, t, r, n);
|
|
577
445
|
case "era":
|
|
578
446
|
case "year":
|
|
579
447
|
case "month":
|
|
580
448
|
case "day": {
|
|
581
|
-
let a =
|
|
582
|
-
return
|
|
449
|
+
let a = W(D(e), t, r, n), o = u(a, e.timeZone);
|
|
450
|
+
return s(d(o, e.timeZone), e.calendar);
|
|
583
451
|
}
|
|
584
452
|
default:
|
|
585
453
|
throw new Error("Unsupported field " + t);
|
|
586
454
|
}
|
|
587
455
|
}
|
|
588
|
-
function
|
|
589
|
-
let n =
|
|
456
|
+
function Oe(e, t, r) {
|
|
457
|
+
let n = D(e), a = k(J(n, t), t);
|
|
590
458
|
if (a.compare(n) === 0) return e;
|
|
591
459
|
let o = u(a, e.timeZone, r);
|
|
592
|
-
return
|
|
460
|
+
return s(d(o, e.timeZone), e.calendar);
|
|
593
461
|
}
|
|
594
|
-
const
|
|
595
|
-
function
|
|
596
|
-
let t = e.match(
|
|
462
|
+
const Pe = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/, Re = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/, he = /^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;
|
|
463
|
+
function et(e) {
|
|
464
|
+
let t = e.match(Pe);
|
|
597
465
|
if (!t)
|
|
598
|
-
throw
|
|
599
|
-
let r = new
|
|
466
|
+
throw he.test(e) ? new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`) : new Error("Invalid ISO 8601 date string: " + e);
|
|
467
|
+
let r = new x(f(t[1], 0, 9999), f(t[2], 1, 12), 1);
|
|
600
468
|
return r.day = f(t[3], 1, r.calendar.getDaysInMonth(r)), r;
|
|
601
469
|
}
|
|
602
|
-
function
|
|
603
|
-
let t = e.match(
|
|
470
|
+
function tt(e) {
|
|
471
|
+
let t = e.match(Re);
|
|
604
472
|
if (!t)
|
|
605
|
-
throw
|
|
606
|
-
let r = f(t[1], -9999, 9999), n = r < 1 ? "BC" : "AD", a = new
|
|
473
|
+
throw he.test(e) ? new Error(`Invalid ISO 8601 date time string: ${e}. Use parseAbsolute() instead.`) : new Error("Invalid ISO 8601 date time string: " + e);
|
|
474
|
+
let r = f(t[1], -9999, 9999), n = r < 1 ? "BC" : "AD", a = new S(n, r < 1 ? -r + 1 : r, f(t[2], 1, 12), 1, t[4] ? f(t[4], 0, 23) : 0, t[5] ? f(t[5], 0, 59) : 0, t[6] ? f(t[6], 0, 59) : 0, t[7] ? f(t[7], 0, 1 / 0) * 1e3 : 0);
|
|
607
475
|
return a.day = f(t[3], 0, a.calendar.getDaysInMonth(a)), a;
|
|
608
476
|
}
|
|
609
477
|
function f(e, t, r) {
|
|
@@ -611,38 +479,38 @@ function f(e, t, r) {
|
|
|
611
479
|
if (n < t || n > r) throw new RangeError(`Value out of range: ${t} <= ${n} <= ${r}`);
|
|
612
480
|
return n;
|
|
613
481
|
}
|
|
614
|
-
function
|
|
482
|
+
function He(e) {
|
|
615
483
|
return `${String(e.hour).padStart(2, "0")}:${String(e.minute).padStart(2, "0")}:${String(e.second).padStart(2, "0")}${e.millisecond ? String(e.millisecond / 1e3).slice(1) : ""}`;
|
|
616
484
|
}
|
|
617
|
-
function
|
|
618
|
-
let t =
|
|
485
|
+
function ue(e) {
|
|
486
|
+
let t = s(e, new g()), r;
|
|
619
487
|
return t.era === "BC" ? r = t.year === 1 ? "0000" : "-" + String(Math.abs(1 - t.year)).padStart(6, "00") : r = String(t.year).padStart(4, "0"), `${r}-${String(t.month).padStart(2, "0")}-${String(t.day).padStart(2, "0")}`;
|
|
620
488
|
}
|
|
621
|
-
function
|
|
622
|
-
return `${
|
|
489
|
+
function de(e) {
|
|
490
|
+
return `${ue(e)}T${He(e)}`;
|
|
623
491
|
}
|
|
624
|
-
function
|
|
492
|
+
function Ze(e) {
|
|
625
493
|
let t = Math.sign(e) < 0 ? "-" : "+";
|
|
626
494
|
e = Math.abs(e);
|
|
627
495
|
let r = Math.floor(e / 36e5), n = Math.floor(e % 36e5 / 6e4), a = Math.floor(e % 36e5 % 6e4 / 1e3), o = `${t}${String(r).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
628
496
|
return a !== 0 && (o += `:${String(a).padStart(2, "0")}`), o;
|
|
629
497
|
}
|
|
630
|
-
function
|
|
631
|
-
return `${
|
|
498
|
+
function Fe(e) {
|
|
499
|
+
return `${de(e)}${Ze(e.offset)}[${e.timeZone}]`;
|
|
632
500
|
}
|
|
633
501
|
function je(e, t) {
|
|
634
502
|
if (t.has(e))
|
|
635
503
|
throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
636
504
|
}
|
|
637
|
-
function
|
|
505
|
+
function N(e, t, r) {
|
|
638
506
|
je(e, t), t.set(e, r);
|
|
639
507
|
}
|
|
640
508
|
function V(e) {
|
|
641
|
-
let t = typeof e[0] == "object" ? e.shift() : new
|
|
509
|
+
let t = typeof e[0] == "object" ? e.shift() : new g(), r;
|
|
642
510
|
if (typeof e[0] == "string") r = e.shift();
|
|
643
511
|
else {
|
|
644
|
-
let
|
|
645
|
-
r =
|
|
512
|
+
let c = t.getEras();
|
|
513
|
+
r = c[c.length - 1];
|
|
646
514
|
}
|
|
647
515
|
let n = e.shift(), a = e.shift(), o = e.shift();
|
|
648
516
|
return [
|
|
@@ -654,68 +522,68 @@ function V(e) {
|
|
|
654
522
|
];
|
|
655
523
|
}
|
|
656
524
|
var qe = /* @__PURE__ */ new WeakMap();
|
|
657
|
-
class
|
|
525
|
+
class x {
|
|
658
526
|
/** Returns a copy of this date. */
|
|
659
527
|
copy() {
|
|
660
|
-
return this.era ? new
|
|
528
|
+
return this.era ? new x(this.calendar, this.era, this.year, this.month, this.day) : new x(this.calendar, this.year, this.month, this.day);
|
|
661
529
|
}
|
|
662
530
|
/** Returns a new `CalendarDate` with the given duration added to it. */
|
|
663
531
|
add(t) {
|
|
664
|
-
return
|
|
532
|
+
return U(this, t);
|
|
665
533
|
}
|
|
666
534
|
/** Returns a new `CalendarDate` with the given duration subtracted from it. */
|
|
667
535
|
subtract(t) {
|
|
668
|
-
return
|
|
536
|
+
return le(this, t);
|
|
669
537
|
}
|
|
670
538
|
/** Returns a new `CalendarDate` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
671
539
|
set(t) {
|
|
672
|
-
return
|
|
540
|
+
return J(this, t);
|
|
673
541
|
}
|
|
674
542
|
/**
|
|
675
543
|
* Returns a new `CalendarDate` with the given field adjusted by a specified amount.
|
|
676
544
|
* When the resulting value reaches the limits of the field, it wraps around.
|
|
677
545
|
*/
|
|
678
546
|
cycle(t, r, n) {
|
|
679
|
-
return
|
|
547
|
+
return W(this, t, r, n);
|
|
680
548
|
}
|
|
681
549
|
/** Converts the date to a native JavaScript Date object, with the time set to midnight in the given time zone. */
|
|
682
550
|
toDate(t) {
|
|
683
|
-
return
|
|
551
|
+
return oe(this, t);
|
|
684
552
|
}
|
|
685
553
|
/** Converts the date to an ISO 8601 formatted string. */
|
|
686
554
|
toString() {
|
|
687
|
-
return
|
|
555
|
+
return ue(this);
|
|
688
556
|
}
|
|
689
557
|
/** 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. */
|
|
690
558
|
compare(t) {
|
|
691
|
-
return
|
|
559
|
+
return te(this, t);
|
|
692
560
|
}
|
|
693
561
|
constructor(...t) {
|
|
694
|
-
|
|
562
|
+
N(this, qe, {
|
|
695
563
|
writable: !0,
|
|
696
564
|
value: void 0
|
|
697
565
|
});
|
|
698
|
-
let [r, n, a, o,
|
|
699
|
-
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day =
|
|
566
|
+
let [r, n, a, o, c] = V(t);
|
|
567
|
+
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = c, b(this);
|
|
700
568
|
}
|
|
701
569
|
}
|
|
702
|
-
var
|
|
703
|
-
class
|
|
570
|
+
var _e = /* @__PURE__ */ new WeakMap();
|
|
571
|
+
class S {
|
|
704
572
|
/** Returns a copy of this date. */
|
|
705
573
|
copy() {
|
|
706
|
-
return this.era ? new
|
|
574
|
+
return this.era ? new S(this.calendar, this.era, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond) : new S(this.calendar, this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
707
575
|
}
|
|
708
576
|
/** Returns a new `CalendarDateTime` with the given duration added to it. */
|
|
709
577
|
add(t) {
|
|
710
|
-
return
|
|
578
|
+
return U(this, t);
|
|
711
579
|
}
|
|
712
580
|
/** Returns a new `CalendarDateTime` with the given duration subtracted from it. */
|
|
713
581
|
subtract(t) {
|
|
714
|
-
return
|
|
582
|
+
return le(this, t);
|
|
715
583
|
}
|
|
716
584
|
/** Returns a new `CalendarDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
717
585
|
set(t) {
|
|
718
|
-
return
|
|
586
|
+
return J(k(this, t), t);
|
|
719
587
|
}
|
|
720
588
|
/**
|
|
721
589
|
* Returns a new `CalendarDateTime` with the given field adjusted by a specified amount.
|
|
@@ -727,65 +595,65 @@ class E {
|
|
|
727
595
|
case "year":
|
|
728
596
|
case "month":
|
|
729
597
|
case "day":
|
|
730
|
-
return
|
|
598
|
+
return W(this, t, r, n);
|
|
731
599
|
default:
|
|
732
|
-
return
|
|
600
|
+
return se(this, t, r, n);
|
|
733
601
|
}
|
|
734
602
|
}
|
|
735
603
|
/** Converts the date to a native JavaScript Date object in the given time zone. */
|
|
736
604
|
toDate(t, r) {
|
|
737
|
-
return
|
|
605
|
+
return oe(this, t, r);
|
|
738
606
|
}
|
|
739
607
|
/** Converts the date to an ISO 8601 formatted string. */
|
|
740
608
|
toString() {
|
|
741
|
-
return
|
|
609
|
+
return de(this);
|
|
742
610
|
}
|
|
743
611
|
/** 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. */
|
|
744
612
|
compare(t) {
|
|
745
|
-
let r =
|
|
746
|
-
return r === 0 ?
|
|
613
|
+
let r = te(this, t);
|
|
614
|
+
return r === 0 ? ve(this, D(t)) : r;
|
|
747
615
|
}
|
|
748
616
|
constructor(...t) {
|
|
749
|
-
|
|
617
|
+
N(this, _e, {
|
|
750
618
|
writable: !0,
|
|
751
619
|
value: void 0
|
|
752
620
|
});
|
|
753
|
-
let [r, n, a, o,
|
|
754
|
-
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day =
|
|
621
|
+
let [r, n, a, o, c] = V(t);
|
|
622
|
+
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = c, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, b(this);
|
|
755
623
|
}
|
|
756
624
|
}
|
|
757
|
-
var
|
|
758
|
-
class
|
|
625
|
+
var Je = /* @__PURE__ */ new WeakMap();
|
|
626
|
+
class C {
|
|
759
627
|
/** Returns a copy of this date. */
|
|
760
628
|
copy() {
|
|
761
|
-
return this.era ? new
|
|
629
|
+
return this.era ? new C(this.calendar, this.era, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond) : new C(this.calendar, this.year, this.month, this.day, this.timeZone, this.offset, this.hour, this.minute, this.second, this.millisecond);
|
|
762
630
|
}
|
|
763
631
|
/** Returns a new `ZonedDateTime` with the given duration added to it. */
|
|
764
632
|
add(t) {
|
|
765
|
-
return
|
|
633
|
+
return fe(this, t);
|
|
766
634
|
}
|
|
767
635
|
/** Returns a new `ZonedDateTime` with the given duration subtracted from it. */
|
|
768
636
|
subtract(t) {
|
|
769
|
-
return
|
|
637
|
+
return Ae(this, t);
|
|
770
638
|
}
|
|
771
639
|
/** Returns a new `ZonedDateTime` with the given fields set to the provided values. Other fields will be constrained accordingly. */
|
|
772
640
|
set(t, r) {
|
|
773
|
-
return
|
|
641
|
+
return Oe(this, t, r);
|
|
774
642
|
}
|
|
775
643
|
/**
|
|
776
644
|
* Returns a new `ZonedDateTime` with the given field adjusted by a specified amount.
|
|
777
645
|
* When the resulting value reaches the limits of the field, it wraps around.
|
|
778
646
|
*/
|
|
779
647
|
cycle(t, r, n) {
|
|
780
|
-
return
|
|
648
|
+
return Be(this, t, r, n);
|
|
781
649
|
}
|
|
782
650
|
/** Converts the date to a native JavaScript Date object. */
|
|
783
651
|
toDate() {
|
|
784
|
-
return
|
|
652
|
+
return Ce(this);
|
|
785
653
|
}
|
|
786
654
|
/** Converts the date to an ISO 8601 formatted string, including the UTC offset and time zone identifier. */
|
|
787
655
|
toString() {
|
|
788
|
-
return
|
|
656
|
+
return Fe(this);
|
|
789
657
|
}
|
|
790
658
|
/** Converts the date to an ISO 8601 formatted string in UTC. */
|
|
791
659
|
toAbsoluteString() {
|
|
@@ -793,19 +661,19 @@ class S {
|
|
|
793
661
|
}
|
|
794
662
|
/** 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. */
|
|
795
663
|
compare(t) {
|
|
796
|
-
return this.toDate().getTime() -
|
|
664
|
+
return this.toDate().getTime() - Se(t, this.timeZone).toDate().getTime();
|
|
797
665
|
}
|
|
798
666
|
constructor(...t) {
|
|
799
|
-
|
|
667
|
+
N(this, Je, {
|
|
800
668
|
writable: !0,
|
|
801
669
|
value: void 0
|
|
802
670
|
});
|
|
803
|
-
let [r, n, a, o,
|
|
804
|
-
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day =
|
|
671
|
+
let [r, n, a, o, c] = V(t), i = t.shift(), l = t.shift();
|
|
672
|
+
this.calendar = r, this.era = n, this.year = a, this.month = o, this.day = c, this.timeZone = i, this.offset = l, this.hour = t.shift() || 0, this.minute = t.shift() || 0, this.second = t.shift() || 0, this.millisecond = t.shift() || 0, b(this);
|
|
805
673
|
}
|
|
806
674
|
}
|
|
807
|
-
let
|
|
808
|
-
class
|
|
675
|
+
let P = /* @__PURE__ */ new Map();
|
|
676
|
+
class rt {
|
|
809
677
|
/** Formats a date as a string according to the locale and format options passed to the constructor. */
|
|
810
678
|
format(t) {
|
|
811
679
|
return this.formatter.format(t);
|
|
@@ -846,50 +714,50 @@ class it {
|
|
|
846
714
|
/** Returns the resolved formatting options based on the values passed to the constructor. */
|
|
847
715
|
resolvedOptions() {
|
|
848
716
|
let t = this.formatter.resolvedOptions();
|
|
849
|
-
return
|
|
717
|
+
return Ve() && (this.resolvedHourCycle || (this.resolvedHourCycle = ze(t.locale, this.options)), t.hourCycle = this.resolvedHourCycle, t.hour12 = this.resolvedHourCycle === "h11" || this.resolvedHourCycle === "h12"), t.calendar === "ethiopic-amete-alem" && (t.calendar = "ethioaa"), t;
|
|
850
718
|
}
|
|
851
719
|
constructor(t, r = {}) {
|
|
852
|
-
this.formatter =
|
|
720
|
+
this.formatter = $e(t, r), this.options = r;
|
|
853
721
|
}
|
|
854
722
|
}
|
|
855
|
-
const
|
|
723
|
+
const We = {
|
|
856
724
|
true: {
|
|
857
725
|
// Only Japanese uses the h11 style for 12 hour time. All others use h12.
|
|
858
726
|
ja: "h11"
|
|
859
727
|
},
|
|
860
728
|
false: {}
|
|
861
729
|
};
|
|
862
|
-
function
|
|
863
|
-
if (typeof t.hour12 == "boolean" &&
|
|
730
|
+
function $e(e, t = {}) {
|
|
731
|
+
if (typeof t.hour12 == "boolean" && Ne()) {
|
|
864
732
|
t = {
|
|
865
733
|
...t
|
|
866
734
|
};
|
|
867
|
-
let a =
|
|
735
|
+
let a = We[String(t.hour12)][e.split("-")[0]], o = t.hour12 ? "h12" : "h23";
|
|
868
736
|
t.hourCycle = a ?? o, delete t.hour12;
|
|
869
737
|
}
|
|
870
738
|
let r = e + (t ? Object.entries(t).sort((a, o) => a[0] < o[0] ? -1 : 1).join() : "");
|
|
871
|
-
if (
|
|
739
|
+
if (P.has(r)) return P.get(r);
|
|
872
740
|
let n = new Intl.DateTimeFormat(e, t);
|
|
873
|
-
return
|
|
741
|
+
return P.set(r, n), n;
|
|
874
742
|
}
|
|
875
|
-
let
|
|
876
|
-
function
|
|
877
|
-
return
|
|
743
|
+
let R = null;
|
|
744
|
+
function Ne() {
|
|
745
|
+
return R == null && (R = new Intl.DateTimeFormat("en-US", {
|
|
878
746
|
hour: "numeric",
|
|
879
747
|
hour12: !1
|
|
880
|
-
}).format(new Date(2020, 2, 3, 0)) === "24"),
|
|
748
|
+
}).format(new Date(2020, 2, 3, 0)) === "24"), R;
|
|
881
749
|
}
|
|
882
|
-
let
|
|
883
|
-
function
|
|
884
|
-
return
|
|
750
|
+
let H = null;
|
|
751
|
+
function Ve() {
|
|
752
|
+
return H == null && (H = new Intl.DateTimeFormat("fr", {
|
|
885
753
|
hour: "numeric",
|
|
886
754
|
hour12: !1
|
|
887
|
-
}).resolvedOptions().hourCycle === "h12"),
|
|
755
|
+
}).resolvedOptions().hourCycle === "h12"), H;
|
|
888
756
|
}
|
|
889
|
-
function
|
|
757
|
+
function ze(e, t) {
|
|
890
758
|
if (!t.timeStyle && !t.hour) return;
|
|
891
759
|
e = e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/, ""), e += (e.includes("-u-") ? "" : "-u") + "-nu-latn";
|
|
892
|
-
let r =
|
|
760
|
+
let r = $e(e, {
|
|
893
761
|
...t,
|
|
894
762
|
timeZone: void 0
|
|
895
763
|
// use local timezone
|
|
@@ -901,27 +769,27 @@ function Qe(e, t) {
|
|
|
901
769
|
throw new Error("Unexpected hour cycle result");
|
|
902
770
|
}
|
|
903
771
|
export {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
772
|
+
g as $,
|
|
773
|
+
x as a,
|
|
774
|
+
q as b,
|
|
775
|
+
me as c,
|
|
776
|
+
B as d,
|
|
777
|
+
E as e,
|
|
778
|
+
T as f,
|
|
779
|
+
re as g,
|
|
780
|
+
rt as h,
|
|
781
|
+
s as i,
|
|
782
|
+
S as j,
|
|
783
|
+
C as k,
|
|
784
|
+
Qe as l,
|
|
785
|
+
K as m,
|
|
786
|
+
Xe as n,
|
|
787
|
+
ge as o,
|
|
788
|
+
Ke as p,
|
|
789
|
+
ee as q,
|
|
790
|
+
Le as r,
|
|
791
|
+
Ge as s,
|
|
792
|
+
pe as t,
|
|
793
|
+
tt as u,
|
|
794
|
+
et as v
|
|
927
795
|
};
|