function BestFitMatcher(availableLocales, requestedLocales, getDefaultLocale) {
        var minimizedAvailableLocaleMap = {};
        var minimizedAvailableLocales = new Set();
        availableLocales.forEach(function (locale) {
            var minimizedLocale = new Intl.Locale(locale)
                .minimize()
                .toString();
            minimizedAvailableLocaleMap[minimizedLocale] = locale;
            minimizedAvailableLocales.add(minimizedLocale);
        });
        var foundLocale;
        for (var _i = 0, requestedLocales_1 = requestedLocales; _i < requestedLocales_1.length; _i++) {
            var l = requestedLocales_1[_i];
            if (foundLocale) {
                break;
            }
            var noExtensionLocale = l.replace(UNICODE_EXTENSION_SEQUENCE_REGEX, '');
            if (availableLocales.has(noExtensionLocale)) {
                foundLocale = noExtensionLocale;
                break;
            }
            if (minimizedAvailableLocales.has(noExtensionLocale)) {
                foundLocale = minimizedAvailableLocaleMap[noExtensionLocale];
                break;
            }
            var locale = new Intl.Locale(noExtensionLocale);
            var maximizedRequestedLocale = locale.maximize().toString();
            var minimizedRequestedLocale = locale.minimize().toString();
            // Check minimized locale
            if (minimizedAvailableLocales.has(minimizedRequestedLocale)) {
                foundLocale = minimizedAvailableLocaleMap[minimizedRequestedLocale];
                break;
            }
            // Lookup algo on maximized locale
            foundLocale = BestAvailableLocale(minimizedAvailableLocales, maximizedRequestedLocale);
        }
        return {
            locale: foundLocale || getDefaultLocale(),
        };
    }
https://tc39.es/ecma402/#sec-bestfitmatcher
@param availableLocales
@param requestedLocales
@param getDefaultLocale