582 lines
49 KiB
JavaScript
582 lines
49 KiB
JavaScript
// Module ID: 13820
|
|
// Function ID: 13821
|
|
// Name: invariant
|
|
// Dependencies: [32, 13821]
|
|
// Exports: LookupSupportedLocales, match
|
|
|
|
// Module 13820 (invariant)
|
|
import closure_0 from "_slicedToArray" /* 32 */;
|
|
import monadic from "monadic" /* 13821 */;
|
|
|
|
function invariant(arg0, arg1) {
|
|
{
|
|
let _Error = Error;
|
|
}
|
|
if (!arg0) {
|
|
_Error = new _Error("Expected locale to not have a Unicode locale extension");
|
|
throw _Error;
|
|
}
|
|
}
|
|
function isMatched(region, str) {
|
|
[tmp2, tmp3, arr] = callback(str.split("-"), 3);
|
|
if (arr) {
|
|
if ("$" === arr[0]) {
|
|
const slice = arr.slice;
|
|
if ("!" !== arr[1]) {
|
|
let arr2 = arg2[slice(arr, 1)];
|
|
} else {
|
|
arr2 = arg2[slice(arr, 2)];
|
|
}
|
|
const mapped = arr2.map((arg0) => {
|
|
let tmp = table[arg0];
|
|
if (!tmp) {
|
|
const items = [arg0];
|
|
tmp = items;
|
|
}
|
|
return tmp;
|
|
});
|
|
const reduced = mapped.reduce((arg0, arg1) => {
|
|
const items = [...arg1];
|
|
return items;
|
|
}, []);
|
|
let str4 = region.region;
|
|
if (!str4) {
|
|
str4 = "";
|
|
}
|
|
let tmp4 = reduced.indexOf(str4) > -1 === tmp7;
|
|
}
|
|
if (tmp4) {
|
|
const script = region.script;
|
|
let tmp8 = !script;
|
|
if (script) {
|
|
tmp8 = "*" === tmp3 || tmp3 === region.script;
|
|
const tmp9 = "*" === tmp3 || tmp3 === region.script;
|
|
}
|
|
tmp4 = tmp8;
|
|
}
|
|
if (tmp4) {
|
|
const language = region.language;
|
|
let tmp10 = !language;
|
|
if (language) {
|
|
tmp10 = "*" === tmp2 || tmp2 === region.language;
|
|
const tmp11 = "*" === tmp2 || tmp2 === region.language;
|
|
}
|
|
tmp4 = tmp10;
|
|
}
|
|
return tmp4;
|
|
}
|
|
region = region.region;
|
|
tmp4 = !region;
|
|
if (region) {
|
|
tmp4 = "*" === arr || arr === region.region;
|
|
const tmp5 = "*" === arr || arr === region.region;
|
|
}
|
|
}
|
|
function serializeLSR(arg0) {
|
|
const items = [, , ];
|
|
({ language: arr[0], script: arr[1], region: arr[2] } = arg0);
|
|
const found = items.filter(Boolean);
|
|
return found.join("-");
|
|
}
|
|
function findMatchingDistanceForLSR(arg0, arg1, matchVariables) {
|
|
const iter = matchVariables.matches[Symbol.iterator]();
|
|
const nextResult = iter.next();
|
|
while (iter !== undefined) {
|
|
let tmp2 = nextResult;
|
|
let tmp3 = isMatched;
|
|
let tmp3Result = isMatched(arg0, nextResult.desired, matchVariables.matchVariables);
|
|
if (tmp3Result) {
|
|
let tmp5 = nextResult;
|
|
tmp3Result = tmp3(arg1, tmp2.supported, matchVariables.matchVariables);
|
|
}
|
|
let tmp6 = tmp3Result;
|
|
let tmp7 = nextResult;
|
|
let tmp8 = tmp2.oneway || tmp6;
|
|
if (!tmp8) {
|
|
let tmp9 = nextResult;
|
|
tmp3Result = tmp3(arg0, tmp2.supported, matchVariables.matchVariables);
|
|
if (tmp3Result) {
|
|
let tmp11 = nextResult;
|
|
tmp3Result = tmp3(arg1, tmp2.desired, matchVariables.matchVariables);
|
|
}
|
|
tmp6 = tmp3Result;
|
|
}
|
|
let tmp12 = tmp6;
|
|
if (tmp6) {
|
|
let num = 10;
|
|
let result = 10 * nextResult.distance;
|
|
let paradigmLocales = matchVariables.paradigmLocales;
|
|
let tmp14 = serializeLSR;
|
|
let num2 = -1;
|
|
let paradigmLocales1 = matchVariables.paradigmLocales;
|
|
let tmp15 = paradigmLocales.indexOf(serializeLSR(arg0)) > -1;
|
|
if (tmp15 !== paradigmLocales1.indexOf(serializeLSR(arg1)) > -1) {
|
|
let tmp17 = result;
|
|
let num3 = 1;
|
|
let diff = result - 1;
|
|
} else {
|
|
diff = result;
|
|
}
|
|
let tmp18 = iter;
|
|
iter.return();
|
|
return diff;
|
|
}
|
|
}
|
|
error = new Error("No matching distance found");
|
|
throw error;
|
|
}
|
|
function getFallbackCandidates(arg0) {
|
|
let str = arg0;
|
|
const items = [];
|
|
if (arg0) {
|
|
items.push(str);
|
|
const lastIndexOfResult = str.lastIndexOf("-");
|
|
while (-1 !== lastIndexOfResult) {
|
|
str = str.substring(0, lastIndexOfResult);
|
|
if (!str) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return items;
|
|
}
|
|
function BestFitMatcher(arr2, arr) {
|
|
let items = [];
|
|
const reduced = arr.reduce((arg0, str) => {
|
|
const replaced = str.replace(closure_1_3, "");
|
|
items.push(replaced);
|
|
arg0[replaced] = str;
|
|
return arg0;
|
|
}, {});
|
|
const tmp2 = (function findBestMatch(items, arr2) {
|
|
let tmp24;
|
|
closure_0 = arr2;
|
|
let mapped;
|
|
let Infinity = Infinity;
|
|
obj = { matchedDesiredLocale: "", distances: {} };
|
|
const value = closure_11.get(arr2);
|
|
mapped = value;
|
|
let tmp6 = value;
|
|
if (!value) {
|
|
mapped = arr2.map((arg0) => {
|
|
try {
|
|
const _Intl = Intl;
|
|
items = [arg0];
|
|
let first = Intl.getCanonicalLocales(items)[0];
|
|
if (!first) {
|
|
first = arg0;
|
|
}
|
|
return first;
|
|
} catch (err) {
|
|
return tmp;
|
|
}
|
|
});
|
|
const result = closure_11.set(arr2, mapped);
|
|
tmp6 = mapped;
|
|
}
|
|
const set = new Set(tmp6);
|
|
let num2 = 0;
|
|
if (0 < items.length) {
|
|
while (true) {
|
|
let tmp9 = items[num2];
|
|
let tmp10 = num2;
|
|
if (set.has(tmp9)) {
|
|
let result1 = 40 * num2;
|
|
obj = {};
|
|
obj[tmp9] = result1;
|
|
obj.distances[tmp9] = obj;
|
|
let tmp12 = Infinity;
|
|
if (result1 < Infinity) {
|
|
Infinity = result1;
|
|
obj.matchedDesiredLocale = tmp9;
|
|
obj.matchedSupportedLocale = tmp9;
|
|
}
|
|
if (0 === num2) {
|
|
break;
|
|
}
|
|
}
|
|
num2 = num2 + 1;
|
|
}
|
|
return obj;
|
|
}
|
|
let num3 = 0;
|
|
if (0 < items.length) {
|
|
try {
|
|
let _Intl = Intl;
|
|
const locale = new Intl.Locale(tmp13);
|
|
let str = locale.maximize();
|
|
str = str.toString();
|
|
if (str !== tmp13) {
|
|
const arr = callback(tmp20);
|
|
let num4 = 0;
|
|
if (0 < arr.length) {
|
|
while (true) {
|
|
let tmp21 = arr;
|
|
let tmp22 = num4;
|
|
let tmp23 = arr2[num4];
|
|
tmp24 = tmp23;
|
|
if (tmp23 !== tmp13) {
|
|
let tmp25 = tmp23;
|
|
if (set.has(tmp24)) {
|
|
break;
|
|
}
|
|
}
|
|
let tmp26 = num4;
|
|
let sum = num4 + 1;
|
|
num4 = sum;
|
|
let tmp28 = arr;
|
|
}
|
|
try {
|
|
const _Intl2 = Intl;
|
|
const locale1 = new Intl.Locale(tmp24);
|
|
if (str2.toString() === tmp20) {
|
|
let result2 = 40 * num3;
|
|
} else {
|
|
result2 = 10 * num4 + 40 * num3;
|
|
}
|
|
let sum1 = result2;
|
|
if (!obj.distances[tmp13]) {
|
|
obj.distances[tmp13] = {};
|
|
}
|
|
obj.distances[tmp13][tmp24] = sum1;
|
|
if (sum1 < Infinity) {
|
|
Infinity = sum1;
|
|
obj.matchedDesiredLocale = tmp13;
|
|
obj.matchedSupportedLocale = tmp24;
|
|
}
|
|
str2 = locale1.maximize();
|
|
} catch (err) {
|
|
sum1 = tmp2 * tmp4 + tmp3 * tmp;
|
|
}
|
|
}
|
|
}
|
|
num3 = num3 + 1;
|
|
} catch (err) {
|
|
}
|
|
}
|
|
let matchedSupportedLocale = obj.matchedSupportedLocale;
|
|
if (matchedSupportedLocale) {
|
|
matchedSupportedLocale = 0 === Infinity;
|
|
}
|
|
if (!matchedSupportedLocale) {
|
|
Infinity = Infinity;
|
|
let item = items.forEach((arg0, arg1) => {
|
|
closure_0 = arg0;
|
|
closure_1 = arg1;
|
|
if (!obj.distances[arg0]) {
|
|
obj.distances[arg0] = {};
|
|
}
|
|
const item = mapped.forEach((arg0, arg1) => {
|
|
const sum = closure_2_9(table, arg0) + 40 * closure_1;
|
|
closure_1_2.distances[table][table[arg1]] = sum;
|
|
if (sum < closure_1) {
|
|
closure_1 = sum;
|
|
tmp4.matchedDesiredLocale = table;
|
|
tmp4.matchedSupportedLocale = tmp;
|
|
}
|
|
});
|
|
});
|
|
if (Infinity >= num) {
|
|
obj.matchedDesiredLocale = undefined;
|
|
obj.matchedSupportedLocale = undefined;
|
|
}
|
|
}
|
|
return obj;
|
|
})(items, arr2);
|
|
let prop;
|
|
if (tmp3) {
|
|
arr2 = reduced[tmp2.matchedDesiredLocale];
|
|
let tmp6 = reduced[tmp2.matchedDesiredLocale].slice(tmp2.matchedDesiredLocale.length) || undefined;
|
|
prop = tmp2.matchedSupportedLocale;
|
|
const tmp4 = reduced[tmp2.matchedDesiredLocale].slice(tmp2.matchedDesiredLocale.length) || undefined;
|
|
}
|
|
if (prop) {
|
|
obj = { locale: null, extension: null };
|
|
obj[0] = prop;
|
|
obj[1] = tmp4;
|
|
} else {
|
|
obj = { locale: null };
|
|
obj[0] = arg2();
|
|
}
|
|
return obj;
|
|
}
|
|
function CanonicalizeUnicodeLocaleId(items) {
|
|
return Intl.getCanonicalLocales(items)[0];
|
|
}
|
|
function BestAvailableLocale(items) {
|
|
let value = weakMap1.get(items);
|
|
if (!value) {
|
|
const _Set = Set;
|
|
const set = new Set(items);
|
|
const result = weakMap1.set(items, set);
|
|
value = set;
|
|
}
|
|
let substr = arg1;
|
|
while (!value.has(substr)) {
|
|
let lastIndexOfResult = substr.lastIndexOf("-");
|
|
if (~lastIndexOfResult) {
|
|
let tmp9 = lastIndexOfResult >= 2 && "-" === substr[lastIndexOfResult - 2];
|
|
let diff = lastIndexOfResult;
|
|
if (tmp9) {
|
|
diff = lastIndexOfResult - 2;
|
|
}
|
|
substr = substr.slice(0, diff);
|
|
continue;
|
|
}
|
|
}
|
|
return substr;
|
|
}
|
|
class ResolveLocale {
|
|
constructor(arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
closure_0 = importDefault;
|
|
if ("lookup" === importDefault.localeMatcher) {
|
|
tmp4 = globalThis;
|
|
_Array2 = Array;
|
|
num2 = 0;
|
|
tmp3 = (function LookupMatcher(arg0, arg1, arg2) {
|
|
obj = { locale: "" };
|
|
const iter = arg1[Symbol.iterator]();
|
|
const str = iter.next();
|
|
while (iter !== undefined) {
|
|
let arr = str;
|
|
let tmp = closure_3;
|
|
let replaced = str.replace(closure_3, "");
|
|
let tmp3 = callback;
|
|
let tmp2 = replaced;
|
|
let tmp4 = callback(arg0, replaced);
|
|
let tmp5 = tmp4;
|
|
if (tmp4) {
|
|
obj.locale = tmp4;
|
|
let tmp6 = str;
|
|
let tmp7 = replaced;
|
|
if (arr !== tmp2) {
|
|
let tmp8 = str;
|
|
obj.extension = arr.slice(replaced.length, arr.length);
|
|
}
|
|
let tmp9 = iter;
|
|
iter.return();
|
|
return obj;
|
|
}
|
|
}
|
|
obj.locale = arg2();
|
|
return obj;
|
|
})(Array.from(global), arg1, exports);
|
|
} else {
|
|
tmp = BestFitMatcher;
|
|
tmp2 = globalThis;
|
|
_Array = Array;
|
|
num = 0;
|
|
tmp3 = BestFitMatcher(Array.from(global), arg1, exports);
|
|
}
|
|
locale = tmp3.locale;
|
|
closure_2 = module[locale];
|
|
closure_3 = { locale: "en", dataLocale: locale };
|
|
if (tmp3.extension) {
|
|
num3 = 0;
|
|
closure_1 = (function UnicodeExtensionComponents(extension) {
|
|
if (extension === extension.toLowerCase()) {
|
|
let num = 3;
|
|
if ("-u-" === extension.slice(0, 3)) {
|
|
const items = [];
|
|
const items1 = [];
|
|
if (num < extension.length) {
|
|
while (true) {
|
|
let index = extension.indexOf("-", num);
|
|
let tmp13 = num;
|
|
let tmp14 = iter;
|
|
let tmp15 = -1 === index ? length - num : index - num;
|
|
let substr = extension.slice(num, num + tmp15);
|
|
let _Error = Error;
|
|
if (2 > tmp15) {
|
|
break;
|
|
} else {
|
|
if (undefined === iter) {
|
|
if (2 !== tmp15) {
|
|
let tmp27 = iter;
|
|
if (-1 === items.indexOf(substr)) {
|
|
let arr = items.push(substr);
|
|
tmp27 = iter;
|
|
}
|
|
num = num + (tmp15 + 1);
|
|
iter = tmp27;
|
|
}
|
|
}
|
|
if (2 === tmp15) {
|
|
obj = { key: null, value: "" };
|
|
obj[0] = substr;
|
|
tmp27 = obj;
|
|
if (undefined === items1.find((key) => {
|
|
key = undefined;
|
|
if (obj != null) {
|
|
key = obj.key;
|
|
}
|
|
return key.key === key;
|
|
})) {
|
|
arr = items1.push(obj);
|
|
tmp27 = obj;
|
|
}
|
|
} else {
|
|
let value;
|
|
if (iter != null) {
|
|
value = iter.value;
|
|
}
|
|
if ("" === value) {
|
|
iter.value = substr;
|
|
tmp27 = iter;
|
|
} else if (undefined !== iter) {
|
|
iter.value = `${iter.value}-${tmp16}`;
|
|
tmp27 = iter;
|
|
} else {
|
|
let tmp23 = new.target;
|
|
let str7 = "Expected keyword to be defined";
|
|
let tmp24 = new.target;
|
|
tmp22 = new tmp22("Expected keyword to be defined");
|
|
let tmp26 = tmp22;
|
|
throw tmp22;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
_Error = new _Error("Expected a subtag to have at least 2 characters");
|
|
throw _Error;
|
|
}
|
|
obj = { attributes: null, keywords: null };
|
|
obj[0] = items;
|
|
obj[1] = items1;
|
|
return obj;
|
|
} else {
|
|
tmp6 = new tmp6("Expected extension to be a Unicode locale extension");
|
|
throw tmp6;
|
|
}
|
|
} else {
|
|
tmp = new tmp("Expected extension to be lowercase");
|
|
throw tmp;
|
|
}
|
|
})(tmp3.extension).keywords;
|
|
} else {
|
|
closure_1 = [];
|
|
}
|
|
closure_4 = [];
|
|
tmp5 = importAll[Symbol.iterator]();
|
|
return;
|
|
}
|
|
}
|
|
let items = [{ paradigmLocales: { _locales: "en en_GB es es_419 pt_BR pt_PT" } }, { $enUS: { _value: "AS+CA+GU+MH+MP+PH+PR+UM+US+VI" } }, { $cnsar: { _value: "HK+MO" } }, { $americas: { _value: "019" } }, { $maghreb: { _value: "MA+DZ+TN+LY+MR+EH" } }, { no: { _desired: "nb", _distance: "1" } }, { bs: { _desired: "hr", _distance: "4" } }, { bs: { _desired: "sh", _distance: "4" } }, { hr: { _desired: "sh", _distance: "4" } }, { sr: { _desired: "sh", _distance: "4" } }, { aa: { _desired: "ssy", _distance: "4" } }, { de: { _desired: "gsw", _distance: "4", _oneway: "true" } }, { de: { _desired: "lb", _distance: "4", _oneway: "true" } }, { no: { _desired: "da", _distance: "8" } }, { nb: { _desired: "da", _distance: "8" } }, { ru: { _desired: "ab", _distance: "30", _oneway: "true" } }, { en: { _desired: "ach", _distance: "30", _oneway: "true" } }, { nl: { _desired: "af", _distance: "20", _oneway: "true" } }, { en: { _desired: "ak", _distance: "30", _oneway: "true" } }, { en: { _desired: "am", _distance: "30", _oneway: "true" } }, { es: { _desired: "ay", _distance: "20", _oneway: "true" } }, { ru: { _desired: "az", _distance: "30", _oneway: "true" } }, { ur: { _desired: "bal", _distance: "20", _oneway: "true" } }, { ru: { _desired: "be", _distance: "20", _oneway: "true" } }, { en: { _desired: "bem", _distance: "30", _oneway: "true" } }, { hi: { _desired: "bh", _distance: "30", _oneway: "true" } }, { en: { _desired: "bn", _distance: "30", _oneway: "true" } }, { zh: { _desired: "bo", _distance: "20", _oneway: "true" } }, { fr: { _desired: "br", _distance: "20", _oneway: "true" } }, { es: { _desired: "ca", _distance: "20", _oneway: "true" } }, { fil: { _desired: "ceb", _distance: "30", _oneway: "true" } }, { en: { _desired: "chr", _distance: "20", _oneway: "true" } }, { ar: { _desired: "ckb", _distance: "30", _oneway: "true" } }, { fr: { _desired: "co", _distance: "20", _oneway: "true" } }, { fr: { _desired: "crs", _distance: "20", _oneway: "true" } }, { sk: { _desired: "cs", _distance: "20" } }, { en: { _desired: "cy", _distance: "20", _oneway: "true" } }, { en: { _desired: "ee", _distance: "30", _oneway: "true" } }, { en: { _desired: "eo", _distance: "30", _oneway: "true" } }, { es: { _desired: "eu", _distance: "20", _oneway: "true" } }, { da: { _desired: "fo", _distance: "20", _oneway: "true" } }, { nl: { _desired: "fy", _distance: "20", _oneway: "true" } }, { en: { _desired: "ga", _distance: "20", _oneway: "true" } }, { en: { _desired: "gaa", _distance: "30", _oneway: "true" } }, { en: { _desired: "gd", _distance: "20", _oneway: "true" } }, { es: { _desired: "gl", _distance: "20", _oneway: "true" } }, { es: { _desired: "gn", _distance: "20", _oneway: "true" } }, { hi: { _desired: "gu", _distance: "30", _oneway: "true" } }, { en: { _desired: "ha", _distance: "30", _oneway: "true" } }, { en: { _desired: "haw", _distance: "20", _oneway: "true" } }, { fr: { _desired: "ht", _distance: "20", _oneway: "true" } }, { ru: { _desired: "hy", _distance: "30", _oneway: "true" } }, { en: { _desired: "ia", _distance: "30", _oneway: "true" } }, { en: { _desired: "ig", _distance: "30", _oneway: "true" } }, { en: { _desired: "is", _distance: "20", _oneway: "true" } }, { id: { _desired: "jv", _distance: "20", _oneway: "true" } }, { en: { _desired: "ka", _distance: "30", _oneway: "true" } }, { fr: { _desired: "kg", _distance: "30", _oneway: "true" } }, { ru: { _desired: "kk", _distance: "30", _oneway: "true" } }, { en: { _desired: "km", _distance: "30", _oneway: "true" } }, { en: { _desired: "kn", _distance: "30", _oneway: "true" } }, { en: { _desired: "kri", _distance: "30", _oneway: "true" } }, { tr: { _desired: "ku", _distance: "30", _oneway: "true" } }, { ru: { _desired: "ky", _distance: "30", _oneway: "true" } }, { it: { _desired: "la", _distance: "20", _oneway: "true" } }, { en: { _desired: "lg", _distance: "30", _oneway: "true" } }, { fr: { _desired: "ln", _distance: "30", _oneway: "true" } }, { en: { _desired: "lo", _distance: "30", _oneway: "true" } }, { en: { _desired: "loz", _distance: "30", _oneway: "true" } }, { fr: { _desired: "lua", _distance: "30", _oneway: "true" } }, { hi: { _desired: "mai", _distance: "20", _oneway: "true" } }, { en: { _desired: "mfe", _distance: "30", _oneway: "true" } }, { fr: { _desired: "mg", _distance: "30", _oneway: "true" } }, { en: { _desired: "mi", _distance: "20", _oneway: "true" } }, { en: { _desired: "ml", _distance: "30", _oneway: "true" } }, { ru: { _desired: "mn", _distance: "30", _oneway: "true" } }, { hi: { _desired: "mr", _distance: "30", _oneway: "true" } }, { id: { _desired: "ms", _distance: "30", _oneway: "true" } }, { en: { _desired: "mt", _distance: "30", _oneway: "true" } }, { en: { _desired: "my", _distance: "30", _oneway: "true" } }, { en: { _desired: "ne", _distance: "30", _oneway: "true" } }, { nb: { _desired: "nn", _distance: "20" } }, { no: { _desired: "nn", _distance: "20" } }, { en: { _desired: "nso", _distance: "30", _oneway: "true" } }, { en: { _desired: "ny", _distance: "30", _oneway: "true" } }, { en: { _desired: "nyn", _distance: "30", _oneway: "true" } }, { fr: { _desired: "oc", _distance: "20", _oneway: "true" } }, { en: { _desired: "om", _distance: "30", _oneway: "true" } }, { en: { _desired: "or", _distance: "30", _oneway: "true" } }, { en: { _desired: "pa", _distance: "30", _oneway: "true" } }, { en: { _desired: "pcm", _distance: "20", _oneway: "true" } }, { en: { _desired: "ps", _distance: "30", _oneway: "true" } }, { es: { _desired: "qu", _distance: "30", _oneway: "true" } }, { de: { _desired: "rm", _distance: "20", _oneway: "true" } }, { en: { _desired: "rn", _distance: "30", _oneway: "true" } }, { fr: { _desired: "rw", _distance: "30", _oneway: "true" } }, { hi: { _desired: "sa", _distance: "30", _oneway: "true" } }, { en: { _desired: "sd", _distance: "30", _oneway: "true" } }, { en: { _desired: "si", _distance: "30", _oneway: "true" } }, { en: { _desired: "sn", _distance: "30", _oneway: "true" } }, { en: { _desired: "so", _distance: "30", _oneway: "true" } }, { en: { _desired: "sq", _distance: "30", _oneway: "true" } }, { en: { _desired: "st", _distance: "30", _oneway: "true" } }, { id: { _desired: "su", _distance: "20", _oneway: "true" } }, { en: { _desired: "sw", _distance: "30", _oneway: "true" } }, { en: { _desired: "ta", _distance: "30", _oneway: "true" } }, { en: { _desired: "te", _distance: "30", _oneway: "true" } }, { ru: { _desired: "tg", _distance: "30", _oneway: "true" } }, { en: { _desired: "ti", _distance: "30", _oneway: "true" } }, { ru: { _desired: "tk", _distance: "30", _oneway: "true" } }, { en: { _desired: "tlh", _distance: "30", _oneway: "true" } }, { en: { _desired: "tn", _distance: "30", _oneway: "true" } }, { en: { _desired: "to", _distance: "30", _oneway: "true" } }, { ru: { _desired: "tt", _distance: "30", _oneway: "true" } }, { en: { _desired: "tum", _distance: "30", _oneway: "true" } }, { zh: { _desired: "ug", _distance: "20", _oneway: "true" } }, { ru: { _desired: "uk", _distance: "20", _oneway: "true" } }, { en: { _desired: "ur", _distance: "30", _oneway: "true" } }, { ru: { _desired: "uz", _distance: "30", _oneway: "true" } }, { fr: { _desired: "wo", _distance: "30", _oneway: "true" } }, { en: { _desired: "xh", _distance: "30", _oneway: "true" } }, { en: { _desired: "yi", _distance: "30", _oneway: "true" } }, { en: { _desired: "yo", _distance: "30", _oneway: "true" } }, { zh: { _desired: "za", _distance: "20", _oneway: "true" } }, { en: { _desired: "zu", _distance: "30", _oneway: "true" } }, { ar: { _desired: "aao", _distance: "10", _oneway: "true" } }, { ar: { _desired: "abh", _distance: "10", _oneway: "true" } }, { ar: { _desired: "abv", _distance: "10", _oneway: "true" } }, { ar: { _desired: "acm", _distance: "10", _oneway: "true" } }, { ar: { _desired: "acq", _distance: "10", _oneway: "true" } }, { ar: { _desired: "acw", _distance: "10", _oneway: "true" } }, { ar: { _desired: "acx", _distance: "10", _oneway: "true" } }, { ar: { _desired: "acy", _distance: "10", _oneway: "true" } }, { ar: { _desired: "adf", _distance: "10", _oneway: "true" } }, { ar: { _desired: "aeb", _distance: "10", _oneway: "true" } }, { ar: { _desired: "aec", _distance: "10", _oneway: "true" } }, { ar: { _desired: "afb", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ajp", _distance: "10", _oneway: "true" } }, { ar: { _desired: "apc", _distance: "10", _oneway: "true" } }, { ar: { _desired: "apd", _distance: "10", _oneway: "true" } }, { ar: { _desired: "arq", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ars", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ary", _distance: "10", _oneway: "true" } }, { ar: { _desired: "arz", _distance: "10", _oneway: "true" } }, { ar: { _desired: "auz", _distance: "10", _oneway: "true" } }, { ar: { _desired: "avl", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ayh", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ayl", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ayn", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ayp", _distance: "10", _oneway: "true" } }, { ar: { _desired: "bbz", _distance: "10", _oneway: "true" } }, { ar: { _desired: "pga", _distance: "10", _oneway: "true" } }, { ar: { _desired: "shu", _distance: "10", _oneway: "true" } }, { ar: { _desired: "ssh", _distance: "10", _oneway: "true" } }, { az: { _desired: "azb", _distance: "10", _oneway: "true" } }, { et: { _desired: "vro", _distance: "10", _oneway: "true" } }, { ff: { _desired: "ffm", _distance: "10", _oneway: "true" } }, { ff: { _desired: "fub", _distance: "10", _oneway: "true" } }, { ff: { _desired: "fue", _distance: "10", _oneway: "true" } }, { ff: { _desired: "fuf", _distance: "10", _oneway: "true" } }, { ff: { _desired: "fuh", _distance: "10", _oneway: "true" } }, { ff: { _desired: "fui", _distance: "10", _oneway: "true" } }, { ff: { _desired: "fuq", _distance: "10", _oneway: "true" } }, { ff: { _desired: "fuv", _distance: "10", _oneway: "true" } }, { gn: { _desired: "gnw", _distance: "10", _oneway: "true" } }, { gn: { _desired: "gui", _distance: "10", _oneway: "true" } }, { gn: { _desired: "gun", _distance: "10", _oneway: "true" } }, { gn: { _desired: "nhd", _distance: "10", _oneway: "true" } }, { iu: { _desired: "ikt", _distance: "10", _oneway: "true" } }, { kln: { _desired: "enb", _distance: "10", _oneway: "true" } }, { kln: { _desired: "eyo", _distance: "10", _oneway: "true" } }, { kln: { _desired: "niq", _distance: "10", _oneway: "true" } }, { kln: { _desired: "oki", _distance: "10", _oneway: "true" } }, { kln: { _desired: "pko", _distance: "10", _oneway: "true" } }, { kln: { _desired: "sgc", _distance: "10", _oneway: "true" } }, { kln: { _desired: "tec", _distance: "10", _oneway: "true" } }, { kln: { _desired: "tuy", _distance: "10", _oneway: "true" } }, { kok: { _desired: "gom", _distance: "10", _oneway: "true" } }, { kpe: { _desired: "gkp", _distance: "10", _oneway: "true" } }, { luy: { _desired: "ida", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lkb", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lko", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lks", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lri", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lrm", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lsm", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lto", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lts", _distance: "10", _oneway: "true" } }, { luy: { _desired: "lwg", _distance: "10", _oneway: "true" } }, { luy: { _desired: "nle", _distance: "10", _oneway: "true" } }, { luy: { _desired: "nyd", _distance: "10", _oneway: "true" } }, { luy: { _desired: "rag", _distance: "10", _oneway: "true" } }, { lv: { _desired: "ltg", _distance: "10", _oneway: "true" } }, { mg: { _desired: "bhr", _distance: "10", _oneway: "true" } }, { mg: { _desired: "bjq", _distance: "10", _oneway: "true" } }, { mg: { _desired: "bmm", _distance: "10", _oneway: "true" } }, { mg: { _desired: "bzc", _distance: "10", _oneway: "true" } }, { mg: { _desired: "msh", _distance: "10", _oneway: "true" } }, { mg: { _desired: "skg", _distance: "10", _oneway: "true" } }, { mg: { _desired: "tdx", _distance: "10", _oneway: "true" } }, { mg: { _desired: "tkg", _distance: "10", _oneway: "true" } }, { mg: { _desired: "txy", _distance: "10", _oneway: "true" } }, { mg: { _desired: "xmv", _distance: "10", _oneway: "true" } }, { mg: { _desired: "xmw", _distance: "10", _oneway: "true" } }, { mn: { _desired: "mvf", _distance: "10", _oneway: "true" } }, { ms: { _desired: "bjn", _distance: "10", _oneway: "true" } }, { ms: { _desired: "btj", _distance: "10", _oneway: "true" } }, { ms: { _desired: "bve", _distance: "10", _oneway: "true" } }, { ms: { _desired: "bvu", _distance: "10", _oneway: "true" } }, { ms: { _desired: "coa", _distance: "10", _oneway: "true" } }, { ms: { _desired: "dup", _distance: "10", _oneway: "true" } }, { ms: { _desired: "hji", _distance: "10", _oneway: "true" } }, { ms: { _desired: "id", _distance: "10", _oneway: "true" } }, { ms: { _desired: "jak", _distance: "10", _oneway: "true" } }, { ms: { _desired: "jax", _distance: "10", _oneway: "true" } }, { ms: { _desired: "kvb", _distance: "10", _oneway: "true" } }, { ms: { _desired: "kvr", _distance: "10", _oneway: "true" } }, { ms: { _desired: "kxd", _distance: "10", _oneway: "true" } }, { ms: { _desired: "lce", _distance: "10", _oneway: "true" } }, { ms: { _desired: "lcf", _distance: "10", _oneway: "true" } }, { ms: { _desired: "liw", _distance: "10", _oneway: "true" } }, { ms: { _desired: "max", _distance: "10", _oneway: "true" } }, { ms: { _desired: "meo", _distance: "10", _oneway: "true" } }, { ms: { _desired: "mfa", _distance: "10", _oneway: "true" } }, { ms: { _desired: "mfb", _distance: "10", _oneway: "true" } }, { ms: { _desired: "min", _distance: "10", _oneway: "true" } }, { ms: { _desired: "mqg", _distance: "10", _oneway: "true" } }, { ms: { _desired: "msi", _distance: "10", _oneway: "true" } }, { ms: { _desired: "mui", _distance: "10", _oneway: "true" } }, { ms: { _desired: "orn", _distance: "10", _oneway: "true" } }, { ms: { _desired: "ors", _distance: "10", _oneway: "true" } }, { ms: { _desired: "pel", _distance: "10", _oneway: "true" } }, { ms: { _desired: "pse", _distance: "10", _oneway: "true" } }, { ms: { _desired: "tmw", _distance: "10", _oneway: "true" } }, { ms: { _desired: "urk", _distance: "10", _oneway: "true" } }, { ms: { _desired: "vkk", _distance: "10", _oneway: "true" } }, { ms: { _desired: "vkt", _distance: "10", _oneway: "true" } }, { ms: { _desired: "xmm", _distance: "10", _oneway: "true" } }, { ms: { _desired: "zlm", _distance: "10", _oneway: "true" } }, { ms: { _desired: "zmi", _distance: "10", _oneway: "true" } }, { ne: { _desired: "dty", _distance: "10", _oneway: "true" } }, { om: { _desired: "gax", _distance: "10", _oneway: "true" } }, { om: { _desired: "hae", _distance: "10", _oneway: "true" } }, { om: { _desired: "orc", _distance: "10", _oneway: "true" } }, { or: { _desired: "spv", _distance: "10", _oneway: "true" } }, { ps: { _desired: "pbt", _distance: "10", _oneway: "true" } }, { ps: { _desired: "pst", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qub", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qud", _distance: "10", _oneway: "true" } }, { qu: { _desired: "quf", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qug", _distance: "10", _oneway: "true" } }, { qu: { _desired: "quh", _distance: "10", _oneway: "true" } }, { qu: { _desired: "quk", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qul", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qup", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qur", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qus", _distance: "10", _oneway: "true" } }, { qu: { _desired: "quw", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qux", _distance: "10", _oneway: "true" } }, { qu: { _desired: "quy", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qva", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvc", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qve", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvh", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvi", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvj", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvl", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvm", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvn", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvo", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvp", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvs", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvw", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qvz", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qwa", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qwc", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qwh", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qws", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxa", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxc", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxh", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxl", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxn", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxo", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxp", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxr", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxt", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxu", _distance: "10", _oneway: "true" } }, { qu: { _desired: "qxw", _distance: "10", _oneway: "true" } }, { sc: { _desired: "sdc", _distance: "10", _oneway: "true" } }, { sc: { _desired: "sdn", _distance: "10", _oneway: "true" } }, { sc: { _desired: "sro", _distance: "10", _oneway: "true" } }, { sq: { _desired: "aae", _distance: "10", _oneway: "true" } }, { sq: { _desired: "aat", _distance: "10", _oneway: "true" } }, { sq: { _desired: "aln", _distance: "10", _oneway: "true" } }, { syr: { _desired: "aii", _distance: "10", _oneway: "true" } }, { uz: { _desired: "uzs", _distance: "10", _oneway: "true" } }, { yi: { _desired: "yih", _distance: "10", _oneway: "true" } }, { zh: { _desired: "cdo", _distance: "10", _oneway: "true" } }, { zh: { _desired: "cjy", _distance: "10", _oneway: "true" } }, { zh: { _desired: "cpx", _distance: "10", _oneway: "true" } }, { zh: { _desired: "czh", _distance: "10", _oneway: "true" } }, { zh: { _desired: "czo", _distance: "10", _oneway: "true" } }, { zh: { _desired: "gan", _distance: "10", _oneway: "true" } }, { zh: { _desired: "hak", _distance: "10", _oneway: "true" } }, { zh: { _desired: "hsn", _distance: "10", _oneway: "true" } }, { zh: { _desired: "lzh", _distance: "10", _oneway: "true" } }, { zh: { _desired: "mnp", _distance: "10", _oneway: "true" } }, { zh: { _desired: "nan", _distance: "10", _oneway: "true" } }, { zh: { _desired: "wuu", _distance: "10", _oneway: "true" } }, { zh: { _desired: "yue", _distance: "10", _oneway: "true" } }, { "*": { _desired: "*", _distance: "80" } }, { "en-Latn": { _desired: "am-Ethi", _distance: "10", _oneway: "true" } }, { "ru-Cyrl": { _desired: "az-Latn", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "bn-Beng", _distance: "10", _oneway: "true" } }, { "zh-Hans": { _desired: "bo-Tibt", _distance: "10", _oneway: "true" } }, { "ru-Cyrl": { _desired: "hy-Armn", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "ka-Geor", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "km-Khmr", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "kn-Knda", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "lo-Laoo", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "ml-Mlym", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "my-Mymr", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "ne-Deva", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "or-Orya", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "pa-Guru", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "ps-Arab", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "sd-Arab", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "si-Sinh", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "ta-Taml", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "te-Telu", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "ti-Ethi", _distance: "10", _oneway: "true" } }, { "ru-Cyrl": { _desired: "tk-Latn", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "ur-Arab", _distance: "10", _oneway: "true" } }, { "ru-Cyrl": { _desired: "uz-Latn", _distance: "10", _oneway: "true" } }, { "en-Latn": { _desired: "yi-Hebr", _distance: "10", _oneway: "true" } }, { "sr-Cyrl": { _desired: "sr-Latn", _distance: "5" } }, { "zh-Hans": { _desired: "za-Latn", _distance: "10", _oneway: "true" } }, { "zh-Hans": { _desired: "zh-Hani", _distance: "20", _oneway: "true" } }, { "zh-Hant": { _desired: "zh-Hani", _distance: "20", _oneway: "true" } }, { "ar-Arab": { _desired: "ar-Latn", _distance: "20", _oneway: "true" } }, { "bn-Beng": { _desired: "bn-Latn", _distance: "20", _oneway: "true" } }, { "gu-Gujr": { _desired: "gu-Latn", _distance: "20", _oneway: "true" } }, { "hi-Deva": { _desired: "hi-Latn", _distance: "20", _oneway: "true" } }, { "kn-Knda": { _desired: "kn-Latn", _distance: "20", _oneway: "true" } }, { "ml-Mlym": { _desired: "ml-Latn", _distance: "20", _oneway: "true" } }, { "mr-Deva": { _desired: "mr-Latn", _distance: "20", _oneway: "true" } }, { "ta-Taml": { _desired: "ta-Latn", _distance: "20", _oneway: "true" } }, { "te-Telu": { _desired: "te-Latn", _distance: "20", _oneway: "true" } }, { "zh-Hans": { _desired: "zh-Latn", _distance: "20", _oneway: "true" } }, { "ja-Jpan": { _desired: "ja-Latn", _distance: "5", _oneway: "true" } }, { "ja-Jpan": { _desired: "ja-Hani", _distance: "5", _oneway: "true" } }, { "ja-Jpan": { _desired: "ja-Hira", _distance: "5", _oneway: "true" } }, { "ja-Jpan": { _desired: "ja-Kana", _distance: "5", _oneway: "true" } }, { "ja-Jpan": { _desired: "ja-Hrkt", _distance: "5", _oneway: "true" } }, { "ja-Hrkt": { _desired: "ja-Hira", _distance: "5", _oneway: "true" } }, { "ja-Hrkt": { _desired: "ja-Kana", _distance: "5", _oneway: "true" } }, { "ko-Kore": { _desired: "ko-Hani", _distance: "5", _oneway: "true" } }, { "ko-Kore": { _desired: "ko-Hang", _distance: "5", _oneway: "true" } }, { "ko-Kore": { _desired: "ko-Jamo", _distance: "5", _oneway: "true" } }, { "ko-Hang": { _desired: "ko-Jamo", _distance: "5", _oneway: "true" } }, { "*-*": { _desired: "*-*", _distance: "50" } }, { "ar-*-$maghreb": { _desired: "ar-*-$maghreb", _distance: "4" } }, { "ar-*-$!maghreb": { _desired: "ar-*-$!maghreb", _distance: "4" } }, { "ar-*-*": { _desired: "ar-*-*", _distance: "5" } }, { "en-*-$enUS": { _desired: "en-*-$enUS", _distance: "4" } }, { "en-*-GB": { _desired: "en-*-$!enUS", _distance: "3" } }, { "en-*-$!enUS": { _desired: "en-*-$!enUS", _distance: "4" } }, { "en-*-*": { _desired: "en-*-*", _distance: "5" } }, { "es-*-$americas": { _desired: "es-*-$americas", _distance: "4" } }, { "es-*-$!americas": { _desired: "es-*-$!americas", _distance: "4" } }, { "es-*-*": { _desired: "es-*-*", _distance: "5" } }, { "pt-*-$americas": { _desired: "pt-*-$americas", _distance: "4" } }, { "pt-*-$!americas": { _desired: "pt-*-$!americas", _distance: "4" } }, { "pt-*-*": { _desired: "pt-*-*", _distance: "5" } }, { "zh-Hant-$cnsar": { _desired: "zh-Hant-$cnsar", _distance: "4" } }, { "zh-Hant-$!cnsar": { _desired: "zh-Hant-$!cnsar", _distance: "4" } }, { "zh-Hant-*": { _desired: "zh-Hant-*", _distance: "5" } }, { "*-*-*": { _desired: "*-*-*", _distance: "4" } }];
|
|
let closure_1 = { supplemental: { languageMatching: { "written-new": items } } };
|
|
let obj = { "001": ["001", "001-status-grouping", "002", "005", "009", "011", "013", "014", "015", "017", "018", "019", "021", "029", "030", "034", "035", "039", "053", "054", "057", "061", "142", "143", "145", "150", "151", "154", "155", "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CP", "CQ", "CR", "CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DG", "DJ", "DK", "DM", "DO", "DZ", "EA", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "EU", "EZ", "FI", "FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU", "IC", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PW", "PY", "QA", "QO", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SY", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "UM", "UN", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"], "002": ["002", "002-status-grouping", "011", "014", "015", "017", "018", "202", "AO", "BF", "BI", "BJ", "BW", "CD", "CF", "CG", "CI", "CM", "CV", "DJ", "DZ", "EA", "EG", "EH", "ER", "ET", "GA", "GH", "GM", "GN", "GQ", "GW", "IC", "IO", "KE", "KM", "LR", "LS", "LY", "MA", "MG", "ML", "MR", "MU", "MW", "MZ", "NA", "NE", "NG", "RE", "RW", "SC", "SD", "SH", "SL", "SN", "SO", "SS", "ST", "SZ", "TD", "TF", "TG", "TN", "TZ", "UG", "YT", "ZA", "ZM", "ZW"], "003": ["003", "013", "021", "029", "AG", "AI", "AW", "BB", "BL", "BM", "BQ", "BS", "BZ", "CA", "CR", "CU", "CW", "DM", "DO", "GD", "GL", "GP", "GT", "HN", "HT", "JM", "KN", "KY", "LC", "MF", "MQ", "MS", "MX", "NI", "PA", "PM", "PR", "SV", "SX", "TC", "TT", "US", "VC", "VG", "VI"], "005": ["005", "AR", "BO", "BR", "BV", "CL", "CO", "EC", "FK", "GF", "GS", "GY", "PE", "PY", "SR", "UY", "VE"], "009": ["009", "053", "054", "057", "061", "AC", "AQ", "AS", "AU", "CC", "CK", "CP", "CX", "DG", "FJ", "FM", "GU", "HM", "KI", "MH", "MP", "NC", "NF", "NR", "NU", "NZ", "PF", "PG", "PN", "PW", "QO", "SB", "TA", "TK", "TO", "TV", "UM", "VU", "WF", "WS"], "011": ["011", "BF", "BJ", "CI", "CV", "GH", "GM", "GN", "GW", "LR", "ML", "MR", "NE", "NG", "SH", "SL", "SN", "TG"], "013": ["013", "BZ", "CR", "GT", "HN", "MX", "NI", "PA", "SV"], "014": ["014", "BI", "DJ", "ER", "ET", "IO", "KE", "KM", "MG", "MU", "MW", "MZ", "RE", "RW", "SC", "SO", "SS", "TF", "TZ", "UG", "YT", "ZM", "ZW"], "015": ["015", "DZ", "EA", "EG", "EH", "IC", "LY", "MA", "SD", "TN"], "017": ["017", "AO", "CD", "CF", "CG", "CM", "GA", "GQ", "ST", "TD"], "018": ["018", "BW", "LS", "NA", "SZ", "ZA"], "019": ["003", "005", "013", "019", "019-status-grouping", "021", "029", "419", "AG", "AI", "AR", "AW", "BB", "BL", "BM", "BO", "BQ", "BR", "BS", "BV", "BZ", "CA", "CL", "CO", "CR", "CU", "CW", "DM", "DO", "EC", "FK", "GD", "GF", "GL", "GP", "GS", "GT", "GY", "HN", "HT", "JM", "KN", "KY", "LC", "MF", "MQ", "MS", "MX", "NI", "PA", "PE", "PM", "PR", "PY", "SR", "SV", "SX", "TC", "TT", "US", "UY", "VC", "VE", "VG", "VI"], "021": ["021", "BM", "CA", "GL", "PM", "US"], "029": ["029", "AG", "AI", "AW", "BB", "BL", "BQ", "BS", "CU", "CW", "DM", "DO", "GD", "GP", "HT", "JM", "KN", "KY", "LC", "MF", "MQ", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], "030": ["030", "CN", "HK", "JP", "KP", "KR", "MN", "MO", "TW"], "034": ["034", "AF", "BD", "BT", "IN", "IR", "LK", "MV", "NP", "PK"], "035": ["035", "BN", "ID", "KH", "LA", "MM", "MY", "PH", "SG", "TH", "TL", "VN"], "039": ["039", "AD", "AL", "BA", "ES", "GI", "GR", "HR", "IT", "ME", "MK", "MT", "PT", "RS", "SI", "SM", "VA", "XK"], "053": ["053", "AU", "CC", "CX", "HM", "NF", "NZ"], "054": ["054", "FJ", "NC", "PG", "SB", "VU"], "057": ["057", "FM", "GU", "KI", "MH", "MP", "NR", "PW", "UM"], "061": ["061", "AS", "CK", "NU", "PF", "PN", "TK", "TO", "TV", "WF", "WS"], 142: null, 143: null, 145: null, 150: null, 151: null, 154: null, 155: null, 202: null, 419: null, EU: null, EZ: null, QO: null, UN: null };
|
|
obj[142] = ["030", "034", "035", "142", "143", "145", "AE", "AF", "AM", "AZ", "BD", "BH", "BN", "BT", "CN", "CY", "GE", "HK", "ID", "IL", "IN", "IQ", "IR", "JO", "JP", "KG", "KH", "KP", "KR", "KW", "KZ", "LA", "LB", "LK", "MM", "MN", "MO", "MV", "MY", "NP", "OM", "PH", "PK", "PS", "QA", "SA", "SG", "SY", "TH", "TJ", "TL", "TM", "TR", "TW", "UZ", "VN", "YE"];
|
|
obj[143] = ["143", "KG", "KZ", "TJ", "TM", "UZ"];
|
|
obj[145] = ["145", "AE", "AM", "AZ", "BH", "CY", "GE", "IL", "IQ", "JO", "KW", "LB", "OM", "PS", "QA", "SA", "SY", "TR", "YE"];
|
|
obj[150] = ["039", "150", "151", "154", "155", "AD", "AL", "AT", "AX", "BA", "BE", "BG", "BY", "CH", "CQ", "CZ", "DE", "DK", "EE", "ES", "FI", "FO", "FR", "GB", "GG", "GI", "GR", "HR", "HU", "IE", "IM", "IS", "IT", "JE", "LI", "LT", "LU", "LV", "MC", "MD", "ME", "MK", "MT", "NL", "NO", "PL", "PT", "RO", "RS", "RU", "SE", "SI", "SJ", "SK", "SM", "UA", "VA", "XK"];
|
|
obj[151] = ["151", "BG", "BY", "CZ", "HU", "MD", "PL", "RO", "RU", "SK", "UA"];
|
|
obj[154] = ["154", "AX", "CQ", "DK", "EE", "FI", "FO", "GB", "GG", "IE", "IM", "IS", "JE", "LT", "LV", "NO", "SE", "SJ"];
|
|
obj[155] = ["155", "AT", "BE", "CH", "DE", "FR", "LI", "LU", "MC", "NL"];
|
|
obj[202] = ["011", "014", "017", "018", "202", "AO", "BF", "BI", "BJ", "BW", "CD", "CF", "CG", "CI", "CM", "CV", "DJ", "ER", "ET", "GA", "GH", "GM", "GN", "GQ", "GW", "IO", "KE", "KM", "LR", "LS", "MG", "ML", "MR", "MU", "MW", "MZ", "NA", "NE", "NG", "RE", "RW", "SC", "SH", "SL", "SN", "SO", "SS", "ST", "SZ", "TD", "TF", "TG", "TZ", "UG", "YT", "ZA", "ZM", "ZW"];
|
|
obj[419] = ["005", "013", "029", "419", "AG", "AI", "AR", "AW", "BB", "BL", "BO", "BQ", "BR", "BS", "BV", "BZ", "CL", "CO", "CR", "CU", "CW", "DM", "DO", "EC", "FK", "GD", "GF", "GP", "GS", "GT", "GY", "HN", "HT", "JM", "KN", "KY", "LC", "MF", "MQ", "MS", "MX", "NI", "PA", "PE", "PR", "PY", "SR", "SV", "SX", "TC", "TT", "UY", "VC", "VE", "VG", "VI"];
|
|
obj.EU = ["AT", "BE", "BG", "CY", "CZ", "DE", "DK", "EE", "ES", "EU", "FI", "FR", "GR", "HR", "HU", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PL", "PT", "RO", "SE", "SI", "SK"];
|
|
obj.EZ = ["AT", "BE", "CY", "DE", "EE", "ES", "EZ", "FI", "FR", "GR", "IE", "IT", "LT", "LU", "LV", "MT", "NL", "PT", "SI", "SK"];
|
|
obj.QO = ["AC", "AQ", "CP", "DG", "QO", "TA"];
|
|
obj.UN = ["AD", "AE", "AF", "AG", "AL", "AM", "AO", "AR", "AT", "AU", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BN", "BO", "BR", "BS", "BT", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CL", "CM", "CN", "CO", "CR", "CU", "CV", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "ER", "ES", "ET", "FI", "FJ", "FM", "FR", "GA", "GB", "GD", "GE", "GH", "GM", "GN", "GQ", "GR", "GT", "GW", "GY", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IN", "IQ", "IR", "IS", "IT", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KP", "KR", "KW", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MG", "MH", "MK", "ML", "MM", "MN", "MR", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NZ", "OM", "PA", "PE", "PG", "PH", "PK", "PL", "PT", "PW", "PY", "QA", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SI", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SY", "SZ", "TD", "TG", "TH", "TJ", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TZ", "UA", "UG", "UN", "US", "UY", "UZ", "VC", "VE", "VN", "VU", "WS", "YE", "ZA", "ZM", "ZW"];
|
|
const re3 = /-u(?:-[0-9a-z]{2,8})+/gi;
|
|
obj = {
|
|
serializer(arg0) {
|
|
return "" + arg0[0] + "|" + arg0[1];
|
|
}
|
|
};
|
|
let closure_9 = monadic.memoize(function findMatchingDistanceImpl(arg0, arg1) {
|
|
let locale = new Intl.Locale(arg0);
|
|
const maximizeResult = locale.maximize();
|
|
const locale1 = new Intl.Locale(arg1);
|
|
const maximizeResult1 = locale1.maximize();
|
|
obj = { language: maximizeResult.language, script: tmp3, region: tmp4 };
|
|
obj = { language: maximizeResult1.language, script: tmp5, region: tmp6 };
|
|
let tmp7 = obj1;
|
|
if (!obj1) {
|
|
let first = supplemental.supplemental.languageMatching["written-new"][0];
|
|
let parts;
|
|
if (first != null) {
|
|
const paradigmLocales = first.paradigmLocales;
|
|
if (paradigmLocales != null) {
|
|
parts = paradigmLocales._locales.split(" ");
|
|
const str = paradigmLocales._locales;
|
|
}
|
|
}
|
|
const prop = tmp8.supplemental.languageMatching["written-new"];
|
|
let substr = prop.slice(1, 5);
|
|
obj1 = { matches: null, matchVariables: null, paradigmLocales: null };
|
|
const prop1 = tmp8.supplemental.languageMatching["written-new"];
|
|
const substr1 = prop1.slice(5);
|
|
obj1[0] = substr1.map((arg0) => {
|
|
const first = Object.keys(arg0)[0];
|
|
return { supported: first, desired: arg0[first]._desired, distance: +arg0[first]._distance, oneway: "true" === arg0[first].oneway };
|
|
}, {});
|
|
obj1[1] = substr.reduce((arg0, arg1) => {
|
|
const first = Object.keys(arg1)[0];
|
|
const substr = first.slice(1);
|
|
arg0[substr] = arg1[first]._value.split("+");
|
|
return arg0;
|
|
}, {});
|
|
const items = [];
|
|
let arraySpreadResult = HermesBuiltin.arraySpread(parts, 0);
|
|
arraySpreadResult = HermesBuiltin.arraySpread(parts.map((str) => {
|
|
const locale = new Intl.Locale(str.replace(/_/g, "-"));
|
|
return locale.maximize().toString();
|
|
}), arraySpreadResult);
|
|
obj1[2] = items;
|
|
tmp7 = obj1;
|
|
}
|
|
let num4 = 0;
|
|
if (obj.language !== obj.language) {
|
|
const obj2 = { language: null, script: "", region: "" };
|
|
obj2[0] = maximizeResult.language;
|
|
const obj3 = { language: null, script: "", region: "" };
|
|
obj3[0] = maximizeResult1.language;
|
|
num4 = findMatchingDistanceForLSR(obj2, obj3, tmp7);
|
|
}
|
|
let sum = num4;
|
|
if (obj.script !== obj.script) {
|
|
const obj4 = { language: null, script: null, region: "" };
|
|
obj4[0] = maximizeResult.language;
|
|
obj4[1] = obj.script;
|
|
const obj5 = { language: null, script: null, region: "" };
|
|
obj5[0] = maximizeResult1.language;
|
|
obj5[1] = obj.script;
|
|
sum = num4 + findMatchingDistanceForLSR(obj4, obj5, tmp7);
|
|
}
|
|
let sum1 = sum;
|
|
if (obj.region !== obj.region) {
|
|
sum1 = sum + findMatchingDistanceForLSR(obj, obj, tmp7);
|
|
}
|
|
return sum1;
|
|
}, obj);
|
|
const weakMap = new WeakMap();
|
|
const weakMap1 = new WeakMap();
|
|
|
|
export const LookupSupportedLocales = function LookupSupportedLocales(arg0, arg1) {
|
|
const items = [];
|
|
const iter = arg1[Symbol.iterator]();
|
|
while (iter !== undefined) {
|
|
let tmp = BestAvailableLocale;
|
|
let tmp2 = closure_3;
|
|
let tmp3 = BestAvailableLocale(arg0, str.replace(closure_3, ""));
|
|
if (tmp3) {
|
|
let tmp5 = tmp3;
|
|
let arr = items.push(tmp4);
|
|
}
|
|
continue;
|
|
}
|
|
return items;
|
|
};
|
|
export { ResolveLocale };
|
|
export const match = function match(items, arg1, arg2, algorithm) {
|
|
closure_0 = arg2;
|
|
const canonicalLocales = Intl.getCanonicalLocales(items);
|
|
let str;
|
|
if (algorithm != null) {
|
|
str = algorithm.algorithm;
|
|
}
|
|
if (!str) {
|
|
str = "best fit";
|
|
}
|
|
return ResolveLocale(arg1, canonicalLocales, { localeMatcher: str }, [], {}, () => closure_0).locale;
|
|
};
|