@kong-ui-public/i18n 1.0.1-pr.880.cba2bebf.0 → 2.0.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/dist/i18n.es.js +295 -224
- package/dist/i18n.umd.js +10 -10
- package/package.json +4 -4
package/dist/i18n.es.js
CHANGED
|
@@ -7,7 +7,7 @@ var z = function(e, t) {
|
|
|
7
7
|
Object.prototype.hasOwnProperty.call(r, a) && (n[a] = r[a]);
|
|
8
8
|
}, z(e, t);
|
|
9
9
|
};
|
|
10
|
-
function
|
|
10
|
+
function N(e, t) {
|
|
11
11
|
if (typeof t != "function" && t !== null)
|
|
12
12
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
13
13
|
z(e, t);
|
|
@@ -26,7 +26,7 @@ var f = function() {
|
|
|
26
26
|
return t;
|
|
27
27
|
}, f.apply(this, arguments);
|
|
28
28
|
};
|
|
29
|
-
function
|
|
29
|
+
function Ve(e, t) {
|
|
30
30
|
var n = {};
|
|
31
31
|
for (var r in e)
|
|
32
32
|
Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
@@ -56,7 +56,7 @@ var D;
|
|
|
56
56
|
function ae(e) {
|
|
57
57
|
return e.type === b.literal;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function ke(e) {
|
|
60
60
|
return e.type === b.argument;
|
|
61
61
|
}
|
|
62
62
|
function Ee(e) {
|
|
@@ -83,11 +83,11 @@ function Te(e) {
|
|
|
83
83
|
function Se(e) {
|
|
84
84
|
return !!(e && typeof e == "object" && e.type === D.number);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function J(e) {
|
|
87
87
|
return !!(e && typeof e == "object" && e.type === D.dateTime);
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
function
|
|
89
|
+
var He = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Xe = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
|
|
90
|
+
function We(e) {
|
|
91
91
|
var t = {};
|
|
92
92
|
return e.replace(Xe, function(n) {
|
|
93
93
|
var r = n.length;
|
|
@@ -121,7 +121,7 @@ function Ze(e) {
|
|
|
121
121
|
case "g":
|
|
122
122
|
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
123
123
|
case "E":
|
|
124
|
-
t.weekday = r === 4 ? "
|
|
124
|
+
t.weekday = r === 4 ? "long" : r === 5 ? "narrow" : "short";
|
|
125
125
|
break;
|
|
126
126
|
case "e":
|
|
127
127
|
if (r < 4)
|
|
@@ -178,36 +178,36 @@ function Ze(e) {
|
|
|
178
178
|
return "";
|
|
179
179
|
}), t;
|
|
180
180
|
}
|
|
181
|
-
var
|
|
181
|
+
var Ze = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
182
182
|
function ze(e) {
|
|
183
183
|
if (e.length === 0)
|
|
184
184
|
throw new Error("Number skeleton cannot be empty");
|
|
185
|
-
for (var t = e.split(
|
|
185
|
+
for (var t = e.split(Ze).filter(function(m) {
|
|
186
186
|
return m.length > 0;
|
|
187
187
|
}), n = [], r = 0, a = t; r < a.length; r++) {
|
|
188
188
|
var i = a[r], o = i.split("/");
|
|
189
189
|
if (o.length === 0)
|
|
190
190
|
throw new Error("Invalid number skeleton");
|
|
191
|
-
for (var s = o[0],
|
|
192
|
-
var c =
|
|
191
|
+
for (var s = o[0], h = o.slice(1), l = 0, u = h; l < u.length; l++) {
|
|
192
|
+
var c = u[l];
|
|
193
193
|
if (c.length === 0)
|
|
194
194
|
throw new Error("Invalid number skeleton");
|
|
195
195
|
}
|
|
196
|
-
n.push({ stem: s, options:
|
|
196
|
+
n.push({ stem: s, options: h });
|
|
197
197
|
}
|
|
198
198
|
return n;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function Je(e) {
|
|
201
201
|
return e.replace(/^(.*?)-/, "");
|
|
202
202
|
}
|
|
203
|
-
var ie = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,
|
|
203
|
+
var ie = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Ie = /^(@+)?(\+|#+)?[rs]?$/g, qe = /(\*)(0+)|(#+)(0+)|(0+)/g, Ne = /^(0+)$/;
|
|
204
204
|
function oe(e) {
|
|
205
205
|
var t = {};
|
|
206
|
-
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(
|
|
206
|
+
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Ie, function(n, r, a) {
|
|
207
207
|
return typeof a != "string" ? (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length) : a === "+" ? t.minimumSignificantDigits = r.length : r[0] === "#" ? t.maximumSignificantDigits = r.length : (t.minimumSignificantDigits = r.length, t.maximumSignificantDigits = r.length + (typeof a == "string" ? a.length : 0)), "";
|
|
208
208
|
}), t;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ae(e) {
|
|
211
211
|
switch (e) {
|
|
212
212
|
case "sign-auto":
|
|
213
213
|
return {
|
|
@@ -255,14 +255,14 @@ function Qe(e) {
|
|
|
255
255
|
notation: "scientific"
|
|
256
256
|
}, e = e.slice(1)), t) {
|
|
257
257
|
var n = e.slice(0, 2);
|
|
258
|
-
if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !
|
|
258
|
+
if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !Ne.test(e))
|
|
259
259
|
throw new Error("Malformed concise eng/scientific notation");
|
|
260
260
|
t.minimumIntegerDigits = e.length;
|
|
261
261
|
}
|
|
262
262
|
return t;
|
|
263
263
|
}
|
|
264
264
|
function se(e) {
|
|
265
|
-
var t = {}, n =
|
|
265
|
+
var t = {}, n = Ae(e);
|
|
266
266
|
return n || t;
|
|
267
267
|
}
|
|
268
268
|
function Ye(e) {
|
|
@@ -289,7 +289,7 @@ function Ye(e) {
|
|
|
289
289
|
continue;
|
|
290
290
|
case "measure-unit":
|
|
291
291
|
case "unit":
|
|
292
|
-
t.style = "unit", t.unit =
|
|
292
|
+
t.style = "unit", t.unit = Je(a.options[0]);
|
|
293
293
|
continue;
|
|
294
294
|
case "compact-short":
|
|
295
295
|
case "K":
|
|
@@ -300,13 +300,13 @@ function Ye(e) {
|
|
|
300
300
|
t.notation = "compact", t.compactDisplay = "long";
|
|
301
301
|
continue;
|
|
302
302
|
case "scientific":
|
|
303
|
-
t = f(f(f({}, t), { notation: "scientific" }), a.options.reduce(function(
|
|
304
|
-
return f(f({},
|
|
303
|
+
t = f(f(f({}, t), { notation: "scientific" }), a.options.reduce(function(h, l) {
|
|
304
|
+
return f(f({}, h), se(l));
|
|
305
305
|
}, {}));
|
|
306
306
|
continue;
|
|
307
307
|
case "engineering":
|
|
308
|
-
t = f(f(f({}, t), { notation: "engineering" }), a.options.reduce(function(
|
|
309
|
-
return f(f({},
|
|
308
|
+
t = f(f(f({}, t), { notation: "engineering" }), a.options.reduce(function(h, l) {
|
|
309
|
+
return f(f({}, h), se(l));
|
|
310
310
|
}, {}));
|
|
311
311
|
continue;
|
|
312
312
|
case "notation-simple":
|
|
@@ -330,9 +330,9 @@ function Ye(e) {
|
|
|
330
330
|
case "integer-width":
|
|
331
331
|
if (a.options.length > 1)
|
|
332
332
|
throw new RangeError("integer-width stems only accept a single optional option");
|
|
333
|
-
a.options[0].replace(
|
|
333
|
+
a.options[0].replace(qe, function(h, l, u, c, m, p) {
|
|
334
334
|
if (l)
|
|
335
|
-
t.minimumIntegerDigits =
|
|
335
|
+
t.minimumIntegerDigits = u.length;
|
|
336
336
|
else {
|
|
337
337
|
if (c && m)
|
|
338
338
|
throw new Error("We currently do not support maximum integer digits");
|
|
@@ -343,25 +343,25 @@ function Ye(e) {
|
|
|
343
343
|
});
|
|
344
344
|
continue;
|
|
345
345
|
}
|
|
346
|
-
if (
|
|
346
|
+
if (Ne.test(a.stem)) {
|
|
347
347
|
t.minimumIntegerDigits = a.stem.length;
|
|
348
348
|
continue;
|
|
349
349
|
}
|
|
350
350
|
if (ie.test(a.stem)) {
|
|
351
351
|
if (a.options.length > 1)
|
|
352
352
|
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
353
|
-
a.stem.replace(ie, function(
|
|
354
|
-
return
|
|
353
|
+
a.stem.replace(ie, function(h, l, u, c, m, p) {
|
|
354
|
+
return u === "*" ? t.minimumFractionDigits = l.length : c && c[0] === "#" ? t.maximumFractionDigits = c.length : m && p ? (t.minimumFractionDigits = m.length, t.maximumFractionDigits = m.length + p.length) : (t.minimumFractionDigits = l.length, t.maximumFractionDigits = l.length), "";
|
|
355
355
|
});
|
|
356
356
|
var i = a.options[0];
|
|
357
357
|
i === "w" ? t = f(f({}, t), { trailingZeroDisplay: "stripIfInteger" }) : i && (t = f(f({}, t), oe(i)));
|
|
358
358
|
continue;
|
|
359
359
|
}
|
|
360
|
-
if (
|
|
360
|
+
if (Ie.test(a.stem)) {
|
|
361
361
|
t = f(f({}, t), oe(a.stem));
|
|
362
362
|
continue;
|
|
363
363
|
}
|
|
364
|
-
var o =
|
|
364
|
+
var o = Ae(a.stem);
|
|
365
365
|
o && (t = f(f({}, t), o));
|
|
366
366
|
var s = Qe(a.stem);
|
|
367
367
|
s && (t = f(f({}, t), s));
|
|
@@ -487,6 +487,10 @@ var U = {
|
|
|
487
487
|
"hb",
|
|
488
488
|
"H"
|
|
489
489
|
],
|
|
490
|
+
BI: [
|
|
491
|
+
"H",
|
|
492
|
+
"h"
|
|
493
|
+
],
|
|
490
494
|
BJ: [
|
|
491
495
|
"H",
|
|
492
496
|
"hB"
|
|
@@ -536,6 +540,10 @@ var U = {
|
|
|
536
540
|
"hb",
|
|
537
541
|
"hB"
|
|
538
542
|
],
|
|
543
|
+
BY: [
|
|
544
|
+
"H",
|
|
545
|
+
"h"
|
|
546
|
+
],
|
|
539
547
|
BZ: [
|
|
540
548
|
"H",
|
|
541
549
|
"h",
|
|
@@ -624,6 +632,10 @@ var U = {
|
|
|
624
632
|
"H",
|
|
625
633
|
"hB"
|
|
626
634
|
],
|
|
635
|
+
CW: [
|
|
636
|
+
"H",
|
|
637
|
+
"hB"
|
|
638
|
+
],
|
|
627
639
|
CX: [
|
|
628
640
|
"H",
|
|
629
641
|
"h",
|
|
@@ -739,6 +751,10 @@ var U = {
|
|
|
739
751
|
"H",
|
|
740
752
|
"hB"
|
|
741
753
|
],
|
|
754
|
+
FO: [
|
|
755
|
+
"H",
|
|
756
|
+
"h"
|
|
757
|
+
],
|
|
742
758
|
FR: [
|
|
743
759
|
"H",
|
|
744
760
|
"hB"
|
|
@@ -784,6 +800,10 @@ var U = {
|
|
|
784
800
|
"hb",
|
|
785
801
|
"hB"
|
|
786
802
|
],
|
|
803
|
+
GL: [
|
|
804
|
+
"H",
|
|
805
|
+
"h"
|
|
806
|
+
],
|
|
787
807
|
GM: [
|
|
788
808
|
"h",
|
|
789
809
|
"hb",
|
|
@@ -848,6 +868,10 @@ var U = {
|
|
|
848
868
|
"H",
|
|
849
869
|
"hB"
|
|
850
870
|
],
|
|
871
|
+
HU: [
|
|
872
|
+
"H",
|
|
873
|
+
"h"
|
|
874
|
+
],
|
|
851
875
|
IC: [
|
|
852
876
|
"H",
|
|
853
877
|
"h",
|
|
@@ -920,8 +944,8 @@ var U = {
|
|
|
920
944
|
],
|
|
921
945
|
JP: [
|
|
922
946
|
"H",
|
|
923
|
-
"
|
|
924
|
-
"
|
|
947
|
+
"K",
|
|
948
|
+
"h"
|
|
925
949
|
],
|
|
926
950
|
KE: [
|
|
927
951
|
"hB",
|
|
@@ -1072,6 +1096,10 @@ var U = {
|
|
|
1072
1096
|
"H",
|
|
1073
1097
|
"hB"
|
|
1074
1098
|
],
|
|
1099
|
+
MG: [
|
|
1100
|
+
"H",
|
|
1101
|
+
"h"
|
|
1102
|
+
],
|
|
1075
1103
|
MH: [
|
|
1076
1104
|
"h",
|
|
1077
1105
|
"hb",
|
|
@@ -1127,6 +1155,18 @@ var U = {
|
|
|
1127
1155
|
"hb",
|
|
1128
1156
|
"hB"
|
|
1129
1157
|
],
|
|
1158
|
+
MT: [
|
|
1159
|
+
"H",
|
|
1160
|
+
"h"
|
|
1161
|
+
],
|
|
1162
|
+
MU: [
|
|
1163
|
+
"H",
|
|
1164
|
+
"h"
|
|
1165
|
+
],
|
|
1166
|
+
MV: [
|
|
1167
|
+
"H",
|
|
1168
|
+
"h"
|
|
1169
|
+
],
|
|
1130
1170
|
MW: [
|
|
1131
1171
|
"h",
|
|
1132
1172
|
"hb",
|
|
@@ -1184,6 +1224,10 @@ var U = {
|
|
|
1184
1224
|
"H",
|
|
1185
1225
|
"hB"
|
|
1186
1226
|
],
|
|
1227
|
+
NO: [
|
|
1228
|
+
"H",
|
|
1229
|
+
"h"
|
|
1230
|
+
],
|
|
1187
1231
|
NP: [
|
|
1188
1232
|
"H",
|
|
1189
1233
|
"h",
|
|
@@ -1245,6 +1289,10 @@ var U = {
|
|
|
1245
1289
|
"hB",
|
|
1246
1290
|
"H"
|
|
1247
1291
|
],
|
|
1292
|
+
PL: [
|
|
1293
|
+
"H",
|
|
1294
|
+
"h"
|
|
1295
|
+
],
|
|
1248
1296
|
PM: [
|
|
1249
1297
|
"H",
|
|
1250
1298
|
"hB"
|
|
@@ -1303,6 +1351,10 @@ var U = {
|
|
|
1303
1351
|
RU: [
|
|
1304
1352
|
"H"
|
|
1305
1353
|
],
|
|
1354
|
+
RW: [
|
|
1355
|
+
"H",
|
|
1356
|
+
"h"
|
|
1357
|
+
],
|
|
1306
1358
|
SA: [
|
|
1307
1359
|
"h",
|
|
1308
1360
|
"hB",
|
|
@@ -1435,12 +1487,24 @@ var U = {
|
|
|
1435
1487
|
"H",
|
|
1436
1488
|
"hB"
|
|
1437
1489
|
],
|
|
1490
|
+
TH: [
|
|
1491
|
+
"H",
|
|
1492
|
+
"h"
|
|
1493
|
+
],
|
|
1494
|
+
TJ: [
|
|
1495
|
+
"H",
|
|
1496
|
+
"h"
|
|
1497
|
+
],
|
|
1438
1498
|
TL: [
|
|
1439
1499
|
"H",
|
|
1440
1500
|
"hB",
|
|
1441
1501
|
"hb",
|
|
1442
1502
|
"h"
|
|
1443
1503
|
],
|
|
1504
|
+
TM: [
|
|
1505
|
+
"H",
|
|
1506
|
+
"h"
|
|
1507
|
+
],
|
|
1444
1508
|
TN: [
|
|
1445
1509
|
"h",
|
|
1446
1510
|
"hB",
|
|
@@ -1536,6 +1600,10 @@ var U = {
|
|
|
1536
1600
|
"H",
|
|
1537
1601
|
"hB"
|
|
1538
1602
|
],
|
|
1603
|
+
VN: [
|
|
1604
|
+
"H",
|
|
1605
|
+
"h"
|
|
1606
|
+
],
|
|
1539
1607
|
VU: [
|
|
1540
1608
|
"h",
|
|
1541
1609
|
"H"
|
|
@@ -1575,6 +1643,10 @@ var U = {
|
|
|
1575
1643
|
"H",
|
|
1576
1644
|
"hB"
|
|
1577
1645
|
],
|
|
1646
|
+
ZW: [
|
|
1647
|
+
"H",
|
|
1648
|
+
"h"
|
|
1649
|
+
],
|
|
1578
1650
|
"af-ZA": [
|
|
1579
1651
|
"H",
|
|
1580
1652
|
"h",
|
|
@@ -1711,9 +1783,9 @@ function $e(e, t) {
|
|
|
1711
1783
|
if (a === "j") {
|
|
1712
1784
|
for (var i = 0; r + 1 < e.length && e.charAt(r + 1) === a; )
|
|
1713
1785
|
i++, r++;
|
|
1714
|
-
var o = 1 + (i & 1), s = i < 2 ? 1 : 3 + (i >> 1),
|
|
1786
|
+
var o = 1 + (i & 1), s = i < 2 ? 1 : 3 + (i >> 1), h = "a", l = Ke(t);
|
|
1715
1787
|
for ((l == "H" || l == "k") && (s = 0); s-- > 0; )
|
|
1716
|
-
n +=
|
|
1788
|
+
n += h;
|
|
1717
1789
|
for (; o-- > 0; )
|
|
1718
1790
|
n = l + n;
|
|
1719
1791
|
} else
|
|
@@ -1743,20 +1815,20 @@ function Ke(e) {
|
|
|
1743
1815
|
var a = U[r || ""] || U[n || ""] || U["".concat(n, "-001")] || U["001"];
|
|
1744
1816
|
return a[0];
|
|
1745
1817
|
}
|
|
1746
|
-
var X, et = new RegExp("^".concat(
|
|
1818
|
+
var X, et = new RegExp("^".concat(He.source, "*")), tt = new RegExp("".concat(He.source, "*$"));
|
|
1747
1819
|
function v(e, t) {
|
|
1748
1820
|
return { start: e, end: t };
|
|
1749
1821
|
}
|
|
1750
|
-
var rt = !!String.prototype.startsWith && "_a".startsWith("a", 1), nt = !!String.fromCodePoint, at = !!Object.fromEntries, it = !!String.prototype.codePointAt, ot = !!String.prototype.trimStart, st = !!String.prototype.trimEnd,
|
|
1822
|
+
var rt = !!String.prototype.startsWith && "_a".startsWith("a", 1), nt = !!String.fromCodePoint, at = !!Object.fromEntries, it = !!String.prototype.codePointAt, ot = !!String.prototype.trimStart, st = !!String.prototype.trimEnd, ht = !!Number.isSafeInteger, ut = ht ? Number.isSafeInteger : function(e) {
|
|
1751
1823
|
return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
|
|
1752
|
-
},
|
|
1824
|
+
}, q = !0;
|
|
1753
1825
|
try {
|
|
1754
1826
|
var lt = _e("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1755
|
-
|
|
1827
|
+
q = ((X = lt.exec("a")) === null || X === void 0 ? void 0 : X[0]) === "a";
|
|
1756
1828
|
} catch {
|
|
1757
|
-
|
|
1829
|
+
q = !1;
|
|
1758
1830
|
}
|
|
1759
|
-
var
|
|
1831
|
+
var he = rt ? (
|
|
1760
1832
|
// Native
|
|
1761
1833
|
function(t, n, r) {
|
|
1762
1834
|
return t.startsWith(n, r);
|
|
@@ -1778,7 +1850,7 @@ var ue = rt ? (
|
|
|
1778
1850
|
}
|
|
1779
1851
|
return r;
|
|
1780
1852
|
}
|
|
1781
|
-
),
|
|
1853
|
+
), ue = (
|
|
1782
1854
|
// native
|
|
1783
1855
|
at ? Object.fromEntries : (
|
|
1784
1856
|
// Ponyfill
|
|
@@ -1829,7 +1901,7 @@ function _e(e, t) {
|
|
|
1829
1901
|
return new RegExp(e, t);
|
|
1830
1902
|
}
|
|
1831
1903
|
var Y;
|
|
1832
|
-
if (
|
|
1904
|
+
if (q) {
|
|
1833
1905
|
var le = _e("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1834
1906
|
Y = function(t, n) {
|
|
1835
1907
|
var r;
|
|
@@ -1913,8 +1985,8 @@ var ct = (
|
|
|
1913
1985
|
if (this.bumpIf("</")) {
|
|
1914
1986
|
if (this.isEOF() || !$(this.char()))
|
|
1915
1987
|
return this.error(g.INVALID_TAG, v(s, this.clonePosition()));
|
|
1916
|
-
var
|
|
1917
|
-
return a !== l ? this.error(g.UNMATCHED_CLOSING_TAG, v(
|
|
1988
|
+
var h = this.clonePosition(), l = this.parseTagName();
|
|
1989
|
+
return a !== l ? this.error(g.UNMATCHED_CLOSING_TAG, v(h, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
|
|
1918
1990
|
val: {
|
|
1919
1991
|
type: b.tag,
|
|
1920
1992
|
value: a,
|
|
@@ -1951,9 +2023,9 @@ var ct = (
|
|
|
1951
2023
|
}
|
|
1952
2024
|
break;
|
|
1953
2025
|
}
|
|
1954
|
-
var
|
|
2026
|
+
var h = v(r, this.clonePosition());
|
|
1955
2027
|
return {
|
|
1956
|
-
val: { type: b.literal, value: a, location:
|
|
2028
|
+
val: { type: b.literal, value: a, location: h },
|
|
1957
2029
|
err: null
|
|
1958
2030
|
};
|
|
1959
2031
|
}, e.prototype.tryParseLeftAngleBracket = function() {
|
|
@@ -2031,10 +2103,10 @@ var ct = (
|
|
|
2031
2103
|
var i = this.clonePosition(), o = v(t, i);
|
|
2032
2104
|
return { value: r, location: o };
|
|
2033
2105
|
}, e.prototype.parseArgumentOptions = function(t, n, r, a) {
|
|
2034
|
-
var i, o = this.clonePosition(), s = this.parseIdentifierIfPossible().value,
|
|
2106
|
+
var i, o = this.clonePosition(), s = this.parseIdentifierIfPossible().value, h = this.clonePosition();
|
|
2035
2107
|
switch (s) {
|
|
2036
2108
|
case "":
|
|
2037
|
-
return this.error(g.EXPECT_ARGUMENT_TYPE, v(o,
|
|
2109
|
+
return this.error(g.EXPECT_ARGUMENT_TYPE, v(o, h));
|
|
2038
2110
|
case "number":
|
|
2039
2111
|
case "date":
|
|
2040
2112
|
case "time": {
|
|
@@ -2042,20 +2114,20 @@ var ct = (
|
|
|
2042
2114
|
var l = null;
|
|
2043
2115
|
if (this.bumpIf(",")) {
|
|
2044
2116
|
this.bumpSpace();
|
|
2045
|
-
var
|
|
2117
|
+
var u = this.clonePosition(), c = this.parseSimpleArgStyleIfPossible();
|
|
2046
2118
|
if (c.err)
|
|
2047
2119
|
return c;
|
|
2048
2120
|
var m = mt(c.val);
|
|
2049
2121
|
if (m.length === 0)
|
|
2050
2122
|
return this.error(g.EXPECT_ARGUMENT_STYLE, v(this.clonePosition(), this.clonePosition()));
|
|
2051
|
-
var p = v(
|
|
2123
|
+
var p = v(u, this.clonePosition());
|
|
2052
2124
|
l = { style: m, styleLocation: p };
|
|
2053
2125
|
}
|
|
2054
2126
|
var d = this.tryParseArgumentClose(a);
|
|
2055
2127
|
if (d.err)
|
|
2056
2128
|
return d;
|
|
2057
2129
|
var E = v(a, this.clonePosition());
|
|
2058
|
-
if (l &&
|
|
2130
|
+
if (l && he(l == null ? void 0 : l.style, "::", 0)) {
|
|
2059
2131
|
var x = ft(l.style.slice(2));
|
|
2060
2132
|
if (s === "number") {
|
|
2061
2133
|
var c = this.parseNumberSkeletonFromString(x, l.styleLocation);
|
|
@@ -2072,10 +2144,10 @@ var ct = (
|
|
|
2072
2144
|
type: D.dateTime,
|
|
2073
2145
|
pattern: y,
|
|
2074
2146
|
location: l.styleLocation,
|
|
2075
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2076
|
-
},
|
|
2147
|
+
parsedOptions: this.shouldParseSkeletons ? We(y) : {}
|
|
2148
|
+
}, H = s === "date" ? b.date : b.time;
|
|
2077
2149
|
return {
|
|
2078
|
-
val: { type:
|
|
2150
|
+
val: { type: H, value: r, location: E, style: m },
|
|
2079
2151
|
err: null
|
|
2080
2152
|
};
|
|
2081
2153
|
}
|
|
@@ -2118,7 +2190,7 @@ var ct = (
|
|
|
2118
2190
|
val: {
|
|
2119
2191
|
type: b.select,
|
|
2120
2192
|
value: r,
|
|
2121
|
-
options:
|
|
2193
|
+
options: ue(G.val),
|
|
2122
2194
|
location: ne
|
|
2123
2195
|
},
|
|
2124
2196
|
err: null
|
|
@@ -2126,7 +2198,7 @@ var ct = (
|
|
|
2126
2198
|
val: {
|
|
2127
2199
|
type: b.plural,
|
|
2128
2200
|
value: r,
|
|
2129
|
-
options:
|
|
2201
|
+
options: ue(G.val),
|
|
2130
2202
|
offset: L,
|
|
2131
2203
|
pluralType: s === "plural" ? "cardinal" : "ordinal",
|
|
2132
2204
|
location: ne
|
|
@@ -2135,7 +2207,7 @@ var ct = (
|
|
|
2135
2207
|
};
|
|
2136
2208
|
}
|
|
2137
2209
|
default:
|
|
2138
|
-
return this.error(g.INVALID_ARGUMENT_TYPE, v(o,
|
|
2210
|
+
return this.error(g.INVALID_ARGUMENT_TYPE, v(o, h));
|
|
2139
2211
|
}
|
|
2140
2212
|
}, e.prototype.tryParseArgumentClose = function(t) {
|
|
2141
2213
|
return this.isEOF() || this.char() !== 125 ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, v(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });
|
|
@@ -2191,19 +2263,19 @@ var ct = (
|
|
|
2191
2263
|
err: null
|
|
2192
2264
|
};
|
|
2193
2265
|
}, e.prototype.tryParsePluralOrSelectOptions = function(t, n, r, a) {
|
|
2194
|
-
for (var i, o = !1, s = [],
|
|
2266
|
+
for (var i, o = !1, s = [], h = /* @__PURE__ */ new Set(), l = a.value, u = a.location; ; ) {
|
|
2195
2267
|
if (l.length === 0) {
|
|
2196
2268
|
var c = this.clonePosition();
|
|
2197
2269
|
if (n !== "select" && this.bumpIf("=")) {
|
|
2198
2270
|
var m = this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR, g.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
2199
2271
|
if (m.err)
|
|
2200
2272
|
return m;
|
|
2201
|
-
|
|
2273
|
+
u = v(c, this.clonePosition()), l = this.message.slice(c.offset, this.offset());
|
|
2202
2274
|
} else
|
|
2203
2275
|
break;
|
|
2204
2276
|
}
|
|
2205
|
-
if (
|
|
2206
|
-
return this.error(n === "select" ? g.DUPLICATE_SELECT_ARGUMENT_SELECTOR : g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,
|
|
2277
|
+
if (h.has(l))
|
|
2278
|
+
return this.error(n === "select" ? g.DUPLICATE_SELECT_ARGUMENT_SELECTOR : g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, u);
|
|
2207
2279
|
l === "other" && (o = !0), this.bumpSpace();
|
|
2208
2280
|
var p = this.clonePosition();
|
|
2209
2281
|
if (!this.bumpIf("{"))
|
|
@@ -2220,7 +2292,7 @@ var ct = (
|
|
|
2220
2292
|
value: d.val,
|
|
2221
2293
|
location: v(p, this.clonePosition())
|
|
2222
2294
|
}
|
|
2223
|
-
]),
|
|
2295
|
+
]), h.add(l), this.bumpSpace(), i = this.parseIdentifierIfPossible(), l = i.value, u = i.location;
|
|
2224
2296
|
}
|
|
2225
2297
|
return s.length === 0 ? this.error(n === "select" ? g.EXPECT_SELECT_ARGUMENT_SELECTOR : g.EXPECT_PLURAL_ARGUMENT_SELECTOR, v(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !o ? this.error(g.MISSING_OTHER_CLAUSE, v(this.clonePosition(), this.clonePosition())) : { val: s, err: null };
|
|
2226
2298
|
}, e.prototype.tryParseDecimalInteger = function(t, n) {
|
|
@@ -2233,8 +2305,8 @@ var ct = (
|
|
|
2233
2305
|
else
|
|
2234
2306
|
break;
|
|
2235
2307
|
}
|
|
2236
|
-
var
|
|
2237
|
-
return i ? (o *= r,
|
|
2308
|
+
var h = v(a, this.clonePosition());
|
|
2309
|
+
return i ? (o *= r, ut(o) ? { val: o, err: null } : this.error(n, h)) : this.error(t, h);
|
|
2238
2310
|
}, e.prototype.offset = function() {
|
|
2239
2311
|
return this.position.offset;
|
|
2240
2312
|
}, e.prototype.isEOF = function() {
|
|
@@ -2268,7 +2340,7 @@ var ct = (
|
|
|
2268
2340
|
t === 10 ? (this.position.line += 1, this.position.column = 1, this.position.offset += 1) : (this.position.column += 1, this.position.offset += t < 65536 ? 1 : 2);
|
|
2269
2341
|
}
|
|
2270
2342
|
}, e.prototype.bumpIf = function(t) {
|
|
2271
|
-
if (
|
|
2343
|
+
if (he(this.message, t, this.offset())) {
|
|
2272
2344
|
for (var n = 0; n < t.length; n++)
|
|
2273
2345
|
this.bump();
|
|
2274
2346
|
return !0;
|
|
@@ -2321,7 +2393,7 @@ function K(e) {
|
|
|
2321
2393
|
for (var n in t.options)
|
|
2322
2394
|
delete t.options[n].location, K(t.options[n].value);
|
|
2323
2395
|
else
|
|
2324
|
-
Ee(t) && Se(t.style) || (be(t) || de(t)) &&
|
|
2396
|
+
Ee(t) && Se(t.style) || (be(t) || de(t)) && J(t.style) ? delete t.style.location : Te(t) && K(t.children);
|
|
2325
2397
|
});
|
|
2326
2398
|
}
|
|
2327
2399
|
function Et(e, t) {
|
|
@@ -2333,7 +2405,7 @@ function Et(e, t) {
|
|
|
2333
2405
|
}
|
|
2334
2406
|
return t != null && t.captureLocation || K(n.val), n.val;
|
|
2335
2407
|
}
|
|
2336
|
-
function
|
|
2408
|
+
function A(e, t) {
|
|
2337
2409
|
var n = t && t.cache ? t.cache : St, r = t && t.serializer ? t.serializer : Tt, a = t && t.strategy ? t.strategy : dt;
|
|
2338
2410
|
return a(e, {
|
|
2339
2411
|
cache: n,
|
|
@@ -2390,7 +2462,7 @@ var St = {
|
|
|
2390
2462
|
var R = (
|
|
2391
2463
|
/** @class */
|
|
2392
2464
|
function(e) {
|
|
2393
|
-
|
|
2465
|
+
N(t, e);
|
|
2394
2466
|
function t(n, r, a) {
|
|
2395
2467
|
var i = e.call(this, n) || this;
|
|
2396
2468
|
return i.code = r, i.originalMessage = a, i;
|
|
@@ -2402,25 +2474,25 @@ var R = (
|
|
|
2402
2474
|
), fe = (
|
|
2403
2475
|
/** @class */
|
|
2404
2476
|
function(e) {
|
|
2405
|
-
|
|
2477
|
+
N(t, e);
|
|
2406
2478
|
function t(n, r, a, i) {
|
|
2407
2479
|
return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(r, '". Options are "').concat(Object.keys(a).join('", "'), '"'), _.INVALID_VALUE, i) || this;
|
|
2408
2480
|
}
|
|
2409
2481
|
return t;
|
|
2410
2482
|
}(R)
|
|
2411
|
-
),
|
|
2483
|
+
), Ht = (
|
|
2412
2484
|
/** @class */
|
|
2413
2485
|
function(e) {
|
|
2414
|
-
|
|
2486
|
+
N(t, e);
|
|
2415
2487
|
function t(n, r, a) {
|
|
2416
2488
|
return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(r), _.INVALID_VALUE, a) || this;
|
|
2417
2489
|
}
|
|
2418
2490
|
return t;
|
|
2419
2491
|
}(R)
|
|
2420
|
-
),
|
|
2492
|
+
), It = (
|
|
2421
2493
|
/** @class */
|
|
2422
2494
|
function(e) {
|
|
2423
|
-
|
|
2495
|
+
N(t, e);
|
|
2424
2496
|
function t(n, r) {
|
|
2425
2497
|
return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(r, '"'), _.MISSING_VALUE, r) || this;
|
|
2426
2498
|
}
|
|
@@ -2430,16 +2502,16 @@ var R = (
|
|
|
2430
2502
|
(function(e) {
|
|
2431
2503
|
e[e.literal = 0] = "literal", e[e.object = 1] = "object";
|
|
2432
2504
|
})(S || (S = {}));
|
|
2433
|
-
function
|
|
2505
|
+
function Nt(e) {
|
|
2434
2506
|
return e.length < 2 ? e : e.reduce(function(t, n) {
|
|
2435
2507
|
var r = t[t.length - 1];
|
|
2436
2508
|
return !r || r.type !== S.literal || n.type !== S.literal ? t.push(n) : r.value += n.value, t;
|
|
2437
2509
|
}, []);
|
|
2438
2510
|
}
|
|
2439
|
-
function
|
|
2511
|
+
function At(e) {
|
|
2440
2512
|
return typeof e == "function";
|
|
2441
2513
|
}
|
|
2442
|
-
function
|
|
2514
|
+
function k(e, t, n, r, a, i, o) {
|
|
2443
2515
|
if (e.length === 1 && ae(e[0]))
|
|
2444
2516
|
return [
|
|
2445
2517
|
{
|
|
@@ -2447,95 +2519,95 @@ function V(e, t, n, r, a, i, o) {
|
|
|
2447
2519
|
value: e[0].value
|
|
2448
2520
|
}
|
|
2449
2521
|
];
|
|
2450
|
-
for (var s = [],
|
|
2451
|
-
var
|
|
2452
|
-
if (ae(
|
|
2522
|
+
for (var s = [], h = 0, l = e; h < l.length; h++) {
|
|
2523
|
+
var u = l[h];
|
|
2524
|
+
if (ae(u)) {
|
|
2453
2525
|
s.push({
|
|
2454
2526
|
type: S.literal,
|
|
2455
|
-
value:
|
|
2527
|
+
value: u.value
|
|
2456
2528
|
});
|
|
2457
2529
|
continue;
|
|
2458
2530
|
}
|
|
2459
|
-
if (je(
|
|
2531
|
+
if (je(u)) {
|
|
2460
2532
|
typeof i == "number" && s.push({
|
|
2461
2533
|
type: S.literal,
|
|
2462
2534
|
value: n.getNumberFormat(t).format(i)
|
|
2463
2535
|
});
|
|
2464
2536
|
continue;
|
|
2465
2537
|
}
|
|
2466
|
-
var c =
|
|
2538
|
+
var c = u.value;
|
|
2467
2539
|
if (!(a && c in a))
|
|
2468
|
-
throw new
|
|
2540
|
+
throw new It(c, o);
|
|
2469
2541
|
var m = a[c];
|
|
2470
|
-
if (
|
|
2542
|
+
if (ke(u)) {
|
|
2471
2543
|
(!m || typeof m == "string" || typeof m == "number") && (m = typeof m == "string" || typeof m == "number" ? String(m) : ""), s.push({
|
|
2472
2544
|
type: typeof m == "string" ? S.literal : S.object,
|
|
2473
2545
|
value: m
|
|
2474
2546
|
});
|
|
2475
2547
|
continue;
|
|
2476
2548
|
}
|
|
2477
|
-
if (be(
|
|
2478
|
-
var p = typeof
|
|
2549
|
+
if (be(u)) {
|
|
2550
|
+
var p = typeof u.style == "string" ? r.date[u.style] : J(u.style) ? u.style.parsedOptions : void 0;
|
|
2479
2551
|
s.push({
|
|
2480
2552
|
type: S.literal,
|
|
2481
2553
|
value: n.getDateTimeFormat(t, p).format(m)
|
|
2482
2554
|
});
|
|
2483
2555
|
continue;
|
|
2484
2556
|
}
|
|
2485
|
-
if (de(
|
|
2486
|
-
var p = typeof
|
|
2557
|
+
if (de(u)) {
|
|
2558
|
+
var p = typeof u.style == "string" ? r.time[u.style] : J(u.style) ? u.style.parsedOptions : r.time.medium;
|
|
2487
2559
|
s.push({
|
|
2488
2560
|
type: S.literal,
|
|
2489
2561
|
value: n.getDateTimeFormat(t, p).format(m)
|
|
2490
2562
|
});
|
|
2491
2563
|
continue;
|
|
2492
2564
|
}
|
|
2493
|
-
if (Ee(
|
|
2494
|
-
var p = typeof
|
|
2565
|
+
if (Ee(u)) {
|
|
2566
|
+
var p = typeof u.style == "string" ? r.number[u.style] : Se(u.style) ? u.style.parsedOptions : void 0;
|
|
2495
2567
|
p && p.scale && (m = m * (p.scale || 1)), s.push({
|
|
2496
2568
|
type: S.literal,
|
|
2497
2569
|
value: n.getNumberFormat(t, p).format(m)
|
|
2498
2570
|
});
|
|
2499
2571
|
continue;
|
|
2500
2572
|
}
|
|
2501
|
-
if (Te(
|
|
2502
|
-
var d =
|
|
2503
|
-
if (!
|
|
2504
|
-
throw new
|
|
2505
|
-
var y =
|
|
2573
|
+
if (Te(u)) {
|
|
2574
|
+
var d = u.children, E = u.value, x = a[E];
|
|
2575
|
+
if (!At(x))
|
|
2576
|
+
throw new Ht(E, "function", o);
|
|
2577
|
+
var y = k(d, t, n, r, a, i), H = x(y.map(function(L) {
|
|
2506
2578
|
return L.value;
|
|
2507
2579
|
}));
|
|
2508
|
-
Array.isArray(
|
|
2580
|
+
Array.isArray(H) || (H = [H]), s.push.apply(s, H.map(function(L) {
|
|
2509
2581
|
return {
|
|
2510
2582
|
type: typeof L == "string" ? S.literal : S.object,
|
|
2511
2583
|
value: L
|
|
2512
2584
|
};
|
|
2513
2585
|
}));
|
|
2514
2586
|
}
|
|
2515
|
-
if (xe(
|
|
2516
|
-
var T =
|
|
2587
|
+
if (xe(u)) {
|
|
2588
|
+
var T = u.options[m] || u.options.other;
|
|
2517
2589
|
if (!T)
|
|
2518
|
-
throw new fe(
|
|
2519
|
-
s.push.apply(s,
|
|
2590
|
+
throw new fe(u.value, m, Object.keys(u.options), o);
|
|
2591
|
+
s.push.apply(s, k(T.value, t, n, r, a));
|
|
2520
2592
|
continue;
|
|
2521
2593
|
}
|
|
2522
|
-
if (ye(
|
|
2523
|
-
var T =
|
|
2594
|
+
if (ye(u)) {
|
|
2595
|
+
var T = u.options["=".concat(m)];
|
|
2524
2596
|
if (!T) {
|
|
2525
2597
|
if (!Intl.PluralRules)
|
|
2526
2598
|
throw new R(`Intl.PluralRules is not available in this environment.
|
|
2527
2599
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2528
2600
|
`, _.MISSING_INTL_API, o);
|
|
2529
|
-
var w = n.getPluralRules(t, { type:
|
|
2530
|
-
T =
|
|
2601
|
+
var w = n.getPluralRules(t, { type: u.pluralType }).select(m - (u.offset || 0));
|
|
2602
|
+
T = u.options[w] || u.options.other;
|
|
2531
2603
|
}
|
|
2532
2604
|
if (!T)
|
|
2533
|
-
throw new fe(
|
|
2534
|
-
s.push.apply(s,
|
|
2605
|
+
throw new fe(u.value, m, Object.keys(u.options), o);
|
|
2606
|
+
s.push.apply(s, k(T.value, t, n, r, a, m - (u.offset || 0)));
|
|
2535
2607
|
continue;
|
|
2536
2608
|
}
|
|
2537
2609
|
}
|
|
2538
|
-
return
|
|
2610
|
+
return Nt(s);
|
|
2539
2611
|
}
|
|
2540
2612
|
function Bt(e, t) {
|
|
2541
2613
|
return t ? f(f(f({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) {
|
|
@@ -2547,7 +2619,7 @@ function _t(e, t) {
|
|
|
2547
2619
|
return n[r] = Bt(e[r], t[r]), n;
|
|
2548
2620
|
}, f({}, e)) : e;
|
|
2549
2621
|
}
|
|
2550
|
-
function
|
|
2622
|
+
function W(e) {
|
|
2551
2623
|
return {
|
|
2552
2624
|
create: function() {
|
|
2553
2625
|
return {
|
|
@@ -2567,28 +2639,28 @@ function Pt(e) {
|
|
|
2567
2639
|
dateTime: {},
|
|
2568
2640
|
pluralRules: {}
|
|
2569
2641
|
}), {
|
|
2570
|
-
getNumberFormat:
|
|
2642
|
+
getNumberFormat: A(function() {
|
|
2571
2643
|
for (var t, n = [], r = 0; r < arguments.length; r++)
|
|
2572
2644
|
n[r] = arguments[r];
|
|
2573
2645
|
return new ((t = Intl.NumberFormat).bind.apply(t, P([void 0], n, !1)))();
|
|
2574
2646
|
}, {
|
|
2575
|
-
cache:
|
|
2647
|
+
cache: W(e.number),
|
|
2576
2648
|
strategy: B.variadic
|
|
2577
2649
|
}),
|
|
2578
|
-
getDateTimeFormat:
|
|
2650
|
+
getDateTimeFormat: A(function() {
|
|
2579
2651
|
for (var t, n = [], r = 0; r < arguments.length; r++)
|
|
2580
2652
|
n[r] = arguments[r];
|
|
2581
2653
|
return new ((t = Intl.DateTimeFormat).bind.apply(t, P([void 0], n, !1)))();
|
|
2582
2654
|
}, {
|
|
2583
|
-
cache:
|
|
2655
|
+
cache: W(e.dateTime),
|
|
2584
2656
|
strategy: B.variadic
|
|
2585
2657
|
}),
|
|
2586
|
-
getPluralRules:
|
|
2658
|
+
getPluralRules: A(function() {
|
|
2587
2659
|
for (var t, n = [], r = 0; r < arguments.length; r++)
|
|
2588
2660
|
n[r] = arguments[r];
|
|
2589
2661
|
return new ((t = Intl.PluralRules).bind.apply(t, P([void 0], n, !1)))();
|
|
2590
2662
|
}, {
|
|
2591
|
-
cache:
|
|
2663
|
+
cache: W(e.pluralRules),
|
|
2592
2664
|
strategy: B.variadic
|
|
2593
2665
|
})
|
|
2594
2666
|
};
|
|
@@ -2597,26 +2669,25 @@ var Oe = (
|
|
|
2597
2669
|
/** @class */
|
|
2598
2670
|
function() {
|
|
2599
2671
|
function e(t, n, r, a) {
|
|
2600
|
-
n === void 0 && (n = e.defaultLocale);
|
|
2601
2672
|
var i = this;
|
|
2602
|
-
if (this.formatterCache = {
|
|
2673
|
+
if (n === void 0 && (n = e.defaultLocale), this.formatterCache = {
|
|
2603
2674
|
number: {},
|
|
2604
2675
|
dateTime: {},
|
|
2605
2676
|
pluralRules: {}
|
|
2606
|
-
}, this.format = function(
|
|
2607
|
-
var l = i.formatToParts(
|
|
2677
|
+
}, this.format = function(h) {
|
|
2678
|
+
var l = i.formatToParts(h);
|
|
2608
2679
|
if (l.length === 1)
|
|
2609
2680
|
return l[0].value;
|
|
2610
|
-
var
|
|
2681
|
+
var u = l.reduce(function(c, m) {
|
|
2611
2682
|
return !c.length || m.type !== S.literal || typeof c[c.length - 1] != "string" ? c.push(m.value) : c[c.length - 1] += m.value, c;
|
|
2612
2683
|
}, []);
|
|
2613
|
-
return
|
|
2614
|
-
}, this.formatToParts = function(
|
|
2615
|
-
return
|
|
2684
|
+
return u.length <= 1 ? u[0] || "" : u;
|
|
2685
|
+
}, this.formatToParts = function(h) {
|
|
2686
|
+
return k(i.ast, i.locales, i.formatters, i.formats, h, void 0, i.message);
|
|
2616
2687
|
}, this.resolvedOptions = function() {
|
|
2617
|
-
var
|
|
2688
|
+
var h;
|
|
2618
2689
|
return {
|
|
2619
|
-
locale: ((
|
|
2690
|
+
locale: ((h = i.resolvedLocale) === null || h === void 0 ? void 0 : h.toString()) || Intl.NumberFormat.supportedLocalesOf(i.locales)[0]
|
|
2620
2691
|
};
|
|
2621
2692
|
}, this.getAst = function() {
|
|
2622
2693
|
return i.ast;
|
|
@@ -2625,7 +2696,7 @@ var Oe = (
|
|
|
2625
2696
|
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
2626
2697
|
var o = a || {};
|
|
2627
2698
|
o.formatters;
|
|
2628
|
-
var s =
|
|
2699
|
+
var s = Ve(o, ["formatters"]);
|
|
2629
2700
|
this.ast = e.__parse(t, f(f({}, s), { locale: this.resolvedLocale }));
|
|
2630
2701
|
} else
|
|
2631
2702
|
this.ast = t;
|
|
@@ -2711,7 +2782,7 @@ var Oe = (
|
|
|
2711
2782
|
var F = (
|
|
2712
2783
|
/** @class */
|
|
2713
2784
|
function(e) {
|
|
2714
|
-
|
|
2785
|
+
N(t, e);
|
|
2715
2786
|
function t(n, r, a) {
|
|
2716
2787
|
var i = this, o = a ? a instanceof Error ? a : new Error(String(a)) : void 0;
|
|
2717
2788
|
return i = e.call(this, "[@formatjs/intl Error ".concat(n, "] ").concat(r, `
|
|
@@ -2724,7 +2795,7 @@ var F = (
|
|
|
2724
2795
|
), Rt = (
|
|
2725
2796
|
/** @class */
|
|
2726
2797
|
function(e) {
|
|
2727
|
-
|
|
2798
|
+
N(t, e);
|
|
2728
2799
|
function t(n, r) {
|
|
2729
2800
|
return e.call(this, M.UNSUPPORTED_FORMATTER, n, r) || this;
|
|
2730
2801
|
}
|
|
@@ -2733,7 +2804,7 @@ var F = (
|
|
|
2733
2804
|
), Lt = (
|
|
2734
2805
|
/** @class */
|
|
2735
2806
|
function(e) {
|
|
2736
|
-
|
|
2807
|
+
N(t, e);
|
|
2737
2808
|
function t(n, r) {
|
|
2738
2809
|
return e.call(this, M.INVALID_CONFIG, n, r) || this;
|
|
2739
2810
|
}
|
|
@@ -2742,16 +2813,16 @@ var F = (
|
|
|
2742
2813
|
), me = (
|
|
2743
2814
|
/** @class */
|
|
2744
2815
|
function(e) {
|
|
2745
|
-
|
|
2816
|
+
N(t, e);
|
|
2746
2817
|
function t(n, r) {
|
|
2747
2818
|
return e.call(this, M.MISSING_DATA, n, r) || this;
|
|
2748
2819
|
}
|
|
2749
2820
|
return t;
|
|
2750
2821
|
}(F)
|
|
2751
|
-
),
|
|
2822
|
+
), I = (
|
|
2752
2823
|
/** @class */
|
|
2753
2824
|
function(e) {
|
|
2754
|
-
|
|
2825
|
+
N(t, e);
|
|
2755
2826
|
function t(n, r, a) {
|
|
2756
2827
|
var i = e.call(this, M.FORMAT_ERROR, "".concat(n, `
|
|
2757
2828
|
Locale: `).concat(r, `
|
|
@@ -2760,10 +2831,10 @@ Locale: `).concat(r, `
|
|
|
2760
2831
|
}
|
|
2761
2832
|
return t;
|
|
2762
2833
|
}(F)
|
|
2763
|
-
),
|
|
2834
|
+
), Z = (
|
|
2764
2835
|
/** @class */
|
|
2765
2836
|
function(e) {
|
|
2766
|
-
|
|
2837
|
+
N(t, e);
|
|
2767
2838
|
function t(n, r, a, i) {
|
|
2768
2839
|
var o = e.call(this, "".concat(n, `
|
|
2769
2840
|
MessageID: `).concat(a == null ? void 0 : a.id, `
|
|
@@ -2773,11 +2844,11 @@ Description: `).concat(a == null ? void 0 : a.description, `
|
|
|
2773
2844
|
return o.descriptor = a, o.locale = r, o;
|
|
2774
2845
|
}
|
|
2775
2846
|
return t;
|
|
2776
|
-
}(
|
|
2847
|
+
}(I)
|
|
2777
2848
|
), Ot = (
|
|
2778
2849
|
/** @class */
|
|
2779
2850
|
function(e) {
|
|
2780
|
-
|
|
2851
|
+
N(t, e);
|
|
2781
2852
|
function t(n, r) {
|
|
2782
2853
|
var a = e.call(this, M.MISSING_TRANSLATION, 'Missing message: "'.concat(n.id, '" for locale "').concat(r, '", using ').concat(n.defaultMessage ? "default message (".concat(typeof n.defaultMessage == "string" ? n.defaultMessage : n.defaultMessage.map(function(i) {
|
|
2783
2854
|
var o;
|
|
@@ -2834,24 +2905,24 @@ function O(e) {
|
|
|
2834
2905
|
}
|
|
2835
2906
|
function wt(e) {
|
|
2836
2907
|
e === void 0 && (e = Me());
|
|
2837
|
-
var t = Intl.RelativeTimeFormat, n = Intl.ListFormat, r = Intl.DisplayNames, a =
|
|
2838
|
-
for (var s,
|
|
2839
|
-
|
|
2840
|
-
return new ((s = Intl.DateTimeFormat).bind.apply(s, P([void 0],
|
|
2908
|
+
var t = Intl.RelativeTimeFormat, n = Intl.ListFormat, r = Intl.DisplayNames, a = A(function() {
|
|
2909
|
+
for (var s, h = [], l = 0; l < arguments.length; l++)
|
|
2910
|
+
h[l] = arguments[l];
|
|
2911
|
+
return new ((s = Intl.DateTimeFormat).bind.apply(s, P([void 0], h, !1)))();
|
|
2841
2912
|
}, {
|
|
2842
2913
|
cache: O(e.dateTime),
|
|
2843
2914
|
strategy: B.variadic
|
|
2844
|
-
}), i =
|
|
2845
|
-
for (var s,
|
|
2846
|
-
|
|
2847
|
-
return new ((s = Intl.NumberFormat).bind.apply(s, P([void 0],
|
|
2915
|
+
}), i = A(function() {
|
|
2916
|
+
for (var s, h = [], l = 0; l < arguments.length; l++)
|
|
2917
|
+
h[l] = arguments[l];
|
|
2918
|
+
return new ((s = Intl.NumberFormat).bind.apply(s, P([void 0], h, !1)))();
|
|
2848
2919
|
}, {
|
|
2849
2920
|
cache: O(e.number),
|
|
2850
2921
|
strategy: B.variadic
|
|
2851
|
-
}), o =
|
|
2852
|
-
for (var s,
|
|
2853
|
-
|
|
2854
|
-
return new ((s = Intl.PluralRules).bind.apply(s, P([void 0],
|
|
2922
|
+
}), o = A(function() {
|
|
2923
|
+
for (var s, h = [], l = 0; l < arguments.length; l++)
|
|
2924
|
+
h[l] = arguments[l];
|
|
2925
|
+
return new ((s = Intl.PluralRules).bind.apply(s, P([void 0], h, !1)))();
|
|
2855
2926
|
}, {
|
|
2856
2927
|
cache: O(e.pluralRules),
|
|
2857
2928
|
strategy: B.variadic
|
|
@@ -2859,36 +2930,36 @@ function wt(e) {
|
|
|
2859
2930
|
return {
|
|
2860
2931
|
getDateTimeFormat: a,
|
|
2861
2932
|
getNumberFormat: i,
|
|
2862
|
-
getMessageFormat:
|
|
2863
|
-
return new Oe(s,
|
|
2933
|
+
getMessageFormat: A(function(s, h, l, u) {
|
|
2934
|
+
return new Oe(s, h, l, f({ formatters: {
|
|
2864
2935
|
getNumberFormat: i,
|
|
2865
2936
|
getDateTimeFormat: a,
|
|
2866
2937
|
getPluralRules: o
|
|
2867
|
-
} },
|
|
2938
|
+
} }, u || {}));
|
|
2868
2939
|
}, {
|
|
2869
2940
|
cache: O(e.message),
|
|
2870
2941
|
strategy: B.variadic
|
|
2871
2942
|
}),
|
|
2872
|
-
getRelativeTimeFormat:
|
|
2873
|
-
for (var s = [],
|
|
2874
|
-
s[
|
|
2943
|
+
getRelativeTimeFormat: A(function() {
|
|
2944
|
+
for (var s = [], h = 0; h < arguments.length; h++)
|
|
2945
|
+
s[h] = arguments[h];
|
|
2875
2946
|
return new (t.bind.apply(t, P([void 0], s, !1)))();
|
|
2876
2947
|
}, {
|
|
2877
2948
|
cache: O(e.relativeTime),
|
|
2878
2949
|
strategy: B.variadic
|
|
2879
2950
|
}),
|
|
2880
2951
|
getPluralRules: o,
|
|
2881
|
-
getListFormat:
|
|
2882
|
-
for (var s = [],
|
|
2883
|
-
s[
|
|
2952
|
+
getListFormat: A(function() {
|
|
2953
|
+
for (var s = [], h = 0; h < arguments.length; h++)
|
|
2954
|
+
s[h] = arguments[h];
|
|
2884
2955
|
return new (n.bind.apply(n, P([void 0], s, !1)))();
|
|
2885
2956
|
}, {
|
|
2886
2957
|
cache: O(e.list),
|
|
2887
2958
|
strategy: B.variadic
|
|
2888
2959
|
}),
|
|
2889
|
-
getDisplayNames:
|
|
2890
|
-
for (var s = [],
|
|
2891
|
-
s[
|
|
2960
|
+
getDisplayNames: A(function() {
|
|
2961
|
+
for (var s = [], h = 0; h < arguments.length; h++)
|
|
2962
|
+
s[h] = arguments[h];
|
|
2892
2963
|
return new (r.bind.apply(r, P([void 0], s, !1)))();
|
|
2893
2964
|
}, {
|
|
2894
2965
|
cache: O(e.displayNames),
|
|
@@ -2906,7 +2977,7 @@ function Ft(e, t, n) {
|
|
|
2906
2977
|
if (n === void 0 && (n = Error), !e)
|
|
2907
2978
|
throw new n(t);
|
|
2908
2979
|
}
|
|
2909
|
-
function
|
|
2980
|
+
function V(e, t) {
|
|
2910
2981
|
return Object.keys(e).reduce(function(n, r) {
|
|
2911
2982
|
return n[r] = f({ timeZone: t }, e[r]), n;
|
|
2912
2983
|
}, {});
|
|
@@ -2921,10 +2992,10 @@ function pe(e, t) {
|
|
|
2921
2992
|
if (!t)
|
|
2922
2993
|
return e;
|
|
2923
2994
|
var n = Oe.formats;
|
|
2924
|
-
return f(f(f({}, n), e), { date: ce(
|
|
2995
|
+
return f(f(f({}, n), e), { date: ce(V(n.date, t), V(e.date || {}, t)), time: ce(V(n.time, t), V(e.time || {}, t)) });
|
|
2925
2996
|
}
|
|
2926
2997
|
var ge = function(e, t, n, r, a) {
|
|
2927
|
-
var i = e.locale, o = e.formats, s = e.messages,
|
|
2998
|
+
var i = e.locale, o = e.formats, s = e.messages, h = e.defaultLocale, l = e.defaultFormats, u = e.fallbackOnEmptyString, c = e.onError, m = e.timeZone, p = e.defaultRichTextElements;
|
|
2928
2999
|
n === void 0 && (n = { id: "" });
|
|
2929
3000
|
var d = n.id, E = n.defaultMessage;
|
|
2930
3001
|
Ft(!!d, "[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");
|
|
@@ -2939,29 +3010,29 @@ var ge = function(e, t, n, r, a) {
|
|
|
2939
3010
|
if (!r && y && typeof y == "string" && !p)
|
|
2940
3011
|
return y.replace(/'\{(.*?)\}'/gi, "{$1}");
|
|
2941
3012
|
if (r = f(f({}, p), r || {}), o = pe(o, m), l = pe(l, m), !y) {
|
|
2942
|
-
if (
|
|
3013
|
+
if (u === !1 && y === "")
|
|
2943
3014
|
return y;
|
|
2944
|
-
if ((!E || i && i.toLowerCase() !==
|
|
3015
|
+
if ((!E || i && i.toLowerCase() !== h.toLowerCase()) && c(new Ot(n, i)), E)
|
|
2945
3016
|
try {
|
|
2946
|
-
var
|
|
2947
|
-
return
|
|
3017
|
+
var H = t.getMessageFormat(E, h, l, a);
|
|
3018
|
+
return H.format(r);
|
|
2948
3019
|
} catch (T) {
|
|
2949
|
-
return c(new
|
|
3020
|
+
return c(new Z('Error formatting default message for: "'.concat(x, '", rendering default message verbatim'), i, n, T)), typeof E == "string" ? E : x;
|
|
2950
3021
|
}
|
|
2951
3022
|
return x;
|
|
2952
3023
|
}
|
|
2953
3024
|
try {
|
|
2954
|
-
var
|
|
2955
|
-
return
|
|
3025
|
+
var H = t.getMessageFormat(y, i, o, f({ formatters: t }, a || {}));
|
|
3026
|
+
return H.format(r);
|
|
2956
3027
|
} catch (T) {
|
|
2957
|
-
c(new
|
|
3028
|
+
c(new Z('Error formatting message: "'.concat(x, '", using ').concat(E ? "default message" : "id", " as fallback."), i, n, T));
|
|
2958
3029
|
}
|
|
2959
3030
|
if (E)
|
|
2960
3031
|
try {
|
|
2961
|
-
var
|
|
2962
|
-
return
|
|
3032
|
+
var H = t.getMessageFormat(E, h, l, a);
|
|
3033
|
+
return H.format(r);
|
|
2963
3034
|
} catch (T) {
|
|
2964
|
-
c(new
|
|
3035
|
+
c(new Z('Error formatting the default message for: "'.concat(x, '", rendering message verbatim'), i, n, T));
|
|
2965
3036
|
}
|
|
2966
3037
|
return typeof y == "string" ? y : typeof E == "string" ? E : x;
|
|
2967
3038
|
}, Ce = [
|
|
@@ -2988,8 +3059,8 @@ var ge = function(e, t, n, r, a) {
|
|
|
2988
3059
|
function j(e, t, n, r) {
|
|
2989
3060
|
var a = e.locale, i = e.formats, o = e.onError, s = e.timeZone;
|
|
2990
3061
|
r === void 0 && (r = {});
|
|
2991
|
-
var
|
|
2992
|
-
return t === "time" && !
|
|
3062
|
+
var h = r.format, l = f(f({}, s && { timeZone: s }), h && re(i, t, h, o)), u = C(r, Ce, l);
|
|
3063
|
+
return t === "time" && !u.hour && !u.minute && !u.second && !u.timeStyle && !u.dateStyle && (u = f(f({}, u), { hour: "numeric", minute: "numeric" })), n(a, u);
|
|
2993
3064
|
}
|
|
2994
3065
|
function Gt(e, t) {
|
|
2995
3066
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
@@ -2997,8 +3068,8 @@ function Gt(e, t) {
|
|
|
2997
3068
|
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
2998
3069
|
try {
|
|
2999
3070
|
return j(e, "date", t, o).format(s);
|
|
3000
|
-
} catch (
|
|
3001
|
-
e.onError(new
|
|
3071
|
+
} catch (h) {
|
|
3072
|
+
e.onError(new I("Error formatting date.", e.locale, h));
|
|
3002
3073
|
}
|
|
3003
3074
|
return String(s);
|
|
3004
3075
|
}
|
|
@@ -3008,30 +3079,30 @@ function Ut(e, t) {
|
|
|
3008
3079
|
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3009
3080
|
try {
|
|
3010
3081
|
return j(e, "time", t, o).format(s);
|
|
3011
|
-
} catch (
|
|
3012
|
-
e.onError(new
|
|
3082
|
+
} catch (h) {
|
|
3083
|
+
e.onError(new I("Error formatting time.", e.locale, h));
|
|
3013
3084
|
}
|
|
3014
3085
|
return String(s);
|
|
3015
3086
|
}
|
|
3016
|
-
function
|
|
3087
|
+
function Vt(e, t) {
|
|
3017
3088
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3018
3089
|
n[r - 2] = arguments[r];
|
|
3019
|
-
var a = n[0], i = n[1], o = n[2], s = o === void 0 ? {} : o,
|
|
3090
|
+
var a = n[0], i = n[1], o = n[2], s = o === void 0 ? {} : o, h = e.timeZone, l = e.locale, u = e.onError, c = C(s, Ce, h ? { timeZone: h } : {});
|
|
3020
3091
|
try {
|
|
3021
3092
|
return t(l, c).formatRange(a, i);
|
|
3022
3093
|
} catch (m) {
|
|
3023
|
-
|
|
3094
|
+
u(new I("Error formatting date time range.", e.locale, m));
|
|
3024
3095
|
}
|
|
3025
3096
|
return String(a);
|
|
3026
3097
|
}
|
|
3027
|
-
function
|
|
3098
|
+
function kt(e, t) {
|
|
3028
3099
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3029
3100
|
n[r - 2] = arguments[r];
|
|
3030
3101
|
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3031
3102
|
try {
|
|
3032
3103
|
return j(e, "date", t, o).formatToParts(s);
|
|
3033
|
-
} catch (
|
|
3034
|
-
e.onError(new
|
|
3104
|
+
} catch (h) {
|
|
3105
|
+
e.onError(new I("Error formatting date.", e.locale, h));
|
|
3035
3106
|
}
|
|
3036
3107
|
return [];
|
|
3037
3108
|
}
|
|
@@ -3041,8 +3112,8 @@ function jt(e, t) {
|
|
|
3041
3112
|
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3042
3113
|
try {
|
|
3043
3114
|
return j(e, "time", t, o).formatToParts(s);
|
|
3044
|
-
} catch (
|
|
3045
|
-
e.onError(new
|
|
3115
|
+
} catch (h) {
|
|
3116
|
+
e.onError(new I("Error formatting time.", e.locale, h));
|
|
3046
3117
|
}
|
|
3047
3118
|
return [];
|
|
3048
3119
|
}
|
|
@@ -3052,7 +3123,7 @@ var Xt = [
|
|
|
3052
3123
|
"fallback",
|
|
3053
3124
|
"languageDisplay"
|
|
3054
3125
|
];
|
|
3055
|
-
function
|
|
3126
|
+
function Wt(e, t, n, r) {
|
|
3056
3127
|
var a = e.locale, i = e.onError, o = Intl.DisplayNames;
|
|
3057
3128
|
o || i(new R(`Intl.DisplayNames is not available in this environment.
|
|
3058
3129
|
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
@@ -3060,18 +3131,18 @@ Try polyfilling it using "@formatjs/intl-displaynames"
|
|
|
3060
3131
|
var s = C(r, Xt);
|
|
3061
3132
|
try {
|
|
3062
3133
|
return t(a, s).of(n);
|
|
3063
|
-
} catch (
|
|
3064
|
-
i(new
|
|
3134
|
+
} catch (h) {
|
|
3135
|
+
i(new I("Error formatting display name.", a, h));
|
|
3065
3136
|
}
|
|
3066
3137
|
}
|
|
3067
|
-
var
|
|
3138
|
+
var Zt = [
|
|
3068
3139
|
"type",
|
|
3069
3140
|
"style"
|
|
3070
3141
|
], ve = Date.now();
|
|
3071
3142
|
function zt(e) {
|
|
3072
3143
|
return "".concat(ve, "_").concat(e, "_").concat(ve);
|
|
3073
3144
|
}
|
|
3074
|
-
function
|
|
3145
|
+
function Jt(e, t, n, r) {
|
|
3075
3146
|
r === void 0 && (r = {});
|
|
3076
3147
|
var a = De(e, t, n, r).reduce(function(i, o) {
|
|
3077
3148
|
var s = o.value;
|
|
@@ -3086,34 +3157,34 @@ function De(e, t, n, r) {
|
|
|
3086
3157
|
o || i(new R(`Intl.ListFormat is not available in this environment.
|
|
3087
3158
|
Try polyfilling it using "@formatjs/intl-listformat"
|
|
3088
3159
|
`, _.MISSING_INTL_API));
|
|
3089
|
-
var s = C(r,
|
|
3160
|
+
var s = C(r, Zt);
|
|
3090
3161
|
try {
|
|
3091
|
-
var
|
|
3092
|
-
if (typeof
|
|
3162
|
+
var h = {}, l = n.map(function(u, c) {
|
|
3163
|
+
if (typeof u == "object") {
|
|
3093
3164
|
var m = zt(c);
|
|
3094
|
-
return
|
|
3165
|
+
return h[m] = u, m;
|
|
3095
3166
|
}
|
|
3096
|
-
return String(
|
|
3167
|
+
return String(u);
|
|
3097
3168
|
});
|
|
3098
|
-
return t(a, s).formatToParts(l).map(function(
|
|
3099
|
-
return
|
|
3169
|
+
return t(a, s).formatToParts(l).map(function(u) {
|
|
3170
|
+
return u.type === "literal" ? u : f(f({}, u), { value: h[u.value] || u.value });
|
|
3100
3171
|
});
|
|
3101
|
-
} catch (
|
|
3102
|
-
i(new
|
|
3172
|
+
} catch (u) {
|
|
3173
|
+
i(new I("Error formatting list.", a, u));
|
|
3103
3174
|
}
|
|
3104
3175
|
return n;
|
|
3105
3176
|
}
|
|
3106
|
-
var
|
|
3177
|
+
var qt = ["type"];
|
|
3107
3178
|
function Qt(e, t, n, r) {
|
|
3108
3179
|
var a = e.locale, i = e.onError;
|
|
3109
3180
|
r === void 0 && (r = {}), Intl.PluralRules || i(new R(`Intl.PluralRules is not available in this environment.
|
|
3110
3181
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3111
3182
|
`, _.MISSING_INTL_API));
|
|
3112
|
-
var o = C(r,
|
|
3183
|
+
var o = C(r, qt);
|
|
3113
3184
|
try {
|
|
3114
3185
|
return t(a, o).select(n);
|
|
3115
3186
|
} catch (s) {
|
|
3116
|
-
i(new
|
|
3187
|
+
i(new I("Error formatting plural.", a, s));
|
|
3117
3188
|
}
|
|
3118
3189
|
return "other";
|
|
3119
3190
|
}
|
|
@@ -3121,8 +3192,8 @@ var Yt = ["numeric", "style"];
|
|
|
3121
3192
|
function $t(e, t, n) {
|
|
3122
3193
|
var r = e.locale, a = e.formats, i = e.onError;
|
|
3123
3194
|
n === void 0 && (n = {});
|
|
3124
|
-
var o = n.format, s = !!o && re(a, "relative", o, i) || {},
|
|
3125
|
-
return t(r,
|
|
3195
|
+
var o = n.format, s = !!o && re(a, "relative", o, i) || {}, h = C(n, Yt, s);
|
|
3196
|
+
return t(r, h);
|
|
3126
3197
|
}
|
|
3127
3198
|
function Kt(e, t, n, r, a) {
|
|
3128
3199
|
a === void 0 && (a = {}), r || (r = "second");
|
|
@@ -3133,7 +3204,7 @@ Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
|
3133
3204
|
try {
|
|
3134
3205
|
return $t(e, t, a).format(n, r);
|
|
3135
3206
|
} catch (o) {
|
|
3136
|
-
e.onError(new
|
|
3207
|
+
e.onError(new I("Error formatting relative time.", e.locale, o));
|
|
3137
3208
|
}
|
|
3138
3209
|
return String(n);
|
|
3139
3210
|
}
|
|
@@ -3162,15 +3233,15 @@ var er = [
|
|
|
3162
3233
|
function we(e, t, n) {
|
|
3163
3234
|
var r = e.locale, a = e.formats, i = e.onError;
|
|
3164
3235
|
n === void 0 && (n = {});
|
|
3165
|
-
var o = n.format, s = o && re(a, "number", o, i) || {},
|
|
3166
|
-
return t(r,
|
|
3236
|
+
var o = n.format, s = o && re(a, "number", o, i) || {}, h = C(n, er, s);
|
|
3237
|
+
return t(r, h);
|
|
3167
3238
|
}
|
|
3168
3239
|
function tr(e, t, n, r) {
|
|
3169
3240
|
r === void 0 && (r = {});
|
|
3170
3241
|
try {
|
|
3171
3242
|
return we(e, t, r).format(n);
|
|
3172
3243
|
} catch (a) {
|
|
3173
|
-
e.onError(new
|
|
3244
|
+
e.onError(new I("Error formatting number.", e.locale, a));
|
|
3174
3245
|
}
|
|
3175
3246
|
return String(n);
|
|
3176
3247
|
}
|
|
@@ -3179,7 +3250,7 @@ function rr(e, t, n, r) {
|
|
|
3179
3250
|
try {
|
|
3180
3251
|
return we(e, t, r).formatToParts(n);
|
|
3181
3252
|
} catch (a) {
|
|
3182
|
-
e.onError(new
|
|
3253
|
+
e.onError(new I("Error formatting number.", e.locale, a));
|
|
3183
3254
|
}
|
|
3184
3255
|
return [];
|
|
3185
3256
|
}
|
|
@@ -3200,18 +3271,18 @@ function ir(e, t) {
|
|
|
3200
3271
|
formatNumberToParts: rr.bind(null, r, n.getNumberFormat),
|
|
3201
3272
|
formatRelativeTime: Kt.bind(null, r, n.getRelativeTimeFormat),
|
|
3202
3273
|
formatDate: Gt.bind(null, r, n.getDateTimeFormat),
|
|
3203
|
-
formatDateToParts:
|
|
3274
|
+
formatDateToParts: kt.bind(null, r, n.getDateTimeFormat),
|
|
3204
3275
|
formatTime: Ut.bind(null, r, n.getDateTimeFormat),
|
|
3205
|
-
formatDateTimeRange:
|
|
3276
|
+
formatDateTimeRange: Vt.bind(null, r, n.getDateTimeFormat),
|
|
3206
3277
|
formatTimeToParts: jt.bind(null, r, n.getDateTimeFormat),
|
|
3207
3278
|
formatPlural: Qt.bind(null, r, n.getPluralRules),
|
|
3208
3279
|
// @ts-expect-error TODO: will get to this later
|
|
3209
3280
|
formatMessage: ge.bind(null, r, n),
|
|
3210
3281
|
// @ts-expect-error TODO: will get to this later
|
|
3211
3282
|
$t: ge.bind(null, r, n),
|
|
3212
|
-
formatList:
|
|
3283
|
+
formatList: Jt.bind(null, r, n.getListFormat),
|
|
3213
3284
|
formatListToParts: De.bind(null, r, n.getListFormat),
|
|
3214
|
-
formatDisplayName:
|
|
3285
|
+
formatDisplayName: Wt.bind(null, r, n.getDisplayNames)
|
|
3215
3286
|
});
|
|
3216
3287
|
}
|
|
3217
3288
|
function or(e) {
|
|
@@ -3220,12 +3291,12 @@ function or(e) {
|
|
|
3220
3291
|
function sr(e) {
|
|
3221
3292
|
return e;
|
|
3222
3293
|
}
|
|
3223
|
-
function
|
|
3294
|
+
function hr(e, t) {
|
|
3224
3295
|
t = t || {};
|
|
3225
3296
|
const n = t.delimiter || ".", r = t.maxDepth, a = t.transformKey || sr, i = {};
|
|
3226
|
-
function o(s,
|
|
3227
|
-
l = l || 1, Object.keys(s).forEach(function(
|
|
3228
|
-
const c = s[
|
|
3297
|
+
function o(s, h, l) {
|
|
3298
|
+
l = l || 1, Object.keys(s).forEach(function(u) {
|
|
3299
|
+
const c = s[u], m = t.safe && Array.isArray(c), p = Object.prototype.toString.call(c), d = or(c), E = p === "[object Object]" || p === "[object Array]", x = h ? h + n + a(u) : a(u);
|
|
3229
3300
|
if (!m && !d && E && Object.keys(c).length && (!t.maxDepth || l < r))
|
|
3230
3301
|
return o(c, x, l + 1);
|
|
3231
3302
|
i[x] = c;
|
|
@@ -3233,19 +3304,19 @@ function ur(e, t) {
|
|
|
3233
3304
|
}
|
|
3234
3305
|
return o(e), i;
|
|
3235
3306
|
}
|
|
3236
|
-
const
|
|
3307
|
+
const ur = Me();
|
|
3237
3308
|
let Fe;
|
|
3238
3309
|
const mr = (e, t, n = !1) => {
|
|
3239
3310
|
const r = ir(
|
|
3240
3311
|
{
|
|
3241
3312
|
...typeof n == "boolean" ? null : n,
|
|
3242
3313
|
locale: e,
|
|
3243
|
-
messages:
|
|
3314
|
+
messages: hr(t, {
|
|
3244
3315
|
safe: !0
|
|
3245
3316
|
// Preserve arrays
|
|
3246
3317
|
})
|
|
3247
3318
|
},
|
|
3248
|
-
|
|
3319
|
+
ur
|
|
3249
3320
|
), { $t: a, ...i } = r, o = i, s = (p) => {
|
|
3250
3321
|
const d = "Invalid Date";
|
|
3251
3322
|
if (!p)
|
|
@@ -3306,11 +3377,11 @@ const lr = (e = null) => Ge({
|
|
|
3306
3377
|
return () => {
|
|
3307
3378
|
const a = Object.keys(n).filter((s) => s !== "_"), i = (e || t.i18n).messages[t.keypath].toString();
|
|
3308
3379
|
let o = r(i);
|
|
3309
|
-
return o = o.filter((s) => s !== ""), o.forEach((s,
|
|
3380
|
+
return o = o.filter((s) => s !== ""), o.forEach((s, h) => {
|
|
3310
3381
|
if (!s.startsWith("{") && !s.endsWith("}"))
|
|
3311
3382
|
return;
|
|
3312
3383
|
const l = s.replace(/[\{\}]/g, "");
|
|
3313
|
-
l === "0" && n.default ? o[
|
|
3384
|
+
l === "0" && n.default ? o[h] = n.default() : a.includes(l) && n[l] && (o[h] = n[l]());
|
|
3314
3385
|
}), Ue(t.tag, t, o);
|
|
3315
3386
|
};
|
|
3316
3387
|
}
|