@formatjs/intl-supportedvaluesof 3.1.1 → 3.1.2
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/README.md +11 -3
- package/index.d.ts +5 -12
- package/index.js +943 -194
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/polyfill-force.js +1027 -210
- package/polyfill-force.js.map +1 -1
- package/polyfill.iife.js +1033 -216
- package/polyfill.js +1028 -211
- package/polyfill.js.map +1 -1
- package/should-polyfill.js +1 -1
- package/should-polyfill.js.map +1 -1
package/polyfill.iife.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// packages/intl-supportedvaluesof/should-polyfill.ts
|
|
2
2
|
function shouldPolyfill() {
|
|
3
|
-
return typeof Intl === "undefined" ||
|
|
3
|
+
return typeof Intl === "undefined" || typeof Intl.supportedValuesOf !== "function";
|
|
4
4
|
}
|
|
5
5
|
// packages/ecma262-abstract/ToString.js
|
|
6
6
|
const StringConstructor = String;
|
|
@@ -12,8 +12,45 @@ function ToString(o) {
|
|
|
12
12
|
if (typeof o === "symbol") throw TypeErrorConstructor("Cannot convert a Symbol value to a string");
|
|
13
13
|
return StringConstructor(o);
|
|
14
14
|
}
|
|
15
|
+
Number.isInteger;
|
|
16
|
+
Number.isFinite;
|
|
17
|
+
Number.isSafeInteger;
|
|
18
|
+
const RangeErrorConstructor = RangeError;
|
|
19
|
+
const arrayApply = Reflect.apply;
|
|
20
|
+
Array.prototype.every;
|
|
21
|
+
const some = Array.prototype.some;
|
|
22
|
+
function arraySome(values, predicate) {
|
|
23
|
+
return arrayApply(some, values, [predicate]);
|
|
24
|
+
}
|
|
25
|
+
Array.prototype.includes;
|
|
26
|
+
const indexOf = Array.prototype.indexOf;
|
|
27
|
+
function arrayIndexOf(values, search) {
|
|
28
|
+
return arrayApply(indexOf, values, [search]);
|
|
29
|
+
}
|
|
30
|
+
const defineProperty$2 = Object.defineProperty;
|
|
31
|
+
function setDataProperty(target, key, value) {
|
|
32
|
+
defineProperty$2(target, key, {
|
|
33
|
+
__proto__: null,
|
|
34
|
+
value,
|
|
35
|
+
writable: true,
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
// packages/intl-supportedvaluesof/supported-entries.ts
|
|
41
|
+
const apply$3 = Reflect.apply;
|
|
42
|
+
const sort = Array.prototype.sort;
|
|
43
|
+
function supportedEntries(candidates, supported) {
|
|
44
|
+
const result = [];
|
|
45
|
+
for (let index = 0; index < candidates.length; index++) {
|
|
46
|
+
const entry = candidates[index];
|
|
47
|
+
if (supported(entry)) setDataProperty(result, `${result.length}`, entry);
|
|
48
|
+
}
|
|
49
|
+
apply$3(sort, result, []);
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
15
52
|
// node_modules/.aspect_rules_js/@formatjs+fast-memoize@0.0.0/node_modules/@formatjs/fast-memoize/index.js
|
|
16
|
-
const apply = Reflect.apply;
|
|
53
|
+
const apply$2 = Reflect.apply;
|
|
17
54
|
const bind = Function.prototype.bind;
|
|
18
55
|
const slice = Array.prototype.slice;
|
|
19
56
|
const stringify = JSON.stringify;
|
|
@@ -35,24 +72,24 @@ function monadic(fn, cache, serializer, arg) {
|
|
|
35
72
|
const cacheKey = isPrimitive(arg) ? arg : serializer(arg);
|
|
36
73
|
let computedValue = cache.get(cacheKey);
|
|
37
74
|
if (typeof computedValue === "undefined") {
|
|
38
|
-
computedValue = apply(fn, this, [arg]);
|
|
75
|
+
computedValue = apply$2(fn, this, [arg]);
|
|
39
76
|
cache.set(cacheKey, computedValue);
|
|
40
77
|
}
|
|
41
78
|
return computedValue;
|
|
42
79
|
}
|
|
43
80
|
function variadic(fn, cache, serializer) {
|
|
44
|
-
const args = apply(slice, arguments, [3]);
|
|
81
|
+
const args = apply$2(slice, arguments, [3]);
|
|
45
82
|
if (serializer === serializerDefault) setPrototypeOf(args, null);
|
|
46
83
|
const cacheKey = serializer(args);
|
|
47
84
|
let computedValue = cache.get(cacheKey);
|
|
48
85
|
if (typeof computedValue === "undefined") {
|
|
49
|
-
computedValue = apply(fn, this, args);
|
|
86
|
+
computedValue = apply$2(fn, this, args);
|
|
50
87
|
cache.set(cacheKey, computedValue);
|
|
51
88
|
}
|
|
52
89
|
return computedValue;
|
|
53
90
|
}
|
|
54
91
|
function assemble(fn, context, strategy, cache, serialize) {
|
|
55
|
-
return apply(bind, strategy, [
|
|
92
|
+
return apply$2(bind, strategy, [
|
|
56
93
|
context,
|
|
57
94
|
fn,
|
|
58
95
|
cache,
|
|
@@ -98,15 +135,107 @@ const strategies = {
|
|
|
98
135
|
monadic: strategyMonadic
|
|
99
136
|
};
|
|
100
137
|
// packages/intl-supportedvaluesof/memoize.ts
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const
|
|
138
|
+
const descriptor = Object.getOwnPropertyDescriptor;
|
|
139
|
+
const getPrototypeOf = Object.getPrototypeOf;
|
|
140
|
+
const objectPrototype = Object.prototype;
|
|
141
|
+
const apply$1 = Reflect.apply;
|
|
142
|
+
const memoizeOptions = {
|
|
143
|
+
__proto__: null,
|
|
144
|
+
strategy: strategies.variadic
|
|
145
|
+
};
|
|
146
|
+
const availableCalendarsKey = Symbol.for("@formatjs/intl-datetimeformat/availableCalendars");
|
|
147
|
+
const hasTimeZoneKey = Symbol.for("@formatjs/intl-datetimeformat/hasTimeZone");
|
|
148
|
+
function ownValue(object, key) {
|
|
149
|
+
const property = descriptor(object, key);
|
|
150
|
+
return property && descriptor(property, "value")?.value;
|
|
151
|
+
}
|
|
152
|
+
function findProperty(owner, key) {
|
|
153
|
+
while (owner !== null && (typeof owner === "object" || typeof owner === "function") && owner !== objectPrototype) {
|
|
154
|
+
const property = descriptor(owner, key);
|
|
155
|
+
if (property) return property;
|
|
156
|
+
owner = getPrototypeOf(owner);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function resolvedOptions(Constructor) {
|
|
160
|
+
const property = findProperty(ownValue(Constructor, "prototype"), "resolvedOptions");
|
|
161
|
+
const method = property && ownValue(property, "value");
|
|
162
|
+
if (typeof method === "function") return (formatter) => apply$1(method, formatter, []);
|
|
163
|
+
}
|
|
164
|
+
let intl$1 = ownValue(globalThis, "Intl");
|
|
165
|
+
function retainProbe(name, createProbe) {
|
|
166
|
+
const probes = /* @__PURE__ */ new WeakMap();
|
|
167
|
+
const readProbe = probes.get.bind(probes);
|
|
168
|
+
const writeProbe = probes.set.bind(probes);
|
|
169
|
+
let currentProbe;
|
|
170
|
+
const getProbe = () => {
|
|
171
|
+
intl$1 ??= ownValue(globalThis, "Intl");
|
|
172
|
+
const property = intl$1 && descriptor(intl$1, name);
|
|
173
|
+
const data = property && descriptor(property, "value");
|
|
174
|
+
if (!data) return currentProbe;
|
|
175
|
+
const candidate = data.value;
|
|
176
|
+
if (typeof candidate !== "function") return void 0;
|
|
177
|
+
const Constructor = candidate;
|
|
178
|
+
let probe = readProbe(Constructor);
|
|
179
|
+
if (probe === void 0) {
|
|
180
|
+
probe = createProbe(Constructor);
|
|
181
|
+
writeProbe(Constructor, probe);
|
|
182
|
+
}
|
|
183
|
+
currentProbe = probe;
|
|
184
|
+
return probe;
|
|
185
|
+
};
|
|
186
|
+
getProbe();
|
|
187
|
+
return getProbe;
|
|
188
|
+
}
|
|
189
|
+
function memoizeHost(Constructor, construct) {
|
|
190
|
+
const marker = findProperty(Constructor, "polyfilled");
|
|
191
|
+
return marker && ownValue(marker, "value") ? construct : memoize(construct, memoizeOptions);
|
|
192
|
+
}
|
|
193
|
+
const getDateTimeFormatProbe = retainProbe("DateTimeFormat", (Constructor) => {
|
|
194
|
+
const availableCalendars = ownValue(Constructor, availableCalendarsKey);
|
|
195
|
+
const hasTimeZone = ownValue(Constructor, hasTimeZoneKey);
|
|
196
|
+
return {
|
|
197
|
+
create: memoizeHost(Constructor, (locales, options) => new Constructor(locales, options)),
|
|
198
|
+
resolve: resolvedOptions(Constructor),
|
|
199
|
+
availableCalendars: typeof availableCalendars === "function" ? () => apply$1(availableCalendars, Constructor, []) : void 0,
|
|
200
|
+
hasTimeZone: typeof hasTimeZone === "function" ? (name) => apply$1(hasTimeZone, Constructor, [name]) : void 0
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
const getNumberFormatProbe = retainProbe("NumberFormat", (Constructor) => {
|
|
204
|
+
const property = findProperty(ownValue(Constructor, "prototype"), "format");
|
|
205
|
+
const getter = property && ownValue(property, "get");
|
|
206
|
+
const method = property && ownValue(property, "value");
|
|
207
|
+
const partsProperty = findProperty(ownValue(Constructor, "prototype"), "formatToParts");
|
|
208
|
+
const parts = partsProperty && ownValue(partsProperty, "value");
|
|
209
|
+
let format;
|
|
210
|
+
if (typeof getter === "function") format = (formatter, value) => apply$1(apply$1(getter, formatter, []), void 0, [value]);
|
|
211
|
+
else if (typeof method === "function") format = (formatter, value) => apply$1(method, formatter, [value]);
|
|
212
|
+
return {
|
|
213
|
+
create: memoizeHost(Constructor, (locales, options) => new Constructor(locales, options)),
|
|
214
|
+
resolve: resolvedOptions(Constructor),
|
|
215
|
+
format,
|
|
216
|
+
formatToParts: typeof parts === "function" ? (formatter, value) => apply$1(parts, formatter, [value]) : void 0
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
const getCollatorProbe = retainProbe("Collator", (Constructor) => ({
|
|
220
|
+
create: (locale) => new Constructor(locale),
|
|
221
|
+
resolve: resolvedOptions(Constructor)
|
|
222
|
+
}));
|
|
223
|
+
const getRelativeTimeFormatProbe = retainProbe("RelativeTimeFormat", (Constructor) => ({
|
|
224
|
+
create: (locale) => new Constructor(locale),
|
|
225
|
+
resolve: resolvedOptions(Constructor)
|
|
226
|
+
}));
|
|
227
|
+
const getCurrencyDisplayNamesProbe = retainProbe("DisplayNames", (Constructor) => {
|
|
228
|
+
const property = findProperty(ownValue(Constructor, "prototype"), "of");
|
|
229
|
+
const of = property && ownValue(property, "value");
|
|
230
|
+
return {
|
|
231
|
+
create: (locale) => new Constructor(locale, {
|
|
232
|
+
__proto__: null,
|
|
233
|
+
type: "currency",
|
|
234
|
+
fallback: "none"
|
|
235
|
+
}),
|
|
236
|
+
hasName: typeof of === "function" ? (formatter, code) => apply$1(of, formatter, [code]) !== void 0 : void 0
|
|
237
|
+
};
|
|
238
|
+
});
|
|
110
239
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/calendars.js
|
|
111
240
|
const calendars = [
|
|
112
241
|
"buddhist",
|
|
@@ -123,33 +252,548 @@ const calendars = [
|
|
|
123
252
|
"islamic-rgsa",
|
|
124
253
|
"islamic-tbla",
|
|
125
254
|
"islamic-umalqura",
|
|
126
|
-
"islamicc",
|
|
127
255
|
"iso8601",
|
|
128
256
|
"japanese",
|
|
129
257
|
"persian",
|
|
130
258
|
"roc"
|
|
131
259
|
];
|
|
260
|
+
const calendarCandidateLocales = {
|
|
261
|
+
"buddhist": [
|
|
262
|
+
"en",
|
|
263
|
+
"th",
|
|
264
|
+
"th-TH",
|
|
265
|
+
"th-Thai-TH"
|
|
266
|
+
],
|
|
267
|
+
"chinese": [
|
|
268
|
+
"en",
|
|
269
|
+
"zh",
|
|
270
|
+
"zh-CN",
|
|
271
|
+
"zh-Hans-CN",
|
|
272
|
+
"zh-HK",
|
|
273
|
+
"zh-Hant-HK",
|
|
274
|
+
"zh-MO",
|
|
275
|
+
"zh-Hant-MO",
|
|
276
|
+
"zh-TW",
|
|
277
|
+
"zh-Hant-TW"
|
|
278
|
+
],
|
|
279
|
+
"coptic": [
|
|
280
|
+
"en",
|
|
281
|
+
"ar",
|
|
282
|
+
"ar-EG",
|
|
283
|
+
"ar-Arab-EG"
|
|
284
|
+
],
|
|
285
|
+
"dangi": [
|
|
286
|
+
"en",
|
|
287
|
+
"ko",
|
|
288
|
+
"ko-KR",
|
|
289
|
+
"ko-Kore-KR"
|
|
290
|
+
],
|
|
291
|
+
"ethioaa": [
|
|
292
|
+
"en",
|
|
293
|
+
"ar",
|
|
294
|
+
"fa",
|
|
295
|
+
"sq",
|
|
296
|
+
"az",
|
|
297
|
+
"bn",
|
|
298
|
+
"zh",
|
|
299
|
+
"fr",
|
|
300
|
+
"ti",
|
|
301
|
+
"am",
|
|
302
|
+
"id",
|
|
303
|
+
"he",
|
|
304
|
+
"hi",
|
|
305
|
+
"ja",
|
|
306
|
+
"ko",
|
|
307
|
+
"dv",
|
|
308
|
+
"ms",
|
|
309
|
+
"ha",
|
|
310
|
+
"ur",
|
|
311
|
+
"th",
|
|
312
|
+
"tg",
|
|
313
|
+
"tk",
|
|
314
|
+
"tr",
|
|
315
|
+
"uz"
|
|
316
|
+
],
|
|
317
|
+
"ethiopic": [
|
|
318
|
+
"en",
|
|
319
|
+
"am",
|
|
320
|
+
"am-ET",
|
|
321
|
+
"am-Ethi-ET"
|
|
322
|
+
],
|
|
323
|
+
"gregory": [
|
|
324
|
+
"en",
|
|
325
|
+
"ar",
|
|
326
|
+
"ar-AE",
|
|
327
|
+
"ar-Arab-AE",
|
|
328
|
+
"fa",
|
|
329
|
+
"fa-AF",
|
|
330
|
+
"fa-Arab-AF",
|
|
331
|
+
"sq",
|
|
332
|
+
"sq-AL",
|
|
333
|
+
"sq-Latn-AL",
|
|
334
|
+
"az",
|
|
335
|
+
"az-AZ",
|
|
336
|
+
"az-Latn-AZ",
|
|
337
|
+
"bn",
|
|
338
|
+
"bn-BD",
|
|
339
|
+
"bn-Beng-BD",
|
|
340
|
+
"ar-BH",
|
|
341
|
+
"ar-Arab-BH",
|
|
342
|
+
"zh",
|
|
343
|
+
"zh-CN",
|
|
344
|
+
"zh-Hans-CN",
|
|
345
|
+
"fr",
|
|
346
|
+
"fr-DJ",
|
|
347
|
+
"fr-Latn-DJ",
|
|
348
|
+
"ar-DZ",
|
|
349
|
+
"ar-Arab-DZ",
|
|
350
|
+
"ar-EG",
|
|
351
|
+
"ar-Arab-EG",
|
|
352
|
+
"ar-EH",
|
|
353
|
+
"ar-Arab-EH",
|
|
354
|
+
"ti",
|
|
355
|
+
"ti-ER",
|
|
356
|
+
"ti-Ethi-ER",
|
|
357
|
+
"am",
|
|
358
|
+
"am-ET",
|
|
359
|
+
"am-Ethi-ET",
|
|
360
|
+
"zh-HK",
|
|
361
|
+
"zh-Hant-HK",
|
|
362
|
+
"id",
|
|
363
|
+
"id-ID",
|
|
364
|
+
"id-Latn-ID",
|
|
365
|
+
"he",
|
|
366
|
+
"he-IL",
|
|
367
|
+
"he-Hebr-IL",
|
|
368
|
+
"hi",
|
|
369
|
+
"hi-IN",
|
|
370
|
+
"hi-Deva-IN",
|
|
371
|
+
"ar-IQ",
|
|
372
|
+
"ar-Arab-IQ",
|
|
373
|
+
"fa-IR",
|
|
374
|
+
"fa-Arab-IR",
|
|
375
|
+
"ar-JO",
|
|
376
|
+
"ar-Arab-JO",
|
|
377
|
+
"ja",
|
|
378
|
+
"ja-JP",
|
|
379
|
+
"ja-Jpan-JP",
|
|
380
|
+
"ar-KM",
|
|
381
|
+
"ar-Arab-KM",
|
|
382
|
+
"ko",
|
|
383
|
+
"ko-KR",
|
|
384
|
+
"ko-Kore-KR",
|
|
385
|
+
"ar-KW",
|
|
386
|
+
"ar-Arab-KW",
|
|
387
|
+
"ar-LB",
|
|
388
|
+
"ar-Arab-LB",
|
|
389
|
+
"ar-LY",
|
|
390
|
+
"ar-Arab-LY",
|
|
391
|
+
"ar-MA",
|
|
392
|
+
"ar-Arab-MA",
|
|
393
|
+
"zh-MO",
|
|
394
|
+
"zh-Hant-MO",
|
|
395
|
+
"ar-MR",
|
|
396
|
+
"ar-Arab-MR",
|
|
397
|
+
"dv",
|
|
398
|
+
"dv-MV",
|
|
399
|
+
"dv-Thaa-MV",
|
|
400
|
+
"ms",
|
|
401
|
+
"ms-MY",
|
|
402
|
+
"ms-Latn-MY",
|
|
403
|
+
"ha",
|
|
404
|
+
"ha-NE",
|
|
405
|
+
"ha-Latn-NE",
|
|
406
|
+
"ar-OM",
|
|
407
|
+
"ar-Arab-OM",
|
|
408
|
+
"ur",
|
|
409
|
+
"ur-PK",
|
|
410
|
+
"ur-Arab-PK",
|
|
411
|
+
"ar-PS",
|
|
412
|
+
"ar-Arab-PS",
|
|
413
|
+
"ar-QA",
|
|
414
|
+
"ar-Arab-QA",
|
|
415
|
+
"ar-SA",
|
|
416
|
+
"ar-Arab-SA",
|
|
417
|
+
"ar-SD",
|
|
418
|
+
"ar-Arab-SD",
|
|
419
|
+
"ar-SY",
|
|
420
|
+
"ar-Arab-SY",
|
|
421
|
+
"ar-TD",
|
|
422
|
+
"ar-Arab-TD",
|
|
423
|
+
"th",
|
|
424
|
+
"th-TH",
|
|
425
|
+
"th-Thai-TH",
|
|
426
|
+
"tg",
|
|
427
|
+
"tg-TJ",
|
|
428
|
+
"tg-Cyrl-TJ",
|
|
429
|
+
"tk",
|
|
430
|
+
"tk-TM",
|
|
431
|
+
"tk-Latn-TM",
|
|
432
|
+
"ar-TN",
|
|
433
|
+
"ar-Arab-TN",
|
|
434
|
+
"tr",
|
|
435
|
+
"tr-TR",
|
|
436
|
+
"tr-Latn-TR",
|
|
437
|
+
"zh-TW",
|
|
438
|
+
"zh-Hant-TW",
|
|
439
|
+
"uz",
|
|
440
|
+
"uz-UZ",
|
|
441
|
+
"uz-Latn-UZ",
|
|
442
|
+
"sq-XK",
|
|
443
|
+
"sq-Latn-XK",
|
|
444
|
+
"ar-YE",
|
|
445
|
+
"ar-Arab-YE"
|
|
446
|
+
],
|
|
447
|
+
"hebrew": [
|
|
448
|
+
"en",
|
|
449
|
+
"he",
|
|
450
|
+
"he-IL",
|
|
451
|
+
"he-Hebr-IL"
|
|
452
|
+
],
|
|
453
|
+
"indian": [
|
|
454
|
+
"en",
|
|
455
|
+
"hi",
|
|
456
|
+
"hi-IN",
|
|
457
|
+
"hi-Deva-IN"
|
|
458
|
+
],
|
|
459
|
+
"islamic": [
|
|
460
|
+
"en",
|
|
461
|
+
"ar",
|
|
462
|
+
"ar-AE",
|
|
463
|
+
"ar-Arab-AE",
|
|
464
|
+
"fa",
|
|
465
|
+
"fa-AF",
|
|
466
|
+
"fa-Arab-AF",
|
|
467
|
+
"bn",
|
|
468
|
+
"bn-BD",
|
|
469
|
+
"bn-Beng-BD",
|
|
470
|
+
"ar-BH",
|
|
471
|
+
"ar-Arab-BH",
|
|
472
|
+
"fr",
|
|
473
|
+
"fr-DJ",
|
|
474
|
+
"fr-Latn-DJ",
|
|
475
|
+
"ar-DZ",
|
|
476
|
+
"ar-Arab-DZ",
|
|
477
|
+
"ar-EG",
|
|
478
|
+
"ar-Arab-EG",
|
|
479
|
+
"ar-EH",
|
|
480
|
+
"ar-Arab-EH",
|
|
481
|
+
"ti",
|
|
482
|
+
"ti-ER",
|
|
483
|
+
"ti-Ethi-ER",
|
|
484
|
+
"id",
|
|
485
|
+
"id-ID",
|
|
486
|
+
"id-Latn-ID",
|
|
487
|
+
"he",
|
|
488
|
+
"he-IL",
|
|
489
|
+
"he-Hebr-IL",
|
|
490
|
+
"ar-IQ",
|
|
491
|
+
"ar-Arab-IQ",
|
|
492
|
+
"fa-IR",
|
|
493
|
+
"fa-Arab-IR",
|
|
494
|
+
"ar-JO",
|
|
495
|
+
"ar-Arab-JO",
|
|
496
|
+
"ar-KM",
|
|
497
|
+
"ar-Arab-KM",
|
|
498
|
+
"ar-KW",
|
|
499
|
+
"ar-Arab-KW",
|
|
500
|
+
"ar-LB",
|
|
501
|
+
"ar-Arab-LB",
|
|
502
|
+
"ar-LY",
|
|
503
|
+
"ar-Arab-LY",
|
|
504
|
+
"ar-MA",
|
|
505
|
+
"ar-Arab-MA",
|
|
506
|
+
"ar-MR",
|
|
507
|
+
"ar-Arab-MR",
|
|
508
|
+
"ms",
|
|
509
|
+
"ms-MY",
|
|
510
|
+
"ms-Latn-MY",
|
|
511
|
+
"ha",
|
|
512
|
+
"ha-NE",
|
|
513
|
+
"ha-Latn-NE",
|
|
514
|
+
"ar-OM",
|
|
515
|
+
"ar-Arab-OM",
|
|
516
|
+
"ur",
|
|
517
|
+
"ur-PK",
|
|
518
|
+
"ur-Arab-PK",
|
|
519
|
+
"ar-PS",
|
|
520
|
+
"ar-Arab-PS",
|
|
521
|
+
"ar-QA",
|
|
522
|
+
"ar-Arab-QA",
|
|
523
|
+
"ar-SA",
|
|
524
|
+
"ar-Arab-SA",
|
|
525
|
+
"ar-SD",
|
|
526
|
+
"ar-Arab-SD",
|
|
527
|
+
"ar-SY",
|
|
528
|
+
"ar-Arab-SY",
|
|
529
|
+
"ar-TD",
|
|
530
|
+
"ar-Arab-TD",
|
|
531
|
+
"ar-TN",
|
|
532
|
+
"ar-Arab-TN",
|
|
533
|
+
"ar-YE",
|
|
534
|
+
"ar-Arab-YE"
|
|
535
|
+
],
|
|
536
|
+
"islamic-civil": [
|
|
537
|
+
"en",
|
|
538
|
+
"ar",
|
|
539
|
+
"ar-AE",
|
|
540
|
+
"ar-Arab-AE",
|
|
541
|
+
"fa",
|
|
542
|
+
"fa-AF",
|
|
543
|
+
"fa-Arab-AF",
|
|
544
|
+
"sq",
|
|
545
|
+
"sq-AL",
|
|
546
|
+
"sq-Latn-AL",
|
|
547
|
+
"az",
|
|
548
|
+
"az-AZ",
|
|
549
|
+
"az-Latn-AZ",
|
|
550
|
+
"bn",
|
|
551
|
+
"bn-BD",
|
|
552
|
+
"bn-Beng-BD",
|
|
553
|
+
"ar-BH",
|
|
554
|
+
"ar-Arab-BH",
|
|
555
|
+
"fr",
|
|
556
|
+
"fr-DJ",
|
|
557
|
+
"fr-Latn-DJ",
|
|
558
|
+
"ar-DZ",
|
|
559
|
+
"ar-Arab-DZ",
|
|
560
|
+
"ar-EG",
|
|
561
|
+
"ar-Arab-EG",
|
|
562
|
+
"ar-EH",
|
|
563
|
+
"ar-Arab-EH",
|
|
564
|
+
"ti",
|
|
565
|
+
"ti-ER",
|
|
566
|
+
"ti-Ethi-ER",
|
|
567
|
+
"id",
|
|
568
|
+
"id-ID",
|
|
569
|
+
"id-Latn-ID",
|
|
570
|
+
"he",
|
|
571
|
+
"he-IL",
|
|
572
|
+
"he-Hebr-IL",
|
|
573
|
+
"ar-IQ",
|
|
574
|
+
"ar-Arab-IQ",
|
|
575
|
+
"fa-IR",
|
|
576
|
+
"fa-Arab-IR",
|
|
577
|
+
"ar-JO",
|
|
578
|
+
"ar-Arab-JO",
|
|
579
|
+
"ar-KM",
|
|
580
|
+
"ar-Arab-KM",
|
|
581
|
+
"ar-KW",
|
|
582
|
+
"ar-Arab-KW",
|
|
583
|
+
"ar-LB",
|
|
584
|
+
"ar-Arab-LB",
|
|
585
|
+
"ar-LY",
|
|
586
|
+
"ar-Arab-LY",
|
|
587
|
+
"ar-MA",
|
|
588
|
+
"ar-Arab-MA",
|
|
589
|
+
"ar-MR",
|
|
590
|
+
"ar-Arab-MR",
|
|
591
|
+
"dv",
|
|
592
|
+
"dv-MV",
|
|
593
|
+
"dv-Thaa-MV",
|
|
594
|
+
"ms",
|
|
595
|
+
"ms-MY",
|
|
596
|
+
"ms-Latn-MY",
|
|
597
|
+
"ha",
|
|
598
|
+
"ha-NE",
|
|
599
|
+
"ha-Latn-NE",
|
|
600
|
+
"ar-OM",
|
|
601
|
+
"ar-Arab-OM",
|
|
602
|
+
"ur",
|
|
603
|
+
"ur-PK",
|
|
604
|
+
"ur-Arab-PK",
|
|
605
|
+
"ar-PS",
|
|
606
|
+
"ar-Arab-PS",
|
|
607
|
+
"ar-QA",
|
|
608
|
+
"ar-Arab-QA",
|
|
609
|
+
"ar-SD",
|
|
610
|
+
"ar-Arab-SD",
|
|
611
|
+
"ar-SY",
|
|
612
|
+
"ar-Arab-SY",
|
|
613
|
+
"ar-TD",
|
|
614
|
+
"ar-Arab-TD",
|
|
615
|
+
"tg",
|
|
616
|
+
"tg-TJ",
|
|
617
|
+
"tg-Cyrl-TJ",
|
|
618
|
+
"tk",
|
|
619
|
+
"tk-TM",
|
|
620
|
+
"tk-Latn-TM",
|
|
621
|
+
"ar-TN",
|
|
622
|
+
"ar-Arab-TN",
|
|
623
|
+
"tr",
|
|
624
|
+
"tr-TR",
|
|
625
|
+
"tr-Latn-TR",
|
|
626
|
+
"uz",
|
|
627
|
+
"uz-UZ",
|
|
628
|
+
"uz-Latn-UZ",
|
|
629
|
+
"sq-XK",
|
|
630
|
+
"sq-Latn-XK",
|
|
631
|
+
"ar-YE",
|
|
632
|
+
"ar-Arab-YE"
|
|
633
|
+
],
|
|
634
|
+
"islamic-rgsa": [
|
|
635
|
+
"en",
|
|
636
|
+
"ar",
|
|
637
|
+
"ar-SA",
|
|
638
|
+
"ar-Arab-SA"
|
|
639
|
+
],
|
|
640
|
+
"islamic-tbla": [
|
|
641
|
+
"en",
|
|
642
|
+
"ar",
|
|
643
|
+
"ar-AE",
|
|
644
|
+
"ar-Arab-AE",
|
|
645
|
+
"fa",
|
|
646
|
+
"fa-AF",
|
|
647
|
+
"fa-Arab-AF",
|
|
648
|
+
"sq",
|
|
649
|
+
"sq-AL",
|
|
650
|
+
"sq-Latn-AL",
|
|
651
|
+
"az",
|
|
652
|
+
"az-AZ",
|
|
653
|
+
"az-Latn-AZ",
|
|
654
|
+
"bn",
|
|
655
|
+
"bn-BD",
|
|
656
|
+
"bn-Beng-BD",
|
|
657
|
+
"ar-BH",
|
|
658
|
+
"ar-Arab-BH",
|
|
659
|
+
"fr",
|
|
660
|
+
"fr-DJ",
|
|
661
|
+
"fr-Latn-DJ",
|
|
662
|
+
"ar-DZ",
|
|
663
|
+
"ar-Arab-DZ",
|
|
664
|
+
"ar-EG",
|
|
665
|
+
"ar-Arab-EG",
|
|
666
|
+
"ar-EH",
|
|
667
|
+
"ar-Arab-EH",
|
|
668
|
+
"ti",
|
|
669
|
+
"ti-ER",
|
|
670
|
+
"ti-Ethi-ER",
|
|
671
|
+
"id",
|
|
672
|
+
"id-ID",
|
|
673
|
+
"id-Latn-ID",
|
|
674
|
+
"he",
|
|
675
|
+
"he-IL",
|
|
676
|
+
"he-Hebr-IL",
|
|
677
|
+
"ar-IQ",
|
|
678
|
+
"ar-Arab-IQ",
|
|
679
|
+
"fa-IR",
|
|
680
|
+
"fa-Arab-IR",
|
|
681
|
+
"ar-JO",
|
|
682
|
+
"ar-Arab-JO",
|
|
683
|
+
"ar-KM",
|
|
684
|
+
"ar-Arab-KM",
|
|
685
|
+
"ar-KW",
|
|
686
|
+
"ar-Arab-KW",
|
|
687
|
+
"ar-LB",
|
|
688
|
+
"ar-Arab-LB",
|
|
689
|
+
"ar-LY",
|
|
690
|
+
"ar-Arab-LY",
|
|
691
|
+
"ar-MA",
|
|
692
|
+
"ar-Arab-MA",
|
|
693
|
+
"ar-MR",
|
|
694
|
+
"ar-Arab-MR",
|
|
695
|
+
"dv",
|
|
696
|
+
"dv-MV",
|
|
697
|
+
"dv-Thaa-MV",
|
|
698
|
+
"ms",
|
|
699
|
+
"ms-MY",
|
|
700
|
+
"ms-Latn-MY",
|
|
701
|
+
"ha",
|
|
702
|
+
"ha-NE",
|
|
703
|
+
"ha-Latn-NE",
|
|
704
|
+
"ar-OM",
|
|
705
|
+
"ar-Arab-OM",
|
|
706
|
+
"ur",
|
|
707
|
+
"ur-PK",
|
|
708
|
+
"ur-Arab-PK",
|
|
709
|
+
"ar-PS",
|
|
710
|
+
"ar-Arab-PS",
|
|
711
|
+
"ar-QA",
|
|
712
|
+
"ar-Arab-QA",
|
|
713
|
+
"ar-SD",
|
|
714
|
+
"ar-Arab-SD",
|
|
715
|
+
"ar-SY",
|
|
716
|
+
"ar-Arab-SY",
|
|
717
|
+
"ar-TD",
|
|
718
|
+
"ar-Arab-TD",
|
|
719
|
+
"tg",
|
|
720
|
+
"tg-TJ",
|
|
721
|
+
"tg-Cyrl-TJ",
|
|
722
|
+
"tk",
|
|
723
|
+
"tk-TM",
|
|
724
|
+
"tk-Latn-TM",
|
|
725
|
+
"ar-TN",
|
|
726
|
+
"ar-Arab-TN",
|
|
727
|
+
"tr",
|
|
728
|
+
"tr-TR",
|
|
729
|
+
"tr-Latn-TR",
|
|
730
|
+
"uz",
|
|
731
|
+
"uz-UZ",
|
|
732
|
+
"uz-Latn-UZ",
|
|
733
|
+
"sq-XK",
|
|
734
|
+
"sq-Latn-XK",
|
|
735
|
+
"ar-YE",
|
|
736
|
+
"ar-Arab-YE"
|
|
737
|
+
],
|
|
738
|
+
"islamic-umalqura": [
|
|
739
|
+
"en",
|
|
740
|
+
"ar",
|
|
741
|
+
"ar-AE",
|
|
742
|
+
"ar-Arab-AE",
|
|
743
|
+
"ar-BH",
|
|
744
|
+
"ar-Arab-BH",
|
|
745
|
+
"ar-KW",
|
|
746
|
+
"ar-Arab-KW",
|
|
747
|
+
"ar-QA",
|
|
748
|
+
"ar-Arab-QA",
|
|
749
|
+
"ar-SA",
|
|
750
|
+
"ar-Arab-SA"
|
|
751
|
+
],
|
|
752
|
+
"iso8601": ["en"],
|
|
753
|
+
"japanese": [
|
|
754
|
+
"en",
|
|
755
|
+
"ja",
|
|
756
|
+
"ja-JP",
|
|
757
|
+
"ja-Jpan-JP"
|
|
758
|
+
],
|
|
759
|
+
"persian": [
|
|
760
|
+
"en",
|
|
761
|
+
"fa",
|
|
762
|
+
"fa-AF",
|
|
763
|
+
"fa-Arab-AF",
|
|
764
|
+
"fa-IR",
|
|
765
|
+
"fa-Arab-IR"
|
|
766
|
+
],
|
|
767
|
+
"roc": [
|
|
768
|
+
"en",
|
|
769
|
+
"zh",
|
|
770
|
+
"zh-TW",
|
|
771
|
+
"zh-Hant-TW"
|
|
772
|
+
]
|
|
773
|
+
};
|
|
132
774
|
// packages/intl-supportedvaluesof/get-supported-calendars.ts
|
|
133
|
-
/**
|
|
134
|
-
* Implementation: Tests if a calendar is supported by attempting to create
|
|
135
|
-
* a DateTimeFormat with that calendar and verifying it was accepted.
|
|
136
|
-
*
|
|
137
|
-
* CLDR Data: Candidate values come from CLDR calendar types
|
|
138
|
-
*/
|
|
139
|
-
function isSupportedCalendar(item) {
|
|
140
|
-
try {
|
|
141
|
-
return createMemoizedDateTimeFormat(`en-u-ca-${item}`).resolvedOptions().calendar === item;
|
|
142
|
-
} catch {}
|
|
143
|
-
return false;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* ECMA-402 Spec: Returns supported calendar identifiers
|
|
147
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
148
|
-
*
|
|
149
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
150
|
-
*/
|
|
151
775
|
function getSupportedCalendars() {
|
|
152
|
-
|
|
776
|
+
const probe = getDateTimeFormatProbe();
|
|
777
|
+
if (probe?.availableCalendars) try {
|
|
778
|
+
const available = probe.availableCalendars();
|
|
779
|
+
return supportedEntries(calendars, (calendar) => calendar === "iso8601" || arrayIndexOf(available, calendar) >= 0);
|
|
780
|
+
} catch {}
|
|
781
|
+
if (!probe?.resolve) return ["iso8601"];
|
|
782
|
+
const { create, resolve } = probe;
|
|
783
|
+
return supportedEntries(calendars, (calendar) => {
|
|
784
|
+
if (calendar === "iso8601") return true;
|
|
785
|
+
const options = {
|
|
786
|
+
__proto__: null,
|
|
787
|
+
calendar
|
|
788
|
+
};
|
|
789
|
+
return arraySome(calendarCandidateLocales[calendar], (locale) => {
|
|
790
|
+
try {
|
|
791
|
+
return resolve(create(`${locale}-u-ca-${calendar}`, options)).calendar === calendar;
|
|
792
|
+
} catch {
|
|
793
|
+
return false;
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
});
|
|
153
797
|
}
|
|
154
798
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/collations.js
|
|
155
799
|
const collations = [
|
|
@@ -473,89 +1117,26 @@ const collationCandidateLocales = {
|
|
|
473
1117
|
"zhuyin": ["zh", "zh-Hant"]
|
|
474
1118
|
};
|
|
475
1119
|
// packages/intl-supportedvaluesof/get-supported-collations.ts
|
|
476
|
-
function isSupportedCollation(collation) {
|
|
477
|
-
const candidates = collationCandidateLocales[collation] || ["en"];
|
|
478
|
-
for (const locale of candidates) try {
|
|
479
|
-
if (new Intl.Collator(`${locale}-u-co-${collation}`).resolvedOptions().collation === collation) return true;
|
|
480
|
-
} catch {}
|
|
481
|
-
return false;
|
|
482
|
-
}
|
|
483
1120
|
function getSupportedCollations() {
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
configurable: true,
|
|
497
|
-
enumerable: false,
|
|
498
|
-
writable: true,
|
|
499
|
-
value
|
|
1121
|
+
const probe = getCollatorProbe();
|
|
1122
|
+
if (!probe?.resolve) return [];
|
|
1123
|
+
const { create, resolve } = probe;
|
|
1124
|
+
return supportedEntries(collations, (collation) => {
|
|
1125
|
+
const candidates = collationCandidateLocales[collation] || ["en"];
|
|
1126
|
+
for (let index = 0; index < candidates.length; index++) {
|
|
1127
|
+
const locale = candidates[index];
|
|
1128
|
+
try {
|
|
1129
|
+
if (resolve(create(`${locale}-u-co-${collation}`)).collation === collation) return true;
|
|
1130
|
+
} catch {}
|
|
1131
|
+
}
|
|
1132
|
+
return false;
|
|
500
1133
|
});
|
|
501
1134
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
writable: true,
|
|
507
|
-
value: {}
|
|
508
|
-
});
|
|
509
|
-
if (providerIntl === void 0) providerIntl = Intl;
|
|
510
|
-
return Intl;
|
|
1135
|
+
// packages/ecma262-abstract/HasOwnProperty.js
|
|
1136
|
+
const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty);
|
|
1137
|
+
function HasOwnProperty(o, prop) {
|
|
1138
|
+
return hasOwn(o, prop);
|
|
511
1139
|
}
|
|
512
|
-
const createMemoizedNumberFormat = memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
|
|
513
|
-
memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
|
|
514
|
-
memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
|
|
515
|
-
const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
516
|
-
strategies.variadic;
|
|
517
|
-
let providerIntl = globalThis.Intl;
|
|
518
|
-
function ownIntlProvider(name) {
|
|
519
|
-
const descriptor = providerIntl && getOwnPropertyDescriptor(providerIntl, name);
|
|
520
|
-
return (descriptor && getOwnPropertyDescriptor(descriptor, "value"))?.value;
|
|
521
|
-
}
|
|
522
|
-
let numberFormatProvider = ownIntlProvider("NumberFormat");
|
|
523
|
-
let listFormatProvider = ownIntlProvider("ListFormat");
|
|
524
|
-
const getFormatterPrototype = Object.getPrototypeOf;
|
|
525
|
-
const formatterPartsMethods = /* @__PURE__ */ new WeakMap();
|
|
526
|
-
const formatterPartsOwners = /* @__PURE__ */ new WeakMap();
|
|
527
|
-
const getPartsMethod = formatterPartsMethods.get.bind(formatterPartsMethods);
|
|
528
|
-
const setPartsMethod = formatterPartsMethods.set.bind(formatterPartsMethods);
|
|
529
|
-
const getPartsOwner = formatterPartsOwners.get.bind(formatterPartsOwners);
|
|
530
|
-
const setPartsOwner = formatterPartsOwners.set.bind(formatterPartsOwners);
|
|
531
|
-
function findFormatterPartsMethod(Constructor) {
|
|
532
|
-
const cached = getPartsMethod(Constructor);
|
|
533
|
-
if (cached) return cached;
|
|
534
|
-
let prototype = getOwnPropertyDescriptor(Constructor, "prototype")?.value;
|
|
535
|
-
while (prototype != null) {
|
|
536
|
-
const inherited = getPartsOwner(prototype);
|
|
537
|
-
if (inherited) {
|
|
538
|
-
setPartsMethod(Constructor, inherited);
|
|
539
|
-
return inherited;
|
|
540
|
-
}
|
|
541
|
-
const descriptor = getOwnPropertyDescriptor(prototype, "formatToParts");
|
|
542
|
-
const value = descriptor && getOwnPropertyDescriptor(descriptor, "value");
|
|
543
|
-
if (value && typeof value.value === "function") {
|
|
544
|
-
setPartsMethod(Constructor, value.value);
|
|
545
|
-
setPartsOwner(prototype, value.value);
|
|
546
|
-
return value.value;
|
|
547
|
-
}
|
|
548
|
-
prototype = getFormatterPrototype(prototype);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
if (typeof numberFormatProvider === "function") findFormatterPartsMethod(numberFormatProvider);
|
|
552
|
-
if (typeof listFormatProvider === "function") findFormatterPartsMethod(listFormatProvider);
|
|
553
|
-
const numberFormatMemoizers = /* @__PURE__ */ new WeakMap();
|
|
554
|
-
numberFormatMemoizers.get.bind(numberFormatMemoizers);
|
|
555
|
-
numberFormatMemoizers.set.bind(numberFormatMemoizers);
|
|
556
|
-
const listFormatMemoizers = /* @__PURE__ */ new WeakMap();
|
|
557
|
-
listFormatMemoizers.get.bind(listFormatMemoizers);
|
|
558
|
-
listFormatMemoizers.set.bind(listFormatMemoizers);
|
|
559
1140
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/currencies.js
|
|
560
1141
|
const currencies = [
|
|
561
1142
|
"ADP",
|
|
@@ -624,6 +1205,7 @@ const currencies = [
|
|
|
624
1205
|
"CLF",
|
|
625
1206
|
"CLP",
|
|
626
1207
|
"CNH",
|
|
1208
|
+
"CNX",
|
|
627
1209
|
"CNY",
|
|
628
1210
|
"COP",
|
|
629
1211
|
"COU",
|
|
@@ -826,6 +1408,7 @@ const currencies = [
|
|
|
826
1408
|
"VNN",
|
|
827
1409
|
"VUV",
|
|
828
1410
|
"WST",
|
|
1411
|
+
"XAD",
|
|
829
1412
|
"XAF",
|
|
830
1413
|
"XAG",
|
|
831
1414
|
"XAU",
|
|
@@ -865,44 +1448,64 @@ const currencies = [
|
|
|
865
1448
|
"ZWL",
|
|
866
1449
|
"ZWR"
|
|
867
1450
|
];
|
|
1451
|
+
const currencyCandidateLocales = { "XAD": ["en", "cv"] };
|
|
868
1452
|
// packages/intl-supportedvaluesof/get-supported-currencies.ts
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
*/
|
|
875
|
-
function isSupportedCurrency(currency) {
|
|
876
|
-
try {
|
|
877
|
-
const format = createMemoizedNumberFormat("en", {
|
|
878
|
-
style: "currency",
|
|
879
|
-
currencyDisplay: "name",
|
|
880
|
-
currency
|
|
881
|
-
}).format(123);
|
|
882
|
-
if (format.substring(0, 3) !== currency && format.substring(format.length - 3) !== currency) return true;
|
|
883
|
-
} catch {}
|
|
884
|
-
return false;
|
|
885
|
-
}
|
|
886
|
-
/**
|
|
887
|
-
* ECMA-402 Spec: Returns supported currency identifiers
|
|
888
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
889
|
-
*
|
|
890
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
891
|
-
*/
|
|
1453
|
+
const apply = Reflect.apply;
|
|
1454
|
+
const createObject = Object.create;
|
|
1455
|
+
const stringIndexOf = String.prototype.indexOf;
|
|
1456
|
+
const stringSlice = String.prototype.slice;
|
|
1457
|
+
const english = ["en"];
|
|
892
1458
|
function getSupportedCurrencies() {
|
|
1459
|
+
const probe = getNumberFormatProbe();
|
|
1460
|
+
if (!probe || !probe.formatToParts && !probe.format) return [];
|
|
1461
|
+
const { create, format, formatToParts } = probe;
|
|
1462
|
+
const namesProbe = getCurrencyDisplayNamesProbe();
|
|
1463
|
+
if (namesProbe && !namesProbe.hasName) return [];
|
|
1464
|
+
const namesByLocale = createObject(null);
|
|
893
1465
|
const ATOZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
894
|
-
const
|
|
895
|
-
for (
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
const
|
|
902
|
-
|
|
1466
|
+
const candidates = [];
|
|
1467
|
+
for (let index = 0; index < currencies.length; index++) {
|
|
1468
|
+
const currency = currencies[index];
|
|
1469
|
+
if (currency.length === 3) setDataProperty(candidates, `${candidates.length}`, currency);
|
|
1470
|
+
else if (currency.length === 5 && currency[3] === "~") {
|
|
1471
|
+
const start = apply(stringIndexOf, ATOZ, [currency[2]]);
|
|
1472
|
+
const end = apply(stringIndexOf, ATOZ, [currency[4]]);
|
|
1473
|
+
const prefix = currency[0] + currency[1];
|
|
1474
|
+
for (let i = start; i <= end; i++) setDataProperty(candidates, `${candidates.length}`, prefix + ATOZ[i]);
|
|
903
1475
|
}
|
|
904
1476
|
}
|
|
905
|
-
return
|
|
1477
|
+
return supportedEntries(candidates, (currency) => {
|
|
1478
|
+
return arraySome(HasOwnProperty(currencyCandidateLocales, currency) ? currencyCandidateLocales[currency] : english, (locale) => {
|
|
1479
|
+
try {
|
|
1480
|
+
if (namesProbe) {
|
|
1481
|
+
let names = namesByLocale[locale];
|
|
1482
|
+
if (names === void 0) {
|
|
1483
|
+
namesByLocale[locale] = null;
|
|
1484
|
+
names = namesByLocale[locale] = namesProbe.create(locale);
|
|
1485
|
+
}
|
|
1486
|
+
if (!names || !namesProbe.hasName?.(names, currency)) return false;
|
|
1487
|
+
}
|
|
1488
|
+
const formatter = create(locale, {
|
|
1489
|
+
__proto__: null,
|
|
1490
|
+
style: "currency",
|
|
1491
|
+
currencyDisplay: "name",
|
|
1492
|
+
currency
|
|
1493
|
+
});
|
|
1494
|
+
if (formatToParts) {
|
|
1495
|
+
const parts = formatToParts(formatter, 123);
|
|
1496
|
+
for (let i = 0; i < parts.length; i++) {
|
|
1497
|
+
const part = parts[i];
|
|
1498
|
+
if (part.type === "currency" && part.value !== currency) return true;
|
|
1499
|
+
}
|
|
1500
|
+
return false;
|
|
1501
|
+
}
|
|
1502
|
+
const text = format(formatter, 123);
|
|
1503
|
+
return apply(stringSlice, text, [0, 3]) !== currency && apply(stringSlice, text, [-3]) !== currency;
|
|
1504
|
+
} catch {
|
|
1505
|
+
return false;
|
|
1506
|
+
}
|
|
1507
|
+
});
|
|
1508
|
+
});
|
|
906
1509
|
}
|
|
907
1510
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.number@0.0.0/node_modules/@formatjs_generated/cldr.number/numbering-systems.js
|
|
908
1511
|
const numberingSystemNames = [
|
|
@@ -1004,28 +1607,183 @@ const numberingSystemNames = [
|
|
|
1004
1607
|
"wara",
|
|
1005
1608
|
"wcho"
|
|
1006
1609
|
];
|
|
1610
|
+
const numericNumberingSystemNames = [
|
|
1611
|
+
"adlm",
|
|
1612
|
+
"ahom",
|
|
1613
|
+
"arab",
|
|
1614
|
+
"arabext",
|
|
1615
|
+
"bali",
|
|
1616
|
+
"beng",
|
|
1617
|
+
"bhks",
|
|
1618
|
+
"brah",
|
|
1619
|
+
"cakm",
|
|
1620
|
+
"cham",
|
|
1621
|
+
"deva",
|
|
1622
|
+
"diak",
|
|
1623
|
+
"fullwide",
|
|
1624
|
+
"gara",
|
|
1625
|
+
"gong",
|
|
1626
|
+
"gonm",
|
|
1627
|
+
"gujr",
|
|
1628
|
+
"gukh",
|
|
1629
|
+
"guru",
|
|
1630
|
+
"hanidec",
|
|
1631
|
+
"hmng",
|
|
1632
|
+
"hmnp",
|
|
1633
|
+
"java",
|
|
1634
|
+
"kali",
|
|
1635
|
+
"kawi",
|
|
1636
|
+
"khmr",
|
|
1637
|
+
"knda",
|
|
1638
|
+
"krai",
|
|
1639
|
+
"lana",
|
|
1640
|
+
"lanatham",
|
|
1641
|
+
"laoo",
|
|
1642
|
+
"latn",
|
|
1643
|
+
"lepc",
|
|
1644
|
+
"limb",
|
|
1645
|
+
"mathbold",
|
|
1646
|
+
"mathdbl",
|
|
1647
|
+
"mathmono",
|
|
1648
|
+
"mathsanb",
|
|
1649
|
+
"mathsans",
|
|
1650
|
+
"mlym",
|
|
1651
|
+
"modi",
|
|
1652
|
+
"mong",
|
|
1653
|
+
"mroo",
|
|
1654
|
+
"mtei",
|
|
1655
|
+
"mymr",
|
|
1656
|
+
"mymrepka",
|
|
1657
|
+
"mymrpao",
|
|
1658
|
+
"mymrshan",
|
|
1659
|
+
"mymrtlng",
|
|
1660
|
+
"nagm",
|
|
1661
|
+
"newa",
|
|
1662
|
+
"nkoo",
|
|
1663
|
+
"olck",
|
|
1664
|
+
"onao",
|
|
1665
|
+
"orya",
|
|
1666
|
+
"osma",
|
|
1667
|
+
"outlined",
|
|
1668
|
+
"rohg",
|
|
1669
|
+
"saur",
|
|
1670
|
+
"segment",
|
|
1671
|
+
"shrd",
|
|
1672
|
+
"sind",
|
|
1673
|
+
"sinh",
|
|
1674
|
+
"sora",
|
|
1675
|
+
"sund",
|
|
1676
|
+
"sunu",
|
|
1677
|
+
"takr",
|
|
1678
|
+
"talu",
|
|
1679
|
+
"tamldec",
|
|
1680
|
+
"telu",
|
|
1681
|
+
"thai",
|
|
1682
|
+
"tibt",
|
|
1683
|
+
"tirh",
|
|
1684
|
+
"tnsa",
|
|
1685
|
+
"tols",
|
|
1686
|
+
"vaii",
|
|
1687
|
+
"wara",
|
|
1688
|
+
"wcho"
|
|
1689
|
+
];
|
|
1690
|
+
const numberingSystemCandidateLocales = {
|
|
1691
|
+
"armn": ["en", "hy"],
|
|
1692
|
+
"armnlow": ["en"],
|
|
1693
|
+
"cyrl": ["en"],
|
|
1694
|
+
"ethi": [
|
|
1695
|
+
"en",
|
|
1696
|
+
"am",
|
|
1697
|
+
"om",
|
|
1698
|
+
"om-KE",
|
|
1699
|
+
"ti",
|
|
1700
|
+
"ti-ER"
|
|
1701
|
+
],
|
|
1702
|
+
"geor": ["en", "ka"],
|
|
1703
|
+
"grek": [
|
|
1704
|
+
"en",
|
|
1705
|
+
"el",
|
|
1706
|
+
"el-CY",
|
|
1707
|
+
"el-polyton"
|
|
1708
|
+
],
|
|
1709
|
+
"greklow": ["en"],
|
|
1710
|
+
"hanidays": ["en", "zh"],
|
|
1711
|
+
"hans": [
|
|
1712
|
+
"en",
|
|
1713
|
+
"zh",
|
|
1714
|
+
"zh-Hans",
|
|
1715
|
+
"zh-Hans-HK",
|
|
1716
|
+
"zh-Hans-MO",
|
|
1717
|
+
"zh-Hans-MY",
|
|
1718
|
+
"zh-Hans-SG"
|
|
1719
|
+
],
|
|
1720
|
+
"hansfin": [
|
|
1721
|
+
"en",
|
|
1722
|
+
"zh",
|
|
1723
|
+
"zh-Hans",
|
|
1724
|
+
"zh-Hans-HK",
|
|
1725
|
+
"zh-Hans-MO",
|
|
1726
|
+
"zh-Hans-MY",
|
|
1727
|
+
"zh-Hans-SG"
|
|
1728
|
+
],
|
|
1729
|
+
"hant": [
|
|
1730
|
+
"en",
|
|
1731
|
+
"zh-Hant",
|
|
1732
|
+
"yue",
|
|
1733
|
+
"yue-Hans",
|
|
1734
|
+
"yue-Hant",
|
|
1735
|
+
"yue-Hant-CN",
|
|
1736
|
+
"yue-Hant-MO",
|
|
1737
|
+
"zh-Hant-HK",
|
|
1738
|
+
"zh-Hant-MO",
|
|
1739
|
+
"zh-Hant-MY"
|
|
1740
|
+
],
|
|
1741
|
+
"hantfin": [
|
|
1742
|
+
"en",
|
|
1743
|
+
"zh-Hant",
|
|
1744
|
+
"yue",
|
|
1745
|
+
"yue-Hans",
|
|
1746
|
+
"yue-Hant",
|
|
1747
|
+
"yue-Hant-CN",
|
|
1748
|
+
"yue-Hant-MO",
|
|
1749
|
+
"zh-Hant-HK",
|
|
1750
|
+
"zh-Hant-MO",
|
|
1751
|
+
"zh-Hant-MY"
|
|
1752
|
+
],
|
|
1753
|
+
"hebr": [
|
|
1754
|
+
"en",
|
|
1755
|
+
"he",
|
|
1756
|
+
"yi"
|
|
1757
|
+
],
|
|
1758
|
+
"jpan": ["en", "ja"],
|
|
1759
|
+
"jpanfin": ["en", "ja"],
|
|
1760
|
+
"jpanyear": ["en", "ja"],
|
|
1761
|
+
"roman": ["en"],
|
|
1762
|
+
"romanlow": ["en"],
|
|
1763
|
+
"taml": [
|
|
1764
|
+
"en",
|
|
1765
|
+
"ta",
|
|
1766
|
+
"ta-LK",
|
|
1767
|
+
"ta-MY",
|
|
1768
|
+
"ta-SG"
|
|
1769
|
+
]
|
|
1770
|
+
};
|
|
1007
1771
|
// packages/intl-supportedvaluesof/get-supported-numbering-systems.ts
|
|
1008
|
-
/**
|
|
1009
|
-
* Implementation: Tests if a numbering system is supported by attempting to create
|
|
1010
|
-
* a NumberFormat with that numbering system and verifying it was accepted.
|
|
1011
|
-
*
|
|
1012
|
-
* CLDR Data: Candidate values come from CLDR numbering system types
|
|
1013
|
-
*/
|
|
1014
|
-
function isSupportedNumberingSystem(system) {
|
|
1015
|
-
try {
|
|
1016
|
-
const numberFormat = createMemoizedNumberFormat(`en-u-nu-${system}`);
|
|
1017
|
-
if (numberFormat.resolvedOptions().numberingSystem === system && system === "latn" || numberFormat.format(123) !== "123") return true;
|
|
1018
|
-
} catch {}
|
|
1019
|
-
return false;
|
|
1020
|
-
}
|
|
1021
|
-
/**
|
|
1022
|
-
* ECMA-402 Spec: Returns supported numbering system identifiers
|
|
1023
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
1024
|
-
*
|
|
1025
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
1026
|
-
*/
|
|
1027
1772
|
function getSupportedNumberingSystems() {
|
|
1028
|
-
|
|
1773
|
+
const number = getNumberFormatProbe();
|
|
1774
|
+
const date = getDateTimeFormatProbe();
|
|
1775
|
+
const relative = getRelativeTimeFormatProbe();
|
|
1776
|
+
return supportedEntries(numberingSystemNames, (system) => {
|
|
1777
|
+
if (arrayIndexOf(numericNumberingSystemNames, system) >= 0) return true;
|
|
1778
|
+
return arraySome(numberingSystemCandidateLocales[system], (candidate) => {
|
|
1779
|
+
const locale = `${candidate}-u-nu-${system}`;
|
|
1780
|
+
try {
|
|
1781
|
+
return number?.resolve?.(number.create(locale)).numberingSystem === system && date?.resolve?.(date.create(locale)).numberingSystem === system && relative?.resolve?.(relative.create(locale)).numberingSystem === system;
|
|
1782
|
+
} catch {
|
|
1783
|
+
return false;
|
|
1784
|
+
}
|
|
1785
|
+
});
|
|
1786
|
+
});
|
|
1029
1787
|
}
|
|
1030
1788
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/timezones.js
|
|
1031
1789
|
const timezones = [
|
|
@@ -1480,27 +2238,25 @@ const timezones = [
|
|
|
1480
2238
|
"UTC"
|
|
1481
2239
|
];
|
|
1482
2240
|
// packages/intl-supportedvaluesof/get-supported-timezones.ts
|
|
1483
|
-
/**
|
|
1484
|
-
* Implementation: Tests if a timezone is supported by attempting to create
|
|
1485
|
-
* a DateTimeFormat with that timezone and verifying it was accepted.
|
|
1486
|
-
*
|
|
1487
|
-
* CLDR Data: Candidate values come from IANA Time Zone Database
|
|
1488
|
-
*/
|
|
1489
|
-
function isSupportedTimeZone(timeZone) {
|
|
1490
|
-
try {
|
|
1491
|
-
createMemoizedDateTimeFormat("en", { timeZone });
|
|
1492
|
-
return true;
|
|
1493
|
-
} catch {}
|
|
1494
|
-
return false;
|
|
1495
|
-
}
|
|
1496
|
-
/**
|
|
1497
|
-
* ECMA-402 Spec: Returns supported timezone identifiers
|
|
1498
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
1499
|
-
*
|
|
1500
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
1501
|
-
*/
|
|
1502
2241
|
function getSupportedTimeZones() {
|
|
1503
|
-
|
|
2242
|
+
const probe = getDateTimeFormatProbe();
|
|
2243
|
+
if (!probe) return ["UTC"];
|
|
2244
|
+
return supportedEntries(timezones, (timeZone) => {
|
|
2245
|
+
if (timeZone === "UTC") return true;
|
|
2246
|
+
if (probe.hasTimeZone) try {
|
|
2247
|
+
return probe.hasTimeZone(timeZone);
|
|
2248
|
+
} catch {}
|
|
2249
|
+
try {
|
|
2250
|
+
const options = {
|
|
2251
|
+
__proto__: null,
|
|
2252
|
+
timeZone
|
|
2253
|
+
};
|
|
2254
|
+
probe.create("en", options);
|
|
2255
|
+
return true;
|
|
2256
|
+
} catch {
|
|
2257
|
+
return false;
|
|
2258
|
+
}
|
|
2259
|
+
});
|
|
1504
2260
|
}
|
|
1505
2261
|
// node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-values@0.0.0/node_modules/@formatjs_generated/cldr.supported-values/units.js
|
|
1506
2262
|
const units = [
|
|
@@ -1551,43 +2307,18 @@ const units = [
|
|
|
1551
2307
|
"milliliter"
|
|
1552
2308
|
];
|
|
1553
2309
|
// packages/intl-supportedvaluesof/get-supported-units.ts
|
|
1554
|
-
/**
|
|
1555
|
-
* Implementation: Tests if a unit is supported by attempting to create
|
|
1556
|
-
* a NumberFormat with that unit and verifying it was accepted.
|
|
1557
|
-
*
|
|
1558
|
-
* CLDR Data: Candidate values come from CLDR unit types
|
|
1559
|
-
*/
|
|
1560
|
-
function isSupportedUnit(unit) {
|
|
1561
|
-
try {
|
|
1562
|
-
return createMemoizedNumberFormat("en", {
|
|
1563
|
-
style: "unit",
|
|
1564
|
-
unit
|
|
1565
|
-
}).resolvedOptions().unit === unit;
|
|
1566
|
-
} catch {}
|
|
1567
|
-
return false;
|
|
1568
|
-
}
|
|
1569
|
-
/**
|
|
1570
|
-
* ECMA-402 Spec: Returns supported unit identifiers
|
|
1571
|
-
* ECMA-402 Spec: Results must be sorted lexicographically
|
|
1572
|
-
*
|
|
1573
|
-
* Implementation: Filters CLDR list against actual runtime support
|
|
1574
|
-
*/
|
|
1575
2310
|
function getSupportedUnits() {
|
|
1576
|
-
return units
|
|
2311
|
+
return supportedEntries(units, () => true);
|
|
1577
2312
|
}
|
|
1578
2313
|
// packages/intl-supportedvaluesof/index.ts
|
|
1579
2314
|
/**
|
|
1580
|
-
* ECMA-402
|
|
1581
|
-
* ECMA-402 §8.3.2 Intl.supportedValuesOf, step 1.
|
|
2315
|
+
* ECMA-402 §8.3.2 Intl.supportedValuesOf.
|
|
1582
2316
|
* https://tc39.es/ecma402/#sec-intl.supportedvaluesof
|
|
1583
|
-
* https://github.com/tc39/ecma402/blob/b1c961988b9a07894b1dc3dc2b5626ea48387d61/spec/intl.html#L103
|
|
1584
2317
|
*
|
|
1585
2318
|
* Returns an array containing the supported calendar, collation, currency,
|
|
1586
2319
|
* numbering systems, time zone, or unit values supported by the implementation.
|
|
1587
2320
|
*
|
|
1588
|
-
*
|
|
1589
|
-
* Intl formatters to determine runtime support rather than using static lists.
|
|
1590
|
-
* This ensures accuracy across different JavaScript engines and runtimes.
|
|
2321
|
+
* Units come from the spec. Other categories probe the installed formatters.
|
|
1591
2322
|
*
|
|
1592
2323
|
* @param key - The category of values to return
|
|
1593
2324
|
* @returns A sorted array of unique string values
|
|
@@ -1601,9 +2332,95 @@ const supportedValuesOf = { supportedValuesOf(key) {
|
|
|
1601
2332
|
case "numberingSystem": return getSupportedNumberingSystems();
|
|
1602
2333
|
case "timeZone": return getSupportedTimeZones();
|
|
1603
2334
|
case "unit": return getSupportedUnits();
|
|
1604
|
-
default: throw
|
|
2335
|
+
default: throw new RangeErrorConstructor("Invalid key: " + key);
|
|
1605
2336
|
}
|
|
1606
2337
|
} }.supportedValuesOf;
|
|
2338
|
+
String.prototype.repeat;
|
|
2339
|
+
Array.from;
|
|
2340
|
+
Array.prototype.join;
|
|
2341
|
+
function defineProperty(target, name, { value }) {
|
|
2342
|
+
Object.defineProperty(target, name, {
|
|
2343
|
+
configurable: true,
|
|
2344
|
+
enumerable: false,
|
|
2345
|
+
writable: true,
|
|
2346
|
+
value
|
|
2347
|
+
});
|
|
2348
|
+
}
|
|
2349
|
+
function ensureIntl() {
|
|
2350
|
+
if (typeof Intl === "undefined") {
|
|
2351
|
+
const intl = {};
|
|
2352
|
+
if (typeof Symbol !== "undefined") Object.defineProperty(intl, Symbol.toStringTag, {
|
|
2353
|
+
value: "Intl",
|
|
2354
|
+
writable: false,
|
|
2355
|
+
enumerable: false,
|
|
2356
|
+
configurable: true
|
|
2357
|
+
});
|
|
2358
|
+
Object.defineProperty(globalThis, "Intl", {
|
|
2359
|
+
configurable: true,
|
|
2360
|
+
enumerable: false,
|
|
2361
|
+
writable: true,
|
|
2362
|
+
value: intl
|
|
2363
|
+
});
|
|
2364
|
+
}
|
|
2365
|
+
if (providerIntl === void 0) providerIntl = Intl;
|
|
2366
|
+
return Intl;
|
|
2367
|
+
}
|
|
2368
|
+
memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
|
|
2369
|
+
memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
|
|
2370
|
+
const getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
2371
|
+
strategies.variadic;
|
|
2372
|
+
let providerIntl = globalThis.Intl;
|
|
2373
|
+
function ownIntlProvider(name) {
|
|
2374
|
+
const descriptor = providerIntl && getOwnPropertyDescriptor(providerIntl, name);
|
|
2375
|
+
return (descriptor && getOwnPropertyDescriptor(descriptor, "value"))?.value;
|
|
2376
|
+
}
|
|
2377
|
+
let numberFormatIntrinsic = ownIntlProvider("NumberFormat");
|
|
2378
|
+
let listFormatIntrinsic = ownIntlProvider("ListFormat");
|
|
2379
|
+
let pluralRulesProvider = ownIntlProvider("PluralRules");
|
|
2380
|
+
const getFormatterPrototype = Object.getPrototypeOf;
|
|
2381
|
+
function formatterMethodLookup(name) {
|
|
2382
|
+
const methods = /* @__PURE__ */ new WeakMap();
|
|
2383
|
+
const owners = /* @__PURE__ */ new WeakMap();
|
|
2384
|
+
const getMethod = methods.get.bind(methods);
|
|
2385
|
+
const setMethod = methods.set.bind(methods);
|
|
2386
|
+
const getOwner = owners.get.bind(owners);
|
|
2387
|
+
const setOwner = owners.set.bind(owners);
|
|
2388
|
+
return (Constructor) => {
|
|
2389
|
+
const cached = getMethod(Constructor);
|
|
2390
|
+
if (cached) return cached;
|
|
2391
|
+
let prototype = getOwnPropertyDescriptor(Constructor, "prototype")?.value;
|
|
2392
|
+
while (prototype != null) {
|
|
2393
|
+
const inherited = getOwner(prototype);
|
|
2394
|
+
if (inherited) {
|
|
2395
|
+
setMethod(Constructor, inherited);
|
|
2396
|
+
return inherited;
|
|
2397
|
+
}
|
|
2398
|
+
const descriptor = getOwnPropertyDescriptor(prototype, name);
|
|
2399
|
+
const value = descriptor && getOwnPropertyDescriptor(descriptor, "value");
|
|
2400
|
+
if (value && typeof value.value === "function") {
|
|
2401
|
+
const method = value.value;
|
|
2402
|
+
setMethod(Constructor, method);
|
|
2403
|
+
setOwner(prototype, method);
|
|
2404
|
+
return method;
|
|
2405
|
+
}
|
|
2406
|
+
prototype = getFormatterPrototype(prototype);
|
|
2407
|
+
}
|
|
2408
|
+
};
|
|
2409
|
+
}
|
|
2410
|
+
const findFormatterPartsMethod = formatterMethodLookup("formatToParts");
|
|
2411
|
+
const findPluralRulesSelectMethod = formatterMethodLookup("select");
|
|
2412
|
+
if (typeof numberFormatIntrinsic === "function") findFormatterPartsMethod(numberFormatIntrinsic);
|
|
2413
|
+
if (typeof listFormatIntrinsic === "function") findFormatterPartsMethod(listFormatIntrinsic);
|
|
2414
|
+
if (typeof pluralRulesProvider === "function") findPluralRulesSelectMethod(pluralRulesProvider);
|
|
2415
|
+
const numberFormatMemoizers = /* @__PURE__ */ new WeakMap();
|
|
2416
|
+
numberFormatMemoizers.get.bind(numberFormatMemoizers);
|
|
2417
|
+
numberFormatMemoizers.set.bind(numberFormatMemoizers);
|
|
2418
|
+
const listFormatMemoizers = /* @__PURE__ */ new WeakMap();
|
|
2419
|
+
listFormatMemoizers.get.bind(listFormatMemoizers);
|
|
2420
|
+
listFormatMemoizers.set.bind(listFormatMemoizers);
|
|
2421
|
+
const pluralRulesMemoizers = /* @__PURE__ */ new WeakMap();
|
|
2422
|
+
pluralRulesMemoizers.get.bind(pluralRulesMemoizers);
|
|
2423
|
+
pluralRulesMemoizers.set.bind(pluralRulesMemoizers);
|
|
1607
2424
|
// packages/intl-supportedvaluesof/polyfill.ts
|
|
1608
2425
|
const intl = ensureIntl();
|
|
1609
2426
|
if (shouldPolyfill()) defineProperty(intl, "supportedValuesOf", { value: supportedValuesOf });
|