@kong-ui-public/i18n 0.8.6-pr.852.f575e5cc.0 → 0.8.6
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 +666 -714
- package/dist/i18n.umd.js +10 -10
- package/package.json +2 -2
package/dist/i18n.es.js
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
return
|
|
1
|
+
import { defineComponent as Ge, h as Ue } from "vue";
|
|
2
|
+
var z = function(e, t) {
|
|
3
|
+
return z = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
4
4
|
n.__proto__ = r;
|
|
5
5
|
} || function(n, r) {
|
|
6
|
-
for (var
|
|
7
|
-
Object.prototype.hasOwnProperty.call(r,
|
|
8
|
-
},
|
|
6
|
+
for (var a in r)
|
|
7
|
+
Object.prototype.hasOwnProperty.call(r, a) && (n[a] = r[a]);
|
|
8
|
+
}, z(e, t);
|
|
9
9
|
};
|
|
10
10
|
function A(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);
|
|
14
14
|
function n() {
|
|
15
15
|
this.constructor = e;
|
|
16
16
|
}
|
|
17
17
|
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
18
18
|
}
|
|
19
|
-
var
|
|
20
|
-
return
|
|
21
|
-
for (var n, r = 1,
|
|
19
|
+
var f = function() {
|
|
20
|
+
return f = Object.assign || function(t) {
|
|
21
|
+
for (var n, r = 1, a = arguments.length; r < a; r++) {
|
|
22
22
|
n = arguments[r];
|
|
23
|
-
for (var
|
|
24
|
-
Object.prototype.hasOwnProperty.call(n,
|
|
23
|
+
for (var i in n)
|
|
24
|
+
Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
25
25
|
}
|
|
26
26
|
return t;
|
|
27
|
-
},
|
|
27
|
+
}, f.apply(this, arguments);
|
|
28
28
|
};
|
|
29
|
-
function
|
|
29
|
+
function ke(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]);
|
|
33
33
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
34
|
-
for (var
|
|
35
|
-
t.indexOf(r[
|
|
34
|
+
for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
|
|
35
|
+
t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
|
|
36
36
|
return n;
|
|
37
37
|
}
|
|
38
38
|
function P(e, t, n) {
|
|
39
39
|
if (n || arguments.length === 2)
|
|
40
|
-
for (var r = 0,
|
|
41
|
-
(
|
|
42
|
-
return e.concat(
|
|
40
|
+
for (var r = 0, a = t.length, i; r < a; r++)
|
|
41
|
+
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
42
|
+
return e.concat(i || Array.prototype.slice.call(t));
|
|
43
43
|
}
|
|
44
44
|
var g;
|
|
45
45
|
(function(e) {
|
|
46
46
|
e[e.EXPECT_ARGUMENT_CLOSING_BRACE = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE", e[e.EMPTY_ARGUMENT = 2] = "EMPTY_ARGUMENT", e[e.MALFORMED_ARGUMENT = 3] = "MALFORMED_ARGUMENT", e[e.EXPECT_ARGUMENT_TYPE = 4] = "EXPECT_ARGUMENT_TYPE", e[e.INVALID_ARGUMENT_TYPE = 5] = "INVALID_ARGUMENT_TYPE", e[e.EXPECT_ARGUMENT_STYLE = 6] = "EXPECT_ARGUMENT_STYLE", e[e.INVALID_NUMBER_SKELETON = 7] = "INVALID_NUMBER_SKELETON", e[e.INVALID_DATE_TIME_SKELETON = 8] = "INVALID_DATE_TIME_SKELETON", e[e.EXPECT_NUMBER_SKELETON = 9] = "EXPECT_NUMBER_SKELETON", e[e.EXPECT_DATE_TIME_SKELETON = 10] = "EXPECT_DATE_TIME_SKELETON", e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE", e[e.EXPECT_SELECT_ARGUMENT_OPTIONS = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS", e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR", e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT", e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT", e[e.INVALID_PLURAL_ARGUMENT_SELECTOR = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR", e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR", e[e.MISSING_OTHER_CLAUSE = 22] = "MISSING_OTHER_CLAUSE", e[e.INVALID_TAG = 23] = "INVALID_TAG", e[e.INVALID_TAG_NAME = 25] = "INVALID_TAG_NAME", e[e.UNMATCHED_CLOSING_TAG = 26] = "UNMATCHED_CLOSING_TAG", e[e.UNCLOSED_TAG = 27] = "UNCLOSED_TAG";
|
|
47
47
|
})(g || (g = {}));
|
|
48
|
-
var
|
|
48
|
+
var b;
|
|
49
49
|
(function(e) {
|
|
50
50
|
e[e.literal = 0] = "literal", e[e.argument = 1] = "argument", e[e.number = 2] = "number", e[e.date = 3] = "date", e[e.time = 4] = "time", e[e.select = 5] = "select", e[e.plural = 6] = "plural", e[e.pound = 7] = "pound", e[e.tag = 8] = "tag";
|
|
51
|
-
})(
|
|
51
|
+
})(b || (b = {}));
|
|
52
52
|
var D;
|
|
53
53
|
(function(e) {
|
|
54
54
|
e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
|
|
55
55
|
})(D || (D = {}));
|
|
56
56
|
function ae(e) {
|
|
57
|
-
return e.type ===
|
|
57
|
+
return e.type === b.literal;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
60
|
-
return e.type ===
|
|
59
|
+
function Ve(e) {
|
|
60
|
+
return e.type === b.argument;
|
|
61
61
|
}
|
|
62
62
|
function Ee(e) {
|
|
63
|
-
return e.type ===
|
|
63
|
+
return e.type === b.number;
|
|
64
|
+
}
|
|
65
|
+
function be(e) {
|
|
66
|
+
return e.type === b.date;
|
|
64
67
|
}
|
|
65
68
|
function de(e) {
|
|
66
|
-
return e.type ===
|
|
69
|
+
return e.type === b.time;
|
|
70
|
+
}
|
|
71
|
+
function xe(e) {
|
|
72
|
+
return e.type === b.select;
|
|
67
73
|
}
|
|
68
74
|
function ye(e) {
|
|
69
|
-
return e.type ===
|
|
75
|
+
return e.type === b.plural;
|
|
70
76
|
}
|
|
71
|
-
function
|
|
72
|
-
return e.type ===
|
|
77
|
+
function je(e) {
|
|
78
|
+
return e.type === b.pound;
|
|
73
79
|
}
|
|
74
80
|
function Te(e) {
|
|
75
|
-
return e.type ===
|
|
76
|
-
}
|
|
77
|
-
function ze(e) {
|
|
78
|
-
return e.type === d.pound;
|
|
81
|
+
return e.type === b.tag;
|
|
79
82
|
}
|
|
80
83
|
function Se(e) {
|
|
81
|
-
return e.type === d.tag;
|
|
82
|
-
}
|
|
83
|
-
function Ie(e) {
|
|
84
84
|
return !!(e && typeof e == "object" && e.type === D.number);
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function q(e) {
|
|
87
87
|
return !!(e && typeof e == "object" && e.type === D.dateTime);
|
|
88
88
|
}
|
|
89
|
-
var
|
|
90
|
-
function
|
|
89
|
+
var Ie = /[ \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 Ze(e) {
|
|
91
91
|
var t = {};
|
|
92
|
-
return e.replace(
|
|
92
|
+
return e.replace(Xe, function(n) {
|
|
93
93
|
var r = n.length;
|
|
94
94
|
switch (n[0]) {
|
|
95
95
|
case "G":
|
|
@@ -178,36 +178,36 @@ function Je(e) {
|
|
|
178
178
|
return "";
|
|
179
179
|
}), t;
|
|
180
180
|
}
|
|
181
|
-
var
|
|
182
|
-
function
|
|
181
|
+
var We = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
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(
|
|
186
|
-
return
|
|
187
|
-
}), n = [], r = 0,
|
|
188
|
-
var
|
|
185
|
+
for (var t = e.split(We).filter(function(m) {
|
|
186
|
+
return m.length > 0;
|
|
187
|
+
}), n = [], r = 0, a = t; r < a.length; r++) {
|
|
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
|
|
193
|
-
if (
|
|
191
|
+
for (var s = o[0], u = o.slice(1), l = 0, h = u; l < h.length; l++) {
|
|
192
|
+
var c = h[l];
|
|
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: u });
|
|
197
197
|
}
|
|
198
198
|
return n;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function qe(e) {
|
|
201
201
|
return e.replace(/^(.*?)-/, "");
|
|
202
202
|
}
|
|
203
|
-
var
|
|
204
|
-
function
|
|
203
|
+
var ie = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, He = /^(@+)?(\+|#+)?[rs]?$/g, Je = /(\*)(0+)|(#+)(0+)|(0+)/g, Ae = /^(0+)$/;
|
|
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(
|
|
207
|
-
return typeof
|
|
206
|
+
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(He, function(n, r, a) {
|
|
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 Ne(e) {
|
|
211
211
|
switch (e) {
|
|
212
212
|
case "sign-auto":
|
|
213
213
|
return {
|
|
@@ -247,7 +247,7 @@ function Be(e) {
|
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Qe(e) {
|
|
251
251
|
var t;
|
|
252
252
|
if (e[0] === "E" && e[1] === "E" ? (t = {
|
|
253
253
|
notation: "engineering"
|
|
@@ -255,20 +255,20 @@ function et(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)), !Ae.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
|
-
function
|
|
265
|
-
var t = {}, n =
|
|
264
|
+
function se(e) {
|
|
265
|
+
var t = {}, n = Ne(e);
|
|
266
266
|
return n || t;
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function Ye(e) {
|
|
269
269
|
for (var t = {}, n = 0, r = e; n < r.length; n++) {
|
|
270
|
-
var
|
|
271
|
-
switch (
|
|
270
|
+
var a = r[n];
|
|
271
|
+
switch (a.stem) {
|
|
272
272
|
case "percent":
|
|
273
273
|
case "%":
|
|
274
274
|
t.style = "percent";
|
|
@@ -277,7 +277,7 @@ function tt(e) {
|
|
|
277
277
|
t.style = "percent", t.scale = 100;
|
|
278
278
|
continue;
|
|
279
279
|
case "currency":
|
|
280
|
-
t.style = "currency", t.currency =
|
|
280
|
+
t.style = "currency", t.currency = a.options[0];
|
|
281
281
|
continue;
|
|
282
282
|
case "group-off":
|
|
283
283
|
case ",_":
|
|
@@ -289,7 +289,7 @@ function tt(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 = qe(a.options[0]);
|
|
293
293
|
continue;
|
|
294
294
|
case "compact-short":
|
|
295
295
|
case "K":
|
|
@@ -300,13 +300,13 @@ function tt(e) {
|
|
|
300
300
|
t.notation = "compact", t.compactDisplay = "long";
|
|
301
301
|
continue;
|
|
302
302
|
case "scientific":
|
|
303
|
-
t =
|
|
304
|
-
return
|
|
303
|
+
t = f(f(f({}, t), { notation: "scientific" }), a.options.reduce(function(u, l) {
|
|
304
|
+
return f(f({}, u), se(l));
|
|
305
305
|
}, {}));
|
|
306
306
|
continue;
|
|
307
307
|
case "engineering":
|
|
308
|
-
t =
|
|
309
|
-
return
|
|
308
|
+
t = f(f(f({}, t), { notation: "engineering" }), a.options.reduce(function(u, l) {
|
|
309
|
+
return f(f({}, u), se(l));
|
|
310
310
|
}, {}));
|
|
311
311
|
continue;
|
|
312
312
|
case "notation-simple":
|
|
@@ -325,16 +325,16 @@ function tt(e) {
|
|
|
325
325
|
t.currencyDisplay = "symbol";
|
|
326
326
|
continue;
|
|
327
327
|
case "scale":
|
|
328
|
-
t.scale = parseFloat(
|
|
328
|
+
t.scale = parseFloat(a.options[0]);
|
|
329
329
|
continue;
|
|
330
330
|
case "integer-width":
|
|
331
|
-
if (
|
|
331
|
+
if (a.options.length > 1)
|
|
332
332
|
throw new RangeError("integer-width stems only accept a single optional option");
|
|
333
|
-
|
|
333
|
+
a.options[0].replace(Je, function(u, l, h, c, m, p) {
|
|
334
334
|
if (l)
|
|
335
|
-
t.minimumIntegerDigits =
|
|
335
|
+
t.minimumIntegerDigits = h.length;
|
|
336
336
|
else {
|
|
337
|
-
if (
|
|
337
|
+
if (c && m)
|
|
338
338
|
throw new Error("We currently do not support maximum integer digits");
|
|
339
339
|
if (p)
|
|
340
340
|
throw new Error("We currently do not support exact integer digits");
|
|
@@ -343,32 +343,32 @@ function tt(e) {
|
|
|
343
343
|
});
|
|
344
344
|
continue;
|
|
345
345
|
}
|
|
346
|
-
if (
|
|
347
|
-
t.minimumIntegerDigits =
|
|
346
|
+
if (Ae.test(a.stem)) {
|
|
347
|
+
t.minimumIntegerDigits = a.stem.length;
|
|
348
348
|
continue;
|
|
349
349
|
}
|
|
350
|
-
if (
|
|
351
|
-
if (
|
|
350
|
+
if (ie.test(a.stem)) {
|
|
351
|
+
if (a.options.length > 1)
|
|
352
352
|
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
353
|
-
|
|
354
|
-
return
|
|
353
|
+
a.stem.replace(ie, function(u, l, h, c, m, p) {
|
|
354
|
+
return h === "*" ? 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
|
-
var
|
|
357
|
-
|
|
356
|
+
var i = a.options[0];
|
|
357
|
+
i === "w" ? t = f(f({}, t), { trailingZeroDisplay: "stripIfInteger" }) : i && (t = f(f({}, t), oe(i)));
|
|
358
358
|
continue;
|
|
359
359
|
}
|
|
360
|
-
if (
|
|
361
|
-
t =
|
|
360
|
+
if (He.test(a.stem)) {
|
|
361
|
+
t = f(f({}, t), oe(a.stem));
|
|
362
362
|
continue;
|
|
363
363
|
}
|
|
364
|
-
var o =
|
|
365
|
-
o && (t =
|
|
366
|
-
var s =
|
|
367
|
-
s && (t =
|
|
364
|
+
var o = Ne(a.stem);
|
|
365
|
+
o && (t = f(f({}, t), o));
|
|
366
|
+
var s = Qe(a.stem);
|
|
367
|
+
s && (t = f(f({}, t), s));
|
|
368
368
|
}
|
|
369
369
|
return t;
|
|
370
370
|
}
|
|
371
|
-
var
|
|
371
|
+
var U = {
|
|
372
372
|
"001": [
|
|
373
373
|
"H",
|
|
374
374
|
"h"
|
|
@@ -1705,23 +1705,23 @@ var j = {
|
|
|
1705
1705
|
"h"
|
|
1706
1706
|
]
|
|
1707
1707
|
};
|
|
1708
|
-
function
|
|
1708
|
+
function $e(e, t) {
|
|
1709
1709
|
for (var n = "", r = 0; r < e.length; r++) {
|
|
1710
|
-
var
|
|
1711
|
-
if (
|
|
1712
|
-
for (var
|
|
1713
|
-
|
|
1714
|
-
var o = 1 + (
|
|
1710
|
+
var a = e.charAt(r);
|
|
1711
|
+
if (a === "j") {
|
|
1712
|
+
for (var i = 0; r + 1 < e.length && e.charAt(r + 1) === a; )
|
|
1713
|
+
i++, r++;
|
|
1714
|
+
var o = 1 + (i & 1), s = i < 2 ? 1 : 3 + (i >> 1), u = "a", l = Ke(t);
|
|
1715
1715
|
for ((l == "H" || l == "k") && (s = 0); s-- > 0; )
|
|
1716
|
-
n +=
|
|
1716
|
+
n += u;
|
|
1717
1717
|
for (; o-- > 0; )
|
|
1718
1718
|
n = l + n;
|
|
1719
1719
|
} else
|
|
1720
|
-
|
|
1720
|
+
a === "J" ? n += "H" : n += a;
|
|
1721
1721
|
}
|
|
1722
1722
|
return n;
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1724
|
+
function Ke(e) {
|
|
1725
1725
|
var t = e.hourCycle;
|
|
1726
1726
|
if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet
|
|
1727
1727
|
e.hourCycles && // @ts-ignore
|
|
@@ -1740,23 +1740,23 @@ function nt(e) {
|
|
|
1740
1740
|
}
|
|
1741
1741
|
var n = e.language, r;
|
|
1742
1742
|
n !== "root" && (r = e.maximize().region);
|
|
1743
|
-
var
|
|
1744
|
-
return
|
|
1743
|
+
var a = U[r || ""] || U[n || ""] || U["".concat(n, "-001")] || U["001"];
|
|
1744
|
+
return a[0];
|
|
1745
1745
|
}
|
|
1746
|
-
var
|
|
1747
|
-
function
|
|
1746
|
+
var X, et = new RegExp("^".concat(Ie.source, "*")), tt = new RegExp("".concat(Ie.source, "*$"));
|
|
1747
|
+
function v(e, t) {
|
|
1748
1748
|
return { start: e, end: t };
|
|
1749
1749
|
}
|
|
1750
|
-
var
|
|
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, ut = !!Number.isSafeInteger, ht = ut ? Number.isSafeInteger : function(e) {
|
|
1751
1751
|
return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
|
|
1752
|
-
},
|
|
1752
|
+
}, J = !0;
|
|
1753
1753
|
try {
|
|
1754
|
-
var
|
|
1755
|
-
|
|
1754
|
+
var lt = _e("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1755
|
+
J = ((X = lt.exec("a")) === null || X === void 0 ? void 0 : X[0]) === "a";
|
|
1756
1756
|
} catch {
|
|
1757
|
-
|
|
1757
|
+
J = !1;
|
|
1758
1758
|
}
|
|
1759
|
-
var
|
|
1759
|
+
var ue = rt ? (
|
|
1760
1760
|
// Native
|
|
1761
1761
|
function(t, n, r) {
|
|
1762
1762
|
return t.startsWith(n, r);
|
|
@@ -1766,31 +1766,31 @@ var he = ot ? (
|
|
|
1766
1766
|
function(t, n, r) {
|
|
1767
1767
|
return t.slice(r, r + n.length) === n;
|
|
1768
1768
|
}
|
|
1769
|
-
),
|
|
1769
|
+
), Q = nt ? String.fromCodePoint : (
|
|
1770
1770
|
// IE11
|
|
1771
1771
|
function() {
|
|
1772
1772
|
for (var t = [], n = 0; n < arguments.length; n++)
|
|
1773
1773
|
t[n] = arguments[n];
|
|
1774
|
-
for (var r = "",
|
|
1775
|
-
if (o = t[
|
|
1774
|
+
for (var r = "", a = t.length, i = 0, o; a > i; ) {
|
|
1775
|
+
if (o = t[i++], o > 1114111)
|
|
1776
1776
|
throw RangeError(o + " is not a valid code point");
|
|
1777
1777
|
r += o < 65536 ? String.fromCharCode(o) : String.fromCharCode(((o -= 65536) >> 10) + 55296, o % 1024 + 56320);
|
|
1778
1778
|
}
|
|
1779
1779
|
return r;
|
|
1780
1780
|
}
|
|
1781
|
-
),
|
|
1781
|
+
), he = (
|
|
1782
1782
|
// native
|
|
1783
|
-
|
|
1783
|
+
at ? Object.fromEntries : (
|
|
1784
1784
|
// Ponyfill
|
|
1785
1785
|
function(t) {
|
|
1786
|
-
for (var n = {}, r = 0,
|
|
1787
|
-
var
|
|
1786
|
+
for (var n = {}, r = 0, a = t; r < a.length; r++) {
|
|
1787
|
+
var i = a[r], o = i[0], s = i[1];
|
|
1788
1788
|
n[o] = s;
|
|
1789
1789
|
}
|
|
1790
1790
|
return n;
|
|
1791
1791
|
}
|
|
1792
1792
|
)
|
|
1793
|
-
),
|
|
1793
|
+
), Be = it ? (
|
|
1794
1794
|
// Native
|
|
1795
1795
|
function(t, n) {
|
|
1796
1796
|
return t.codePointAt(n);
|
|
@@ -1800,11 +1800,11 @@ var he = ot ? (
|
|
|
1800
1800
|
function(t, n) {
|
|
1801
1801
|
var r = t.length;
|
|
1802
1802
|
if (!(n < 0 || n >= r)) {
|
|
1803
|
-
var
|
|
1804
|
-
return
|
|
1803
|
+
var a = t.charCodeAt(n), i;
|
|
1804
|
+
return a < 55296 || a > 56319 || n + 1 === r || (i = t.charCodeAt(n + 1)) < 56320 || i > 57343 ? a : (a - 55296 << 10) + (i - 56320) + 65536;
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
|
-
),
|
|
1807
|
+
), ft = ot ? (
|
|
1808
1808
|
// Native
|
|
1809
1809
|
function(t) {
|
|
1810
1810
|
return t.trimStart();
|
|
@@ -1812,9 +1812,9 @@ var he = ot ? (
|
|
|
1812
1812
|
) : (
|
|
1813
1813
|
// Ponyfill
|
|
1814
1814
|
function(t) {
|
|
1815
|
-
return t.replace(
|
|
1815
|
+
return t.replace(et, "");
|
|
1816
1816
|
}
|
|
1817
|
-
),
|
|
1817
|
+
), mt = st ? (
|
|
1818
1818
|
// Native
|
|
1819
1819
|
function(t) {
|
|
1820
1820
|
return t.trimEnd();
|
|
@@ -1822,32 +1822,32 @@ var he = ot ? (
|
|
|
1822
1822
|
) : (
|
|
1823
1823
|
// Ponyfill
|
|
1824
1824
|
function(t) {
|
|
1825
|
-
return t.replace(
|
|
1825
|
+
return t.replace(tt, "");
|
|
1826
1826
|
}
|
|
1827
1827
|
);
|
|
1828
|
-
function
|
|
1828
|
+
function _e(e, t) {
|
|
1829
1829
|
return new RegExp(e, t);
|
|
1830
1830
|
}
|
|
1831
|
-
var
|
|
1832
|
-
if (
|
|
1833
|
-
var
|
|
1834
|
-
|
|
1831
|
+
var Y;
|
|
1832
|
+
if (J) {
|
|
1833
|
+
var le = _e("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1834
|
+
Y = function(t, n) {
|
|
1835
1835
|
var r;
|
|
1836
|
-
|
|
1837
|
-
var
|
|
1838
|
-
return (r =
|
|
1836
|
+
le.lastIndex = n;
|
|
1837
|
+
var a = le.exec(t);
|
|
1838
|
+
return (r = a[1]) !== null && r !== void 0 ? r : "";
|
|
1839
1839
|
};
|
|
1840
1840
|
} else
|
|
1841
|
-
|
|
1841
|
+
Y = function(t, n) {
|
|
1842
1842
|
for (var r = []; ; ) {
|
|
1843
|
-
var
|
|
1844
|
-
if (
|
|
1843
|
+
var a = Be(t, n);
|
|
1844
|
+
if (a === void 0 || Pe(a) || vt(a))
|
|
1845
1845
|
break;
|
|
1846
|
-
r.push(
|
|
1846
|
+
r.push(a), n += a >= 65536 ? 2 : 1;
|
|
1847
1847
|
}
|
|
1848
|
-
return
|
|
1848
|
+
return Q.apply(void 0, r);
|
|
1849
1849
|
};
|
|
1850
|
-
var
|
|
1850
|
+
var ct = (
|
|
1851
1851
|
/** @class */
|
|
1852
1852
|
function() {
|
|
1853
1853
|
function e(t, n) {
|
|
@@ -1858,107 +1858,107 @@ var bt = (
|
|
|
1858
1858
|
throw Error("parser can only be used once");
|
|
1859
1859
|
return this.parseMessage(0, "", !1);
|
|
1860
1860
|
}, e.prototype.parseMessage = function(t, n, r) {
|
|
1861
|
-
for (var
|
|
1862
|
-
var
|
|
1863
|
-
if (
|
|
1861
|
+
for (var a = []; !this.isEOF(); ) {
|
|
1862
|
+
var i = this.char();
|
|
1863
|
+
if (i === 123) {
|
|
1864
1864
|
var o = this.parseArgument(t, r);
|
|
1865
1865
|
if (o.err)
|
|
1866
1866
|
return o;
|
|
1867
|
-
|
|
1867
|
+
a.push(o.val);
|
|
1868
1868
|
} else {
|
|
1869
|
-
if (
|
|
1869
|
+
if (i === 125 && t > 0)
|
|
1870
1870
|
break;
|
|
1871
|
-
if (
|
|
1871
|
+
if (i === 35 && (n === "plural" || n === "selectordinal")) {
|
|
1872
1872
|
var s = this.clonePosition();
|
|
1873
|
-
this.bump(),
|
|
1874
|
-
type:
|
|
1875
|
-
location:
|
|
1873
|
+
this.bump(), a.push({
|
|
1874
|
+
type: b.pound,
|
|
1875
|
+
location: v(s, this.clonePosition())
|
|
1876
1876
|
});
|
|
1877
|
-
} else if (
|
|
1877
|
+
} else if (i === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
1878
1878
|
if (r)
|
|
1879
1879
|
break;
|
|
1880
|
-
return this.error(g.UNMATCHED_CLOSING_TAG,
|
|
1881
|
-
} else if (
|
|
1880
|
+
return this.error(g.UNMATCHED_CLOSING_TAG, v(this.clonePosition(), this.clonePosition()));
|
|
1881
|
+
} else if (i === 60 && !this.ignoreTag && $(this.peek() || 0)) {
|
|
1882
1882
|
var o = this.parseTag(t, n);
|
|
1883
1883
|
if (o.err)
|
|
1884
1884
|
return o;
|
|
1885
|
-
|
|
1885
|
+
a.push(o.val);
|
|
1886
1886
|
} else {
|
|
1887
1887
|
var o = this.parseLiteral(t, n);
|
|
1888
1888
|
if (o.err)
|
|
1889
1889
|
return o;
|
|
1890
|
-
|
|
1890
|
+
a.push(o.val);
|
|
1891
1891
|
}
|
|
1892
1892
|
}
|
|
1893
1893
|
}
|
|
1894
|
-
return { val:
|
|
1894
|
+
return { val: a, err: null };
|
|
1895
1895
|
}, e.prototype.parseTag = function(t, n) {
|
|
1896
1896
|
var r = this.clonePosition();
|
|
1897
1897
|
this.bump();
|
|
1898
|
-
var
|
|
1898
|
+
var a = this.parseTagName();
|
|
1899
1899
|
if (this.bumpSpace(), this.bumpIf("/>"))
|
|
1900
1900
|
return {
|
|
1901
1901
|
val: {
|
|
1902
|
-
type:
|
|
1903
|
-
value: "<".concat(
|
|
1904
|
-
location:
|
|
1902
|
+
type: b.literal,
|
|
1903
|
+
value: "<".concat(a, "/>"),
|
|
1904
|
+
location: v(r, this.clonePosition())
|
|
1905
1905
|
},
|
|
1906
1906
|
err: null
|
|
1907
1907
|
};
|
|
1908
1908
|
if (this.bumpIf(">")) {
|
|
1909
|
-
var
|
|
1910
|
-
if (
|
|
1911
|
-
return
|
|
1912
|
-
var o =
|
|
1909
|
+
var i = this.parseMessage(t + 1, n, !0);
|
|
1910
|
+
if (i.err)
|
|
1911
|
+
return i;
|
|
1912
|
+
var o = i.val, s = this.clonePosition();
|
|
1913
1913
|
if (this.bumpIf("</")) {
|
|
1914
|
-
if (this.isEOF() ||
|
|
1915
|
-
return this.error(g.INVALID_TAG,
|
|
1916
|
-
var
|
|
1917
|
-
return
|
|
1914
|
+
if (this.isEOF() || !$(this.char()))
|
|
1915
|
+
return this.error(g.INVALID_TAG, v(s, this.clonePosition()));
|
|
1916
|
+
var u = this.clonePosition(), l = this.parseTagName();
|
|
1917
|
+
return a !== l ? this.error(g.UNMATCHED_CLOSING_TAG, v(u, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
|
|
1918
1918
|
val: {
|
|
1919
|
-
type:
|
|
1920
|
-
value:
|
|
1919
|
+
type: b.tag,
|
|
1920
|
+
value: a,
|
|
1921
1921
|
children: o,
|
|
1922
|
-
location:
|
|
1922
|
+
location: v(r, this.clonePosition())
|
|
1923
1923
|
},
|
|
1924
1924
|
err: null
|
|
1925
|
-
} : this.error(g.INVALID_TAG,
|
|
1925
|
+
} : this.error(g.INVALID_TAG, v(s, this.clonePosition())));
|
|
1926
1926
|
} else
|
|
1927
|
-
return this.error(g.UNCLOSED_TAG,
|
|
1927
|
+
return this.error(g.UNCLOSED_TAG, v(r, this.clonePosition()));
|
|
1928
1928
|
} else
|
|
1929
|
-
return this.error(g.INVALID_TAG,
|
|
1929
|
+
return this.error(g.INVALID_TAG, v(r, this.clonePosition()));
|
|
1930
1930
|
}, e.prototype.parseTagName = function() {
|
|
1931
1931
|
var t = this.offset();
|
|
1932
|
-
for (this.bump(); !this.isEOF() &&
|
|
1932
|
+
for (this.bump(); !this.isEOF() && gt(this.char()); )
|
|
1933
1933
|
this.bump();
|
|
1934
1934
|
return this.message.slice(t, this.offset());
|
|
1935
1935
|
}, e.prototype.parseLiteral = function(t, n) {
|
|
1936
|
-
for (var r = this.clonePosition(),
|
|
1937
|
-
var
|
|
1938
|
-
if (
|
|
1939
|
-
|
|
1936
|
+
for (var r = this.clonePosition(), a = ""; ; ) {
|
|
1937
|
+
var i = this.tryParseQuote(n);
|
|
1938
|
+
if (i) {
|
|
1939
|
+
a += i;
|
|
1940
1940
|
continue;
|
|
1941
1941
|
}
|
|
1942
1942
|
var o = this.tryParseUnquoted(t, n);
|
|
1943
1943
|
if (o) {
|
|
1944
|
-
|
|
1944
|
+
a += o;
|
|
1945
1945
|
continue;
|
|
1946
1946
|
}
|
|
1947
1947
|
var s = this.tryParseLeftAngleBracket();
|
|
1948
1948
|
if (s) {
|
|
1949
|
-
|
|
1949
|
+
a += s;
|
|
1950
1950
|
continue;
|
|
1951
1951
|
}
|
|
1952
1952
|
break;
|
|
1953
1953
|
}
|
|
1954
|
-
var
|
|
1954
|
+
var u = v(r, this.clonePosition());
|
|
1955
1955
|
return {
|
|
1956
|
-
val: { type:
|
|
1956
|
+
val: { type: b.literal, value: a, location: u },
|
|
1957
1957
|
err: null
|
|
1958
1958
|
};
|
|
1959
1959
|
}, e.prototype.tryParseLeftAngleBracket = function() {
|
|
1960
1960
|
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
|
|
1961
|
-
!
|
|
1961
|
+
!pt(this.peek() || 0)) ? (this.bump(), "<") : null;
|
|
1962
1962
|
}, e.prototype.tryParseQuote = function(t) {
|
|
1963
1963
|
if (this.isEOF() || this.char() !== 39)
|
|
1964
1964
|
return null;
|
|
@@ -1992,49 +1992,49 @@ var bt = (
|
|
|
1992
1992
|
n.push(r);
|
|
1993
1993
|
this.bump();
|
|
1994
1994
|
}
|
|
1995
|
-
return
|
|
1995
|
+
return Q.apply(void 0, n);
|
|
1996
1996
|
}, e.prototype.tryParseUnquoted = function(t, n) {
|
|
1997
1997
|
if (this.isEOF())
|
|
1998
1998
|
return null;
|
|
1999
1999
|
var r = this.char();
|
|
2000
|
-
return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(),
|
|
2000
|
+
return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(), Q(r));
|
|
2001
2001
|
}, e.prototype.parseArgument = function(t, n) {
|
|
2002
2002
|
var r = this.clonePosition();
|
|
2003
2003
|
if (this.bump(), this.bumpSpace(), this.isEOF())
|
|
2004
|
-
return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,
|
|
2004
|
+
return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, v(r, this.clonePosition()));
|
|
2005
2005
|
if (this.char() === 125)
|
|
2006
|
-
return this.bump(), this.error(g.EMPTY_ARGUMENT,
|
|
2007
|
-
var
|
|
2008
|
-
if (!
|
|
2009
|
-
return this.error(g.MALFORMED_ARGUMENT,
|
|
2006
|
+
return this.bump(), this.error(g.EMPTY_ARGUMENT, v(r, this.clonePosition()));
|
|
2007
|
+
var a = this.parseIdentifierIfPossible().value;
|
|
2008
|
+
if (!a)
|
|
2009
|
+
return this.error(g.MALFORMED_ARGUMENT, v(r, this.clonePosition()));
|
|
2010
2010
|
if (this.bumpSpace(), this.isEOF())
|
|
2011
|
-
return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,
|
|
2011
|
+
return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, v(r, this.clonePosition()));
|
|
2012
2012
|
switch (this.char()) {
|
|
2013
2013
|
case 125:
|
|
2014
2014
|
return this.bump(), {
|
|
2015
2015
|
val: {
|
|
2016
|
-
type:
|
|
2016
|
+
type: b.argument,
|
|
2017
2017
|
// value does not include the opening and closing braces.
|
|
2018
|
-
value:
|
|
2019
|
-
location:
|
|
2018
|
+
value: a,
|
|
2019
|
+
location: v(r, this.clonePosition())
|
|
2020
2020
|
},
|
|
2021
2021
|
err: null
|
|
2022
2022
|
};
|
|
2023
2023
|
case 44:
|
|
2024
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,
|
|
2024
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, v(r, this.clonePosition())) : this.parseArgumentOptions(t, n, a, r);
|
|
2025
2025
|
default:
|
|
2026
|
-
return this.error(g.MALFORMED_ARGUMENT,
|
|
2026
|
+
return this.error(g.MALFORMED_ARGUMENT, v(r, this.clonePosition()));
|
|
2027
2027
|
}
|
|
2028
2028
|
}, e.prototype.parseIdentifierIfPossible = function() {
|
|
2029
|
-
var t = this.clonePosition(), n = this.offset(), r =
|
|
2030
|
-
this.bumpTo(
|
|
2031
|
-
var
|
|
2029
|
+
var t = this.clonePosition(), n = this.offset(), r = Y(this.message, n), a = n + r.length;
|
|
2030
|
+
this.bumpTo(a);
|
|
2031
|
+
var i = this.clonePosition(), o = v(t, i);
|
|
2032
2032
|
return { value: r, location: o };
|
|
2033
|
-
}, e.prototype.parseArgumentOptions = function(t, n, r,
|
|
2034
|
-
var
|
|
2033
|
+
}, e.prototype.parseArgumentOptions = function(t, n, r, a) {
|
|
2034
|
+
var i, o = this.clonePosition(), s = this.parseIdentifierIfPossible().value, u = this.clonePosition();
|
|
2035
2035
|
switch (s) {
|
|
2036
2036
|
case "":
|
|
2037
|
-
return this.error(g.EXPECT_ARGUMENT_TYPE,
|
|
2037
|
+
return this.error(g.EXPECT_ARGUMENT_TYPE, v(o, u));
|
|
2038
2038
|
case "number":
|
|
2039
2039
|
case "date":
|
|
2040
2040
|
case "time": {
|
|
@@ -2042,50 +2042,50 @@ var bt = (
|
|
|
2042
2042
|
var l = null;
|
|
2043
2043
|
if (this.bumpIf(",")) {
|
|
2044
2044
|
this.bumpSpace();
|
|
2045
|
-
var
|
|
2046
|
-
if (
|
|
2047
|
-
return
|
|
2048
|
-
var
|
|
2049
|
-
if (
|
|
2050
|
-
return this.error(g.EXPECT_ARGUMENT_STYLE,
|
|
2051
|
-
var p =
|
|
2052
|
-
l = { style:
|
|
2045
|
+
var h = this.clonePosition(), c = this.parseSimpleArgStyleIfPossible();
|
|
2046
|
+
if (c.err)
|
|
2047
|
+
return c;
|
|
2048
|
+
var m = mt(c.val);
|
|
2049
|
+
if (m.length === 0)
|
|
2050
|
+
return this.error(g.EXPECT_ARGUMENT_STYLE, v(this.clonePosition(), this.clonePosition()));
|
|
2051
|
+
var p = v(h, this.clonePosition());
|
|
2052
|
+
l = { style: m, styleLocation: p };
|
|
2053
2053
|
}
|
|
2054
|
-
var
|
|
2055
|
-
if (
|
|
2056
|
-
return
|
|
2057
|
-
var E =
|
|
2058
|
-
if (l &&
|
|
2059
|
-
var
|
|
2054
|
+
var d = this.tryParseArgumentClose(a);
|
|
2055
|
+
if (d.err)
|
|
2056
|
+
return d;
|
|
2057
|
+
var E = v(a, this.clonePosition());
|
|
2058
|
+
if (l && ue(l == null ? void 0 : l.style, "::", 0)) {
|
|
2059
|
+
var x = ft(l.style.slice(2));
|
|
2060
2060
|
if (s === "number") {
|
|
2061
|
-
var
|
|
2062
|
-
return
|
|
2063
|
-
val: { type:
|
|
2061
|
+
var c = this.parseNumberSkeletonFromString(x, l.styleLocation);
|
|
2062
|
+
return c.err ? c : {
|
|
2063
|
+
val: { type: b.number, value: r, location: E, style: c.val },
|
|
2064
2064
|
err: null
|
|
2065
2065
|
};
|
|
2066
2066
|
} else {
|
|
2067
|
-
if (
|
|
2067
|
+
if (x.length === 0)
|
|
2068
2068
|
return this.error(g.EXPECT_DATE_TIME_SKELETON, E);
|
|
2069
|
-
var
|
|
2070
|
-
this.locale && (
|
|
2071
|
-
var
|
|
2069
|
+
var y = x;
|
|
2070
|
+
this.locale && (y = $e(x, this.locale));
|
|
2071
|
+
var m = {
|
|
2072
2072
|
type: D.dateTime,
|
|
2073
|
-
pattern:
|
|
2073
|
+
pattern: y,
|
|
2074
2074
|
location: l.styleLocation,
|
|
2075
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2076
|
-
}, I = s === "date" ?
|
|
2075
|
+
parsedOptions: this.shouldParseSkeletons ? Ze(y) : {}
|
|
2076
|
+
}, I = s === "date" ? b.date : b.time;
|
|
2077
2077
|
return {
|
|
2078
|
-
val: { type: I, value: r, location: E, style:
|
|
2078
|
+
val: { type: I, value: r, location: E, style: m },
|
|
2079
2079
|
err: null
|
|
2080
2080
|
};
|
|
2081
2081
|
}
|
|
2082
2082
|
}
|
|
2083
2083
|
return {
|
|
2084
2084
|
val: {
|
|
2085
|
-
type: s === "number" ?
|
|
2085
|
+
type: s === "number" ? b.number : s === "date" ? b.date : b.time,
|
|
2086
2086
|
value: r,
|
|
2087
2087
|
location: E,
|
|
2088
|
-
style: (
|
|
2088
|
+
style: (i = l == null ? void 0 : l.style) !== null && i !== void 0 ? i : null
|
|
2089
2089
|
},
|
|
2090
2090
|
err: null
|
|
2091
2091
|
};
|
|
@@ -2095,59 +2095,59 @@ var bt = (
|
|
|
2095
2095
|
case "select": {
|
|
2096
2096
|
var T = this.clonePosition();
|
|
2097
2097
|
if (this.bumpSpace(), !this.bumpIf(","))
|
|
2098
|
-
return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,
|
|
2098
|
+
return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS, v(T, f({}, T)));
|
|
2099
2099
|
this.bumpSpace();
|
|
2100
|
-
var w = this.parseIdentifierIfPossible(),
|
|
2100
|
+
var w = this.parseIdentifierIfPossible(), L = 0;
|
|
2101
2101
|
if (s !== "select" && w.value === "offset") {
|
|
2102
2102
|
if (!this.bumpIf(":"))
|
|
2103
|
-
return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,
|
|
2103
|
+
return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, v(this.clonePosition(), this.clonePosition()));
|
|
2104
2104
|
this.bumpSpace();
|
|
2105
|
-
var
|
|
2106
|
-
if (
|
|
2107
|
-
return
|
|
2108
|
-
this.bumpSpace(), w = this.parseIdentifierIfPossible(),
|
|
2105
|
+
var c = this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2106
|
+
if (c.err)
|
|
2107
|
+
return c;
|
|
2108
|
+
this.bumpSpace(), w = this.parseIdentifierIfPossible(), L = c.val;
|
|
2109
2109
|
}
|
|
2110
|
-
var
|
|
2111
|
-
if (
|
|
2112
|
-
return
|
|
2113
|
-
var
|
|
2114
|
-
if (
|
|
2115
|
-
return
|
|
2116
|
-
var
|
|
2110
|
+
var G = this.tryParsePluralOrSelectOptions(t, s, n, w);
|
|
2111
|
+
if (G.err)
|
|
2112
|
+
return G;
|
|
2113
|
+
var d = this.tryParseArgumentClose(a);
|
|
2114
|
+
if (d.err)
|
|
2115
|
+
return d;
|
|
2116
|
+
var ne = v(a, this.clonePosition());
|
|
2117
2117
|
return s === "select" ? {
|
|
2118
2118
|
val: {
|
|
2119
|
-
type:
|
|
2119
|
+
type: b.select,
|
|
2120
2120
|
value: r,
|
|
2121
|
-
options:
|
|
2122
|
-
location:
|
|
2121
|
+
options: he(G.val),
|
|
2122
|
+
location: ne
|
|
2123
2123
|
},
|
|
2124
2124
|
err: null
|
|
2125
2125
|
} : {
|
|
2126
2126
|
val: {
|
|
2127
|
-
type:
|
|
2127
|
+
type: b.plural,
|
|
2128
2128
|
value: r,
|
|
2129
|
-
options:
|
|
2130
|
-
offset:
|
|
2129
|
+
options: he(G.val),
|
|
2130
|
+
offset: L,
|
|
2131
2131
|
pluralType: s === "plural" ? "cardinal" : "ordinal",
|
|
2132
|
-
location:
|
|
2132
|
+
location: ne
|
|
2133
2133
|
},
|
|
2134
2134
|
err: null
|
|
2135
2135
|
};
|
|
2136
2136
|
}
|
|
2137
2137
|
default:
|
|
2138
|
-
return this.error(g.INVALID_ARGUMENT_TYPE,
|
|
2138
|
+
return this.error(g.INVALID_ARGUMENT_TYPE, v(o, u));
|
|
2139
2139
|
}
|
|
2140
2140
|
}, e.prototype.tryParseArgumentClose = function(t) {
|
|
2141
|
-
return this.isEOF() || this.char() !== 125 ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,
|
|
2141
|
+
return this.isEOF() || this.char() !== 125 ? this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE, v(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });
|
|
2142
2142
|
}, e.prototype.parseSimpleArgStyleIfPossible = function() {
|
|
2143
2143
|
for (var t = 0, n = this.clonePosition(); !this.isEOF(); ) {
|
|
2144
2144
|
var r = this.char();
|
|
2145
2145
|
switch (r) {
|
|
2146
2146
|
case 39: {
|
|
2147
2147
|
this.bump();
|
|
2148
|
-
var
|
|
2148
|
+
var a = this.clonePosition();
|
|
2149
2149
|
if (!this.bumpUntil("'"))
|
|
2150
|
-
return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,
|
|
2150
|
+
return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, v(a, this.clonePosition()));
|
|
2151
2151
|
this.bump();
|
|
2152
2152
|
break;
|
|
2153
2153
|
}
|
|
@@ -2177,7 +2177,7 @@ var bt = (
|
|
|
2177
2177
|
}, e.prototype.parseNumberSkeletonFromString = function(t, n) {
|
|
2178
2178
|
var r = [];
|
|
2179
2179
|
try {
|
|
2180
|
-
r =
|
|
2180
|
+
r = ze(t);
|
|
2181
2181
|
} catch {
|
|
2182
2182
|
return this.error(g.INVALID_NUMBER_SKELETON, n);
|
|
2183
2183
|
}
|
|
@@ -2186,55 +2186,55 @@ var bt = (
|
|
|
2186
2186
|
type: D.number,
|
|
2187
2187
|
tokens: r,
|
|
2188
2188
|
location: n,
|
|
2189
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2189
|
+
parsedOptions: this.shouldParseSkeletons ? Ye(r) : {}
|
|
2190
2190
|
},
|
|
2191
2191
|
err: null
|
|
2192
2192
|
};
|
|
2193
|
-
}, e.prototype.tryParsePluralOrSelectOptions = function(t, n, r,
|
|
2194
|
-
for (var
|
|
2193
|
+
}, e.prototype.tryParsePluralOrSelectOptions = function(t, n, r, a) {
|
|
2194
|
+
for (var i, o = !1, s = [], u = /* @__PURE__ */ new Set(), l = a.value, h = a.location; ; ) {
|
|
2195
2195
|
if (l.length === 0) {
|
|
2196
|
-
var
|
|
2196
|
+
var c = this.clonePosition();
|
|
2197
2197
|
if (n !== "select" && this.bumpIf("=")) {
|
|
2198
|
-
var
|
|
2199
|
-
if (
|
|
2200
|
-
return
|
|
2201
|
-
|
|
2198
|
+
var m = this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_SELECTOR, g.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
2199
|
+
if (m.err)
|
|
2200
|
+
return m;
|
|
2201
|
+
h = v(c, this.clonePosition()), l = this.message.slice(c.offset, this.offset());
|
|
2202
2202
|
} else
|
|
2203
2203
|
break;
|
|
2204
2204
|
}
|
|
2205
|
-
if (
|
|
2206
|
-
return this.error(n === "select" ? g.DUPLICATE_SELECT_ARGUMENT_SELECTOR : g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,
|
|
2205
|
+
if (u.has(l))
|
|
2206
|
+
return this.error(n === "select" ? g.DUPLICATE_SELECT_ARGUMENT_SELECTOR : g.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, h);
|
|
2207
2207
|
l === "other" && (o = !0), this.bumpSpace();
|
|
2208
2208
|
var p = this.clonePosition();
|
|
2209
2209
|
if (!this.bumpIf("{"))
|
|
2210
|
-
return this.error(n === "select" ? g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,
|
|
2211
|
-
var
|
|
2212
|
-
if (
|
|
2213
|
-
return
|
|
2210
|
+
return this.error(n === "select" ? g.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : g.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, v(this.clonePosition(), this.clonePosition()));
|
|
2211
|
+
var d = this.parseMessage(t + 1, n, r);
|
|
2212
|
+
if (d.err)
|
|
2213
|
+
return d;
|
|
2214
2214
|
var E = this.tryParseArgumentClose(p);
|
|
2215
2215
|
if (E.err)
|
|
2216
2216
|
return E;
|
|
2217
2217
|
s.push([
|
|
2218
2218
|
l,
|
|
2219
2219
|
{
|
|
2220
|
-
value:
|
|
2221
|
-
location:
|
|
2220
|
+
value: d.val,
|
|
2221
|
+
location: v(p, this.clonePosition())
|
|
2222
2222
|
}
|
|
2223
|
-
]),
|
|
2223
|
+
]), u.add(l), this.bumpSpace(), i = this.parseIdentifierIfPossible(), l = i.value, h = i.location;
|
|
2224
2224
|
}
|
|
2225
|
-
return s.length === 0 ? this.error(n === "select" ? g.EXPECT_SELECT_ARGUMENT_SELECTOR : g.EXPECT_PLURAL_ARGUMENT_SELECTOR,
|
|
2225
|
+
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
2226
|
}, e.prototype.tryParseDecimalInteger = function(t, n) {
|
|
2227
|
-
var r = 1,
|
|
2227
|
+
var r = 1, a = this.clonePosition();
|
|
2228
2228
|
this.bumpIf("+") || this.bumpIf("-") && (r = -1);
|
|
2229
|
-
for (var
|
|
2229
|
+
for (var i = !1, o = 0; !this.isEOF(); ) {
|
|
2230
2230
|
var s = this.char();
|
|
2231
2231
|
if (s >= 48 && s <= 57)
|
|
2232
|
-
|
|
2232
|
+
i = !0, o = o * 10 + (s - 48), this.bump();
|
|
2233
2233
|
else
|
|
2234
2234
|
break;
|
|
2235
2235
|
}
|
|
2236
|
-
var
|
|
2237
|
-
return
|
|
2236
|
+
var u = v(a, this.clonePosition());
|
|
2237
|
+
return i ? (o *= r, ht(o) ? { val: o, err: null } : this.error(n, u)) : this.error(t, u);
|
|
2238
2238
|
}, e.prototype.offset = function() {
|
|
2239
2239
|
return this.position.offset;
|
|
2240
2240
|
}, e.prototype.isEOF = function() {
|
|
@@ -2249,7 +2249,7 @@ var bt = (
|
|
|
2249
2249
|
var t = this.position.offset;
|
|
2250
2250
|
if (t >= this.message.length)
|
|
2251
2251
|
throw Error("out of bound");
|
|
2252
|
-
var n =
|
|
2252
|
+
var n = Be(this.message, t);
|
|
2253
2253
|
if (n === void 0)
|
|
2254
2254
|
throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary"));
|
|
2255
2255
|
return n;
|
|
@@ -2268,7 +2268,7 @@ var bt = (
|
|
|
2268
2268
|
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
2269
|
}
|
|
2270
2270
|
}, e.prototype.bumpIf = function(t) {
|
|
2271
|
-
if (
|
|
2271
|
+
if (ue(this.message, t, this.offset())) {
|
|
2272
2272
|
for (var n = 0; n < t.length; n++)
|
|
2273
2273
|
this.bump();
|
|
2274
2274
|
return !0;
|
|
@@ -2290,7 +2290,7 @@ var bt = (
|
|
|
2290
2290
|
break;
|
|
2291
2291
|
}
|
|
2292
2292
|
}, e.prototype.bumpSpace = function() {
|
|
2293
|
-
for (; !this.isEOF() &&
|
|
2293
|
+
for (; !this.isEOF() && Pe(this.char()); )
|
|
2294
2294
|
this.bump();
|
|
2295
2295
|
}, e.prototype.peek = function() {
|
|
2296
2296
|
if (this.isEOF())
|
|
@@ -2300,124 +2300,124 @@ var bt = (
|
|
|
2300
2300
|
}, e;
|
|
2301
2301
|
}()
|
|
2302
2302
|
);
|
|
2303
|
-
function
|
|
2303
|
+
function $(e) {
|
|
2304
2304
|
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
2305
2305
|
}
|
|
2306
|
-
function
|
|
2307
|
-
return
|
|
2306
|
+
function pt(e) {
|
|
2307
|
+
return $(e) || e === 47;
|
|
2308
2308
|
}
|
|
2309
|
-
function
|
|
2309
|
+
function gt(e) {
|
|
2310
2310
|
return e === 45 || e === 46 || e >= 48 && e <= 57 || e === 95 || e >= 97 && e <= 122 || e >= 65 && e <= 90 || e == 183 || e >= 192 && e <= 214 || e >= 216 && e <= 246 || e >= 248 && e <= 893 || e >= 895 && e <= 8191 || e >= 8204 && e <= 8205 || e >= 8255 && e <= 8256 || e >= 8304 && e <= 8591 || e >= 11264 && e <= 12271 || e >= 12289 && e <= 55295 || e >= 63744 && e <= 64975 || e >= 65008 && e <= 65533 || e >= 65536 && e <= 983039;
|
|
2311
2311
|
}
|
|
2312
|
-
function
|
|
2312
|
+
function Pe(e) {
|
|
2313
2313
|
return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
|
|
2314
2314
|
}
|
|
2315
|
-
function
|
|
2315
|
+
function vt(e) {
|
|
2316
2316
|
return e >= 33 && e <= 35 || e === 36 || e >= 37 && e <= 39 || e === 40 || e === 41 || e === 42 || e === 43 || e === 44 || e === 45 || e >= 46 && e <= 47 || e >= 58 && e <= 59 || e >= 60 && e <= 62 || e >= 63 && e <= 64 || e === 91 || e === 92 || e === 93 || e === 94 || e === 96 || e === 123 || e === 124 || e === 125 || e === 126 || e === 161 || e >= 162 && e <= 165 || e === 166 || e === 167 || e === 169 || e === 171 || e === 172 || e === 174 || e === 176 || e === 177 || e === 182 || e === 187 || e === 191 || e === 215 || e === 247 || e >= 8208 && e <= 8213 || e >= 8214 && e <= 8215 || e === 8216 || e === 8217 || e === 8218 || e >= 8219 && e <= 8220 || e === 8221 || e === 8222 || e === 8223 || e >= 8224 && e <= 8231 || e >= 8240 && e <= 8248 || e === 8249 || e === 8250 || e >= 8251 && e <= 8254 || e >= 8257 && e <= 8259 || e === 8260 || e === 8261 || e === 8262 || e >= 8263 && e <= 8273 || e === 8274 || e === 8275 || e >= 8277 && e <= 8286 || e >= 8592 && e <= 8596 || e >= 8597 && e <= 8601 || e >= 8602 && e <= 8603 || e >= 8604 && e <= 8607 || e === 8608 || e >= 8609 && e <= 8610 || e === 8611 || e >= 8612 && e <= 8613 || e === 8614 || e >= 8615 && e <= 8621 || e === 8622 || e >= 8623 && e <= 8653 || e >= 8654 && e <= 8655 || e >= 8656 && e <= 8657 || e === 8658 || e === 8659 || e === 8660 || e >= 8661 && e <= 8691 || e >= 8692 && e <= 8959 || e >= 8960 && e <= 8967 || e === 8968 || e === 8969 || e === 8970 || e === 8971 || e >= 8972 && e <= 8991 || e >= 8992 && e <= 8993 || e >= 8994 && e <= 9e3 || e === 9001 || e === 9002 || e >= 9003 && e <= 9083 || e === 9084 || e >= 9085 && e <= 9114 || e >= 9115 && e <= 9139 || e >= 9140 && e <= 9179 || e >= 9180 && e <= 9185 || e >= 9186 && e <= 9254 || e >= 9255 && e <= 9279 || e >= 9280 && e <= 9290 || e >= 9291 && e <= 9311 || e >= 9472 && e <= 9654 || e === 9655 || e >= 9656 && e <= 9664 || e === 9665 || e >= 9666 && e <= 9719 || e >= 9720 && e <= 9727 || e >= 9728 && e <= 9838 || e === 9839 || e >= 9840 && e <= 10087 || e === 10088 || e === 10089 || e === 10090 || e === 10091 || e === 10092 || e === 10093 || e === 10094 || e === 10095 || e === 10096 || e === 10097 || e === 10098 || e === 10099 || e === 10100 || e === 10101 || e >= 10132 && e <= 10175 || e >= 10176 && e <= 10180 || e === 10181 || e === 10182 || e >= 10183 && e <= 10213 || e === 10214 || e === 10215 || e === 10216 || e === 10217 || e === 10218 || e === 10219 || e === 10220 || e === 10221 || e === 10222 || e === 10223 || e >= 10224 && e <= 10239 || e >= 10240 && e <= 10495 || e >= 10496 && e <= 10626 || e === 10627 || e === 10628 || e === 10629 || e === 10630 || e === 10631 || e === 10632 || e === 10633 || e === 10634 || e === 10635 || e === 10636 || e === 10637 || e === 10638 || e === 10639 || e === 10640 || e === 10641 || e === 10642 || e === 10643 || e === 10644 || e === 10645 || e === 10646 || e === 10647 || e === 10648 || e >= 10649 && e <= 10711 || e === 10712 || e === 10713 || e === 10714 || e === 10715 || e >= 10716 && e <= 10747 || e === 10748 || e === 10749 || e >= 10750 && e <= 11007 || e >= 11008 && e <= 11055 || e >= 11056 && e <= 11076 || e >= 11077 && e <= 11078 || e >= 11079 && e <= 11084 || e >= 11085 && e <= 11123 || e >= 11124 && e <= 11125 || e >= 11126 && e <= 11157 || e === 11158 || e >= 11159 && e <= 11263 || e >= 11776 && e <= 11777 || e === 11778 || e === 11779 || e === 11780 || e === 11781 || e >= 11782 && e <= 11784 || e === 11785 || e === 11786 || e === 11787 || e === 11788 || e === 11789 || e >= 11790 && e <= 11798 || e === 11799 || e >= 11800 && e <= 11801 || e === 11802 || e === 11803 || e === 11804 || e === 11805 || e >= 11806 && e <= 11807 || e === 11808 || e === 11809 || e === 11810 || e === 11811 || e === 11812 || e === 11813 || e === 11814 || e === 11815 || e === 11816 || e === 11817 || e >= 11818 && e <= 11822 || e === 11823 || e >= 11824 && e <= 11833 || e >= 11834 && e <= 11835 || e >= 11836 && e <= 11839 || e === 11840 || e === 11841 || e === 11842 || e >= 11843 && e <= 11855 || e >= 11856 && e <= 11857 || e === 11858 || e >= 11859 && e <= 11903 || e >= 12289 && e <= 12291 || e === 12296 || e === 12297 || e === 12298 || e === 12299 || e === 12300 || e === 12301 || e === 12302 || e === 12303 || e === 12304 || e === 12305 || e >= 12306 && e <= 12307 || e === 12308 || e === 12309 || e === 12310 || e === 12311 || e === 12312 || e === 12313 || e === 12314 || e === 12315 || e === 12316 || e === 12317 || e >= 12318 && e <= 12319 || e === 12320 || e === 12336 || e === 64830 || e === 64831 || e >= 65093 && e <= 65094;
|
|
2317
2317
|
}
|
|
2318
|
-
function
|
|
2318
|
+
function K(e) {
|
|
2319
2319
|
e.forEach(function(t) {
|
|
2320
|
-
if (delete t.location, xe(t) ||
|
|
2320
|
+
if (delete t.location, xe(t) || ye(t))
|
|
2321
2321
|
for (var n in t.options)
|
|
2322
|
-
delete t.options[n].location,
|
|
2322
|
+
delete t.options[n].location, K(t.options[n].value);
|
|
2323
2323
|
else
|
|
2324
|
-
Ee(t) &&
|
|
2324
|
+
Ee(t) && Se(t.style) || (be(t) || de(t)) && q(t.style) ? delete t.style.location : Te(t) && K(t.children);
|
|
2325
2325
|
});
|
|
2326
2326
|
}
|
|
2327
|
-
function
|
|
2328
|
-
t === void 0 && (t = {}), t =
|
|
2329
|
-
var n = new
|
|
2327
|
+
function Et(e, t) {
|
|
2328
|
+
t === void 0 && (t = {}), t = f({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
|
|
2329
|
+
var n = new ct(e, t).parse();
|
|
2330
2330
|
if (n.err) {
|
|
2331
2331
|
var r = SyntaxError(g[n.err.kind]);
|
|
2332
2332
|
throw r.location = n.err.location, r.originalMessage = n.err.message, r;
|
|
2333
2333
|
}
|
|
2334
|
-
return t != null && t.captureLocation ||
|
|
2334
|
+
return t != null && t.captureLocation || K(n.val), n.val;
|
|
2335
2335
|
}
|
|
2336
2336
|
function N(e, t) {
|
|
2337
|
-
var n = t && t.cache ? t.cache :
|
|
2338
|
-
return
|
|
2337
|
+
var n = t && t.cache ? t.cache : St, r = t && t.serializer ? t.serializer : Tt, a = t && t.strategy ? t.strategy : dt;
|
|
2338
|
+
return a(e, {
|
|
2339
2339
|
cache: n,
|
|
2340
2340
|
serializer: r
|
|
2341
2341
|
});
|
|
2342
2342
|
}
|
|
2343
|
-
function
|
|
2343
|
+
function bt(e) {
|
|
2344
2344
|
return e == null || typeof e == "number" || typeof e == "boolean";
|
|
2345
2345
|
}
|
|
2346
2346
|
function Re(e, t, n, r) {
|
|
2347
|
-
var
|
|
2348
|
-
return typeof
|
|
2347
|
+
var a = bt(r) ? r : n(r), i = t.get(a);
|
|
2348
|
+
return typeof i > "u" && (i = e.call(this, r), t.set(a, i)), i;
|
|
2349
2349
|
}
|
|
2350
2350
|
function Le(e, t, n) {
|
|
2351
|
-
var r = Array.prototype.slice.call(arguments, 3),
|
|
2352
|
-
return typeof
|
|
2351
|
+
var r = Array.prototype.slice.call(arguments, 3), a = n(r), i = t.get(a);
|
|
2352
|
+
return typeof i > "u" && (i = e.apply(this, r), t.set(a, i)), i;
|
|
2353
2353
|
}
|
|
2354
|
-
function
|
|
2355
|
-
return n.bind(t, e, r,
|
|
2354
|
+
function ee(e, t, n, r, a) {
|
|
2355
|
+
return n.bind(t, e, r, a);
|
|
2356
2356
|
}
|
|
2357
|
-
function
|
|
2357
|
+
function dt(e, t) {
|
|
2358
2358
|
var n = e.length === 1 ? Re : Le;
|
|
2359
|
-
return
|
|
2359
|
+
return ee(e, this, n, t.cache.create(), t.serializer);
|
|
2360
2360
|
}
|
|
2361
|
-
function
|
|
2362
|
-
return
|
|
2361
|
+
function xt(e, t) {
|
|
2362
|
+
return ee(e, this, Le, t.cache.create(), t.serializer);
|
|
2363
2363
|
}
|
|
2364
|
-
function
|
|
2365
|
-
return
|
|
2364
|
+
function yt(e, t) {
|
|
2365
|
+
return ee(e, this, Re, t.cache.create(), t.serializer);
|
|
2366
2366
|
}
|
|
2367
|
-
var
|
|
2367
|
+
var Tt = function() {
|
|
2368
2368
|
return JSON.stringify(arguments);
|
|
2369
2369
|
};
|
|
2370
|
-
function
|
|
2370
|
+
function te() {
|
|
2371
2371
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2372
2372
|
}
|
|
2373
|
-
|
|
2373
|
+
te.prototype.get = function(e) {
|
|
2374
2374
|
return this.cache[e];
|
|
2375
2375
|
};
|
|
2376
|
-
|
|
2376
|
+
te.prototype.set = function(e, t) {
|
|
2377
2377
|
this.cache[e] = t;
|
|
2378
2378
|
};
|
|
2379
|
-
var
|
|
2379
|
+
var St = {
|
|
2380
2380
|
create: function() {
|
|
2381
|
-
return new
|
|
2381
|
+
return new te();
|
|
2382
2382
|
}
|
|
2383
2383
|
}, B = {
|
|
2384
|
-
variadic:
|
|
2385
|
-
monadic:
|
|
2384
|
+
variadic: xt,
|
|
2385
|
+
monadic: yt
|
|
2386
2386
|
}, _;
|
|
2387
2387
|
(function(e) {
|
|
2388
2388
|
e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
|
|
2389
2389
|
})(_ || (_ = {}));
|
|
2390
|
-
var
|
|
2390
|
+
var R = (
|
|
2391
2391
|
/** @class */
|
|
2392
2392
|
function(e) {
|
|
2393
2393
|
A(t, e);
|
|
2394
|
-
function t(n, r,
|
|
2395
|
-
var
|
|
2396
|
-
return
|
|
2394
|
+
function t(n, r, a) {
|
|
2395
|
+
var i = e.call(this, n) || this;
|
|
2396
|
+
return i.code = r, i.originalMessage = a, i;
|
|
2397
2397
|
}
|
|
2398
2398
|
return t.prototype.toString = function() {
|
|
2399
2399
|
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
2400
2400
|
}, t;
|
|
2401
2401
|
}(Error)
|
|
2402
|
-
),
|
|
2402
|
+
), fe = (
|
|
2403
2403
|
/** @class */
|
|
2404
2404
|
function(e) {
|
|
2405
2405
|
A(t, e);
|
|
2406
|
-
function t(n, r,
|
|
2407
|
-
return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(r, '". Options are "').concat(Object.keys(
|
|
2406
|
+
function t(n, r, a, i) {
|
|
2407
|
+
return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(r, '". Options are "').concat(Object.keys(a).join('", "'), '"'), _.INVALID_VALUE, i) || this;
|
|
2408
2408
|
}
|
|
2409
2409
|
return t;
|
|
2410
|
-
}(
|
|
2411
|
-
),
|
|
2410
|
+
}(R)
|
|
2411
|
+
), It = (
|
|
2412
2412
|
/** @class */
|
|
2413
2413
|
function(e) {
|
|
2414
2414
|
A(t, e);
|
|
2415
|
-
function t(n, r,
|
|
2416
|
-
return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(r), _.INVALID_VALUE,
|
|
2415
|
+
function t(n, r, a) {
|
|
2416
|
+
return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(r), _.INVALID_VALUE, a) || this;
|
|
2417
2417
|
}
|
|
2418
2418
|
return t;
|
|
2419
|
-
}(
|
|
2420
|
-
),
|
|
2419
|
+
}(R)
|
|
2420
|
+
), Ht = (
|
|
2421
2421
|
/** @class */
|
|
2422
2422
|
function(e) {
|
|
2423
2423
|
A(t, e);
|
|
@@ -2425,21 +2425,21 @@ var O = (
|
|
|
2425
2425
|
return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(r, '"'), _.MISSING_VALUE, r) || this;
|
|
2426
2426
|
}
|
|
2427
2427
|
return t;
|
|
2428
|
-
}(
|
|
2428
|
+
}(R)
|
|
2429
2429
|
), S;
|
|
2430
2430
|
(function(e) {
|
|
2431
2431
|
e[e.literal = 0] = "literal", e[e.object = 1] = "object";
|
|
2432
2432
|
})(S || (S = {}));
|
|
2433
|
-
function
|
|
2433
|
+
function At(e) {
|
|
2434
2434
|
return e.length < 2 ? e : e.reduce(function(t, n) {
|
|
2435
2435
|
var r = t[t.length - 1];
|
|
2436
2436
|
return !r || r.type !== S.literal || n.type !== S.literal ? t.push(n) : r.value += n.value, t;
|
|
2437
2437
|
}, []);
|
|
2438
2438
|
}
|
|
2439
|
-
function
|
|
2439
|
+
function Nt(e) {
|
|
2440
2440
|
return typeof e == "function";
|
|
2441
2441
|
}
|
|
2442
|
-
function
|
|
2442
|
+
function V(e, t, n, r, a, i, o) {
|
|
2443
2443
|
if (e.length === 1 && ae(e[0]))
|
|
2444
2444
|
return [
|
|
2445
2445
|
{
|
|
@@ -2447,107 +2447,107 @@ function k(e, t, n, r, i, a, o) {
|
|
|
2447
2447
|
value: e[0].value
|
|
2448
2448
|
}
|
|
2449
2449
|
];
|
|
2450
|
-
for (var s = [],
|
|
2451
|
-
var
|
|
2452
|
-
if (ae(
|
|
2450
|
+
for (var s = [], u = 0, l = e; u < l.length; u++) {
|
|
2451
|
+
var h = l[u];
|
|
2452
|
+
if (ae(h)) {
|
|
2453
2453
|
s.push({
|
|
2454
2454
|
type: S.literal,
|
|
2455
|
-
value:
|
|
2455
|
+
value: h.value
|
|
2456
2456
|
});
|
|
2457
2457
|
continue;
|
|
2458
2458
|
}
|
|
2459
|
-
if (
|
|
2460
|
-
typeof
|
|
2459
|
+
if (je(h)) {
|
|
2460
|
+
typeof i == "number" && s.push({
|
|
2461
2461
|
type: S.literal,
|
|
2462
|
-
value: n.getNumberFormat(t).format(
|
|
2462
|
+
value: n.getNumberFormat(t).format(i)
|
|
2463
2463
|
});
|
|
2464
2464
|
continue;
|
|
2465
2465
|
}
|
|
2466
|
-
var
|
|
2467
|
-
if (!(
|
|
2468
|
-
throw new
|
|
2469
|
-
var
|
|
2470
|
-
if (
|
|
2471
|
-
(!
|
|
2472
|
-
type: typeof
|
|
2473
|
-
value:
|
|
2466
|
+
var c = h.value;
|
|
2467
|
+
if (!(a && c in a))
|
|
2468
|
+
throw new Ht(c, o);
|
|
2469
|
+
var m = a[c];
|
|
2470
|
+
if (Ve(h)) {
|
|
2471
|
+
(!m || typeof m == "string" || typeof m == "number") && (m = typeof m == "string" || typeof m == "number" ? String(m) : ""), s.push({
|
|
2472
|
+
type: typeof m == "string" ? S.literal : S.object,
|
|
2473
|
+
value: m
|
|
2474
2474
|
});
|
|
2475
2475
|
continue;
|
|
2476
2476
|
}
|
|
2477
|
-
if (
|
|
2478
|
-
var p = typeof
|
|
2477
|
+
if (be(h)) {
|
|
2478
|
+
var p = typeof h.style == "string" ? r.date[h.style] : q(h.style) ? h.style.parsedOptions : void 0;
|
|
2479
2479
|
s.push({
|
|
2480
2480
|
type: S.literal,
|
|
2481
|
-
value: n.getDateTimeFormat(t, p).format(
|
|
2481
|
+
value: n.getDateTimeFormat(t, p).format(m)
|
|
2482
2482
|
});
|
|
2483
2483
|
continue;
|
|
2484
2484
|
}
|
|
2485
|
-
if (
|
|
2486
|
-
var p = typeof
|
|
2485
|
+
if (de(h)) {
|
|
2486
|
+
var p = typeof h.style == "string" ? r.time[h.style] : q(h.style) ? h.style.parsedOptions : r.time.medium;
|
|
2487
2487
|
s.push({
|
|
2488
2488
|
type: S.literal,
|
|
2489
|
-
value: n.getDateTimeFormat(t, p).format(
|
|
2489
|
+
value: n.getDateTimeFormat(t, p).format(m)
|
|
2490
2490
|
});
|
|
2491
2491
|
continue;
|
|
2492
2492
|
}
|
|
2493
|
-
if (Ee(
|
|
2494
|
-
var p = typeof
|
|
2495
|
-
p && p.scale && (
|
|
2493
|
+
if (Ee(h)) {
|
|
2494
|
+
var p = typeof h.style == "string" ? r.number[h.style] : Se(h.style) ? h.style.parsedOptions : void 0;
|
|
2495
|
+
p && p.scale && (m = m * (p.scale || 1)), s.push({
|
|
2496
2496
|
type: S.literal,
|
|
2497
|
-
value: n.getNumberFormat(t, p).format(
|
|
2497
|
+
value: n.getNumberFormat(t, p).format(m)
|
|
2498
2498
|
});
|
|
2499
2499
|
continue;
|
|
2500
2500
|
}
|
|
2501
|
-
if (
|
|
2502
|
-
var
|
|
2503
|
-
if (!
|
|
2504
|
-
throw new
|
|
2505
|
-
var
|
|
2506
|
-
return
|
|
2501
|
+
if (Te(h)) {
|
|
2502
|
+
var d = h.children, E = h.value, x = a[E];
|
|
2503
|
+
if (!Nt(x))
|
|
2504
|
+
throw new It(E, "function", o);
|
|
2505
|
+
var y = V(d, t, n, r, a, i), I = x(y.map(function(L) {
|
|
2506
|
+
return L.value;
|
|
2507
2507
|
}));
|
|
2508
|
-
Array.isArray(I) || (I = [I]), s.push.apply(s, I.map(function(
|
|
2508
|
+
Array.isArray(I) || (I = [I]), s.push.apply(s, I.map(function(L) {
|
|
2509
2509
|
return {
|
|
2510
|
-
type: typeof
|
|
2511
|
-
value:
|
|
2510
|
+
type: typeof L == "string" ? S.literal : S.object,
|
|
2511
|
+
value: L
|
|
2512
2512
|
};
|
|
2513
2513
|
}));
|
|
2514
2514
|
}
|
|
2515
|
-
if (xe(
|
|
2516
|
-
var T =
|
|
2515
|
+
if (xe(h)) {
|
|
2516
|
+
var T = h.options[m] || h.options.other;
|
|
2517
2517
|
if (!T)
|
|
2518
|
-
throw new
|
|
2519
|
-
s.push.apply(s,
|
|
2518
|
+
throw new fe(h.value, m, Object.keys(h.options), o);
|
|
2519
|
+
s.push.apply(s, V(T.value, t, n, r, a));
|
|
2520
2520
|
continue;
|
|
2521
2521
|
}
|
|
2522
|
-
if (
|
|
2523
|
-
var T =
|
|
2522
|
+
if (ye(h)) {
|
|
2523
|
+
var T = h.options["=".concat(m)];
|
|
2524
2524
|
if (!T) {
|
|
2525
2525
|
if (!Intl.PluralRules)
|
|
2526
|
-
throw new
|
|
2526
|
+
throw new R(`Intl.PluralRules is not available in this environment.
|
|
2527
2527
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2528
2528
|
`, _.MISSING_INTL_API, o);
|
|
2529
|
-
var w = n.getPluralRules(t, { type:
|
|
2530
|
-
T =
|
|
2529
|
+
var w = n.getPluralRules(t, { type: h.pluralType }).select(m - (h.offset || 0));
|
|
2530
|
+
T = h.options[w] || h.options.other;
|
|
2531
2531
|
}
|
|
2532
2532
|
if (!T)
|
|
2533
|
-
throw new
|
|
2534
|
-
s.push.apply(s,
|
|
2533
|
+
throw new fe(h.value, m, Object.keys(h.options), o);
|
|
2534
|
+
s.push.apply(s, V(T.value, t, n, r, a, m - (h.offset || 0)));
|
|
2535
2535
|
continue;
|
|
2536
2536
|
}
|
|
2537
2537
|
}
|
|
2538
|
-
return
|
|
2538
|
+
return At(s);
|
|
2539
2539
|
}
|
|
2540
|
-
function
|
|
2541
|
-
return t ?
|
|
2542
|
-
return n[r] =
|
|
2540
|
+
function Bt(e, t) {
|
|
2541
|
+
return t ? f(f(f({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) {
|
|
2542
|
+
return n[r] = f(f({}, e[r]), t[r] || {}), n;
|
|
2543
2543
|
}, {})) : e;
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2545
|
+
function _t(e, t) {
|
|
2546
2546
|
return t ? Object.keys(e).reduce(function(n, r) {
|
|
2547
|
-
return n[r] =
|
|
2548
|
-
},
|
|
2547
|
+
return n[r] = Bt(e[r], t[r]), n;
|
|
2548
|
+
}, f({}, e)) : e;
|
|
2549
2549
|
}
|
|
2550
|
-
function
|
|
2550
|
+
function Z(e) {
|
|
2551
2551
|
return {
|
|
2552
2552
|
create: function() {
|
|
2553
2553
|
return {
|
|
@@ -2561,7 +2561,7 @@ function W(e) {
|
|
|
2561
2561
|
}
|
|
2562
2562
|
};
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function Pt(e) {
|
|
2565
2565
|
return e === void 0 && (e = {
|
|
2566
2566
|
number: {},
|
|
2567
2567
|
dateTime: {},
|
|
@@ -2572,7 +2572,7 @@ function Mt(e) {
|
|
|
2572
2572
|
n[r] = arguments[r];
|
|
2573
2573
|
return new ((t = Intl.NumberFormat).bind.apply(t, P([void 0], n, !1)))();
|
|
2574
2574
|
}, {
|
|
2575
|
-
cache:
|
|
2575
|
+
cache: Z(e.number),
|
|
2576
2576
|
strategy: B.variadic
|
|
2577
2577
|
}),
|
|
2578
2578
|
getDateTimeFormat: N(function() {
|
|
@@ -2580,7 +2580,7 @@ function Mt(e) {
|
|
|
2580
2580
|
n[r] = arguments[r];
|
|
2581
2581
|
return new ((t = Intl.DateTimeFormat).bind.apply(t, P([void 0], n, !1)))();
|
|
2582
2582
|
}, {
|
|
2583
|
-
cache:
|
|
2583
|
+
cache: Z(e.dateTime),
|
|
2584
2584
|
strategy: B.variadic
|
|
2585
2585
|
}),
|
|
2586
2586
|
getPluralRules: N(function() {
|
|
@@ -2588,50 +2588,50 @@ function Mt(e) {
|
|
|
2588
2588
|
n[r] = arguments[r];
|
|
2589
2589
|
return new ((t = Intl.PluralRules).bind.apply(t, P([void 0], n, !1)))();
|
|
2590
2590
|
}, {
|
|
2591
|
-
cache:
|
|
2591
|
+
cache: Z(e.pluralRules),
|
|
2592
2592
|
strategy: B.variadic
|
|
2593
2593
|
})
|
|
2594
2594
|
};
|
|
2595
2595
|
}
|
|
2596
|
-
var
|
|
2596
|
+
var Oe = (
|
|
2597
2597
|
/** @class */
|
|
2598
2598
|
function() {
|
|
2599
|
-
function e(t, n, r,
|
|
2599
|
+
function e(t, n, r, a) {
|
|
2600
2600
|
n === void 0 && (n = e.defaultLocale);
|
|
2601
|
-
var
|
|
2601
|
+
var i = this;
|
|
2602
2602
|
if (this.formatterCache = {
|
|
2603
2603
|
number: {},
|
|
2604
2604
|
dateTime: {},
|
|
2605
2605
|
pluralRules: {}
|
|
2606
|
-
}, this.format = function(
|
|
2607
|
-
var l =
|
|
2606
|
+
}, this.format = function(u) {
|
|
2607
|
+
var l = i.formatToParts(u);
|
|
2608
2608
|
if (l.length === 1)
|
|
2609
2609
|
return l[0].value;
|
|
2610
|
-
var
|
|
2611
|
-
return !
|
|
2610
|
+
var h = l.reduce(function(c, m) {
|
|
2611
|
+
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
2612
|
}, []);
|
|
2613
|
-
return
|
|
2614
|
-
}, this.formatToParts = function(
|
|
2615
|
-
return
|
|
2613
|
+
return h.length <= 1 ? h[0] || "" : h;
|
|
2614
|
+
}, this.formatToParts = function(u) {
|
|
2615
|
+
return V(i.ast, i.locales, i.formatters, i.formats, u, void 0, i.message);
|
|
2616
2616
|
}, this.resolvedOptions = function() {
|
|
2617
|
-
var
|
|
2617
|
+
var u;
|
|
2618
2618
|
return {
|
|
2619
|
-
locale: ((
|
|
2619
|
+
locale: ((u = i.resolvedLocale) === null || u === void 0 ? void 0 : u.toString()) || Intl.NumberFormat.supportedLocalesOf(i.locales)[0]
|
|
2620
2620
|
};
|
|
2621
2621
|
}, this.getAst = function() {
|
|
2622
|
-
return
|
|
2622
|
+
return i.ast;
|
|
2623
2623
|
}, this.locales = n, this.resolvedLocale = e.resolveLocale(n), typeof t == "string") {
|
|
2624
2624
|
if (this.message = t, !e.__parse)
|
|
2625
2625
|
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
2626
|
-
var o =
|
|
2626
|
+
var o = a || {};
|
|
2627
2627
|
o.formatters;
|
|
2628
|
-
var s =
|
|
2629
|
-
this.ast = e.__parse(t,
|
|
2628
|
+
var s = ke(o, ["formatters"]);
|
|
2629
|
+
this.ast = e.__parse(t, f(f({}, s), { locale: this.resolvedLocale }));
|
|
2630
2630
|
} else
|
|
2631
2631
|
this.ast = t;
|
|
2632
2632
|
if (!Array.isArray(this.ast))
|
|
2633
2633
|
throw new TypeError("A message must be provided as a String or AST.");
|
|
2634
|
-
this.formats =
|
|
2634
|
+
this.formats = _t(e.formats, r), this.formatters = a && a.formatters || Pt(this.formatterCache);
|
|
2635
2635
|
}
|
|
2636
2636
|
return Object.defineProperty(e, "defaultLocale", {
|
|
2637
2637
|
get: function() {
|
|
@@ -2644,7 +2644,7 @@ var Me = (
|
|
|
2644
2644
|
var n = Intl.NumberFormat.supportedLocalesOf(t);
|
|
2645
2645
|
return n.length > 0 ? new Intl.Locale(n[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]);
|
|
2646
2646
|
}
|
|
2647
|
-
}, e.__parse =
|
|
2647
|
+
}, e.__parse = Et, e.formats = {
|
|
2648
2648
|
number: {
|
|
2649
2649
|
integer: {
|
|
2650
2650
|
maximumFractionDigits: 0
|
|
@@ -2708,20 +2708,20 @@ var Me = (
|
|
|
2708
2708
|
(function(e) {
|
|
2709
2709
|
e.FORMAT_ERROR = "FORMAT_ERROR", e.UNSUPPORTED_FORMATTER = "UNSUPPORTED_FORMATTER", e.INVALID_CONFIG = "INVALID_CONFIG", e.MISSING_DATA = "MISSING_DATA", e.MISSING_TRANSLATION = "MISSING_TRANSLATION";
|
|
2710
2710
|
})(M || (M = {}));
|
|
2711
|
-
var
|
|
2711
|
+
var F = (
|
|
2712
2712
|
/** @class */
|
|
2713
2713
|
function(e) {
|
|
2714
2714
|
A(t, e);
|
|
2715
|
-
function t(n, r,
|
|
2716
|
-
var
|
|
2717
|
-
return
|
|
2715
|
+
function t(n, r, a) {
|
|
2716
|
+
var i = this, o = a ? a instanceof Error ? a : new Error(String(a)) : void 0;
|
|
2717
|
+
return i = e.call(this, "[@formatjs/intl Error ".concat(n, "] ").concat(r, `
|
|
2718
2718
|
`).concat(o ? `
|
|
2719
2719
|
`.concat(o.message, `
|
|
2720
|
-
`).concat(o.stack) : "")) || this,
|
|
2720
|
+
`).concat(o.stack) : "")) || this, i.code = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(i, t), i;
|
|
2721
2721
|
}
|
|
2722
2722
|
return t;
|
|
2723
2723
|
}(Error)
|
|
2724
|
-
),
|
|
2724
|
+
), Rt = (
|
|
2725
2725
|
/** @class */
|
|
2726
2726
|
function(e) {
|
|
2727
2727
|
A(t, e);
|
|
@@ -2729,8 +2729,8 @@ var G = (
|
|
|
2729
2729
|
return e.call(this, M.UNSUPPORTED_FORMATTER, n, r) || this;
|
|
2730
2730
|
}
|
|
2731
2731
|
return t;
|
|
2732
|
-
}(
|
|
2733
|
-
),
|
|
2732
|
+
}(F)
|
|
2733
|
+
), Lt = (
|
|
2734
2734
|
/** @class */
|
|
2735
2735
|
function(e) {
|
|
2736
2736
|
A(t, e);
|
|
@@ -2738,7 +2738,7 @@ var G = (
|
|
|
2738
2738
|
return e.call(this, M.INVALID_CONFIG, n, r) || this;
|
|
2739
2739
|
}
|
|
2740
2740
|
return t;
|
|
2741
|
-
}(
|
|
2741
|
+
}(F)
|
|
2742
2742
|
), me = (
|
|
2743
2743
|
/** @class */
|
|
2744
2744
|
function(e) {
|
|
@@ -2747,67 +2747,67 @@ var G = (
|
|
|
2747
2747
|
return e.call(this, M.MISSING_DATA, n, r) || this;
|
|
2748
2748
|
}
|
|
2749
2749
|
return t;
|
|
2750
|
-
}(
|
|
2750
|
+
}(F)
|
|
2751
2751
|
), H = (
|
|
2752
2752
|
/** @class */
|
|
2753
2753
|
function(e) {
|
|
2754
2754
|
A(t, e);
|
|
2755
|
-
function t(n, r,
|
|
2756
|
-
var
|
|
2755
|
+
function t(n, r, a) {
|
|
2756
|
+
var i = e.call(this, M.FORMAT_ERROR, "".concat(n, `
|
|
2757
2757
|
Locale: `).concat(r, `
|
|
2758
|
-
`),
|
|
2759
|
-
return
|
|
2758
|
+
`), a) || this;
|
|
2759
|
+
return i.locale = r, i;
|
|
2760
2760
|
}
|
|
2761
2761
|
return t;
|
|
2762
|
-
}(
|
|
2763
|
-
),
|
|
2762
|
+
}(F)
|
|
2763
|
+
), W = (
|
|
2764
2764
|
/** @class */
|
|
2765
2765
|
function(e) {
|
|
2766
2766
|
A(t, e);
|
|
2767
|
-
function t(n, r,
|
|
2767
|
+
function t(n, r, a, i) {
|
|
2768
2768
|
var o = e.call(this, "".concat(n, `
|
|
2769
|
-
MessageID: `).concat(
|
|
2770
|
-
Default Message: `).concat(
|
|
2771
|
-
Description: `).concat(
|
|
2772
|
-
`), r,
|
|
2773
|
-
return o.descriptor =
|
|
2769
|
+
MessageID: `).concat(a == null ? void 0 : a.id, `
|
|
2770
|
+
Default Message: `).concat(a == null ? void 0 : a.defaultMessage, `
|
|
2771
|
+
Description: `).concat(a == null ? void 0 : a.description, `
|
|
2772
|
+
`), r, i) || this;
|
|
2773
|
+
return o.descriptor = a, o.locale = r, o;
|
|
2774
2774
|
}
|
|
2775
2775
|
return t;
|
|
2776
2776
|
}(H)
|
|
2777
|
-
),
|
|
2777
|
+
), Ot = (
|
|
2778
2778
|
/** @class */
|
|
2779
2779
|
function(e) {
|
|
2780
2780
|
A(t, e);
|
|
2781
2781
|
function t(n, r) {
|
|
2782
|
-
var
|
|
2782
|
+
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
2783
|
var o;
|
|
2784
|
-
return (o =
|
|
2784
|
+
return (o = i.value) !== null && o !== void 0 ? o : JSON.stringify(i);
|
|
2785
2785
|
}).join(), ")") : "id", " as fallback.")) || this;
|
|
2786
|
-
return
|
|
2786
|
+
return a.descriptor = n, a;
|
|
2787
2787
|
}
|
|
2788
2788
|
return t;
|
|
2789
|
-
}(
|
|
2789
|
+
}(F)
|
|
2790
2790
|
);
|
|
2791
2791
|
function C(e, t, n) {
|
|
2792
|
-
return n === void 0 && (n = {}), t.reduce(function(r,
|
|
2793
|
-
return
|
|
2792
|
+
return n === void 0 && (n = {}), t.reduce(function(r, a) {
|
|
2793
|
+
return a in e ? r[a] = e[a] : a in n && (r[a] = n[a]), r;
|
|
2794
2794
|
}, {});
|
|
2795
2795
|
}
|
|
2796
|
-
var
|
|
2796
|
+
var Mt = function(e) {
|
|
2797
2797
|
process.env.NODE_ENV !== "production" && console.error(e);
|
|
2798
|
-
},
|
|
2798
|
+
}, Ct = function(e) {
|
|
2799
2799
|
process.env.NODE_ENV !== "production" && console.warn(e);
|
|
2800
|
-
},
|
|
2800
|
+
}, Dt = {
|
|
2801
2801
|
formats: {},
|
|
2802
2802
|
messages: {},
|
|
2803
2803
|
timeZone: void 0,
|
|
2804
2804
|
defaultLocale: "en",
|
|
2805
2805
|
defaultFormats: {},
|
|
2806
2806
|
fallbackOnEmptyString: !0,
|
|
2807
|
-
onError:
|
|
2808
|
-
onWarn:
|
|
2807
|
+
onError: Mt,
|
|
2808
|
+
onWarn: Ct
|
|
2809
2809
|
};
|
|
2810
|
-
function
|
|
2810
|
+
function Me() {
|
|
2811
2811
|
return {
|
|
2812
2812
|
dateTime: {},
|
|
2813
2813
|
number: {},
|
|
@@ -2818,7 +2818,7 @@ function Ce() {
|
|
|
2818
2818
|
displayNames: {}
|
|
2819
2819
|
};
|
|
2820
2820
|
}
|
|
2821
|
-
function
|
|
2821
|
+
function O(e) {
|
|
2822
2822
|
return {
|
|
2823
2823
|
create: function() {
|
|
2824
2824
|
return {
|
|
@@ -2832,139 +2832,139 @@ function L(e) {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
};
|
|
2834
2834
|
}
|
|
2835
|
-
function
|
|
2836
|
-
e === void 0 && (e =
|
|
2837
|
-
var t = Intl.RelativeTimeFormat, n = Intl.ListFormat, r = Intl.DisplayNames,
|
|
2838
|
-
for (var s,
|
|
2839
|
-
|
|
2840
|
-
return new ((s = Intl.DateTimeFormat).bind.apply(s, P([void 0],
|
|
2835
|
+
function wt(e) {
|
|
2836
|
+
e === void 0 && (e = Me());
|
|
2837
|
+
var t = Intl.RelativeTimeFormat, n = Intl.ListFormat, r = Intl.DisplayNames, a = N(function() {
|
|
2838
|
+
for (var s, u = [], l = 0; l < arguments.length; l++)
|
|
2839
|
+
u[l] = arguments[l];
|
|
2840
|
+
return new ((s = Intl.DateTimeFormat).bind.apply(s, P([void 0], u, !1)))();
|
|
2841
2841
|
}, {
|
|
2842
|
-
cache:
|
|
2842
|
+
cache: O(e.dateTime),
|
|
2843
2843
|
strategy: B.variadic
|
|
2844
|
-
}),
|
|
2845
|
-
for (var s,
|
|
2846
|
-
|
|
2847
|
-
return new ((s = Intl.NumberFormat).bind.apply(s, P([void 0],
|
|
2844
|
+
}), i = N(function() {
|
|
2845
|
+
for (var s, u = [], l = 0; l < arguments.length; l++)
|
|
2846
|
+
u[l] = arguments[l];
|
|
2847
|
+
return new ((s = Intl.NumberFormat).bind.apply(s, P([void 0], u, !1)))();
|
|
2848
2848
|
}, {
|
|
2849
|
-
cache:
|
|
2849
|
+
cache: O(e.number),
|
|
2850
2850
|
strategy: B.variadic
|
|
2851
2851
|
}), o = N(function() {
|
|
2852
|
-
for (var s,
|
|
2853
|
-
|
|
2854
|
-
return new ((s = Intl.PluralRules).bind.apply(s, P([void 0],
|
|
2852
|
+
for (var s, u = [], l = 0; l < arguments.length; l++)
|
|
2853
|
+
u[l] = arguments[l];
|
|
2854
|
+
return new ((s = Intl.PluralRules).bind.apply(s, P([void 0], u, !1)))();
|
|
2855
2855
|
}, {
|
|
2856
|
-
cache:
|
|
2856
|
+
cache: O(e.pluralRules),
|
|
2857
2857
|
strategy: B.variadic
|
|
2858
2858
|
});
|
|
2859
2859
|
return {
|
|
2860
|
-
getDateTimeFormat:
|
|
2861
|
-
getNumberFormat:
|
|
2862
|
-
getMessageFormat: N(function(s,
|
|
2863
|
-
return new
|
|
2864
|
-
getNumberFormat:
|
|
2865
|
-
getDateTimeFormat:
|
|
2860
|
+
getDateTimeFormat: a,
|
|
2861
|
+
getNumberFormat: i,
|
|
2862
|
+
getMessageFormat: N(function(s, u, l, h) {
|
|
2863
|
+
return new Oe(s, u, l, f({ formatters: {
|
|
2864
|
+
getNumberFormat: i,
|
|
2865
|
+
getDateTimeFormat: a,
|
|
2866
2866
|
getPluralRules: o
|
|
2867
|
-
} },
|
|
2867
|
+
} }, h || {}));
|
|
2868
2868
|
}, {
|
|
2869
|
-
cache:
|
|
2869
|
+
cache: O(e.message),
|
|
2870
2870
|
strategy: B.variadic
|
|
2871
2871
|
}),
|
|
2872
2872
|
getRelativeTimeFormat: N(function() {
|
|
2873
|
-
for (var s = [],
|
|
2874
|
-
s[
|
|
2873
|
+
for (var s = [], u = 0; u < arguments.length; u++)
|
|
2874
|
+
s[u] = arguments[u];
|
|
2875
2875
|
return new (t.bind.apply(t, P([void 0], s, !1)))();
|
|
2876
2876
|
}, {
|
|
2877
|
-
cache:
|
|
2877
|
+
cache: O(e.relativeTime),
|
|
2878
2878
|
strategy: B.variadic
|
|
2879
2879
|
}),
|
|
2880
2880
|
getPluralRules: o,
|
|
2881
2881
|
getListFormat: N(function() {
|
|
2882
|
-
for (var s = [],
|
|
2883
|
-
s[
|
|
2882
|
+
for (var s = [], u = 0; u < arguments.length; u++)
|
|
2883
|
+
s[u] = arguments[u];
|
|
2884
2884
|
return new (n.bind.apply(n, P([void 0], s, !1)))();
|
|
2885
2885
|
}, {
|
|
2886
|
-
cache:
|
|
2886
|
+
cache: O(e.list),
|
|
2887
2887
|
strategy: B.variadic
|
|
2888
2888
|
}),
|
|
2889
2889
|
getDisplayNames: N(function() {
|
|
2890
|
-
for (var s = [],
|
|
2891
|
-
s[
|
|
2890
|
+
for (var s = [], u = 0; u < arguments.length; u++)
|
|
2891
|
+
s[u] = arguments[u];
|
|
2892
2892
|
return new (r.bind.apply(r, P([void 0], s, !1)))();
|
|
2893
2893
|
}, {
|
|
2894
|
-
cache:
|
|
2894
|
+
cache: O(e.displayNames),
|
|
2895
2895
|
strategy: B.variadic
|
|
2896
2896
|
})
|
|
2897
2897
|
};
|
|
2898
2898
|
}
|
|
2899
|
-
function
|
|
2900
|
-
var
|
|
2901
|
-
if (
|
|
2902
|
-
return
|
|
2903
|
-
r(new
|
|
2899
|
+
function re(e, t, n, r) {
|
|
2900
|
+
var a = e && e[t], i;
|
|
2901
|
+
if (a && (i = a[n]), i)
|
|
2902
|
+
return i;
|
|
2903
|
+
r(new Rt("No ".concat(t, " format named: ").concat(n)));
|
|
2904
2904
|
}
|
|
2905
|
-
function
|
|
2905
|
+
function Ft(e, t, n) {
|
|
2906
2906
|
if (n === void 0 && (n = Error), !e)
|
|
2907
2907
|
throw new n(t);
|
|
2908
2908
|
}
|
|
2909
|
-
function
|
|
2909
|
+
function k(e, t) {
|
|
2910
2910
|
return Object.keys(e).reduce(function(n, r) {
|
|
2911
|
-
return n[r] =
|
|
2911
|
+
return n[r] = f({ timeZone: t }, e[r]), n;
|
|
2912
2912
|
}, {});
|
|
2913
2913
|
}
|
|
2914
|
-
function
|
|
2915
|
-
var n = Object.keys(
|
|
2916
|
-
return n.reduce(function(r,
|
|
2917
|
-
return r[
|
|
2914
|
+
function ce(e, t) {
|
|
2915
|
+
var n = Object.keys(f(f({}, e), t));
|
|
2916
|
+
return n.reduce(function(r, a) {
|
|
2917
|
+
return r[a] = f(f({}, e[a] || {}), t[a] || {}), r;
|
|
2918
2918
|
}, {});
|
|
2919
2919
|
}
|
|
2920
|
-
function
|
|
2920
|
+
function pe(e, t) {
|
|
2921
2921
|
if (!t)
|
|
2922
2922
|
return e;
|
|
2923
|
-
var n =
|
|
2924
|
-
return
|
|
2923
|
+
var n = Oe.formats;
|
|
2924
|
+
return f(f(f({}, n), e), { date: ce(k(n.date, t), k(e.date || {}, t)), time: ce(k(n.time, t), k(e.time || {}, t)) });
|
|
2925
2925
|
}
|
|
2926
|
-
var
|
|
2927
|
-
var
|
|
2926
|
+
var ge = function(e, t, n, r, a) {
|
|
2927
|
+
var i = e.locale, o = e.formats, s = e.messages, u = e.defaultLocale, l = e.defaultFormats, h = e.fallbackOnEmptyString, c = e.onError, m = e.timeZone, p = e.defaultRichTextElements;
|
|
2928
2928
|
n === void 0 && (n = { id: "" });
|
|
2929
|
-
var
|
|
2930
|
-
|
|
2931
|
-
var
|
|
2929
|
+
var d = n.id, E = n.defaultMessage;
|
|
2930
|
+
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");
|
|
2931
|
+
var x = String(d), y = (
|
|
2932
2932
|
// In case messages is Object.create(null)
|
|
2933
2933
|
// e.g import('foo.json') from webpack)
|
|
2934
2934
|
// See https://github.com/formatjs/formatjs/issues/1914
|
|
2935
|
-
s && Object.prototype.hasOwnProperty.call(s,
|
|
2935
|
+
s && Object.prototype.hasOwnProperty.call(s, x) && s[x]
|
|
2936
2936
|
);
|
|
2937
|
-
if (Array.isArray(
|
|
2938
|
-
return
|
|
2939
|
-
if (!r &&
|
|
2940
|
-
return
|
|
2941
|
-
if (r =
|
|
2942
|
-
if (
|
|
2943
|
-
return
|
|
2944
|
-
if ((!E ||
|
|
2937
|
+
if (Array.isArray(y) && y.length === 1 && y[0].type === b.literal)
|
|
2938
|
+
return y[0].value;
|
|
2939
|
+
if (!r && y && typeof y == "string" && !p)
|
|
2940
|
+
return y.replace(/'\{(.*?)\}'/gi, "{$1}");
|
|
2941
|
+
if (r = f(f({}, p), r || {}), o = pe(o, m), l = pe(l, m), !y) {
|
|
2942
|
+
if (h === !1 && y === "")
|
|
2943
|
+
return y;
|
|
2944
|
+
if ((!E || i && i.toLowerCase() !== u.toLowerCase()) && c(new Ot(n, i)), E)
|
|
2945
2945
|
try {
|
|
2946
|
-
var I = t.getMessageFormat(E,
|
|
2946
|
+
var I = t.getMessageFormat(E, u, l, a);
|
|
2947
2947
|
return I.format(r);
|
|
2948
2948
|
} catch (T) {
|
|
2949
|
-
return
|
|
2949
|
+
return c(new W('Error formatting default message for: "'.concat(x, '", rendering default message verbatim'), i, n, T)), typeof E == "string" ? E : x;
|
|
2950
2950
|
}
|
|
2951
|
-
return
|
|
2951
|
+
return x;
|
|
2952
2952
|
}
|
|
2953
2953
|
try {
|
|
2954
|
-
var I = t.getMessageFormat(
|
|
2954
|
+
var I = t.getMessageFormat(y, i, o, f({ formatters: t }, a || {}));
|
|
2955
2955
|
return I.format(r);
|
|
2956
2956
|
} catch (T) {
|
|
2957
|
-
|
|
2957
|
+
c(new W('Error formatting message: "'.concat(x, '", using ').concat(E ? "default message" : "id", " as fallback."), i, n, T));
|
|
2958
2958
|
}
|
|
2959
2959
|
if (E)
|
|
2960
2960
|
try {
|
|
2961
|
-
var I = t.getMessageFormat(E,
|
|
2961
|
+
var I = t.getMessageFormat(E, u, l, a);
|
|
2962
2962
|
return I.format(r);
|
|
2963
2963
|
} catch (T) {
|
|
2964
|
-
|
|
2964
|
+
c(new W('Error formatting the default message for: "'.concat(x, '", rendering message verbatim'), i, n, T));
|
|
2965
2965
|
}
|
|
2966
|
-
return typeof
|
|
2967
|
-
},
|
|
2966
|
+
return typeof y == "string" ? y : typeof E == "string" ? E : x;
|
|
2967
|
+
}, Ce = [
|
|
2968
2968
|
"formatMatcher",
|
|
2969
2969
|
"timeZone",
|
|
2970
2970
|
"hour12",
|
|
@@ -2985,159 +2985,159 @@ var ve = function(e, t, n, r, i) {
|
|
|
2985
2985
|
"numberingSystem",
|
|
2986
2986
|
"fractionalSecondDigits"
|
|
2987
2987
|
];
|
|
2988
|
-
function
|
|
2989
|
-
var
|
|
2988
|
+
function j(e, t, n, r) {
|
|
2989
|
+
var a = e.locale, i = e.formats, o = e.onError, s = e.timeZone;
|
|
2990
2990
|
r === void 0 && (r = {});
|
|
2991
|
-
var
|
|
2992
|
-
return t === "time" && !
|
|
2991
|
+
var u = r.format, l = f(f({}, s && { timeZone: s }), u && re(i, t, u, o)), h = C(r, Ce, l);
|
|
2992
|
+
return t === "time" && !h.hour && !h.minute && !h.second && !h.timeStyle && !h.dateStyle && (h = f(f({}, h), { hour: "numeric", minute: "numeric" })), n(a, h);
|
|
2993
2993
|
}
|
|
2994
|
-
function
|
|
2994
|
+
function Gt(e, t) {
|
|
2995
2995
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
2996
2996
|
n[r - 2] = arguments[r];
|
|
2997
|
-
var
|
|
2997
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
2998
2998
|
try {
|
|
2999
|
-
return
|
|
3000
|
-
} catch (
|
|
3001
|
-
e.onError(new H("Error formatting date.", e.locale,
|
|
2999
|
+
return j(e, "date", t, o).format(s);
|
|
3000
|
+
} catch (u) {
|
|
3001
|
+
e.onError(new H("Error formatting date.", e.locale, u));
|
|
3002
3002
|
}
|
|
3003
3003
|
return String(s);
|
|
3004
3004
|
}
|
|
3005
|
-
function
|
|
3005
|
+
function Ut(e, t) {
|
|
3006
3006
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3007
3007
|
n[r - 2] = arguments[r];
|
|
3008
|
-
var
|
|
3008
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3009
3009
|
try {
|
|
3010
|
-
return
|
|
3011
|
-
} catch (
|
|
3012
|
-
e.onError(new H("Error formatting time.", e.locale,
|
|
3010
|
+
return j(e, "time", t, o).format(s);
|
|
3011
|
+
} catch (u) {
|
|
3012
|
+
e.onError(new H("Error formatting time.", e.locale, u));
|
|
3013
3013
|
}
|
|
3014
3014
|
return String(s);
|
|
3015
3015
|
}
|
|
3016
|
-
function
|
|
3016
|
+
function kt(e, t) {
|
|
3017
3017
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3018
3018
|
n[r - 2] = arguments[r];
|
|
3019
|
-
var
|
|
3019
|
+
var a = n[0], i = n[1], o = n[2], s = o === void 0 ? {} : o, u = e.timeZone, l = e.locale, h = e.onError, c = C(s, Ce, u ? { timeZone: u } : {});
|
|
3020
3020
|
try {
|
|
3021
|
-
return t(l,
|
|
3022
|
-
} catch (
|
|
3023
|
-
|
|
3021
|
+
return t(l, c).formatRange(a, i);
|
|
3022
|
+
} catch (m) {
|
|
3023
|
+
h(new H("Error formatting date time range.", e.locale, m));
|
|
3024
3024
|
}
|
|
3025
|
-
return String(
|
|
3025
|
+
return String(a);
|
|
3026
3026
|
}
|
|
3027
|
-
function
|
|
3027
|
+
function Vt(e, t) {
|
|
3028
3028
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3029
3029
|
n[r - 2] = arguments[r];
|
|
3030
|
-
var
|
|
3030
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3031
3031
|
try {
|
|
3032
|
-
return
|
|
3033
|
-
} catch (
|
|
3034
|
-
e.onError(new H("Error formatting date.", e.locale,
|
|
3032
|
+
return j(e, "date", t, o).formatToParts(s);
|
|
3033
|
+
} catch (u) {
|
|
3034
|
+
e.onError(new H("Error formatting date.", e.locale, u));
|
|
3035
3035
|
}
|
|
3036
3036
|
return [];
|
|
3037
3037
|
}
|
|
3038
|
-
function
|
|
3038
|
+
function jt(e, t) {
|
|
3039
3039
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3040
3040
|
n[r - 2] = arguments[r];
|
|
3041
|
-
var
|
|
3041
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3042
3042
|
try {
|
|
3043
|
-
return
|
|
3044
|
-
} catch (
|
|
3045
|
-
e.onError(new H("Error formatting time.", e.locale,
|
|
3043
|
+
return j(e, "time", t, o).formatToParts(s);
|
|
3044
|
+
} catch (u) {
|
|
3045
|
+
e.onError(new H("Error formatting time.", e.locale, u));
|
|
3046
3046
|
}
|
|
3047
3047
|
return [];
|
|
3048
3048
|
}
|
|
3049
|
-
var
|
|
3049
|
+
var Xt = [
|
|
3050
3050
|
"style",
|
|
3051
3051
|
"type",
|
|
3052
3052
|
"fallback",
|
|
3053
3053
|
"languageDisplay"
|
|
3054
3054
|
];
|
|
3055
|
-
function
|
|
3056
|
-
var
|
|
3057
|
-
o ||
|
|
3055
|
+
function Zt(e, t, n, r) {
|
|
3056
|
+
var a = e.locale, i = e.onError, o = Intl.DisplayNames;
|
|
3057
|
+
o || i(new R(`Intl.DisplayNames is not available in this environment.
|
|
3058
3058
|
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
3059
3059
|
`, _.MISSING_INTL_API));
|
|
3060
|
-
var s = C(r,
|
|
3060
|
+
var s = C(r, Xt);
|
|
3061
3061
|
try {
|
|
3062
|
-
return t(
|
|
3063
|
-
} catch (
|
|
3064
|
-
|
|
3062
|
+
return t(a, s).of(n);
|
|
3063
|
+
} catch (u) {
|
|
3064
|
+
i(new H("Error formatting display name.", a, u));
|
|
3065
3065
|
}
|
|
3066
3066
|
}
|
|
3067
|
-
var
|
|
3067
|
+
var Wt = [
|
|
3068
3068
|
"type",
|
|
3069
3069
|
"style"
|
|
3070
|
-
],
|
|
3071
|
-
function
|
|
3072
|
-
return "".concat(
|
|
3070
|
+
], ve = Date.now();
|
|
3071
|
+
function zt(e) {
|
|
3072
|
+
return "".concat(ve, "_").concat(e, "_").concat(ve);
|
|
3073
3073
|
}
|
|
3074
|
-
function
|
|
3074
|
+
function qt(e, t, n, r) {
|
|
3075
3075
|
r === void 0 && (r = {});
|
|
3076
|
-
var
|
|
3076
|
+
var a = De(e, t, n, r).reduce(function(i, o) {
|
|
3077
3077
|
var s = o.value;
|
|
3078
|
-
return typeof s != "string" ?
|
|
3078
|
+
return typeof s != "string" ? i.push(s) : typeof i[i.length - 1] == "string" ? i[i.length - 1] += s : i.push(s), i;
|
|
3079
3079
|
}, []);
|
|
3080
|
-
return
|
|
3080
|
+
return a.length === 1 ? a[0] : a.length === 0 ? "" : a;
|
|
3081
3081
|
}
|
|
3082
|
-
function
|
|
3083
|
-
var
|
|
3082
|
+
function De(e, t, n, r) {
|
|
3083
|
+
var a = e.locale, i = e.onError;
|
|
3084
3084
|
r === void 0 && (r = {});
|
|
3085
3085
|
var o = Intl.ListFormat;
|
|
3086
|
-
o ||
|
|
3086
|
+
o || i(new R(`Intl.ListFormat is not available in this environment.
|
|
3087
3087
|
Try polyfilling it using "@formatjs/intl-listformat"
|
|
3088
3088
|
`, _.MISSING_INTL_API));
|
|
3089
|
-
var s = C(r,
|
|
3089
|
+
var s = C(r, Wt);
|
|
3090
3090
|
try {
|
|
3091
|
-
var
|
|
3092
|
-
if (typeof
|
|
3093
|
-
var
|
|
3094
|
-
return
|
|
3091
|
+
var u = {}, l = n.map(function(h, c) {
|
|
3092
|
+
if (typeof h == "object") {
|
|
3093
|
+
var m = zt(c);
|
|
3094
|
+
return u[m] = h, m;
|
|
3095
3095
|
}
|
|
3096
|
-
return String(
|
|
3096
|
+
return String(h);
|
|
3097
3097
|
});
|
|
3098
|
-
return t(
|
|
3099
|
-
return
|
|
3098
|
+
return t(a, s).formatToParts(l).map(function(h) {
|
|
3099
|
+
return h.type === "literal" ? h : f(f({}, h), { value: u[h.value] || h.value });
|
|
3100
3100
|
});
|
|
3101
|
-
} catch (
|
|
3102
|
-
|
|
3101
|
+
} catch (h) {
|
|
3102
|
+
i(new H("Error formatting list.", a, h));
|
|
3103
3103
|
}
|
|
3104
3104
|
return n;
|
|
3105
3105
|
}
|
|
3106
|
-
var
|
|
3107
|
-
function
|
|
3108
|
-
var
|
|
3109
|
-
r === void 0 && (r = {}), Intl.PluralRules ||
|
|
3106
|
+
var Jt = ["type"];
|
|
3107
|
+
function Qt(e, t, n, r) {
|
|
3108
|
+
var a = e.locale, i = e.onError;
|
|
3109
|
+
r === void 0 && (r = {}), Intl.PluralRules || i(new R(`Intl.PluralRules is not available in this environment.
|
|
3110
3110
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3111
3111
|
`, _.MISSING_INTL_API));
|
|
3112
|
-
var o = C(r,
|
|
3112
|
+
var o = C(r, Jt);
|
|
3113
3113
|
try {
|
|
3114
|
-
return t(
|
|
3114
|
+
return t(a, o).select(n);
|
|
3115
3115
|
} catch (s) {
|
|
3116
|
-
|
|
3116
|
+
i(new H("Error formatting plural.", a, s));
|
|
3117
3117
|
}
|
|
3118
3118
|
return "other";
|
|
3119
3119
|
}
|
|
3120
|
-
var
|
|
3121
|
-
function
|
|
3122
|
-
var r = e.locale,
|
|
3120
|
+
var Yt = ["numeric", "style"];
|
|
3121
|
+
function $t(e, t, n) {
|
|
3122
|
+
var r = e.locale, a = e.formats, i = e.onError;
|
|
3123
3123
|
n === void 0 && (n = {});
|
|
3124
|
-
var o = n.format, s = !!o &&
|
|
3125
|
-
return t(r,
|
|
3124
|
+
var o = n.format, s = !!o && re(a, "relative", o, i) || {}, u = C(n, Yt, s);
|
|
3125
|
+
return t(r, u);
|
|
3126
3126
|
}
|
|
3127
|
-
function
|
|
3128
|
-
|
|
3129
|
-
var
|
|
3130
|
-
|
|
3127
|
+
function Kt(e, t, n, r, a) {
|
|
3128
|
+
a === void 0 && (a = {}), r || (r = "second");
|
|
3129
|
+
var i = Intl.RelativeTimeFormat;
|
|
3130
|
+
i || e.onError(new R(`Intl.RelativeTimeFormat is not available in this environment.
|
|
3131
3131
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
3132
3132
|
`, _.MISSING_INTL_API));
|
|
3133
3133
|
try {
|
|
3134
|
-
return
|
|
3134
|
+
return $t(e, t, a).format(n, r);
|
|
3135
3135
|
} catch (o) {
|
|
3136
3136
|
e.onError(new H("Error formatting relative time.", e.locale, o));
|
|
3137
3137
|
}
|
|
3138
3138
|
return String(n);
|
|
3139
3139
|
}
|
|
3140
|
-
var
|
|
3140
|
+
var er = [
|
|
3141
3141
|
"style",
|
|
3142
3142
|
"currency",
|
|
3143
3143
|
"currencyDisplay",
|
|
@@ -3159,145 +3159,97 @@ var ir = [
|
|
|
3159
3159
|
"unitDisplay",
|
|
3160
3160
|
"numberingSystem"
|
|
3161
3161
|
];
|
|
3162
|
-
function
|
|
3163
|
-
var r = e.locale,
|
|
3162
|
+
function we(e, t, n) {
|
|
3163
|
+
var r = e.locale, a = e.formats, i = e.onError;
|
|
3164
3164
|
n === void 0 && (n = {});
|
|
3165
|
-
var o = n.format, s = o &&
|
|
3166
|
-
return t(r,
|
|
3165
|
+
var o = n.format, s = o && re(a, "number", o, i) || {}, u = C(n, er, s);
|
|
3166
|
+
return t(r, u);
|
|
3167
3167
|
}
|
|
3168
|
-
function
|
|
3168
|
+
function tr(e, t, n, r) {
|
|
3169
3169
|
r === void 0 && (r = {});
|
|
3170
3170
|
try {
|
|
3171
|
-
return
|
|
3172
|
-
} catch (
|
|
3173
|
-
e.onError(new H("Error formatting number.", e.locale,
|
|
3171
|
+
return we(e, t, r).format(n);
|
|
3172
|
+
} catch (a) {
|
|
3173
|
+
e.onError(new H("Error formatting number.", e.locale, a));
|
|
3174
3174
|
}
|
|
3175
3175
|
return String(n);
|
|
3176
3176
|
}
|
|
3177
|
-
function
|
|
3177
|
+
function rr(e, t, n, r) {
|
|
3178
3178
|
r === void 0 && (r = {});
|
|
3179
3179
|
try {
|
|
3180
|
-
return
|
|
3181
|
-
} catch (
|
|
3182
|
-
e.onError(new H("Error formatting number.", e.locale,
|
|
3180
|
+
return we(e, t, r).formatToParts(n);
|
|
3181
|
+
} catch (a) {
|
|
3182
|
+
e.onError(new H("Error formatting number.", e.locale, a));
|
|
3183
3183
|
}
|
|
3184
3184
|
return [];
|
|
3185
3185
|
}
|
|
3186
|
-
function
|
|
3186
|
+
function nr(e) {
|
|
3187
3187
|
var t = e ? e[Object.keys(e)[0]] : void 0;
|
|
3188
3188
|
return typeof t == "string";
|
|
3189
3189
|
}
|
|
3190
|
-
function
|
|
3191
|
-
e.onWarn && e.defaultRichTextElements &&
|
|
3190
|
+
function ar(e) {
|
|
3191
|
+
e.onWarn && e.defaultRichTextElements && nr(e.messages || {}) && e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
3192
3192
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
3193
3193
|
For more details see https://formatjs.io/docs/getting-started/message-distribution`);
|
|
3194
3194
|
}
|
|
3195
|
-
function
|
|
3196
|
-
var n =
|
|
3197
|
-
return
|
|
3195
|
+
function ir(e, t) {
|
|
3196
|
+
var n = wt(t), r = f(f({}, Dt), e), a = r.locale, i = r.defaultLocale, o = r.onError;
|
|
3197
|
+
return a ? !Intl.NumberFormat.supportedLocalesOf(a).length && o ? o(new me('Missing locale data for locale: "'.concat(a, '" in Intl.NumberFormat. Using default locale: "').concat(i, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : !Intl.DateTimeFormat.supportedLocalesOf(a).length && o && o(new me('Missing locale data for locale: "'.concat(a, '" in Intl.DateTimeFormat. Using default locale: "').concat(i, '" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))) : (o && o(new Lt('"locale" was not configured, using "'.concat(i, '" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))), r.locale = r.defaultLocale || "en"), ar(r), f(f({}, r), {
|
|
3198
3198
|
formatters: n,
|
|
3199
|
-
formatNumber:
|
|
3200
|
-
formatNumberToParts:
|
|
3201
|
-
formatRelativeTime:
|
|
3202
|
-
formatDate:
|
|
3203
|
-
formatDateToParts:
|
|
3204
|
-
formatTime:
|
|
3205
|
-
formatDateTimeRange:
|
|
3206
|
-
formatTimeToParts:
|
|
3207
|
-
formatPlural:
|
|
3199
|
+
formatNumber: tr.bind(null, r, n.getNumberFormat),
|
|
3200
|
+
formatNumberToParts: rr.bind(null, r, n.getNumberFormat),
|
|
3201
|
+
formatRelativeTime: Kt.bind(null, r, n.getRelativeTimeFormat),
|
|
3202
|
+
formatDate: Gt.bind(null, r, n.getDateTimeFormat),
|
|
3203
|
+
formatDateToParts: Vt.bind(null, r, n.getDateTimeFormat),
|
|
3204
|
+
formatTime: Ut.bind(null, r, n.getDateTimeFormat),
|
|
3205
|
+
formatDateTimeRange: kt.bind(null, r, n.getDateTimeFormat),
|
|
3206
|
+
formatTimeToParts: jt.bind(null, r, n.getDateTimeFormat),
|
|
3207
|
+
formatPlural: Qt.bind(null, r, n.getPluralRules),
|
|
3208
3208
|
// @ts-expect-error TODO: will get to this later
|
|
3209
|
-
formatMessage:
|
|
3209
|
+
formatMessage: ge.bind(null, r, n),
|
|
3210
3210
|
// @ts-expect-error TODO: will get to this later
|
|
3211
|
-
$t:
|
|
3212
|
-
formatList:
|
|
3213
|
-
formatListToParts:
|
|
3214
|
-
formatDisplayName:
|
|
3211
|
+
$t: ge.bind(null, r, n),
|
|
3212
|
+
formatList: qt.bind(null, r, n.getListFormat),
|
|
3213
|
+
formatListToParts: De.bind(null, r, n.getListFormat),
|
|
3214
|
+
formatDisplayName: Zt.bind(null, r, n.getDisplayNames)
|
|
3215
3215
|
});
|
|
3216
3216
|
}
|
|
3217
|
-
|
|
3218
|
-
F.flatten = F;
|
|
3219
|
-
F.unflatten = je;
|
|
3220
|
-
function Ge(e) {
|
|
3217
|
+
function or(e) {
|
|
3221
3218
|
return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
3222
3219
|
}
|
|
3223
|
-
function
|
|
3220
|
+
function sr(e) {
|
|
3224
3221
|
return e;
|
|
3225
3222
|
}
|
|
3226
|
-
function
|
|
3223
|
+
function ur(e, t) {
|
|
3227
3224
|
t = t || {};
|
|
3228
|
-
const n = t.delimiter || ".", r = t.maxDepth,
|
|
3229
|
-
function o(s,
|
|
3230
|
-
l = l || 1, Object.keys(s).forEach(function(
|
|
3231
|
-
const
|
|
3232
|
-
if (!
|
|
3233
|
-
return o(
|
|
3234
|
-
|
|
3225
|
+
const n = t.delimiter || ".", r = t.maxDepth, a = t.transformKey || sr, i = {};
|
|
3226
|
+
function o(s, u, l) {
|
|
3227
|
+
l = l || 1, Object.keys(s).forEach(function(h) {
|
|
3228
|
+
const c = s[h], m = t.safe && Array.isArray(c), p = Object.prototype.toString.call(c), d = or(c), E = p === "[object Object]" || p === "[object Array]", x = u ? u + n + a(h) : a(h);
|
|
3229
|
+
if (!m && !d && E && Object.keys(c).length && (!t.maxDepth || l < r))
|
|
3230
|
+
return o(c, x, l + 1);
|
|
3231
|
+
i[x] = c;
|
|
3235
3232
|
});
|
|
3236
3233
|
}
|
|
3237
|
-
return o(e),
|
|
3238
|
-
}
|
|
3239
|
-
function je(e, t) {
|
|
3240
|
-
t = t || {};
|
|
3241
|
-
const n = t.delimiter || ".", r = t.overwrite || !1, i = t.transformKey || Ue, a = {};
|
|
3242
|
-
if (Ge(e) || Object.prototype.toString.call(e) !== "[object Object]")
|
|
3243
|
-
return e;
|
|
3244
|
-
function s(u) {
|
|
3245
|
-
const f = Number(u);
|
|
3246
|
-
return isNaN(f) || u.indexOf(".") !== -1 || t.object ? u : f;
|
|
3247
|
-
}
|
|
3248
|
-
function h(u, f, c) {
|
|
3249
|
-
return Object.keys(c).reduce(function(p, v) {
|
|
3250
|
-
return p[u + n + v] = c[v], p;
|
|
3251
|
-
}, f);
|
|
3252
|
-
}
|
|
3253
|
-
function l(u) {
|
|
3254
|
-
const f = Object.prototype.toString.call(u), c = f === "[object Array]", p = f === "[object Object]";
|
|
3255
|
-
if (u) {
|
|
3256
|
-
if (c)
|
|
3257
|
-
return !u.length;
|
|
3258
|
-
if (p)
|
|
3259
|
-
return !Object.keys(u).length;
|
|
3260
|
-
} else
|
|
3261
|
-
return !0;
|
|
3262
|
-
}
|
|
3263
|
-
return e = Object.keys(e).reduce(function(u, f) {
|
|
3264
|
-
const c = Object.prototype.toString.call(e[f]);
|
|
3265
|
-
return !(c === "[object Object]" || c === "[object Array]") || l(e[f]) ? (u[f] = e[f], u) : h(
|
|
3266
|
-
f,
|
|
3267
|
-
u,
|
|
3268
|
-
F(e[f], t)
|
|
3269
|
-
);
|
|
3270
|
-
}, {}), Object.keys(e).forEach(function(u) {
|
|
3271
|
-
const f = u.split(n).map(i);
|
|
3272
|
-
let c = s(f.shift()), p = s(f[0]), v = a;
|
|
3273
|
-
for (; p !== void 0; ) {
|
|
3274
|
-
if (c === "__proto__")
|
|
3275
|
-
return;
|
|
3276
|
-
const E = Object.prototype.toString.call(v[c]), y = E === "[object Object]" || E === "[object Array]";
|
|
3277
|
-
if (!r && !y && typeof v[c] < "u")
|
|
3278
|
-
return;
|
|
3279
|
-
(r && !y || !r && v[c] == null) && (v[c] = typeof p == "number" && !t.object ? [] : {}), v = v[c], f.length > 0 && (c = s(f.shift()), p = s(f[0]));
|
|
3280
|
-
}
|
|
3281
|
-
v[c] = je(e[u], t);
|
|
3282
|
-
}), a;
|
|
3234
|
+
return o(e), i;
|
|
3283
3235
|
}
|
|
3284
|
-
const
|
|
3285
|
-
let
|
|
3286
|
-
const
|
|
3287
|
-
const r =
|
|
3236
|
+
const hr = Me();
|
|
3237
|
+
let Fe;
|
|
3238
|
+
const mr = (e, t, n = !1) => {
|
|
3239
|
+
const r = ir(
|
|
3288
3240
|
{
|
|
3289
3241
|
...typeof n == "boolean" ? null : n,
|
|
3290
3242
|
locale: e,
|
|
3291
|
-
messages:
|
|
3243
|
+
messages: ur(t, {
|
|
3292
3244
|
safe: !0
|
|
3293
3245
|
// Preserve arrays
|
|
3294
3246
|
})
|
|
3295
3247
|
},
|
|
3296
|
-
|
|
3297
|
-
), { $t:
|
|
3298
|
-
const
|
|
3248
|
+
hr
|
|
3249
|
+
), { $t: a, ...i } = r, o = i, s = (p) => {
|
|
3250
|
+
const d = "Invalid Date";
|
|
3299
3251
|
if (!p)
|
|
3300
|
-
return
|
|
3252
|
+
return d;
|
|
3301
3253
|
try {
|
|
3302
3254
|
const E = new Date(p * 1e3);
|
|
3303
3255
|
return o.formatDate(E, {
|
|
@@ -3308,26 +3260,26 @@ const pr = (e, t, n = !1) => {
|
|
|
3308
3260
|
minute: "numeric"
|
|
3309
3261
|
});
|
|
3310
3262
|
} catch {
|
|
3311
|
-
return
|
|
3263
|
+
return d;
|
|
3312
3264
|
}
|
|
3313
|
-
},
|
|
3265
|
+
}, m = {
|
|
3314
3266
|
formatUnixTimeStamp: s,
|
|
3315
3267
|
formatIsoDate: (p) => {
|
|
3316
|
-
const
|
|
3317
|
-
return s(
|
|
3268
|
+
const d = Date.parse(p) / 1e3;
|
|
3269
|
+
return s(d);
|
|
3318
3270
|
},
|
|
3319
|
-
t: (p,
|
|
3271
|
+
t: (p, d, E) => o.formatMessage({ id: p }, d, E),
|
|
3320
3272
|
te: (p) => !!o.messages[p],
|
|
3321
3273
|
tm: (p) => o.messages[p] || [],
|
|
3322
3274
|
...o,
|
|
3323
3275
|
source: t
|
|
3324
3276
|
};
|
|
3325
|
-
return (typeof n == "boolean" && n === !0 || typeof n != "boolean" && n.isGlobal === !0) && (
|
|
3277
|
+
return (typeof n == "boolean" && n === !0 || typeof n != "boolean" && n.isGlobal === !0) && (Fe = m), m;
|
|
3326
3278
|
};
|
|
3327
|
-
function
|
|
3328
|
-
return
|
|
3279
|
+
function cr() {
|
|
3280
|
+
return Fe;
|
|
3329
3281
|
}
|
|
3330
|
-
const
|
|
3282
|
+
const lr = (e = null) => Ge({
|
|
3331
3283
|
name: "I18nT",
|
|
3332
3284
|
props: {
|
|
3333
3285
|
i18n: {
|
|
@@ -3345,32 +3297,32 @@ const cr = (e = null) => ke({
|
|
|
3345
3297
|
}
|
|
3346
3298
|
},
|
|
3347
3299
|
setup(t, { slots: n }) {
|
|
3348
|
-
const r = (
|
|
3349
|
-
if (!
|
|
3300
|
+
const r = (a) => {
|
|
3301
|
+
if (!a)
|
|
3350
3302
|
return [];
|
|
3351
|
-
const
|
|
3352
|
-
return
|
|
3303
|
+
const i = /(\{[^}]+\})/g;
|
|
3304
|
+
return a.split(i).filter(Boolean);
|
|
3353
3305
|
};
|
|
3354
3306
|
return () => {
|
|
3355
|
-
const
|
|
3356
|
-
let o = r(
|
|
3357
|
-
return o = o.filter((s) => s !== ""), o.forEach((s,
|
|
3307
|
+
const a = Object.keys(n).filter((s) => s !== "_"), i = (e || t.i18n).messages[t.keypath].toString();
|
|
3308
|
+
let o = r(i);
|
|
3309
|
+
return o = o.filter((s) => s !== ""), o.forEach((s, u) => {
|
|
3358
3310
|
if (!s.startsWith("{") && !s.endsWith("}"))
|
|
3359
3311
|
return;
|
|
3360
3312
|
const l = s.replace(/[\{\}]/g, "");
|
|
3361
|
-
l === "0" && n.default ? o[
|
|
3362
|
-
}),
|
|
3313
|
+
l === "0" && n.default ? o[u] = n.default() : a.includes(l) && n[l] && (o[u] = n[l]());
|
|
3314
|
+
}), Ue(t.tag, t, o);
|
|
3363
3315
|
};
|
|
3364
3316
|
}
|
|
3365
|
-
}),
|
|
3317
|
+
}), pr = {
|
|
3366
3318
|
install(e, t) {
|
|
3367
3319
|
const { i18n: n } = t;
|
|
3368
|
-
e.component("I18nT",
|
|
3320
|
+
e.component("I18nT", lr(n));
|
|
3369
3321
|
}
|
|
3370
3322
|
};
|
|
3371
3323
|
export {
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3324
|
+
pr as Translation,
|
|
3325
|
+
mr as createI18n,
|
|
3326
|
+
lr as i18nTComponent,
|
|
3327
|
+
cr as useI18n
|
|
3376
3328
|
};
|