intl-messageformat 10.6.0 → 10.7.1
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/intl-messageformat.esm.js +217 -173
- package/intl-messageformat.iife.js +384 -382
- package/lib/src/core.d.ts +2 -2
- package/lib/src/core.js +1 -1
- package/package.json +5 -5
- package/src/core.d.ts +2 -2
- package/src/core.js +1 -1
- package/src/formatters.js +3 -3
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
var IntlMessageFormat = (() => {
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __objRest = (source, exclude) => {
|
|
24
|
+
var target = {};
|
|
25
|
+
for (var prop in source)
|
|
26
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
+
target[prop] = source[prop];
|
|
28
|
+
if (source != null && __getOwnPropSymbols)
|
|
29
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
+
target[prop] = source[prop];
|
|
32
|
+
}
|
|
33
|
+
return target;
|
|
34
|
+
};
|
|
6
35
|
var __export = (target, all) => {
|
|
7
36
|
for (var name in all)
|
|
8
37
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -16,10 +45,14 @@ var IntlMessageFormat = (() => {
|
|
|
16
45
|
return to;
|
|
17
46
|
};
|
|
18
47
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
48
|
+
var __publicField = (obj, key, value) => {
|
|
49
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
50
|
+
return value;
|
|
51
|
+
};
|
|
19
52
|
|
|
20
|
-
//
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
53
|
+
// packages/intl-messageformat/index.ts
|
|
54
|
+
var intl_messageformat_exports = {};
|
|
55
|
+
__export(intl_messageformat_exports, {
|
|
23
56
|
ErrorCode: () => ErrorCode,
|
|
24
57
|
FormatError: () => FormatError,
|
|
25
58
|
IntlMessageFormat: () => IntlMessageFormat,
|
|
@@ -27,68 +60,12 @@ var IntlMessageFormat = (() => {
|
|
|
27
60
|
InvalidValueTypeError: () => InvalidValueTypeError,
|
|
28
61
|
MissingValueError: () => MissingValueError,
|
|
29
62
|
PART_TYPE: () => PART_TYPE,
|
|
30
|
-
default: () =>
|
|
63
|
+
default: () => intl_messageformat_default,
|
|
31
64
|
formatToParts: () => formatToParts,
|
|
32
65
|
isFormatXMLElementFn: () => isFormatXMLElementFn
|
|
33
66
|
});
|
|
34
67
|
|
|
35
|
-
//
|
|
36
|
-
var extendStatics = function(d, b) {
|
|
37
|
-
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
|
|
38
|
-
d2.__proto__ = b2;
|
|
39
|
-
} || function(d2, b2) {
|
|
40
|
-
for (var p in b2)
|
|
41
|
-
if (Object.prototype.hasOwnProperty.call(b2, p))
|
|
42
|
-
d2[p] = b2[p];
|
|
43
|
-
};
|
|
44
|
-
return extendStatics(d, b);
|
|
45
|
-
};
|
|
46
|
-
function __extends(d, b) {
|
|
47
|
-
if (typeof b !== "function" && b !== null)
|
|
48
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
49
|
-
extendStatics(d, b);
|
|
50
|
-
function __() {
|
|
51
|
-
this.constructor = d;
|
|
52
|
-
}
|
|
53
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
54
|
-
}
|
|
55
|
-
var __assign = function() {
|
|
56
|
-
__assign = Object.assign || function __assign2(t) {
|
|
57
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
58
|
-
s = arguments[i];
|
|
59
|
-
for (var p in s)
|
|
60
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
61
|
-
t[p] = s[p];
|
|
62
|
-
}
|
|
63
|
-
return t;
|
|
64
|
-
};
|
|
65
|
-
return __assign.apply(this, arguments);
|
|
66
|
-
};
|
|
67
|
-
function __rest(s, e) {
|
|
68
|
-
var t = {};
|
|
69
|
-
for (var p in s)
|
|
70
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
71
|
-
t[p] = s[p];
|
|
72
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
73
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
74
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
75
|
-
t[p[i]] = s[p[i]];
|
|
76
|
-
}
|
|
77
|
-
return t;
|
|
78
|
-
}
|
|
79
|
-
function __spreadArray(to, from, pack) {
|
|
80
|
-
if (pack || arguments.length === 2)
|
|
81
|
-
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
82
|
-
if (ar || !(i in from)) {
|
|
83
|
-
if (!ar)
|
|
84
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
85
|
-
ar[i] = from[i];
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
68
|
+
// node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/lib/index.js
|
|
92
69
|
function memoize(fn, options) {
|
|
93
70
|
var cache = options && options.cache ? options.cache : cacheDefault;
|
|
94
71
|
var serializer = options && options.serializer ? options.serializer : serializerDefault;
|
|
@@ -155,7 +132,21 @@ var IntlMessageFormat = (() => {
|
|
|
155
132
|
monadic: strategyMonadic
|
|
156
133
|
};
|
|
157
134
|
|
|
158
|
-
//
|
|
135
|
+
// node_modules/.aspect_rules_js/tslib@2.8.0/node_modules/tslib/tslib.es6.mjs
|
|
136
|
+
var __assign = function() {
|
|
137
|
+
__assign = Object.assign || function __assign2(t) {
|
|
138
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
139
|
+
s = arguments[i];
|
|
140
|
+
for (var p in s)
|
|
141
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
142
|
+
t[p] = s[p];
|
|
143
|
+
}
|
|
144
|
+
return t;
|
|
145
|
+
};
|
|
146
|
+
return __assign.apply(this, arguments);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/error.js
|
|
159
150
|
var ErrorKind;
|
|
160
151
|
(function(ErrorKind2) {
|
|
161
152
|
ErrorKind2[ErrorKind2["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE";
|
|
@@ -186,7 +177,7 @@ var IntlMessageFormat = (() => {
|
|
|
186
177
|
ErrorKind2[ErrorKind2["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG";
|
|
187
178
|
})(ErrorKind || (ErrorKind = {}));
|
|
188
179
|
|
|
189
|
-
//
|
|
180
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/types.js
|
|
190
181
|
var TYPE;
|
|
191
182
|
(function(TYPE2) {
|
|
192
183
|
TYPE2[TYPE2["literal"] = 0] = "literal";
|
|
@@ -238,10 +229,10 @@ var IntlMessageFormat = (() => {
|
|
|
238
229
|
return !!(el && typeof el === "object" && el.type === SKELETON_TYPE.dateTime);
|
|
239
230
|
}
|
|
240
231
|
|
|
241
|
-
//
|
|
232
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js
|
|
242
233
|
var SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
243
234
|
|
|
244
|
-
//
|
|
235
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js
|
|
245
236
|
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;
|
|
246
237
|
function parseDateTimeSkeleton(skeleton) {
|
|
247
238
|
var result = {};
|
|
@@ -342,10 +333,10 @@ var IntlMessageFormat = (() => {
|
|
|
342
333
|
return result;
|
|
343
334
|
}
|
|
344
335
|
|
|
345
|
-
//
|
|
336
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js
|
|
346
337
|
var WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i;
|
|
347
338
|
|
|
348
|
-
//
|
|
339
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-skeleton-parser@0.0.0/node_modules/@formatjs/icu-skeleton-parser/lib/number.js
|
|
349
340
|
function parseNumberSkeletonFromString(skeleton) {
|
|
350
341
|
if (skeleton.length === 0) {
|
|
351
342
|
throw new Error("Number skeleton cannot be empty");
|
|
@@ -632,12 +623,18 @@ var IntlMessageFormat = (() => {
|
|
|
632
623
|
return result;
|
|
633
624
|
}
|
|
634
625
|
|
|
635
|
-
//
|
|
626
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js
|
|
636
627
|
var timeData = {
|
|
637
628
|
"001": [
|
|
638
629
|
"H",
|
|
639
630
|
"h"
|
|
640
631
|
],
|
|
632
|
+
"419": [
|
|
633
|
+
"h",
|
|
634
|
+
"H",
|
|
635
|
+
"hB",
|
|
636
|
+
"hb"
|
|
637
|
+
],
|
|
641
638
|
"AC": [
|
|
642
639
|
"H",
|
|
643
640
|
"h",
|
|
@@ -686,8 +683,8 @@ var IntlMessageFormat = (() => {
|
|
|
686
683
|
"hB"
|
|
687
684
|
],
|
|
688
685
|
"AR": [
|
|
689
|
-
"H",
|
|
690
686
|
"h",
|
|
687
|
+
"H",
|
|
691
688
|
"hB",
|
|
692
689
|
"hb"
|
|
693
690
|
],
|
|
@@ -777,9 +774,9 @@ var IntlMessageFormat = (() => {
|
|
|
777
774
|
"H"
|
|
778
775
|
],
|
|
779
776
|
"BO": [
|
|
777
|
+
"h",
|
|
780
778
|
"H",
|
|
781
779
|
"hB",
|
|
782
|
-
"h",
|
|
783
780
|
"hb"
|
|
784
781
|
],
|
|
785
782
|
"BQ": [
|
|
@@ -856,8 +853,8 @@ var IntlMessageFormat = (() => {
|
|
|
856
853
|
"hB"
|
|
857
854
|
],
|
|
858
855
|
"CL": [
|
|
859
|
-
"H",
|
|
860
856
|
"h",
|
|
857
|
+
"H",
|
|
861
858
|
"hB",
|
|
862
859
|
"hb"
|
|
863
860
|
],
|
|
@@ -882,14 +879,14 @@ var IntlMessageFormat = (() => {
|
|
|
882
879
|
"H"
|
|
883
880
|
],
|
|
884
881
|
"CR": [
|
|
885
|
-
"H",
|
|
886
882
|
"h",
|
|
883
|
+
"H",
|
|
887
884
|
"hB",
|
|
888
885
|
"hb"
|
|
889
886
|
],
|
|
890
887
|
"CU": [
|
|
891
|
-
"H",
|
|
892
888
|
"h",
|
|
889
|
+
"H",
|
|
893
890
|
"hB",
|
|
894
891
|
"hb"
|
|
895
892
|
],
|
|
@@ -958,9 +955,9 @@ var IntlMessageFormat = (() => {
|
|
|
958
955
|
"hb"
|
|
959
956
|
],
|
|
960
957
|
"EC": [
|
|
958
|
+
"h",
|
|
961
959
|
"H",
|
|
962
960
|
"hB",
|
|
963
|
-
"h",
|
|
964
961
|
"hb"
|
|
965
962
|
],
|
|
966
963
|
"EE": [
|
|
@@ -1096,8 +1093,8 @@ var IntlMessageFormat = (() => {
|
|
|
1096
1093
|
"hB"
|
|
1097
1094
|
],
|
|
1098
1095
|
"GT": [
|
|
1099
|
-
"H",
|
|
1100
1096
|
"h",
|
|
1097
|
+
"H",
|
|
1101
1098
|
"hB",
|
|
1102
1099
|
"hb"
|
|
1103
1100
|
],
|
|
@@ -1124,8 +1121,8 @@ var IntlMessageFormat = (() => {
|
|
|
1124
1121
|
"H"
|
|
1125
1122
|
],
|
|
1126
1123
|
"HN": [
|
|
1127
|
-
"H",
|
|
1128
1124
|
"h",
|
|
1125
|
+
"H",
|
|
1129
1126
|
"hB",
|
|
1130
1127
|
"hb"
|
|
1131
1128
|
],
|
|
@@ -1439,8 +1436,8 @@ var IntlMessageFormat = (() => {
|
|
|
1439
1436
|
"hB"
|
|
1440
1437
|
],
|
|
1441
1438
|
"MX": [
|
|
1442
|
-
"H",
|
|
1443
1439
|
"h",
|
|
1440
|
+
"H",
|
|
1444
1441
|
"hB",
|
|
1445
1442
|
"hb"
|
|
1446
1443
|
],
|
|
@@ -1480,8 +1477,8 @@ var IntlMessageFormat = (() => {
|
|
|
1480
1477
|
"hB"
|
|
1481
1478
|
],
|
|
1482
1479
|
"NI": [
|
|
1483
|
-
"H",
|
|
1484
1480
|
"h",
|
|
1481
|
+
"H",
|
|
1485
1482
|
"hB",
|
|
1486
1483
|
"hb"
|
|
1487
1484
|
],
|
|
@@ -1529,9 +1526,9 @@ var IntlMessageFormat = (() => {
|
|
|
1529
1526
|
"hb"
|
|
1530
1527
|
],
|
|
1531
1528
|
"PE": [
|
|
1529
|
+
"h",
|
|
1532
1530
|
"H",
|
|
1533
1531
|
"hB",
|
|
1534
|
-
"h",
|
|
1535
1532
|
"hb"
|
|
1536
1533
|
],
|
|
1537
1534
|
"PF": [
|
|
@@ -1589,8 +1586,8 @@ var IntlMessageFormat = (() => {
|
|
|
1589
1586
|
"H"
|
|
1590
1587
|
],
|
|
1591
1588
|
"PY": [
|
|
1592
|
-
"H",
|
|
1593
1589
|
"h",
|
|
1590
|
+
"H",
|
|
1594
1591
|
"hB",
|
|
1595
1592
|
"hb"
|
|
1596
1593
|
],
|
|
@@ -1703,8 +1700,8 @@ var IntlMessageFormat = (() => {
|
|
|
1703
1700
|
"hB"
|
|
1704
1701
|
],
|
|
1705
1702
|
"SV": [
|
|
1706
|
-
"H",
|
|
1707
1703
|
"h",
|
|
1704
|
+
"H",
|
|
1708
1705
|
"hB",
|
|
1709
1706
|
"hb"
|
|
1710
1707
|
],
|
|
@@ -1826,8 +1823,8 @@ var IntlMessageFormat = (() => {
|
|
|
1826
1823
|
"hB"
|
|
1827
1824
|
],
|
|
1828
1825
|
"UY": [
|
|
1829
|
-
"H",
|
|
1830
1826
|
"h",
|
|
1827
|
+
"H",
|
|
1831
1828
|
"hB",
|
|
1832
1829
|
"hb"
|
|
1833
1830
|
],
|
|
@@ -1935,24 +1932,12 @@ var IntlMessageFormat = (() => {
|
|
|
1935
1932
|
"H",
|
|
1936
1933
|
"hB"
|
|
1937
1934
|
],
|
|
1938
|
-
"es-BO": [
|
|
1939
|
-
"H",
|
|
1940
|
-
"h",
|
|
1941
|
-
"hB",
|
|
1942
|
-
"hb"
|
|
1943
|
-
],
|
|
1944
1935
|
"es-BR": [
|
|
1945
1936
|
"H",
|
|
1946
1937
|
"h",
|
|
1947
1938
|
"hB",
|
|
1948
1939
|
"hb"
|
|
1949
1940
|
],
|
|
1950
|
-
"es-EC": [
|
|
1951
|
-
"H",
|
|
1952
|
-
"h",
|
|
1953
|
-
"hB",
|
|
1954
|
-
"hb"
|
|
1955
|
-
],
|
|
1956
1941
|
"es-ES": [
|
|
1957
1942
|
"H",
|
|
1958
1943
|
"h",
|
|
@@ -1965,12 +1950,6 @@ var IntlMessageFormat = (() => {
|
|
|
1965
1950
|
"hB",
|
|
1966
1951
|
"hb"
|
|
1967
1952
|
],
|
|
1968
|
-
"es-PE": [
|
|
1969
|
-
"H",
|
|
1970
|
-
"h",
|
|
1971
|
-
"hB",
|
|
1972
|
-
"hb"
|
|
1973
|
-
],
|
|
1974
1953
|
"fr-CA": [
|
|
1975
1954
|
"H",
|
|
1976
1955
|
"h",
|
|
@@ -2043,7 +2022,7 @@ var IntlMessageFormat = (() => {
|
|
|
2043
2022
|
]
|
|
2044
2023
|
};
|
|
2045
2024
|
|
|
2046
|
-
//
|
|
2025
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js
|
|
2047
2026
|
function getBestPattern(skeleton, locale) {
|
|
2048
2027
|
var skeletonCopy = "";
|
|
2049
2028
|
for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {
|
|
@@ -2105,7 +2084,7 @@ var IntlMessageFormat = (() => {
|
|
|
2105
2084
|
return hourCycles[0];
|
|
2106
2085
|
}
|
|
2107
2086
|
|
|
2108
|
-
//
|
|
2087
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/parser.js
|
|
2109
2088
|
var _a;
|
|
2110
2089
|
var SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*"));
|
|
2111
2090
|
var SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$"));
|
|
@@ -2910,7 +2889,7 @@ var IntlMessageFormat = (() => {
|
|
|
2910
2889
|
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;
|
|
2911
2890
|
}
|
|
2912
2891
|
|
|
2913
|
-
//
|
|
2892
|
+
// node_modules/.aspect_rules_js/@formatjs+icu-messageformat-parser@0.0.0/node_modules/@formatjs/icu-messageformat-parser/lib/index.js
|
|
2914
2893
|
function pruneLocation(els) {
|
|
2915
2894
|
els.forEach(function(el) {
|
|
2916
2895
|
delete el.location;
|
|
@@ -2946,73 +2925,75 @@ var IntlMessageFormat = (() => {
|
|
|
2946
2925
|
return result.val;
|
|
2947
2926
|
}
|
|
2948
2927
|
|
|
2949
|
-
//
|
|
2950
|
-
var ErrorCode
|
|
2951
|
-
(function(ErrorCode2) {
|
|
2928
|
+
// packages/intl-messageformat/src/error.ts
|
|
2929
|
+
var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
|
|
2952
2930
|
ErrorCode2["MISSING_VALUE"] = "MISSING_VALUE";
|
|
2953
2931
|
ErrorCode2["INVALID_VALUE"] = "INVALID_VALUE";
|
|
2954
2932
|
ErrorCode2["MISSING_INTL_API"] = "MISSING_INTL_API";
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
2933
|
+
return ErrorCode2;
|
|
2934
|
+
})(ErrorCode || {});
|
|
2935
|
+
var FormatError = class extends Error {
|
|
2936
|
+
constructor(msg, code, originalMessage) {
|
|
2937
|
+
super(msg);
|
|
2938
|
+
__publicField(this, "code");
|
|
2939
|
+
/**
|
|
2940
|
+
* Original message we're trying to format
|
|
2941
|
+
* `undefined` if we're only dealing w/ AST
|
|
2942
|
+
*
|
|
2943
|
+
* @type {(string | undefined)}
|
|
2944
|
+
* @memberof FormatError
|
|
2945
|
+
*/
|
|
2946
|
+
__publicField(this, "originalMessage");
|
|
2947
|
+
this.code = code;
|
|
2948
|
+
this.originalMessage = originalMessage;
|
|
2949
|
+
}
|
|
2950
|
+
toString() {
|
|
2951
|
+
return `[formatjs Error: ${this.code}] ${this.message}`;
|
|
2952
|
+
}
|
|
2953
|
+
};
|
|
2954
|
+
var InvalidValueError = class extends FormatError {
|
|
2955
|
+
constructor(variableId, value, options, originalMessage) {
|
|
2956
|
+
super(
|
|
2957
|
+
`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(
|
|
2958
|
+
options
|
|
2959
|
+
).join('", "')}"`,
|
|
2960
|
+
"INVALID_VALUE" /* INVALID_VALUE */,
|
|
2961
|
+
originalMessage
|
|
2962
|
+
);
|
|
2963
|
+
}
|
|
2964
|
+
};
|
|
2965
|
+
var InvalidValueTypeError = class extends FormatError {
|
|
2966
|
+
constructor(value, type, originalMessage) {
|
|
2967
|
+
super(
|
|
2968
|
+
`Value for "${value}" must be of type ${type}`,
|
|
2969
|
+
"INVALID_VALUE" /* INVALID_VALUE */,
|
|
2970
|
+
originalMessage
|
|
2971
|
+
);
|
|
2972
|
+
}
|
|
2973
|
+
};
|
|
2974
|
+
var MissingValueError = class extends FormatError {
|
|
2975
|
+
constructor(variableId, originalMessage) {
|
|
2976
|
+
super(
|
|
2977
|
+
`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`,
|
|
2978
|
+
"MISSING_VALUE" /* MISSING_VALUE */,
|
|
2979
|
+
originalMessage
|
|
2980
|
+
);
|
|
2981
|
+
}
|
|
2982
|
+
};
|
|
3002
2983
|
|
|
3003
|
-
//
|
|
3004
|
-
var PART_TYPE
|
|
3005
|
-
(function(PART_TYPE2) {
|
|
2984
|
+
// packages/intl-messageformat/src/formatters.ts
|
|
2985
|
+
var PART_TYPE = /* @__PURE__ */ ((PART_TYPE2) => {
|
|
3006
2986
|
PART_TYPE2[PART_TYPE2["literal"] = 0] = "literal";
|
|
3007
2987
|
PART_TYPE2[PART_TYPE2["object"] = 1] = "object";
|
|
3008
|
-
|
|
2988
|
+
return PART_TYPE2;
|
|
2989
|
+
})(PART_TYPE || {});
|
|
3009
2990
|
function mergeLiteral(parts) {
|
|
3010
2991
|
if (parts.length < 2) {
|
|
3011
2992
|
return parts;
|
|
3012
2993
|
}
|
|
3013
|
-
return parts.reduce(
|
|
3014
|
-
|
|
3015
|
-
if (!lastPart || lastPart.type !==
|
|
2994
|
+
return parts.reduce((all, part) => {
|
|
2995
|
+
const lastPart = all[all.length - 1];
|
|
2996
|
+
if (!lastPart || lastPart.type !== 0 /* literal */ || part.type !== 0 /* literal */) {
|
|
3016
2997
|
all.push(part);
|
|
3017
2998
|
} else {
|
|
3018
2999
|
lastPart.value += part.value;
|
|
@@ -3027,17 +3008,16 @@ var IntlMessageFormat = (() => {
|
|
|
3027
3008
|
if (els.length === 1 && isLiteralElement(els[0])) {
|
|
3028
3009
|
return [
|
|
3029
3010
|
{
|
|
3030
|
-
type:
|
|
3011
|
+
type: 0 /* literal */,
|
|
3031
3012
|
value: els[0].value
|
|
3032
3013
|
}
|
|
3033
3014
|
];
|
|
3034
3015
|
}
|
|
3035
|
-
|
|
3036
|
-
for (
|
|
3037
|
-
var el = els_1[_i];
|
|
3016
|
+
const result = [];
|
|
3017
|
+
for (const el of els) {
|
|
3038
3018
|
if (isLiteralElement(el)) {
|
|
3039
3019
|
result.push({
|
|
3040
|
-
type:
|
|
3020
|
+
type: 0 /* literal */,
|
|
3041
3021
|
value: el.value
|
|
3042
3022
|
});
|
|
3043
3023
|
continue;
|
|
@@ -3045,108 +3025,142 @@ var IntlMessageFormat = (() => {
|
|
|
3045
3025
|
if (isPoundElement(el)) {
|
|
3046
3026
|
if (typeof currentPluralValue === "number") {
|
|
3047
3027
|
result.push({
|
|
3048
|
-
type:
|
|
3028
|
+
type: 0 /* literal */,
|
|
3049
3029
|
value: formatters.getNumberFormat(locales).format(currentPluralValue)
|
|
3050
3030
|
});
|
|
3051
3031
|
}
|
|
3052
3032
|
continue;
|
|
3053
3033
|
}
|
|
3054
|
-
|
|
3034
|
+
const { value: varName } = el;
|
|
3055
3035
|
if (!(values && varName in values)) {
|
|
3056
3036
|
throw new MissingValueError(varName, originalMessage);
|
|
3057
3037
|
}
|
|
3058
|
-
|
|
3038
|
+
let value = values[varName];
|
|
3059
3039
|
if (isArgumentElement(el)) {
|
|
3060
3040
|
if (!value || typeof value === "string" || typeof value === "number") {
|
|
3061
3041
|
value = typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
3062
3042
|
}
|
|
3063
3043
|
result.push({
|
|
3064
|
-
type: typeof value === "string" ?
|
|
3044
|
+
type: typeof value === "string" ? 0 /* literal */ : 1 /* object */,
|
|
3065
3045
|
value
|
|
3066
3046
|
});
|
|
3067
3047
|
continue;
|
|
3068
3048
|
}
|
|
3069
3049
|
if (isDateElement(el)) {
|
|
3070
|
-
|
|
3050
|
+
const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
3071
3051
|
result.push({
|
|
3072
|
-
type:
|
|
3052
|
+
type: 0 /* literal */,
|
|
3073
3053
|
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
3074
3054
|
});
|
|
3075
3055
|
continue;
|
|
3076
3056
|
}
|
|
3077
3057
|
if (isTimeElement(el)) {
|
|
3078
|
-
|
|
3058
|
+
const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium;
|
|
3079
3059
|
result.push({
|
|
3080
|
-
type:
|
|
3060
|
+
type: 0 /* literal */,
|
|
3081
3061
|
value: formatters.getDateTimeFormat(locales, style).format(value)
|
|
3082
3062
|
});
|
|
3083
3063
|
continue;
|
|
3084
3064
|
}
|
|
3085
3065
|
if (isNumberElement(el)) {
|
|
3086
|
-
|
|
3066
|
+
const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0;
|
|
3087
3067
|
if (style && style.scale) {
|
|
3088
3068
|
value = value * (style.scale || 1);
|
|
3089
3069
|
}
|
|
3090
3070
|
result.push({
|
|
3091
|
-
type:
|
|
3071
|
+
type: 0 /* literal */,
|
|
3092
3072
|
value: formatters.getNumberFormat(locales, style).format(value)
|
|
3093
3073
|
});
|
|
3094
3074
|
continue;
|
|
3095
3075
|
}
|
|
3096
3076
|
if (isTagElement(el)) {
|
|
3097
|
-
|
|
3098
|
-
|
|
3077
|
+
const { children, value: value2 } = el;
|
|
3078
|
+
const formatFn = values[value2];
|
|
3099
3079
|
if (!isFormatXMLElementFn(formatFn)) {
|
|
3100
|
-
throw new InvalidValueTypeError(
|
|
3101
|
-
}
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3080
|
+
throw new InvalidValueTypeError(value2, "function", originalMessage);
|
|
3081
|
+
}
|
|
3082
|
+
const parts = formatToParts(
|
|
3083
|
+
children,
|
|
3084
|
+
locales,
|
|
3085
|
+
formatters,
|
|
3086
|
+
formats,
|
|
3087
|
+
values,
|
|
3088
|
+
currentPluralValue
|
|
3089
|
+
);
|
|
3090
|
+
let chunks = formatFn(parts.map((p) => p.value));
|
|
3106
3091
|
if (!Array.isArray(chunks)) {
|
|
3107
3092
|
chunks = [chunks];
|
|
3108
3093
|
}
|
|
3109
|
-
result.push
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3094
|
+
result.push(
|
|
3095
|
+
...chunks.map((c) => {
|
|
3096
|
+
return {
|
|
3097
|
+
type: typeof c === "string" ? 0 /* literal */ : 1 /* object */,
|
|
3098
|
+
value: c
|
|
3099
|
+
};
|
|
3100
|
+
})
|
|
3101
|
+
);
|
|
3115
3102
|
}
|
|
3116
3103
|
if (isSelectElement(el)) {
|
|
3117
|
-
|
|
3104
|
+
const opt = el.options[value] || el.options.other;
|
|
3118
3105
|
if (!opt) {
|
|
3119
|
-
throw new InvalidValueError(
|
|
3120
|
-
|
|
3121
|
-
|
|
3106
|
+
throw new InvalidValueError(
|
|
3107
|
+
el.value,
|
|
3108
|
+
value,
|
|
3109
|
+
Object.keys(el.options),
|
|
3110
|
+
originalMessage
|
|
3111
|
+
);
|
|
3112
|
+
}
|
|
3113
|
+
result.push(
|
|
3114
|
+
...formatToParts(opt.value, locales, formatters, formats, values)
|
|
3115
|
+
);
|
|
3122
3116
|
continue;
|
|
3123
3117
|
}
|
|
3124
3118
|
if (isPluralElement(el)) {
|
|
3125
|
-
|
|
3119
|
+
let opt = el.options[`=${value}`];
|
|
3126
3120
|
if (!opt) {
|
|
3127
3121
|
if (!Intl.PluralRules) {
|
|
3128
|
-
throw new FormatError(
|
|
3122
|
+
throw new FormatError(
|
|
3123
|
+
`Intl.PluralRules is not available in this environment.
|
|
3124
|
+
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
3125
|
+
`,
|
|
3126
|
+
"MISSING_INTL_API" /* MISSING_INTL_API */,
|
|
3127
|
+
originalMessage
|
|
3128
|
+
);
|
|
3129
3129
|
}
|
|
3130
|
-
|
|
3130
|
+
const rule = formatters.getPluralRules(locales, { type: el.pluralType }).select(value - (el.offset || 0));
|
|
3131
3131
|
opt = el.options[rule] || el.options.other;
|
|
3132
3132
|
}
|
|
3133
3133
|
if (!opt) {
|
|
3134
|
-
throw new InvalidValueError(
|
|
3135
|
-
|
|
3136
|
-
|
|
3134
|
+
throw new InvalidValueError(
|
|
3135
|
+
el.value,
|
|
3136
|
+
value,
|
|
3137
|
+
Object.keys(el.options),
|
|
3138
|
+
originalMessage
|
|
3139
|
+
);
|
|
3140
|
+
}
|
|
3141
|
+
result.push(
|
|
3142
|
+
...formatToParts(
|
|
3143
|
+
opt.value,
|
|
3144
|
+
locales,
|
|
3145
|
+
formatters,
|
|
3146
|
+
formats,
|
|
3147
|
+
values,
|
|
3148
|
+
value - (el.offset || 0)
|
|
3149
|
+
)
|
|
3150
|
+
);
|
|
3137
3151
|
continue;
|
|
3138
3152
|
}
|
|
3139
3153
|
}
|
|
3140
3154
|
return mergeLiteral(result);
|
|
3141
3155
|
}
|
|
3142
3156
|
|
|
3143
|
-
//
|
|
3157
|
+
// packages/intl-messageformat/src/core.ts
|
|
3144
3158
|
function mergeConfig(c1, c2) {
|
|
3145
3159
|
if (!c2) {
|
|
3146
3160
|
return c1;
|
|
3147
3161
|
}
|
|
3148
|
-
return
|
|
3149
|
-
all[k] =
|
|
3162
|
+
return __spreadValues(__spreadValues(__spreadValues({}, c1 || {}), c2 || {}), Object.keys(c1).reduce((all, k) => {
|
|
3163
|
+
all[k] = __spreadValues(__spreadValues({}, c1[k]), c2[k] || {});
|
|
3150
3164
|
return all;
|
|
3151
3165
|
}, {}));
|
|
3152
3166
|
}
|
|
@@ -3154,217 +3168,205 @@ var IntlMessageFormat = (() => {
|
|
|
3154
3168
|
if (!configs) {
|
|
3155
3169
|
return defaultConfig;
|
|
3156
3170
|
}
|
|
3157
|
-
return Object.keys(defaultConfig).reduce(
|
|
3158
|
-
all
|
|
3159
|
-
|
|
3160
|
-
|
|
3171
|
+
return Object.keys(defaultConfig).reduce(
|
|
3172
|
+
(all, k) => {
|
|
3173
|
+
all[k] = mergeConfig(defaultConfig[k], configs[k]);
|
|
3174
|
+
return all;
|
|
3175
|
+
},
|
|
3176
|
+
__spreadValues({}, defaultConfig)
|
|
3177
|
+
);
|
|
3161
3178
|
}
|
|
3162
3179
|
function createFastMemoizeCache(store) {
|
|
3163
3180
|
return {
|
|
3164
|
-
create
|
|
3181
|
+
create() {
|
|
3165
3182
|
return {
|
|
3166
|
-
get
|
|
3183
|
+
get(key) {
|
|
3167
3184
|
return store[key];
|
|
3168
3185
|
},
|
|
3169
|
-
set
|
|
3186
|
+
set(key, value) {
|
|
3170
3187
|
store[key] = value;
|
|
3171
3188
|
}
|
|
3172
3189
|
};
|
|
3173
3190
|
}
|
|
3174
3191
|
};
|
|
3175
3192
|
}
|
|
3176
|
-
function createDefaultFormatters(cache
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
pluralRules: {}
|
|
3182
|
-
};
|
|
3183
|
-
}
|
|
3193
|
+
function createDefaultFormatters(cache = {
|
|
3194
|
+
number: {},
|
|
3195
|
+
dateTime: {},
|
|
3196
|
+
pluralRules: {}
|
|
3197
|
+
}) {
|
|
3184
3198
|
return {
|
|
3185
|
-
getNumberFormat: memoize(
|
|
3186
|
-
var _a2;
|
|
3187
|
-
var args = [];
|
|
3188
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3189
|
-
args[_i] = arguments[_i];
|
|
3190
|
-
}
|
|
3191
|
-
return new ((_a2 = Intl.NumberFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3192
|
-
}, {
|
|
3199
|
+
getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), {
|
|
3193
3200
|
cache: createFastMemoizeCache(cache.number),
|
|
3194
3201
|
strategy: strategies.variadic
|
|
3195
3202
|
}),
|
|
3196
|
-
getDateTimeFormat: memoize(
|
|
3197
|
-
var _a2;
|
|
3198
|
-
var args = [];
|
|
3199
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3200
|
-
args[_i] = arguments[_i];
|
|
3201
|
-
}
|
|
3202
|
-
return new ((_a2 = Intl.DateTimeFormat).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3203
|
-
}, {
|
|
3203
|
+
getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), {
|
|
3204
3204
|
cache: createFastMemoizeCache(cache.dateTime),
|
|
3205
3205
|
strategy: strategies.variadic
|
|
3206
3206
|
}),
|
|
3207
|
-
getPluralRules: memoize(
|
|
3208
|
-
var _a2;
|
|
3209
|
-
var args = [];
|
|
3210
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
3211
|
-
args[_i] = arguments[_i];
|
|
3212
|
-
}
|
|
3213
|
-
return new ((_a2 = Intl.PluralRules).bind.apply(_a2, __spreadArray([void 0], args, false)))();
|
|
3214
|
-
}, {
|
|
3207
|
+
getPluralRules: memoize((...args) => new Intl.PluralRules(...args), {
|
|
3215
3208
|
cache: createFastMemoizeCache(cache.pluralRules),
|
|
3216
3209
|
strategy: strategies.variadic
|
|
3217
3210
|
})
|
|
3218
3211
|
};
|
|
3219
3212
|
}
|
|
3220
|
-
var
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3213
|
+
var _IntlMessageFormat = class _IntlMessageFormat {
|
|
3214
|
+
constructor(message, locales = _IntlMessageFormat.defaultLocale, overrideFormats, opts) {
|
|
3215
|
+
__publicField(this, "ast");
|
|
3216
|
+
__publicField(this, "locales");
|
|
3217
|
+
__publicField(this, "resolvedLocale");
|
|
3218
|
+
__publicField(this, "formatters");
|
|
3219
|
+
__publicField(this, "formats");
|
|
3220
|
+
__publicField(this, "message");
|
|
3221
|
+
__publicField(this, "formatterCache", {
|
|
3222
|
+
number: {},
|
|
3223
|
+
dateTime: {},
|
|
3224
|
+
pluralRules: {}
|
|
3225
|
+
});
|
|
3226
|
+
__publicField(this, "format", (values) => {
|
|
3227
|
+
const parts = this.formatToParts(values);
|
|
3228
|
+
if (parts.length === 1) {
|
|
3229
|
+
return parts[0].value;
|
|
3230
|
+
}
|
|
3231
|
+
const result = parts.reduce(
|
|
3232
|
+
(all, part) => {
|
|
3233
|
+
if (!all.length || part.type !== 0 /* literal */ || typeof all[all.length - 1] !== "string") {
|
|
3240
3234
|
all.push(part.value);
|
|
3241
3235
|
} else {
|
|
3242
3236
|
all[all.length - 1] += part.value;
|
|
3243
3237
|
}
|
|
3244
3238
|
return all;
|
|
3245
|
-
}, []);
|
|
3246
|
-
if (result.length <= 1) {
|
|
3247
|
-
return result[0] || "";
|
|
3248
|
-
}
|
|
3249
|
-
return result;
|
|
3250
|
-
};
|
|
3251
|
-
this.formatToParts = function(values) {
|
|
3252
|
-
return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, void 0, _this.message);
|
|
3253
|
-
};
|
|
3254
|
-
this.resolvedOptions = function() {
|
|
3255
|
-
var _a3;
|
|
3256
|
-
return {
|
|
3257
|
-
locale: ((_a3 = _this.resolvedLocale) === null || _a3 === void 0 ? void 0 : _a3.toString()) || Intl.NumberFormat.supportedLocalesOf(_this.locales)[0]
|
|
3258
|
-
};
|
|
3259
|
-
};
|
|
3260
|
-
this.getAst = function() {
|
|
3261
|
-
return _this.ast;
|
|
3262
|
-
};
|
|
3263
|
-
this.locales = locales;
|
|
3264
|
-
this.resolvedLocale = IntlMessageFormat2.resolveLocale(locales);
|
|
3265
|
-
if (typeof message === "string") {
|
|
3266
|
-
this.message = message;
|
|
3267
|
-
if (!IntlMessageFormat2.__parse) {
|
|
3268
|
-
throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");
|
|
3269
|
-
}
|
|
3270
|
-
var _a2 = opts || {}, formatters = _a2.formatters, parseOpts = __rest(_a2, ["formatters"]);
|
|
3271
|
-
this.ast = IntlMessageFormat2.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale }));
|
|
3272
|
-
} else {
|
|
3273
|
-
this.ast = message;
|
|
3274
|
-
}
|
|
3275
|
-
if (!Array.isArray(this.ast)) {
|
|
3276
|
-
throw new TypeError("A message must be provided as a String or AST.");
|
|
3277
|
-
}
|
|
3278
|
-
this.formats = mergeConfigs(IntlMessageFormat2.formats, overrideFormats);
|
|
3279
|
-
this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
|
|
3280
|
-
}
|
|
3281
|
-
Object.defineProperty(IntlMessageFormat2, "defaultLocale", {
|
|
3282
|
-
get: function() {
|
|
3283
|
-
if (!IntlMessageFormat2.memoizedDefaultLocale) {
|
|
3284
|
-
IntlMessageFormat2.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
|
|
3285
|
-
}
|
|
3286
|
-
return IntlMessageFormat2.memoizedDefaultLocale;
|
|
3287
|
-
},
|
|
3288
|
-
enumerable: false,
|
|
3289
|
-
configurable: true
|
|
3290
|
-
});
|
|
3291
|
-
IntlMessageFormat2.memoizedDefaultLocale = null;
|
|
3292
|
-
IntlMessageFormat2.resolveLocale = function(locales) {
|
|
3293
|
-
if (typeof Intl.Locale === "undefined") {
|
|
3294
|
-
return;
|
|
3295
|
-
}
|
|
3296
|
-
var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
|
|
3297
|
-
if (supportedLocales.length > 0) {
|
|
3298
|
-
return new Intl.Locale(supportedLocales[0]);
|
|
3299
|
-
}
|
|
3300
|
-
return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
|
|
3301
|
-
};
|
|
3302
|
-
IntlMessageFormat2.__parse = parse;
|
|
3303
|
-
IntlMessageFormat2.formats = {
|
|
3304
|
-
number: {
|
|
3305
|
-
integer: {
|
|
3306
|
-
maximumFractionDigits: 0
|
|
3307
|
-
},
|
|
3308
|
-
currency: {
|
|
3309
|
-
style: "currency"
|
|
3310
|
-
},
|
|
3311
|
-
percent: {
|
|
3312
|
-
style: "percent"
|
|
3313
|
-
}
|
|
3314
|
-
},
|
|
3315
|
-
date: {
|
|
3316
|
-
short: {
|
|
3317
|
-
month: "numeric",
|
|
3318
|
-
day: "numeric",
|
|
3319
|
-
year: "2-digit"
|
|
3320
|
-
},
|
|
3321
|
-
medium: {
|
|
3322
|
-
month: "short",
|
|
3323
|
-
day: "numeric",
|
|
3324
|
-
year: "numeric"
|
|
3325
|
-
},
|
|
3326
|
-
long: {
|
|
3327
|
-
month: "long",
|
|
3328
|
-
day: "numeric",
|
|
3329
|
-
year: "numeric"
|
|
3330
3239
|
},
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
year: "numeric"
|
|
3336
|
-
}
|
|
3337
|
-
},
|
|
3338
|
-
time: {
|
|
3339
|
-
short: {
|
|
3340
|
-
hour: "numeric",
|
|
3341
|
-
minute: "numeric"
|
|
3342
|
-
},
|
|
3343
|
-
medium: {
|
|
3344
|
-
hour: "numeric",
|
|
3345
|
-
minute: "numeric",
|
|
3346
|
-
second: "numeric"
|
|
3347
|
-
},
|
|
3348
|
-
long: {
|
|
3349
|
-
hour: "numeric",
|
|
3350
|
-
minute: "numeric",
|
|
3351
|
-
second: "numeric",
|
|
3352
|
-
timeZoneName: "short"
|
|
3353
|
-
},
|
|
3354
|
-
full: {
|
|
3355
|
-
hour: "numeric",
|
|
3356
|
-
minute: "numeric",
|
|
3357
|
-
second: "numeric",
|
|
3358
|
-
timeZoneName: "short"
|
|
3359
|
-
}
|
|
3240
|
+
[]
|
|
3241
|
+
);
|
|
3242
|
+
if (result.length <= 1) {
|
|
3243
|
+
return result[0] || "";
|
|
3360
3244
|
}
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3245
|
+
return result;
|
|
3246
|
+
});
|
|
3247
|
+
__publicField(this, "formatToParts", (values) => formatToParts(
|
|
3248
|
+
this.ast,
|
|
3249
|
+
this.locales,
|
|
3250
|
+
this.formatters,
|
|
3251
|
+
this.formats,
|
|
3252
|
+
values,
|
|
3253
|
+
void 0,
|
|
3254
|
+
this.message
|
|
3255
|
+
));
|
|
3256
|
+
__publicField(this, "resolvedOptions", () => {
|
|
3257
|
+
var _a2;
|
|
3258
|
+
return {
|
|
3259
|
+
locale: ((_a2 = this.resolvedLocale) == null ? void 0 : _a2.toString()) || Intl.NumberFormat.supportedLocalesOf(this.locales)[0]
|
|
3260
|
+
};
|
|
3261
|
+
});
|
|
3262
|
+
__publicField(this, "getAst", () => this.ast);
|
|
3263
|
+
this.locales = locales;
|
|
3264
|
+
this.resolvedLocale = _IntlMessageFormat.resolveLocale(locales);
|
|
3265
|
+
if (typeof message === "string") {
|
|
3266
|
+
this.message = message;
|
|
3267
|
+
if (!_IntlMessageFormat.__parse) {
|
|
3268
|
+
throw new TypeError(
|
|
3269
|
+
"IntlMessageFormat.__parse must be set to process `message` of type `string`"
|
|
3270
|
+
);
|
|
3271
|
+
}
|
|
3272
|
+
const _a2 = opts || {}, { formatters } = _a2, parseOpts = __objRest(_a2, ["formatters"]);
|
|
3273
|
+
this.ast = _IntlMessageFormat.__parse(message, __spreadProps(__spreadValues({}, parseOpts), {
|
|
3274
|
+
locale: this.resolvedLocale
|
|
3275
|
+
}));
|
|
3276
|
+
} else {
|
|
3277
|
+
this.ast = message;
|
|
3278
|
+
}
|
|
3279
|
+
if (!Array.isArray(this.ast)) {
|
|
3280
|
+
throw new TypeError("A message must be provided as a String or AST.");
|
|
3281
|
+
}
|
|
3282
|
+
this.formats = mergeConfigs(_IntlMessageFormat.formats, overrideFormats);
|
|
3283
|
+
this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache);
|
|
3284
|
+
}
|
|
3285
|
+
static get defaultLocale() {
|
|
3286
|
+
if (!_IntlMessageFormat.memoizedDefaultLocale) {
|
|
3287
|
+
_IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
|
|
3288
|
+
}
|
|
3289
|
+
return _IntlMessageFormat.memoizedDefaultLocale;
|
|
3290
|
+
}
|
|
3291
|
+
};
|
|
3292
|
+
__publicField(_IntlMessageFormat, "memoizedDefaultLocale", null);
|
|
3293
|
+
__publicField(_IntlMessageFormat, "resolveLocale", (locales) => {
|
|
3294
|
+
if (typeof Intl.Locale === "undefined") {
|
|
3295
|
+
return;
|
|
3296
|
+
}
|
|
3297
|
+
const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);
|
|
3298
|
+
if (supportedLocales.length > 0) {
|
|
3299
|
+
return new Intl.Locale(supportedLocales[0]);
|
|
3300
|
+
}
|
|
3301
|
+
return new Intl.Locale(typeof locales === "string" ? locales : locales[0]);
|
|
3302
|
+
});
|
|
3303
|
+
__publicField(_IntlMessageFormat, "__parse", parse);
|
|
3304
|
+
// Default format options used as the prototype of the `formats` provided to the
|
|
3305
|
+
// constructor. These are used when constructing the internal Intl.NumberFormat
|
|
3306
|
+
// and Intl.DateTimeFormat instances.
|
|
3307
|
+
__publicField(_IntlMessageFormat, "formats", {
|
|
3308
|
+
number: {
|
|
3309
|
+
integer: {
|
|
3310
|
+
maximumFractionDigits: 0
|
|
3311
|
+
},
|
|
3312
|
+
currency: {
|
|
3313
|
+
style: "currency"
|
|
3314
|
+
},
|
|
3315
|
+
percent: {
|
|
3316
|
+
style: "percent"
|
|
3317
|
+
}
|
|
3318
|
+
},
|
|
3319
|
+
date: {
|
|
3320
|
+
short: {
|
|
3321
|
+
month: "numeric",
|
|
3322
|
+
day: "numeric",
|
|
3323
|
+
year: "2-digit"
|
|
3324
|
+
},
|
|
3325
|
+
medium: {
|
|
3326
|
+
month: "short",
|
|
3327
|
+
day: "numeric",
|
|
3328
|
+
year: "numeric"
|
|
3329
|
+
},
|
|
3330
|
+
long: {
|
|
3331
|
+
month: "long",
|
|
3332
|
+
day: "numeric",
|
|
3333
|
+
year: "numeric"
|
|
3334
|
+
},
|
|
3335
|
+
full: {
|
|
3336
|
+
weekday: "long",
|
|
3337
|
+
month: "long",
|
|
3338
|
+
day: "numeric",
|
|
3339
|
+
year: "numeric"
|
|
3340
|
+
}
|
|
3341
|
+
},
|
|
3342
|
+
time: {
|
|
3343
|
+
short: {
|
|
3344
|
+
hour: "numeric",
|
|
3345
|
+
minute: "numeric"
|
|
3346
|
+
},
|
|
3347
|
+
medium: {
|
|
3348
|
+
hour: "numeric",
|
|
3349
|
+
minute: "numeric",
|
|
3350
|
+
second: "numeric"
|
|
3351
|
+
},
|
|
3352
|
+
long: {
|
|
3353
|
+
hour: "numeric",
|
|
3354
|
+
minute: "numeric",
|
|
3355
|
+
second: "numeric",
|
|
3356
|
+
timeZoneName: "short"
|
|
3357
|
+
},
|
|
3358
|
+
full: {
|
|
3359
|
+
hour: "numeric",
|
|
3360
|
+
minute: "numeric",
|
|
3361
|
+
second: "numeric",
|
|
3362
|
+
timeZoneName: "short"
|
|
3363
|
+
}
|
|
3364
|
+
}
|
|
3365
|
+
});
|
|
3366
|
+
var IntlMessageFormat = _IntlMessageFormat;
|
|
3365
3367
|
|
|
3366
|
-
//
|
|
3367
|
-
var
|
|
3368
|
-
return __toCommonJS(
|
|
3368
|
+
// packages/intl-messageformat/index.ts
|
|
3369
|
+
var intl_messageformat_default = IntlMessageFormat;
|
|
3370
|
+
return __toCommonJS(intl_messageformat_exports);
|
|
3369
3371
|
})();
|
|
3370
3372
|
//# sourceMappingURL=intl-messageformat.iife.js.map
|