@intlify/core 12.0.0-alpha.6 → 12.0.0-alpha.8
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/core.esm-browser.js +35 -54
- package/dist/core.esm-browser.prod.js +348 -351
- package/dist/core.global.js +35 -54
- package/dist/core.global.prod.js +249 -252
- package/dist/core.js +1 -1
- package/dist/core.node.js +1 -1
- package/dist/core.runtime.esm-browser.js +29 -42
- package/dist/core.runtime.esm-browser.prod.js +201 -204
- package/dist/core.runtime.global.js +29 -42
- package/dist/core.runtime.global.prod.js +183 -186
- package/dist/core.runtime.js +3 -5
- package/dist/core.runtime.node.js +3 -5
- package/package.json +3 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @intlify/core v12.0.0-alpha.
|
|
2
|
+
* @intlify/core v12.0.0-alpha.8
|
|
3
3
|
* (c) 2016-present kazuya kawaguchi and contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/ const e = /\{([0-9a-z]+)\}/gi;
|
|
6
6
|
function t(t, ...n) {
|
|
7
|
-
return n.length === 1 && y(n[0]) && (n = n[0]),
|
|
7
|
+
return n.length === 1 && y(n[0]) && (n = n[0]), n && n.hasOwnProperty || (n = {}), t.replace(e, (e, t) => n.hasOwnProperty(t) ? n[t] : ``);
|
|
8
8
|
}
|
|
9
9
|
const n = (e, t, n) => r({
|
|
10
10
|
l: e,
|
|
@@ -34,46 +34,43 @@ function D(e) {
|
|
|
34
34
|
function ee(e) {
|
|
35
35
|
return e.replace(/&(?![a-z0-9#]{2,6};)/gi, `&`).replace(/"/g, `"`).replace(/'/g, `'`).replace(/</g, `<`).replace(/>/g, `>`);
|
|
36
36
|
}
|
|
37
|
-
const te = /^javascript:/i, ne = /^(?:href|src|action|formaction)$/i, re = /&#(?:x([0-9a-f]+)|(\d+));?/gi, O = /&(?:Tab|NewLine);/g, ie = /:?/gi, ae = /[\u0000-\u0020\u007f-\u009f]/g, oe = /(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i,
|
|
38
|
-
function
|
|
37
|
+
const te = /^javascript:/i, ne = /^(?:href|xlink:href|src|action|formaction)$/i, re = /&#(?:x([0-9a-f]+)|(\d+));?/gi, O = /&(?:Tab|NewLine);/g, ie = /:?/gi, ae = /[\u0000-\u0020\u007f-\u009f]/g, oe = /(?:^|[\s"'<>/])on\w+\s*=\s*["']?[^"'>]+["']?/i, se = /(^|[\s"'<>/])on(\w+\s*=)/gi, ce = /(?:^|[\s"'<>/])srcdoc\s*=/i, le = /(^|[\s"'<>/])s(rcdoc\s*=)/gi, ue = /<(?:base|animate|set)(?=[\s/>]|$)/i, de = /<(base|animate|set)(?=[\s/>]|$)/gi, fe = /(^|[\s"'<>/])((?:href|xlink:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi;
|
|
38
|
+
function pe(e, t, n) {
|
|
39
39
|
let r = t || n;
|
|
40
40
|
if (!r) return e;
|
|
41
41
|
let i = Number.parseInt(r, t ? 16 : 10);
|
|
42
42
|
return i <= 127 ? String.fromCharCode(i) : e;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let t = e.replace(re,
|
|
44
|
+
function k(e) {
|
|
45
|
+
let t = e.replace(re, pe).replace(O, ``).replace(ie, `:`).replace(ae, ``);
|
|
46
46
|
return te.test(t);
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function me(e) {
|
|
49
49
|
let t = /url\s*\(/gi, n = ``, r = 0, i;
|
|
50
50
|
for (; (i = t.exec(e)) !== null;) {
|
|
51
51
|
let a = i.index, o = t.lastIndex - 1, s = o + 1, c = 1, l = null;
|
|
52
52
|
for (; s < e.length; s++) {
|
|
53
53
|
let t = e[s];
|
|
54
|
-
if (l)
|
|
55
|
-
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
if (t === `"` || t === `'`) l = t;
|
|
54
|
+
if (l) t === l && (l = null);
|
|
55
|
+
else if (t === `"` || t === `'`) l = t;
|
|
59
56
|
else if (t === `(`) c++;
|
|
60
57
|
else if (t === `)` && (c--, c === 0)) break;
|
|
61
58
|
}
|
|
62
59
|
if (c !== 0) break;
|
|
63
60
|
let u = e.slice(o + 1, s).trim(), d = u.startsWith(`"`) && u.endsWith(`"`) || u.startsWith(`'`) && u.endsWith(`'`) ? u.slice(1, -1).trim() : u;
|
|
64
|
-
n += e.slice(r, a), n +=
|
|
61
|
+
n += e.slice(r, a), n += k(d) ? `url(about:blank)` : e.slice(a, s + 1), r = s + 1;
|
|
65
62
|
}
|
|
66
63
|
return n + e.slice(r);
|
|
67
64
|
}
|
|
68
|
-
function
|
|
69
|
-
return ne.test(e) &&
|
|
65
|
+
function A(e, t) {
|
|
66
|
+
return ne.test(e) && k(t) ? `about:blank` : ee(e.toLowerCase() === `style` ? me(t) : t);
|
|
70
67
|
}
|
|
71
|
-
function
|
|
72
|
-
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${
|
|
68
|
+
function he(e) {
|
|
69
|
+
return e = e.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g, (e, t, n) => `${t}="${A(t, n)}"`), e = e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g, (e, t, n) => `${t}='${A(t, n)}'`), oe.test(e) && (e = e.replace(se, `$1on$2`)), ce.test(e) && (e = e.replace(le, `$1s$2`)), ue.test(e) && (e = e.replace(de, `<$1`)), e = e.replace(fe, (e, t, n, r) => k(r) ? `${t}${n}about:blank` : e), e;
|
|
73
70
|
}
|
|
74
|
-
const
|
|
75
|
-
function
|
|
76
|
-
if (
|
|
71
|
+
const ge = (e) => !y(e) || h(e);
|
|
72
|
+
function j(e, t) {
|
|
73
|
+
if (ge(e) || ge(t) || t === Object.prototype) throw Error(`Invalid value`);
|
|
77
74
|
let n = [e, t];
|
|
78
75
|
for (; n.length;) {
|
|
79
76
|
let e = n.pop(), t = n.pop(), r = Object.keys(t);
|
|
@@ -95,21 +92,21 @@ function pe(e, t) {
|
|
|
95
92
|
}
|
|
96
93
|
}
|
|
97
94
|
}
|
|
98
|
-
function
|
|
95
|
+
function _e(e, t, n) {
|
|
99
96
|
return {
|
|
100
97
|
line: e,
|
|
101
98
|
column: t,
|
|
102
99
|
offset: n
|
|
103
100
|
};
|
|
104
101
|
}
|
|
105
|
-
function
|
|
102
|
+
function ve(e, t, n) {
|
|
106
103
|
let r = {
|
|
107
104
|
start: e,
|
|
108
105
|
end: t
|
|
109
106
|
};
|
|
110
107
|
return n != null && (r.source = n), r;
|
|
111
108
|
}
|
|
112
|
-
const
|
|
109
|
+
const M = {
|
|
113
110
|
EXPECTED_TOKEN: 1,
|
|
114
111
|
INVALID_TOKEN_IN_PLACEHOLDER: 2,
|
|
115
112
|
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3,
|
|
@@ -127,30 +124,30 @@ const N = {
|
|
|
127
124
|
UNHANDLED_CODEGEN_NODE_TYPE: 15,
|
|
128
125
|
UNHANDLED_MINIFIER_NODE_TYPE: 16
|
|
129
126
|
};
|
|
130
|
-
|
|
131
|
-
function
|
|
127
|
+
M.EXPECTED_TOKEN, M.INVALID_TOKEN_IN_PLACEHOLDER, M.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, M.UNKNOWN_ESCAPE_SEQUENCE, M.INVALID_UNICODE_ESCAPE_SEQUENCE, M.UNBALANCED_CLOSING_BRACE, M.UNTERMINATED_CLOSING_BRACE, M.EMPTY_PLACEHOLDER, M.NOT_ALLOW_NEST_PLACEHOLDER, M.INVALID_LINKED_FORMAT, M.MUST_HAVE_MESSAGES_IN_PLURAL, M.UNEXPECTED_EMPTY_LINKED_MODIFIER, M.UNEXPECTED_EMPTY_LINKED_KEY, M.UNEXPECTED_LEXICAL_ANALYSIS, M.UNHANDLED_CODEGEN_NODE_TYPE, M.UNHANDLED_MINIFIER_NODE_TYPE;
|
|
128
|
+
function N(e, t, n = {}) {
|
|
132
129
|
let { domain: r, messages: i, args: a } = n, o = SyntaxError(String(e));
|
|
133
130
|
return o.code = e, t && (o.location = t), o.domain = r, o;
|
|
134
131
|
}
|
|
135
|
-
function
|
|
132
|
+
function P(e) {
|
|
136
133
|
throw e;
|
|
137
134
|
}
|
|
138
|
-
function
|
|
135
|
+
function F(e) {
|
|
139
136
|
switch (e.t = e.type, e.type) {
|
|
140
137
|
case 0: {
|
|
141
138
|
let t = e;
|
|
142
|
-
|
|
139
|
+
F(t.body), t.b = t.body, delete t.body;
|
|
143
140
|
break;
|
|
144
141
|
}
|
|
145
142
|
case 1: {
|
|
146
143
|
let t = e, n = t.cases;
|
|
147
|
-
for (let e = 0; e < n.length; e++)
|
|
144
|
+
for (let e = 0; e < n.length; e++) F(n[e]);
|
|
148
145
|
t.c = n, delete t.cases;
|
|
149
146
|
break;
|
|
150
147
|
}
|
|
151
148
|
case 2: {
|
|
152
149
|
let t = e, n = t.items;
|
|
153
|
-
for (let e = 0; e < n.length; e++)
|
|
150
|
+
for (let e = 0; e < n.length; e++) F(n[e]);
|
|
154
151
|
t.i = n, delete t.items, t.static && (t.s = t.static, delete t.static);
|
|
155
152
|
break;
|
|
156
153
|
}
|
|
@@ -164,7 +161,7 @@ function I(e) {
|
|
|
164
161
|
}
|
|
165
162
|
case 6: {
|
|
166
163
|
let t = e;
|
|
167
|
-
|
|
164
|
+
F(t.key), t.k = t.key, delete t.key, t.modifier && (F(t.modifier), t.m = t.modifier, delete t.modifier);
|
|
168
165
|
break;
|
|
169
166
|
}
|
|
170
167
|
case 5: {
|
|
@@ -180,11 +177,11 @@ function I(e) {
|
|
|
180
177
|
}
|
|
181
178
|
delete e.type;
|
|
182
179
|
}
|
|
183
|
-
function
|
|
180
|
+
function ye(e) {
|
|
184
181
|
let t = e.body;
|
|
185
|
-
return t.type === 2 ?
|
|
182
|
+
return t.type === 2 ? be(t) : t.cases.forEach((e) => be(e)), e;
|
|
186
183
|
}
|
|
187
|
-
function
|
|
184
|
+
function be(e) {
|
|
188
185
|
if (e.items.length === 1) {
|
|
189
186
|
let t = e.items[0];
|
|
190
187
|
(t.type === 3 || t.type === 9) && (e.static = t.value, delete t.value);
|
|
@@ -204,7 +201,7 @@ function R(e) {
|
|
|
204
201
|
}
|
|
205
202
|
}
|
|
206
203
|
}
|
|
207
|
-
function
|
|
204
|
+
function xe(e) {
|
|
208
205
|
let t = e, n = 0, r = 1, i = 1, a = 0, o = (e) => t[e] === `\r` && t[e + 1] === `
|
|
209
206
|
`, s = (e) => t[e] === `
|
|
210
207
|
`, c = (e) => t[e] === `\u2029`, l = (e) => t[e] === `\u2028`, u = (e) => o(e) || s(e) || c(e) || l(e), d = () => n, f = () => r, p = () => i, m = () => a, h = (e) => o(e) || c(e) || l(e) ? `
|
|
@@ -241,8 +238,8 @@ function ge(e) {
|
|
|
241
238
|
skipToPeek: S
|
|
242
239
|
};
|
|
243
240
|
}
|
|
244
|
-
function
|
|
245
|
-
let n = t.location !== !1, r =
|
|
241
|
+
function Se(e, t = {}) {
|
|
242
|
+
let n = t.location !== !1, r = xe(e), i = () => r.index(), a = () => _e(r.line(), r.column(), r.index()), o = a(), s = i(), c = {
|
|
246
243
|
currentType: 13,
|
|
247
244
|
offset: s,
|
|
248
245
|
startLoc: o,
|
|
@@ -258,11 +255,11 @@ function _e(e, t = {}) {
|
|
|
258
255
|
function d(e, t, r) {
|
|
259
256
|
e.endLoc = a(), e.currentType = t;
|
|
260
257
|
let i = { type: t };
|
|
261
|
-
return n && (i.loc =
|
|
258
|
+
return n && (i.loc = ve(e.startLoc, e.endLoc)), r != null && (i.value = r), i;
|
|
262
259
|
}
|
|
263
260
|
let f = (e) => d(e, 13);
|
|
264
261
|
function p(e, t) {
|
|
265
|
-
return e.currentChar() === t ? (e.next(), t) : (
|
|
262
|
+
return e.currentChar() === t ? (e.next(), t) : (M.EXPECTED_TOKEN, a(), ``);
|
|
266
263
|
}
|
|
267
264
|
function m(e) {
|
|
268
265
|
let t = ``;
|
|
@@ -383,12 +380,12 @@ function _e(e, t = {}) {
|
|
|
383
380
|
function oe(e) {
|
|
384
381
|
return D(e, ae);
|
|
385
382
|
}
|
|
386
|
-
function
|
|
383
|
+
function se(e) {
|
|
387
384
|
let t = ``, n = ``;
|
|
388
385
|
for (; t = ie(e);) n += t;
|
|
389
386
|
return n;
|
|
390
387
|
}
|
|
391
|
-
function
|
|
388
|
+
function ce(e) {
|
|
392
389
|
let t = ``;
|
|
393
390
|
for (;;) {
|
|
394
391
|
let n = e.currentChar();
|
|
@@ -405,145 +402,145 @@ function _e(e, t = {}) {
|
|
|
405
402
|
}
|
|
406
403
|
return t;
|
|
407
404
|
}
|
|
408
|
-
function
|
|
405
|
+
function le(e) {
|
|
409
406
|
h(e);
|
|
410
407
|
let t = ``, n = ``;
|
|
411
408
|
for (; t = re(e);) n += t;
|
|
412
409
|
let r = e.currentChar();
|
|
413
410
|
if (r && r !== `}` && r !== void 0 && r !== ` ` && r !== `
|
|
414
411
|
` && r !== ` `) {
|
|
415
|
-
let t =
|
|
416
|
-
return
|
|
412
|
+
let t = A(e);
|
|
413
|
+
return M.INVALID_TOKEN_IN_PLACEHOLDER, a(), n + t, n + t;
|
|
417
414
|
}
|
|
418
|
-
return e.currentChar() === void 0 && (
|
|
415
|
+
return e.currentChar() === void 0 && (M.UNTERMINATED_CLOSING_BRACE, a()), n;
|
|
419
416
|
}
|
|
420
|
-
function
|
|
417
|
+
function ue(e) {
|
|
421
418
|
h(e);
|
|
422
419
|
let t = ``;
|
|
423
|
-
return e.currentChar() === `-` ? (e.next(), t += `-${
|
|
420
|
+
return e.currentChar() === `-` ? (e.next(), t += `-${se(e)}`) : t += se(e), e.currentChar() === void 0 && (M.UNTERMINATED_CLOSING_BRACE, a()), t;
|
|
424
421
|
}
|
|
425
|
-
function
|
|
422
|
+
function de(e) {
|
|
426
423
|
return e !== `'` && e !== `
|
|
427
424
|
`;
|
|
428
425
|
}
|
|
429
|
-
function
|
|
426
|
+
function fe(e) {
|
|
430
427
|
h(e), p(e, `'`);
|
|
431
428
|
let t = ``, n = ``;
|
|
432
|
-
for (; t = D(e,
|
|
429
|
+
for (; t = D(e, de);) n += t === `\\` ? pe(e) : t;
|
|
433
430
|
let r = e.currentChar();
|
|
434
431
|
return r === `
|
|
435
|
-
` || r === void 0 ? (
|
|
432
|
+
` || r === void 0 ? (M.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, a(), r === `
|
|
436
433
|
` && (e.next(), p(e, `'`)), n) : (p(e, `'`), n);
|
|
437
434
|
}
|
|
438
|
-
function
|
|
435
|
+
function pe(e) {
|
|
439
436
|
let t = e.currentChar();
|
|
440
437
|
switch (t) {
|
|
441
438
|
case `\\`:
|
|
442
439
|
case `'`: return e.next(), `\\${t}`;
|
|
443
|
-
case `u`: return
|
|
444
|
-
case `U`: return
|
|
445
|
-
default: return
|
|
440
|
+
case `u`: return k(e, t, 4);
|
|
441
|
+
case `U`: return k(e, t, 6);
|
|
442
|
+
default: return M.UNKNOWN_ESCAPE_SEQUENCE, a(), ``;
|
|
446
443
|
}
|
|
447
444
|
}
|
|
448
|
-
function
|
|
445
|
+
function k(e, t, n) {
|
|
449
446
|
p(e, t);
|
|
450
447
|
let r = ``;
|
|
451
448
|
for (let i = 0; i < n; i++) {
|
|
452
449
|
let n = oe(e);
|
|
453
450
|
if (!n) {
|
|
454
|
-
|
|
451
|
+
M.INVALID_UNICODE_ESCAPE_SEQUENCE, a(), `${t}${r}${e.currentChar()}`;
|
|
455
452
|
break;
|
|
456
453
|
}
|
|
457
454
|
r += n;
|
|
458
455
|
}
|
|
459
456
|
return `\\${t}${r}`;
|
|
460
457
|
}
|
|
461
|
-
function
|
|
458
|
+
function me(e) {
|
|
462
459
|
return e !== `{` && e !== `}` && e !== ` ` && e !== `
|
|
463
460
|
`;
|
|
464
461
|
}
|
|
465
|
-
function
|
|
462
|
+
function A(e) {
|
|
466
463
|
h(e);
|
|
467
464
|
let t = ``, n = ``;
|
|
468
|
-
for (; t = D(e,
|
|
465
|
+
for (; t = D(e, me);) n += t;
|
|
469
466
|
return n;
|
|
470
467
|
}
|
|
471
|
-
function
|
|
468
|
+
function he(e) {
|
|
472
469
|
let t = ``, n = ``;
|
|
473
470
|
for (; t = te(e);) n += t;
|
|
474
471
|
return n;
|
|
475
472
|
}
|
|
476
|
-
function
|
|
473
|
+
function ge(e) {
|
|
477
474
|
let t = (n) => {
|
|
478
475
|
let r = e.currentChar();
|
|
479
476
|
return r === `{` || r === `@` || r === `|` || r === `(` || r === `)` || !r || r === ` ` ? n : (n += r, e.next(), t(n));
|
|
480
477
|
};
|
|
481
478
|
return t(``);
|
|
482
479
|
}
|
|
483
|
-
function
|
|
480
|
+
function j(e) {
|
|
484
481
|
h(e);
|
|
485
482
|
let t = p(e, `|`);
|
|
486
483
|
return h(e), t;
|
|
487
484
|
}
|
|
488
|
-
function
|
|
485
|
+
function N(e, t) {
|
|
489
486
|
let n = null;
|
|
490
487
|
switch (e.currentChar()) {
|
|
491
|
-
case `{`: return t.braceNest >= 1 && (
|
|
492
|
-
case `}`: return t.braceNest > 0 && t.currentType === 2 && (
|
|
493
|
-
case `@`: return t.braceNest > 0 && (
|
|
488
|
+
case `{`: return t.braceNest >= 1 && (M.NOT_ALLOW_NEST_PLACEHOLDER, a()), e.next(), n = d(t, 2, `{`), h(e), t.braceNest++, n;
|
|
489
|
+
case `}`: return t.braceNest > 0 && t.currentType === 2 && (M.EMPTY_PLACEHOLDER, a()), e.next(), n = d(t, 3, `}`), t.braceNest--, t.braceNest > 0 && h(e), t.inLinked && t.braceNest === 0 && (t.inLinked = !1), n;
|
|
490
|
+
case `@`: return t.braceNest > 0 && (M.UNTERMINATED_CLOSING_BRACE, a()), n = P(e, t) || f(t), t.braceNest = 0, n;
|
|
494
491
|
default: {
|
|
495
492
|
let r = !0, i = !0, o = !0;
|
|
496
|
-
if (T(e)) return t.braceNest > 0 && (
|
|
497
|
-
if (t.braceNest > 0 && (t.currentType === 4 || t.currentType === 5 || t.currentType === 6)) return
|
|
498
|
-
if (r = v(e, t)) return n = d(t, 4,
|
|
499
|
-
if (i = y(e, t)) return n = d(t, 5,
|
|
500
|
-
if (o = b(e, t)) return n = d(t, 6,
|
|
501
|
-
if (!r && !i && !o) return n = d(t, 12,
|
|
493
|
+
if (T(e)) return t.braceNest > 0 && (M.UNTERMINATED_CLOSING_BRACE, a()), n = d(t, 1, j(e)), t.braceNest = 0, t.inLinked = !1, n;
|
|
494
|
+
if (t.braceNest > 0 && (t.currentType === 4 || t.currentType === 5 || t.currentType === 6)) return M.UNTERMINATED_CLOSING_BRACE, a(), t.braceNest = 0, F(e, t);
|
|
495
|
+
if (r = v(e, t)) return n = d(t, 4, le(e)), h(e), n;
|
|
496
|
+
if (i = y(e, t)) return n = d(t, 5, ue(e)), h(e), n;
|
|
497
|
+
if (o = b(e, t)) return n = d(t, 6, fe(e)), h(e), n;
|
|
498
|
+
if (!r && !i && !o) return n = d(t, 12, A(e)), M.INVALID_TOKEN_IN_PLACEHOLDER, a(), n.value, h(e), n;
|
|
502
499
|
break;
|
|
503
500
|
}
|
|
504
501
|
}
|
|
505
502
|
return n;
|
|
506
503
|
}
|
|
507
|
-
function
|
|
504
|
+
function P(e, t) {
|
|
508
505
|
let { currentType: n } = t, r = null, i = e.currentChar();
|
|
509
|
-
switch (
|
|
510
|
-
`
|
|
506
|
+
switch (n !== 7 && n !== 8 && n !== 11 && n !== 9 || i !== `
|
|
507
|
+
` && i !== ` ` || (M.INVALID_LINKED_FORMAT, a()), i) {
|
|
511
508
|
case `@`: return e.next(), r = d(t, 7, `@`), t.inLinked = !0, r;
|
|
512
509
|
case `.`: return h(e), e.next(), d(t, 8, `.`);
|
|
513
510
|
case `:`: return h(e), e.next(), d(t, 9, `:`);
|
|
514
|
-
default: return T(e) ? (r = d(t, 1,
|
|
511
|
+
default: return T(e) ? (r = d(t, 1, j(e)), t.braceNest = 0, t.inLinked = !1, r) : x(e, t) || C(e, t) ? (h(e), P(e, t)) : S(e, t) ? (h(e), d(t, 11, he(e))) : w(e, t) ? (h(e), i === `{` ? N(e, t) || r : d(t, 10, ge(e))) : (n === 7 && (M.INVALID_LINKED_FORMAT, a()), t.braceNest = 0, t.inLinked = !1, F(e, t));
|
|
515
512
|
}
|
|
516
513
|
}
|
|
517
|
-
function
|
|
514
|
+
function F(e, t) {
|
|
518
515
|
let n = { type: 13 };
|
|
519
|
-
if (t.braceNest > 0) return
|
|
520
|
-
if (t.inLinked) return
|
|
516
|
+
if (t.braceNest > 0) return N(e, t) || f(t);
|
|
517
|
+
if (t.inLinked) return P(e, t) || f(t);
|
|
521
518
|
switch (e.currentChar()) {
|
|
522
|
-
case `{`: return
|
|
523
|
-
case `}`: return
|
|
524
|
-
case `@`: return
|
|
519
|
+
case `{`: return N(e, t) || f(t);
|
|
520
|
+
case `}`: return M.UNBALANCED_CLOSING_BRACE, a(), e.next(), d(t, 3, `}`);
|
|
521
|
+
case `@`: return P(e, t) || f(t);
|
|
525
522
|
default:
|
|
526
|
-
if (T(e)) return n = d(t, 1,
|
|
527
|
-
if (E(e)) return d(t, 0,
|
|
523
|
+
if (T(e)) return n = d(t, 1, j(e)), t.braceNest = 0, t.inLinked = !1, n;
|
|
524
|
+
if (E(e)) return d(t, 0, ce(e));
|
|
528
525
|
}
|
|
529
526
|
return n;
|
|
530
527
|
}
|
|
531
|
-
function
|
|
528
|
+
function ye() {
|
|
532
529
|
let { currentType: e, offset: t, startLoc: n, endLoc: o } = c;
|
|
533
|
-
return c.lastType = e, c.lastOffset = t, c.lastStartLoc = n, c.lastEndLoc = o, c.offset = i(), c.startLoc = a(), r.currentChar() === void 0 ? d(c, 13) :
|
|
530
|
+
return c.lastType = e, c.lastOffset = t, c.lastStartLoc = n, c.lastEndLoc = o, c.offset = i(), c.startLoc = a(), r.currentChar() === void 0 ? d(c, 13) : F(r, c);
|
|
534
531
|
}
|
|
535
532
|
return {
|
|
536
|
-
nextToken:
|
|
533
|
+
nextToken: ye,
|
|
537
534
|
currentOffset: i,
|
|
538
535
|
currentPosition: a,
|
|
539
536
|
context: l
|
|
540
537
|
};
|
|
541
538
|
}
|
|
542
|
-
const
|
|
543
|
-
function
|
|
539
|
+
const Ce = /\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6})/g, we = /\\([\\@{}|])/g;
|
|
540
|
+
function Te(e, t) {
|
|
544
541
|
return t;
|
|
545
542
|
}
|
|
546
|
-
function
|
|
543
|
+
function Ee(e, t, n) {
|
|
547
544
|
switch (e) {
|
|
548
545
|
case `\\\\`: return `\\`;
|
|
549
546
|
case `\\'`: return `'`;
|
|
@@ -553,7 +550,7 @@ function xe(e, t, n) {
|
|
|
553
550
|
}
|
|
554
551
|
}
|
|
555
552
|
}
|
|
556
|
-
function
|
|
553
|
+
function De(e = {}) {
|
|
557
554
|
let t = e.location !== !1, { onError: n } = e;
|
|
558
555
|
function r(e, n, r) {
|
|
559
556
|
let i = { type: e };
|
|
@@ -567,7 +564,7 @@ function Se(e = {}) {
|
|
|
567
564
|
}
|
|
568
565
|
function a(e, t) {
|
|
569
566
|
let n = e.context(), a = r(3, n.offset, n.startLoc);
|
|
570
|
-
return a.value = t.replace(
|
|
567
|
+
return a.value = t.replace(we, Te), i(a, e.currentOffset(), e.currentPosition()), a;
|
|
571
568
|
}
|
|
572
569
|
function o(e, t) {
|
|
573
570
|
let { lastOffset: n, lastStartLoc: a } = e.context(), o = r(5, n, a);
|
|
@@ -579,11 +576,11 @@ function Se(e = {}) {
|
|
|
579
576
|
}
|
|
580
577
|
function l(e, t) {
|
|
581
578
|
let { lastOffset: n, lastStartLoc: a } = e.context(), o = r(9, n, a);
|
|
582
|
-
return o.value = t.replace(
|
|
579
|
+
return o.value = t.replace(Ce, Ee), e.nextToken(), i(o, e.currentOffset(), e.currentPosition()), o;
|
|
583
580
|
}
|
|
584
581
|
function u(e) {
|
|
585
582
|
let t = e.nextToken(), n = e.context(), { lastOffset: a, lastStartLoc: o } = n, s = r(8, a, o);
|
|
586
|
-
return t.type === 11 ? (t.value == null && (
|
|
583
|
+
return t.type === 11 ? (t.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, n.lastStartLoc, I(t)), s.value = t.value || ``, i(s, e.currentOffset(), e.currentPosition()), { node: s }) : (M.UNEXPECTED_EMPTY_LINKED_MODIFIER, n.lastStartLoc, s.value = ``, i(s, a, o), {
|
|
587
584
|
nextConsumeToken: t,
|
|
588
585
|
node: s
|
|
589
586
|
});
|
|
@@ -598,21 +595,21 @@ function Se(e = {}) {
|
|
|
598
595
|
let t = u(e);
|
|
599
596
|
n.modifier = t.node, a = t.nextConsumeToken || e.nextToken();
|
|
600
597
|
}
|
|
601
|
-
switch (a.type !== 9 && (
|
|
598
|
+
switch (a.type !== 9 && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(a)), a = e.nextToken(), a.type === 2 && (a = e.nextToken()), a.type) {
|
|
602
599
|
case 10:
|
|
603
|
-
a.value == null && (
|
|
600
|
+
a.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(a)), n.key = d(e, a.value || ``);
|
|
604
601
|
break;
|
|
605
602
|
case 4:
|
|
606
|
-
a.value == null && (
|
|
603
|
+
a.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(a)), n.key = s(e, a.value || ``);
|
|
607
604
|
break;
|
|
608
605
|
case 5:
|
|
609
|
-
a.value == null && (
|
|
606
|
+
a.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(a)), n.key = o(e, a.value || ``);
|
|
610
607
|
break;
|
|
611
608
|
case 6:
|
|
612
|
-
a.value == null && (
|
|
609
|
+
a.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(a)), n.key = l(e, a.value || ``);
|
|
613
610
|
break;
|
|
614
611
|
default: {
|
|
615
|
-
|
|
612
|
+
M.UNEXPECTED_EMPTY_LINKED_KEY, t.lastStartLoc;
|
|
616
613
|
let o = e.context(), s = r(7, o.offset, o.startLoc);
|
|
617
614
|
return s.value = ``, i(s, o.offset, o.startLoc), n.key = s, i(n, o.offset, o.startLoc), {
|
|
618
615
|
nextConsumeToken: a,
|
|
@@ -630,16 +627,16 @@ function Se(e = {}) {
|
|
|
630
627
|
let r = c || e.nextToken();
|
|
631
628
|
switch (c = null, r.type) {
|
|
632
629
|
case 0:
|
|
633
|
-
r.value == null && (
|
|
630
|
+
r.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(r)), n.items.push(a(e, r.value || ``));
|
|
634
631
|
break;
|
|
635
632
|
case 5:
|
|
636
|
-
r.value == null && (
|
|
633
|
+
r.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(r)), n.items.push(o(e, r.value || ``));
|
|
637
634
|
break;
|
|
638
635
|
case 4:
|
|
639
|
-
r.value == null && (
|
|
636
|
+
r.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(r)), n.items.push(s(e, r.value || ``));
|
|
640
637
|
break;
|
|
641
638
|
case 6:
|
|
642
|
-
r.value == null && (
|
|
639
|
+
r.value == null && (M.UNEXPECTED_LEXICAL_ANALYSIS, t.lastStartLoc, I(r)), n.items.push(l(e, r.value || ``));
|
|
643
640
|
break;
|
|
644
641
|
case 7: {
|
|
645
642
|
let t = f(e);
|
|
@@ -657,222 +654,222 @@ function Se(e = {}) {
|
|
|
657
654
|
let t = p(e);
|
|
658
655
|
s || (s = t.items.length === 0), c.cases.push(t);
|
|
659
656
|
} while (o.currentType !== 13);
|
|
660
|
-
return s &&
|
|
657
|
+
return s && M.MUST_HAVE_MESSAGES_IN_PLURAL, i(c, e.currentOffset(), e.currentPosition()), c;
|
|
661
658
|
}
|
|
662
659
|
function h(e) {
|
|
663
660
|
let t = e.context(), { offset: n, startLoc: r } = t, i = p(e);
|
|
664
661
|
return t.currentType === 13 ? i : m(e, n, r, i);
|
|
665
662
|
}
|
|
666
663
|
function g(n) {
|
|
667
|
-
let a =
|
|
668
|
-
return t && s.loc && (s.loc.source = n), s.body = h(a), e.onCacheKey && (s.cacheKey = e.onCacheKey(n)), o.currentType !== 13 && (
|
|
664
|
+
let a = Se(n, c({}, e)), o = a.context(), s = r(0, o.offset, o.startLoc);
|
|
665
|
+
return t && s.loc && (s.loc.source = n), s.body = h(a), e.onCacheKey && (s.cacheKey = e.onCacheKey(n)), o.currentType !== 13 && (M.UNEXPECTED_LEXICAL_ANALYSIS, o.lastStartLoc, n[o.offset]), i(s, a.currentOffset(), a.currentPosition()), s;
|
|
669
666
|
}
|
|
670
667
|
return { parse: g };
|
|
671
668
|
}
|
|
672
|
-
function
|
|
669
|
+
function I(e) {
|
|
673
670
|
if (e.type === 13) return `EOF`;
|
|
674
671
|
let t = (e.value || ``).replace(/\r?\n/gu, `\\n`);
|
|
675
672
|
return t.length > 10 ? t.slice(0, 9) + `…` : t;
|
|
676
673
|
}
|
|
677
|
-
function
|
|
678
|
-
return y(e) &&
|
|
674
|
+
function L(e) {
|
|
675
|
+
return y(e) && Le(e) === 0 && (f(e, `b`) || f(e, `body`));
|
|
679
676
|
}
|
|
680
|
-
const
|
|
681
|
-
function
|
|
682
|
-
return
|
|
677
|
+
const Oe = [`b`, `body`];
|
|
678
|
+
function ke(e) {
|
|
679
|
+
return z(e, Oe);
|
|
683
680
|
}
|
|
684
|
-
const
|
|
685
|
-
function
|
|
686
|
-
return
|
|
681
|
+
const Ae = [`c`, `cases`];
|
|
682
|
+
function je(e) {
|
|
683
|
+
return z(e, Ae, []);
|
|
687
684
|
}
|
|
688
|
-
const
|
|
689
|
-
function
|
|
690
|
-
return
|
|
685
|
+
const Me = [`s`, `static`];
|
|
686
|
+
function Ne(e) {
|
|
687
|
+
return z(e, Me);
|
|
691
688
|
}
|
|
692
|
-
const
|
|
693
|
-
function
|
|
694
|
-
return
|
|
689
|
+
const Pe = [`i`, `items`];
|
|
690
|
+
function Fe(e) {
|
|
691
|
+
return z(e, Pe, []);
|
|
695
692
|
}
|
|
696
|
-
const
|
|
697
|
-
function
|
|
698
|
-
return
|
|
693
|
+
const Ie = [`t`, `type`];
|
|
694
|
+
function Le(e) {
|
|
695
|
+
return z(e, Ie);
|
|
699
696
|
}
|
|
700
|
-
const
|
|
701
|
-
function
|
|
702
|
-
let n =
|
|
697
|
+
const Re = [`v`, `value`];
|
|
698
|
+
function R(e, t) {
|
|
699
|
+
let n = z(e, Re);
|
|
703
700
|
if (n != null) return n;
|
|
704
|
-
throw
|
|
701
|
+
throw B(t);
|
|
705
702
|
}
|
|
706
|
-
const
|
|
707
|
-
function
|
|
708
|
-
return
|
|
703
|
+
const ze = [`m`, `modifier`];
|
|
704
|
+
function Be(e) {
|
|
705
|
+
return z(e, ze);
|
|
709
706
|
}
|
|
710
|
-
const
|
|
711
|
-
function
|
|
712
|
-
let t =
|
|
707
|
+
const Ve = [`k`, `key`];
|
|
708
|
+
function He(e) {
|
|
709
|
+
let t = z(e, Ve);
|
|
713
710
|
if (t) return t;
|
|
714
|
-
throw
|
|
711
|
+
throw B(6);
|
|
715
712
|
}
|
|
716
|
-
function
|
|
713
|
+
function z(e, t, n) {
|
|
717
714
|
for (let n = 0; n < t.length; n++) {
|
|
718
715
|
let r = t[n];
|
|
719
716
|
if (f(e, r) && e[r] != null) return e[r];
|
|
720
717
|
}
|
|
721
718
|
return n;
|
|
722
719
|
}
|
|
723
|
-
const
|
|
724
|
-
...
|
|
725
|
-
...
|
|
726
|
-
...
|
|
727
|
-
...ke,
|
|
728
|
-
...Ie,
|
|
720
|
+
const Ue = [
|
|
721
|
+
...Oe,
|
|
722
|
+
...Ae,
|
|
723
|
+
...Me,
|
|
729
724
|
...Pe,
|
|
730
|
-
...
|
|
731
|
-
...
|
|
725
|
+
...Ve,
|
|
726
|
+
...ze,
|
|
727
|
+
...Re,
|
|
728
|
+
...Ie
|
|
732
729
|
];
|
|
733
|
-
function
|
|
730
|
+
function B(e) {
|
|
734
731
|
return Error(`unhandled node type: ${e}`);
|
|
735
732
|
}
|
|
736
|
-
function
|
|
737
|
-
return (t) =>
|
|
733
|
+
function We(e) {
|
|
734
|
+
return (t) => Ge(t, e);
|
|
738
735
|
}
|
|
739
|
-
function
|
|
740
|
-
let n =
|
|
741
|
-
if (n == null) throw
|
|
742
|
-
if (
|
|
743
|
-
let t =
|
|
744
|
-
return e.plural(t.reduce((t, n) => [...h(t) ? t : [t],
|
|
736
|
+
function Ge(e, t) {
|
|
737
|
+
let n = ke(t);
|
|
738
|
+
if (n == null) throw B(0);
|
|
739
|
+
if (Le(n) === 1) {
|
|
740
|
+
let t = je(n);
|
|
741
|
+
return e.plural(t.reduce((t, n) => [...h(t) ? t : [t], Ke(e, n)], []));
|
|
745
742
|
}
|
|
746
|
-
return
|
|
743
|
+
return Ke(e, n);
|
|
747
744
|
}
|
|
748
|
-
function
|
|
749
|
-
let n =
|
|
745
|
+
function Ke(e, t) {
|
|
746
|
+
let n = Ne(t);
|
|
750
747
|
if (n != null) return e.type === `text` ? n : e.normalize([n]);
|
|
751
748
|
{
|
|
752
|
-
let n =
|
|
749
|
+
let n = Fe(t).reduce((t, n) => [...t, qe(e, n)], []);
|
|
753
750
|
return e.normalize(n);
|
|
754
751
|
}
|
|
755
752
|
}
|
|
756
|
-
function
|
|
757
|
-
let n =
|
|
753
|
+
function qe(e, t) {
|
|
754
|
+
let n = Le(t);
|
|
758
755
|
switch (n) {
|
|
759
|
-
case 3: return
|
|
760
|
-
case 9: return
|
|
756
|
+
case 3: return R(t, n);
|
|
757
|
+
case 9: return R(t, n);
|
|
761
758
|
case 4: {
|
|
762
759
|
let r = t;
|
|
763
760
|
if (f(r, `k`) && r.k) return e.interpolate(e.named(r.k));
|
|
764
761
|
if (f(r, `key`) && r.key) return e.interpolate(e.named(r.key));
|
|
765
|
-
throw
|
|
762
|
+
throw B(n);
|
|
766
763
|
}
|
|
767
764
|
case 5: {
|
|
768
765
|
let r = t;
|
|
769
766
|
if (f(r, `i`) && i(r.i)) return e.interpolate(e.list(r.i));
|
|
770
767
|
if (f(r, `index`) && i(r.index)) return e.interpolate(e.list(r.index));
|
|
771
|
-
throw
|
|
768
|
+
throw B(n);
|
|
772
769
|
}
|
|
773
770
|
case 6: {
|
|
774
|
-
let n = t, r =
|
|
775
|
-
return e.linked(
|
|
771
|
+
let n = t, r = Be(n), i = He(n);
|
|
772
|
+
return e.linked(qe(e, i), r ? qe(e, r) : void 0, e.type);
|
|
776
773
|
}
|
|
777
|
-
case 7: return
|
|
778
|
-
case 8: return
|
|
774
|
+
case 7: return R(t, n);
|
|
775
|
+
case 8: return R(t, n);
|
|
779
776
|
default: throw Error(`unhandled node on format message part: ${n}`);
|
|
780
777
|
}
|
|
781
778
|
}
|
|
782
|
-
const
|
|
783
|
-
let
|
|
784
|
-
function
|
|
785
|
-
|
|
779
|
+
const Je = (e) => e;
|
|
780
|
+
let V = u();
|
|
781
|
+
function Ye() {
|
|
782
|
+
V = u();
|
|
786
783
|
}
|
|
787
|
-
function
|
|
788
|
-
let n = !1, r = t.onError ||
|
|
784
|
+
function Xe(e, t = {}) {
|
|
785
|
+
let n = !1, r = t.onError || P;
|
|
789
786
|
t.onError = (e) => {
|
|
790
787
|
n = !0, r(e);
|
|
791
788
|
};
|
|
792
|
-
let i =
|
|
793
|
-
return t.optimize &&
|
|
789
|
+
let i = De(t).parse(e);
|
|
790
|
+
return t.optimize && ye(i), t.mangle && F(i), {
|
|
794
791
|
ast: i,
|
|
795
792
|
detectError: n,
|
|
796
793
|
code: ``
|
|
797
794
|
};
|
|
798
795
|
}
|
|
799
|
-
function
|
|
796
|
+
function Ze(e, t) {
|
|
800
797
|
if (_(e)) {
|
|
801
798
|
v(t.warnHtmlMessage) && t.warnHtmlMessage;
|
|
802
|
-
let n = (t.onCacheKey ||
|
|
799
|
+
let n = (t.onCacheKey || Je)(e), r = V[n];
|
|
803
800
|
if (r) return r;
|
|
804
|
-
let { ast: i, detectError: a } =
|
|
801
|
+
let { ast: i, detectError: a } = Xe(e, {
|
|
805
802
|
...t,
|
|
806
803
|
location: !1,
|
|
807
804
|
mangle: !0,
|
|
808
805
|
optimize: !0
|
|
809
|
-
}), o =
|
|
810
|
-
return a ? o :
|
|
806
|
+
}), o = We(i);
|
|
807
|
+
return a ? o : V[n] = o;
|
|
811
808
|
}
|
|
812
809
|
{
|
|
813
|
-
if (!
|
|
810
|
+
if (!L(e)) return (() => e);
|
|
814
811
|
let t = e.cacheKey;
|
|
815
|
-
return t ?
|
|
812
|
+
return t ? V[t] || (V[t] = We(e)) : We(e);
|
|
816
813
|
}
|
|
817
814
|
}
|
|
818
|
-
const
|
|
815
|
+
const H = {
|
|
819
816
|
INVALID_ARGUMENT: 17,
|
|
820
817
|
INVALID_DATE_ARGUMENT: 18,
|
|
821
818
|
INVALID_ISO_DATE_ARGUMENT: 19,
|
|
822
819
|
NOT_SUPPORT_LOCALE_PROMISE_VALUE: 20,
|
|
823
820
|
NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: 21,
|
|
824
821
|
NOT_SUPPORT_LOCALE_TYPE: 22
|
|
825
|
-
},
|
|
826
|
-
function
|
|
827
|
-
return
|
|
822
|
+
}, Qe = 23;
|
|
823
|
+
function $e(e) {
|
|
824
|
+
return N(e, null, void 0);
|
|
828
825
|
}
|
|
829
|
-
|
|
830
|
-
function
|
|
831
|
-
return t.locale == null ?
|
|
826
|
+
H.INVALID_ARGUMENT, H.INVALID_DATE_ARGUMENT, H.INVALID_ISO_DATE_ARGUMENT, H.NOT_SUPPORT_LOCALE_PROMISE_VALUE, H.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION, H.NOT_SUPPORT_LOCALE_TYPE;
|
|
827
|
+
function U(e, t) {
|
|
828
|
+
return t.locale == null ? G(e.locale) : G(t.locale);
|
|
832
829
|
}
|
|
833
|
-
let
|
|
834
|
-
function
|
|
830
|
+
let W;
|
|
831
|
+
function G(e) {
|
|
835
832
|
if (_(e)) return e;
|
|
836
833
|
if (g(e)) {
|
|
837
|
-
if (e.resolvedOnce &&
|
|
834
|
+
if (e.resolvedOnce && W != null) return W;
|
|
838
835
|
if (e.constructor.name === `Function`) {
|
|
839
836
|
let t = e();
|
|
840
|
-
if (b(t)) throw Error(
|
|
841
|
-
return
|
|
837
|
+
if (b(t)) throw Error(H.NOT_SUPPORT_LOCALE_PROMISE_VALUE);
|
|
838
|
+
return W = t;
|
|
842
839
|
}
|
|
843
|
-
throw Error(
|
|
840
|
+
throw Error(H.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION);
|
|
844
841
|
}
|
|
845
|
-
throw Error(
|
|
842
|
+
throw Error(H.NOT_SUPPORT_LOCALE_TYPE);
|
|
846
843
|
}
|
|
847
|
-
function
|
|
844
|
+
function et(e, t, n) {
|
|
848
845
|
return [.../* @__PURE__ */ new Set([n, ...h(t) ? t : y(t) ? Object.keys(t).filter((e) => e !== "default") : _(t) ? [t] : [n]])];
|
|
849
846
|
}
|
|
850
|
-
function
|
|
851
|
-
let r = _(n) ? n :
|
|
847
|
+
function tt(e, t, n) {
|
|
848
|
+
let r = _(n) ? n : J, i = e, a;
|
|
852
849
|
y(t) ? (i.__localeChainObjectCache || (i.__localeChainObjectCache = /* @__PURE__ */ new WeakMap()), a = i.__localeChainObjectCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainObjectCache.set(t, a))) : (i.__localeChainCache || (i.__localeChainCache = /* @__PURE__ */ new Map()), a = i.__localeChainCache.get(t), a || (a = /* @__PURE__ */ new Map(), i.__localeChainCache.set(t, a)));
|
|
853
850
|
let o = a.get(r);
|
|
854
851
|
if (o) return o;
|
|
855
852
|
let s = [], c = [n];
|
|
856
|
-
for (; h(c);) c =
|
|
853
|
+
for (; h(c);) c = nt(s, c, t);
|
|
857
854
|
let l = h(t) || !C(t) ? t : t.default ? t.default : null;
|
|
858
|
-
return c = _(l) ? [l] : l, h(c) &&
|
|
855
|
+
return c = _(l) ? [l] : l, h(c) && nt(s, c, !1), a.set(r, s), s;
|
|
859
856
|
}
|
|
860
|
-
function
|
|
857
|
+
function nt(e, t, n) {
|
|
861
858
|
let r = !0;
|
|
862
859
|
for (let i = 0; i < t.length && v(r); i++) {
|
|
863
860
|
let a = t[i];
|
|
864
|
-
_(a) && (r =
|
|
861
|
+
_(a) && (r = rt(e, t[i], n));
|
|
865
862
|
}
|
|
866
863
|
return r;
|
|
867
864
|
}
|
|
868
|
-
function
|
|
865
|
+
function rt(e, t, n) {
|
|
869
866
|
let r, i = t.split(`-`);
|
|
870
867
|
do
|
|
871
|
-
r =
|
|
868
|
+
r = it(e, i.join(`-`), n), i.splice(-1, 1);
|
|
872
869
|
while (i.length && r === !0);
|
|
873
870
|
return r;
|
|
874
871
|
}
|
|
875
|
-
function
|
|
872
|
+
function it(e, t, n) {
|
|
876
873
|
let r = !1;
|
|
877
874
|
if (!e.includes(t) && (r = !0, t)) {
|
|
878
875
|
r = t[t.length - 1] !== `!`;
|
|
@@ -881,53 +878,53 @@ function tt(e, t, n) {
|
|
|
881
878
|
}
|
|
882
879
|
return r;
|
|
883
880
|
}
|
|
884
|
-
const
|
|
885
|
-
|
|
881
|
+
const K = [];
|
|
882
|
+
K[0] = {
|
|
886
883
|
w: [0],
|
|
887
884
|
i: [3, 0],
|
|
888
885
|
"[": [4],
|
|
889
886
|
o: [7]
|
|
890
|
-
},
|
|
887
|
+
}, K[1] = {
|
|
891
888
|
w: [1],
|
|
892
889
|
".": [2],
|
|
893
890
|
"[": [4],
|
|
894
891
|
o: [7]
|
|
895
|
-
},
|
|
892
|
+
}, K[2] = {
|
|
896
893
|
w: [2],
|
|
897
894
|
i: [3, 0],
|
|
898
895
|
0: [3, 0]
|
|
899
|
-
},
|
|
896
|
+
}, K[3] = {
|
|
900
897
|
i: [3, 0],
|
|
901
898
|
0: [3, 0],
|
|
902
899
|
w: [1, 1],
|
|
903
900
|
".": [2, 1],
|
|
904
901
|
"[": [4, 1],
|
|
905
902
|
o: [7, 1]
|
|
906
|
-
},
|
|
903
|
+
}, K[4] = {
|
|
907
904
|
"'": [5, 0],
|
|
908
905
|
"\"": [6, 0],
|
|
909
906
|
"[": [4, 2],
|
|
910
907
|
"]": [1, 3],
|
|
911
908
|
o: 8,
|
|
912
909
|
l: [4, 0]
|
|
913
|
-
},
|
|
910
|
+
}, K[5] = {
|
|
914
911
|
"'": [4, 0],
|
|
915
912
|
o: 8,
|
|
916
913
|
l: [5, 0]
|
|
917
|
-
},
|
|
914
|
+
}, K[6] = {
|
|
918
915
|
"\"": [4, 0],
|
|
919
916
|
o: 8,
|
|
920
917
|
l: [6, 0]
|
|
921
918
|
};
|
|
922
|
-
const
|
|
923
|
-
function
|
|
924
|
-
return
|
|
919
|
+
const at = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
|
|
920
|
+
function ot(e) {
|
|
921
|
+
return at.test(e);
|
|
925
922
|
}
|
|
926
|
-
function
|
|
923
|
+
function st(e) {
|
|
927
924
|
let t = e.charCodeAt(0);
|
|
928
925
|
return t === e.charCodeAt(e.length - 1) && (t === 34 || t === 39) ? e.slice(1, -1) : e;
|
|
929
926
|
}
|
|
930
|
-
function
|
|
927
|
+
function ct(e) {
|
|
931
928
|
if (e == null) return `o`;
|
|
932
929
|
switch (e.charCodeAt(0)) {
|
|
933
930
|
case 91:
|
|
@@ -948,11 +945,11 @@ function at(e) {
|
|
|
948
945
|
}
|
|
949
946
|
return `i`;
|
|
950
947
|
}
|
|
951
|
-
function
|
|
948
|
+
function lt(e) {
|
|
952
949
|
let t = e.trim();
|
|
953
|
-
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 :
|
|
950
|
+
return e.charAt(0) === `0` && isNaN(parseInt(e)) ? !1 : ot(t) ? st(t) : `*` + t;
|
|
954
951
|
}
|
|
955
|
-
function
|
|
952
|
+
function ut(e) {
|
|
956
953
|
let t = [], n = -1, r = 0, i = 0, a, o, s, c, l, u, d, f = [];
|
|
957
954
|
f[0] = () => {
|
|
958
955
|
o === void 0 ? o = s : o += s;
|
|
@@ -963,7 +960,7 @@ function st(e) {
|
|
|
963
960
|
}, f[3] = () => {
|
|
964
961
|
if (i > 0) i--, r = 4, f[0]();
|
|
965
962
|
else {
|
|
966
|
-
if (i = 0, o === void 0 || (o =
|
|
963
|
+
if (i = 0, o === void 0 || (o = lt(o), o === !1)) return !1;
|
|
967
964
|
f[1]();
|
|
968
965
|
}
|
|
969
966
|
};
|
|
@@ -972,29 +969,29 @@ function st(e) {
|
|
|
972
969
|
if (r === 5 && t === `'` || r === 6 && t === `"`) return n++, s = `\\` + t, f[0](), !0;
|
|
973
970
|
}
|
|
974
971
|
for (; r !== null;) if (n++, a = e[n], !(a === `\\` && p())) {
|
|
975
|
-
if (c =
|
|
972
|
+
if (c = ct(a), d = K[r], l = d[c] || d.l || 8, l === 8 || (r = l[0], l[1] !== void 0 && (u = f[l[1]], u && (s = a, u() === !1)))) return;
|
|
976
973
|
if (r === 7) return t;
|
|
977
974
|
}
|
|
978
975
|
}
|
|
979
|
-
const
|
|
980
|
-
function
|
|
976
|
+
const dt = /* @__PURE__ */ new Map();
|
|
977
|
+
function ft(e, t) {
|
|
981
978
|
return y(e) ? p(e, t) : null;
|
|
982
979
|
}
|
|
983
|
-
function
|
|
980
|
+
function pt(e, t) {
|
|
984
981
|
if (!y(e)) return null;
|
|
985
|
-
let n =
|
|
986
|
-
if (n || (n =
|
|
982
|
+
let n = dt.get(t);
|
|
983
|
+
if (n || (n = ut(t), n && dt.set(t, n)), !n) return null;
|
|
987
984
|
let r = n.length, i = e, a = 0;
|
|
988
985
|
for (; a < r;) {
|
|
989
986
|
let e = n[a];
|
|
990
|
-
if (
|
|
987
|
+
if (Ue.includes(e) && L(i) || !y(i) || !f(i, e)) return null;
|
|
991
988
|
let t = i[e];
|
|
992
989
|
if (t === void 0 || g(i)) return null;
|
|
993
990
|
i = t, a++;
|
|
994
991
|
}
|
|
995
992
|
return i;
|
|
996
993
|
}
|
|
997
|
-
const
|
|
994
|
+
const q = {
|
|
998
995
|
NOT_FOUND_KEY: 1,
|
|
999
996
|
FALLBACK_TO_TRANSLATE: 2,
|
|
1000
997
|
CANNOT_FORMAT_NUMBER: 3,
|
|
@@ -1007,50 +1004,50 @@ const J = {
|
|
|
1007
1004
|
IGNORE_UNSAFE_LOCALE: 10,
|
|
1008
1005
|
FALLBACK_TO_DEFAULT_PLURAL_RULE: 11,
|
|
1009
1006
|
FALLBACK_FROM_INVALID_LOCALE: 12
|
|
1010
|
-
},
|
|
1011
|
-
[
|
|
1012
|
-
[
|
|
1013
|
-
[
|
|
1014
|
-
[
|
|
1015
|
-
[
|
|
1016
|
-
[
|
|
1017
|
-
[
|
|
1018
|
-
[
|
|
1019
|
-
[
|
|
1020
|
-
[
|
|
1021
|
-
[
|
|
1022
|
-
[
|
|
1007
|
+
}, mt = 13, ht = {
|
|
1008
|
+
[q.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale {resource}.`,
|
|
1009
|
+
[q.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`,
|
|
1010
|
+
[q.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`,
|
|
1011
|
+
[q.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`,
|
|
1012
|
+
[q.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,
|
|
1013
|
+
[q.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`,
|
|
1014
|
+
[q.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.`,
|
|
1015
|
+
[q.INVALID_NUMBER_ARGUMENT]: `Invalid argument for number formatting: expected a number but received '{value}'.`,
|
|
1016
|
+
[q.INVALID_DATE_ARGUMENT]: `Invalid argument for datetime formatting: expected a Date, number, or ISO string but received '{value}'.`,
|
|
1017
|
+
[q.IGNORE_UNSAFE_LOCALE]: `Ignore '{locale}' locale: it is a property name of Object.prototype`,
|
|
1018
|
+
[q.FALLBACK_TO_DEFAULT_PLURAL_RULE]: `Fall back to the default plural rule for '{locale}' locale: Intl.PluralRules does not support it`,
|
|
1019
|
+
[q.FALLBACK_FROM_INVALID_LOCALE]: `Fall back to '{target}' locale for {type} formatting with '{locale}' locale: it is not a BCP 47 language tag`
|
|
1023
1020
|
};
|
|
1024
|
-
function
|
|
1025
|
-
return t(
|
|
1021
|
+
function gt(e, ...n) {
|
|
1022
|
+
return t(ht[e], ...n);
|
|
1026
1023
|
}
|
|
1027
|
-
const
|
|
1028
|
-
function
|
|
1024
|
+
const _t = `12.0.0-alpha.8`, vt = -1, J = `en-US`, yt = ``, bt = (e) => `${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;
|
|
1025
|
+
function xt() {
|
|
1029
1026
|
return {
|
|
1030
1027
|
upper: (e, t) => t === `text` && _(e) ? e.toUpperCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toUpperCase() : e,
|
|
1031
1028
|
lower: (e, t) => t === `text` && _(e) ? e.toLowerCase() : t === `vnode` && y(e) && `__v_isVNode` in e ? e.children.toLowerCase() : e,
|
|
1032
|
-
capitalize: (e, t) => t === `text` && _(e) ?
|
|
1029
|
+
capitalize: (e, t) => t === `text` && _(e) ? bt(e) : t === `vnode` && y(e) && `__v_isVNode` in e ? bt(e.children) : e
|
|
1033
1030
|
};
|
|
1034
1031
|
}
|
|
1035
|
-
let
|
|
1036
|
-
function
|
|
1037
|
-
|
|
1032
|
+
let St;
|
|
1033
|
+
function Ct(e) {
|
|
1034
|
+
St = e;
|
|
1038
1035
|
}
|
|
1039
|
-
let
|
|
1040
|
-
function
|
|
1041
|
-
|
|
1036
|
+
let wt;
|
|
1037
|
+
function Tt(e) {
|
|
1038
|
+
wt = e;
|
|
1042
1039
|
}
|
|
1043
|
-
let
|
|
1044
|
-
function
|
|
1045
|
-
|
|
1040
|
+
let Et;
|
|
1041
|
+
function Dt(e) {
|
|
1042
|
+
Et = e;
|
|
1046
1043
|
}
|
|
1047
|
-
let
|
|
1048
|
-
function
|
|
1049
|
-
let t = g(e.onWarn) ? e.onWarn : E, n = _(e.version) ? e.version :
|
|
1050
|
-
|
|
1044
|
+
let Ot = 0;
|
|
1045
|
+
function kt(e = {}) {
|
|
1046
|
+
let t = g(e.onWarn) ? e.onWarn : E, n = _(e.version) ? e.version : _t, r = _(e.locale) || g(e.locale) ? e.locale : J, i = g(r) ? J : r, a = Nt(e.fallbackLocale) ? e.fallbackLocale : i, o = C(e.messages) ? e.messages : At(i), s = C(e.datetimeFormats) ? e.datetimeFormats : At(i), l = C(e.numberFormats) ? e.numberFormats : At(i), d = c(u(), e.modifiers, xt()), f = e.pluralRules || u(), p = g(e.missing) ? e.missing : null, m = !Y(e.missingWarn) || e.missingWarn, h = !Y(e.fallbackWarn) || e.fallbackWarn, b = !!e.fallbackFormat, x = !!e.unresolving, S = g(e.postTranslation) ? e.postTranslation : null, w = C(e.processor) ? e.processor : null, T = !v(e.warnHtmlMessage) || e.warnHtmlMessage, D = !!e.escapeParameter, ee = g(e.messageCompiler) ? e.messageCompiler : St || null, te = g(e.messageResolver) ? e.messageResolver : wt || ft, ne = g(e.localeFallbacker) ? e.localeFallbacker : Et || et, re = y(e.fallbackContext) ? e.fallbackContext : void 0;
|
|
1047
|
+
Ot++;
|
|
1051
1048
|
let O = {
|
|
1052
1049
|
version: n,
|
|
1053
|
-
cid:
|
|
1050
|
+
cid: Ot,
|
|
1054
1051
|
locale: r,
|
|
1055
1052
|
fallbackLocale: a,
|
|
1056
1053
|
messages: o,
|
|
@@ -1073,29 +1070,29 @@ function Et(e = {}) {
|
|
|
1073
1070
|
};
|
|
1074
1071
|
return O.datetimeFormats = s, O.numberFormats = l, O.__datetimeFormatters = /* @__PURE__ */ new Map(), O.__numberFormatters = /* @__PURE__ */ new Map(), O;
|
|
1075
1072
|
}
|
|
1076
|
-
const
|
|
1077
|
-
function
|
|
1073
|
+
const At = (e) => ({ [e]: u() });
|
|
1074
|
+
function jt(e, t) {
|
|
1078
1075
|
let n = p(e.messages, t);
|
|
1079
1076
|
if (n == null) return;
|
|
1080
1077
|
let r = u();
|
|
1081
|
-
return
|
|
1078
|
+
return j(n, r), r;
|
|
1082
1079
|
}
|
|
1083
|
-
function
|
|
1080
|
+
function Mt(e, t, n) {
|
|
1084
1081
|
m(t) || (e.messages[t] = n);
|
|
1085
1082
|
}
|
|
1086
|
-
function
|
|
1083
|
+
function Nt(e) {
|
|
1087
1084
|
return _(e) || h(e) || C(e) || e === !1;
|
|
1088
1085
|
}
|
|
1089
|
-
function
|
|
1086
|
+
function Y(e) {
|
|
1090
1087
|
return v(e) || o(e);
|
|
1091
1088
|
}
|
|
1092
|
-
function
|
|
1089
|
+
function Pt(e, t) {
|
|
1093
1090
|
return o(e) ? e.test(t) : e;
|
|
1094
1091
|
}
|
|
1095
|
-
function
|
|
1092
|
+
function Ft(e, t) {
|
|
1096
1093
|
return o(e) ? e.test(t) : e;
|
|
1097
1094
|
}
|
|
1098
|
-
function
|
|
1095
|
+
function It(e, t, n, r, i) {
|
|
1099
1096
|
let { missing: a, onWarn: o } = e;
|
|
1100
1097
|
if (a !== null) {
|
|
1101
1098
|
let r = a(e, n, t, i);
|
|
@@ -1103,84 +1100,84 @@ function Pt(e, t, n, r, i) {
|
|
|
1103
1100
|
}
|
|
1104
1101
|
return t;
|
|
1105
1102
|
}
|
|
1106
|
-
function
|
|
1103
|
+
function Lt(e, t) {
|
|
1107
1104
|
let n = e;
|
|
1108
1105
|
y(t) ? n.__localeChainObjectCache?.delete(t) : n.__localeChainCache?.delete(t);
|
|
1109
1106
|
}
|
|
1110
|
-
function
|
|
1111
|
-
|
|
1107
|
+
function Rt(e, t, n) {
|
|
1108
|
+
Lt(e, n), e.fallbackContext && Lt(e.fallbackContext, n);
|
|
1112
1109
|
{
|
|
1113
1110
|
let { __datetimeFormatters: t, __numberFormatters: n } = e;
|
|
1114
1111
|
t.clear(), n.clear();
|
|
1115
1112
|
}
|
|
1116
1113
|
e.localeFallbacker(e, n, t);
|
|
1117
1114
|
}
|
|
1118
|
-
function
|
|
1115
|
+
function zt(e, t) {
|
|
1119
1116
|
return e !== t && e.split(`-`)[0] === t.split(`-`)[0];
|
|
1120
1117
|
}
|
|
1121
|
-
function
|
|
1118
|
+
function Bt(e, t) {
|
|
1122
1119
|
let n = t.indexOf(e);
|
|
1123
1120
|
if (n === -1) return !1;
|
|
1124
|
-
for (let r = n + 1; r < t.length; r++) if (
|
|
1121
|
+
for (let r = n + 1; r < t.length; r++) if (zt(e, t[r])) return !0;
|
|
1125
1122
|
return !1;
|
|
1126
1123
|
}
|
|
1127
|
-
function
|
|
1124
|
+
function Vt(e, t, n, r, i, a, o) {
|
|
1128
1125
|
let { fallbackLocale: s, localeFallbacker: c, onWarn: l } = e, u = c(e, s, n);
|
|
1129
1126
|
for (let n = 0; n < u.length; n++) {
|
|
1130
1127
|
let a = u[n], s = p(p(r, a) || {}, t);
|
|
1131
1128
|
if (C(s) && _(a)) return a;
|
|
1132
|
-
|
|
1129
|
+
It(e, t, a, i, o);
|
|
1133
1130
|
}
|
|
1134
1131
|
return null;
|
|
1135
1132
|
}
|
|
1136
|
-
function
|
|
1133
|
+
function Ht(e) {
|
|
1137
1134
|
try {
|
|
1138
1135
|
return Intl.getCanonicalLocales(e), !0;
|
|
1139
1136
|
} catch {
|
|
1140
1137
|
return !1;
|
|
1141
1138
|
}
|
|
1142
1139
|
}
|
|
1143
|
-
function
|
|
1140
|
+
function Ut(e, t, n, r, i) {
|
|
1144
1141
|
try {
|
|
1145
1142
|
return new t(n, r);
|
|
1146
1143
|
} catch (i) {
|
|
1147
|
-
if (
|
|
1144
|
+
if (Ht(n)) throw i;
|
|
1148
1145
|
let { fallbackLocale: a, localeFallbacker: o, onWarn: s } = e;
|
|
1149
|
-
return new t(o(e, a, n).find(
|
|
1146
|
+
return new t(o(e, a, n).find(Ht) || `en-US`, r);
|
|
1150
1147
|
}
|
|
1151
1148
|
}
|
|
1152
|
-
function
|
|
1153
|
-
let u = v(r.missingWarn) ? r.missingWarn : e.missingWarn, d = v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p =
|
|
1149
|
+
function Wt(e, [t, n, r, i], a, o, s, l) {
|
|
1150
|
+
let u = v(r.missingWarn) ? r.missingWarn : e.missingWarn, d = v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, f = !!r.part, p = U(e, r);
|
|
1154
1151
|
if (!_(t) || t === ``) {
|
|
1155
|
-
let t =
|
|
1152
|
+
let t = Ut(e, a, p.replace(/!/g, ``), i, l);
|
|
1156
1153
|
return f ? t.formatToParts(n) : t.format(n);
|
|
1157
1154
|
}
|
|
1158
|
-
let m =
|
|
1155
|
+
let m = Vt(e, t, p, s, u, d, l);
|
|
1159
1156
|
if (!_(m)) return e.unresolving ? -1 : t;
|
|
1160
|
-
let h = s[m][t], g =
|
|
1161
|
-
return y || (y =
|
|
1157
|
+
let h = s[m][t], g = Gt(m, t, i), y = o.get(g);
|
|
1158
|
+
return y || (y = Ut(e, a, m, c({}, h, i), l), o.set(g, y)), f ? y.formatToParts(n) : y.format(n);
|
|
1162
1159
|
}
|
|
1163
|
-
function
|
|
1160
|
+
function Gt(e, t, n) {
|
|
1164
1161
|
let r = `${e}__${t}`;
|
|
1165
1162
|
return C(n) && !s(n) && (r = `${r}__${JSON.stringify(n)}`), r;
|
|
1166
1163
|
}
|
|
1167
|
-
function
|
|
1164
|
+
function Kt(e, t, n) {
|
|
1168
1165
|
for (let r in n) {
|
|
1169
1166
|
let n = `${t}__${r}`;
|
|
1170
1167
|
for (let t of e.keys()) (t === n || t.startsWith(`${n}__`)) && e.delete(t);
|
|
1171
1168
|
}
|
|
1172
1169
|
}
|
|
1173
|
-
function
|
|
1170
|
+
function qt(e, t, n, r) {
|
|
1174
1171
|
let [, i, a, o] = e, s = n;
|
|
1175
1172
|
return _(i) ? t.key = i : C(i) && Object.keys(i).forEach((e) => {
|
|
1176
1173
|
r.includes(e) ? s[e] = i[e] : t[e] = i[e];
|
|
1177
1174
|
}), _(a) ? t.locale = a : C(a) && (s = a), C(o) && (s = o), s;
|
|
1178
1175
|
}
|
|
1179
|
-
function
|
|
1176
|
+
function Jt(e, ...t) {
|
|
1180
1177
|
let { datetimeFormats: n, onWarn: r } = e, { __datetimeFormatters: o } = e;
|
|
1181
|
-
return !_(t[0]) && !a(t[0]) && !i(t[0]) ? `` :
|
|
1178
|
+
return !_(t[0]) && !a(t[0]) && !i(t[0]) ? `` : Wt(e, Xt(...t), Intl.DateTimeFormat, o, n, `datetime format`);
|
|
1182
1179
|
}
|
|
1183
|
-
const
|
|
1180
|
+
const Yt = [
|
|
1184
1181
|
`localeMatcher`,
|
|
1185
1182
|
`weekday`,
|
|
1186
1183
|
`era`,
|
|
@@ -1202,24 +1199,24 @@ const qt = [
|
|
|
1202
1199
|
`hourCycle`,
|
|
1203
1200
|
`fractionalSecondDigits`
|
|
1204
1201
|
];
|
|
1205
|
-
function
|
|
1202
|
+
function Xt(...e) {
|
|
1206
1203
|
let [t] = e, n = u(), r = u(), o;
|
|
1207
1204
|
if (_(t)) {
|
|
1208
1205
|
let e = t.match(/^(\d{4}-\d{2}-\d{2})(?:(T|\s)(.+))?$/);
|
|
1209
|
-
if (!e) throw Error(
|
|
1206
|
+
if (!e) throw Error(H.INVALID_ISO_DATE_ARGUMENT);
|
|
1210
1207
|
let n = e[3] ? e[3].trim().startsWith(`T`) ? `${e[1].trim()}${e[3].trim()}` : `${e[1].trim()}T${e[3].trim()}` : e[1].trim();
|
|
1211
1208
|
o = new Date(n);
|
|
1212
1209
|
try {
|
|
1213
1210
|
o.toISOString();
|
|
1214
1211
|
} catch {
|
|
1215
|
-
throw Error(
|
|
1212
|
+
throw Error(H.INVALID_ISO_DATE_ARGUMENT);
|
|
1216
1213
|
}
|
|
1217
1214
|
} else if (a(t)) {
|
|
1218
|
-
if (isNaN(t.getTime())) throw Error(
|
|
1215
|
+
if (isNaN(t.getTime())) throw Error(H.INVALID_DATE_ARGUMENT);
|
|
1219
1216
|
o = t;
|
|
1220
1217
|
} else if (i(t)) o = t;
|
|
1221
|
-
else throw Error(
|
|
1222
|
-
let s =
|
|
1218
|
+
else throw Error(H.INVALID_ARGUMENT);
|
|
1219
|
+
let s = qt(e, n, r, Yt);
|
|
1223
1220
|
return [
|
|
1224
1221
|
n.key || ``,
|
|
1225
1222
|
o,
|
|
@@ -1227,14 +1224,14 @@ function Jt(...e) {
|
|
|
1227
1224
|
s
|
|
1228
1225
|
];
|
|
1229
1226
|
}
|
|
1230
|
-
function
|
|
1231
|
-
|
|
1227
|
+
function Zt(e, t, n) {
|
|
1228
|
+
Kt(e.__datetimeFormatters, t, n);
|
|
1232
1229
|
}
|
|
1233
|
-
function
|
|
1230
|
+
function Qt(e, ...t) {
|
|
1234
1231
|
let { numberFormats: n, onWarn: r } = e, { __numberFormatters: a } = e;
|
|
1235
|
-
return i(t[0]) ?
|
|
1232
|
+
return i(t[0]) ? Wt(e, en(...t), Intl.NumberFormat, a, n, `number format`) : ``;
|
|
1236
1233
|
}
|
|
1237
|
-
const
|
|
1234
|
+
const $t = [
|
|
1238
1235
|
`localeMatcher`,
|
|
1239
1236
|
`style`,
|
|
1240
1237
|
`currency`,
|
|
@@ -1256,10 +1253,10 @@ const Zt = [
|
|
|
1256
1253
|
`roundingIncrement`,
|
|
1257
1254
|
`trailingZeroDisplay`
|
|
1258
1255
|
];
|
|
1259
|
-
function
|
|
1256
|
+
function en(...e) {
|
|
1260
1257
|
let [t] = e, n = u(), r = u();
|
|
1261
|
-
if (!i(t)) throw Error(
|
|
1262
|
-
let a = t, o =
|
|
1258
|
+
if (!i(t)) throw Error(H.INVALID_ARGUMENT);
|
|
1259
|
+
let a = t, o = qt(e, n, r, $t);
|
|
1263
1260
|
return [
|
|
1264
1261
|
n.key || ``,
|
|
1265
1262
|
a,
|
|
@@ -1267,14 +1264,14 @@ function Qt(...e) {
|
|
|
1267
1264
|
o
|
|
1268
1265
|
];
|
|
1269
1266
|
}
|
|
1270
|
-
function
|
|
1271
|
-
|
|
1267
|
+
function tn(e, t, n) {
|
|
1268
|
+
Kt(e.__numberFormatters, t, n);
|
|
1272
1269
|
}
|
|
1273
|
-
const
|
|
1270
|
+
const nn = (e) => e, rn = (e) => ``, an = `text`, on = (e) => e.length === 0 ? `` : T(e), sn = w;
|
|
1274
1271
|
function X(e, t) {
|
|
1275
1272
|
return e = Math.abs(e), t === 2 ? e === 1 ? 0 : 1 : Math.min(e, 2);
|
|
1276
1273
|
}
|
|
1277
|
-
const
|
|
1274
|
+
const cn = [
|
|
1278
1275
|
`zero`,
|
|
1279
1276
|
`one`,
|
|
1280
1277
|
`two`,
|
|
@@ -1282,29 +1279,29 @@ const on = [
|
|
|
1282
1279
|
`many`,
|
|
1283
1280
|
`other`
|
|
1284
1281
|
], Z = /* @__PURE__ */ new Map();
|
|
1285
|
-
function
|
|
1282
|
+
function ln(e) {
|
|
1286
1283
|
try {
|
|
1287
1284
|
if (Intl.PluralRules.supportedLocalesOf(e).length === 0) return null;
|
|
1288
1285
|
let t = new Intl.PluralRules(e);
|
|
1289
1286
|
return {
|
|
1290
1287
|
rules: t,
|
|
1291
|
-
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) =>
|
|
1288
|
+
categories: t.resolvedOptions().pluralCategories.slice().sort((e, t) => cn.indexOf(e) - cn.indexOf(t))
|
|
1292
1289
|
};
|
|
1293
1290
|
} catch {
|
|
1294
1291
|
return null;
|
|
1295
1292
|
}
|
|
1296
1293
|
}
|
|
1297
|
-
function
|
|
1294
|
+
function un(e) {
|
|
1298
1295
|
let t = Z.get(e);
|
|
1299
|
-
return t === void 0 && (t =
|
|
1296
|
+
return t === void 0 && (t = ln(e), Z.size >= 1e3 && Z.delete(Z.keys().next().value), Z.set(e, t)), t;
|
|
1300
1297
|
}
|
|
1301
|
-
function
|
|
1298
|
+
function dn(e) {
|
|
1302
1299
|
return i(e.pluralIndex) ? e.pluralIndex : i(e.named?.count) ? e.named.count : i(e.named?.n) ? e.named.n : -1;
|
|
1303
1300
|
}
|
|
1304
|
-
function
|
|
1305
|
-
let t = e.locale, n =
|
|
1301
|
+
function fn(e = {}) {
|
|
1302
|
+
let t = e.locale, n = dn(e), r;
|
|
1306
1303
|
r = _(t) && e.pluralRules && g(p(e.pluralRules, t)) ? e.pluralRules[t] : _(t) && typeof Intl < `u` && Intl.PluralRules !== void 0 ? (e, n) => {
|
|
1307
|
-
let r =
|
|
1304
|
+
let r = un(t);
|
|
1308
1305
|
if (r === null || n > r.categories.length) return X(e, n);
|
|
1309
1306
|
let { rules: i, categories: a } = r, o = i.select(Math.abs(e)), s = a.indexOf(o);
|
|
1310
1307
|
return Math.min(s === -1 ? n - 1 : s, n - 1);
|
|
@@ -1314,9 +1311,9 @@ function un(e = {}) {
|
|
|
1314
1311
|
return f && n == null && (t === `count` || t === `n`) ? e.pluralIndex : n;
|
|
1315
1312
|
};
|
|
1316
1313
|
function b(t, n) {
|
|
1317
|
-
return (g(e.messages) ? e.messages(t, !!n) : y(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) :
|
|
1314
|
+
return (g(e.messages) ? e.messages(t, !!n) : y(e.messages) ? e.messages[t] : !1) || (e.parent ? e.parent.message(t) : rn);
|
|
1318
1315
|
}
|
|
1319
|
-
let x = (t) => e.modifiers ? p(e.modifiers, t) :
|
|
1316
|
+
let x = (t) => e.modifiers ? p(e.modifiers, t) : nn, S = g(e.processor?.normalize) ? e.processor.normalize : on, C = g(e.processor?.interpolate) ? e.processor.interpolate : sn, w = {
|
|
1320
1317
|
list: l,
|
|
1321
1318
|
named: v,
|
|
1322
1319
|
plural: o,
|
|
@@ -1329,7 +1326,7 @@ function un(e = {}) {
|
|
|
1329
1326
|
return g(l) ? l(c, i) : c;
|
|
1330
1327
|
},
|
|
1331
1328
|
message: b,
|
|
1332
|
-
type: _(e.processor?.type) ? e.processor.type :
|
|
1329
|
+
type: _(e.processor?.type) ? e.processor.type : an,
|
|
1333
1330
|
interpolate: C,
|
|
1334
1331
|
normalize: S,
|
|
1335
1332
|
values: c(u(), s, d, f ? {
|
|
@@ -1339,28 +1336,28 @@ function un(e = {}) {
|
|
|
1339
1336
|
};
|
|
1340
1337
|
return w;
|
|
1341
1338
|
}
|
|
1342
|
-
const
|
|
1343
|
-
function
|
|
1344
|
-
let [n, r] =
|
|
1345
|
-
a &&
|
|
1339
|
+
const pn = () => ``, Q = (e) => g(e), $ = (e) => _(e) || L(e) || Q(e);
|
|
1340
|
+
function mn(e, ...t) {
|
|
1341
|
+
let [n, r] = vn(...t), i = U(e, r), a = v(r.escapeParameter) ? r.escapeParameter : e.escapeParameter;
|
|
1342
|
+
a && hn(r);
|
|
1346
1343
|
let o = !!r.resolvedMessage, [s, c, l] = o ? [
|
|
1347
1344
|
n,
|
|
1348
1345
|
i,
|
|
1349
1346
|
p(e.messages, i) || u()
|
|
1350
|
-
] :
|
|
1347
|
+
] : gn(e, n, i, e.fallbackLocale, v(r.fallbackWarn) ? r.fallbackWarn : e.fallbackWarn, v(r.missingWarn) ? r.missingWarn : e.missingWarn), d = n;
|
|
1351
1348
|
if (!o && !$(s)) {
|
|
1352
1349
|
let t = _(r.default) ? r.default : v(r.default) || e.fallbackFormat ? e.messageCompiler ? n : () => n : null;
|
|
1353
1350
|
(e.fallbackFormat || t != null && (_(t) || g(t))) && (s = t, d = s);
|
|
1354
1351
|
}
|
|
1355
1352
|
if (!o && (!$(s) || !_(c))) return e.unresolving ? -1 : n;
|
|
1356
|
-
let f = !1, m = Q(s) ? s :
|
|
1353
|
+
let f = !1, m = Q(s) ? s : _n(e, n, c, s, d, () => {
|
|
1357
1354
|
f = !0;
|
|
1358
1355
|
});
|
|
1359
1356
|
if (f) return s;
|
|
1360
|
-
let h = m(
|
|
1361
|
-
return a && _(y) && (y =
|
|
1357
|
+
let h = m(fn(bn(e, c, l, r))), y = e.postTranslation ? e.postTranslation(h, n) : h;
|
|
1358
|
+
return a && _(y) && (y = he(y)), y;
|
|
1362
1359
|
}
|
|
1363
|
-
function
|
|
1360
|
+
function hn(e) {
|
|
1364
1361
|
if (h(e.list) && (e.list = e.list.map((e) => _(e) ? D(e) : e)), y(e.named)) {
|
|
1365
1362
|
let t = e.named, n = u();
|
|
1366
1363
|
for (let e of Object.keys(t)) {
|
|
@@ -1370,10 +1367,10 @@ function pn(e) {
|
|
|
1370
1367
|
e.named = n;
|
|
1371
1368
|
}
|
|
1372
1369
|
}
|
|
1373
|
-
function
|
|
1370
|
+
function gn(e, t, n, r, i, a) {
|
|
1374
1371
|
let { messages: o, onWarn: s, messageResolver: c, localeFallbacker: l } = e, d = l(e, r, n), f = u(), m, h = null;
|
|
1375
|
-
for (let n = 0; n < d.length && (m = d[n], f = p(o, m) || u(), (h = c(f, t)) === null && (h = p(f, t)), !$(h)); n++) if (!
|
|
1376
|
-
let n =
|
|
1372
|
+
for (let n = 0; n < d.length && (m = d[n], f = p(o, m) || u(), (h = c(f, t)) === null && (h = p(f, t)), !$(h)); n++) if (!Bt(m, d)) {
|
|
1373
|
+
let n = It(e, t, m, a, `translate`);
|
|
1377
1374
|
n !== t && (h = n);
|
|
1378
1375
|
}
|
|
1379
1376
|
return [
|
|
@@ -1382,7 +1379,7 @@ function mn(e, t, n, r, i, a) {
|
|
|
1382
1379
|
f
|
|
1383
1380
|
];
|
|
1384
1381
|
}
|
|
1385
|
-
function
|
|
1382
|
+
function _n(e, t, n, r, i, a) {
|
|
1386
1383
|
if (Q(r)) {
|
|
1387
1384
|
let e = r;
|
|
1388
1385
|
return e.locale = e.locale || n, e.key = e.key || t, e;
|
|
@@ -1391,16 +1388,16 @@ function hn(e, t, n, r, i, a) {
|
|
|
1391
1388
|
let e = (() => r);
|
|
1392
1389
|
return e.locale = n, e.key = t, e;
|
|
1393
1390
|
}
|
|
1394
|
-
let o = e.messageCompiler(r,
|
|
1391
|
+
let o = e.messageCompiler(r, yn(e, n, i, r, e.warnHtmlMessage, a));
|
|
1395
1392
|
return o.locale = n, o.key = t, o.source = r, o;
|
|
1396
1393
|
}
|
|
1397
|
-
function
|
|
1394
|
+
function vn(...e) {
|
|
1398
1395
|
let [t, n, r] = e;
|
|
1399
|
-
if (!_(t) && !i(t) && !Q(t) && !
|
|
1396
|
+
if (!_(t) && !i(t) && !Q(t) && !L(t)) throw Error(H.INVALID_ARGUMENT);
|
|
1400
1397
|
let a = i(t) ? String(t) : (Q(t), t), o = u();
|
|
1401
1398
|
return i(n) ? o.plural = n : _(n) ? o.default = n : C(n) && !s(n) ? o.named = n : h(n) && (o.list = n), i(r) ? o.plural = r : _(r) ? o.default = r : C(r) && c(o, r), [a, o];
|
|
1402
1399
|
}
|
|
1403
|
-
function
|
|
1400
|
+
function yn(e, t, r, i, a, o) {
|
|
1404
1401
|
return {
|
|
1405
1402
|
locale: t,
|
|
1406
1403
|
key: r,
|
|
@@ -1411,7 +1408,7 @@ function _n(e, t, r, i, a, o) {
|
|
|
1411
1408
|
onCacheKey: (e) => n(t, r, e)
|
|
1412
1409
|
};
|
|
1413
1410
|
}
|
|
1414
|
-
function
|
|
1411
|
+
function bn(e, t, n, r) {
|
|
1415
1412
|
let { modifiers: a, pluralRules: o, messageResolver: s, fallbackLocale: c, fallbackWarn: l, missingWarn: u, fallbackContext: d } = e;
|
|
1416
1413
|
return {
|
|
1417
1414
|
locale: t,
|
|
@@ -1420,16 +1417,16 @@ function vn(e, t, n, r) {
|
|
|
1420
1417
|
messages: (r, i) => {
|
|
1421
1418
|
let a = s(n, r);
|
|
1422
1419
|
if (a == null && (d || i)) {
|
|
1423
|
-
let [n, , i] =
|
|
1420
|
+
let [n, , i] = gn(d || e, r, t, c, l, u);
|
|
1424
1421
|
a = n ?? s(i, r);
|
|
1425
1422
|
}
|
|
1426
|
-
if (_(a) ||
|
|
1427
|
-
let n = !1, i =
|
|
1423
|
+
if (_(a) || L(a)) {
|
|
1424
|
+
let n = !1, i = _n(e, r, t, a, r, () => {
|
|
1428
1425
|
n = !0;
|
|
1429
1426
|
});
|
|
1430
|
-
return n ?
|
|
1427
|
+
return n ? pn : i;
|
|
1431
1428
|
}
|
|
1432
|
-
return Q(a) ? a :
|
|
1429
|
+
return Q(a) ? a : pn;
|
|
1433
1430
|
},
|
|
1434
1431
|
processor: e.processor ?? void 0,
|
|
1435
1432
|
list: r.list ?? void 0,
|
|
@@ -1437,4 +1434,4 @@ function vn(e, t, n, r) {
|
|
|
1437
1434
|
pluralIndex: i(r.plural) ? r.plural : void 0
|
|
1438
1435
|
};
|
|
1439
1436
|
}
|
|
1440
|
-
export {
|
|
1437
|
+
export { Ue as AST_NODE_PROPS_KEYS, Qe as CORE_ERROR_CODES_EXTEND_POINT, mt as CORE_WARN_CODES_EXTEND_POINT, q as CoreWarnCodes, Yt as DATETIME_FORMAT_OPTIONS_KEYS, J as DEFAULT_LOCALE, an as DEFAULT_MESSAGE_DATA_TYPE, yt as MISSING_RESOLVE_VALUE, vt as NOT_RESOLVED, $t as NUMBER_FORMAT_OPTIONS_KEYS, _t as VERSION, Ye as clearCompileCache, Zt as clearDateTimeFormat, tn as clearNumberFormat, Ze as compile, N as createCompileError, kt as createCoreContext, $e as createCoreError, fn as createMessageContext, Jt as datetime, tt as fallbackWithLocaleChain, et as fallbackWithSimple, U as getLocale, jt as getLocaleMessage, gt as getWarnMessage, It as handleMissing, zt as isAlmostSameLocale, Nt as isFallbackLocale, Bt as isImplicitFallback, L as isMessageAST, $ as isMessageFormat, Q as isMessageFunction, Pt as isTranslateFallbackWarn, Ft as isTranslateMissingWarn, Y as isWarnOption, Qt as number, ut as parse, Xt as parseDateTimeArgs, en as parseNumberArgs, vn as parseTranslateArgs, Dt as registerLocaleFallbacker, Ct as registerMessageCompiler, Tt as registerMessageResolver, G as resolveLocale, pt as resolveValue, ft as resolveWithKeyValue, Mt as setLocaleMessage, mn as translate, Rt as updateFallbackLocale };
|