@kong-ui-public/i18n 2.2.3-pr.1430.f58edae3.0 → 2.2.3
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 +697 -673
- package/dist/i18n.umd.js +10 -10
- package/dist/types/Translation.d.ts.map +1 -1
- package/dist/types/i18n.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/i18n.es.js
CHANGED
|
@@ -1,95 +1,121 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
var
|
|
3
|
-
return
|
|
1
|
+
import { defineComponent as Xe, h as We } from "vue";
|
|
2
|
+
var q = function(e, t) {
|
|
3
|
+
return q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
4
4
|
n.__proto__ = r;
|
|
5
5
|
} || function(n, r) {
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
}, z(e, t);
|
|
6
|
+
for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (n[a] = r[a]);
|
|
7
|
+
}, q(e, t);
|
|
9
8
|
};
|
|
10
|
-
function
|
|
9
|
+
function M(e, t) {
|
|
11
10
|
if (typeof t != "function" && t !== null)
|
|
12
11
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
13
|
-
|
|
12
|
+
q(e, t);
|
|
14
13
|
function n() {
|
|
15
14
|
this.constructor = e;
|
|
16
15
|
}
|
|
17
16
|
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
18
17
|
}
|
|
19
|
-
var
|
|
20
|
-
return
|
|
21
|
-
for (var n, r = 1,
|
|
18
|
+
var m = function() {
|
|
19
|
+
return m = Object.assign || function(t) {
|
|
20
|
+
for (var n, r = 1, a = arguments.length; r < a; r++) {
|
|
22
21
|
n = arguments[r];
|
|
23
|
-
for (var
|
|
24
|
-
Object.prototype.hasOwnProperty.call(n, a) && (t[a] = n[a]);
|
|
22
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
25
23
|
}
|
|
26
24
|
return t;
|
|
27
|
-
},
|
|
25
|
+
}, m.apply(this, arguments);
|
|
28
26
|
};
|
|
29
|
-
function
|
|
27
|
+
function w(e, t, n) {
|
|
28
|
+
if (n || arguments.length === 2) for (var r = 0, a = t.length, i; r < a; r++)
|
|
29
|
+
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
30
|
+
return e.concat(i || Array.prototype.slice.call(t));
|
|
31
|
+
}
|
|
32
|
+
var Q = function(e, t) {
|
|
33
|
+
return Q = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
34
|
+
n.__proto__ = r;
|
|
35
|
+
} || function(n, r) {
|
|
36
|
+
for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (n[a] = r[a]);
|
|
37
|
+
}, Q(e, t);
|
|
38
|
+
};
|
|
39
|
+
function X(e, t) {
|
|
40
|
+
if (typeof t != "function" && t !== null)
|
|
41
|
+
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
42
|
+
Q(e, t);
|
|
43
|
+
function n() {
|
|
44
|
+
this.constructor = e;
|
|
45
|
+
}
|
|
46
|
+
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
|
|
47
|
+
}
|
|
48
|
+
var N = function() {
|
|
49
|
+
return N = Object.assign || function(t) {
|
|
50
|
+
for (var n, r = 1, a = arguments.length; r < a; r++) {
|
|
51
|
+
n = arguments[r];
|
|
52
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
}, N.apply(this, arguments);
|
|
56
|
+
};
|
|
57
|
+
function Ze(e, t) {
|
|
30
58
|
var n = {};
|
|
31
|
-
for (var r in e)
|
|
32
|
-
Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
59
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
33
60
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
34
|
-
for (var
|
|
35
|
-
t.indexOf(r[
|
|
61
|
+
for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
|
|
62
|
+
t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
|
|
36
63
|
return n;
|
|
37
64
|
}
|
|
38
|
-
function
|
|
39
|
-
if (n || arguments.length === 2)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return e.concat(a || Array.prototype.slice.call(t));
|
|
65
|
+
function Z(e, t, n) {
|
|
66
|
+
if (n || arguments.length === 2) for (var r = 0, a = t.length, i; r < a; r++)
|
|
67
|
+
(i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
|
|
68
|
+
return e.concat(i || Array.prototype.slice.call(t));
|
|
43
69
|
}
|
|
44
|
-
var
|
|
70
|
+
var p;
|
|
45
71
|
(function(e) {
|
|
46
72
|
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
|
-
})(
|
|
48
|
-
var
|
|
73
|
+
})(p || (p = {}));
|
|
74
|
+
var b;
|
|
49
75
|
(function(e) {
|
|
50
76
|
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
|
-
})(
|
|
77
|
+
})(b || (b = {}));
|
|
52
78
|
var D;
|
|
53
79
|
(function(e) {
|
|
54
80
|
e[e.number = 0] = "number", e[e.dateTime = 1] = "dateTime";
|
|
55
81
|
})(D || (D = {}));
|
|
56
|
-
function
|
|
57
|
-
return e.type ===
|
|
82
|
+
function ue(e) {
|
|
83
|
+
return e.type === b.literal;
|
|
58
84
|
}
|
|
59
|
-
function
|
|
60
|
-
return e.type ===
|
|
85
|
+
function ze(e) {
|
|
86
|
+
return e.type === b.argument;
|
|
61
87
|
}
|
|
62
|
-
function
|
|
63
|
-
return e.type ===
|
|
88
|
+
function Te(e) {
|
|
89
|
+
return e.type === b.number;
|
|
64
90
|
}
|
|
65
|
-
function
|
|
66
|
-
return e.type ===
|
|
91
|
+
function Se(e) {
|
|
92
|
+
return e.type === b.date;
|
|
67
93
|
}
|
|
68
|
-
function
|
|
69
|
-
return e.type ===
|
|
94
|
+
function He(e) {
|
|
95
|
+
return e.type === b.time;
|
|
70
96
|
}
|
|
71
|
-
function
|
|
72
|
-
return e.type ===
|
|
97
|
+
function Ie(e) {
|
|
98
|
+
return e.type === b.select;
|
|
73
99
|
}
|
|
74
|
-
function
|
|
75
|
-
return e.type ===
|
|
100
|
+
function Ae(e) {
|
|
101
|
+
return e.type === b.plural;
|
|
76
102
|
}
|
|
77
|
-
function
|
|
78
|
-
return e.type ===
|
|
103
|
+
function $e(e) {
|
|
104
|
+
return e.type === b.pound;
|
|
79
105
|
}
|
|
80
|
-
function
|
|
81
|
-
return e.type ===
|
|
106
|
+
function _e(e) {
|
|
107
|
+
return e.type === b.tag;
|
|
82
108
|
}
|
|
83
|
-
function
|
|
109
|
+
function Ne(e) {
|
|
84
110
|
return !!(e && typeof e == "object" && e.type === D.number);
|
|
85
111
|
}
|
|
86
|
-
function
|
|
112
|
+
function Y(e) {
|
|
87
113
|
return !!(e && typeof e == "object" && e.type === D.dateTime);
|
|
88
114
|
}
|
|
89
|
-
var
|
|
90
|
-
function
|
|
115
|
+
var Be = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/, Je = /(?:[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;
|
|
116
|
+
function qe(e) {
|
|
91
117
|
var t = {};
|
|
92
|
-
return e.replace(
|
|
118
|
+
return e.replace(Je, function(n) {
|
|
93
119
|
var r = n.length;
|
|
94
120
|
switch (n[0]) {
|
|
95
121
|
case "G":
|
|
@@ -178,36 +204,36 @@ function Ze(e) {
|
|
|
178
204
|
return "";
|
|
179
205
|
}), t;
|
|
180
206
|
}
|
|
181
|
-
var
|
|
182
|
-
function
|
|
207
|
+
var Qe = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
208
|
+
function Ye(e) {
|
|
183
209
|
if (e.length === 0)
|
|
184
210
|
throw new Error("Number skeleton cannot be empty");
|
|
185
|
-
for (var t = e.split(
|
|
211
|
+
for (var t = e.split(Qe).filter(function(c) {
|
|
186
212
|
return c.length > 0;
|
|
187
|
-
}), n = [], r = 0,
|
|
188
|
-
var
|
|
213
|
+
}), n = [], r = 0, a = t; r < a.length; r++) {
|
|
214
|
+
var i = a[r], o = i.split("/");
|
|
189
215
|
if (o.length === 0)
|
|
190
216
|
throw new Error("Invalid number skeleton");
|
|
191
217
|
for (var s = o[0], u = o.slice(1), l = 0, h = u; l < h.length; l++) {
|
|
192
|
-
var
|
|
193
|
-
if (
|
|
218
|
+
var f = h[l];
|
|
219
|
+
if (f.length === 0)
|
|
194
220
|
throw new Error("Invalid number skeleton");
|
|
195
221
|
}
|
|
196
222
|
n.push({ stem: s, options: u });
|
|
197
223
|
}
|
|
198
224
|
return n;
|
|
199
225
|
}
|
|
200
|
-
function
|
|
226
|
+
function Ke(e) {
|
|
201
227
|
return e.replace(/^(.*?)-/, "");
|
|
202
228
|
}
|
|
203
|
-
var
|
|
204
|
-
function
|
|
229
|
+
var he = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g, Pe = /^(@+)?(\+|#+)?[rs]?$/g, et = /(\*)(0+)|(#+)(0+)|(0+)/g, Oe = /^(0+)$/;
|
|
230
|
+
function le(e) {
|
|
205
231
|
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
|
|
232
|
+
return e[e.length - 1] === "r" ? t.roundingPriority = "morePrecision" : e[e.length - 1] === "s" && (t.roundingPriority = "lessPrecision"), e.replace(Pe, function(n, r, a) {
|
|
233
|
+
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
234
|
}), t;
|
|
209
235
|
}
|
|
210
|
-
function
|
|
236
|
+
function Re(e) {
|
|
211
237
|
switch (e) {
|
|
212
238
|
case "sign-auto":
|
|
213
239
|
return {
|
|
@@ -247,7 +273,7 @@ function Be(e) {
|
|
|
247
273
|
};
|
|
248
274
|
}
|
|
249
275
|
}
|
|
250
|
-
function
|
|
276
|
+
function tt(e) {
|
|
251
277
|
var t;
|
|
252
278
|
if (e[0] === "E" && e[1] === "E" ? (t = {
|
|
253
279
|
notation: "engineering"
|
|
@@ -255,20 +281,20 @@ function Ye(e) {
|
|
|
255
281
|
notation: "scientific"
|
|
256
282
|
}, e = e.slice(1)), t) {
|
|
257
283
|
var n = e.slice(0, 2);
|
|
258
|
-
if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !
|
|
284
|
+
if (n === "+!" ? (t.signDisplay = "always", e = e.slice(2)) : n === "+?" && (t.signDisplay = "exceptZero", e = e.slice(2)), !Oe.test(e))
|
|
259
285
|
throw new Error("Malformed concise eng/scientific notation");
|
|
260
286
|
t.minimumIntegerDigits = e.length;
|
|
261
287
|
}
|
|
262
288
|
return t;
|
|
263
289
|
}
|
|
264
|
-
function
|
|
265
|
-
var t = {}, n =
|
|
290
|
+
function fe(e) {
|
|
291
|
+
var t = {}, n = Re(e);
|
|
266
292
|
return n || t;
|
|
267
293
|
}
|
|
268
|
-
function
|
|
294
|
+
function rt(e) {
|
|
269
295
|
for (var t = {}, n = 0, r = e; n < r.length; n++) {
|
|
270
|
-
var
|
|
271
|
-
switch (
|
|
296
|
+
var a = r[n];
|
|
297
|
+
switch (a.stem) {
|
|
272
298
|
case "percent":
|
|
273
299
|
case "%":
|
|
274
300
|
t.style = "percent";
|
|
@@ -277,7 +303,7 @@ function $e(e) {
|
|
|
277
303
|
t.style = "percent", t.scale = 100;
|
|
278
304
|
continue;
|
|
279
305
|
case "currency":
|
|
280
|
-
t.style = "currency", t.currency =
|
|
306
|
+
t.style = "currency", t.currency = a.options[0];
|
|
281
307
|
continue;
|
|
282
308
|
case "group-off":
|
|
283
309
|
case ",_":
|
|
@@ -289,7 +315,7 @@ function $e(e) {
|
|
|
289
315
|
continue;
|
|
290
316
|
case "measure-unit":
|
|
291
317
|
case "unit":
|
|
292
|
-
t.style = "unit", t.unit =
|
|
318
|
+
t.style = "unit", t.unit = Ke(a.options[0]);
|
|
293
319
|
continue;
|
|
294
320
|
case "compact-short":
|
|
295
321
|
case "K":
|
|
@@ -300,13 +326,13 @@ function $e(e) {
|
|
|
300
326
|
t.notation = "compact", t.compactDisplay = "long";
|
|
301
327
|
continue;
|
|
302
328
|
case "scientific":
|
|
303
|
-
t =
|
|
304
|
-
return
|
|
329
|
+
t = m(m(m({}, t), { notation: "scientific" }), a.options.reduce(function(u, l) {
|
|
330
|
+
return m(m({}, u), fe(l));
|
|
305
331
|
}, {}));
|
|
306
332
|
continue;
|
|
307
333
|
case "engineering":
|
|
308
|
-
t =
|
|
309
|
-
return
|
|
334
|
+
t = m(m(m({}, t), { notation: "engineering" }), a.options.reduce(function(u, l) {
|
|
335
|
+
return m(m({}, u), fe(l));
|
|
310
336
|
}, {}));
|
|
311
337
|
continue;
|
|
312
338
|
case "notation-simple":
|
|
@@ -325,7 +351,7 @@ function $e(e) {
|
|
|
325
351
|
t.currencyDisplay = "symbol";
|
|
326
352
|
continue;
|
|
327
353
|
case "scale":
|
|
328
|
-
t.scale = parseFloat(
|
|
354
|
+
t.scale = parseFloat(a.options[0]);
|
|
329
355
|
continue;
|
|
330
356
|
case "rounding-mode-floor":
|
|
331
357
|
t.roundingMode = "floor";
|
|
@@ -349,13 +375,13 @@ function $e(e) {
|
|
|
349
375
|
t.roundingMode = "halfExpand";
|
|
350
376
|
continue;
|
|
351
377
|
case "integer-width":
|
|
352
|
-
if (
|
|
378
|
+
if (a.options.length > 1)
|
|
353
379
|
throw new RangeError("integer-width stems only accept a single optional option");
|
|
354
|
-
|
|
380
|
+
a.options[0].replace(et, function(u, l, h, f, c, E) {
|
|
355
381
|
if (l)
|
|
356
382
|
t.minimumIntegerDigits = h.length;
|
|
357
383
|
else {
|
|
358
|
-
if (
|
|
384
|
+
if (f && c)
|
|
359
385
|
throw new Error("We currently do not support maximum integer digits");
|
|
360
386
|
if (E)
|
|
361
387
|
throw new Error("We currently do not support exact integer digits");
|
|
@@ -364,32 +390,32 @@ function $e(e) {
|
|
|
364
390
|
});
|
|
365
391
|
continue;
|
|
366
392
|
}
|
|
367
|
-
if (
|
|
368
|
-
t.minimumIntegerDigits =
|
|
393
|
+
if (Oe.test(a.stem)) {
|
|
394
|
+
t.minimumIntegerDigits = a.stem.length;
|
|
369
395
|
continue;
|
|
370
396
|
}
|
|
371
|
-
if (
|
|
372
|
-
if (
|
|
397
|
+
if (he.test(a.stem)) {
|
|
398
|
+
if (a.options.length > 1)
|
|
373
399
|
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
374
|
-
|
|
375
|
-
return h === "*" ? t.minimumFractionDigits = l.length :
|
|
400
|
+
a.stem.replace(he, function(u, l, h, f, c, E) {
|
|
401
|
+
return h === "*" ? t.minimumFractionDigits = l.length : f && f[0] === "#" ? t.maximumFractionDigits = f.length : c && E ? (t.minimumFractionDigits = c.length, t.maximumFractionDigits = c.length + E.length) : (t.minimumFractionDigits = l.length, t.maximumFractionDigits = l.length), "";
|
|
376
402
|
});
|
|
377
|
-
var
|
|
378
|
-
|
|
403
|
+
var i = a.options[0];
|
|
404
|
+
i === "w" ? t = m(m({}, t), { trailingZeroDisplay: "stripIfInteger" }) : i && (t = m(m({}, t), le(i)));
|
|
379
405
|
continue;
|
|
380
406
|
}
|
|
381
|
-
if (
|
|
382
|
-
t =
|
|
407
|
+
if (Pe.test(a.stem)) {
|
|
408
|
+
t = m(m({}, t), le(a.stem));
|
|
383
409
|
continue;
|
|
384
410
|
}
|
|
385
|
-
var o =
|
|
386
|
-
o && (t =
|
|
387
|
-
var s =
|
|
388
|
-
s && (t =
|
|
411
|
+
var o = Re(a.stem);
|
|
412
|
+
o && (t = m(m({}, t), o));
|
|
413
|
+
var s = tt(a.stem);
|
|
414
|
+
s && (t = m(m({}, t), s));
|
|
389
415
|
}
|
|
390
416
|
return t;
|
|
391
417
|
}
|
|
392
|
-
var
|
|
418
|
+
var V = {
|
|
393
419
|
"001": [
|
|
394
420
|
"H",
|
|
395
421
|
"h"
|
|
@@ -1798,23 +1824,22 @@ var U = {
|
|
|
1798
1824
|
"h"
|
|
1799
1825
|
]
|
|
1800
1826
|
};
|
|
1801
|
-
function
|
|
1827
|
+
function nt(e, t) {
|
|
1802
1828
|
for (var n = "", r = 0; r < e.length; r++) {
|
|
1803
|
-
var
|
|
1804
|
-
if (
|
|
1805
|
-
for (var
|
|
1806
|
-
|
|
1807
|
-
var o = 1 + (
|
|
1829
|
+
var a = e.charAt(r);
|
|
1830
|
+
if (a === "j") {
|
|
1831
|
+
for (var i = 0; r + 1 < e.length && e.charAt(r + 1) === a; )
|
|
1832
|
+
i++, r++;
|
|
1833
|
+
var o = 1 + (i & 1), s = i < 2 ? 1 : 3 + (i >> 1), u = "a", l = at(t);
|
|
1808
1834
|
for ((l == "H" || l == "k") && (s = 0); s-- > 0; )
|
|
1809
1835
|
n += u;
|
|
1810
1836
|
for (; o-- > 0; )
|
|
1811
1837
|
n = l + n;
|
|
1812
|
-
} else
|
|
1813
|
-
i === "J" ? n += "H" : n += i;
|
|
1838
|
+
} else a === "J" ? n += "H" : n += a;
|
|
1814
1839
|
}
|
|
1815
1840
|
return n;
|
|
1816
1841
|
}
|
|
1817
|
-
function
|
|
1842
|
+
function at(e) {
|
|
1818
1843
|
var t = e.hourCycle;
|
|
1819
1844
|
if (t === void 0 && // @ts-ignore hourCycle(s) is not identified yet
|
|
1820
1845
|
e.hourCycles && // @ts-ignore
|
|
@@ -1833,23 +1858,23 @@ function et(e) {
|
|
|
1833
1858
|
}
|
|
1834
1859
|
var n = e.language, r;
|
|
1835
1860
|
n !== "root" && (r = e.maximize().region);
|
|
1836
|
-
var
|
|
1837
|
-
return
|
|
1861
|
+
var a = V[r || ""] || V[n || ""] || V["".concat(n, "-001")] || V["001"];
|
|
1862
|
+
return a[0];
|
|
1838
1863
|
}
|
|
1839
|
-
var
|
|
1864
|
+
var z, it = new RegExp("^".concat(Be.source, "*")), ot = new RegExp("".concat(Be.source, "*$"));
|
|
1840
1865
|
function v(e, t) {
|
|
1841
1866
|
return { start: e, end: t };
|
|
1842
1867
|
}
|
|
1843
|
-
var
|
|
1868
|
+
var st = !!String.prototype.startsWith && "_a".startsWith("a", 1), ut = !!String.fromCodePoint, ht = !!Object.fromEntries, lt = !!String.prototype.codePointAt, ft = !!String.prototype.trimStart, ct = !!String.prototype.trimEnd, mt = !!Number.isSafeInteger, pt = mt ? Number.isSafeInteger : function(e) {
|
|
1844
1869
|
return typeof e == "number" && isFinite(e) && Math.floor(e) === e && Math.abs(e) <= 9007199254740991;
|
|
1845
|
-
},
|
|
1870
|
+
}, K = !0;
|
|
1846
1871
|
try {
|
|
1847
|
-
var
|
|
1848
|
-
|
|
1872
|
+
var gt = Me("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1873
|
+
K = ((z = gt.exec("a")) === null || z === void 0 ? void 0 : z[0]) === "a";
|
|
1849
1874
|
} catch {
|
|
1850
|
-
|
|
1875
|
+
K = !1;
|
|
1851
1876
|
}
|
|
1852
|
-
var
|
|
1877
|
+
var ce = st ? (
|
|
1853
1878
|
// Native
|
|
1854
1879
|
function(t, n, r) {
|
|
1855
1880
|
return t.startsWith(n, r);
|
|
@@ -1859,31 +1884,31 @@ var ue = nt ? (
|
|
|
1859
1884
|
function(t, n, r) {
|
|
1860
1885
|
return t.slice(r, r + n.length) === n;
|
|
1861
1886
|
}
|
|
1862
|
-
),
|
|
1887
|
+
), ee = ut ? String.fromCodePoint : (
|
|
1863
1888
|
// IE11
|
|
1864
1889
|
function() {
|
|
1865
1890
|
for (var t = [], n = 0; n < arguments.length; n++)
|
|
1866
1891
|
t[n] = arguments[n];
|
|
1867
|
-
for (var r = "",
|
|
1868
|
-
if (o = t[
|
|
1892
|
+
for (var r = "", a = t.length, i = 0, o; a > i; ) {
|
|
1893
|
+
if (o = t[i++], o > 1114111)
|
|
1869
1894
|
throw RangeError(o + " is not a valid code point");
|
|
1870
1895
|
r += o < 65536 ? String.fromCharCode(o) : String.fromCharCode(((o -= 65536) >> 10) + 55296, o % 1024 + 56320);
|
|
1871
1896
|
}
|
|
1872
1897
|
return r;
|
|
1873
1898
|
}
|
|
1874
|
-
),
|
|
1899
|
+
), me = (
|
|
1875
1900
|
// native
|
|
1876
|
-
|
|
1901
|
+
ht ? Object.fromEntries : (
|
|
1877
1902
|
// Ponyfill
|
|
1878
1903
|
function(t) {
|
|
1879
|
-
for (var n = {}, r = 0,
|
|
1880
|
-
var
|
|
1904
|
+
for (var n = {}, r = 0, a = t; r < a.length; r++) {
|
|
1905
|
+
var i = a[r], o = i[0], s = i[1];
|
|
1881
1906
|
n[o] = s;
|
|
1882
1907
|
}
|
|
1883
1908
|
return n;
|
|
1884
1909
|
}
|
|
1885
1910
|
)
|
|
1886
|
-
),
|
|
1911
|
+
), Le = lt ? (
|
|
1887
1912
|
// Native
|
|
1888
1913
|
function(t, n) {
|
|
1889
1914
|
return t.codePointAt(n);
|
|
@@ -1893,11 +1918,11 @@ var ue = nt ? (
|
|
|
1893
1918
|
function(t, n) {
|
|
1894
1919
|
var r = t.length;
|
|
1895
1920
|
if (!(n < 0 || n >= r)) {
|
|
1896
|
-
var
|
|
1897
|
-
return
|
|
1921
|
+
var a = t.charCodeAt(n), i;
|
|
1922
|
+
return a < 55296 || a > 56319 || n + 1 === r || (i = t.charCodeAt(n + 1)) < 56320 || i > 57343 ? a : (a - 55296 << 10) + (i - 56320) + 65536;
|
|
1898
1923
|
}
|
|
1899
1924
|
}
|
|
1900
|
-
),
|
|
1925
|
+
), vt = ft ? (
|
|
1901
1926
|
// Native
|
|
1902
1927
|
function(t) {
|
|
1903
1928
|
return t.trimStart();
|
|
@@ -1905,9 +1930,9 @@ var ue = nt ? (
|
|
|
1905
1930
|
) : (
|
|
1906
1931
|
// Ponyfill
|
|
1907
1932
|
function(t) {
|
|
1908
|
-
return t.replace(
|
|
1933
|
+
return t.replace(it, "");
|
|
1909
1934
|
}
|
|
1910
|
-
),
|
|
1935
|
+
), Et = ct ? (
|
|
1911
1936
|
// Native
|
|
1912
1937
|
function(t) {
|
|
1913
1938
|
return t.trimEnd();
|
|
@@ -1915,32 +1940,32 @@ var ue = nt ? (
|
|
|
1915
1940
|
) : (
|
|
1916
1941
|
// Ponyfill
|
|
1917
1942
|
function(t) {
|
|
1918
|
-
return t.replace(
|
|
1943
|
+
return t.replace(ot, "");
|
|
1919
1944
|
}
|
|
1920
1945
|
);
|
|
1921
|
-
function
|
|
1946
|
+
function Me(e, t) {
|
|
1922
1947
|
return new RegExp(e, t);
|
|
1923
1948
|
}
|
|
1924
|
-
var
|
|
1925
|
-
if (
|
|
1926
|
-
var
|
|
1927
|
-
|
|
1949
|
+
var te;
|
|
1950
|
+
if (K) {
|
|
1951
|
+
var pe = Me("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1952
|
+
te = function(t, n) {
|
|
1928
1953
|
var r;
|
|
1929
|
-
|
|
1930
|
-
var
|
|
1931
|
-
return (r =
|
|
1954
|
+
pe.lastIndex = n;
|
|
1955
|
+
var a = pe.exec(t);
|
|
1956
|
+
return (r = a[1]) !== null && r !== void 0 ? r : "";
|
|
1932
1957
|
};
|
|
1933
1958
|
} else
|
|
1934
|
-
|
|
1959
|
+
te = function(t, n) {
|
|
1935
1960
|
for (var r = []; ; ) {
|
|
1936
|
-
var
|
|
1937
|
-
if (
|
|
1961
|
+
var a = Le(t, n);
|
|
1962
|
+
if (a === void 0 || Ce(a) || xt(a))
|
|
1938
1963
|
break;
|
|
1939
|
-
r.push(
|
|
1964
|
+
r.push(a), n += a >= 65536 ? 2 : 1;
|
|
1940
1965
|
}
|
|
1941
|
-
return
|
|
1966
|
+
return ee.apply(void 0, r);
|
|
1942
1967
|
};
|
|
1943
|
-
var
|
|
1968
|
+
var dt = (
|
|
1944
1969
|
/** @class */
|
|
1945
1970
|
function() {
|
|
1946
1971
|
function e(t, n) {
|
|
@@ -1951,107 +1976,107 @@ var gt = (
|
|
|
1951
1976
|
throw Error("parser can only be used once");
|
|
1952
1977
|
return this.parseMessage(0, "", !1);
|
|
1953
1978
|
}, e.prototype.parseMessage = function(t, n, r) {
|
|
1954
|
-
for (var
|
|
1955
|
-
var
|
|
1956
|
-
if (
|
|
1979
|
+
for (var a = []; !this.isEOF(); ) {
|
|
1980
|
+
var i = this.char();
|
|
1981
|
+
if (i === 123) {
|
|
1957
1982
|
var o = this.parseArgument(t, r);
|
|
1958
1983
|
if (o.err)
|
|
1959
1984
|
return o;
|
|
1960
|
-
|
|
1985
|
+
a.push(o.val);
|
|
1961
1986
|
} else {
|
|
1962
|
-
if (
|
|
1987
|
+
if (i === 125 && t > 0)
|
|
1963
1988
|
break;
|
|
1964
|
-
if (
|
|
1989
|
+
if (i === 35 && (n === "plural" || n === "selectordinal")) {
|
|
1965
1990
|
var s = this.clonePosition();
|
|
1966
|
-
this.bump(),
|
|
1967
|
-
type:
|
|
1991
|
+
this.bump(), a.push({
|
|
1992
|
+
type: b.pound,
|
|
1968
1993
|
location: v(s, this.clonePosition())
|
|
1969
1994
|
});
|
|
1970
|
-
} else if (
|
|
1995
|
+
} else if (i === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
1971
1996
|
if (r)
|
|
1972
1997
|
break;
|
|
1973
|
-
return this.error(
|
|
1974
|
-
} else if (
|
|
1998
|
+
return this.error(p.UNMATCHED_CLOSING_TAG, v(this.clonePosition(), this.clonePosition()));
|
|
1999
|
+
} else if (i === 60 && !this.ignoreTag && re(this.peek() || 0)) {
|
|
1975
2000
|
var o = this.parseTag(t, n);
|
|
1976
2001
|
if (o.err)
|
|
1977
2002
|
return o;
|
|
1978
|
-
|
|
2003
|
+
a.push(o.val);
|
|
1979
2004
|
} else {
|
|
1980
2005
|
var o = this.parseLiteral(t, n);
|
|
1981
2006
|
if (o.err)
|
|
1982
2007
|
return o;
|
|
1983
|
-
|
|
2008
|
+
a.push(o.val);
|
|
1984
2009
|
}
|
|
1985
2010
|
}
|
|
1986
2011
|
}
|
|
1987
|
-
return { val:
|
|
2012
|
+
return { val: a, err: null };
|
|
1988
2013
|
}, e.prototype.parseTag = function(t, n) {
|
|
1989
2014
|
var r = this.clonePosition();
|
|
1990
2015
|
this.bump();
|
|
1991
|
-
var
|
|
2016
|
+
var a = this.parseTagName();
|
|
1992
2017
|
if (this.bumpSpace(), this.bumpIf("/>"))
|
|
1993
2018
|
return {
|
|
1994
2019
|
val: {
|
|
1995
|
-
type:
|
|
1996
|
-
value: "<".concat(
|
|
2020
|
+
type: b.literal,
|
|
2021
|
+
value: "<".concat(a, "/>"),
|
|
1997
2022
|
location: v(r, this.clonePosition())
|
|
1998
2023
|
},
|
|
1999
2024
|
err: null
|
|
2000
2025
|
};
|
|
2001
2026
|
if (this.bumpIf(">")) {
|
|
2002
|
-
var
|
|
2003
|
-
if (
|
|
2004
|
-
return
|
|
2005
|
-
var o =
|
|
2027
|
+
var i = this.parseMessage(t + 1, n, !0);
|
|
2028
|
+
if (i.err)
|
|
2029
|
+
return i;
|
|
2030
|
+
var o = i.val, s = this.clonePosition();
|
|
2006
2031
|
if (this.bumpIf("</")) {
|
|
2007
|
-
if (this.isEOF() ||
|
|
2008
|
-
return this.error(
|
|
2032
|
+
if (this.isEOF() || !re(this.char()))
|
|
2033
|
+
return this.error(p.INVALID_TAG, v(s, this.clonePosition()));
|
|
2009
2034
|
var u = this.clonePosition(), l = this.parseTagName();
|
|
2010
|
-
return
|
|
2035
|
+
return a !== l ? this.error(p.UNMATCHED_CLOSING_TAG, v(u, this.clonePosition())) : (this.bumpSpace(), this.bumpIf(">") ? {
|
|
2011
2036
|
val: {
|
|
2012
|
-
type:
|
|
2013
|
-
value:
|
|
2037
|
+
type: b.tag,
|
|
2038
|
+
value: a,
|
|
2014
2039
|
children: o,
|
|
2015
2040
|
location: v(r, this.clonePosition())
|
|
2016
2041
|
},
|
|
2017
2042
|
err: null
|
|
2018
|
-
} : this.error(
|
|
2043
|
+
} : this.error(p.INVALID_TAG, v(s, this.clonePosition())));
|
|
2019
2044
|
} else
|
|
2020
|
-
return this.error(
|
|
2045
|
+
return this.error(p.UNCLOSED_TAG, v(r, this.clonePosition()));
|
|
2021
2046
|
} else
|
|
2022
|
-
return this.error(
|
|
2047
|
+
return this.error(p.INVALID_TAG, v(r, this.clonePosition()));
|
|
2023
2048
|
}, e.prototype.parseTagName = function() {
|
|
2024
2049
|
var t = this.offset();
|
|
2025
|
-
for (this.bump(); !this.isEOF() &&
|
|
2050
|
+
for (this.bump(); !this.isEOF() && yt(this.char()); )
|
|
2026
2051
|
this.bump();
|
|
2027
2052
|
return this.message.slice(t, this.offset());
|
|
2028
2053
|
}, e.prototype.parseLiteral = function(t, n) {
|
|
2029
|
-
for (var r = this.clonePosition(),
|
|
2030
|
-
var
|
|
2031
|
-
if (
|
|
2032
|
-
|
|
2054
|
+
for (var r = this.clonePosition(), a = ""; ; ) {
|
|
2055
|
+
var i = this.tryParseQuote(n);
|
|
2056
|
+
if (i) {
|
|
2057
|
+
a += i;
|
|
2033
2058
|
continue;
|
|
2034
2059
|
}
|
|
2035
2060
|
var o = this.tryParseUnquoted(t, n);
|
|
2036
2061
|
if (o) {
|
|
2037
|
-
|
|
2062
|
+
a += o;
|
|
2038
2063
|
continue;
|
|
2039
2064
|
}
|
|
2040
2065
|
var s = this.tryParseLeftAngleBracket();
|
|
2041
2066
|
if (s) {
|
|
2042
|
-
|
|
2067
|
+
a += s;
|
|
2043
2068
|
continue;
|
|
2044
2069
|
}
|
|
2045
2070
|
break;
|
|
2046
2071
|
}
|
|
2047
2072
|
var u = v(r, this.clonePosition());
|
|
2048
2073
|
return {
|
|
2049
|
-
val: { type:
|
|
2074
|
+
val: { type: b.literal, value: a, location: u },
|
|
2050
2075
|
err: null
|
|
2051
2076
|
};
|
|
2052
2077
|
}, e.prototype.tryParseLeftAngleBracket = function() {
|
|
2053
2078
|
return !this.isEOF() && this.char() === 60 && (this.ignoreTag || // If at the opening tag or closing tag position, bail.
|
|
2054
|
-
!
|
|
2079
|
+
!bt(this.peek() || 0)) ? (this.bump(), "<") : null;
|
|
2055
2080
|
}, e.prototype.tryParseQuote = function(t) {
|
|
2056
2081
|
if (this.isEOF() || this.char() !== 39)
|
|
2057
2082
|
return null;
|
|
@@ -2085,49 +2110,49 @@ var gt = (
|
|
|
2085
2110
|
n.push(r);
|
|
2086
2111
|
this.bump();
|
|
2087
2112
|
}
|
|
2088
|
-
return
|
|
2113
|
+
return ee.apply(void 0, n);
|
|
2089
2114
|
}, e.prototype.tryParseUnquoted = function(t, n) {
|
|
2090
2115
|
if (this.isEOF())
|
|
2091
2116
|
return null;
|
|
2092
2117
|
var r = this.char();
|
|
2093
|
-
return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(),
|
|
2118
|
+
return r === 60 || r === 123 || r === 35 && (n === "plural" || n === "selectordinal") || r === 125 && t > 0 ? null : (this.bump(), ee(r));
|
|
2094
2119
|
}, e.prototype.parseArgument = function(t, n) {
|
|
2095
2120
|
var r = this.clonePosition();
|
|
2096
2121
|
if (this.bump(), this.bumpSpace(), this.isEOF())
|
|
2097
|
-
return this.error(
|
|
2122
|
+
return this.error(p.EXPECT_ARGUMENT_CLOSING_BRACE, v(r, this.clonePosition()));
|
|
2098
2123
|
if (this.char() === 125)
|
|
2099
|
-
return this.bump(), this.error(
|
|
2100
|
-
var
|
|
2101
|
-
if (!
|
|
2102
|
-
return this.error(
|
|
2124
|
+
return this.bump(), this.error(p.EMPTY_ARGUMENT, v(r, this.clonePosition()));
|
|
2125
|
+
var a = this.parseIdentifierIfPossible().value;
|
|
2126
|
+
if (!a)
|
|
2127
|
+
return this.error(p.MALFORMED_ARGUMENT, v(r, this.clonePosition()));
|
|
2103
2128
|
if (this.bumpSpace(), this.isEOF())
|
|
2104
|
-
return this.error(
|
|
2129
|
+
return this.error(p.EXPECT_ARGUMENT_CLOSING_BRACE, v(r, this.clonePosition()));
|
|
2105
2130
|
switch (this.char()) {
|
|
2106
2131
|
case 125:
|
|
2107
2132
|
return this.bump(), {
|
|
2108
2133
|
val: {
|
|
2109
|
-
type:
|
|
2134
|
+
type: b.argument,
|
|
2110
2135
|
// value does not include the opening and closing braces.
|
|
2111
|
-
value:
|
|
2136
|
+
value: a,
|
|
2112
2137
|
location: v(r, this.clonePosition())
|
|
2113
2138
|
},
|
|
2114
2139
|
err: null
|
|
2115
2140
|
};
|
|
2116
2141
|
case 44:
|
|
2117
|
-
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(
|
|
2142
|
+
return this.bump(), this.bumpSpace(), this.isEOF() ? this.error(p.EXPECT_ARGUMENT_CLOSING_BRACE, v(r, this.clonePosition())) : this.parseArgumentOptions(t, n, a, r);
|
|
2118
2143
|
default:
|
|
2119
|
-
return this.error(
|
|
2144
|
+
return this.error(p.MALFORMED_ARGUMENT, v(r, this.clonePosition()));
|
|
2120
2145
|
}
|
|
2121
2146
|
}, e.prototype.parseIdentifierIfPossible = function() {
|
|
2122
|
-
var t = this.clonePosition(), n = this.offset(), r =
|
|
2123
|
-
this.bumpTo(
|
|
2124
|
-
var
|
|
2147
|
+
var t = this.clonePosition(), n = this.offset(), r = te(this.message, n), a = n + r.length;
|
|
2148
|
+
this.bumpTo(a);
|
|
2149
|
+
var i = this.clonePosition(), o = v(t, i);
|
|
2125
2150
|
return { value: r, location: o };
|
|
2126
|
-
}, e.prototype.parseArgumentOptions = function(t, n, r,
|
|
2127
|
-
var
|
|
2151
|
+
}, e.prototype.parseArgumentOptions = function(t, n, r, a) {
|
|
2152
|
+
var i, o = this.clonePosition(), s = this.parseIdentifierIfPossible().value, u = this.clonePosition();
|
|
2128
2153
|
switch (s) {
|
|
2129
2154
|
case "":
|
|
2130
|
-
return this.error(
|
|
2155
|
+
return this.error(p.EXPECT_ARGUMENT_TYPE, v(o, u));
|
|
2131
2156
|
case "number":
|
|
2132
2157
|
case "date":
|
|
2133
2158
|
case "time": {
|
|
@@ -2135,50 +2160,50 @@ var gt = (
|
|
|
2135
2160
|
var l = null;
|
|
2136
2161
|
if (this.bumpIf(",")) {
|
|
2137
2162
|
this.bumpSpace();
|
|
2138
|
-
var h = this.clonePosition(),
|
|
2139
|
-
if (
|
|
2140
|
-
return
|
|
2141
|
-
var c =
|
|
2163
|
+
var h = this.clonePosition(), f = this.parseSimpleArgStyleIfPossible();
|
|
2164
|
+
if (f.err)
|
|
2165
|
+
return f;
|
|
2166
|
+
var c = Et(f.val);
|
|
2142
2167
|
if (c.length === 0)
|
|
2143
|
-
return this.error(
|
|
2168
|
+
return this.error(p.EXPECT_ARGUMENT_STYLE, v(this.clonePosition(), this.clonePosition()));
|
|
2144
2169
|
var E = v(h, this.clonePosition());
|
|
2145
2170
|
l = { style: c, styleLocation: E };
|
|
2146
2171
|
}
|
|
2147
|
-
var
|
|
2148
|
-
if (
|
|
2149
|
-
return
|
|
2150
|
-
var
|
|
2151
|
-
if (l &&
|
|
2152
|
-
var
|
|
2172
|
+
var x = this.tryParseArgumentClose(a);
|
|
2173
|
+
if (x.err)
|
|
2174
|
+
return x;
|
|
2175
|
+
var g = v(a, this.clonePosition());
|
|
2176
|
+
if (l && ce(l == null ? void 0 : l.style, "::", 0)) {
|
|
2177
|
+
var d = vt(l.style.slice(2));
|
|
2153
2178
|
if (s === "number") {
|
|
2154
|
-
var
|
|
2155
|
-
return
|
|
2156
|
-
val: { type:
|
|
2179
|
+
var f = this.parseNumberSkeletonFromString(d, l.styleLocation);
|
|
2180
|
+
return f.err ? f : {
|
|
2181
|
+
val: { type: b.number, value: r, location: g, style: f.val },
|
|
2157
2182
|
err: null
|
|
2158
2183
|
};
|
|
2159
2184
|
} else {
|
|
2160
|
-
if (
|
|
2161
|
-
return this.error(
|
|
2162
|
-
var
|
|
2163
|
-
this.locale && (
|
|
2185
|
+
if (d.length === 0)
|
|
2186
|
+
return this.error(p.EXPECT_DATE_TIME_SKELETON, g);
|
|
2187
|
+
var y = d;
|
|
2188
|
+
this.locale && (y = nt(d, this.locale));
|
|
2164
2189
|
var c = {
|
|
2165
2190
|
type: D.dateTime,
|
|
2166
|
-
pattern:
|
|
2191
|
+
pattern: y,
|
|
2167
2192
|
location: l.styleLocation,
|
|
2168
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2169
|
-
}, H = s === "date" ?
|
|
2193
|
+
parsedOptions: this.shouldParseSkeletons ? qe(y) : {}
|
|
2194
|
+
}, H = s === "date" ? b.date : b.time;
|
|
2170
2195
|
return {
|
|
2171
|
-
val: { type: H, value: r, location:
|
|
2196
|
+
val: { type: H, value: r, location: g, style: c },
|
|
2172
2197
|
err: null
|
|
2173
2198
|
};
|
|
2174
2199
|
}
|
|
2175
2200
|
}
|
|
2176
2201
|
return {
|
|
2177
2202
|
val: {
|
|
2178
|
-
type: s === "number" ?
|
|
2203
|
+
type: s === "number" ? b.number : s === "date" ? b.date : b.time,
|
|
2179
2204
|
value: r,
|
|
2180
|
-
location:
|
|
2181
|
-
style: (
|
|
2205
|
+
location: g,
|
|
2206
|
+
style: (i = l == null ? void 0 : l.style) !== null && i !== void 0 ? i : null
|
|
2182
2207
|
},
|
|
2183
2208
|
err: null
|
|
2184
2209
|
};
|
|
@@ -2188,59 +2213,59 @@ var gt = (
|
|
|
2188
2213
|
case "select": {
|
|
2189
2214
|
var T = this.clonePosition();
|
|
2190
2215
|
if (this.bumpSpace(), !this.bumpIf(","))
|
|
2191
|
-
return this.error(
|
|
2216
|
+
return this.error(p.EXPECT_SELECT_ARGUMENT_OPTIONS, v(T, m({}, T)));
|
|
2192
2217
|
this.bumpSpace();
|
|
2193
|
-
var
|
|
2194
|
-
if (s !== "select" &&
|
|
2218
|
+
var F = this.parseIdentifierIfPossible(), O = 0;
|
|
2219
|
+
if (s !== "select" && F.value === "offset") {
|
|
2195
2220
|
if (!this.bumpIf(":"))
|
|
2196
|
-
return this.error(
|
|
2221
|
+
return this.error(p.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, v(this.clonePosition(), this.clonePosition()));
|
|
2197
2222
|
this.bumpSpace();
|
|
2198
|
-
var
|
|
2199
|
-
if (
|
|
2200
|
-
return
|
|
2201
|
-
this.bumpSpace(),
|
|
2223
|
+
var f = this.tryParseDecimalInteger(p.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, p.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2224
|
+
if (f.err)
|
|
2225
|
+
return f;
|
|
2226
|
+
this.bumpSpace(), F = this.parseIdentifierIfPossible(), O = f.val;
|
|
2202
2227
|
}
|
|
2203
|
-
var
|
|
2204
|
-
if (
|
|
2205
|
-
return
|
|
2206
|
-
var
|
|
2207
|
-
if (
|
|
2208
|
-
return
|
|
2209
|
-
var
|
|
2228
|
+
var U = this.tryParsePluralOrSelectOptions(t, s, n, F);
|
|
2229
|
+
if (U.err)
|
|
2230
|
+
return U;
|
|
2231
|
+
var x = this.tryParseArgumentClose(a);
|
|
2232
|
+
if (x.err)
|
|
2233
|
+
return x;
|
|
2234
|
+
var se = v(a, this.clonePosition());
|
|
2210
2235
|
return s === "select" ? {
|
|
2211
2236
|
val: {
|
|
2212
|
-
type:
|
|
2237
|
+
type: b.select,
|
|
2213
2238
|
value: r,
|
|
2214
|
-
options:
|
|
2215
|
-
location:
|
|
2239
|
+
options: me(U.val),
|
|
2240
|
+
location: se
|
|
2216
2241
|
},
|
|
2217
2242
|
err: null
|
|
2218
2243
|
} : {
|
|
2219
2244
|
val: {
|
|
2220
|
-
type:
|
|
2245
|
+
type: b.plural,
|
|
2221
2246
|
value: r,
|
|
2222
|
-
options:
|
|
2223
|
-
offset:
|
|
2247
|
+
options: me(U.val),
|
|
2248
|
+
offset: O,
|
|
2224
2249
|
pluralType: s === "plural" ? "cardinal" : "ordinal",
|
|
2225
|
-
location:
|
|
2250
|
+
location: se
|
|
2226
2251
|
},
|
|
2227
2252
|
err: null
|
|
2228
2253
|
};
|
|
2229
2254
|
}
|
|
2230
2255
|
default:
|
|
2231
|
-
return this.error(
|
|
2256
|
+
return this.error(p.INVALID_ARGUMENT_TYPE, v(o, u));
|
|
2232
2257
|
}
|
|
2233
2258
|
}, e.prototype.tryParseArgumentClose = function(t) {
|
|
2234
|
-
return this.isEOF() || this.char() !== 125 ? this.error(
|
|
2259
|
+
return this.isEOF() || this.char() !== 125 ? this.error(p.EXPECT_ARGUMENT_CLOSING_BRACE, v(t, this.clonePosition())) : (this.bump(), { val: !0, err: null });
|
|
2235
2260
|
}, e.prototype.parseSimpleArgStyleIfPossible = function() {
|
|
2236
2261
|
for (var t = 0, n = this.clonePosition(); !this.isEOF(); ) {
|
|
2237
2262
|
var r = this.char();
|
|
2238
2263
|
switch (r) {
|
|
2239
2264
|
case 39: {
|
|
2240
2265
|
this.bump();
|
|
2241
|
-
var
|
|
2266
|
+
var a = this.clonePosition();
|
|
2242
2267
|
if (!this.bumpUntil("'"))
|
|
2243
|
-
return this.error(
|
|
2268
|
+
return this.error(p.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, v(a, this.clonePosition()));
|
|
2244
2269
|
this.bump();
|
|
2245
2270
|
break;
|
|
2246
2271
|
}
|
|
@@ -2270,64 +2295,64 @@ var gt = (
|
|
|
2270
2295
|
}, e.prototype.parseNumberSkeletonFromString = function(t, n) {
|
|
2271
2296
|
var r = [];
|
|
2272
2297
|
try {
|
|
2273
|
-
r =
|
|
2298
|
+
r = Ye(t);
|
|
2274
2299
|
} catch {
|
|
2275
|
-
return this.error(
|
|
2300
|
+
return this.error(p.INVALID_NUMBER_SKELETON, n);
|
|
2276
2301
|
}
|
|
2277
2302
|
return {
|
|
2278
2303
|
val: {
|
|
2279
2304
|
type: D.number,
|
|
2280
2305
|
tokens: r,
|
|
2281
2306
|
location: n,
|
|
2282
|
-
parsedOptions: this.shouldParseSkeletons ?
|
|
2307
|
+
parsedOptions: this.shouldParseSkeletons ? rt(r) : {}
|
|
2283
2308
|
},
|
|
2284
2309
|
err: null
|
|
2285
2310
|
};
|
|
2286
|
-
}, e.prototype.tryParsePluralOrSelectOptions = function(t, n, r,
|
|
2287
|
-
for (var
|
|
2311
|
+
}, e.prototype.tryParsePluralOrSelectOptions = function(t, n, r, a) {
|
|
2312
|
+
for (var i, o = !1, s = [], u = /* @__PURE__ */ new Set(), l = a.value, h = a.location; ; ) {
|
|
2288
2313
|
if (l.length === 0) {
|
|
2289
|
-
var
|
|
2314
|
+
var f = this.clonePosition();
|
|
2290
2315
|
if (n !== "select" && this.bumpIf("=")) {
|
|
2291
|
-
var c = this.tryParseDecimalInteger(
|
|
2316
|
+
var c = this.tryParseDecimalInteger(p.EXPECT_PLURAL_ARGUMENT_SELECTOR, p.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
2292
2317
|
if (c.err)
|
|
2293
2318
|
return c;
|
|
2294
|
-
h = v(
|
|
2319
|
+
h = v(f, this.clonePosition()), l = this.message.slice(f.offset, this.offset());
|
|
2295
2320
|
} else
|
|
2296
2321
|
break;
|
|
2297
2322
|
}
|
|
2298
2323
|
if (u.has(l))
|
|
2299
|
-
return this.error(n === "select" ?
|
|
2324
|
+
return this.error(n === "select" ? p.DUPLICATE_SELECT_ARGUMENT_SELECTOR : p.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, h);
|
|
2300
2325
|
l === "other" && (o = !0), this.bumpSpace();
|
|
2301
2326
|
var E = this.clonePosition();
|
|
2302
2327
|
if (!this.bumpIf("{"))
|
|
2303
|
-
return this.error(n === "select" ?
|
|
2304
|
-
var
|
|
2305
|
-
if (
|
|
2306
|
-
return
|
|
2307
|
-
var
|
|
2308
|
-
if (
|
|
2309
|
-
return
|
|
2328
|
+
return this.error(n === "select" ? p.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : p.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, v(this.clonePosition(), this.clonePosition()));
|
|
2329
|
+
var x = this.parseMessage(t + 1, n, r);
|
|
2330
|
+
if (x.err)
|
|
2331
|
+
return x;
|
|
2332
|
+
var g = this.tryParseArgumentClose(E);
|
|
2333
|
+
if (g.err)
|
|
2334
|
+
return g;
|
|
2310
2335
|
s.push([
|
|
2311
2336
|
l,
|
|
2312
2337
|
{
|
|
2313
|
-
value:
|
|
2338
|
+
value: x.val,
|
|
2314
2339
|
location: v(E, this.clonePosition())
|
|
2315
2340
|
}
|
|
2316
|
-
]), u.add(l), this.bumpSpace(),
|
|
2341
|
+
]), u.add(l), this.bumpSpace(), i = this.parseIdentifierIfPossible(), l = i.value, h = i.location;
|
|
2317
2342
|
}
|
|
2318
|
-
return s.length === 0 ? this.error(n === "select" ?
|
|
2343
|
+
return s.length === 0 ? this.error(n === "select" ? p.EXPECT_SELECT_ARGUMENT_SELECTOR : p.EXPECT_PLURAL_ARGUMENT_SELECTOR, v(this.clonePosition(), this.clonePosition())) : this.requiresOtherClause && !o ? this.error(p.MISSING_OTHER_CLAUSE, v(this.clonePosition(), this.clonePosition())) : { val: s, err: null };
|
|
2319
2344
|
}, e.prototype.tryParseDecimalInteger = function(t, n) {
|
|
2320
|
-
var r = 1,
|
|
2345
|
+
var r = 1, a = this.clonePosition();
|
|
2321
2346
|
this.bumpIf("+") || this.bumpIf("-") && (r = -1);
|
|
2322
|
-
for (var
|
|
2347
|
+
for (var i = !1, o = 0; !this.isEOF(); ) {
|
|
2323
2348
|
var s = this.char();
|
|
2324
2349
|
if (s >= 48 && s <= 57)
|
|
2325
|
-
|
|
2350
|
+
i = !0, o = o * 10 + (s - 48), this.bump();
|
|
2326
2351
|
else
|
|
2327
2352
|
break;
|
|
2328
2353
|
}
|
|
2329
|
-
var u = v(
|
|
2330
|
-
return
|
|
2354
|
+
var u = v(a, this.clonePosition());
|
|
2355
|
+
return i ? (o *= r, pt(o) ? { val: o, err: null } : this.error(n, u)) : this.error(t, u);
|
|
2331
2356
|
}, e.prototype.offset = function() {
|
|
2332
2357
|
return this.position.offset;
|
|
2333
2358
|
}, e.prototype.isEOF = function() {
|
|
@@ -2342,7 +2367,7 @@ var gt = (
|
|
|
2342
2367
|
var t = this.position.offset;
|
|
2343
2368
|
if (t >= this.message.length)
|
|
2344
2369
|
throw Error("out of bound");
|
|
2345
|
-
var n =
|
|
2370
|
+
var n = Le(this.message, t);
|
|
2346
2371
|
if (n === void 0)
|
|
2347
2372
|
throw Error("Offset ".concat(t, " is at invalid UTF-16 code unit boundary"));
|
|
2348
2373
|
return n;
|
|
@@ -2361,7 +2386,7 @@ var gt = (
|
|
|
2361
2386
|
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);
|
|
2362
2387
|
}
|
|
2363
2388
|
}, e.prototype.bumpIf = function(t) {
|
|
2364
|
-
if (
|
|
2389
|
+
if (ce(this.message, t, this.offset())) {
|
|
2365
2390
|
for (var n = 0; n < t.length; n++)
|
|
2366
2391
|
this.bump();
|
|
2367
2392
|
return !0;
|
|
@@ -2383,7 +2408,7 @@ var gt = (
|
|
|
2383
2408
|
break;
|
|
2384
2409
|
}
|
|
2385
2410
|
}, e.prototype.bumpSpace = function() {
|
|
2386
|
-
for (; !this.isEOF() &&
|
|
2411
|
+
for (; !this.isEOF() && Ce(this.char()); )
|
|
2387
2412
|
this.bump();
|
|
2388
2413
|
}, e.prototype.peek = function() {
|
|
2389
2414
|
if (this.isEOF())
|
|
@@ -2393,147 +2418,146 @@ var gt = (
|
|
|
2393
2418
|
}, e;
|
|
2394
2419
|
}()
|
|
2395
2420
|
);
|
|
2396
|
-
function
|
|
2421
|
+
function re(e) {
|
|
2397
2422
|
return e >= 97 && e <= 122 || e >= 65 && e <= 90;
|
|
2398
2423
|
}
|
|
2399
|
-
function
|
|
2400
|
-
return
|
|
2424
|
+
function bt(e) {
|
|
2425
|
+
return re(e) || e === 47;
|
|
2401
2426
|
}
|
|
2402
|
-
function
|
|
2427
|
+
function yt(e) {
|
|
2403
2428
|
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;
|
|
2404
2429
|
}
|
|
2405
|
-
function
|
|
2430
|
+
function Ce(e) {
|
|
2406
2431
|
return e >= 9 && e <= 13 || e === 32 || e === 133 || e >= 8206 && e <= 8207 || e === 8232 || e === 8233;
|
|
2407
2432
|
}
|
|
2408
|
-
function
|
|
2433
|
+
function xt(e) {
|
|
2409
2434
|
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;
|
|
2410
2435
|
}
|
|
2411
|
-
function
|
|
2436
|
+
function ne(e) {
|
|
2412
2437
|
e.forEach(function(t) {
|
|
2413
|
-
if (delete t.location,
|
|
2438
|
+
if (delete t.location, Ie(t) || Ae(t))
|
|
2414
2439
|
for (var n in t.options)
|
|
2415
|
-
delete t.options[n].location,
|
|
2416
|
-
else
|
|
2417
|
-
be(t) && He(t.style) || (de(t) || xe(t)) && J(t.style) ? delete t.style.location : Se(t) && K(t.children);
|
|
2440
|
+
delete t.options[n].location, ne(t.options[n].value);
|
|
2441
|
+
else Te(t) && Ne(t.style) || (Se(t) || He(t)) && Y(t.style) ? delete t.style.location : _e(t) && ne(t.children);
|
|
2418
2442
|
});
|
|
2419
2443
|
}
|
|
2420
|
-
function
|
|
2421
|
-
t === void 0 && (t = {}), t =
|
|
2422
|
-
var n = new
|
|
2444
|
+
function Tt(e, t) {
|
|
2445
|
+
t === void 0 && (t = {}), t = m({ shouldParseSkeletons: !0, requiresOtherClause: !0 }, t);
|
|
2446
|
+
var n = new dt(e, t).parse();
|
|
2423
2447
|
if (n.err) {
|
|
2424
|
-
var r = SyntaxError(
|
|
2448
|
+
var r = SyntaxError(p[n.err.kind]);
|
|
2425
2449
|
throw r.location = n.err.location, r.originalMessage = n.err.message, r;
|
|
2426
2450
|
}
|
|
2427
|
-
return t != null && t.captureLocation ||
|
|
2451
|
+
return t != null && t.captureLocation || ne(n.val), n.val;
|
|
2428
2452
|
}
|
|
2429
2453
|
function A(e, t) {
|
|
2430
|
-
var n = t && t.cache ? t.cache :
|
|
2431
|
-
return
|
|
2454
|
+
var n = t && t.cache ? t.cache : Nt, r = t && t.serializer ? t.serializer : _t, a = t && t.strategy ? t.strategy : Ht;
|
|
2455
|
+
return a(e, {
|
|
2432
2456
|
cache: n,
|
|
2433
2457
|
serializer: r
|
|
2434
2458
|
});
|
|
2435
2459
|
}
|
|
2436
|
-
function
|
|
2460
|
+
function St(e) {
|
|
2437
2461
|
return e == null || typeof e == "number" || typeof e == "boolean";
|
|
2438
2462
|
}
|
|
2439
|
-
function
|
|
2440
|
-
var
|
|
2441
|
-
return typeof
|
|
2463
|
+
function we(e, t, n, r) {
|
|
2464
|
+
var a = St(r) ? r : n(r), i = t.get(a);
|
|
2465
|
+
return typeof i > "u" && (i = e.call(this, r), t.set(a, i)), i;
|
|
2442
2466
|
}
|
|
2443
|
-
function
|
|
2444
|
-
var r = Array.prototype.slice.call(arguments, 3),
|
|
2445
|
-
return typeof
|
|
2467
|
+
function De(e, t, n) {
|
|
2468
|
+
var r = Array.prototype.slice.call(arguments, 3), a = n(r), i = t.get(a);
|
|
2469
|
+
return typeof i > "u" && (i = e.apply(this, r), t.set(a, i)), i;
|
|
2446
2470
|
}
|
|
2447
|
-
function
|
|
2448
|
-
return n.bind(t, e, r,
|
|
2471
|
+
function ae(e, t, n, r, a) {
|
|
2472
|
+
return n.bind(t, e, r, a);
|
|
2449
2473
|
}
|
|
2450
|
-
function
|
|
2451
|
-
var n = e.length === 1 ?
|
|
2452
|
-
return
|
|
2474
|
+
function Ht(e, t) {
|
|
2475
|
+
var n = e.length === 1 ? we : De;
|
|
2476
|
+
return ae(e, this, n, t.cache.create(), t.serializer);
|
|
2453
2477
|
}
|
|
2454
|
-
function
|
|
2455
|
-
return
|
|
2478
|
+
function It(e, t) {
|
|
2479
|
+
return ae(e, this, De, t.cache.create(), t.serializer);
|
|
2456
2480
|
}
|
|
2457
|
-
function
|
|
2458
|
-
return
|
|
2481
|
+
function At(e, t) {
|
|
2482
|
+
return ae(e, this, we, t.cache.create(), t.serializer);
|
|
2459
2483
|
}
|
|
2460
|
-
var
|
|
2484
|
+
var _t = function() {
|
|
2461
2485
|
return JSON.stringify(arguments);
|
|
2462
2486
|
};
|
|
2463
|
-
function
|
|
2487
|
+
function ie() {
|
|
2464
2488
|
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2465
2489
|
}
|
|
2466
|
-
|
|
2490
|
+
ie.prototype.get = function(e) {
|
|
2467
2491
|
return this.cache[e];
|
|
2468
2492
|
};
|
|
2469
|
-
|
|
2493
|
+
ie.prototype.set = function(e, t) {
|
|
2470
2494
|
this.cache[e] = t;
|
|
2471
2495
|
};
|
|
2472
|
-
var
|
|
2496
|
+
var Nt = {
|
|
2473
2497
|
create: function() {
|
|
2474
|
-
return new
|
|
2498
|
+
return new ie();
|
|
2475
2499
|
}
|
|
2476
|
-
},
|
|
2477
|
-
variadic:
|
|
2478
|
-
monadic:
|
|
2479
|
-
},
|
|
2500
|
+
}, _ = {
|
|
2501
|
+
variadic: It,
|
|
2502
|
+
monadic: At
|
|
2503
|
+
}, B;
|
|
2480
2504
|
(function(e) {
|
|
2481
2505
|
e.MISSING_VALUE = "MISSING_VALUE", e.INVALID_VALUE = "INVALID_VALUE", e.MISSING_INTL_API = "MISSING_INTL_API";
|
|
2482
|
-
})(
|
|
2483
|
-
var
|
|
2506
|
+
})(B || (B = {}));
|
|
2507
|
+
var P = (
|
|
2484
2508
|
/** @class */
|
|
2485
2509
|
function(e) {
|
|
2486
|
-
|
|
2487
|
-
function t(n, r,
|
|
2488
|
-
var
|
|
2489
|
-
return
|
|
2510
|
+
X(t, e);
|
|
2511
|
+
function t(n, r, a) {
|
|
2512
|
+
var i = e.call(this, n) || this;
|
|
2513
|
+
return i.code = r, i.originalMessage = a, i;
|
|
2490
2514
|
}
|
|
2491
2515
|
return t.prototype.toString = function() {
|
|
2492
2516
|
return "[formatjs Error: ".concat(this.code, "] ").concat(this.message);
|
|
2493
2517
|
}, t;
|
|
2494
2518
|
}(Error)
|
|
2495
|
-
),
|
|
2519
|
+
), ge = (
|
|
2496
2520
|
/** @class */
|
|
2497
2521
|
function(e) {
|
|
2498
|
-
|
|
2499
|
-
function t(n, r,
|
|
2500
|
-
return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(r, '". Options are "').concat(Object.keys(
|
|
2522
|
+
X(t, e);
|
|
2523
|
+
function t(n, r, a, i) {
|
|
2524
|
+
return e.call(this, 'Invalid values for "'.concat(n, '": "').concat(r, '". Options are "').concat(Object.keys(a).join('", "'), '"'), B.INVALID_VALUE, i) || this;
|
|
2501
2525
|
}
|
|
2502
2526
|
return t;
|
|
2503
|
-
}(
|
|
2504
|
-
),
|
|
2527
|
+
}(P)
|
|
2528
|
+
), Bt = (
|
|
2505
2529
|
/** @class */
|
|
2506
2530
|
function(e) {
|
|
2507
|
-
|
|
2508
|
-
function t(n, r,
|
|
2509
|
-
return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(r),
|
|
2531
|
+
X(t, e);
|
|
2532
|
+
function t(n, r, a) {
|
|
2533
|
+
return e.call(this, 'Value for "'.concat(n, '" must be of type ').concat(r), B.INVALID_VALUE, a) || this;
|
|
2510
2534
|
}
|
|
2511
2535
|
return t;
|
|
2512
|
-
}(
|
|
2513
|
-
),
|
|
2536
|
+
}(P)
|
|
2537
|
+
), Pt = (
|
|
2514
2538
|
/** @class */
|
|
2515
2539
|
function(e) {
|
|
2516
|
-
|
|
2540
|
+
X(t, e);
|
|
2517
2541
|
function t(n, r) {
|
|
2518
|
-
return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(r, '"'),
|
|
2542
|
+
return e.call(this, 'The intl string context variable "'.concat(n, '" was not provided to the string "').concat(r, '"'), B.MISSING_VALUE, r) || this;
|
|
2519
2543
|
}
|
|
2520
2544
|
return t;
|
|
2521
|
-
}(
|
|
2545
|
+
}(P)
|
|
2522
2546
|
), S;
|
|
2523
2547
|
(function(e) {
|
|
2524
2548
|
e[e.literal = 0] = "literal", e[e.object = 1] = "object";
|
|
2525
2549
|
})(S || (S = {}));
|
|
2526
|
-
function
|
|
2550
|
+
function Ot(e) {
|
|
2527
2551
|
return e.length < 2 ? e : e.reduce(function(t, n) {
|
|
2528
2552
|
var r = t[t.length - 1];
|
|
2529
2553
|
return !r || r.type !== S.literal || n.type !== S.literal ? t.push(n) : r.value += n.value, t;
|
|
2530
2554
|
}, []);
|
|
2531
2555
|
}
|
|
2532
|
-
function
|
|
2556
|
+
function Rt(e) {
|
|
2533
2557
|
return typeof e == "function";
|
|
2534
2558
|
}
|
|
2535
|
-
function k(e, t, n, r,
|
|
2536
|
-
if (e.length === 1 &&
|
|
2559
|
+
function k(e, t, n, r, a, i, o) {
|
|
2560
|
+
if (e.length === 1 && ue(e[0]))
|
|
2537
2561
|
return [
|
|
2538
2562
|
{
|
|
2539
2563
|
type: S.literal,
|
|
@@ -2542,105 +2566,105 @@ function k(e, t, n, r, i, a, o) {
|
|
|
2542
2566
|
];
|
|
2543
2567
|
for (var s = [], u = 0, l = e; u < l.length; u++) {
|
|
2544
2568
|
var h = l[u];
|
|
2545
|
-
if (
|
|
2569
|
+
if (ue(h)) {
|
|
2546
2570
|
s.push({
|
|
2547
2571
|
type: S.literal,
|
|
2548
2572
|
value: h.value
|
|
2549
2573
|
});
|
|
2550
2574
|
continue;
|
|
2551
2575
|
}
|
|
2552
|
-
if (
|
|
2553
|
-
typeof
|
|
2576
|
+
if ($e(h)) {
|
|
2577
|
+
typeof i == "number" && s.push({
|
|
2554
2578
|
type: S.literal,
|
|
2555
|
-
value: n.getNumberFormat(t).format(
|
|
2579
|
+
value: n.getNumberFormat(t).format(i)
|
|
2556
2580
|
});
|
|
2557
2581
|
continue;
|
|
2558
2582
|
}
|
|
2559
|
-
var
|
|
2560
|
-
if (!(
|
|
2561
|
-
throw new
|
|
2562
|
-
var c =
|
|
2563
|
-
if (
|
|
2583
|
+
var f = h.value;
|
|
2584
|
+
if (!(a && f in a))
|
|
2585
|
+
throw new Pt(f, o);
|
|
2586
|
+
var c = a[f];
|
|
2587
|
+
if (ze(h)) {
|
|
2564
2588
|
(!c || typeof c == "string" || typeof c == "number") && (c = typeof c == "string" || typeof c == "number" ? String(c) : ""), s.push({
|
|
2565
2589
|
type: typeof c == "string" ? S.literal : S.object,
|
|
2566
2590
|
value: c
|
|
2567
2591
|
});
|
|
2568
2592
|
continue;
|
|
2569
2593
|
}
|
|
2570
|
-
if (
|
|
2571
|
-
var E = typeof h.style == "string" ? r.date[h.style] :
|
|
2594
|
+
if (Se(h)) {
|
|
2595
|
+
var E = typeof h.style == "string" ? r.date[h.style] : Y(h.style) ? h.style.parsedOptions : void 0;
|
|
2572
2596
|
s.push({
|
|
2573
2597
|
type: S.literal,
|
|
2574
2598
|
value: n.getDateTimeFormat(t, E).format(c)
|
|
2575
2599
|
});
|
|
2576
2600
|
continue;
|
|
2577
2601
|
}
|
|
2578
|
-
if (
|
|
2579
|
-
var E = typeof h.style == "string" ? r.time[h.style] :
|
|
2602
|
+
if (He(h)) {
|
|
2603
|
+
var E = typeof h.style == "string" ? r.time[h.style] : Y(h.style) ? h.style.parsedOptions : r.time.medium;
|
|
2580
2604
|
s.push({
|
|
2581
2605
|
type: S.literal,
|
|
2582
2606
|
value: n.getDateTimeFormat(t, E).format(c)
|
|
2583
2607
|
});
|
|
2584
2608
|
continue;
|
|
2585
2609
|
}
|
|
2586
|
-
if (
|
|
2587
|
-
var E = typeof h.style == "string" ? r.number[h.style] :
|
|
2610
|
+
if (Te(h)) {
|
|
2611
|
+
var E = typeof h.style == "string" ? r.number[h.style] : Ne(h.style) ? h.style.parsedOptions : void 0;
|
|
2588
2612
|
E && E.scale && (c = c * (E.scale || 1)), s.push({
|
|
2589
2613
|
type: S.literal,
|
|
2590
2614
|
value: n.getNumberFormat(t, E).format(c)
|
|
2591
2615
|
});
|
|
2592
2616
|
continue;
|
|
2593
2617
|
}
|
|
2594
|
-
if (
|
|
2595
|
-
var
|
|
2596
|
-
if (!
|
|
2597
|
-
throw new
|
|
2598
|
-
var
|
|
2599
|
-
return
|
|
2618
|
+
if (_e(h)) {
|
|
2619
|
+
var x = h.children, g = h.value, d = a[g];
|
|
2620
|
+
if (!Rt(d))
|
|
2621
|
+
throw new Bt(g, "function", o);
|
|
2622
|
+
var y = k(x, t, n, r, a, i), H = d(y.map(function(O) {
|
|
2623
|
+
return O.value;
|
|
2600
2624
|
}));
|
|
2601
|
-
Array.isArray(H) || (H = [H]), s.push.apply(s, H.map(function(
|
|
2625
|
+
Array.isArray(H) || (H = [H]), s.push.apply(s, H.map(function(O) {
|
|
2602
2626
|
return {
|
|
2603
|
-
type: typeof
|
|
2604
|
-
value:
|
|
2627
|
+
type: typeof O == "string" ? S.literal : S.object,
|
|
2628
|
+
value: O
|
|
2605
2629
|
};
|
|
2606
2630
|
}));
|
|
2607
2631
|
}
|
|
2608
|
-
if (
|
|
2632
|
+
if (Ie(h)) {
|
|
2609
2633
|
var T = h.options[c] || h.options.other;
|
|
2610
2634
|
if (!T)
|
|
2611
|
-
throw new
|
|
2612
|
-
s.push.apply(s, k(T.value, t, n, r,
|
|
2635
|
+
throw new ge(h.value, c, Object.keys(h.options), o);
|
|
2636
|
+
s.push.apply(s, k(T.value, t, n, r, a));
|
|
2613
2637
|
continue;
|
|
2614
2638
|
}
|
|
2615
|
-
if (
|
|
2639
|
+
if (Ae(h)) {
|
|
2616
2640
|
var T = h.options["=".concat(c)];
|
|
2617
2641
|
if (!T) {
|
|
2618
2642
|
if (!Intl.PluralRules)
|
|
2619
|
-
throw new
|
|
2643
|
+
throw new P(`Intl.PluralRules is not available in this environment.
|
|
2620
2644
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2621
|
-
`,
|
|
2622
|
-
var
|
|
2623
|
-
T = h.options[
|
|
2645
|
+
`, B.MISSING_INTL_API, o);
|
|
2646
|
+
var F = n.getPluralRules(t, { type: h.pluralType }).select(c - (h.offset || 0));
|
|
2647
|
+
T = h.options[F] || h.options.other;
|
|
2624
2648
|
}
|
|
2625
2649
|
if (!T)
|
|
2626
|
-
throw new
|
|
2627
|
-
s.push.apply(s, k(T.value, t, n, r,
|
|
2650
|
+
throw new ge(h.value, c, Object.keys(h.options), o);
|
|
2651
|
+
s.push.apply(s, k(T.value, t, n, r, a, c - (h.offset || 0)));
|
|
2628
2652
|
continue;
|
|
2629
2653
|
}
|
|
2630
2654
|
}
|
|
2631
|
-
return
|
|
2655
|
+
return Ot(s);
|
|
2632
2656
|
}
|
|
2633
|
-
function
|
|
2634
|
-
return t ?
|
|
2635
|
-
return n[r] =
|
|
2657
|
+
function Lt(e, t) {
|
|
2658
|
+
return t ? N(N(N({}, e || {}), t || {}), Object.keys(e).reduce(function(n, r) {
|
|
2659
|
+
return n[r] = N(N({}, e[r]), t[r] || {}), n;
|
|
2636
2660
|
}, {})) : e;
|
|
2637
2661
|
}
|
|
2638
|
-
function
|
|
2662
|
+
function Mt(e, t) {
|
|
2639
2663
|
return t ? Object.keys(e).reduce(function(n, r) {
|
|
2640
|
-
return n[r] =
|
|
2641
|
-
},
|
|
2664
|
+
return n[r] = Lt(e[r], t[r]), n;
|
|
2665
|
+
}, N({}, e)) : e;
|
|
2642
2666
|
}
|
|
2643
|
-
function
|
|
2667
|
+
function $(e) {
|
|
2644
2668
|
return {
|
|
2645
2669
|
create: function() {
|
|
2646
2670
|
return {
|
|
@@ -2654,7 +2678,7 @@ function W(e) {
|
|
|
2654
2678
|
}
|
|
2655
2679
|
};
|
|
2656
2680
|
}
|
|
2657
|
-
function
|
|
2681
|
+
function Ct(e) {
|
|
2658
2682
|
return e === void 0 && (e = {
|
|
2659
2683
|
number: {},
|
|
2660
2684
|
dateTime: {},
|
|
@@ -2663,67 +2687,67 @@ function Rt(e) {
|
|
|
2663
2687
|
getNumberFormat: A(function() {
|
|
2664
2688
|
for (var t, n = [], r = 0; r < arguments.length; r++)
|
|
2665
2689
|
n[r] = arguments[r];
|
|
2666
|
-
return new ((t = Intl.NumberFormat).bind.apply(t,
|
|
2690
|
+
return new ((t = Intl.NumberFormat).bind.apply(t, Z([void 0], n, !1)))();
|
|
2667
2691
|
}, {
|
|
2668
|
-
cache:
|
|
2669
|
-
strategy:
|
|
2692
|
+
cache: $(e.number),
|
|
2693
|
+
strategy: _.variadic
|
|
2670
2694
|
}),
|
|
2671
2695
|
getDateTimeFormat: A(function() {
|
|
2672
2696
|
for (var t, n = [], r = 0; r < arguments.length; r++)
|
|
2673
2697
|
n[r] = arguments[r];
|
|
2674
|
-
return new ((t = Intl.DateTimeFormat).bind.apply(t,
|
|
2698
|
+
return new ((t = Intl.DateTimeFormat).bind.apply(t, Z([void 0], n, !1)))();
|
|
2675
2699
|
}, {
|
|
2676
|
-
cache:
|
|
2677
|
-
strategy:
|
|
2700
|
+
cache: $(e.dateTime),
|
|
2701
|
+
strategy: _.variadic
|
|
2678
2702
|
}),
|
|
2679
2703
|
getPluralRules: A(function() {
|
|
2680
2704
|
for (var t, n = [], r = 0; r < arguments.length; r++)
|
|
2681
2705
|
n[r] = arguments[r];
|
|
2682
|
-
return new ((t = Intl.PluralRules).bind.apply(t,
|
|
2706
|
+
return new ((t = Intl.PluralRules).bind.apply(t, Z([void 0], n, !1)))();
|
|
2683
2707
|
}, {
|
|
2684
|
-
cache:
|
|
2685
|
-
strategy:
|
|
2708
|
+
cache: $(e.pluralRules),
|
|
2709
|
+
strategy: _.variadic
|
|
2686
2710
|
})
|
|
2687
2711
|
};
|
|
2688
2712
|
}
|
|
2689
|
-
var
|
|
2713
|
+
var Fe = (
|
|
2690
2714
|
/** @class */
|
|
2691
2715
|
function() {
|
|
2692
|
-
function e(t, n, r,
|
|
2693
|
-
var
|
|
2716
|
+
function e(t, n, r, a) {
|
|
2717
|
+
var i = this;
|
|
2694
2718
|
if (n === void 0 && (n = e.defaultLocale), this.formatterCache = {
|
|
2695
2719
|
number: {},
|
|
2696
2720
|
dateTime: {},
|
|
2697
2721
|
pluralRules: {}
|
|
2698
2722
|
}, this.format = function(u) {
|
|
2699
|
-
var l =
|
|
2723
|
+
var l = i.formatToParts(u);
|
|
2700
2724
|
if (l.length === 1)
|
|
2701
2725
|
return l[0].value;
|
|
2702
|
-
var h = l.reduce(function(
|
|
2703
|
-
return !
|
|
2726
|
+
var h = l.reduce(function(f, c) {
|
|
2727
|
+
return !f.length || c.type !== S.literal || typeof f[f.length - 1] != "string" ? f.push(c.value) : f[f.length - 1] += c.value, f;
|
|
2704
2728
|
}, []);
|
|
2705
2729
|
return h.length <= 1 ? h[0] || "" : h;
|
|
2706
2730
|
}, this.formatToParts = function(u) {
|
|
2707
|
-
return k(
|
|
2731
|
+
return k(i.ast, i.locales, i.formatters, i.formats, u, void 0, i.message);
|
|
2708
2732
|
}, this.resolvedOptions = function() {
|
|
2709
2733
|
var u;
|
|
2710
2734
|
return {
|
|
2711
|
-
locale: ((u =
|
|
2735
|
+
locale: ((u = i.resolvedLocale) === null || u === void 0 ? void 0 : u.toString()) || Intl.NumberFormat.supportedLocalesOf(i.locales)[0]
|
|
2712
2736
|
};
|
|
2713
2737
|
}, this.getAst = function() {
|
|
2714
|
-
return
|
|
2738
|
+
return i.ast;
|
|
2715
2739
|
}, this.locales = n, this.resolvedLocale = e.resolveLocale(n), typeof t == "string") {
|
|
2716
2740
|
if (this.message = t, !e.__parse)
|
|
2717
2741
|
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
2718
|
-
var o =
|
|
2742
|
+
var o = a || {};
|
|
2719
2743
|
o.formatters;
|
|
2720
|
-
var s =
|
|
2721
|
-
this.ast = e.__parse(t,
|
|
2744
|
+
var s = Ze(o, ["formatters"]);
|
|
2745
|
+
this.ast = e.__parse(t, N(N({}, s), { locale: this.resolvedLocale }));
|
|
2722
2746
|
} else
|
|
2723
2747
|
this.ast = t;
|
|
2724
2748
|
if (!Array.isArray(this.ast))
|
|
2725
2749
|
throw new TypeError("A message must be provided as a String or AST.");
|
|
2726
|
-
this.formats =
|
|
2750
|
+
this.formats = Mt(e.formats, r), this.formatters = a && a.formatters || Ct(this.formatterCache);
|
|
2727
2751
|
}
|
|
2728
2752
|
return Object.defineProperty(e, "defaultLocale", {
|
|
2729
2753
|
get: function() {
|
|
@@ -2736,7 +2760,7 @@ var Me = (
|
|
|
2736
2760
|
var n = Intl.NumberFormat.supportedLocalesOf(t);
|
|
2737
2761
|
return n.length > 0 ? new Intl.Locale(n[0]) : new Intl.Locale(typeof t == "string" ? t : t[0]);
|
|
2738
2762
|
}
|
|
2739
|
-
}, e.__parse =
|
|
2763
|
+
}, e.__parse = Tt, e.formats = {
|
|
2740
2764
|
number: {
|
|
2741
2765
|
integer: {
|
|
2742
2766
|
maximumFractionDigits: 0
|
|
@@ -2796,110 +2820,110 @@ var Me = (
|
|
|
2796
2820
|
}
|
|
2797
2821
|
}, e;
|
|
2798
2822
|
}()
|
|
2799
|
-
),
|
|
2823
|
+
), L;
|
|
2800
2824
|
(function(e) {
|
|
2801
2825
|
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";
|
|
2802
|
-
})(
|
|
2803
|
-
var
|
|
2826
|
+
})(L || (L = {}));
|
|
2827
|
+
var G = (
|
|
2804
2828
|
/** @class */
|
|
2805
2829
|
function(e) {
|
|
2806
|
-
|
|
2807
|
-
function t(n, r,
|
|
2808
|
-
var
|
|
2809
|
-
return
|
|
2830
|
+
M(t, e);
|
|
2831
|
+
function t(n, r, a) {
|
|
2832
|
+
var i = this, o = a ? a instanceof Error ? a : new Error(String(a)) : void 0;
|
|
2833
|
+
return i = e.call(this, "[@formatjs/intl Error ".concat(n, "] ").concat(r, `
|
|
2810
2834
|
`).concat(o ? `
|
|
2811
2835
|
`.concat(o.message, `
|
|
2812
|
-
`).concat(o.stack) : "")) || this,
|
|
2836
|
+
`).concat(o.stack) : "")) || this, i.code = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(i, t), i;
|
|
2813
2837
|
}
|
|
2814
2838
|
return t;
|
|
2815
2839
|
}(Error)
|
|
2816
|
-
),
|
|
2840
|
+
), wt = (
|
|
2817
2841
|
/** @class */
|
|
2818
2842
|
function(e) {
|
|
2819
|
-
|
|
2843
|
+
M(t, e);
|
|
2820
2844
|
function t(n, r) {
|
|
2821
|
-
return e.call(this,
|
|
2845
|
+
return e.call(this, L.UNSUPPORTED_FORMATTER, n, r) || this;
|
|
2822
2846
|
}
|
|
2823
2847
|
return t;
|
|
2824
|
-
}(
|
|
2825
|
-
),
|
|
2848
|
+
}(G)
|
|
2849
|
+
), Dt = (
|
|
2826
2850
|
/** @class */
|
|
2827
2851
|
function(e) {
|
|
2828
|
-
|
|
2852
|
+
M(t, e);
|
|
2829
2853
|
function t(n, r) {
|
|
2830
|
-
return e.call(this,
|
|
2854
|
+
return e.call(this, L.INVALID_CONFIG, n, r) || this;
|
|
2831
2855
|
}
|
|
2832
2856
|
return t;
|
|
2833
|
-
}(
|
|
2834
|
-
),
|
|
2857
|
+
}(G)
|
|
2858
|
+
), ve = (
|
|
2835
2859
|
/** @class */
|
|
2836
2860
|
function(e) {
|
|
2837
|
-
|
|
2861
|
+
M(t, e);
|
|
2838
2862
|
function t(n, r) {
|
|
2839
|
-
return e.call(this,
|
|
2863
|
+
return e.call(this, L.MISSING_DATA, n, r) || this;
|
|
2840
2864
|
}
|
|
2841
2865
|
return t;
|
|
2842
|
-
}(
|
|
2866
|
+
}(G)
|
|
2843
2867
|
), I = (
|
|
2844
2868
|
/** @class */
|
|
2845
2869
|
function(e) {
|
|
2846
|
-
|
|
2847
|
-
function t(n, r,
|
|
2848
|
-
var
|
|
2870
|
+
M(t, e);
|
|
2871
|
+
function t(n, r, a) {
|
|
2872
|
+
var i = e.call(this, L.FORMAT_ERROR, "".concat(n, `
|
|
2849
2873
|
Locale: `).concat(r, `
|
|
2850
|
-
`),
|
|
2851
|
-
return
|
|
2874
|
+
`), a) || this;
|
|
2875
|
+
return i.locale = r, i;
|
|
2852
2876
|
}
|
|
2853
2877
|
return t;
|
|
2854
|
-
}(
|
|
2855
|
-
),
|
|
2878
|
+
}(G)
|
|
2879
|
+
), J = (
|
|
2856
2880
|
/** @class */
|
|
2857
2881
|
function(e) {
|
|
2858
|
-
|
|
2859
|
-
function t(n, r,
|
|
2882
|
+
M(t, e);
|
|
2883
|
+
function t(n, r, a, i) {
|
|
2860
2884
|
var o = e.call(this, "".concat(n, `
|
|
2861
|
-
MessageID: `).concat(
|
|
2862
|
-
Default Message: `).concat(
|
|
2863
|
-
Description: `).concat(
|
|
2864
|
-
`), r,
|
|
2865
|
-
return o.descriptor =
|
|
2885
|
+
MessageID: `).concat(a == null ? void 0 : a.id, `
|
|
2886
|
+
Default Message: `).concat(a == null ? void 0 : a.defaultMessage, `
|
|
2887
|
+
Description: `).concat(a == null ? void 0 : a.description, `
|
|
2888
|
+
`), r, i) || this;
|
|
2889
|
+
return o.descriptor = a, o.locale = r, o;
|
|
2866
2890
|
}
|
|
2867
2891
|
return t;
|
|
2868
2892
|
}(I)
|
|
2869
|
-
),
|
|
2893
|
+
), Ft = (
|
|
2870
2894
|
/** @class */
|
|
2871
2895
|
function(e) {
|
|
2872
|
-
|
|
2896
|
+
M(t, e);
|
|
2873
2897
|
function t(n, r) {
|
|
2874
|
-
var
|
|
2898
|
+
var a = e.call(this, L.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) {
|
|
2875
2899
|
var o;
|
|
2876
|
-
return (o =
|
|
2900
|
+
return (o = i.value) !== null && o !== void 0 ? o : JSON.stringify(i);
|
|
2877
2901
|
}).join(), ")") : "id", " as fallback.")) || this;
|
|
2878
|
-
return
|
|
2902
|
+
return a.descriptor = n, a;
|
|
2879
2903
|
}
|
|
2880
2904
|
return t;
|
|
2881
|
-
}(
|
|
2905
|
+
}(G)
|
|
2882
2906
|
);
|
|
2883
2907
|
function C(e, t, n) {
|
|
2884
|
-
return n === void 0 && (n = {}), t.reduce(function(r,
|
|
2885
|
-
return
|
|
2908
|
+
return n === void 0 && (n = {}), t.reduce(function(r, a) {
|
|
2909
|
+
return a in e ? r[a] = e[a] : a in n && (r[a] = n[a]), r;
|
|
2886
2910
|
}, {});
|
|
2887
2911
|
}
|
|
2888
|
-
var
|
|
2912
|
+
var Gt = function(e) {
|
|
2889
2913
|
process.env.NODE_ENV !== "production" && console.error(e);
|
|
2890
|
-
},
|
|
2914
|
+
}, Ut = function(e) {
|
|
2891
2915
|
process.env.NODE_ENV !== "production" && console.warn(e);
|
|
2892
|
-
},
|
|
2916
|
+
}, Vt = {
|
|
2893
2917
|
formats: {},
|
|
2894
2918
|
messages: {},
|
|
2895
2919
|
timeZone: void 0,
|
|
2896
2920
|
defaultLocale: "en",
|
|
2897
2921
|
defaultFormats: {},
|
|
2898
2922
|
fallbackOnEmptyString: !0,
|
|
2899
|
-
onError:
|
|
2900
|
-
onWarn:
|
|
2923
|
+
onError: Gt,
|
|
2924
|
+
onWarn: Ut
|
|
2901
2925
|
};
|
|
2902
|
-
function
|
|
2926
|
+
function Ge() {
|
|
2903
2927
|
return {
|
|
2904
2928
|
dateTime: {},
|
|
2905
2929
|
number: {},
|
|
@@ -2910,7 +2934,7 @@ function Ce() {
|
|
|
2910
2934
|
displayNames: {}
|
|
2911
2935
|
};
|
|
2912
2936
|
}
|
|
2913
|
-
function
|
|
2937
|
+
function R(e) {
|
|
2914
2938
|
return {
|
|
2915
2939
|
create: function() {
|
|
2916
2940
|
return {
|
|
@@ -2924,139 +2948,139 @@ function O(e) {
|
|
|
2924
2948
|
}
|
|
2925
2949
|
};
|
|
2926
2950
|
}
|
|
2927
|
-
function
|
|
2928
|
-
e === void 0 && (e =
|
|
2929
|
-
var t = Intl.RelativeTimeFormat, n = Intl.ListFormat, r = Intl.DisplayNames,
|
|
2951
|
+
function jt(e) {
|
|
2952
|
+
e === void 0 && (e = Ge());
|
|
2953
|
+
var t = Intl.RelativeTimeFormat, n = Intl.ListFormat, r = Intl.DisplayNames, a = A(function() {
|
|
2930
2954
|
for (var s, u = [], l = 0; l < arguments.length; l++)
|
|
2931
2955
|
u[l] = arguments[l];
|
|
2932
|
-
return new ((s = Intl.DateTimeFormat).bind.apply(s,
|
|
2956
|
+
return new ((s = Intl.DateTimeFormat).bind.apply(s, w([void 0], u, !1)))();
|
|
2933
2957
|
}, {
|
|
2934
|
-
cache:
|
|
2935
|
-
strategy:
|
|
2936
|
-
}),
|
|
2958
|
+
cache: R(e.dateTime),
|
|
2959
|
+
strategy: _.variadic
|
|
2960
|
+
}), i = A(function() {
|
|
2937
2961
|
for (var s, u = [], l = 0; l < arguments.length; l++)
|
|
2938
2962
|
u[l] = arguments[l];
|
|
2939
|
-
return new ((s = Intl.NumberFormat).bind.apply(s,
|
|
2963
|
+
return new ((s = Intl.NumberFormat).bind.apply(s, w([void 0], u, !1)))();
|
|
2940
2964
|
}, {
|
|
2941
|
-
cache:
|
|
2942
|
-
strategy:
|
|
2965
|
+
cache: R(e.number),
|
|
2966
|
+
strategy: _.variadic
|
|
2943
2967
|
}), o = A(function() {
|
|
2944
2968
|
for (var s, u = [], l = 0; l < arguments.length; l++)
|
|
2945
2969
|
u[l] = arguments[l];
|
|
2946
|
-
return new ((s = Intl.PluralRules).bind.apply(s,
|
|
2970
|
+
return new ((s = Intl.PluralRules).bind.apply(s, w([void 0], u, !1)))();
|
|
2947
2971
|
}, {
|
|
2948
|
-
cache:
|
|
2949
|
-
strategy:
|
|
2972
|
+
cache: R(e.pluralRules),
|
|
2973
|
+
strategy: _.variadic
|
|
2950
2974
|
});
|
|
2951
2975
|
return {
|
|
2952
|
-
getDateTimeFormat:
|
|
2953
|
-
getNumberFormat:
|
|
2976
|
+
getDateTimeFormat: a,
|
|
2977
|
+
getNumberFormat: i,
|
|
2954
2978
|
getMessageFormat: A(function(s, u, l, h) {
|
|
2955
|
-
return new
|
|
2956
|
-
getNumberFormat:
|
|
2957
|
-
getDateTimeFormat:
|
|
2979
|
+
return new Fe(s, u, l, m({ formatters: {
|
|
2980
|
+
getNumberFormat: i,
|
|
2981
|
+
getDateTimeFormat: a,
|
|
2958
2982
|
getPluralRules: o
|
|
2959
2983
|
} }, h || {}));
|
|
2960
2984
|
}, {
|
|
2961
|
-
cache:
|
|
2962
|
-
strategy:
|
|
2985
|
+
cache: R(e.message),
|
|
2986
|
+
strategy: _.variadic
|
|
2963
2987
|
}),
|
|
2964
2988
|
getRelativeTimeFormat: A(function() {
|
|
2965
2989
|
for (var s = [], u = 0; u < arguments.length; u++)
|
|
2966
2990
|
s[u] = arguments[u];
|
|
2967
|
-
return new (t.bind.apply(t,
|
|
2991
|
+
return new (t.bind.apply(t, w([void 0], s, !1)))();
|
|
2968
2992
|
}, {
|
|
2969
|
-
cache:
|
|
2970
|
-
strategy:
|
|
2993
|
+
cache: R(e.relativeTime),
|
|
2994
|
+
strategy: _.variadic
|
|
2971
2995
|
}),
|
|
2972
2996
|
getPluralRules: o,
|
|
2973
2997
|
getListFormat: A(function() {
|
|
2974
2998
|
for (var s = [], u = 0; u < arguments.length; u++)
|
|
2975
2999
|
s[u] = arguments[u];
|
|
2976
|
-
return new (n.bind.apply(n,
|
|
3000
|
+
return new (n.bind.apply(n, w([void 0], s, !1)))();
|
|
2977
3001
|
}, {
|
|
2978
|
-
cache:
|
|
2979
|
-
strategy:
|
|
3002
|
+
cache: R(e.list),
|
|
3003
|
+
strategy: _.variadic
|
|
2980
3004
|
}),
|
|
2981
3005
|
getDisplayNames: A(function() {
|
|
2982
3006
|
for (var s = [], u = 0; u < arguments.length; u++)
|
|
2983
3007
|
s[u] = arguments[u];
|
|
2984
|
-
return new (r.bind.apply(r,
|
|
3008
|
+
return new (r.bind.apply(r, w([void 0], s, !1)))();
|
|
2985
3009
|
}, {
|
|
2986
|
-
cache:
|
|
2987
|
-
strategy:
|
|
3010
|
+
cache: R(e.displayNames),
|
|
3011
|
+
strategy: _.variadic
|
|
2988
3012
|
})
|
|
2989
3013
|
};
|
|
2990
3014
|
}
|
|
2991
|
-
function
|
|
2992
|
-
var
|
|
2993
|
-
if (
|
|
2994
|
-
return
|
|
2995
|
-
r(new
|
|
3015
|
+
function oe(e, t, n, r) {
|
|
3016
|
+
var a = e && e[t], i;
|
|
3017
|
+
if (a && (i = a[n]), i)
|
|
3018
|
+
return i;
|
|
3019
|
+
r(new wt("No ".concat(t, " format named: ").concat(n)));
|
|
2996
3020
|
}
|
|
2997
|
-
function
|
|
3021
|
+
function kt(e, t, n) {
|
|
2998
3022
|
if (n === void 0 && (n = Error), !e)
|
|
2999
3023
|
throw new n(t);
|
|
3000
3024
|
}
|
|
3001
|
-
function
|
|
3025
|
+
function j(e, t) {
|
|
3002
3026
|
return Object.keys(e).reduce(function(n, r) {
|
|
3003
|
-
return n[r] =
|
|
3027
|
+
return n[r] = m({ timeZone: t }, e[r]), n;
|
|
3004
3028
|
}, {});
|
|
3005
3029
|
}
|
|
3006
|
-
function
|
|
3007
|
-
var n = Object.keys(
|
|
3008
|
-
return n.reduce(function(r,
|
|
3009
|
-
return r[
|
|
3030
|
+
function Ee(e, t) {
|
|
3031
|
+
var n = Object.keys(m(m({}, e), t));
|
|
3032
|
+
return n.reduce(function(r, a) {
|
|
3033
|
+
return r[a] = m(m({}, e[a] || {}), t[a] || {}), r;
|
|
3010
3034
|
}, {});
|
|
3011
3035
|
}
|
|
3012
|
-
function
|
|
3036
|
+
function de(e, t) {
|
|
3013
3037
|
if (!t)
|
|
3014
3038
|
return e;
|
|
3015
|
-
var n =
|
|
3016
|
-
return
|
|
3039
|
+
var n = Fe.formats;
|
|
3040
|
+
return m(m(m({}, n), e), { date: Ee(j(n.date, t), j(e.date || {}, t)), time: Ee(j(n.time, t), j(e.time || {}, t)) });
|
|
3017
3041
|
}
|
|
3018
|
-
var
|
|
3019
|
-
var
|
|
3042
|
+
var be = function(e, t, n, r, a) {
|
|
3043
|
+
var i = e.locale, o = e.formats, s = e.messages, u = e.defaultLocale, l = e.defaultFormats, h = e.fallbackOnEmptyString, f = e.onError, c = e.timeZone, E = e.defaultRichTextElements;
|
|
3020
3044
|
n === void 0 && (n = { id: "" });
|
|
3021
|
-
var
|
|
3022
|
-
|
|
3023
|
-
var
|
|
3045
|
+
var x = n.id, g = n.defaultMessage;
|
|
3046
|
+
kt(!!x, "[@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");
|
|
3047
|
+
var d = String(x), y = (
|
|
3024
3048
|
// In case messages is Object.create(null)
|
|
3025
3049
|
// e.g import('foo.json') from webpack)
|
|
3026
3050
|
// See https://github.com/formatjs/formatjs/issues/1914
|
|
3027
|
-
s && Object.prototype.hasOwnProperty.call(s,
|
|
3051
|
+
s && Object.prototype.hasOwnProperty.call(s, d) && s[d]
|
|
3028
3052
|
);
|
|
3029
|
-
if (Array.isArray(
|
|
3030
|
-
return
|
|
3031
|
-
if (!r &&
|
|
3032
|
-
return
|
|
3033
|
-
if (r =
|
|
3034
|
-
if (h === !1 &&
|
|
3035
|
-
return
|
|
3036
|
-
if ((!
|
|
3053
|
+
if (Array.isArray(y) && y.length === 1 && y[0].type === b.literal)
|
|
3054
|
+
return y[0].value;
|
|
3055
|
+
if (!r && y && typeof y == "string" && !E)
|
|
3056
|
+
return y.replace(/'\{(.*?)\}'/gi, "{$1}");
|
|
3057
|
+
if (r = m(m({}, E), r || {}), o = de(o, c), l = de(l, c), !y) {
|
|
3058
|
+
if (h === !1 && y === "")
|
|
3059
|
+
return y;
|
|
3060
|
+
if ((!g || i && i.toLowerCase() !== u.toLowerCase()) && f(new Ft(n, i)), g)
|
|
3037
3061
|
try {
|
|
3038
|
-
var H = t.getMessageFormat(
|
|
3062
|
+
var H = t.getMessageFormat(g, u, l, a);
|
|
3039
3063
|
return H.format(r);
|
|
3040
3064
|
} catch (T) {
|
|
3041
|
-
return
|
|
3065
|
+
return f(new J('Error formatting default message for: "'.concat(d, '", rendering default message verbatim'), i, n, T)), typeof g == "string" ? g : d;
|
|
3042
3066
|
}
|
|
3043
|
-
return
|
|
3067
|
+
return d;
|
|
3044
3068
|
}
|
|
3045
3069
|
try {
|
|
3046
|
-
var H = t.getMessageFormat(
|
|
3070
|
+
var H = t.getMessageFormat(y, i, o, m({ formatters: t }, a || {}));
|
|
3047
3071
|
return H.format(r);
|
|
3048
3072
|
} catch (T) {
|
|
3049
|
-
|
|
3073
|
+
f(new J('Error formatting message: "'.concat(d, '", using ').concat(g ? "default message" : "id", " as fallback."), i, n, T));
|
|
3050
3074
|
}
|
|
3051
|
-
if (
|
|
3075
|
+
if (g)
|
|
3052
3076
|
try {
|
|
3053
|
-
var H = t.getMessageFormat(
|
|
3077
|
+
var H = t.getMessageFormat(g, u, l, a);
|
|
3054
3078
|
return H.format(r);
|
|
3055
3079
|
} catch (T) {
|
|
3056
|
-
|
|
3080
|
+
f(new J('Error formatting the default message for: "'.concat(d, '", rendering message verbatim'), i, n, T));
|
|
3057
3081
|
}
|
|
3058
|
-
return typeof
|
|
3059
|
-
},
|
|
3082
|
+
return typeof y == "string" ? y : typeof g == "string" ? g : d;
|
|
3083
|
+
}, Ue = [
|
|
3060
3084
|
"formatMatcher",
|
|
3061
3085
|
"timeZone",
|
|
3062
3086
|
"hour12",
|
|
@@ -3077,159 +3101,159 @@ var pe = function(e, t, n, r, i) {
|
|
|
3077
3101
|
"numberingSystem",
|
|
3078
3102
|
"fractionalSecondDigits"
|
|
3079
3103
|
];
|
|
3080
|
-
function
|
|
3081
|
-
var
|
|
3104
|
+
function W(e, t, n, r) {
|
|
3105
|
+
var a = e.locale, i = e.formats, o = e.onError, s = e.timeZone;
|
|
3082
3106
|
r === void 0 && (r = {});
|
|
3083
|
-
var u = r.format, l =
|
|
3084
|
-
return t === "time" && !h.hour && !h.minute && !h.second && !h.timeStyle && !h.dateStyle && (h =
|
|
3107
|
+
var u = r.format, l = m(m({}, s && { timeZone: s }), u && oe(i, t, u, o)), h = C(r, Ue, l);
|
|
3108
|
+
return t === "time" && !h.hour && !h.minute && !h.second && !h.timeStyle && !h.dateStyle && (h = m(m({}, h), { hour: "numeric", minute: "numeric" })), n(a, h);
|
|
3085
3109
|
}
|
|
3086
|
-
function
|
|
3110
|
+
function Xt(e, t) {
|
|
3087
3111
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3088
3112
|
n[r - 2] = arguments[r];
|
|
3089
|
-
var
|
|
3113
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3090
3114
|
try {
|
|
3091
|
-
return
|
|
3115
|
+
return W(e, "date", t, o).format(s);
|
|
3092
3116
|
} catch (u) {
|
|
3093
3117
|
e.onError(new I("Error formatting date.", e.locale, u));
|
|
3094
3118
|
}
|
|
3095
3119
|
return String(s);
|
|
3096
3120
|
}
|
|
3097
|
-
function
|
|
3121
|
+
function Wt(e, t) {
|
|
3098
3122
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3099
3123
|
n[r - 2] = arguments[r];
|
|
3100
|
-
var
|
|
3124
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3101
3125
|
try {
|
|
3102
|
-
return
|
|
3126
|
+
return W(e, "time", t, o).format(s);
|
|
3103
3127
|
} catch (u) {
|
|
3104
3128
|
e.onError(new I("Error formatting time.", e.locale, u));
|
|
3105
3129
|
}
|
|
3106
3130
|
return String(s);
|
|
3107
3131
|
}
|
|
3108
|
-
function
|
|
3132
|
+
function Zt(e, t) {
|
|
3109
3133
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3110
3134
|
n[r - 2] = arguments[r];
|
|
3111
|
-
var
|
|
3135
|
+
var a = n[0], i = n[1], o = n[2], s = o === void 0 ? {} : o, u = e.timeZone, l = e.locale, h = e.onError, f = C(s, Ue, u ? { timeZone: u } : {});
|
|
3112
3136
|
try {
|
|
3113
|
-
return t(l,
|
|
3137
|
+
return t(l, f).formatRange(a, i);
|
|
3114
3138
|
} catch (c) {
|
|
3115
3139
|
h(new I("Error formatting date time range.", e.locale, c));
|
|
3116
3140
|
}
|
|
3117
|
-
return String(
|
|
3141
|
+
return String(a);
|
|
3118
3142
|
}
|
|
3119
|
-
function
|
|
3143
|
+
function zt(e, t) {
|
|
3120
3144
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3121
3145
|
n[r - 2] = arguments[r];
|
|
3122
|
-
var
|
|
3146
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3123
3147
|
try {
|
|
3124
|
-
return
|
|
3148
|
+
return W(e, "date", t, o).formatToParts(s);
|
|
3125
3149
|
} catch (u) {
|
|
3126
3150
|
e.onError(new I("Error formatting date.", e.locale, u));
|
|
3127
3151
|
}
|
|
3128
3152
|
return [];
|
|
3129
3153
|
}
|
|
3130
|
-
function
|
|
3154
|
+
function $t(e, t) {
|
|
3131
3155
|
for (var n = [], r = 2; r < arguments.length; r++)
|
|
3132
3156
|
n[r - 2] = arguments[r];
|
|
3133
|
-
var
|
|
3157
|
+
var a = n[0], i = n[1], o = i === void 0 ? {} : i, s = typeof a == "string" ? new Date(a || 0) : a;
|
|
3134
3158
|
try {
|
|
3135
|
-
return
|
|
3159
|
+
return W(e, "time", t, o).formatToParts(s);
|
|
3136
3160
|
} catch (u) {
|
|
3137
3161
|
e.onError(new I("Error formatting time.", e.locale, u));
|
|
3138
3162
|
}
|
|
3139
3163
|
return [];
|
|
3140
3164
|
}
|
|
3141
|
-
var
|
|
3165
|
+
var Jt = [
|
|
3142
3166
|
"style",
|
|
3143
3167
|
"type",
|
|
3144
3168
|
"fallback",
|
|
3145
3169
|
"languageDisplay"
|
|
3146
3170
|
];
|
|
3147
|
-
function
|
|
3148
|
-
var
|
|
3149
|
-
o ||
|
|
3171
|
+
function qt(e, t, n, r) {
|
|
3172
|
+
var a = e.locale, i = e.onError, o = Intl.DisplayNames;
|
|
3173
|
+
o || i(new P(`Intl.DisplayNames is not available in this environment.
|
|
3150
3174
|
Try polyfilling it using "@formatjs/intl-displaynames"
|
|
3151
|
-
`,
|
|
3152
|
-
var s = C(r,
|
|
3175
|
+
`, B.MISSING_INTL_API));
|
|
3176
|
+
var s = C(r, Jt);
|
|
3153
3177
|
try {
|
|
3154
|
-
return t(
|
|
3178
|
+
return t(a, s).of(n);
|
|
3155
3179
|
} catch (u) {
|
|
3156
|
-
|
|
3180
|
+
i(new I("Error formatting display name.", a, u));
|
|
3157
3181
|
}
|
|
3158
3182
|
}
|
|
3159
|
-
var
|
|
3183
|
+
var Qt = [
|
|
3160
3184
|
"type",
|
|
3161
3185
|
"style"
|
|
3162
|
-
],
|
|
3163
|
-
function
|
|
3164
|
-
return "".concat(
|
|
3186
|
+
], ye = Date.now();
|
|
3187
|
+
function Yt(e) {
|
|
3188
|
+
return "".concat(ye, "_").concat(e, "_").concat(ye);
|
|
3165
3189
|
}
|
|
3166
|
-
function
|
|
3190
|
+
function Kt(e, t, n, r) {
|
|
3167
3191
|
r === void 0 && (r = {});
|
|
3168
|
-
var
|
|
3192
|
+
var a = Ve(e, t, n, r).reduce(function(i, o) {
|
|
3169
3193
|
var s = o.value;
|
|
3170
|
-
return typeof s != "string" ?
|
|
3194
|
+
return typeof s != "string" ? i.push(s) : typeof i[i.length - 1] == "string" ? i[i.length - 1] += s : i.push(s), i;
|
|
3171
3195
|
}, []);
|
|
3172
|
-
return
|
|
3196
|
+
return a.length === 1 ? a[0] : a.length === 0 ? "" : a;
|
|
3173
3197
|
}
|
|
3174
|
-
function
|
|
3175
|
-
var
|
|
3198
|
+
function Ve(e, t, n, r) {
|
|
3199
|
+
var a = e.locale, i = e.onError;
|
|
3176
3200
|
r === void 0 && (r = {});
|
|
3177
3201
|
var o = Intl.ListFormat;
|
|
3178
|
-
o ||
|
|
3202
|
+
o || i(new P(`Intl.ListFormat is not available in this environment.
|
|
3179
3203
|
Try polyfilling it using "@formatjs/intl-listformat"
|
|
3180
|
-
`,
|
|
3181
|
-
var s = C(r,
|
|
3204
|
+
`, B.MISSING_INTL_API));
|
|
3205
|
+
var s = C(r, Qt);
|
|
3182
3206
|
try {
|
|
3183
|
-
var u = {}, l = n.map(function(h,
|
|
3207
|
+
var u = {}, l = n.map(function(h, f) {
|
|
3184
3208
|
if (typeof h == "object") {
|
|
3185
|
-
var c =
|
|
3209
|
+
var c = Yt(f);
|
|
3186
3210
|
return u[c] = h, c;
|
|
3187
3211
|
}
|
|
3188
3212
|
return String(h);
|
|
3189
3213
|
});
|
|
3190
|
-
return t(
|
|
3191
|
-
return h.type === "literal" ? h :
|
|
3214
|
+
return t(a, s).formatToParts(l).map(function(h) {
|
|
3215
|
+
return h.type === "literal" ? h : m(m({}, h), { value: u[h.value] || h.value });
|
|
3192
3216
|
});
|
|
3193
3217
|
} catch (h) {
|
|
3194
|
-
|
|
3218
|
+
i(new I("Error formatting list.", a, h));
|
|
3195
3219
|
}
|
|
3196
3220
|
return n;
|
|
3197
3221
|
}
|
|
3198
|
-
var
|
|
3199
|
-
function
|
|
3200
|
-
var
|
|
3201
|
-
r === void 0 && (r = {}), Intl.PluralRules ||
|
|
3222
|
+
var er = ["type"];
|
|
3223
|
+
function tr(e, t, n, r) {
|
|
3224
|
+
var a = e.locale, i = e.onError;
|
|
3225
|
+
r === void 0 && (r = {}), Intl.PluralRules || i(new P(`Intl.PluralRules is not available in this environment.
|
|
3202
3226
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3203
|
-
`,
|
|
3204
|
-
var o = C(r,
|
|
3227
|
+
`, B.MISSING_INTL_API));
|
|
3228
|
+
var o = C(r, er);
|
|
3205
3229
|
try {
|
|
3206
|
-
return t(
|
|
3230
|
+
return t(a, o).select(n);
|
|
3207
3231
|
} catch (s) {
|
|
3208
|
-
|
|
3232
|
+
i(new I("Error formatting plural.", a, s));
|
|
3209
3233
|
}
|
|
3210
3234
|
return "other";
|
|
3211
3235
|
}
|
|
3212
|
-
var
|
|
3213
|
-
function
|
|
3214
|
-
var r = e.locale,
|
|
3236
|
+
var rr = ["numeric", "style"];
|
|
3237
|
+
function nr(e, t, n) {
|
|
3238
|
+
var r = e.locale, a = e.formats, i = e.onError;
|
|
3215
3239
|
n === void 0 && (n = {});
|
|
3216
|
-
var o = n.format, s = !!o &&
|
|
3240
|
+
var o = n.format, s = !!o && oe(a, "relative", o, i) || {}, u = C(n, rr, s);
|
|
3217
3241
|
return t(r, u);
|
|
3218
3242
|
}
|
|
3219
|
-
function
|
|
3220
|
-
|
|
3221
|
-
var
|
|
3222
|
-
|
|
3243
|
+
function ar(e, t, n, r, a) {
|
|
3244
|
+
a === void 0 && (a = {}), r || (r = "second");
|
|
3245
|
+
var i = Intl.RelativeTimeFormat;
|
|
3246
|
+
i || e.onError(new P(`Intl.RelativeTimeFormat is not available in this environment.
|
|
3223
3247
|
Try polyfilling it using "@formatjs/intl-relativetimeformat"
|
|
3224
|
-
`,
|
|
3248
|
+
`, B.MISSING_INTL_API));
|
|
3225
3249
|
try {
|
|
3226
|
-
return
|
|
3250
|
+
return nr(e, t, a).format(n, r);
|
|
3227
3251
|
} catch (o) {
|
|
3228
3252
|
e.onError(new I("Error formatting relative time.", e.locale, o));
|
|
3229
3253
|
}
|
|
3230
3254
|
return String(n);
|
|
3231
3255
|
}
|
|
3232
|
-
var
|
|
3256
|
+
var ir = [
|
|
3233
3257
|
"style",
|
|
3234
3258
|
"currency",
|
|
3235
3259
|
"unit",
|
|
@@ -3255,135 +3279,135 @@ var tr = [
|
|
|
3255
3279
|
"roundingIncrement",
|
|
3256
3280
|
"roundingMode"
|
|
3257
3281
|
];
|
|
3258
|
-
function
|
|
3259
|
-
var r = e.locale,
|
|
3282
|
+
function je(e, t, n) {
|
|
3283
|
+
var r = e.locale, a = e.formats, i = e.onError;
|
|
3260
3284
|
n === void 0 && (n = {});
|
|
3261
|
-
var o = n.format, s = o &&
|
|
3285
|
+
var o = n.format, s = o && oe(a, "number", o, i) || {}, u = C(n, ir, s);
|
|
3262
3286
|
return t(r, u);
|
|
3263
3287
|
}
|
|
3264
|
-
function
|
|
3288
|
+
function or(e, t, n, r) {
|
|
3265
3289
|
r === void 0 && (r = {});
|
|
3266
3290
|
try {
|
|
3267
|
-
return
|
|
3268
|
-
} catch (
|
|
3269
|
-
e.onError(new I("Error formatting number.", e.locale,
|
|
3291
|
+
return je(e, t, r).format(n);
|
|
3292
|
+
} catch (a) {
|
|
3293
|
+
e.onError(new I("Error formatting number.", e.locale, a));
|
|
3270
3294
|
}
|
|
3271
3295
|
return String(n);
|
|
3272
3296
|
}
|
|
3273
|
-
function
|
|
3297
|
+
function sr(e, t, n, r) {
|
|
3274
3298
|
r === void 0 && (r = {});
|
|
3275
3299
|
try {
|
|
3276
|
-
return
|
|
3277
|
-
} catch (
|
|
3278
|
-
e.onError(new I("Error formatting number.", e.locale,
|
|
3300
|
+
return je(e, t, r).formatToParts(n);
|
|
3301
|
+
} catch (a) {
|
|
3302
|
+
e.onError(new I("Error formatting number.", e.locale, a));
|
|
3279
3303
|
}
|
|
3280
3304
|
return [];
|
|
3281
3305
|
}
|
|
3282
|
-
function
|
|
3306
|
+
function ur(e) {
|
|
3283
3307
|
var t = e ? e[Object.keys(e)[0]] : void 0;
|
|
3284
3308
|
return typeof t == "string";
|
|
3285
3309
|
}
|
|
3286
|
-
function
|
|
3287
|
-
e.onWarn && e.defaultRichTextElements &&
|
|
3310
|
+
function hr(e) {
|
|
3311
|
+
e.onWarn && e.defaultRichTextElements && ur(e.messages || {}) && e.onWarn(`[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled.
|
|
3288
3312
|
Please consider using "@formatjs/cli" to pre-compile your messages for performance.
|
|
3289
3313
|
For more details see https://formatjs.io/docs/getting-started/message-distribution`);
|
|
3290
3314
|
}
|
|
3291
|
-
function
|
|
3292
|
-
var n =
|
|
3293
|
-
return
|
|
3315
|
+
function lr(e, t) {
|
|
3316
|
+
var n = jt(t), r = m(m({}, Vt), e), a = r.locale, i = r.defaultLocale, o = r.onError;
|
|
3317
|
+
return a ? !Intl.NumberFormat.supportedLocalesOf(a).length && o ? o(new ve('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 ve('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 Dt('"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"), hr(r), m(m({}, r), {
|
|
3294
3318
|
formatters: n,
|
|
3295
|
-
formatNumber:
|
|
3296
|
-
formatNumberToParts:
|
|
3297
|
-
formatRelativeTime:
|
|
3298
|
-
formatDate:
|
|
3299
|
-
formatDateToParts:
|
|
3300
|
-
formatTime:
|
|
3301
|
-
formatDateTimeRange:
|
|
3302
|
-
formatTimeToParts:
|
|
3303
|
-
formatPlural:
|
|
3319
|
+
formatNumber: or.bind(null, r, n.getNumberFormat),
|
|
3320
|
+
formatNumberToParts: sr.bind(null, r, n.getNumberFormat),
|
|
3321
|
+
formatRelativeTime: ar.bind(null, r, n.getRelativeTimeFormat),
|
|
3322
|
+
formatDate: Xt.bind(null, r, n.getDateTimeFormat),
|
|
3323
|
+
formatDateToParts: zt.bind(null, r, n.getDateTimeFormat),
|
|
3324
|
+
formatTime: Wt.bind(null, r, n.getDateTimeFormat),
|
|
3325
|
+
formatDateTimeRange: Zt.bind(null, r, n.getDateTimeFormat),
|
|
3326
|
+
formatTimeToParts: $t.bind(null, r, n.getDateTimeFormat),
|
|
3327
|
+
formatPlural: tr.bind(null, r, n.getPluralRules),
|
|
3304
3328
|
// @ts-expect-error TODO: will get to this later
|
|
3305
|
-
formatMessage:
|
|
3329
|
+
formatMessage: be.bind(null, r, n),
|
|
3306
3330
|
// @ts-expect-error TODO: will get to this later
|
|
3307
|
-
$t:
|
|
3308
|
-
formatList:
|
|
3309
|
-
formatListToParts:
|
|
3310
|
-
formatDisplayName:
|
|
3331
|
+
$t: be.bind(null, r, n),
|
|
3332
|
+
formatList: Kt.bind(null, r, n.getListFormat),
|
|
3333
|
+
formatListToParts: Ve.bind(null, r, n.getListFormat),
|
|
3334
|
+
formatDisplayName: qt.bind(null, r, n.getDisplayNames)
|
|
3311
3335
|
});
|
|
3312
3336
|
}
|
|
3313
|
-
function
|
|
3337
|
+
function fr(e) {
|
|
3314
3338
|
return e && e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
|
|
3315
3339
|
}
|
|
3316
|
-
function
|
|
3340
|
+
function cr(e) {
|
|
3317
3341
|
return e;
|
|
3318
3342
|
}
|
|
3319
|
-
function
|
|
3343
|
+
function mr(e, t) {
|
|
3320
3344
|
t = t || {};
|
|
3321
|
-
const n = t.delimiter || ".", r = t.maxDepth,
|
|
3345
|
+
const n = t.delimiter || ".", r = t.maxDepth, a = t.transformKey || cr, i = {};
|
|
3322
3346
|
function o(s, u, l) {
|
|
3323
3347
|
l = l || 1, Object.keys(s).forEach(function(h) {
|
|
3324
|
-
const
|
|
3325
|
-
if (!c && !
|
|
3326
|
-
return o(
|
|
3327
|
-
|
|
3348
|
+
const f = s[h], c = t.safe && Array.isArray(f), E = Object.prototype.toString.call(f), x = fr(f), g = E === "[object Object]" || E === "[object Array]", d = u ? u + n + a(h) : a(h);
|
|
3349
|
+
if (!c && !x && g && Object.keys(f).length && (!t.maxDepth || l < r))
|
|
3350
|
+
return o(f, d, l + 1);
|
|
3351
|
+
i[d] = f;
|
|
3328
3352
|
});
|
|
3329
3353
|
}
|
|
3330
|
-
return o(e),
|
|
3354
|
+
return o(e), i;
|
|
3331
3355
|
}
|
|
3332
|
-
const
|
|
3333
|
-
let
|
|
3334
|
-
const
|
|
3356
|
+
const pr = Ge();
|
|
3357
|
+
let ke;
|
|
3358
|
+
const xe = {
|
|
3335
3359
|
year: "numeric",
|
|
3336
3360
|
month: "short",
|
|
3337
3361
|
day: "numeric",
|
|
3338
3362
|
hour: "numeric",
|
|
3339
3363
|
minute: "numeric"
|
|
3340
|
-
},
|
|
3341
|
-
var
|
|
3342
|
-
const r = typeof n == "boolean",
|
|
3364
|
+
}, Er = (e, t, n = !1) => {
|
|
3365
|
+
var x;
|
|
3366
|
+
const r = typeof n == "boolean", a = lr(
|
|
3343
3367
|
{
|
|
3344
3368
|
...r ? null : n,
|
|
3345
3369
|
locale: e,
|
|
3346
|
-
messages:
|
|
3370
|
+
messages: mr(t, {
|
|
3347
3371
|
safe: !0
|
|
3348
3372
|
// Preserve arrays
|
|
3349
3373
|
}),
|
|
3350
3374
|
formats: {
|
|
3351
3375
|
...r ? null : n.formats,
|
|
3352
3376
|
date: {
|
|
3353
|
-
...r ? null : (
|
|
3354
|
-
datetime:
|
|
3377
|
+
...r ? null : (x = n.formats) == null ? void 0 : x.date,
|
|
3378
|
+
datetime: xe
|
|
3355
3379
|
}
|
|
3356
3380
|
}
|
|
3357
3381
|
},
|
|
3358
|
-
|
|
3359
|
-
), { $t:
|
|
3360
|
-
const
|
|
3361
|
-
if (!
|
|
3362
|
-
return
|
|
3382
|
+
pr
|
|
3383
|
+
), { $t: i, ...o } = a, s = o, u = (g) => {
|
|
3384
|
+
const d = "Invalid Date";
|
|
3385
|
+
if (!g)
|
|
3386
|
+
return d;
|
|
3363
3387
|
try {
|
|
3364
|
-
const
|
|
3365
|
-
return s.formatDate(
|
|
3388
|
+
const y = new Date(g * 1e3);
|
|
3389
|
+
return s.formatDate(y, xe);
|
|
3366
3390
|
} catch {
|
|
3367
|
-
return
|
|
3391
|
+
return d;
|
|
3368
3392
|
}
|
|
3369
3393
|
}, E = {
|
|
3370
3394
|
formatUnixTimeStamp: u,
|
|
3371
|
-
formatIsoDate: (
|
|
3372
|
-
const
|
|
3373
|
-
return u(
|
|
3395
|
+
formatIsoDate: (g) => {
|
|
3396
|
+
const d = Date.parse(g) / 1e3;
|
|
3397
|
+
return u(d);
|
|
3374
3398
|
},
|
|
3375
|
-
t: (
|
|
3376
|
-
te: (
|
|
3377
|
-
tm: (
|
|
3399
|
+
t: (g, d, y) => s.formatMessage({ id: g }, d, y),
|
|
3400
|
+
te: (g) => !!s.messages[g],
|
|
3401
|
+
tm: (g) => s.messages[g] || [],
|
|
3378
3402
|
...s,
|
|
3379
3403
|
source: t
|
|
3380
3404
|
};
|
|
3381
|
-
return (typeof n == "boolean" && n === !0 || typeof n != "boolean" && n.isGlobal === !0) && (
|
|
3405
|
+
return (typeof n == "boolean" && n === !0 || typeof n != "boolean" && n.isGlobal === !0) && (ke = E), E;
|
|
3382
3406
|
};
|
|
3383
|
-
function
|
|
3384
|
-
return
|
|
3407
|
+
function dr() {
|
|
3408
|
+
return ke;
|
|
3385
3409
|
}
|
|
3386
|
-
const
|
|
3410
|
+
const gr = (e = null) => Xe({
|
|
3387
3411
|
name: "I18nT",
|
|
3388
3412
|
props: {
|
|
3389
3413
|
i18n: {
|
|
@@ -3401,33 +3425,33 @@ const fr = (e = null) => Ue({
|
|
|
3401
3425
|
}
|
|
3402
3426
|
},
|
|
3403
3427
|
setup(t, { slots: n }) {
|
|
3404
|
-
const r = (
|
|
3405
|
-
if (!
|
|
3428
|
+
const r = (a) => {
|
|
3429
|
+
if (!a)
|
|
3406
3430
|
return [];
|
|
3407
|
-
const
|
|
3408
|
-
return
|
|
3431
|
+
const i = /(\{[^}]+\})/g;
|
|
3432
|
+
return a.split(i).filter(Boolean);
|
|
3409
3433
|
};
|
|
3410
3434
|
return () => {
|
|
3411
3435
|
var s;
|
|
3412
|
-
const
|
|
3413
|
-
let o = r(
|
|
3436
|
+
const a = Object.keys(n).filter((u) => u !== "_"), i = ((s = (e || t.i18n).messages[t.keypath]) == null ? void 0 : s.toString()) || "";
|
|
3437
|
+
let o = r(i);
|
|
3414
3438
|
return o = o.filter((u) => u !== ""), o.forEach((u, l) => {
|
|
3415
3439
|
if (!u.startsWith("{") && !u.endsWith("}"))
|
|
3416
3440
|
return;
|
|
3417
3441
|
const h = u.replace(/[\{\}]/g, "");
|
|
3418
|
-
h === "0" && n.default ? o[l] = n.default() :
|
|
3419
|
-
}),
|
|
3442
|
+
h === "0" && n.default ? o[l] = n.default() : a.includes(h) && n[h] && (o[l] = n[h]());
|
|
3443
|
+
}), We(t.tag, t, o);
|
|
3420
3444
|
};
|
|
3421
3445
|
}
|
|
3422
|
-
}),
|
|
3446
|
+
}), br = {
|
|
3423
3447
|
install(e, t) {
|
|
3424
3448
|
const { i18n: n } = t;
|
|
3425
|
-
e.component("I18nT",
|
|
3449
|
+
e.component("I18nT", gr(n));
|
|
3426
3450
|
}
|
|
3427
3451
|
};
|
|
3428
3452
|
export {
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3453
|
+
br as Translation,
|
|
3454
|
+
Er as createI18n,
|
|
3455
|
+
gr as i18nTComponent,
|
|
3456
|
+
dr as useI18n
|
|
3433
3457
|
};
|