intl-messageformat 10.1.2 → 10.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +13 -0
- package/intl-messageformat.esm.js +3131 -0
- package/intl-messageformat.iife.js +3212 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/src/core.d.ts +34 -0
- package/lib/src/core.d.ts.map +1 -0
- package/lib/src/core.js +240 -0
- package/lib/src/error.d.ts +28 -0
- package/lib/src/error.d.ts.map +1 -0
- package/lib/src/error.js +48 -0
- package/lib/src/formatters.d.ts +47 -0
- package/lib/src/formatters.d.ts.map +1 -0
- package/lib/src/formatters.js +177 -0
- package/package.json +4 -4
- package/src/core.d.ts +34 -0
- package/src/core.d.ts.map +1 -0
- package/src/core.js +243 -0
- package/src/error.d.ts +28 -0
- package/src/error.d.ts.map +1 -0
- package/src/error.js +51 -0
- package/src/formatters.d.ts +47 -0
- package/src/formatters.d.ts.map +1 -0
- package/src/formatters.js +182 -0
- package/BUILD +0 -126
- package/CHANGELOG.md +0 -1141
- package/index.ts +0 -11
- package/src/core.ts +0 -294
- package/src/error.ts +0 -65
- package/src/formatters.ts +0 -311
- package/tests/benchmark.ts +0 -103
- package/tests/index.test.ts +0 -968
- package/tsconfig.json +0 -5
|
@@ -0,0 +1,3131 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => {
|
|
4
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
+
return value;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/tslib.es6.js
|
|
9
|
+
var __assign = function() {
|
|
10
|
+
__assign = Object.assign || function __assign2(t) {
|
|
11
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12
|
+
s = arguments[i];
|
|
13
|
+
for (var p in s)
|
|
14
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
}
|
|
17
|
+
return t;
|
|
18
|
+
};
|
|
19
|
+
return __assign.apply(this, arguments);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/error.js
|
|
23
|
+
var ErrorKind;
|
|
24
|
+
(function(ErrorKind2) {
|
|
25
|
+
ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
|
|
26
|
+
ErrorKind2[ErrorKind2["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT";
|
|
27
|
+
ErrorKind2[ErrorKind2["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT";
|
|
28
|
+
ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE";
|
|
29
|
+
ErrorKind2[ErrorKind2["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE";
|
|
30
|
+
ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE";
|
|
31
|
+
ErrorKind2[ErrorKind2["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON";
|
|
32
|
+
ErrorKind2[ErrorKind2["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON";
|
|
33
|
+
ErrorKind2[ErrorKind2["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON";
|
|
34
|
+
ErrorKind2[ErrorKind2["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON";
|
|
35
|
+
ErrorKind2[ErrorKind2["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE";
|
|
36
|
+
ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS";
|
|
37
|
+
ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
38
|
+
ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE";
|
|
39
|
+
ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR";
|
|
40
|
+
ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR";
|
|
41
|
+
ErrorKind2[ErrorKind2["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT";
|
|
42
|
+
ErrorKind2[ErrorKind2["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT";
|
|
43
|
+
ErrorKind2[ErrorKind2["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR";
|
|
44
|
+
ErrorKind2[ErrorKind2["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR";
|
|
45
|
+
ErrorKind2[ErrorKind2["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR";
|
|
46
|
+
ErrorKind2[ErrorKind2["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE";
|
|
47
|
+
ErrorKind2[ErrorKind2["INVALID_TAG"] = 23] = "INVALID_TAG";
|
|
48
|
+
ErrorKind2[ErrorKind2["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME";
|
|
49
|
+
ErrorKind2[ErrorKind2["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG";
|
|
50
|
+
ErrorKind2[ErrorKind2["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
|
|
51
|
+
})(ErrorKind || (ErrorKind = {}));
|
|
52
|
+
|
|
53
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/types.js
|
|
54
|
+
var TYPE;
|
|
55
|
+
(function(TYPE2) {
|
|
56
|
+
TYPE2[TYPE2["literal"] = 0] = "literal";
|
|
57
|
+
TYPE2[TYPE2["argument"] = 1] = "argument";
|
|
58
|
+
TYPE2[TYPE2["number"] = 2] = "number";
|
|
59
|
+
TYPE2[TYPE2["date"] = 3] = "date";
|
|
60
|
+
TYPE2[TYPE2["time"] = 4] = "time";
|
|
61
|
+
TYPE2[TYPE2["select"] = 5] = "select";
|
|
62
|
+
TYPE2[TYPE2["plural"] = 6] = "plural";
|
|
63
|
+
TYPE2[TYPE2["pound"] = 7] = "pound";
|
|
64
|
+
TYPE2[TYPE2["tag"] = 8] = "tag";
|
|
65
|
+
})(TYPE || (TYPE = {}));
|
|
66
|
+
var SKELETON_TYPE;
|
|
67
|
+
(function(SKELETON_TYPE2) {
|
|
68
|
+
SKELETON_TYPE2[SKELETON_TYPE2["number"] = 0] = "number";
|
|
69
|
+
SKELETON_TYPE2[SKELETON_TYPE2["dateTime"] = 1] = "dateTime";
|
|
70
|
+
})(SKELETON_TYPE || (SKELETON_TYPE = {}));
|
|
71
|
+
function isLiteralElement(el) {
|
|
72
|
+
return el.type === TYPE.literal;
|
|
73
|
+
}
|
|
74
|
+
function isArgumentElement(el) {
|
|
75
|
+
return el.type === TYPE.argument;
|
|
76
|
+
}
|
|
77
|
+
function isNumberElement(el) {
|
|
78
|
+
return el.type === TYPE.number;
|
|
79
|
+
}
|
|
80
|
+
function isDateElement(el) {
|
|
81
|
+
return el.type === TYPE.date;
|
|
82
|
+
}
|
|
83
|
+
function isTimeElement(el) {
|
|
84
|
+
return el.type === TYPE.time;
|
|
85
|
+
}
|
|
86
|
+
function isSelectElement(el) {
|
|
87
|
+
return el.type === TYPE.select;
|
|
88
|
+
}
|
|
89
|
+
function isPluralElement(el) {
|
|
90
|
+
return el.type === TYPE.plural;
|
|
91
|
+
}
|
|
92
|
+
function isPoundElement(el) {
|
|
93
|
+
return el.type === TYPE.pound;
|
|
94
|
+
}
|
|
95
|
+
function isTagElement(el) {
|
|
96
|
+
return el.type === TYPE.tag;
|
|
97
|
+
}
|
|
98
|
+
function isNumberSkeleton(el) {
|
|
99
|
+
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.number);
|
|
100
|
+
}
|
|
101
|
+
function isDateTimeSkeleton(el) {
|
|
102
|
+
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js
|
|
106
|
+
var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
107
|
+
|
|
108
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js
|
|
109
|
+
var DATE_TIME_REGEX = /(?:[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;
|
|
110
|
+
function parseDateTimeSkeleton(skeleton) {
|
|
111
|
+
var result = {};
|
|
112
|
+
skeleton.replace(DATE_TIME_REGEX, function(match) {
|
|
113
|
+
var len = match.length;
|
|
114
|
+
switch (match[0]) {
|
|
115
|
+
case "G":
|
|
116
|
+
result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short";
|
|
117
|
+
break;
|
|
118
|
+
case "y":
|
|
119
|
+
result.year = len === 2 ? "2-digit" : "numeric";
|
|
120
|
+
break;
|
|
121
|
+
case "Y":
|
|
122
|
+
case "u":
|
|
123
|
+
case "U":
|
|
124
|
+
case "r":
|
|
125
|
+
throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");
|
|
126
|
+
case "q":
|
|
127
|
+
case "Q":
|
|
128
|
+
throw new RangeError("`q/Q` (quarter) patterns are not supported");
|
|
129
|
+
case "M":
|
|
130
|
+
case "L":
|
|
131
|
+
result.month = ["numeric", "2-digit", "short", "long", "narrow"][len - 1];
|
|
132
|
+
break;
|
|
133
|
+
case "w":
|
|
134
|
+
case "W":
|
|
135
|
+
throw new RangeError("`w/W` (week) patterns are not supported");
|
|
136
|
+
case "d":
|
|
137
|
+
result.day = ["numeric", "2-digit"][len - 1];
|
|
138
|
+
break;
|
|
139
|
+
case "D":
|
|
140
|
+
case "F":
|
|
141
|
+
case "g":
|
|
142
|
+
throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");
|
|
143
|
+
case "E":
|
|
144
|
+
result.weekday = len === 4 ? "short" : len === 5 ? "narrow" : "short";
|
|
145
|
+
break;
|
|
146
|
+
case "e":
|
|
147
|
+
if (len < 4) {
|
|
148
|
+
throw new RangeError("`e..eee` (weekday) patterns are not supported");
|
|
149
|
+
}
|
|
150
|
+
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
151
|
+
break;
|
|
152
|
+
case "c":
|
|
153
|
+
if (len < 4) {
|
|
154
|
+
throw new RangeError("`c..ccc` (weekday) patterns are not supported");
|
|
155
|
+
}
|
|
156
|
+
result.weekday = ["short", "long", "narrow", "short"][len - 4];
|
|
157
|
+
break;
|
|
158
|
+
case "a":
|
|
159
|
+
result.hour12 = true;
|
|
160
|
+
break;
|
|
161
|
+
case "b":
|
|
162
|
+
case "B":
|
|
163
|
+
throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");
|
|
164
|
+
case "h":
|
|
165
|
+
result.hourCycle = "h12";
|
|
166
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
167
|
+
break;
|
|
168
|
+
case "H":
|
|
169
|
+
result.hourCycle = "h23";
|
|
170
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
171
|
+
break;
|
|
172
|
+
case "K":
|
|
173
|
+
result.hourCycle = "h11";
|
|
174
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
175
|
+
break;
|
|
176
|
+
case "k":
|
|
177
|
+
result.hourCycle = "h24";
|
|
178
|
+
result.hour = ["numeric", "2-digit"][len - 1];
|
|
179
|
+
break;
|
|
180
|
+
case "j":
|
|
181
|
+
case "J":
|
|
182
|
+
case "C":
|
|
183
|
+
throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");
|
|
184
|
+
case "m":
|
|
185
|
+
result.minute = ["numeric", "2-digit"][len - 1];
|
|
186
|
+
break;
|
|
187
|
+
case "s":
|
|
188
|
+
result.second = ["numeric", "2-digit"][len - 1];
|
|
189
|
+
break;
|
|
190
|
+
case "S":
|
|
191
|
+
case "A":
|
|
192
|
+
throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");
|
|
193
|
+
case "z":
|
|
194
|
+
result.timeZoneName = len < 4 ? "short" : "long";
|
|
195
|
+
break;
|
|
196
|
+
case "Z":
|
|
197
|
+
case "O":
|
|
198
|
+
case "v":
|
|
199
|
+
case "V":
|
|
200
|
+
case "X":
|
|
201
|
+
case "x":
|
|
202
|
+
throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead");
|
|
203
|
+
}
|
|
204
|
+
return "";
|
|
205
|
+
});
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js
|
|
210
|
+
var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
211
|
+
|
|
212
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/number.js
|
|
213
|
+
function parseNumberSkeletonFromString(skeleton) {
|
|
214
|
+
if (skeleton.length === 0) {
|
|
215
|
+
throw new Error("Number skeleton cannot be empty");
|
|
216
|
+
}
|
|
217
|
+
var stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter(function(x) {
|
|
218
|
+
return x.length > 0;
|
|
219
|
+
});
|
|
220
|
+
var tokens = [];
|
|
221
|
+
for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {
|
|
222
|
+
var stringToken = stringTokens_1[_i];
|
|
223
|
+
var stemAndOptions = stringToken.split("/");
|
|
224
|
+
if (stemAndOptions.length === 0) {
|
|
225
|
+
throw new Error("Invalid number skeleton");
|
|
226
|
+
}
|
|
227
|
+
var stem = stemAndOptions[0], options = stemAndOptions.slice(1);
|
|
228
|
+
for (var _a2 = 0, options_1 = options; _a2 < options_1.length; _a2++) {
|
|
229
|
+
var option = options_1[_a2];
|
|
230
|
+
if (option.length === 0) {
|
|
231
|
+
throw new Error("Invalid number skeleton");
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
tokens.push({ stem, options });
|
|
235
|
+
}
|
|
236
|
+
return tokens;
|
|
237
|
+
}
|
|
238
|
+
function icuUnitToEcma(unit) {
|
|
239
|
+
return unit.replace(/^(.*?)-/, "");
|
|
240
|
+
}
|
|
241
|
+
var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g;
|
|
242
|
+
var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g;
|
|
243
|
+
var INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g;
|
|
244
|
+
var CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;
|
|
245
|
+
function parseSignificantPrecision(str) {
|
|
246
|
+
var result = {};
|
|
247
|
+
if (str[str.length - 1] === "r") {
|
|
248
|
+
result.roundingPriority = "morePrecision";
|
|
249
|
+
} else if (str[str.length - 1] === "s") {
|
|
250
|
+
result.roundingPriority = "lessPrecision";
|
|
251
|
+
}
|
|
252
|
+
str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) {
|
|
253
|
+
if (typeof g2 !== "string") {
|
|
254
|
+
result.minimumSignificantDigits = g1.length;
|
|
255
|
+
result.maximumSignificantDigits = g1.length;
|
|
256
|
+
} else if (g2 === "+") {
|
|
257
|
+
result.minimumSignificantDigits = g1.length;
|
|
258
|
+
} else if (g1[0] === "#") {
|
|
259
|
+
result.maximumSignificantDigits = g1.length;
|
|
260
|
+
} else {
|
|
261
|
+
result.minimumSignificantDigits = g1.length;
|
|
262
|
+
result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0);
|
|
263
|
+
}
|
|
264
|
+
return "";
|
|
265
|
+
});
|
|
266
|
+
return result;
|
|
267
|
+
}
|
|
268
|
+
function parseSign(str) {
|
|
269
|
+
switch (str) {
|
|
270
|
+
case "sign-auto":
|
|
271
|
+
return {
|
|
272
|
+
signDisplay: "auto"
|
|
273
|
+
};
|
|
274
|
+
case "sign-accounting":
|
|
275
|
+
case "()":
|
|
276
|
+
return {
|
|
277
|
+
currencySign: "accounting"
|
|
278
|
+
};
|
|
279
|
+
case "sign-always":
|
|
280
|
+
case "+!":
|
|
281
|
+
return {
|
|
282
|
+
signDisplay: "always"
|
|
283
|
+
};
|
|
284
|
+
case "sign-accounting-always":
|
|
285
|
+
case "()!":
|
|
286
|
+
return {
|
|
287
|
+
signDisplay: "always",
|
|
288
|
+
currencySign: "accounting"
|
|
289
|
+
};
|
|
290
|
+
case "sign-except-zero":
|
|
291
|
+
case "+?":
|
|
292
|
+
return {
|
|
293
|
+
signDisplay: "exceptZero"
|
|
294
|
+
};
|
|
295
|
+
case "sign-accounting-except-zero":
|
|
296
|
+
case "()?":
|
|
297
|
+
return {
|
|
298
|
+
signDisplay: "exceptZero",
|
|
299
|
+
currencySign: "accounting"
|
|
300
|
+
};
|
|
301
|
+
case "sign-never":
|
|
302
|
+
case "+_":
|
|
303
|
+
return {
|
|
304
|
+
signDisplay: "never"
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function parseConciseScientificAndEngineeringStem(stem) {
|
|
309
|
+
var result;
|
|
310
|
+
if (stem[0] === "E" && stem[1] === "E") {
|
|
311
|
+
result = {
|
|
312
|
+
notation: "engineering"
|
|
313
|
+
};
|
|
314
|
+
stem = stem.slice(2);
|
|
315
|
+
} else if (stem[0] === "E") {
|
|
316
|
+
result = {
|
|
317
|
+
notation: "scientific"
|
|
318
|
+
};
|
|
319
|
+
stem = stem.slice(1);
|
|
320
|
+
}
|
|
321
|
+
if (result) {
|
|
322
|
+
var signDisplay = stem.slice(0, 2);
|
|
323
|
+
if (signDisplay === "+!") {
|
|
324
|
+
result.signDisplay = "always";
|
|
325
|
+
stem = stem.slice(2);
|
|
326
|
+
} else if (signDisplay === "+?") {
|
|
327
|
+
result.signDisplay = "exceptZero";
|
|
328
|
+
stem = stem.slice(2);
|
|
329
|
+
}
|
|
330
|
+
if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {
|
|
331
|
+
throw new Error("Malformed concise eng/scientific notation");
|
|
332
|
+
}
|
|
333
|
+
result.minimumIntegerDigits = stem.length;
|
|
334
|
+
}
|
|
335
|
+
return result;
|
|
336
|
+
}
|
|
337
|
+
function parseNotationOptions(opt) {
|
|
338
|
+
var result = {};
|
|
339
|
+
var signOpts = parseSign(opt);
|
|
340
|
+
if (signOpts) {
|
|
341
|
+
return signOpts;
|
|
342
|
+
}
|
|
343
|
+
return result;
|
|
344
|
+
}
|
|
345
|
+
function parseNumberSkeleton(tokens) {
|
|
346
|
+
var result = {};
|
|
347
|
+
for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
|
|
348
|
+
var token = tokens_1[_i];
|
|
349
|
+
switch (token.stem) {
|
|
350
|
+
case "percent":
|
|
351
|
+
case "%":
|
|
352
|
+
result.style = "percent";
|
|
353
|
+
continue;
|
|
354
|
+
case "%x100":
|
|
355
|
+
result.style = "percent";
|
|
356
|
+
result.scale = 100;
|
|
357
|
+
continue;
|
|
358
|
+
case "currency":
|
|
359
|
+
result.style = "currency";
|
|
360
|
+
result.currency = token.options[0];
|
|
361
|
+
continue;
|
|
362
|
+
case "group-off":
|
|
363
|
+
case ",_":
|
|
364
|
+
result.useGrouping = false;
|
|
365
|
+
continue;
|
|
366
|
+
case "precision-integer":
|
|
367
|
+
case ".":
|
|
368
|
+
result.maximumFractionDigits = 0;
|
|
369
|
+
continue;
|
|
370
|
+
case "measure-unit":
|
|
371
|
+
case "unit":
|
|
372
|
+
result.style = "unit";
|
|
373
|
+
result.unit = icuUnitToEcma(token.options[0]);
|
|
374
|
+
continue;
|
|
375
|
+
case "compact-short":
|
|
376
|
+
case "K":
|
|
377
|
+
result.notation = "compact";
|
|
378
|
+
result.compactDisplay = "short";
|
|
379
|
+
continue;
|
|
380
|
+
case "compact-long":
|
|
381
|
+
case "KK":
|
|
382
|
+
result.notation = "compact";
|
|
383
|
+
result.compactDisplay = "long";
|
|
384
|
+
continue;
|
|
385
|
+
case "scientific":
|
|
386
|
+
result = __assign(__assign(__assign({}, result), { notation: "scientific" }), token.options.reduce(function(all, opt2) {
|
|
387
|
+
return __assign(__assign({}, all), parseNotationOptions(opt2));
|
|
388
|
+
}, {}));
|
|
389
|
+
continue;
|
|
390
|
+
case "engineering":
|
|
391
|
+
result = __assign(__assign(__assign({}, result), { notation: "engineering" }), token.options.reduce(function(all, opt2) {
|
|
392
|
+
return __assign(__assign({}, all), parseNotationOptions(opt2));
|
|
393
|
+
}, {}));
|
|
394
|
+
continue;
|
|
395
|
+
case "notation-simple":
|
|
396
|
+
result.notation = "standard";
|
|
397
|
+
continue;
|
|
398
|
+
case "unit-width-narrow":
|
|
399
|
+
result.currencyDisplay = "narrowSymbol";
|
|
400
|
+
result.unitDisplay = "narrow";
|
|
401
|
+
continue;
|
|
402
|
+
case "unit-width-short":
|
|
403
|
+
result.currencyDisplay = "code";
|
|
404
|
+
result.unitDisplay = "short";
|
|
405
|
+
continue;
|
|
406
|
+
case "unit-width-full-name":
|
|
407
|
+
result.currencyDisplay = "name";
|
|
408
|
+
result.unitDisplay = "long";
|
|
409
|
+
continue;
|
|
410
|
+
case "unit-width-iso-code":
|
|
411
|
+
result.currencyDisplay = "symbol";
|
|
412
|
+
continue;
|
|
413
|
+
case "scale":
|
|
414
|
+
result.scale = parseFloat(token.options[0]);
|
|
415
|
+
continue;
|
|
416
|
+
case "integer-width":
|
|
417
|
+
if (token.options.length > 1) {
|
|
418
|
+
throw new RangeError("integer-width stems only accept a single optional option");
|
|
419
|
+
}
|
|
420
|
+
token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
421
|
+
if (g1) {
|
|
422
|
+
result.minimumIntegerDigits = g2.length;
|
|
423
|
+
} else if (g3 && g4) {
|
|
424
|
+
throw new Error("We currently do not support maximum integer digits");
|
|
425
|
+
} else if (g5) {
|
|
426
|
+
throw new Error("We currently do not support exact integer digits");
|
|
427
|
+
}
|
|
428
|
+
return "";
|
|
429
|
+
});
|
|
430
|
+
continue;
|
|
431
|
+
}
|
|
432
|
+
if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {
|
|
433
|
+
result.minimumIntegerDigits = token.stem.length;
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
if (FRACTION_PRECISION_REGEX.test(token.stem)) {
|
|
437
|
+
if (token.options.length > 1) {
|
|
438
|
+
throw new RangeError("Fraction-precision stems only accept a single optional option");
|
|
439
|
+
}
|
|
440
|
+
token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) {
|
|
441
|
+
if (g2 === "*") {
|
|
442
|
+
result.minimumFractionDigits = g1.length;
|
|
443
|
+
} else if (g3 && g3[0] === "#") {
|
|
444
|
+
result.maximumFractionDigits = g3.length;
|
|
445
|
+
} else if (g4 && g5) {
|
|
446
|
+
result.minimumFractionDigits = g4.length;
|
|
447
|
+
result.maximumFractionDigits = g4.length + g5.length;
|
|
448
|
+
} else {
|
|
449
|
+
result.minimumFractionDigits = g1.length;
|
|
450
|
+
result.maximumFractionDigits = g1.length;
|
|
451
|
+
}
|
|
452
|
+
return "";
|
|
453
|
+
});
|
|
454
|
+
var opt = token.options[0];
|
|
455
|
+
if (opt === "w") {
|
|
456
|
+
result = __assign(__assign({}, result), { trailingZeroDisplay: "stripIfInteger" });
|
|
457
|
+
} else if (opt) {
|
|
458
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(opt));
|
|
459
|
+
}
|
|
460
|
+
continue;
|
|
461
|
+
}
|
|
462
|
+
if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
|
|
463
|
+
result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));
|
|
464
|
+
continue;
|
|
465
|
+
}
|
|
466
|
+
var signOpts = parseSign(token.stem);
|
|
467
|
+
if (signOpts) {
|
|
468
|
+
result = __assign(__assign({}, result), signOpts);
|
|
469
|
+
}
|
|
470
|
+
var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);
|
|
471
|
+
if (conciseScientificAndEngineeringOpts) {
|
|
472
|
+
result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return result;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js
|
|
479
|
+
var timeData = {
|
|
480
|
+
"AX": [
|
|
481
|
+
"H"
|
|
482
|
+
],
|
|
483
|
+
"BQ": [
|
|
484
|
+
"H"
|
|
485
|
+
],
|
|
486
|
+
"CP": [
|
|
487
|
+
"H"
|
|
488
|
+
],
|
|
489
|
+
"CZ": [
|
|
490
|
+
"H"
|
|
491
|
+
],
|
|
492
|
+
"DK": [
|
|
493
|
+
"H"
|
|
494
|
+
],
|
|
495
|
+
"FI": [
|
|
496
|
+
"H"
|
|
497
|
+
],
|
|
498
|
+
"ID": [
|
|
499
|
+
"H"
|
|
500
|
+
],
|
|
501
|
+
"IS": [
|
|
502
|
+
"H"
|
|
503
|
+
],
|
|
504
|
+
"ML": [
|
|
505
|
+
"H"
|
|
506
|
+
],
|
|
507
|
+
"NE": [
|
|
508
|
+
"H"
|
|
509
|
+
],
|
|
510
|
+
"RU": [
|
|
511
|
+
"H"
|
|
512
|
+
],
|
|
513
|
+
"SE": [
|
|
514
|
+
"H"
|
|
515
|
+
],
|
|
516
|
+
"SJ": [
|
|
517
|
+
"H"
|
|
518
|
+
],
|
|
519
|
+
"SK": [
|
|
520
|
+
"H"
|
|
521
|
+
],
|
|
522
|
+
"AS": [
|
|
523
|
+
"h",
|
|
524
|
+
"H"
|
|
525
|
+
],
|
|
526
|
+
"BT": [
|
|
527
|
+
"h",
|
|
528
|
+
"H"
|
|
529
|
+
],
|
|
530
|
+
"DJ": [
|
|
531
|
+
"h",
|
|
532
|
+
"H"
|
|
533
|
+
],
|
|
534
|
+
"ER": [
|
|
535
|
+
"h",
|
|
536
|
+
"H"
|
|
537
|
+
],
|
|
538
|
+
"GH": [
|
|
539
|
+
"h",
|
|
540
|
+
"H"
|
|
541
|
+
],
|
|
542
|
+
"IN": [
|
|
543
|
+
"h",
|
|
544
|
+
"H"
|
|
545
|
+
],
|
|
546
|
+
"LS": [
|
|
547
|
+
"h",
|
|
548
|
+
"H"
|
|
549
|
+
],
|
|
550
|
+
"PG": [
|
|
551
|
+
"h",
|
|
552
|
+
"H"
|
|
553
|
+
],
|
|
554
|
+
"PW": [
|
|
555
|
+
"h",
|
|
556
|
+
"H"
|
|
557
|
+
],
|
|
558
|
+
"SO": [
|
|
559
|
+
"h",
|
|
560
|
+
"H"
|
|
561
|
+
],
|
|
562
|
+
"TO": [
|
|
563
|
+
"h",
|
|
564
|
+
"H"
|
|
565
|
+
],
|
|
566
|
+
"VU": [
|
|
567
|
+
"h",
|
|
568
|
+
"H"
|
|
569
|
+
],
|
|
570
|
+
"WS": [
|
|
571
|
+
"h",
|
|
572
|
+
"H"
|
|
573
|
+
],
|
|
574
|
+
"001": [
|
|
575
|
+
"H",
|
|
576
|
+
"h"
|
|
577
|
+
],
|
|
578
|
+
"AL": [
|
|
579
|
+
"h",
|
|
580
|
+
"H",
|
|
581
|
+
"hB"
|
|
582
|
+
],
|
|
583
|
+
"TD": [
|
|
584
|
+
"h",
|
|
585
|
+
"H",
|
|
586
|
+
"hB"
|
|
587
|
+
],
|
|
588
|
+
"ca-ES": [
|
|
589
|
+
"H",
|
|
590
|
+
"h",
|
|
591
|
+
"hB"
|
|
592
|
+
],
|
|
593
|
+
"CF": [
|
|
594
|
+
"H",
|
|
595
|
+
"h",
|
|
596
|
+
"hB"
|
|
597
|
+
],
|
|
598
|
+
"CM": [
|
|
599
|
+
"H",
|
|
600
|
+
"h",
|
|
601
|
+
"hB"
|
|
602
|
+
],
|
|
603
|
+
"fr-CA": [
|
|
604
|
+
"H",
|
|
605
|
+
"h",
|
|
606
|
+
"hB"
|
|
607
|
+
],
|
|
608
|
+
"gl-ES": [
|
|
609
|
+
"H",
|
|
610
|
+
"h",
|
|
611
|
+
"hB"
|
|
612
|
+
],
|
|
613
|
+
"it-CH": [
|
|
614
|
+
"H",
|
|
615
|
+
"h",
|
|
616
|
+
"hB"
|
|
617
|
+
],
|
|
618
|
+
"it-IT": [
|
|
619
|
+
"H",
|
|
620
|
+
"h",
|
|
621
|
+
"hB"
|
|
622
|
+
],
|
|
623
|
+
"LU": [
|
|
624
|
+
"H",
|
|
625
|
+
"h",
|
|
626
|
+
"hB"
|
|
627
|
+
],
|
|
628
|
+
"NP": [
|
|
629
|
+
"H",
|
|
630
|
+
"h",
|
|
631
|
+
"hB"
|
|
632
|
+
],
|
|
633
|
+
"PF": [
|
|
634
|
+
"H",
|
|
635
|
+
"h",
|
|
636
|
+
"hB"
|
|
637
|
+
],
|
|
638
|
+
"SC": [
|
|
639
|
+
"H",
|
|
640
|
+
"h",
|
|
641
|
+
"hB"
|
|
642
|
+
],
|
|
643
|
+
"SM": [
|
|
644
|
+
"H",
|
|
645
|
+
"h",
|
|
646
|
+
"hB"
|
|
647
|
+
],
|
|
648
|
+
"SN": [
|
|
649
|
+
"H",
|
|
650
|
+
"h",
|
|
651
|
+
"hB"
|
|
652
|
+
],
|
|
653
|
+
"TF": [
|
|
654
|
+
"H",
|
|
655
|
+
"h",
|
|
656
|
+
"hB"
|
|
657
|
+
],
|
|
658
|
+
"VA": [
|
|
659
|
+
"H",
|
|
660
|
+
"h",
|
|
661
|
+
"hB"
|
|
662
|
+
],
|
|
663
|
+
"CY": [
|
|
664
|
+
"h",
|
|
665
|
+
"H",
|
|
666
|
+
"hb",
|
|
667
|
+
"hB"
|
|
668
|
+
],
|
|
669
|
+
"GR": [
|
|
670
|
+
"h",
|
|
671
|
+
"H",
|
|
672
|
+
"hb",
|
|
673
|
+
"hB"
|
|
674
|
+
],
|
|
675
|
+
"CO": [
|
|
676
|
+
"h",
|
|
677
|
+
"H",
|
|
678
|
+
"hB",
|
|
679
|
+
"hb"
|
|
680
|
+
],
|
|
681
|
+
"DO": [
|
|
682
|
+
"h",
|
|
683
|
+
"H",
|
|
684
|
+
"hB",
|
|
685
|
+
"hb"
|
|
686
|
+
],
|
|
687
|
+
"KP": [
|
|
688
|
+
"h",
|
|
689
|
+
"H",
|
|
690
|
+
"hB",
|
|
691
|
+
"hb"
|
|
692
|
+
],
|
|
693
|
+
"KR": [
|
|
694
|
+
"h",
|
|
695
|
+
"H",
|
|
696
|
+
"hB",
|
|
697
|
+
"hb"
|
|
698
|
+
],
|
|
699
|
+
"NA": [
|
|
700
|
+
"h",
|
|
701
|
+
"H",
|
|
702
|
+
"hB",
|
|
703
|
+
"hb"
|
|
704
|
+
],
|
|
705
|
+
"PA": [
|
|
706
|
+
"h",
|
|
707
|
+
"H",
|
|
708
|
+
"hB",
|
|
709
|
+
"hb"
|
|
710
|
+
],
|
|
711
|
+
"PR": [
|
|
712
|
+
"h",
|
|
713
|
+
"H",
|
|
714
|
+
"hB",
|
|
715
|
+
"hb"
|
|
716
|
+
],
|
|
717
|
+
"VE": [
|
|
718
|
+
"h",
|
|
719
|
+
"H",
|
|
720
|
+
"hB",
|
|
721
|
+
"hb"
|
|
722
|
+
],
|
|
723
|
+
"AC": [
|
|
724
|
+
"H",
|
|
725
|
+
"h",
|
|
726
|
+
"hb",
|
|
727
|
+
"hB"
|
|
728
|
+
],
|
|
729
|
+
"AI": [
|
|
730
|
+
"H",
|
|
731
|
+
"h",
|
|
732
|
+
"hb",
|
|
733
|
+
"hB"
|
|
734
|
+
],
|
|
735
|
+
"BW": [
|
|
736
|
+
"H",
|
|
737
|
+
"h",
|
|
738
|
+
"hb",
|
|
739
|
+
"hB"
|
|
740
|
+
],
|
|
741
|
+
"BZ": [
|
|
742
|
+
"H",
|
|
743
|
+
"h",
|
|
744
|
+
"hb",
|
|
745
|
+
"hB"
|
|
746
|
+
],
|
|
747
|
+
"CC": [
|
|
748
|
+
"H",
|
|
749
|
+
"h",
|
|
750
|
+
"hb",
|
|
751
|
+
"hB"
|
|
752
|
+
],
|
|
753
|
+
"CK": [
|
|
754
|
+
"H",
|
|
755
|
+
"h",
|
|
756
|
+
"hb",
|
|
757
|
+
"hB"
|
|
758
|
+
],
|
|
759
|
+
"CX": [
|
|
760
|
+
"H",
|
|
761
|
+
"h",
|
|
762
|
+
"hb",
|
|
763
|
+
"hB"
|
|
764
|
+
],
|
|
765
|
+
"DG": [
|
|
766
|
+
"H",
|
|
767
|
+
"h",
|
|
768
|
+
"hb",
|
|
769
|
+
"hB"
|
|
770
|
+
],
|
|
771
|
+
"FK": [
|
|
772
|
+
"H",
|
|
773
|
+
"h",
|
|
774
|
+
"hb",
|
|
775
|
+
"hB"
|
|
776
|
+
],
|
|
777
|
+
"GB": [
|
|
778
|
+
"H",
|
|
779
|
+
"h",
|
|
780
|
+
"hb",
|
|
781
|
+
"hB"
|
|
782
|
+
],
|
|
783
|
+
"GG": [
|
|
784
|
+
"H",
|
|
785
|
+
"h",
|
|
786
|
+
"hb",
|
|
787
|
+
"hB"
|
|
788
|
+
],
|
|
789
|
+
"GI": [
|
|
790
|
+
"H",
|
|
791
|
+
"h",
|
|
792
|
+
"hb",
|
|
793
|
+
"hB"
|
|
794
|
+
],
|
|
795
|
+
"IE": [
|
|
796
|
+
"H",
|
|
797
|
+
"h",
|
|
798
|
+
"hb",
|
|
799
|
+
"hB"
|
|
800
|
+
],
|
|
801
|
+
"IM": [
|
|
802
|
+
"H",
|
|
803
|
+
"h",
|
|
804
|
+
"hb",
|
|
805
|
+
"hB"
|
|
806
|
+
],
|
|
807
|
+
"IO": [
|
|
808
|
+
"H",
|
|
809
|
+
"h",
|
|
810
|
+
"hb",
|
|
811
|
+
"hB"
|
|
812
|
+
],
|
|
813
|
+
"JE": [
|
|
814
|
+
"H",
|
|
815
|
+
"h",
|
|
816
|
+
"hb",
|
|
817
|
+
"hB"
|
|
818
|
+
],
|
|
819
|
+
"LT": [
|
|
820
|
+
"H",
|
|
821
|
+
"h",
|
|
822
|
+
"hb",
|
|
823
|
+
"hB"
|
|
824
|
+
],
|
|
825
|
+
"MK": [
|
|
826
|
+
"H",
|
|
827
|
+
"h",
|
|
828
|
+
"hb",
|
|
829
|
+
"hB"
|
|
830
|
+
],
|
|
831
|
+
"MN": [
|
|
832
|
+
"H",
|
|
833
|
+
"h",
|
|
834
|
+
"hb",
|
|
835
|
+
"hB"
|
|
836
|
+
],
|
|
837
|
+
"MS": [
|
|
838
|
+
"H",
|
|
839
|
+
"h",
|
|
840
|
+
"hb",
|
|
841
|
+
"hB"
|
|
842
|
+
],
|
|
843
|
+
"NF": [
|
|
844
|
+
"H",
|
|
845
|
+
"h",
|
|
846
|
+
"hb",
|
|
847
|
+
"hB"
|
|
848
|
+
],
|
|
849
|
+
"NG": [
|
|
850
|
+
"H",
|
|
851
|
+
"h",
|
|
852
|
+
"hb",
|
|
853
|
+
"hB"
|
|
854
|
+
],
|
|
855
|
+
"NR": [
|
|
856
|
+
"H",
|
|
857
|
+
"h",
|
|
858
|
+
"hb",
|
|
859
|
+
"hB"
|
|
860
|
+
],
|
|
861
|
+
"NU": [
|
|
862
|
+
"H",
|
|
863
|
+
"h",
|
|
864
|
+
"hb",
|
|
865
|
+
"hB"
|
|
866
|
+
],
|
|
867
|
+
"PN": [
|
|
868
|
+
"H",
|
|
869
|
+
"h",
|
|
870
|
+
"hb",
|
|
871
|
+
"hB"
|
|
872
|
+
],
|
|
873
|
+
"SH": [
|
|
874
|
+
"H",
|
|
875
|
+
"h",
|
|
876
|
+
"hb",
|
|
877
|
+
"hB"
|
|
878
|
+
],
|
|
879
|
+
"SX": [
|
|
880
|
+
"H",
|
|
881
|
+
"h",
|
|
882
|
+
"hb",
|
|
883
|
+
"hB"
|
|
884
|
+
],
|
|
885
|
+
"TA": [
|
|
886
|
+
"H",
|
|
887
|
+
"h",
|
|
888
|
+
"hb",
|
|
889
|
+
"hB"
|
|
890
|
+
],
|
|
891
|
+
"ZA": [
|
|
892
|
+
"H",
|
|
893
|
+
"h",
|
|
894
|
+
"hb",
|
|
895
|
+
"hB"
|
|
896
|
+
],
|
|
897
|
+
"af-ZA": [
|
|
898
|
+
"H",
|
|
899
|
+
"h",
|
|
900
|
+
"hB",
|
|
901
|
+
"hb"
|
|
902
|
+
],
|
|
903
|
+
"AR": [
|
|
904
|
+
"H",
|
|
905
|
+
"h",
|
|
906
|
+
"hB",
|
|
907
|
+
"hb"
|
|
908
|
+
],
|
|
909
|
+
"CL": [
|
|
910
|
+
"H",
|
|
911
|
+
"h",
|
|
912
|
+
"hB",
|
|
913
|
+
"hb"
|
|
914
|
+
],
|
|
915
|
+
"CR": [
|
|
916
|
+
"H",
|
|
917
|
+
"h",
|
|
918
|
+
"hB",
|
|
919
|
+
"hb"
|
|
920
|
+
],
|
|
921
|
+
"CU": [
|
|
922
|
+
"H",
|
|
923
|
+
"h",
|
|
924
|
+
"hB",
|
|
925
|
+
"hb"
|
|
926
|
+
],
|
|
927
|
+
"EA": [
|
|
928
|
+
"H",
|
|
929
|
+
"h",
|
|
930
|
+
"hB",
|
|
931
|
+
"hb"
|
|
932
|
+
],
|
|
933
|
+
"es-BO": [
|
|
934
|
+
"H",
|
|
935
|
+
"h",
|
|
936
|
+
"hB",
|
|
937
|
+
"hb"
|
|
938
|
+
],
|
|
939
|
+
"es-BR": [
|
|
940
|
+
"H",
|
|
941
|
+
"h",
|
|
942
|
+
"hB",
|
|
943
|
+
"hb"
|
|
944
|
+
],
|
|
945
|
+
"es-EC": [
|
|
946
|
+
"H",
|
|
947
|
+
"h",
|
|
948
|
+
"hB",
|
|
949
|
+
"hb"
|
|
950
|
+
],
|
|
951
|
+
"es-ES": [
|
|
952
|
+
"H",
|
|
953
|
+
"h",
|
|
954
|
+
"hB",
|
|
955
|
+
"hb"
|
|
956
|
+
],
|
|
957
|
+
"es-GQ": [
|
|
958
|
+
"H",
|
|
959
|
+
"h",
|
|
960
|
+
"hB",
|
|
961
|
+
"hb"
|
|
962
|
+
],
|
|
963
|
+
"es-PE": [
|
|
964
|
+
"H",
|
|
965
|
+
"h",
|
|
966
|
+
"hB",
|
|
967
|
+
"hb"
|
|
968
|
+
],
|
|
969
|
+
"GT": [
|
|
970
|
+
"H",
|
|
971
|
+
"h",
|
|
972
|
+
"hB",
|
|
973
|
+
"hb"
|
|
974
|
+
],
|
|
975
|
+
"HN": [
|
|
976
|
+
"H",
|
|
977
|
+
"h",
|
|
978
|
+
"hB",
|
|
979
|
+
"hb"
|
|
980
|
+
],
|
|
981
|
+
"IC": [
|
|
982
|
+
"H",
|
|
983
|
+
"h",
|
|
984
|
+
"hB",
|
|
985
|
+
"hb"
|
|
986
|
+
],
|
|
987
|
+
"KG": [
|
|
988
|
+
"H",
|
|
989
|
+
"h",
|
|
990
|
+
"hB",
|
|
991
|
+
"hb"
|
|
992
|
+
],
|
|
993
|
+
"KM": [
|
|
994
|
+
"H",
|
|
995
|
+
"h",
|
|
996
|
+
"hB",
|
|
997
|
+
"hb"
|
|
998
|
+
],
|
|
999
|
+
"LK": [
|
|
1000
|
+
"H",
|
|
1001
|
+
"h",
|
|
1002
|
+
"hB",
|
|
1003
|
+
"hb"
|
|
1004
|
+
],
|
|
1005
|
+
"MA": [
|
|
1006
|
+
"H",
|
|
1007
|
+
"h",
|
|
1008
|
+
"hB",
|
|
1009
|
+
"hb"
|
|
1010
|
+
],
|
|
1011
|
+
"MX": [
|
|
1012
|
+
"H",
|
|
1013
|
+
"h",
|
|
1014
|
+
"hB",
|
|
1015
|
+
"hb"
|
|
1016
|
+
],
|
|
1017
|
+
"NI": [
|
|
1018
|
+
"H",
|
|
1019
|
+
"h",
|
|
1020
|
+
"hB",
|
|
1021
|
+
"hb"
|
|
1022
|
+
],
|
|
1023
|
+
"PY": [
|
|
1024
|
+
"H",
|
|
1025
|
+
"h",
|
|
1026
|
+
"hB",
|
|
1027
|
+
"hb"
|
|
1028
|
+
],
|
|
1029
|
+
"SV": [
|
|
1030
|
+
"H",
|
|
1031
|
+
"h",
|
|
1032
|
+
"hB",
|
|
1033
|
+
"hb"
|
|
1034
|
+
],
|
|
1035
|
+
"UY": [
|
|
1036
|
+
"H",
|
|
1037
|
+
"h",
|
|
1038
|
+
"hB",
|
|
1039
|
+
"hb"
|
|
1040
|
+
],
|
|
1041
|
+
"JP": [
|
|
1042
|
+
"H",
|
|
1043
|
+
"h",
|
|
1044
|
+
"K"
|
|
1045
|
+
],
|
|
1046
|
+
"AD": [
|
|
1047
|
+
"H",
|
|
1048
|
+
"hB"
|
|
1049
|
+
],
|
|
1050
|
+
"AM": [
|
|
1051
|
+
"H",
|
|
1052
|
+
"hB"
|
|
1053
|
+
],
|
|
1054
|
+
"AO": [
|
|
1055
|
+
"H",
|
|
1056
|
+
"hB"
|
|
1057
|
+
],
|
|
1058
|
+
"AT": [
|
|
1059
|
+
"H",
|
|
1060
|
+
"hB"
|
|
1061
|
+
],
|
|
1062
|
+
"AW": [
|
|
1063
|
+
"H",
|
|
1064
|
+
"hB"
|
|
1065
|
+
],
|
|
1066
|
+
"BE": [
|
|
1067
|
+
"H",
|
|
1068
|
+
"hB"
|
|
1069
|
+
],
|
|
1070
|
+
"BF": [
|
|
1071
|
+
"H",
|
|
1072
|
+
"hB"
|
|
1073
|
+
],
|
|
1074
|
+
"BJ": [
|
|
1075
|
+
"H",
|
|
1076
|
+
"hB"
|
|
1077
|
+
],
|
|
1078
|
+
"BL": [
|
|
1079
|
+
"H",
|
|
1080
|
+
"hB"
|
|
1081
|
+
],
|
|
1082
|
+
"BR": [
|
|
1083
|
+
"H",
|
|
1084
|
+
"hB"
|
|
1085
|
+
],
|
|
1086
|
+
"CG": [
|
|
1087
|
+
"H",
|
|
1088
|
+
"hB"
|
|
1089
|
+
],
|
|
1090
|
+
"CI": [
|
|
1091
|
+
"H",
|
|
1092
|
+
"hB"
|
|
1093
|
+
],
|
|
1094
|
+
"CV": [
|
|
1095
|
+
"H",
|
|
1096
|
+
"hB"
|
|
1097
|
+
],
|
|
1098
|
+
"DE": [
|
|
1099
|
+
"H",
|
|
1100
|
+
"hB"
|
|
1101
|
+
],
|
|
1102
|
+
"EE": [
|
|
1103
|
+
"H",
|
|
1104
|
+
"hB"
|
|
1105
|
+
],
|
|
1106
|
+
"FR": [
|
|
1107
|
+
"H",
|
|
1108
|
+
"hB"
|
|
1109
|
+
],
|
|
1110
|
+
"GA": [
|
|
1111
|
+
"H",
|
|
1112
|
+
"hB"
|
|
1113
|
+
],
|
|
1114
|
+
"GF": [
|
|
1115
|
+
"H",
|
|
1116
|
+
"hB"
|
|
1117
|
+
],
|
|
1118
|
+
"GN": [
|
|
1119
|
+
"H",
|
|
1120
|
+
"hB"
|
|
1121
|
+
],
|
|
1122
|
+
"GP": [
|
|
1123
|
+
"H",
|
|
1124
|
+
"hB"
|
|
1125
|
+
],
|
|
1126
|
+
"GW": [
|
|
1127
|
+
"H",
|
|
1128
|
+
"hB"
|
|
1129
|
+
],
|
|
1130
|
+
"HR": [
|
|
1131
|
+
"H",
|
|
1132
|
+
"hB"
|
|
1133
|
+
],
|
|
1134
|
+
"IL": [
|
|
1135
|
+
"H",
|
|
1136
|
+
"hB"
|
|
1137
|
+
],
|
|
1138
|
+
"IT": [
|
|
1139
|
+
"H",
|
|
1140
|
+
"hB"
|
|
1141
|
+
],
|
|
1142
|
+
"KZ": [
|
|
1143
|
+
"H",
|
|
1144
|
+
"hB"
|
|
1145
|
+
],
|
|
1146
|
+
"MC": [
|
|
1147
|
+
"H",
|
|
1148
|
+
"hB"
|
|
1149
|
+
],
|
|
1150
|
+
"MD": [
|
|
1151
|
+
"H",
|
|
1152
|
+
"hB"
|
|
1153
|
+
],
|
|
1154
|
+
"MF": [
|
|
1155
|
+
"H",
|
|
1156
|
+
"hB"
|
|
1157
|
+
],
|
|
1158
|
+
"MQ": [
|
|
1159
|
+
"H",
|
|
1160
|
+
"hB"
|
|
1161
|
+
],
|
|
1162
|
+
"MZ": [
|
|
1163
|
+
"H",
|
|
1164
|
+
"hB"
|
|
1165
|
+
],
|
|
1166
|
+
"NC": [
|
|
1167
|
+
"H",
|
|
1168
|
+
"hB"
|
|
1169
|
+
],
|
|
1170
|
+
"NL": [
|
|
1171
|
+
"H",
|
|
1172
|
+
"hB"
|
|
1173
|
+
],
|
|
1174
|
+
"PM": [
|
|
1175
|
+
"H",
|
|
1176
|
+
"hB"
|
|
1177
|
+
],
|
|
1178
|
+
"PT": [
|
|
1179
|
+
"H",
|
|
1180
|
+
"hB"
|
|
1181
|
+
],
|
|
1182
|
+
"RE": [
|
|
1183
|
+
"H",
|
|
1184
|
+
"hB"
|
|
1185
|
+
],
|
|
1186
|
+
"RO": [
|
|
1187
|
+
"H",
|
|
1188
|
+
"hB"
|
|
1189
|
+
],
|
|
1190
|
+
"SI": [
|
|
1191
|
+
"H",
|
|
1192
|
+
"hB"
|
|
1193
|
+
],
|
|
1194
|
+
"SR": [
|
|
1195
|
+
"H",
|
|
1196
|
+
"hB"
|
|
1197
|
+
],
|
|
1198
|
+
"ST": [
|
|
1199
|
+
"H",
|
|
1200
|
+
"hB"
|
|
1201
|
+
],
|
|
1202
|
+
"TG": [
|
|
1203
|
+
"H",
|
|
1204
|
+
"hB"
|
|
1205
|
+
],
|
|
1206
|
+
"TR": [
|
|
1207
|
+
"H",
|
|
1208
|
+
"hB"
|
|
1209
|
+
],
|
|
1210
|
+
"WF": [
|
|
1211
|
+
"H",
|
|
1212
|
+
"hB"
|
|
1213
|
+
],
|
|
1214
|
+
"YT": [
|
|
1215
|
+
"H",
|
|
1216
|
+
"hB"
|
|
1217
|
+
],
|
|
1218
|
+
"BD": [
|
|
1219
|
+
"h",
|
|
1220
|
+
"hB",
|
|
1221
|
+
"H"
|
|
1222
|
+
],
|
|
1223
|
+
"PK": [
|
|
1224
|
+
"h",
|
|
1225
|
+
"hB",
|
|
1226
|
+
"H"
|
|
1227
|
+
],
|
|
1228
|
+
"AZ": [
|
|
1229
|
+
"H",
|
|
1230
|
+
"hB",
|
|
1231
|
+
"h"
|
|
1232
|
+
],
|
|
1233
|
+
"BA": [
|
|
1234
|
+
"H",
|
|
1235
|
+
"hB",
|
|
1236
|
+
"h"
|
|
1237
|
+
],
|
|
1238
|
+
"BG": [
|
|
1239
|
+
"H",
|
|
1240
|
+
"hB",
|
|
1241
|
+
"h"
|
|
1242
|
+
],
|
|
1243
|
+
"CH": [
|
|
1244
|
+
"H",
|
|
1245
|
+
"hB",
|
|
1246
|
+
"h"
|
|
1247
|
+
],
|
|
1248
|
+
"GE": [
|
|
1249
|
+
"H",
|
|
1250
|
+
"hB",
|
|
1251
|
+
"h"
|
|
1252
|
+
],
|
|
1253
|
+
"LI": [
|
|
1254
|
+
"H",
|
|
1255
|
+
"hB",
|
|
1256
|
+
"h"
|
|
1257
|
+
],
|
|
1258
|
+
"ME": [
|
|
1259
|
+
"H",
|
|
1260
|
+
"hB",
|
|
1261
|
+
"h"
|
|
1262
|
+
],
|
|
1263
|
+
"RS": [
|
|
1264
|
+
"H",
|
|
1265
|
+
"hB",
|
|
1266
|
+
"h"
|
|
1267
|
+
],
|
|
1268
|
+
"UA": [
|
|
1269
|
+
"H",
|
|
1270
|
+
"hB",
|
|
1271
|
+
"h"
|
|
1272
|
+
],
|
|
1273
|
+
"UZ": [
|
|
1274
|
+
"H",
|
|
1275
|
+
"hB",
|
|
1276
|
+
"h"
|
|
1277
|
+
],
|
|
1278
|
+
"XK": [
|
|
1279
|
+
"H",
|
|
1280
|
+
"hB",
|
|
1281
|
+
"h"
|
|
1282
|
+
],
|
|
1283
|
+
"AG": [
|
|
1284
|
+
"h",
|
|
1285
|
+
"hb",
|
|
1286
|
+
"H",
|
|
1287
|
+
"hB"
|
|
1288
|
+
],
|
|
1289
|
+
"AU": [
|
|
1290
|
+
"h",
|
|
1291
|
+
"hb",
|
|
1292
|
+
"H",
|
|
1293
|
+
"hB"
|
|
1294
|
+
],
|
|
1295
|
+
"BB": [
|
|
1296
|
+
"h",
|
|
1297
|
+
"hb",
|
|
1298
|
+
"H",
|
|
1299
|
+
"hB"
|
|
1300
|
+
],
|
|
1301
|
+
"BM": [
|
|
1302
|
+
"h",
|
|
1303
|
+
"hb",
|
|
1304
|
+
"H",
|
|
1305
|
+
"hB"
|
|
1306
|
+
],
|
|
1307
|
+
"BS": [
|
|
1308
|
+
"h",
|
|
1309
|
+
"hb",
|
|
1310
|
+
"H",
|
|
1311
|
+
"hB"
|
|
1312
|
+
],
|
|
1313
|
+
"CA": [
|
|
1314
|
+
"h",
|
|
1315
|
+
"hb",
|
|
1316
|
+
"H",
|
|
1317
|
+
"hB"
|
|
1318
|
+
],
|
|
1319
|
+
"DM": [
|
|
1320
|
+
"h",
|
|
1321
|
+
"hb",
|
|
1322
|
+
"H",
|
|
1323
|
+
"hB"
|
|
1324
|
+
],
|
|
1325
|
+
"en-001": [
|
|
1326
|
+
"h",
|
|
1327
|
+
"hb",
|
|
1328
|
+
"H",
|
|
1329
|
+
"hB"
|
|
1330
|
+
],
|
|
1331
|
+
"FJ": [
|
|
1332
|
+
"h",
|
|
1333
|
+
"hb",
|
|
1334
|
+
"H",
|
|
1335
|
+
"hB"
|
|
1336
|
+
],
|
|
1337
|
+
"FM": [
|
|
1338
|
+
"h",
|
|
1339
|
+
"hb",
|
|
1340
|
+
"H",
|
|
1341
|
+
"hB"
|
|
1342
|
+
],
|
|
1343
|
+
"GD": [
|
|
1344
|
+
"h",
|
|
1345
|
+
"hb",
|
|
1346
|
+
"H",
|
|
1347
|
+
"hB"
|
|
1348
|
+
],
|
|
1349
|
+
"GM": [
|
|
1350
|
+
"h",
|
|
1351
|
+
"hb",
|
|
1352
|
+
"H",
|
|
1353
|
+
"hB"
|
|
1354
|
+
],
|
|
1355
|
+
"GU": [
|
|
1356
|
+
"h",
|
|
1357
|
+
"hb",
|
|
1358
|
+
"H",
|
|
1359
|
+
"hB"
|
|
1360
|
+
],
|
|
1361
|
+
"GY": [
|
|
1362
|
+
"h",
|
|
1363
|
+
"hb",
|
|
1364
|
+
"H",
|
|
1365
|
+
"hB"
|
|
1366
|
+
],
|
|
1367
|
+
"JM": [
|
|
1368
|
+
"h",
|
|
1369
|
+
"hb",
|
|
1370
|
+
"H",
|
|
1371
|
+
"hB"
|
|
1372
|
+
],
|
|
1373
|
+
"KI": [
|
|
1374
|
+
"h",
|
|
1375
|
+
"hb",
|
|
1376
|
+
"H",
|
|
1377
|
+
"hB"
|
|
1378
|
+
],
|
|
1379
|
+
"KN": [
|
|
1380
|
+
"h",
|
|
1381
|
+
"hb",
|
|
1382
|
+
"H",
|
|
1383
|
+
"hB"
|
|
1384
|
+
],
|
|
1385
|
+
"KY": [
|
|
1386
|
+
"h",
|
|
1387
|
+
"hb",
|
|
1388
|
+
"H",
|
|
1389
|
+
"hB"
|
|
1390
|
+
],
|
|
1391
|
+
"LC": [
|
|
1392
|
+
"h",
|
|
1393
|
+
"hb",
|
|
1394
|
+
"H",
|
|
1395
|
+
"hB"
|
|
1396
|
+
],
|
|
1397
|
+
"LR": [
|
|
1398
|
+
"h",
|
|
1399
|
+
"hb",
|
|
1400
|
+
"H",
|
|
1401
|
+
"hB"
|
|
1402
|
+
],
|
|
1403
|
+
"MH": [
|
|
1404
|
+
"h",
|
|
1405
|
+
"hb",
|
|
1406
|
+
"H",
|
|
1407
|
+
"hB"
|
|
1408
|
+
],
|
|
1409
|
+
"MP": [
|
|
1410
|
+
"h",
|
|
1411
|
+
"hb",
|
|
1412
|
+
"H",
|
|
1413
|
+
"hB"
|
|
1414
|
+
],
|
|
1415
|
+
"MW": [
|
|
1416
|
+
"h",
|
|
1417
|
+
"hb",
|
|
1418
|
+
"H",
|
|
1419
|
+
"hB"
|
|
1420
|
+
],
|
|
1421
|
+
"NZ": [
|
|
1422
|
+
"h",
|
|
1423
|
+
"hb",
|
|
1424
|
+
"H",
|
|
1425
|
+
"hB"
|
|
1426
|
+
],
|
|
1427
|
+
"SB": [
|
|
1428
|
+
"h",
|
|
1429
|
+
"hb",
|
|
1430
|
+
"H",
|
|
1431
|
+
"hB"
|
|
1432
|
+
],
|
|
1433
|
+
"SG": [
|
|
1434
|
+
"h",
|
|
1435
|
+
"hb",
|
|
1436
|
+
"H",
|
|
1437
|
+
"hB"
|
|
1438
|
+
],
|
|
1439
|
+
"SL": [
|
|
1440
|
+
"h",
|
|
1441
|
+
"hb",
|
|
1442
|
+
"H",
|
|
1443
|
+
"hB"
|
|
1444
|
+
],
|
|
1445
|
+
"SS": [
|
|
1446
|
+
"h",
|
|
1447
|
+
"hb",
|
|
1448
|
+
"H",
|
|
1449
|
+
"hB"
|
|
1450
|
+
],
|
|
1451
|
+
"SZ": [
|
|
1452
|
+
"h",
|
|
1453
|
+
"hb",
|
|
1454
|
+
"H",
|
|
1455
|
+
"hB"
|
|
1456
|
+
],
|
|
1457
|
+
"TC": [
|
|
1458
|
+
"h",
|
|
1459
|
+
"hb",
|
|
1460
|
+
"H",
|
|
1461
|
+
"hB"
|
|
1462
|
+
],
|
|
1463
|
+
"TT": [
|
|
1464
|
+
"h",
|
|
1465
|
+
"hb",
|
|
1466
|
+
"H",
|
|
1467
|
+
"hB"
|
|
1468
|
+
],
|
|
1469
|
+
"UM": [
|
|
1470
|
+
"h",
|
|
1471
|
+
"hb",
|
|
1472
|
+
"H",
|
|
1473
|
+
"hB"
|
|
1474
|
+
],
|
|
1475
|
+
"US": [
|
|
1476
|
+
"h",
|
|
1477
|
+
"hb",
|
|
1478
|
+
"H",
|
|
1479
|
+
"hB"
|
|
1480
|
+
],
|
|
1481
|
+
"VC": [
|
|
1482
|
+
"h",
|
|
1483
|
+
"hb",
|
|
1484
|
+
"H",
|
|
1485
|
+
"hB"
|
|
1486
|
+
],
|
|
1487
|
+
"VG": [
|
|
1488
|
+
"h",
|
|
1489
|
+
"hb",
|
|
1490
|
+
"H",
|
|
1491
|
+
"hB"
|
|
1492
|
+
],
|
|
1493
|
+
"VI": [
|
|
1494
|
+
"h",
|
|
1495
|
+
"hb",
|
|
1496
|
+
"H",
|
|
1497
|
+
"hB"
|
|
1498
|
+
],
|
|
1499
|
+
"ZM": [
|
|
1500
|
+
"h",
|
|
1501
|
+
"hb",
|
|
1502
|
+
"H",
|
|
1503
|
+
"hB"
|
|
1504
|
+
],
|
|
1505
|
+
"BO": [
|
|
1506
|
+
"H",
|
|
1507
|
+
"hB",
|
|
1508
|
+
"h",
|
|
1509
|
+
"hb"
|
|
1510
|
+
],
|
|
1511
|
+
"EC": [
|
|
1512
|
+
"H",
|
|
1513
|
+
"hB",
|
|
1514
|
+
"h",
|
|
1515
|
+
"hb"
|
|
1516
|
+
],
|
|
1517
|
+
"ES": [
|
|
1518
|
+
"H",
|
|
1519
|
+
"hB",
|
|
1520
|
+
"h",
|
|
1521
|
+
"hb"
|
|
1522
|
+
],
|
|
1523
|
+
"GQ": [
|
|
1524
|
+
"H",
|
|
1525
|
+
"hB",
|
|
1526
|
+
"h",
|
|
1527
|
+
"hb"
|
|
1528
|
+
],
|
|
1529
|
+
"PE": [
|
|
1530
|
+
"H",
|
|
1531
|
+
"hB",
|
|
1532
|
+
"h",
|
|
1533
|
+
"hb"
|
|
1534
|
+
],
|
|
1535
|
+
"AE": [
|
|
1536
|
+
"h",
|
|
1537
|
+
"hB",
|
|
1538
|
+
"hb",
|
|
1539
|
+
"H"
|
|
1540
|
+
],
|
|
1541
|
+
"ar-001": [
|
|
1542
|
+
"h",
|
|
1543
|
+
"hB",
|
|
1544
|
+
"hb",
|
|
1545
|
+
"H"
|
|
1546
|
+
],
|
|
1547
|
+
"BH": [
|
|
1548
|
+
"h",
|
|
1549
|
+
"hB",
|
|
1550
|
+
"hb",
|
|
1551
|
+
"H"
|
|
1552
|
+
],
|
|
1553
|
+
"DZ": [
|
|
1554
|
+
"h",
|
|
1555
|
+
"hB",
|
|
1556
|
+
"hb",
|
|
1557
|
+
"H"
|
|
1558
|
+
],
|
|
1559
|
+
"EG": [
|
|
1560
|
+
"h",
|
|
1561
|
+
"hB",
|
|
1562
|
+
"hb",
|
|
1563
|
+
"H"
|
|
1564
|
+
],
|
|
1565
|
+
"EH": [
|
|
1566
|
+
"h",
|
|
1567
|
+
"hB",
|
|
1568
|
+
"hb",
|
|
1569
|
+
"H"
|
|
1570
|
+
],
|
|
1571
|
+
"HK": [
|
|
1572
|
+
"h",
|
|
1573
|
+
"hB",
|
|
1574
|
+
"hb",
|
|
1575
|
+
"H"
|
|
1576
|
+
],
|
|
1577
|
+
"IQ": [
|
|
1578
|
+
"h",
|
|
1579
|
+
"hB",
|
|
1580
|
+
"hb",
|
|
1581
|
+
"H"
|
|
1582
|
+
],
|
|
1583
|
+
"JO": [
|
|
1584
|
+
"h",
|
|
1585
|
+
"hB",
|
|
1586
|
+
"hb",
|
|
1587
|
+
"H"
|
|
1588
|
+
],
|
|
1589
|
+
"KW": [
|
|
1590
|
+
"h",
|
|
1591
|
+
"hB",
|
|
1592
|
+
"hb",
|
|
1593
|
+
"H"
|
|
1594
|
+
],
|
|
1595
|
+
"LB": [
|
|
1596
|
+
"h",
|
|
1597
|
+
"hB",
|
|
1598
|
+
"hb",
|
|
1599
|
+
"H"
|
|
1600
|
+
],
|
|
1601
|
+
"LY": [
|
|
1602
|
+
"h",
|
|
1603
|
+
"hB",
|
|
1604
|
+
"hb",
|
|
1605
|
+
"H"
|
|
1606
|
+
],
|
|
1607
|
+
"MO": [
|
|
1608
|
+
"h",
|
|
1609
|
+
"hB",
|
|
1610
|
+
"hb",
|
|
1611
|
+
"H"
|
|
1612
|
+
],
|
|
1613
|
+
"MR": [
|
|
1614
|
+
"h",
|
|
1615
|
+
"hB",
|
|
1616
|
+
"hb",
|
|
1617
|
+
"H"
|
|
1618
|
+
],
|
|
1619
|
+
"OM": [
|
|
1620
|
+
"h",
|
|
1621
|
+
"hB",
|
|
1622
|
+
"hb",
|
|
1623
|
+
"H"
|
|
1624
|
+
],
|
|
1625
|
+
"PH": [
|
|
1626
|
+
"h",
|
|
1627
|
+
"hB",
|
|
1628
|
+
"hb",
|
|
1629
|
+
"H"
|
|
1630
|
+
],
|
|
1631
|
+
"PS": [
|
|
1632
|
+
"h",
|
|
1633
|
+
"hB",
|
|
1634
|
+
"hb",
|
|
1635
|
+
"H"
|
|
1636
|
+
],
|
|
1637
|
+
"QA": [
|
|
1638
|
+
"h",
|
|
1639
|
+
"hB",
|
|
1640
|
+
"hb",
|
|
1641
|
+
"H"
|
|
1642
|
+
],
|
|
1643
|
+
"SA": [
|
|
1644
|
+
"h",
|
|
1645
|
+
"hB",
|
|
1646
|
+
"hb",
|
|
1647
|
+
"H"
|
|
1648
|
+
],
|
|
1649
|
+
"SD": [
|
|
1650
|
+
"h",
|
|
1651
|
+
"hB",
|
|
1652
|
+
"hb",
|
|
1653
|
+
"H"
|
|
1654
|
+
],
|
|
1655
|
+
"SY": [
|
|
1656
|
+
"h",
|
|
1657
|
+
"hB",
|
|
1658
|
+
"hb",
|
|
1659
|
+
"H"
|
|
1660
|
+
],
|
|
1661
|
+
"TN": [
|
|
1662
|
+
"h",
|
|
1663
|
+
"hB",
|
|
1664
|
+
"hb",
|
|
1665
|
+
"H"
|
|
1666
|
+
],
|
|
1667
|
+
"YE": [
|
|
1668
|
+
"h",
|
|
1669
|
+
"hB",
|
|
1670
|
+
"hb",
|
|
1671
|
+
"H"
|
|
1672
|
+
],
|
|
1673
|
+
"AF": [
|
|
1674
|
+
"H",
|
|
1675
|
+
"hb",
|
|
1676
|
+
"hB",
|
|
1677
|
+
"h"
|
|
1678
|
+
],
|
|
1679
|
+
"LA": [
|
|
1680
|
+
"H",
|
|
1681
|
+
"hb",
|
|
1682
|
+
"hB",
|
|
1683
|
+
"h"
|
|
1684
|
+
],
|
|
1685
|
+
"CN": [
|
|
1686
|
+
"H",
|
|
1687
|
+
"hB",
|
|
1688
|
+
"hb",
|
|
1689
|
+
"h"
|
|
1690
|
+
],
|
|
1691
|
+
"LV": [
|
|
1692
|
+
"H",
|
|
1693
|
+
"hB",
|
|
1694
|
+
"hb",
|
|
1695
|
+
"h"
|
|
1696
|
+
],
|
|
1697
|
+
"TL": [
|
|
1698
|
+
"H",
|
|
1699
|
+
"hB",
|
|
1700
|
+
"hb",
|
|
1701
|
+
"h"
|
|
1702
|
+
],
|
|
1703
|
+
"zu-ZA": [
|
|
1704
|
+
"H",
|
|
1705
|
+
"hB",
|
|
1706
|
+
"hb",
|
|
1707
|
+
"h"
|
|
1708
|
+
],
|
|
1709
|
+
"CD": [
|
|
1710
|
+
"hB",
|
|
1711
|
+
"H"
|
|
1712
|
+
],
|
|
1713
|
+
"IR": [
|
|
1714
|
+
"hB",
|
|
1715
|
+
"H"
|
|
1716
|
+
],
|
|
1717
|
+
"hi-IN": [
|
|
1718
|
+
"hB",
|
|
1719
|
+
"h",
|
|
1720
|
+
"H"
|
|
1721
|
+
],
|
|
1722
|
+
"kn-IN": [
|
|
1723
|
+
"hB",
|
|
1724
|
+
"h",
|
|
1725
|
+
"H"
|
|
1726
|
+
],
|
|
1727
|
+
"ml-IN": [
|
|
1728
|
+
"hB",
|
|
1729
|
+
"h",
|
|
1730
|
+
"H"
|
|
1731
|
+
],
|
|
1732
|
+
"te-IN": [
|
|
1733
|
+
"hB",
|
|
1734
|
+
"h",
|
|
1735
|
+
"H"
|
|
1736
|
+
],
|
|
1737
|
+
"KH": [
|
|
1738
|
+
"hB",
|
|
1739
|
+
"h",
|
|
1740
|
+
"H",
|
|
1741
|
+
"hb"
|
|
1742
|
+
],
|
|
1743
|
+
"ta-IN": [
|
|
1744
|
+
"hB",
|
|
1745
|
+
"h",
|
|
1746
|
+
"hb",
|
|
1747
|
+
"H"
|
|
1748
|
+
],
|
|
1749
|
+
"BN": [
|
|
1750
|
+
"hb",
|
|
1751
|
+
"hB",
|
|
1752
|
+
"h",
|
|
1753
|
+
"H"
|
|
1754
|
+
],
|
|
1755
|
+
"MY": [
|
|
1756
|
+
"hb",
|
|
1757
|
+
"hB",
|
|
1758
|
+
"h",
|
|
1759
|
+
"H"
|
|
1760
|
+
],
|
|
1761
|
+
"ET": [
|
|
1762
|
+
"hB",
|
|
1763
|
+
"hb",
|
|
1764
|
+
"h",
|
|
1765
|
+
"H"
|
|
1766
|
+
],
|
|
1767
|
+
"gu-IN": [
|
|
1768
|
+
"hB",
|
|
1769
|
+
"hb",
|
|
1770
|
+
"h",
|
|
1771
|
+
"H"
|
|
1772
|
+
],
|
|
1773
|
+
"mr-IN": [
|
|
1774
|
+
"hB",
|
|
1775
|
+
"hb",
|
|
1776
|
+
"h",
|
|
1777
|
+
"H"
|
|
1778
|
+
],
|
|
1779
|
+
"pa-IN": [
|
|
1780
|
+
"hB",
|
|
1781
|
+
"hb",
|
|
1782
|
+
"h",
|
|
1783
|
+
"H"
|
|
1784
|
+
],
|
|
1785
|
+
"TW": [
|
|
1786
|
+
"hB",
|
|
1787
|
+
"hb",
|
|
1788
|
+
"h",
|
|
1789
|
+
"H"
|
|
1790
|
+
],
|
|
1791
|
+
"KE": [
|
|
1792
|
+
"hB",
|
|
1793
|
+
"hb",
|
|
1794
|
+
"H",
|
|
1795
|
+
"h"
|
|
1796
|
+
],
|
|
1797
|
+
"MM": [
|
|
1798
|
+
"hB",
|
|
1799
|
+
"hb",
|
|
1800
|
+
"H",
|
|
1801
|
+
"h"
|
|
1802
|
+
],
|
|
1803
|
+
"TZ": [
|
|
1804
|
+
"hB",
|
|
1805
|
+
"hb",
|
|
1806
|
+
"H",
|
|
1807
|
+
"h"
|
|
1808
|
+
],
|
|
1809
|
+
"UG": [
|
|
1810
|
+
"hB",
|
|
1811
|
+
"hb",
|
|
1812
|
+
"H",
|
|
1813
|
+
"h"
|
|
1814
|
+
]
|
|
1815
|
+
};
|
|
1816
|
+
|
|
1817
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js
|
|
1818
|
+
function getBestPattern(skeleton, locale) {
|
|
1819
|
+
var skeletonCopy = "";
|
|
1820
|
+
for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {
|
|
1821
|
+
var patternChar = skeleton.charAt(patternPos);
|
|
1822
|
+
if (patternChar === "j") {
|
|
1823
|
+
var extraLength = 0;
|
|
1824
|
+
while (patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar) {
|
|
1825
|
+
extraLength++;
|
|
1826
|
+
patternPos++;
|
|
1827
|
+
}
|
|
1828
|
+
var hourLen = 1 + (extraLength & 1);
|
|
1829
|
+
var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);
|
|
1830
|
+
var dayPeriodChar = "a";
|
|
1831
|
+
var hourChar = getDefaultHourSymbolFromLocale(locale);
|
|
1832
|
+
if (hourChar == "H" || hourChar == "k") {
|
|
1833
|
+
dayPeriodLen = 0;
|
|
1834
|
+
}
|
|
1835
|
+
while (dayPeriodLen-- > 0) {
|
|
1836
|
+
skeletonCopy += dayPeriodChar;
|
|
1837
|
+
}
|
|
1838
|
+
while (hourLen-- > 0) {
|
|
1839
|
+
skeletonCopy = hourChar + skeletonCopy;
|
|
1840
|
+
}
|
|
1841
|
+
} else if (patternChar === "J") {
|
|
1842
|
+
skeletonCopy += "H";
|
|
1843
|
+
} else {
|
|
1844
|
+
skeletonCopy += patternChar;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
return skeletonCopy;
|
|
1848
|
+
}
|
|
1849
|
+
function getDefaultHourSymbolFromLocale(locale) {
|
|
1850
|
+
var hourCycle = locale.hourCycle;
|
|
1851
|
+
if (hourCycle === void 0 && locale.hourCycles && locale.hourCycles.length) {
|
|
1852
|
+
hourCycle = locale.hourCycles[0];
|
|
1853
|
+
}
|
|
1854
|
+
if (hourCycle) {
|
|
1855
|
+
switch (hourCycle) {
|
|
1856
|
+
case "h24":
|
|
1857
|
+
return "k";
|
|
1858
|
+
case "h23":
|
|
1859
|
+
return "H";
|
|
1860
|
+
case "h12":
|
|
1861
|
+
return "h";
|
|
1862
|
+
case "h11":
|
|
1863
|
+
return "K";
|
|
1864
|
+
default:
|
|
1865
|
+
throw new Error("Invalid hourCycle");
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
var languageTag = locale.language;
|
|
1869
|
+
var regionTag;
|
|
1870
|
+
if (languageTag !== "root") {
|
|
1871
|
+
regionTag = locale.maximize().region;
|
|
1872
|
+
}
|
|
1873
|
+
var hourCycles = timeData[regionTag || ""] || timeData[languageTag || ""] || timeData["".concat(languageTag, "-001")] || timeData["001"];
|
|
1874
|
+
return hourCycles[0];
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js
|
|
1878
|
+
var _a;
|
|
1879
|
+
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
|
|
1880
|
+
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
1881
|
+
function createLocation(start, end) {
|
|
1882
|
+
return { start, end };
|
|
1883
|
+
}
|
|
1884
|
+
var hasNativeStartsWith = !!String.prototype.startsWith;
|
|
1885
|
+
var hasNativeFromCodePoint = !!String.fromCodePoint;
|
|
1886
|
+
var hasNativeFromEntries = !!Object.fromEntries;
|
|
1887
|
+
var hasNativeCodePointAt = !!String.prototype.codePointAt;
|
|
1888
|
+
var hasTrimStart = !!String.prototype.trimStart;
|
|
1889
|
+
var hasTrimEnd = !!String.prototype.trimEnd;
|
|
1890
|
+
var hasNativeIsSafeInteger = !!Number.isSafeInteger;
|
|
1891
|
+
var isSafeInteger = hasNativeIsSafeInteger ? Number.isSafeInteger : function(n) {
|
|
1892
|
+
return typeof n === "number" && isFinite(n) && Math.floor(n) === n && Math.abs(n) <= 9007199254740991;
|
|
1893
|
+
};
|
|
1894
|
+
var REGEX_SUPPORTS_U_AND_Y = true;
|
|
1895
|
+
try {
|
|
1896
|
+
re = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1897
|
+
REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec("a")) === null || _a === void 0 ? void 0 : _a[0]) === "a";
|
|
1898
|
+
} catch (_) {
|
|
1899
|
+
REGEX_SUPPORTS_U_AND_Y = false;
|
|
1900
|
+
}
|
|
1901
|
+
var re;
|
|
1902
|
+
var startsWith = hasNativeStartsWith ? function startsWith2(s, search, position) {
|
|
1903
|
+
return s.startsWith(search, position);
|
|
1904
|
+
} : function startsWith3(s, search, position) {
|
|
1905
|
+
return s.slice(position, position + search.length) === search;
|
|
1906
|
+
};
|
|
1907
|
+
var fromCodePoint = hasNativeFromCodePoint ? String.fromCodePoint : function fromCodePoint2() {
|
|
1908
|
+
var codePoints = [];
|
|
1909
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1910
|
+
codePoints[_i] = arguments[_i];
|
|
1911
|
+
}
|
|
1912
|
+
var elements = "";
|
|
1913
|
+
var length = codePoints.length;
|
|
1914
|
+
var i = 0;
|
|
1915
|
+
var code;
|
|
1916
|
+
while (length > i) {
|
|
1917
|
+
code = codePoints[i++];
|
|
1918
|
+
if (code > 1114111)
|
|
1919
|
+
throw RangeError(code + " is not a valid code point");
|
|
1920
|
+
elements += code < 65536 ? String.fromCharCode(code) : String.fromCharCode(((code -= 65536) >> 10) + 55296, code % 1024 + 56320);
|
|
1921
|
+
}
|
|
1922
|
+
return elements;
|
|
1923
|
+
};
|
|
1924
|
+
var fromEntries = hasNativeFromEntries ? Object.fromEntries : function fromEntries2(entries) {
|
|
1925
|
+
var obj = {};
|
|
1926
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
1927
|
+
var _a2 = entries_1[_i], k = _a2[0], v = _a2[1];
|
|
1928
|
+
obj[k] = v;
|
|
1929
|
+
}
|
|
1930
|
+
return obj;
|
|
1931
|
+
};
|
|
1932
|
+
var codePointAt = hasNativeCodePointAt ? function codePointAt2(s, index) {
|
|
1933
|
+
return s.codePointAt(index);
|
|
1934
|
+
} : function codePointAt3(s, index) {
|
|
1935
|
+
var size = s.length;
|
|
1936
|
+
if (index < 0 || index >= size) {
|
|
1937
|
+
return void 0;
|
|
1938
|
+
}
|
|
1939
|
+
var first = s.charCodeAt(index);
|
|
1940
|
+
var second;
|
|
1941
|
+
return first < 55296 || first > 56319 || index + 1 === size || (second = s.charCodeAt(index + 1)) < 56320 || second > 57343 ? first : (first - 55296 << 10) + (second - 56320) + 65536;
|
|
1942
|
+
};
|
|
1943
|
+
var trimStart = hasTrimStart ? function trimStart2(s) {
|
|
1944
|
+
return s.trimStart();
|
|
1945
|
+
} : function trimStart3(s) {
|
|
1946
|
+
return s.replace(SPACE_SEPARATOR_START_REGEX, "");
|
|
1947
|
+
};
|
|
1948
|
+
var trimEnd = hasTrimEnd ? function trimEnd2(s) {
|
|
1949
|
+
return s.trimEnd();
|
|
1950
|
+
} : function trimEnd3(s) {
|
|
1951
|
+
return s.replace(SPACE_SEPARATOR_END_REGEX, "");
|
|
1952
|
+
};
|
|
1953
|
+
function RE(s, flag) {
|
|
1954
|
+
return new RegExp(s, flag);
|
|
1955
|
+
}
|
|
1956
|
+
var matchIdentifierAtIndex;
|
|
1957
|
+
if (REGEX_SUPPORTS_U_AND_Y) {
|
|
1958
|
+
IDENTIFIER_PREFIX_RE_1 = RE("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu");
|
|
1959
|
+
matchIdentifierAtIndex = function matchIdentifierAtIndex2(s, index) {
|
|
1960
|
+
var _a2;
|
|
1961
|
+
IDENTIFIER_PREFIX_RE_1.lastIndex = index;
|
|
1962
|
+
var match = IDENTIFIER_PREFIX_RE_1.exec(s);
|
|
1963
|
+
return (_a2 = match[1]) !== null && _a2 !== void 0 ? _a2 : "";
|
|
1964
|
+
};
|
|
1965
|
+
} else {
|
|
1966
|
+
matchIdentifierAtIndex = function matchIdentifierAtIndex2(s, index) {
|
|
1967
|
+
var match = [];
|
|
1968
|
+
while (true) {
|
|
1969
|
+
var c = codePointAt(s, index);
|
|
1970
|
+
if (c === void 0 || _isWhiteSpace(c) || _isPatternSyntax(c)) {
|
|
1971
|
+
break;
|
|
1972
|
+
}
|
|
1973
|
+
match.push(c);
|
|
1974
|
+
index += c >= 65536 ? 2 : 1;
|
|
1975
|
+
}
|
|
1976
|
+
return fromCodePoint.apply(void 0, match);
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
var IDENTIFIER_PREFIX_RE_1;
|
|
1980
|
+
var Parser = function() {
|
|
1981
|
+
function Parser2(message, options) {
|
|
1982
|
+
if (options === void 0) {
|
|
1983
|
+
options = {};
|
|
1984
|
+
}
|
|
1985
|
+
this.message = message;
|
|
1986
|
+
this.position = { offset: 0, line: 1, column: 1 };
|
|
1987
|
+
this.ignoreTag = !!options.ignoreTag;
|
|
1988
|
+
this.locale = options.locale;
|
|
1989
|
+
this.requiresOtherClause = !!options.requiresOtherClause;
|
|
1990
|
+
this.shouldParseSkeletons = !!options.shouldParseSkeletons;
|
|
1991
|
+
}
|
|
1992
|
+
Parser2.prototype.parse = function() {
|
|
1993
|
+
if (this.offset() !== 0) {
|
|
1994
|
+
throw Error("parser can only be used once");
|
|
1995
|
+
}
|
|
1996
|
+
return this.parseMessage(0, "", false);
|
|
1997
|
+
};
|
|
1998
|
+
Parser2.prototype.parseMessage = function(nestingLevel, parentArgType, expectingCloseTag) {
|
|
1999
|
+
var elements = [];
|
|
2000
|
+
while (!this.isEOF()) {
|
|
2001
|
+
var char = this.char();
|
|
2002
|
+
if (char === 123) {
|
|
2003
|
+
var result = this.parseArgument(nestingLevel, expectingCloseTag);
|
|
2004
|
+
if (result.err) {
|
|
2005
|
+
return result;
|
|
2006
|
+
}
|
|
2007
|
+
elements.push(result.val);
|
|
2008
|
+
} else if (char === 125 && nestingLevel > 0) {
|
|
2009
|
+
break;
|
|
2010
|
+
} else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) {
|
|
2011
|
+
var position = this.clonePosition();
|
|
2012
|
+
this.bump();
|
|
2013
|
+
elements.push({
|
|
2014
|
+
type: TYPE.pound,
|
|
2015
|
+
location: createLocation(position, this.clonePosition())
|
|
2016
|
+
});
|
|
2017
|
+
} else if (char === 60 && !this.ignoreTag && this.peek() === 47) {
|
|
2018
|
+
if (expectingCloseTag) {
|
|
2019
|
+
break;
|
|
2020
|
+
} else {
|
|
2021
|
+
return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2022
|
+
}
|
|
2023
|
+
} else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) {
|
|
2024
|
+
var result = this.parseTag(nestingLevel, parentArgType);
|
|
2025
|
+
if (result.err) {
|
|
2026
|
+
return result;
|
|
2027
|
+
}
|
|
2028
|
+
elements.push(result.val);
|
|
2029
|
+
} else {
|
|
2030
|
+
var result = this.parseLiteral(nestingLevel, parentArgType);
|
|
2031
|
+
if (result.err) {
|
|
2032
|
+
return result;
|
|
2033
|
+
}
|
|
2034
|
+
elements.push(result.val);
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
return { val: elements, err: null };
|
|
2038
|
+
};
|
|
2039
|
+
Parser2.prototype.parseTag = function(nestingLevel, parentArgType) {
|
|
2040
|
+
var startPosition = this.clonePosition();
|
|
2041
|
+
this.bump();
|
|
2042
|
+
var tagName = this.parseTagName();
|
|
2043
|
+
this.bumpSpace();
|
|
2044
|
+
if (this.bumpIf("/>")) {
|
|
2045
|
+
return {
|
|
2046
|
+
val: {
|
|
2047
|
+
type: TYPE.literal,
|
|
2048
|
+
value: "<".concat(tagName, "/>"),
|
|
2049
|
+
location: createLocation(startPosition, this.clonePosition())
|
|
2050
|
+
},
|
|
2051
|
+
err: null
|
|
2052
|
+
};
|
|
2053
|
+
} else if (this.bumpIf(">")) {
|
|
2054
|
+
var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);
|
|
2055
|
+
if (childrenResult.err) {
|
|
2056
|
+
return childrenResult;
|
|
2057
|
+
}
|
|
2058
|
+
var children = childrenResult.val;
|
|
2059
|
+
var endTagStartPosition = this.clonePosition();
|
|
2060
|
+
if (this.bumpIf("</")) {
|
|
2061
|
+
if (this.isEOF() || !_isAlpha(this.char())) {
|
|
2062
|
+
return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2063
|
+
}
|
|
2064
|
+
var closingTagNameStartPosition = this.clonePosition();
|
|
2065
|
+
var closingTagName = this.parseTagName();
|
|
2066
|
+
if (tagName !== closingTagName) {
|
|
2067
|
+
return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(closingTagNameStartPosition, this.clonePosition()));
|
|
2068
|
+
}
|
|
2069
|
+
this.bumpSpace();
|
|
2070
|
+
if (!this.bumpIf(">")) {
|
|
2071
|
+
return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));
|
|
2072
|
+
}
|
|
2073
|
+
return {
|
|
2074
|
+
val: {
|
|
2075
|
+
type: TYPE.tag,
|
|
2076
|
+
value: tagName,
|
|
2077
|
+
children,
|
|
2078
|
+
location: createLocation(startPosition, this.clonePosition())
|
|
2079
|
+
},
|
|
2080
|
+
err: null
|
|
2081
|
+
};
|
|
2082
|
+
} else {
|
|
2083
|
+
return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));
|
|
2084
|
+
}
|
|
2085
|
+
} else {
|
|
2086
|
+
return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));
|
|
2087
|
+
}
|
|
2088
|
+
};
|
|
2089
|
+
Parser2.prototype.parseTagName = function() {
|
|
2090
|
+
var startOffset = this.offset();
|
|
2091
|
+
this.bump();
|
|
2092
|
+
while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {
|
|
2093
|
+
this.bump();
|
|
2094
|
+
}
|
|
2095
|
+
return this.message.slice(startOffset, this.offset());
|
|
2096
|
+
};
|
|
2097
|
+
Parser2.prototype.parseLiteral = function(nestingLevel, parentArgType) {
|
|
2098
|
+
var start = this.clonePosition();
|
|
2099
|
+
var value = "";
|
|
2100
|
+
while (true) {
|
|
2101
|
+
var parseQuoteResult = this.tryParseQuote(parentArgType);
|
|
2102
|
+
if (parseQuoteResult) {
|
|
2103
|
+
value += parseQuoteResult;
|
|
2104
|
+
continue;
|
|
2105
|
+
}
|
|
2106
|
+
var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);
|
|
2107
|
+
if (parseUnquotedResult) {
|
|
2108
|
+
value += parseUnquotedResult;
|
|
2109
|
+
continue;
|
|
2110
|
+
}
|
|
2111
|
+
var parseLeftAngleResult = this.tryParseLeftAngleBracket();
|
|
2112
|
+
if (parseLeftAngleResult) {
|
|
2113
|
+
value += parseLeftAngleResult;
|
|
2114
|
+
continue;
|
|
2115
|
+
}
|
|
2116
|
+
break;
|
|
2117
|
+
}
|
|
2118
|
+
var location = createLocation(start, this.clonePosition());
|
|
2119
|
+
return {
|
|
2120
|
+
val: { type: TYPE.literal, value, location },
|
|
2121
|
+
err: null
|
|
2122
|
+
};
|
|
2123
|
+
};
|
|
2124
|
+
Parser2.prototype.tryParseLeftAngleBracket = function() {
|
|
2125
|
+
if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) {
|
|
2126
|
+
this.bump();
|
|
2127
|
+
return "<";
|
|
2128
|
+
}
|
|
2129
|
+
return null;
|
|
2130
|
+
};
|
|
2131
|
+
Parser2.prototype.tryParseQuote = function(parentArgType) {
|
|
2132
|
+
if (this.isEOF() || this.char() !== 39) {
|
|
2133
|
+
return null;
|
|
2134
|
+
}
|
|
2135
|
+
switch (this.peek()) {
|
|
2136
|
+
case 39:
|
|
2137
|
+
this.bump();
|
|
2138
|
+
this.bump();
|
|
2139
|
+
return "'";
|
|
2140
|
+
case 123:
|
|
2141
|
+
case 60:
|
|
2142
|
+
case 62:
|
|
2143
|
+
case 125:
|
|
2144
|
+
break;
|
|
2145
|
+
case 35:
|
|
2146
|
+
if (parentArgType === "plural" || parentArgType === "selectordinal") {
|
|
2147
|
+
break;
|
|
2148
|
+
}
|
|
2149
|
+
return null;
|
|
2150
|
+
default:
|
|
2151
|
+
return null;
|
|
2152
|
+
}
|
|
2153
|
+
this.bump();
|
|
2154
|
+
var codePoints = [this.char()];
|
|
2155
|
+
this.bump();
|
|
2156
|
+
while (!this.isEOF()) {
|
|
2157
|
+
var ch = this.char();
|
|
2158
|
+
if (ch === 39) {
|
|
2159
|
+
if (this.peek() === 39) {
|
|
2160
|
+
codePoints.push(39);
|
|
2161
|
+
this.bump();
|
|
2162
|
+
} else {
|
|
2163
|
+
this.bump();
|
|
2164
|
+
break;
|
|
2165
|
+
}
|
|
2166
|
+
} else {
|
|
2167
|
+
codePoints.push(ch);
|
|
2168
|
+
}
|
|
2169
|
+
this.bump();
|
|
2170
|
+
}
|
|
2171
|
+
return fromCodePoint.apply(void 0, codePoints);
|
|
2172
|
+
};
|
|
2173
|
+
Parser2.prototype.tryParseUnquoted = function(nestingLevel, parentArgType) {
|
|
2174
|
+
if (this.isEOF()) {
|
|
2175
|
+
return null;
|
|
2176
|
+
}
|
|
2177
|
+
var ch = this.char();
|
|
2178
|
+
if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) {
|
|
2179
|
+
return null;
|
|
2180
|
+
} else {
|
|
2181
|
+
this.bump();
|
|
2182
|
+
return fromCodePoint(ch);
|
|
2183
|
+
}
|
|
2184
|
+
};
|
|
2185
|
+
Parser2.prototype.parseArgument = function(nestingLevel, expectingCloseTag) {
|
|
2186
|
+
var openingBracePosition = this.clonePosition();
|
|
2187
|
+
this.bump();
|
|
2188
|
+
this.bumpSpace();
|
|
2189
|
+
if (this.isEOF()) {
|
|
2190
|
+
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2191
|
+
}
|
|
2192
|
+
if (this.char() === 125) {
|
|
2193
|
+
this.bump();
|
|
2194
|
+
return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2195
|
+
}
|
|
2196
|
+
var value = this.parseIdentifierIfPossible().value;
|
|
2197
|
+
if (!value) {
|
|
2198
|
+
return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2199
|
+
}
|
|
2200
|
+
this.bumpSpace();
|
|
2201
|
+
if (this.isEOF()) {
|
|
2202
|
+
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2203
|
+
}
|
|
2204
|
+
switch (this.char()) {
|
|
2205
|
+
case 125: {
|
|
2206
|
+
this.bump();
|
|
2207
|
+
return {
|
|
2208
|
+
val: {
|
|
2209
|
+
type: TYPE.argument,
|
|
2210
|
+
value,
|
|
2211
|
+
location: createLocation(openingBracePosition, this.clonePosition())
|
|
2212
|
+
},
|
|
2213
|
+
err: null
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
case 44: {
|
|
2217
|
+
this.bump();
|
|
2218
|
+
this.bumpSpace();
|
|
2219
|
+
if (this.isEOF()) {
|
|
2220
|
+
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2221
|
+
}
|
|
2222
|
+
return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);
|
|
2223
|
+
}
|
|
2224
|
+
default:
|
|
2225
|
+
return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));
|
|
2226
|
+
}
|
|
2227
|
+
};
|
|
2228
|
+
Parser2.prototype.parseIdentifierIfPossible = function() {
|
|
2229
|
+
var startingPosition = this.clonePosition();
|
|
2230
|
+
var startOffset = this.offset();
|
|
2231
|
+
var value = matchIdentifierAtIndex(this.message, startOffset);
|
|
2232
|
+
var endOffset = startOffset + value.length;
|
|
2233
|
+
this.bumpTo(endOffset);
|
|
2234
|
+
var endPosition = this.clonePosition();
|
|
2235
|
+
var location = createLocation(startingPosition, endPosition);
|
|
2236
|
+
return { value, location };
|
|
2237
|
+
};
|
|
2238
|
+
Parser2.prototype.parseArgumentOptions = function(nestingLevel, expectingCloseTag, value, openingBracePosition) {
|
|
2239
|
+
var _a2;
|
|
2240
|
+
var typeStartPosition = this.clonePosition();
|
|
2241
|
+
var argType = this.parseIdentifierIfPossible().value;
|
|
2242
|
+
var typeEndPosition = this.clonePosition();
|
|
2243
|
+
switch (argType) {
|
|
2244
|
+
case "":
|
|
2245
|
+
return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
2246
|
+
case "number":
|
|
2247
|
+
case "date":
|
|
2248
|
+
case "time": {
|
|
2249
|
+
this.bumpSpace();
|
|
2250
|
+
var styleAndLocation = null;
|
|
2251
|
+
if (this.bumpIf(",")) {
|
|
2252
|
+
this.bumpSpace();
|
|
2253
|
+
var styleStartPosition = this.clonePosition();
|
|
2254
|
+
var result = this.parseSimpleArgStyleIfPossible();
|
|
2255
|
+
if (result.err) {
|
|
2256
|
+
return result;
|
|
2257
|
+
}
|
|
2258
|
+
var style = trimEnd(result.val);
|
|
2259
|
+
if (style.length === 0) {
|
|
2260
|
+
return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2261
|
+
}
|
|
2262
|
+
var styleLocation = createLocation(styleStartPosition, this.clonePosition());
|
|
2263
|
+
styleAndLocation = { style, styleLocation };
|
|
2264
|
+
}
|
|
2265
|
+
var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2266
|
+
if (argCloseResult.err) {
|
|
2267
|
+
return argCloseResult;
|
|
2268
|
+
}
|
|
2269
|
+
var location_1 = createLocation(openingBracePosition, this.clonePosition());
|
|
2270
|
+
if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, "::", 0)) {
|
|
2271
|
+
var skeleton = trimStart(styleAndLocation.style.slice(2));
|
|
2272
|
+
if (argType === "number") {
|
|
2273
|
+
var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);
|
|
2274
|
+
if (result.err) {
|
|
2275
|
+
return result;
|
|
2276
|
+
}
|
|
2277
|
+
return {
|
|
2278
|
+
val: { type: TYPE.number, value, location: location_1, style: result.val },
|
|
2279
|
+
err: null
|
|
2280
|
+
};
|
|
2281
|
+
} else {
|
|
2282
|
+
if (skeleton.length === 0) {
|
|
2283
|
+
return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);
|
|
2284
|
+
}
|
|
2285
|
+
var dateTimePattern = skeleton;
|
|
2286
|
+
if (this.locale) {
|
|
2287
|
+
dateTimePattern = getBestPattern(skeleton, this.locale);
|
|
2288
|
+
}
|
|
2289
|
+
var style = {
|
|
2290
|
+
type: SKELETON_TYPE.dateTime,
|
|
2291
|
+
pattern: dateTimePattern,
|
|
2292
|
+
location: styleAndLocation.styleLocation,
|
|
2293
|
+
parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {}
|
|
2294
|
+
};
|
|
2295
|
+
var type = argType === "date" ? TYPE.date : TYPE.time;
|
|
2296
|
+
return {
|
|
2297
|
+
val: { type, value, location: location_1, style },
|
|
2298
|
+
err: null
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2302
|
+
return {
|
|
2303
|
+
val: {
|
|
2304
|
+
type: argType === "number" ? TYPE.number : argType === "date" ? TYPE.date : TYPE.time,
|
|
2305
|
+
value,
|
|
2306
|
+
location: location_1,
|
|
2307
|
+
style: (_a2 = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a2 !== void 0 ? _a2 : null
|
|
2308
|
+
},
|
|
2309
|
+
err: null
|
|
2310
|
+
};
|
|
2311
|
+
}
|
|
2312
|
+
case "plural":
|
|
2313
|
+
case "selectordinal":
|
|
2314
|
+
case "select": {
|
|
2315
|
+
var typeEndPosition_1 = this.clonePosition();
|
|
2316
|
+
this.bumpSpace();
|
|
2317
|
+
if (!this.bumpIf(",")) {
|
|
2318
|
+
return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));
|
|
2319
|
+
}
|
|
2320
|
+
this.bumpSpace();
|
|
2321
|
+
var identifierAndLocation = this.parseIdentifierIfPossible();
|
|
2322
|
+
var pluralOffset = 0;
|
|
2323
|
+
if (argType !== "select" && identifierAndLocation.value === "offset") {
|
|
2324
|
+
if (!this.bumpIf(":")) {
|
|
2325
|
+
return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2326
|
+
}
|
|
2327
|
+
this.bumpSpace();
|
|
2328
|
+
var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);
|
|
2329
|
+
if (result.err) {
|
|
2330
|
+
return result;
|
|
2331
|
+
}
|
|
2332
|
+
this.bumpSpace();
|
|
2333
|
+
identifierAndLocation = this.parseIdentifierIfPossible();
|
|
2334
|
+
pluralOffset = result.val;
|
|
2335
|
+
}
|
|
2336
|
+
var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);
|
|
2337
|
+
if (optionsResult.err) {
|
|
2338
|
+
return optionsResult;
|
|
2339
|
+
}
|
|
2340
|
+
var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2341
|
+
if (argCloseResult.err) {
|
|
2342
|
+
return argCloseResult;
|
|
2343
|
+
}
|
|
2344
|
+
var location_2 = createLocation(openingBracePosition, this.clonePosition());
|
|
2345
|
+
if (argType === "select") {
|
|
2346
|
+
return {
|
|
2347
|
+
val: {
|
|
2348
|
+
type: TYPE.select,
|
|
2349
|
+
value,
|
|
2350
|
+
options: fromEntries(optionsResult.val),
|
|
2351
|
+
location: location_2
|
|
2352
|
+
},
|
|
2353
|
+
err: null
|
|
2354
|
+
};
|
|
2355
|
+
} else {
|
|
2356
|
+
return {
|
|
2357
|
+
val: {
|
|
2358
|
+
type: TYPE.plural,
|
|
2359
|
+
value,
|
|
2360
|
+
options: fromEntries(optionsResult.val),
|
|
2361
|
+
offset: pluralOffset,
|
|
2362
|
+
pluralType: argType === "plural" ? "cardinal" : "ordinal",
|
|
2363
|
+
location: location_2
|
|
2364
|
+
},
|
|
2365
|
+
err: null
|
|
2366
|
+
};
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
default:
|
|
2370
|
+
return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));
|
|
2371
|
+
}
|
|
2372
|
+
};
|
|
2373
|
+
Parser2.prototype.tryParseArgumentClose = function(openingBracePosition) {
|
|
2374
|
+
if (this.isEOF() || this.char() !== 125) {
|
|
2375
|
+
return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));
|
|
2376
|
+
}
|
|
2377
|
+
this.bump();
|
|
2378
|
+
return { val: true, err: null };
|
|
2379
|
+
};
|
|
2380
|
+
Parser2.prototype.parseSimpleArgStyleIfPossible = function() {
|
|
2381
|
+
var nestedBraces = 0;
|
|
2382
|
+
var startPosition = this.clonePosition();
|
|
2383
|
+
while (!this.isEOF()) {
|
|
2384
|
+
var ch = this.char();
|
|
2385
|
+
switch (ch) {
|
|
2386
|
+
case 39: {
|
|
2387
|
+
this.bump();
|
|
2388
|
+
var apostrophePosition = this.clonePosition();
|
|
2389
|
+
if (!this.bumpUntil("'")) {
|
|
2390
|
+
return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));
|
|
2391
|
+
}
|
|
2392
|
+
this.bump();
|
|
2393
|
+
break;
|
|
2394
|
+
}
|
|
2395
|
+
case 123: {
|
|
2396
|
+
nestedBraces += 1;
|
|
2397
|
+
this.bump();
|
|
2398
|
+
break;
|
|
2399
|
+
}
|
|
2400
|
+
case 125: {
|
|
2401
|
+
if (nestedBraces > 0) {
|
|
2402
|
+
nestedBraces -= 1;
|
|
2403
|
+
} else {
|
|
2404
|
+
return {
|
|
2405
|
+
val: this.message.slice(startPosition.offset, this.offset()),
|
|
2406
|
+
err: null
|
|
2407
|
+
};
|
|
2408
|
+
}
|
|
2409
|
+
break;
|
|
2410
|
+
}
|
|
2411
|
+
default:
|
|
2412
|
+
this.bump();
|
|
2413
|
+
break;
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
return {
|
|
2417
|
+
val: this.message.slice(startPosition.offset, this.offset()),
|
|
2418
|
+
err: null
|
|
2419
|
+
};
|
|
2420
|
+
};
|
|
2421
|
+
Parser2.prototype.parseNumberSkeletonFromString = function(skeleton, location) {
|
|
2422
|
+
var tokens = [];
|
|
2423
|
+
try {
|
|
2424
|
+
tokens = parseNumberSkeletonFromString(skeleton);
|
|
2425
|
+
} catch (e) {
|
|
2426
|
+
return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);
|
|
2427
|
+
}
|
|
2428
|
+
return {
|
|
2429
|
+
val: {
|
|
2430
|
+
type: SKELETON_TYPE.number,
|
|
2431
|
+
tokens,
|
|
2432
|
+
location,
|
|
2433
|
+
parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {}
|
|
2434
|
+
},
|
|
2435
|
+
err: null
|
|
2436
|
+
};
|
|
2437
|
+
};
|
|
2438
|
+
Parser2.prototype.tryParsePluralOrSelectOptions = function(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {
|
|
2439
|
+
var _a2;
|
|
2440
|
+
var hasOtherClause = false;
|
|
2441
|
+
var options = [];
|
|
2442
|
+
var parsedSelectors = /* @__PURE__ */ new Set();
|
|
2443
|
+
var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;
|
|
2444
|
+
while (true) {
|
|
2445
|
+
if (selector.length === 0) {
|
|
2446
|
+
var startPosition = this.clonePosition();
|
|
2447
|
+
if (parentArgType !== "select" && this.bumpIf("=")) {
|
|
2448
|
+
var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);
|
|
2449
|
+
if (result.err) {
|
|
2450
|
+
return result;
|
|
2451
|
+
}
|
|
2452
|
+
selectorLocation = createLocation(startPosition, this.clonePosition());
|
|
2453
|
+
selector = this.message.slice(startPosition.offset, this.offset());
|
|
2454
|
+
} else {
|
|
2455
|
+
break;
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
if (parsedSelectors.has(selector)) {
|
|
2459
|
+
return this.error(parentArgType === "select" ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);
|
|
2460
|
+
}
|
|
2461
|
+
if (selector === "other") {
|
|
2462
|
+
hasOtherClause = true;
|
|
2463
|
+
}
|
|
2464
|
+
this.bumpSpace();
|
|
2465
|
+
var openingBracePosition = this.clonePosition();
|
|
2466
|
+
if (!this.bumpIf("{")) {
|
|
2467
|
+
return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2468
|
+
}
|
|
2469
|
+
var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);
|
|
2470
|
+
if (fragmentResult.err) {
|
|
2471
|
+
return fragmentResult;
|
|
2472
|
+
}
|
|
2473
|
+
var argCloseResult = this.tryParseArgumentClose(openingBracePosition);
|
|
2474
|
+
if (argCloseResult.err) {
|
|
2475
|
+
return argCloseResult;
|
|
2476
|
+
}
|
|
2477
|
+
options.push([
|
|
2478
|
+
selector,
|
|
2479
|
+
{
|
|
2480
|
+
value: fragmentResult.val,
|
|
2481
|
+
location: createLocation(openingBracePosition, this.clonePosition())
|
|
2482
|
+
}
|
|
2483
|
+
]);
|
|
2484
|
+
parsedSelectors.add(selector);
|
|
2485
|
+
this.bumpSpace();
|
|
2486
|
+
_a2 = this.parseIdentifierIfPossible(), selector = _a2.value, selectorLocation = _a2.location;
|
|
2487
|
+
}
|
|
2488
|
+
if (options.length === 0) {
|
|
2489
|
+
return this.error(parentArgType === "select" ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2490
|
+
}
|
|
2491
|
+
if (this.requiresOtherClause && !hasOtherClause) {
|
|
2492
|
+
return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));
|
|
2493
|
+
}
|
|
2494
|
+
return { val: options, err: null };
|
|
2495
|
+
};
|
|
2496
|
+
Parser2.prototype.tryParseDecimalInteger = function(expectNumberError, invalidNumberError) {
|
|
2497
|
+
var sign = 1;
|
|
2498
|
+
var startingPosition = this.clonePosition();
|
|
2499
|
+
if (this.bumpIf("+")) {
|
|
2500
|
+
} else if (this.bumpIf("-")) {
|
|
2501
|
+
sign = -1;
|
|
2502
|
+
}
|
|
2503
|
+
var hasDigits = false;
|
|
2504
|
+
var decimal = 0;
|
|
2505
|
+
while (!this.isEOF()) {
|
|
2506
|
+
var ch = this.char();
|
|
2507
|
+
if (ch >= 48 && ch <= 57) {
|
|
2508
|
+
hasDigits = true;
|
|
2509
|
+
decimal = decimal * 10 + (ch - 48);
|
|
2510
|
+
this.bump();
|
|
2511
|
+
} else {
|
|
2512
|
+
break;
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
var location = createLocation(startingPosition, this.clonePosition());
|
|
2516
|
+
if (!hasDigits) {
|
|
2517
|
+
return this.error(expectNumberError, location);
|
|
2518
|
+
}
|
|
2519
|
+
decimal *= sign;
|
|
2520
|
+
if (!isSafeInteger(decimal)) {
|
|
2521
|
+
return this.error(invalidNumberError, location);
|
|
2522
|
+
}
|
|
2523
|
+
return { val: decimal, err: null };
|
|
2524
|
+
};
|
|
2525
|
+
Parser2.prototype.offset = function() {
|
|
2526
|
+
return this.position.offset;
|
|
2527
|
+
};
|
|
2528
|
+
Parser2.prototype.isEOF = function() {
|
|
2529
|
+
return this.offset() === this.message.length;
|
|
2530
|
+
};
|
|
2531
|
+
Parser2.prototype.clonePosition = function() {
|
|
2532
|
+
return {
|
|
2533
|
+
offset: this.position.offset,
|
|
2534
|
+
line: this.position.line,
|
|
2535
|
+
column: this.position.column
|
|
2536
|
+
};
|
|
2537
|
+
};
|
|
2538
|
+
Parser2.prototype.char = function() {
|
|
2539
|
+
var offset = this.position.offset;
|
|
2540
|
+
if (offset >= this.message.length) {
|
|
2541
|
+
throw Error("out of bound");
|
|
2542
|
+
}
|
|
2543
|
+
var code = codePointAt(this.message, offset);
|
|
2544
|
+
if (code === void 0) {
|
|
2545
|
+
throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary"));
|
|
2546
|
+
}
|
|
2547
|
+
return code;
|
|
2548
|
+
};
|
|
2549
|
+
Parser2.prototype.error = function(kind, location) {
|
|
2550
|
+
return {
|
|
2551
|
+
val: null,
|
|
2552
|
+
err: {
|
|
2553
|
+
kind,
|
|
2554
|
+
message: this.message,
|
|
2555
|
+
location
|
|
2556
|
+
}
|
|
2557
|
+
};
|
|
2558
|
+
};
|
|
2559
|
+
Parser2.prototype.bump = function() {
|
|
2560
|
+
if (this.isEOF()) {
|
|
2561
|
+
return;
|
|
2562
|
+
}
|
|
2563
|
+
var code = this.char();
|
|
2564
|
+
if (code === 10) {
|
|
2565
|
+
this.position.line += 1;
|
|
2566
|
+
this.position.column = 1;
|
|
2567
|
+
this.position.offset += 1;
|
|
2568
|
+
} else {
|
|
2569
|
+
this.position.column += 1;
|
|
2570
|
+
this.position.offset += code < 65536 ? 1 : 2;
|
|
2571
|
+
}
|
|
2572
|
+
};
|
|
2573
|
+
Parser2.prototype.bumpIf = function(prefix) {
|
|
2574
|
+
if (startsWith(this.message, prefix, this.offset())) {
|
|
2575
|
+
for (var i = 0; i < prefix.length; i++) {
|
|
2576
|
+
this.bump();
|
|
2577
|
+
}
|
|
2578
|
+
return true;
|
|
2579
|
+
}
|
|
2580
|
+
return false;
|
|
2581
|
+
};
|
|
2582
|
+
Parser2.prototype.bumpUntil = function(pattern) {
|
|
2583
|
+
var currentOffset = this.offset();
|
|
2584
|
+
var index = this.message.indexOf(pattern, currentOffset);
|
|
2585
|
+
if (index >= 0) {
|
|
2586
|
+
this.bumpTo(index);
|
|
2587
|
+
return true;
|
|
2588
|
+
} else {
|
|
2589
|
+
this.bumpTo(this.message.length);
|
|
2590
|
+
return false;
|
|
2591
|
+
}
|
|
2592
|
+
};
|
|
2593
|
+
Parser2.prototype.bumpTo = function(targetOffset) {
|
|
2594
|
+
if (this.offset() > targetOffset) {
|
|
2595
|
+
throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset()));
|
|
2596
|
+
}
|
|
2597
|
+
targetOffset = Math.min(targetOffset, this.message.length);
|
|
2598
|
+
while (true) {
|
|
2599
|
+
var offset = this.offset();
|
|
2600
|
+
if (offset === targetOffset) {
|
|
2601
|
+
break;
|
|
2602
|
+
}
|
|
2603
|
+
if (offset > targetOffset) {
|
|
2604
|
+
throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary"));
|
|
2605
|
+
}
|
|
2606
|
+
this.bump();
|
|
2607
|
+
if (this.isEOF()) {
|
|
2608
|
+
break;
|
|
2609
|
+
}
|
|
2610
|
+
}
|
|
2611
|
+
};
|
|
2612
|
+
Parser2.prototype.bumpSpace = function() {
|
|
2613
|
+
while (!this.isEOF() && _isWhiteSpace(this.char())) {
|
|
2614
|
+
this.bump();
|
|
2615
|
+
}
|
|
2616
|
+
};
|
|
2617
|
+
Parser2.prototype.peek = function() {
|
|
2618
|
+
if (this.isEOF()) {
|
|
2619
|
+
return null;
|
|
2620
|
+
}
|
|
2621
|
+
var code = this.char();
|
|
2622
|
+
var offset = this.offset();
|
|
2623
|
+
var nextCode = this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1));
|
|
2624
|
+
return nextCode !== null && nextCode !== void 0 ? nextCode : null;
|
|
2625
|
+
};
|
|
2626
|
+
return Parser2;
|
|
2627
|
+
}();
|
|
2628
|
+
function _isAlpha(codepoint) {
|
|
2629
|
+
return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90;
|
|
2630
|
+
}
|
|
2631
|
+
function _isAlphaOrSlash(codepoint) {
|
|
2632
|
+
return _isAlpha(codepoint) || codepoint === 47;
|
|
2633
|
+
}
|
|
2634
|
+
function _isPotentialElementNameChar(c) {
|
|
2635
|
+
return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039;
|
|
2636
|
+
}
|
|
2637
|
+
function _isWhiteSpace(c) {
|
|
2638
|
+
return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233;
|
|
2639
|
+
}
|
|
2640
|
+
function _isPatternSyntax(c) {
|
|
2641
|
+
return c >= 33 && c <= 35 || c === 36 || c >= 37 && c <= 39 || c === 40 || c === 41 || c === 42 || c === 43 || c === 44 || c === 45 || c >= 46 && c <= 47 || c >= 58 && c <= 59 || c >= 60 && c <= 62 || c >= 63 && c <= 64 || c === 91 || c === 92 || c === 93 || c === 94 || c === 96 || c === 123 || c === 124 || c === 125 || c === 126 || c === 161 || c >= 162 && c <= 165 || c === 166 || c === 167 || c === 169 || c === 171 || c === 172 || c === 174 || c === 176 || c === 177 || c === 182 || c === 187 || c === 191 || c === 215 || c === 247 || c >= 8208 && c <= 8213 || c >= 8214 && c <= 8215 || c === 8216 || c === 8217 || c === 8218 || c >= 8219 && c <= 8220 || c === 8221 || c === 8222 || c === 8223 || c >= 8224 && c <= 8231 || c >= 8240 && c <= 8248 || c === 8249 || c === 8250 || c >= 8251 && c <= 8254 || c >= 8257 && c <= 8259 || c === 8260 || c === 8261 || c === 8262 || c >= 8263 && c <= 8273 || c === 8274 || c === 8275 || c >= 8277 && c <= 8286 || c >= 8592 && c <= 8596 || c >= 8597 && c <= 8601 || c >= 8602 && c <= 8603 || c >= 8604 && c <= 8607 || c === 8608 || c >= 8609 && c <= 8610 || c === 8611 || c >= 8612 && c <= 8613 || c === 8614 || c >= 8615 && c <= 8621 || c === 8622 || c >= 8623 && c <= 8653 || c >= 8654 && c <= 8655 || c >= 8656 && c <= 8657 || c === 8658 || c === 8659 || c === 8660 || c >= 8661 && c <= 8691 || c >= 8692 && c <= 8959 || c >= 8960 && c <= 8967 || c === 8968 || c === 8969 || c === 8970 || c === 8971 || c >= 8972 && c <= 8991 || c >= 8992 && c <= 8993 || c >= 8994 && c <= 9e3 || c === 9001 || c === 9002 || c >= 9003 && c <= 9083 || c === 9084 || c >= 9085 && c <= 9114 || c >= 9115 && c <= 9139 || c >= 9140 && c <= 9179 || c >= 9180 && c <= 9185 || c >= 9186 && c <= 9254 || c >= 9255 && c <= 9279 || c >= 9280 && c <= 9290 || c >= 9291 && c <= 9311 || c >= 9472 && c <= 9654 || c === 9655 || c >= 9656 && c <= 9664 || c === 9665 || c >= 9666 && c <= 9719 || c >= 9720 && c <= 9727 || c >= 9728 && c <= 9838 || c === 9839 || c >= 9840 && c <= 10087 || c === 10088 || c === 10089 || c === 10090 || c === 10091 || c === 10092 || c === 10093 || c === 10094 || c === 10095 || c === 10096 || c === 10097 || c === 10098 || c === 10099 || c === 10100 || c === 10101 || c >= 10132 && c <= 10175 || c >= 10176 && c <= 10180 || c === 10181 || c === 10182 || c >= 10183 && c <= 10213 || c === 10214 || c === 10215 || c === 10216 || c === 10217 || c === 10218 || c === 10219 || c === 10220 || c === 10221 || c === 10222 || c === 10223 || c >= 10224 && c <= 10239 || c >= 10240 && c <= 10495 || c >= 10496 && c <= 10626 || c === 10627 || c === 10628 || c === 10629 || c === 10630 || c === 10631 || c === 10632 || c === 10633 || c === 10634 || c === 10635 || c === 10636 || c === 10637 || c === 10638 || c === 10639 || c === 10640 || c === 10641 || c === 10642 || c === 10643 || c === 10644 || c === 10645 || c === 10646 || c === 10647 || c === 10648 || c >= 10649 && c <= 10711 || c === 10712 || c === 10713 || c === 10714 || c === 10715 || c >= 10716 && c <= 10747 || c === 10748 || c === 10749 || c >= 10750 && c <= 11007 || c >= 11008 && c <= 11055 || c >= 11056 && c <= 11076 || c >= 11077 && c <= 11078 || c >= 11079 && c <= 11084 || c >= 11085 && c <= 11123 || c >= 11124 && c <= 11125 || c >= 11126 && c <= 11157 || c === 11158 || c >= 11159 && c <= 11263 || c >= 11776 && c <= 11777 || c === 11778 || c === 11779 || c === 11780 || c === 11781 || c >= 11782 && c <= 11784 || c === 11785 || c === 11786 || c === 11787 || c === 11788 || c === 11789 || c >= 11790 && c <= 11798 || c === 11799 || c >= 11800 && c <= 11801 || c === 11802 || c === 11803 || c === 11804 || c === 11805 || c >= 11806 && c <= 11807 || c === 11808 || c === 11809 || c === 11810 || c === 11811 || c === 11812 || c === 11813 || c === 11814 || c === 11815 || c === 11816 || c === 11817 || c >= 11818 && c <= 11822 || c === 11823 || c >= 11824 && c <= 11833 || c >= 11834 && c <= 11835 || c >= 11836 && c <= 11839 || c === 11840 || c === 11841 || c === 11842 || c >= 11843 && c <= 11855 || c >= 11856 && c <= 11857 || c === 11858 || c >= 11859 && c <= 11903 || c >= 12289 && c <= 12291 || c === 12296 || c === 12297 || c === 12298 || c === 12299 || c === 12300 || c === 12301 || c === 12302 || c === 12303 || c === 12304 || c === 12305 || c >= 12306 && c <= 12307 || c === 12308 || c === 12309 || c === 12310 || c === 12311 || c === 12312 || c === 12313 || c === 12314 || c === 12315 || c === 12316 || c === 12317 || c >= 12318 && c <= 12319 || c === 12320 || c === 12336 || c === 64830 || c === 64831 || c >= 65093 && c <= 65094;
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/index.js
|
|
2645
|
+
function pruneLocation(els) {
|
|
2646
|
+
els.forEach(function(el) {
|
|
2647
|
+
delete el.location;
|
|
2648
|
+
if (isSelectElement(el) || isPluralElement(el)) {
|
|
2649
|
+
for (var k in el.options) {
|
|
2650
|
+
delete el.options[k].location;
|
|
2651
|
+
pruneLocation(el.options[k].value);
|
|
2652
|
+
}
|
|
2653
|
+
} else if (isNumberElement(el) && isNumberSkeleton(el.style)) {
|
|
2654
|
+
delete el.style.location;
|
|
2655
|
+
} else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) {
|
|
2656
|
+
delete el.style.location;
|
|
2657
|
+
} else if (isTagElement(el)) {
|
|
2658
|
+
pruneLocation(el.children);
|
|
2659
|
+
}
|
|
2660
|
+
});
|
|
2661
|
+
}
|
|
2662
|
+
function parse(message, opts) {
|
|
2663
|
+
if (opts === void 0) {
|
|
2664
|
+
opts = {};
|
|
2665
|
+
}
|
|
2666
|
+
opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);
|
|
2667
|
+
var result = new Parser(message, opts).parse();
|
|
2668
|
+
if (result.err) {
|
|
2669
|
+
var error = SyntaxError(ErrorKind[result.err.kind]);
|
|
2670
|
+
error.location = result.err.location;
|
|
2671
|
+
error.originalMessage = result.err.message;
|
|
2672
|
+
throw error;
|
|
2673
|
+
}
|
|
2674
|
+
if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {
|
|
2675
|
+
pruneLocation(result.val);
|
|
2676
|
+
}
|
|
2677
|
+
return result.val;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
2681
|
+
function memoize(fn, options) {
|
|
2682
|
+
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
2683
|
+
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
2684
|
+
var strategy = options && options.strategy ? options.strategy : strategyDefault;
|
|
2685
|
+
return strategy(fn, {
|
|
2686
|
+
cache,
|
|
2687
|
+
serializer
|
|
2688
|
+
});
|
|
2689
|
+
}
|
|
2690
|
+
function isPrimitive(value) {
|
|
2691
|
+
return value == null || typeof value === "number" || typeof value === "boolean";
|
|
2692
|
+
}
|
|
2693
|
+
function monadic(fn, cache, serializer, arg) {
|
|
2694
|
+
var cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
2695
|
+
var computedValue = cache.get(cacheKey);
|
|
2696
|
+
if (typeof computedValue === "undefined") {
|
|
2697
|
+
computedValue = fn.call(this, arg);
|
|
2698
|
+
cache.set(cacheKey, computedValue);
|
|
2699
|
+
}
|
|
2700
|
+
return computedValue;
|
|
2701
|
+
}
|
|
2702
|
+
function variadic(fn, cache, serializer) {
|
|
2703
|
+
var args = Array.prototype.slice.call(arguments, 3);
|
|
2704
|
+
var cacheKey = serializer(args);
|
|
2705
|
+
var computedValue = cache.get(cacheKey);
|
|
2706
|
+
if (typeof computedValue === "undefined") {
|
|
2707
|
+
computedValue = fn.apply(this, args);
|
|
2708
|
+
cache.set(cacheKey, computedValue);
|
|
2709
|
+
}
|
|
2710
|
+
return computedValue;
|
|
2711
|
+
}
|
|
2712
|
+
function assemble(fn, context, strategy, cache, serialize) {
|
|
2713
|
+
return strategy.bind(context, fn, cache, serialize);
|
|
2714
|
+
}
|
|
2715
|
+
function strategyDefault(fn, options) {
|
|
2716
|
+
var strategy = fn.length === 1 ? monadic : variadic;
|
|
2717
|
+
return assemble(fn, this, strategy, options.cache.create(), options.serializer);
|
|
2718
|
+
}
|
|
2719
|
+
function strategyVariadic(fn, options) {
|
|
2720
|
+
return assemble(fn, this, variadic, options.cache.create(), options.serializer);
|
|
2721
|
+
}
|
|
2722
|
+
function strategyMonadic(fn, options) {
|
|
2723
|
+
return assemble(fn, this, monadic, options.cache.create(), options.serializer);
|
|
2724
|
+
}
|
|
2725
|
+
var serializerDefault = function() {
|
|
2726
|
+
return JSON.stringify(arguments);
|
|
2727
|
+
};
|
|
2728
|
+
function ObjectWithoutPrototypeCache() {
|
|
2729
|
+
this.cache = /* @__PURE__ */ Object.create(null);
|
|
2730
|
+
}
|
|
2731
|
+
ObjectWithoutPrototypeCache.prototype.get = function(key) {
|
|
2732
|
+
return this.cache[key];
|
|
2733
|
+
};
|
|
2734
|
+
ObjectWithoutPrototypeCache.prototype.set = function(key, value) {
|
|
2735
|
+
this.cache[key] = value;
|
|
2736
|
+
};
|
|
2737
|
+
var cacheDefault = {
|
|
2738
|
+
create: function create() {
|
|
2739
|
+
return new ObjectWithoutPrototypeCache();
|
|
2740
|
+
}
|
|
2741
|
+
};
|
|
2742
|
+
var strategies = {
|
|
2743
|
+
variadic: strategyVariadic,
|
|
2744
|
+
monadic: strategyMonadic
|
|
2745
|
+
};
|
|
2746
|
+
|
|
2747
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/error.js
|
|
2748
|
+
var ErrorCode;
|
|
2749
|
+
(function(ErrorCode2) {
|
|
2750
|
+
ErrorCode2["MISSING_VALUE"] = "MISSING_VALUE";
|
|
2751
|
+
ErrorCode2["INVALID_VALUE"] = "INVALID_VALUE";
|
|
2752
|
+
ErrorCode2["MISSING_INTL_API"] = "MISSING_INTL_API";
|
|
2753
|
+
})(ErrorCode || (ErrorCode = {}));
|
|
2754
|
+
var FormatError = class extends Error {
|
|
2755
|
+
code;
|
|
2756
|
+
originalMessage;
|
|
2757
|
+
constructor(msg, code, originalMessage) {
|
|
2758
|
+
super(msg);
|
|
2759
|
+
this.code = code;
|
|
2760
|
+
this.originalMessage = originalMessage;
|
|
2761
|
+
}
|
|
2762
|
+
toString() {
|
|
2763
|
+
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
2764
|
+
}
|
|
2765
|
+
};
|
|
2766
|
+
var InvalidValueError = class extends FormatError {
|
|
2767
|
+
constructor(variableId, value, options, originalMessage) {
|
|
2768
|
+
super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join('", "')}"`, ErrorCode.INVALID_VALUE, originalMessage);
|
|
2769
|
+
}
|
|
2770
|
+
};
|
|
2771
|
+
var InvalidValueTypeError = class extends FormatError {
|
|
2772
|
+
constructor(value, type, originalMessage) {
|
|
2773
|
+
super(`Value for "${value}" must be of type ${type}`, ErrorCode.INVALID_VALUE, originalMessage);
|
|
2774
|
+
}
|
|
2775
|
+
};
|
|
2776
|
+
var MissingValueError = class extends FormatError {
|
|
2777
|
+
constructor(variableId, originalMessage) {
|
|
2778
|
+
super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, ErrorCode.MISSING_VALUE, originalMessage);
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2781
|
+
|
|
2782
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/formatters.js
|
|
2783
|
+
var PART_TYPE;
|
|
2784
|
+
(function(PART_TYPE2) {
|
|
2785
|
+
PART_TYPE2[PART_TYPE2["literal"] = 0] = "literal";
|
|
2786
|
+
PART_TYPE2[PART_TYPE2["object"] = 1] = "object";
|
|
2787
|
+
})(PART_TYPE || (PART_TYPE = {}));
|
|
2788
|
+
function mergeLiteral(parts) {
|
|
2789
|
+
if (parts.length < 2) {
|
|
2790
|
+
return parts;
|
|
2791
|
+
}
|
|
2792
|
+
return parts.reduce((all, part) => {
|
|
2793
|
+
const lastPart = all[all.length - 1];
|
|
2794
|
+
if (!lastPart || lastPart.type !== PART_TYPE.literal || part.type !== PART_TYPE.literal) {
|
|
2795
|
+
all.push(part);
|
|
2796
|
+
} else {
|
|
2797
|
+
lastPart.value += part.value;
|
|
2798
|
+
}
|
|
2799
|
+
return all;
|
|
2800
|
+
}, []);
|
|
2801
|
+
}
|
|
2802
|
+
function isFormatXMLElementFn(el) {
|
|
2803
|
+
return typeof el === "function";
|
|
2804
|
+
}
|
|
2805
|
+
function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) {
|
|
2806
|
+
if (els.length === 1 && isLiteralElement(els[0])) {
|
|
2807
|
+
return [
|
|
2808
|
+
{
|
|
2809
|
+
type: PART_TYPE.literal,
|
|
2810
|
+
value: els[0].value
|
|
2811
|
+
}
|
|
2812
|
+
];
|
|
2813
|
+
}
|
|
2814
|
+
const result = [];
|
|
2815
|
+
for (const el of els) {
|
|
2816
|
+
if (isLiteralElement(el)) {
|
|
2817
|
+
result.push({
|
|
2818
|
+
type: PART_TYPE.literal,
|
|
2819
|
+
value: el.value
|
|
2820
|
+
});
|
|
2821
|
+
continue;
|
|
2822
|
+
}
|
|
2823
|
+
if (isPoundElement(el)) {
|
|
2824
|
+
if (typeof currentPluralValue === "number") {
|
|
2825
|
+
result.push({
|
|
2826
|
+
type: PART_TYPE.literal,
|
|
2827
|
+
value: formatters.getNumberFormat(locales).format(currentPluralValue)
|
|
2828
|
+
});
|
|
2829
|
+
}
|
|
2830
|
+
continue;
|
|
2831
|
+
}
|
|
2832
|
+
const { value: varName } = el;
|
|
2833
|
+
if (!(values && varName in values)) {
|
|
2834
|
+
throw new MissingValueError(varName, originalMessage);
|
|
2835
|
+
}
|
|
2836
|
+
let value = values[varName];
|
|
2837
|
+
if (isArgumentElement(el)) {
|
|
2838
|
+
if (!value || typeof value === "string" || typeof value === "number") {
|
|
2839
|
+
value = typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
2840
|
+
}
|
|
2841
|
+
result.push({
|
|
2842
|
+
type: typeof value === "string" ? PART_TYPE.literal : PART_TYPE.object,
|
|
2843
|
+
value
|
|
2844
|
+
});
|
|
2845
|
+
continue;
|
|
2846
|
+
}
|
|
2847
|
+
if (isDateElement(el)) {
|
|
2848
|
+
const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
2849
|
+
result.push({
|
|
2850
|
+
type: PART_TYPE.literal,
|
|
2851
|
+
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
2852
|
+
});
|
|
2853
|
+
continue;
|
|
2854
|
+
}
|
|
2855
|
+
if (isTimeElement(el)) {
|
|
2856
|
+
const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium;
|
|
2857
|
+
result.push({
|
|
2858
|
+
type: PART_TYPE.literal,
|
|
2859
|
+
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
2860
|
+
});
|
|
2861
|
+
continue;
|
|
2862
|
+
}
|
|
2863
|
+
if (isNumberElement(el)) {
|
|
2864
|
+
const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
2865
|
+
if (style && style.scale) {
|
|
2866
|
+
value = value * (style.scale || 1);
|
|
2867
|
+
}
|
|
2868
|
+
result.push({
|
|
2869
|
+
type: PART_TYPE.literal,
|
|
2870
|
+
value: formatters.getNumberFormat(locales, style).format(value)
|
|
2871
|
+
});
|
|
2872
|
+
continue;
|
|
2873
|
+
}
|
|
2874
|
+
if (isTagElement(el)) {
|
|
2875
|
+
const { children, value: value2 } = el;
|
|
2876
|
+
const formatFn = values[value2];
|
|
2877
|
+
if (!isFormatXMLElementFn(formatFn)) {
|
|
2878
|
+
throw new InvalidValueTypeError(value2, "function", originalMessage);
|
|
2879
|
+
}
|
|
2880
|
+
const parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);
|
|
2881
|
+
let chunks = formatFn(parts.map((p) => p.value));
|
|
2882
|
+
if (!Array.isArray(chunks)) {
|
|
2883
|
+
chunks = [chunks];
|
|
2884
|
+
}
|
|
2885
|
+
result.push(...chunks.map((c) => {
|
|
2886
|
+
return {
|
|
2887
|
+
type: typeof c === "string" ? PART_TYPE.literal : PART_TYPE.object,
|
|
2888
|
+
value: c
|
|
2889
|
+
};
|
|
2890
|
+
}));
|
|
2891
|
+
}
|
|
2892
|
+
if (isSelectElement(el)) {
|
|
2893
|
+
const opt = el.options[value] || el.options.other;
|
|
2894
|
+
if (!opt) {
|
|
2895
|
+
throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
2896
|
+
}
|
|
2897
|
+
result.push(...formatToParts(opt.value, locales, formatters, formats, values));
|
|
2898
|
+
continue;
|
|
2899
|
+
}
|
|
2900
|
+
if (isPluralElement(el)) {
|
|
2901
|
+
let opt = el.options[`=${value}`];
|
|
2902
|
+
if (!opt) {
|
|
2903
|
+
if (!Intl.PluralRules) {
|
|
2904
|
+
throw new FormatError(`Intl.PluralRules is not available in this environment.
|
|
2905
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
2906
|
+
`, ErrorCode.MISSING_INTL_API, originalMessage);
|
|
2907
|
+
}
|
|
2908
|
+
const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(value - (el.offset || 0));
|
|
2909
|
+
opt = el.options[rule] || el.options.other;
|
|
2910
|
+
}
|
|
2911
|
+
if (!opt) {
|
|
2912
|
+
throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);
|
|
2913
|
+
}
|
|
2914
|
+
result.push(...formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
|
|
2915
|
+
continue;
|
|
2916
|
+
}
|
|
2917
|
+
}
|
|
2918
|
+
return mergeLiteral(result);
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-messageformat/lib_esnext/src/core.js
|
|
2922
|
+
function mergeConfig(c1, c2) {
|
|
2923
|
+
if (!c2) {
|
|
2924
|
+
return c1;
|
|
2925
|
+
}
|
|
2926
|
+
return {
|
|
2927
|
+
...c1 || {},
|
|
2928
|
+
...c2 || {},
|
|
2929
|
+
...Object.keys(c1).reduce((all, k) => {
|
|
2930
|
+
all[k] = {
|
|
2931
|
+
...c1[k],
|
|
2932
|
+
...c2[k] || {}
|
|
2933
|
+
};
|
|
2934
|
+
return all;
|
|
2935
|
+
}, {})
|
|
2936
|
+
};
|
|
2937
|
+
}
|
|
2938
|
+
function mergeConfigs(defaultConfig, configs) {
|
|
2939
|
+
if (!configs) {
|
|
2940
|
+
return defaultConfig;
|
|
2941
|
+
}
|
|
2942
|
+
return Object.keys(defaultConfig).reduce((all, k) => {
|
|
2943
|
+
all[k] = mergeConfig(defaultConfig[k], configs[k]);
|
|
2944
|
+
return all;
|
|
2945
|
+
}, { ...defaultConfig });
|
|
2946
|
+
}
|
|
2947
|
+
function createFastMemoizeCache(store) {
|
|
2948
|
+
return {
|
|
2949
|
+
create() {
|
|
2950
|
+
return {
|
|
2951
|
+
get(key) {
|
|
2952
|
+
return store[key];
|
|
2953
|
+
},
|
|
2954
|
+
set(key, value) {
|
|
2955
|
+
store[key] = value;
|
|
2956
|
+
}
|
|
2957
|
+
};
|
|
2958
|
+
}
|
|
2959
|
+
};
|
|
2960
|
+
}
|
|
2961
|
+
function createDefaultFormatters(cache = {
|
|
2962
|
+
number: {},
|
|
2963
|
+
dateTime: {},
|
|
2964
|
+
pluralRules: {}
|
|
2965
|
+
}) {
|
|
2966
|
+
return {
|
|
2967
|
+
getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), {
|
|
2968
|
+
cache: createFastMemoizeCache(cache.number),
|
|
2969
|
+
strategy: strategies.variadic
|
|
2970
|
+
}),
|
|
2971
|
+
getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), {
|
|
2972
|
+
cache: createFastMemoizeCache(cache.dateTime),
|
|
2973
|
+
strategy: strategies.variadic
|
|
2974
|
+
}),
|
|
2975
|
+
getPluralRules: memoize((...args) => new Intl.PluralRules(...args), {
|
|
2976
|
+
cache: createFastMemoizeCache(cache.pluralRules),
|
|
2977
|
+
strategy: strategies.variadic
|
|
2978
|
+
})
|
|
2979
|
+
};
|
|
2980
|
+
}
|
|
2981
|
+
var _IntlMessageFormat = class {
|
|
2982
|
+
ast;
|
|
2983
|
+
locales;
|
|
2984
|
+
resolvedLocale;
|
|
2985
|
+
formatters;
|
|
2986
|
+
formats;
|
|
2987
|
+
message;
|
|
2988
|
+
formatterCache = {
|
|
2989
|
+
number: {},
|
|
2990
|
+
dateTime: {},
|
|
2991
|
+
pluralRules: {}
|
|
2992
|
+
};
|
|
2993
|
+
constructor(message, locales = _IntlMessageFormat.defaultLocale, overrideFormats, opts) {
|
|
2994
|
+
this.locales = locales;
|
|
2995
|
+
this.resolvedLocale = _IntlMessageFormat.resolveLocale(locales);
|
|
2996
|
+
if (typeof message === "string") {
|
|
2997
|
+
this.message = message;
|
|
2998
|
+
if (!_IntlMessageFormat.__parse) {
|
|
2999
|
+
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3000
|
+
}
|
|
3001
|
+
this.ast = _IntlMessageFormat.__parse(message, {
|
|
3002
|
+
ignoreTag: opts?.ignoreTag,
|
|
3003
|
+
locale: this.resolvedLocale
|
|
3004
|
+
});
|
|
3005
|
+
} else {
|
|
3006
|
+
this.ast = message;
|
|
3007
|
+
}
|
|
3008
|
+
if (!Array.isArray(this.ast)) {
|
|
3009
|
+
throw new TypeError("A message must be provided as a String or AST.");
|
|
3010
|
+
}
|
|
3011
|
+
this.formats = mergeConfigs(_IntlMessageFormat.formats, overrideFormats);
|
|
3012
|
+
this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
|
|
3013
|
+
}
|
|
3014
|
+
format = (values) => {
|
|
3015
|
+
const parts = this.formatToParts(values);
|
|
3016
|
+
if (parts.length === 1) {
|
|
3017
|
+
return parts[0].value;
|
|
3018
|
+
}
|
|
3019
|
+
const result = parts.reduce((all, part) => {
|
|
3020
|
+
if (!all.length || part.type !== PART_TYPE.literal || typeof all[all.length - 1] !== "string") {
|
|
3021
|
+
all.push(part.value);
|
|
3022
|
+
} else {
|
|
3023
|
+
all[all.length - 1] += part.value;
|
|
3024
|
+
}
|
|
3025
|
+
return all;
|
|
3026
|
+
}, []);
|
|
3027
|
+
if (result.length <= 1) {
|
|
3028
|
+
return result[0] || "";
|
|
3029
|
+
}
|
|
3030
|
+
return result;
|
|
3031
|
+
};
|
|
3032
|
+
formatToParts = (values) => formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message);
|
|
3033
|
+
resolvedOptions = () => ({
|
|
3034
|
+
locale: this.resolvedLocale?.toString() || Intl.NumberFormat.supportedLocalesOf(this.locales)[0]
|
|
3035
|
+
});
|
|
3036
|
+
getAst = () => this.ast;
|
|
3037
|
+
static get defaultLocale() {
|
|
3038
|
+
if (!_IntlMessageFormat.memoizedDefaultLocale) {
|
|
3039
|
+
_IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
|
|
3040
|
+
}
|
|
3041
|
+
return _IntlMessageFormat.memoizedDefaultLocale;
|
|
3042
|
+
}
|
|
3043
|
+
};
|
|
3044
|
+
var IntlMessageFormat = _IntlMessageFormat;
|
|
3045
|
+
__publicField(IntlMessageFormat, "memoizedDefaultLocale", null);
|
|
3046
|
+
__publicField(IntlMessageFormat, "resolveLocale", (locales) => {
|
|
3047
|
+
if (typeof Intl.Locale === "undefined") {
|
|
3048
|
+
return;
|
|
3049
|
+
}
|
|
3050
|
+
const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
|
|
3051
|
+
if (supportedLocales.length > 0) {
|
|
3052
|
+
return new Intl.Locale(supportedLocales[0]);
|
|
3053
|
+
}
|
|
3054
|
+
return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
|
|
3055
|
+
});
|
|
3056
|
+
__publicField(IntlMessageFormat, "__parse", parse);
|
|
3057
|
+
__publicField(IntlMessageFormat, "formats", {
|
|
3058
|
+
number: {
|
|
3059
|
+
integer: {
|
|
3060
|
+
maximumFractionDigits: 0
|
|
3061
|
+
},
|
|
3062
|
+
currency: {
|
|
3063
|
+
style: "currency"
|
|
3064
|
+
},
|
|
3065
|
+
percent: {
|
|
3066
|
+
style: "percent"
|
|
3067
|
+
}
|
|
3068
|
+
},
|
|
3069
|
+
date: {
|
|
3070
|
+
short: {
|
|
3071
|
+
month: "numeric",
|
|
3072
|
+
day: "numeric",
|
|
3073
|
+
year: "2-digit"
|
|
3074
|
+
},
|
|
3075
|
+
medium: {
|
|
3076
|
+
month: "short",
|
|
3077
|
+
day: "numeric",
|
|
3078
|
+
year: "numeric"
|
|
3079
|
+
},
|
|
3080
|
+
long: {
|
|
3081
|
+
month: "long",
|
|
3082
|
+
day: "numeric",
|
|
3083
|
+
year: "numeric"
|
|
3084
|
+
},
|
|
3085
|
+
full: {
|
|
3086
|
+
weekday: "long",
|
|
3087
|
+
month: "long",
|
|
3088
|
+
day: "numeric",
|
|
3089
|
+
year: "numeric"
|
|
3090
|
+
}
|
|
3091
|
+
},
|
|
3092
|
+
time: {
|
|
3093
|
+
short: {
|
|
3094
|
+
hour: "numeric",
|
|
3095
|
+
minute: "numeric"
|
|
3096
|
+
},
|
|
3097
|
+
medium: {
|
|
3098
|
+
hour: "numeric",
|
|
3099
|
+
minute: "numeric",
|
|
3100
|
+
second: "numeric"
|
|
3101
|
+
},
|
|
3102
|
+
long: {
|
|
3103
|
+
hour: "numeric",
|
|
3104
|
+
minute: "numeric",
|
|
3105
|
+
second: "numeric",
|
|
3106
|
+
timeZoneName: "short"
|
|
3107
|
+
},
|
|
3108
|
+
full: {
|
|
3109
|
+
hour: "numeric",
|
|
3110
|
+
minute: "numeric",
|
|
3111
|
+
second: "numeric",
|
|
3112
|
+
timeZoneName: "short"
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
});
|
|
3116
|
+
|
|
3117
|
+
// ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-messageformat/lib_esnext/index.js
|
|
3118
|
+
var lib_esnext_default = IntlMessageFormat;
|
|
3119
|
+
export {
|
|
3120
|
+
ErrorCode,
|
|
3121
|
+
FormatError,
|
|
3122
|
+
IntlMessageFormat,
|
|
3123
|
+
InvalidValueError,
|
|
3124
|
+
InvalidValueTypeError,
|
|
3125
|
+
MissingValueError,
|
|
3126
|
+
PART_TYPE,
|
|
3127
|
+
lib_esnext_default as default,
|
|
3128
|
+
formatToParts,
|
|
3129
|
+
isFormatXMLElementFn
|
|
3130
|
+
};
|
|
3131
|
+
//# sourceMappingURL=intl-messageformat.esm.js.map
|