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