var AvailablePages;
(function (AvailablePages) {
    AvailablePages[AvailablePages["COMPARISON_HOMEPAGE"] = 0] = "COMPARISON_HOMEPAGE";
    AvailablePages[AvailablePages["PROVIDER_PAGE"] = 1] = "PROVIDER_PAGE";
    AvailablePages[AvailablePages["MID_MARKET_RATE"] = 2] = "MID_MARKET_RATE";
    AvailablePages[AvailablePages["COMPARISON_DISCLAIMER"] = 3] = "COMPARISON_DISCLAIMER";
    AvailablePages[AvailablePages["ABOUT_OUR_STORY"] = 4] = "ABOUT_OUR_STORY";
})(AvailablePages || (AvailablePages = {}));
const COMPARISON_FRONTEND_EXCLUDED_REGIONS = ['AE', 'FI', 'NO'];
const EXCLUDED_LOCALES_PAGES = {
    [AvailablePages.ABOUT_OUR_STORY]: ['BG', 'CZ', 'NO', 'SE', 'SK', 'ZH-CN'],
    [AvailablePages.COMPARISON_DISCLAIMER]: COMPARISON_FRONTEND_EXCLUDED_REGIONS,
    [AvailablePages.MID_MARKET_RATE]: ['CH', 'HK', 'TR'],
    [AvailablePages.PROVIDER_PAGE]: COMPARISON_FRONTEND_EXCLUDED_REGIONS,
    [AvailablePages.COMPARISON_HOMEPAGE]: COMPARISON_FRONTEND_EXCLUDED_REGIONS,
};
const WISE_SUPPORTED_REGIONS = [
    'AE',
    'AU',
    'BG',
    'BR',
    'CA',
    'CH',
    'CZ',
    'DE',
    'ES',
    'FI',
    'FR',
    'GB',
    'HK',
    'HU',
    'IE',
    'IN',
    'IT',
    'JP',
    'MY',
    'NL',
    'NO',
    'NZ',
    'PL',
    'PT',
    'RO',
    'RU',
    'SE',
    'SG',
    'SK',
    'TR',
    'US',
    'ZH-CN',
    'ZH-HK',
];
// eslint-disable-next-line unicorn/prefer-set-has
const NONSTRIPPED_LOCALES = ['ZH-CN', 'ZH-HK'];
const isLocaleSupported = (locale, locale_list) => {
    return locale_list.includes(locale);
};
const getSupportedLocalesForPage = (page) => {
    return WISE_SUPPORTED_REGIONS.filter((locale) => {
        return !EXCLUDED_LOCALES_PAGES[page].includes(locale);
    });
};
const generateUrl = (locale, path, page) => {
    if (!locale) {
        return `/gb/${path}`;
    }
    const urlRegion = getRegionUrl(locale.toUpperCase());
    const supportedLocalesForPage = getSupportedLocalesForPage(page);
    return isLocaleSupported(urlRegion, supportedLocalesForPage)
        ? `/${urlRegion.toLowerCase()}/${path}`
        : `/gb/${path}`;
};
const getRegionUrl = (locale) => {
    return NONSTRIPPED_LOCALES.includes(locale) ? locale : locale.slice(-2);
};

export { AvailablePages as A, generateUrl as g };
//# sourceMappingURL=generateUrl-3fc80d02.js.map
