next-intl 3.25.1 → 4.0.0-beta-9ea117c
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/config.d.ts +2 -1
- package/dist/cjs/development/plugin.cjs +167 -0
- package/dist/{development → esm/development}/config.js +1 -5
- package/dist/esm/development/index.react-client.js +3 -0
- package/dist/esm/development/index.react-server.js +8 -0
- package/dist/{development → esm/development}/middleware/getAlternateLinksHeaderValue.js +18 -25
- package/dist/esm/development/middleware/middleware.js +155 -0
- package/dist/{development → esm/development}/middleware/resolveLocale.js +13 -25
- package/dist/esm/development/middleware/syncCookie.js +20 -0
- package/dist/{development → esm/development}/middleware/utils.js +24 -54
- package/dist/esm/development/middleware.js +1 -0
- package/dist/{development → esm/development}/navigation/react-client/createNavigation.js +22 -29
- package/dist/esm/development/navigation/react-client/useBasePathname.js +27 -0
- package/dist/esm/development/navigation/react-server/createNavigation.js +22 -0
- package/dist/esm/development/navigation/react-server/getServerLocale.js +12 -0
- package/dist/{development → esm/development}/navigation/shared/BaseLink.js +31 -36
- package/dist/{development → esm/development}/navigation/shared/createSharedNavigationFns.js +39 -50
- package/dist/{development → esm/development}/navigation/shared/syncLocaleCookie.js +5 -9
- package/dist/{development → esm/development}/navigation/shared/utils.js +21 -35
- package/dist/esm/development/navigation.react-client.js +1 -0
- package/dist/esm/development/navigation.react-server.js +1 -0
- package/dist/esm/development/plugin/createMessagesDeclaration.js +61 -0
- package/dist/esm/development/plugin/createNextIntlPlugin.js +23 -0
- package/dist/esm/development/plugin/getNextConfig.js +82 -0
- package/dist/esm/development/plugin/utils.js +11 -0
- package/dist/esm/development/plugin.js +1 -0
- package/dist/esm/development/react-client/index.js +35 -0
- package/dist/esm/development/react-server/NextIntlClientProviderServer.js +31 -0
- package/dist/esm/development/react-server/useConfig.js +21 -0
- package/dist/esm/development/react-server/useFormatter.js +9 -0
- package/dist/esm/development/react-server/useLocale.js +8 -0
- package/dist/esm/development/react-server/useMessages.js +9 -0
- package/dist/esm/development/react-server/useNow.js +12 -0
- package/dist/esm/development/react-server/useTimeZone.js +8 -0
- package/dist/esm/development/react-server/useTranslations.js +9 -0
- package/dist/esm/development/routing/config.js +28 -0
- package/dist/esm/development/routing/defineRouting.js +5 -0
- package/dist/esm/development/routing.js +1 -0
- package/dist/{development → esm/development}/server/react-client/index.js +5 -16
- package/dist/{development → esm/development}/server/react-server/RequestLocale.js +10 -14
- package/dist/{development → esm/development}/server/react-server/RequestLocaleCache.js +3 -8
- package/dist/esm/development/server/react-server/createRequestConfig.js +2 -0
- package/dist/esm/development/server/react-server/getConfig.js +53 -0
- package/dist/esm/development/server/react-server/getConfigNow.js +10 -0
- package/dist/esm/development/server/react-server/getDefaultNow.js +9 -0
- package/dist/esm/development/server/react-server/getFormats.js +10 -0
- package/dist/esm/development/server/react-server/getFormatter.js +21 -0
- package/dist/esm/development/server/react-server/getLocale.js +10 -0
- package/dist/esm/development/server/react-server/getMessages.js +19 -0
- package/dist/esm/development/server/react-server/getNow.js +8 -0
- package/dist/{development → esm/development}/server/react-server/getRequestConfig.js +1 -5
- package/dist/esm/development/server/react-server/getServerFormatter.js +21 -0
- package/dist/esm/development/server/react-server/getServerTranslator.js +12 -0
- package/dist/esm/development/server/react-server/getTimeZone.js +13 -0
- package/dist/{development → esm/development}/server/react-server/getTranslations.js +7 -15
- package/dist/esm/development/server.react-client.js +1 -0
- package/dist/esm/development/server.react-server.js +8 -0
- package/dist/esm/development/shared/NextIntlClientProvider.js +18 -0
- package/dist/esm/development/shared/constants.js +4 -0
- package/dist/esm/development/shared/use.js +13 -0
- package/dist/{development → esm/development}/shared/utils.js +6 -50
- package/dist/esm/production/index.react-client.js +1 -0
- package/dist/esm/production/middleware/getAlternateLinksHeaderValue.js +1 -0
- package/dist/esm/production/middleware/middleware.js +1 -0
- package/dist/esm/production/middleware/resolveLocale.js +1 -0
- package/dist/esm/production/middleware/syncCookie.js +1 -0
- package/dist/esm/production/middleware/utils.js +1 -0
- package/dist/esm/production/navigation/react-client/createNavigation.js +1 -0
- package/dist/esm/production/navigation/react-client/useBasePathname.js +1 -0
- package/dist/esm/production/navigation/react-server/createNavigation.js +1 -0
- package/dist/esm/production/navigation/shared/BaseLink.js +2 -0
- package/dist/esm/production/navigation/shared/createSharedNavigationFns.js +1 -0
- package/dist/esm/production/navigation/shared/syncLocaleCookie.js +1 -0
- package/dist/esm/production/navigation/shared/utils.js +1 -0
- package/dist/esm/production/navigation.react-client.js +1 -0
- package/dist/esm/production/navigation.react-server.js +1 -0
- package/dist/esm/production/plugin/createMessagesDeclaration.js +1 -0
- package/dist/esm/production/plugin/createNextIntlPlugin.js +1 -0
- package/dist/esm/production/plugin/getNextConfig.js +1 -0
- package/dist/esm/production/plugin/utils.js +1 -0
- package/dist/esm/production/plugin.js +1 -0
- package/dist/esm/production/react-client/index.js +1 -0
- package/dist/esm/production/react-server/NextIntlClientProviderServer.js +1 -0
- package/dist/esm/production/react-server/useConfig.js +1 -0
- package/dist/esm/production/react-server/useFormatter.js +1 -0
- package/dist/esm/production/react-server/useLocale.js +1 -0
- package/dist/esm/production/react-server/useMessages.js +1 -0
- package/dist/esm/production/react-server/useNow.js +1 -0
- package/dist/esm/production/react-server/useTimeZone.js +1 -0
- package/dist/esm/production/react-server/useTranslations.js +1 -0
- package/dist/esm/production/routing/config.js +1 -0
- package/dist/esm/production/server/react-client/index.js +1 -0
- package/dist/esm/production/server/react-server/RequestLocale.js +1 -0
- package/dist/esm/production/server/react-server/getConfig.js +1 -0
- package/dist/esm/production/server/react-server/getConfigNow.js +1 -0
- package/dist/esm/production/server/react-server/getDefaultNow.js +1 -0
- package/dist/esm/production/server/react-server/getFormats.js +1 -0
- package/dist/esm/production/server/react-server/getFormatter.js +1 -0
- package/dist/esm/production/server/react-server/getLocale.js +1 -0
- package/dist/esm/production/server/react-server/getMessages.js +1 -0
- package/dist/esm/production/server/react-server/getNow.js +1 -0
- package/dist/esm/production/server/react-server/getServerFormatter.js +1 -0
- package/dist/esm/{server → production/server}/react-server/getTimeZone.js +1 -1
- package/dist/esm/production/server/react-server/getTranslations.js +1 -0
- package/dist/esm/production/server.react-client.js +1 -0
- package/dist/esm/production/server.react-server.js +1 -0
- package/dist/esm/production/shared/NextIntlClientProvider.js +2 -0
- package/dist/esm/production/shared/constants.js +1 -0
- package/dist/esm/production/shared/use.js +1 -0
- package/dist/esm/production/shared/utils.js +1 -0
- package/dist/types/{src/index.react-client.d.ts → index.react-client.d.ts} +1 -1
- package/dist/types/index.react-server.d.ts +1 -0
- package/dist/types/{src/middleware → middleware}/getAlternateLinksHeaderValue.d.ts +3 -3
- package/dist/types/{src/middleware → middleware}/index.d.ts +1 -1
- package/dist/types/middleware/middleware.d.ts +4 -0
- package/dist/types/{src/middleware → middleware}/resolveLocale.d.ts +5 -4
- package/dist/types/middleware/syncCookie.d.ts +7 -0
- package/dist/types/{src/middleware → middleware}/utils.d.ts +4 -3
- package/dist/types/middleware.d.ts +1 -0
- package/dist/types/{src/navigation → navigation}/react-client/createNavigation.d.ts +58 -57
- package/dist/types/navigation/react-client/index.d.ts +2 -0
- package/dist/types/{src/navigation → navigation}/react-client/useBasePathname.d.ts +1 -1
- package/dist/types/{src/navigation → navigation}/react-server/createNavigation.d.ts +30 -30
- package/dist/types/navigation/react-server/index.d.ts +2 -0
- package/dist/types/navigation/shared/BaseLink.d.ts +19 -0
- package/dist/types/navigation/shared/createSharedNavigationFns.d.ts +386 -0
- package/dist/types/{src/navigation → navigation}/shared/syncLocaleCookie.d.ts +3 -2
- package/dist/types/{src/navigation → navigation}/shared/utils.d.ts +5 -4
- package/dist/types/navigation.react-client.d.ts +1 -0
- package/dist/types/navigation.react-server.d.ts +1 -0
- package/dist/types/plugin/createMessagesDeclaration.d.ts +1 -0
- package/dist/types/plugin/createNextIntlPlugin.d.ts +3 -0
- package/dist/types/plugin/getNextConfig.d.ts +3 -0
- package/dist/types/plugin/index.d.ts +1 -0
- package/dist/types/plugin/types.d.ts +6 -0
- package/dist/types/plugin/utils.d.ts +2 -0
- package/dist/types/plugin.d.ts +1 -0
- package/dist/types/{src/react-client → react-client}/index.d.ts +1 -2
- package/dist/types/react-server/NextIntlClientProviderServer.d.ts +5 -0
- package/dist/types/react-server/index.d.ts +15 -0
- package/dist/types/{src/react-server → react-server}/testUtils.d.ts +1 -1
- package/dist/types/{src/react-server → react-server}/useConfig.d.ts +1 -1
- package/dist/types/react-server/useFormatter.d.ts +2 -0
- package/dist/types/react-server/useLocale.d.ts +2 -0
- package/dist/types/react-server/useMessages.d.ts +2 -0
- package/dist/types/react-server/useNow.d.ts +2 -0
- package/dist/types/react-server/useTimeZone.d.ts +2 -0
- package/dist/types/{src/routing → routing}/config.d.ts +2 -4
- package/dist/types/{src/routing → routing}/defineRouting.d.ts +2 -2
- package/dist/types/routing/index.d.ts +3 -0
- package/dist/types/routing.d.ts +1 -0
- package/dist/types/{src/server → server}/react-client/index.d.ts +1 -2
- package/dist/types/server/react-server/RequestLocaleCache.d.ts +3 -0
- package/dist/types/{src/server → server}/react-server/createRequestConfig.d.ts +1 -1
- package/dist/types/{src/server → server}/react-server/getConfig.d.ts +2 -3
- package/dist/types/server/react-server/getConfigNow.d.ts +4 -0
- package/dist/types/server/react-server/getDefaultNow.d.ts +3 -0
- package/dist/types/server/react-server/getFormats.d.ts +3 -0
- package/dist/types/{src/server → server}/react-server/getFormatter.d.ts +2 -2
- package/dist/types/server/react-server/getLocale.d.ts +4 -0
- package/dist/types/server/react-server/getMessages.d.ts +6 -0
- package/dist/types/server/react-server/getNow.d.ts +4 -0
- package/dist/types/{src/server → server}/react-server/getRequestConfig.d.ts +2 -19
- package/dist/types/server/react-server/getServerFormatter.d.ts +10 -0
- package/dist/types/server/react-server/getServerTranslator.d.ts +4 -0
- package/dist/types/server/react-server/getTimeZone.d.ts +4 -0
- package/dist/types/server/react-server/getTranslations.d.ts +8 -0
- package/dist/types/server/react-server/index.d.ts +11 -0
- package/dist/types/server.react-client.d.ts +1 -0
- package/dist/types/server.react-server.d.ts +1 -0
- package/dist/types/{src/shared → shared}/NextIntlClientProvider.d.ts +5 -4
- package/dist/types/shared/constants.d.ts +1 -0
- package/dist/types/shared/use.d.ts +3 -0
- package/dist/types/{src/shared → shared}/utils.d.ts +3 -9
- package/middleware.d.ts +2 -1
- package/navigation.d.ts +2 -1
- package/package.json +57 -26
- package/plugin.d.cts +3 -0
- package/plugin.d.ts +3 -7
- package/routing.d.ts +2 -1
- package/server.d.ts +2 -1
- package/dist/config.js +0 -7
- package/dist/development/_virtual/_rollupPluginBabelHelpers.js +0 -15
- package/dist/development/index.react-client.js +0 -21
- package/dist/development/index.react-server.js +0 -28
- package/dist/development/middleware/middleware.js +0 -170
- package/dist/development/middleware/syncCookie.js +0 -20
- package/dist/development/middleware.js +0 -9
- package/dist/development/navigation/react-client/ClientLink.js +0 -55
- package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -156
- package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +0 -67
- package/dist/development/navigation/react-client/redirects.js +0 -32
- package/dist/development/navigation/react-client/useBasePathname.js +0 -31
- package/dist/development/navigation/react-client/useBaseRouter.js +0 -72
- package/dist/development/navigation/react-server/ServerLink.js +0 -32
- package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -95
- package/dist/development/navigation/react-server/createNavigation.js +0 -30
- package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +0 -56
- package/dist/development/navigation/react-server/getServerLocale.js +0 -16
- package/dist/development/navigation/react-server/redirects.js +0 -24
- package/dist/development/navigation/shared/LegacyBaseLink.js +0 -57
- package/dist/development/navigation/shared/redirects.js +0 -25
- package/dist/development/navigation.react-client.js +0 -13
- package/dist/development/navigation.react-server.js +0 -13
- package/dist/development/plugin.js +0 -101
- package/dist/development/react-client/index.js +0 -38
- package/dist/development/react-client/useLocale.js +0 -28
- package/dist/development/react-server/NextIntlClientProviderServer.js +0 -33
- package/dist/development/react-server/getTranslator.js +0 -16
- package/dist/development/react-server/useConfig.js +0 -25
- package/dist/development/react-server/useFormatter.js +0 -18
- package/dist/development/react-server/useLocale.js +0 -15
- package/dist/development/react-server/useMessages.js +0 -16
- package/dist/development/react-server/useNow.js +0 -19
- package/dist/development/react-server/useTimeZone.js +0 -15
- package/dist/development/react-server/useTranslations.js +0 -17
- package/dist/development/routing/config.js +0 -35
- package/dist/development/routing/defineRouting.js +0 -9
- package/dist/development/routing.js +0 -9
- package/dist/development/server/react-server/RequestLocaleLegacy.js +0 -43
- package/dist/development/server/react-server/createRequestConfig.js +0 -16
- package/dist/development/server/react-server/getConfig.js +0 -73
- package/dist/development/server/react-server/getFormatter.js +0 -25
- package/dist/development/server/react-server/getLocale.js +0 -14
- package/dist/development/server/react-server/getMessages.js +0 -24
- package/dist/development/server/react-server/getNow.js +0 -17
- package/dist/development/server/react-server/getTimeZone.js +0 -17
- package/dist/development/server.react-client.js +0 -17
- package/dist/development/server.react-server.js +0 -24
- package/dist/development/shared/NextIntlClientProvider.js +0 -30
- package/dist/development/shared/constants.js +0 -12
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +0 -1
- package/dist/esm/index.react-client.js +0 -1
- package/dist/esm/middleware/getAlternateLinksHeaderValue.js +0 -1
- package/dist/esm/middleware/middleware.js +0 -1
- package/dist/esm/middleware/resolveLocale.js +0 -1
- package/dist/esm/middleware/syncCookie.js +0 -1
- package/dist/esm/middleware/utils.js +0 -1
- package/dist/esm/navigation/react-client/ClientLink.js +0 -1
- package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-client/createNavigation.js +0 -1
- package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-client/redirects.js +0 -1
- package/dist/esm/navigation/react-client/useBasePathname.js +0 -1
- package/dist/esm/navigation/react-client/useBaseRouter.js +0 -1
- package/dist/esm/navigation/react-server/ServerLink.js +0 -1
- package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-server/createNavigation.js +0 -1
- package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +0 -1
- package/dist/esm/navigation/react-server/redirects.js +0 -1
- package/dist/esm/navigation/shared/BaseLink.js +0 -2
- package/dist/esm/navigation/shared/LegacyBaseLink.js +0 -2
- package/dist/esm/navigation/shared/createSharedNavigationFns.js +0 -1
- package/dist/esm/navigation/shared/redirects.js +0 -1
- package/dist/esm/navigation/shared/syncLocaleCookie.js +0 -1
- package/dist/esm/navigation/shared/utils.js +0 -1
- package/dist/esm/navigation.react-client.js +0 -1
- package/dist/esm/navigation.react-server.js +0 -1
- package/dist/esm/plugin.js +0 -1
- package/dist/esm/react-client/index.js +0 -1
- package/dist/esm/react-client/useLocale.js +0 -1
- package/dist/esm/react-server/NextIntlClientProviderServer.js +0 -1
- package/dist/esm/react-server/useConfig.js +0 -1
- package/dist/esm/react-server/useFormatter.js +0 -1
- package/dist/esm/react-server/useLocale.js +0 -1
- package/dist/esm/react-server/useMessages.js +0 -1
- package/dist/esm/react-server/useNow.js +0 -1
- package/dist/esm/react-server/useTimeZone.js +0 -1
- package/dist/esm/react-server/useTranslations.js +0 -1
- package/dist/esm/routing/config.js +0 -1
- package/dist/esm/server/react-client/index.js +0 -1
- package/dist/esm/server/react-server/RequestLocale.js +0 -1
- package/dist/esm/server/react-server/RequestLocaleLegacy.js +0 -1
- package/dist/esm/server/react-server/getConfig.js +0 -1
- package/dist/esm/server/react-server/getFormatter.js +0 -1
- package/dist/esm/server/react-server/getLocale.js +0 -1
- package/dist/esm/server/react-server/getMessages.js +0 -1
- package/dist/esm/server/react-server/getNow.js +0 -1
- package/dist/esm/server/react-server/getTranslations.js +0 -1
- package/dist/esm/server.react-client.js +0 -1
- package/dist/esm/server.react-server.js +0 -1
- package/dist/esm/shared/NextIntlClientProvider.js +0 -2
- package/dist/esm/shared/constants.js +0 -1
- package/dist/esm/shared/utils.js +0 -1
- package/dist/index.react-client.js +0 -7
- package/dist/index.react-server.js +0 -7
- package/dist/middleware.js +0 -7
- package/dist/navigation.react-client.js +0 -7
- package/dist/navigation.react-server.js +0 -7
- package/dist/plugin.js +0 -7
- package/dist/production/_virtual/_rollupPluginBabelHelpers.js +0 -1
- package/dist/production/config.js +0 -1
- package/dist/production/index.react-client.js +0 -1
- package/dist/production/index.react-server.js +0 -1
- package/dist/production/middleware/getAlternateLinksHeaderValue.js +0 -1
- package/dist/production/middleware/middleware.js +0 -1
- package/dist/production/middleware/resolveLocale.js +0 -1
- package/dist/production/middleware/syncCookie.js +0 -1
- package/dist/production/middleware/utils.js +0 -1
- package/dist/production/middleware.js +0 -1
- package/dist/production/navigation/react-client/ClientLink.js +0 -1
- package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-client/createNavigation.js +0 -1
- package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-client/redirects.js +0 -1
- package/dist/production/navigation/react-client/useBasePathname.js +0 -1
- package/dist/production/navigation/react-client/useBaseRouter.js +0 -1
- package/dist/production/navigation/react-server/ServerLink.js +0 -1
- package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-server/createNavigation.js +0 -1
- package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +0 -1
- package/dist/production/navigation/react-server/getServerLocale.js +0 -1
- package/dist/production/navigation/react-server/redirects.js +0 -1
- package/dist/production/navigation/shared/BaseLink.js +0 -2
- package/dist/production/navigation/shared/LegacyBaseLink.js +0 -2
- package/dist/production/navigation/shared/createSharedNavigationFns.js +0 -1
- package/dist/production/navigation/shared/redirects.js +0 -1
- package/dist/production/navigation/shared/syncLocaleCookie.js +0 -1
- package/dist/production/navigation/shared/utils.js +0 -1
- package/dist/production/navigation.react-client.js +0 -1
- package/dist/production/navigation.react-server.js +0 -1
- package/dist/production/plugin.js +0 -1
- package/dist/production/react-client/index.js +0 -1
- package/dist/production/react-client/useLocale.js +0 -1
- package/dist/production/react-server/NextIntlClientProviderServer.js +0 -1
- package/dist/production/react-server/getTranslator.js +0 -1
- package/dist/production/react-server/useConfig.js +0 -1
- package/dist/production/react-server/useFormatter.js +0 -1
- package/dist/production/react-server/useLocale.js +0 -1
- package/dist/production/react-server/useMessages.js +0 -1
- package/dist/production/react-server/useNow.js +0 -1
- package/dist/production/react-server/useTimeZone.js +0 -1
- package/dist/production/react-server/useTranslations.js +0 -1
- package/dist/production/routing/config.js +0 -1
- package/dist/production/routing/defineRouting.js +0 -1
- package/dist/production/routing.js +0 -1
- package/dist/production/server/react-client/index.js +0 -1
- package/dist/production/server/react-server/RequestLocale.js +0 -1
- package/dist/production/server/react-server/RequestLocaleCache.js +0 -1
- package/dist/production/server/react-server/RequestLocaleLegacy.js +0 -1
- package/dist/production/server/react-server/createRequestConfig.js +0 -1
- package/dist/production/server/react-server/getConfig.js +0 -1
- package/dist/production/server/react-server/getFormatter.js +0 -1
- package/dist/production/server/react-server/getLocale.js +0 -1
- package/dist/production/server/react-server/getMessages.js +0 -1
- package/dist/production/server/react-server/getNow.js +0 -1
- package/dist/production/server/react-server/getRequestConfig.js +0 -1
- package/dist/production/server/react-server/getTimeZone.js +0 -1
- package/dist/production/server/react-server/getTranslations.js +0 -1
- package/dist/production/server.react-client.js +0 -1
- package/dist/production/server.react-server.js +0 -1
- package/dist/production/shared/NextIntlClientProvider.js +0 -2
- package/dist/production/shared/constants.js +0 -1
- package/dist/production/shared/utils.js +0 -1
- package/dist/routing.js +0 -7
- package/dist/server.react-client.js +0 -7
- package/dist/server.react-server.js +0 -7
- package/dist/types/__mocks__/react.d.ts +0 -9
- package/dist/types/src/index.react-server.d.ts +0 -1
- package/dist/types/src/middleware/getAlternateLinksHeaderValue.test.d.ts +0 -1
- package/dist/types/src/middleware/middleware.d.ts +0 -13
- package/dist/types/src/middleware/middleware.test.d.ts +0 -1
- package/dist/types/src/middleware/resolveLocale.test.d.ts +0 -1
- package/dist/types/src/middleware/syncCookie.d.ts +0 -3
- package/dist/types/src/middleware/utils.test.d.ts +0 -1
- package/dist/types/src/middleware.d.ts +0 -1
- package/dist/types/src/navigation/createLocalizedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/createNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/createSharedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/ClientLink.d.ts +0 -31
- package/dist/types/src/navigation/react-client/ClientLink.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +0 -91
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/createNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +0 -66
- package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/index.d.ts +0 -7
- package/dist/types/src/navigation/react-client/redirects.d.ts +0 -10
- package/dist/types/src/navigation/react-client/useBasePathname.test.d.ts +0 -1
- package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +0 -33
- package/dist/types/src/navigation/react-client/useBaseRouter.test.d.ts +0 -1
- package/dist/types/src/navigation/react-server/ServerLink.d.ts +0 -9
- package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +0 -70
- package/dist/types/src/navigation/react-server/createNavigation.test.d.ts +0 -1
- package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +0 -11
- package/dist/types/src/navigation/react-server/index.d.ts +0 -4
- package/dist/types/src/navigation/react-server/redirects.d.ts +0 -10
- package/dist/types/src/navigation/shared/BaseLink.d.ts +0 -17
- package/dist/types/src/navigation/shared/LegacyBaseLink.d.ts +0 -12
- package/dist/types/src/navigation/shared/createSharedNavigationFns.d.ts +0 -386
- package/dist/types/src/navigation/shared/redirects.d.ts +0 -11
- package/dist/types/src/navigation/shared/redirects.test.d.ts +0 -1
- package/dist/types/src/navigation/shared/utils.test.d.ts +0 -1
- package/dist/types/src/navigation.react-client.d.ts +0 -1
- package/dist/types/src/navigation.react-server.d.ts +0 -1
- package/dist/types/src/plugin.d.ts +0 -1
- package/dist/types/src/react-client/useFormatter.test.d.ts +0 -1
- package/dist/types/src/react-client/useLocale.d.ts +0 -1
- package/dist/types/src/react-client/useLocale.test.d.ts +0 -1
- package/dist/types/src/react-client/useNow.test.d.ts +0 -1
- package/dist/types/src/react-client/useTimeZone.test.d.ts +0 -1
- package/dist/types/src/react-client/useTranslations.test.d.ts +0 -1
- package/dist/types/src/react-server/NextIntlClientProviderServer.d.ts +0 -5
- package/dist/types/src/react-server/NextIntlClientProviderServer.test.d.ts +0 -1
- package/dist/types/src/react-server/getTranslator.d.ts +0 -51
- package/dist/types/src/react-server/index.d.ts +0 -15
- package/dist/types/src/react-server/index.test.d.ts +0 -1
- package/dist/types/src/react-server/useFormatter.d.ts +0 -2
- package/dist/types/src/react-server/useLocale.d.ts +0 -2
- package/dist/types/src/react-server/useMessages.d.ts +0 -2
- package/dist/types/src/react-server/useNow.d.ts +0 -2
- package/dist/types/src/react-server/useTimeZone.d.ts +0 -2
- package/dist/types/src/react-server/useTranslations.test.d.ts +0 -1
- package/dist/types/src/routing/defineRouting.test.d.ts +0 -1
- package/dist/types/src/routing/index.d.ts +0 -3
- package/dist/types/src/routing/types.test.d.ts +0 -1
- package/dist/types/src/routing.d.ts +0 -1
- package/dist/types/src/server/react-client/index.test.d.ts +0 -1
- package/dist/types/src/server/react-server/RequestLocaleCache.d.ts +0 -2
- package/dist/types/src/server/react-server/RequestLocaleLegacy.d.ts +0 -1
- package/dist/types/src/server/react-server/getLocale.d.ts +0 -3
- package/dist/types/src/server/react-server/getMessages.d.ts +0 -6
- package/dist/types/src/server/react-server/getNow.d.ts +0 -3
- package/dist/types/src/server/react-server/getTimeZone.d.ts +0 -3
- package/dist/types/src/server/react-server/getTranslations.d.ts +0 -92
- package/dist/types/src/server/react-server/index.d.ts +0 -14
- package/dist/types/src/server/react-server/index.test.d.ts +0 -1
- package/dist/types/src/server.react-client.d.ts +0 -1
- package/dist/types/src/server.react-server.d.ts +0 -1
- package/dist/types/src/shared/NextIntlClientProvider.test.d.ts +0 -1
- package/dist/types/src/shared/constants.d.ts +0 -3
- package/dist/types/src/shared/utils.test.d.ts +0 -1
- package/dist/types/test/setup.d.ts +0 -1
- /package/dist/esm/{config.js → production/config.js} +0 -0
- /package/dist/esm/{index.react-server.js → production/index.react-server.js} +0 -0
- /package/dist/esm/{middleware.js → production/middleware.js} +0 -0
- /package/dist/esm/{navigation → production/navigation}/react-server/getServerLocale.js +0 -0
- /package/dist/esm/{routing → production/routing}/defineRouting.js +0 -0
- /package/dist/esm/{routing.js → production/routing.js} +0 -0
- /package/dist/esm/{server → production/server}/react-server/RequestLocaleCache.js +0 -0
- /package/dist/esm/{server → production/server}/react-server/createRequestConfig.js +0 -0
- /package/dist/esm/{server → production/server}/react-server/getRequestConfig.js +0 -0
- /package/dist/esm/{react-server/getTranslator.js → production/server/react-server/getServerTranslator.js} +0 -0
- /package/dist/types/{src/config.d.ts → config.d.ts} +0 -0
- /package/dist/types/{src/navigation → navigation}/react-server/getServerLocale.d.ts +0 -0
- /package/dist/types/{src/navigation → navigation}/shared/StrictParams.d.ts +0 -0
- /package/dist/types/{src/react-server → react-server}/useTranslations.d.ts +0 -0
- /package/dist/types/{src/routing → routing}/types.d.ts +0 -0
- /package/dist/types/{src/server → server}/react-server/RequestLocale.d.ts +0 -0
- /package/dist/types/{src/shared → shared}/types.d.ts +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var core = require('use-intl/core');
|
|
7
|
-
var getConfig = require('./getConfig.js');
|
|
8
|
-
|
|
9
|
-
async function getFormatterCachedImpl(locale) {
|
|
10
|
-
const config = await getConfig.default(locale);
|
|
11
|
-
return core.createFormatter(config);
|
|
12
|
-
}
|
|
13
|
-
const getFormatterCached = React.cache(getFormatterCachedImpl);
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Returns a formatter based on the given locale.
|
|
17
|
-
*
|
|
18
|
-
* The formatter automatically receives the request config, but
|
|
19
|
-
* you can override it by passing in additional options.
|
|
20
|
-
*/
|
|
21
|
-
async function getFormatter(opts) {
|
|
22
|
-
return getFormatterCached(opts === null || opts === void 0 ? void 0 : opts.locale);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
exports.default = getFormatter;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var getConfig = require('./getConfig.js');
|
|
7
|
-
|
|
8
|
-
async function getLocaleCachedImpl() {
|
|
9
|
-
const config = await getConfig.default();
|
|
10
|
-
return Promise.resolve(config.locale);
|
|
11
|
-
}
|
|
12
|
-
const getLocaleCached = React.cache(getLocaleCachedImpl);
|
|
13
|
-
|
|
14
|
-
exports.default = getLocaleCached;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var getConfig = require('./getConfig.js');
|
|
7
|
-
|
|
8
|
-
function getMessagesFromConfig(config) {
|
|
9
|
-
if (!config.messages) {
|
|
10
|
-
throw new Error('No messages found. Have you configured them correctly? See https://next-intl-docs.vercel.app/docs/configuration#messages');
|
|
11
|
-
}
|
|
12
|
-
return config.messages;
|
|
13
|
-
}
|
|
14
|
-
async function getMessagesCachedImpl(locale) {
|
|
15
|
-
const config = await getConfig.default(locale);
|
|
16
|
-
return getMessagesFromConfig(config);
|
|
17
|
-
}
|
|
18
|
-
const getMessagesCached = React.cache(getMessagesCachedImpl);
|
|
19
|
-
async function getMessages(opts) {
|
|
20
|
-
return getMessagesCached(opts === null || opts === void 0 ? void 0 : opts.locale);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.default = getMessages;
|
|
24
|
-
exports.getMessagesFromConfig = getMessagesFromConfig;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var getConfig = require('./getConfig.js');
|
|
7
|
-
|
|
8
|
-
async function getNowCachedImpl(locale) {
|
|
9
|
-
const config = await getConfig.default(locale);
|
|
10
|
-
return config.now;
|
|
11
|
-
}
|
|
12
|
-
const getNowCached = React.cache(getNowCachedImpl);
|
|
13
|
-
async function getNow(opts) {
|
|
14
|
-
return getNowCached(opts === null || opts === void 0 ? void 0 : opts.locale);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.default = getNow;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var getConfig = require('./getConfig.js');
|
|
7
|
-
|
|
8
|
-
async function getTimeZoneCachedImpl(locale) {
|
|
9
|
-
const config = await getConfig.default(locale);
|
|
10
|
-
return config.timeZone;
|
|
11
|
-
}
|
|
12
|
-
const getTimeZoneCached = React.cache(getTimeZoneCachedImpl);
|
|
13
|
-
async function getTimeZone(opts) {
|
|
14
|
-
return getTimeZoneCached(opts === null || opts === void 0 ? void 0 : opts.locale);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
exports.default = getTimeZone;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var index = require('./server/react-client/index.js');
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.getFormatter = index.getFormatter;
|
|
10
|
-
exports.getLocale = index.getLocale;
|
|
11
|
-
exports.getMessages = index.getMessages;
|
|
12
|
-
exports.getNow = index.getNow;
|
|
13
|
-
exports.getRequestConfig = index.getRequestConfig;
|
|
14
|
-
exports.getTimeZone = index.getTimeZone;
|
|
15
|
-
exports.getTranslations = index.getTranslations;
|
|
16
|
-
exports.setRequestLocale = index.setRequestLocale;
|
|
17
|
-
exports.unstable_setRequestLocale = index.unstable_setRequestLocale;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var getRequestConfig = require('./server/react-server/getRequestConfig.js');
|
|
6
|
-
var getFormatter = require('./server/react-server/getFormatter.js');
|
|
7
|
-
var getMessages = require('./server/react-server/getMessages.js');
|
|
8
|
-
var getNow = require('./server/react-server/getNow.js');
|
|
9
|
-
var getTimeZone = require('./server/react-server/getTimeZone.js');
|
|
10
|
-
var getTranslations = require('./server/react-server/getTranslations.js');
|
|
11
|
-
var getLocale = require('./server/react-server/getLocale.js');
|
|
12
|
-
var RequestLocaleCache = require('./server/react-server/RequestLocaleCache.js');
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
exports.getRequestConfig = getRequestConfig.default;
|
|
17
|
-
exports.getFormatter = getFormatter.default;
|
|
18
|
-
exports.getMessages = getMessages.default;
|
|
19
|
-
exports.getNow = getNow.default;
|
|
20
|
-
exports.getTimeZone = getTimeZone.default;
|
|
21
|
-
exports.getTranslations = getTranslations.default;
|
|
22
|
-
exports.getLocale = getLocale.default;
|
|
23
|
-
exports.setRequestLocale = RequestLocaleCache.setCachedRequestLocale;
|
|
24
|
-
exports.unstable_setRequestLocale = RequestLocaleCache.setCachedRequestLocale;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
-
|
|
6
|
-
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var _IntlProvider = require('use-intl/_IntlProvider');
|
|
9
|
-
|
|
10
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
13
|
-
|
|
14
|
-
function NextIntlClientProvider(_ref) {
|
|
15
|
-
let {
|
|
16
|
-
locale,
|
|
17
|
-
...rest
|
|
18
|
-
} = _ref;
|
|
19
|
-
// TODO: We could call `useParams` here to receive a default value
|
|
20
|
-
// for `locale`, but this would require dropping Next.js <13.
|
|
21
|
-
|
|
22
|
-
if (!locale) {
|
|
23
|
-
throw new Error('Failed to determine locale in `NextIntlClientProvider`, please provide the `locale` prop explicitly.\n\nSee https://next-intl-docs.vercel.app/docs/configuration#locale' );
|
|
24
|
-
}
|
|
25
|
-
return /*#__PURE__*/React__default.default.createElement(_IntlProvider.IntlProvider, _rollupPluginBabelHelpers.extends({
|
|
26
|
-
locale: locale
|
|
27
|
-
}, rest));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
exports.default = NextIntlClientProvider;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
// Should take precedence over the cookie
|
|
6
|
-
const HEADER_LOCALE_NAME = 'X-NEXT-INTL-LOCALE';
|
|
7
|
-
|
|
8
|
-
// In a URL like "/en-US/about", the locale segment is "en-US"
|
|
9
|
-
const LOCALE_SEGMENT_NAME = 'locale';
|
|
10
|
-
|
|
11
|
-
exports.HEADER_LOCALE_NAME = HEADER_LOCALE_NAME;
|
|
12
|
-
exports.LOCALE_SEGMENT_NAME = LOCALE_SEGMENT_NAME;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(){return n=Object.assign?Object.assign.bind():function(n){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var a in t)({}).hasOwnProperty.call(t,a)&&(n[a]=t[a])}return n},n.apply(null,arguments)}export{n as extends};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{useFormatter,useTranslations}from"./react-client/index.js";export{default as useLocale}from"./react-client/useLocale.js";export{default as NextIntlClientProvider}from"./shared/NextIntlClientProvider.js";export*from"use-intl";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{normalizeTrailingSlash as e}from"../shared/utils.js";import{getHost as a,getNormalizedPathname as t,getLocalePrefixes as o,isLocaleSupportedOnDomain as n,applyBasePath as l,formatTemplatePathname as r}from"./utils.js";function c(c){var m;let{localizedPathnames:p,request:s,resolvedLocale:i,routing:f}=c;const h=s.nextUrl.clone(),u=a(s.headers);function d(a,t){return a.pathname=e(a.pathname),s.nextUrl.basePath&&((a=new URL(a)).pathname=l(a.pathname,s.nextUrl.basePath)),"<".concat(a.toString(),'>; rel="alternate"; hreflang="').concat(t,'"')}function x(e,a){return p&&"object"==typeof p?r(e,p[i],p[a]):e}u&&(h.port="",h.host=u),h.protocol=null!==(m=s.headers.get("x-forwarded-proto"))&&void 0!==m?m:h.protocol,h.pathname=t(h.pathname,f.locales,f.localePrefix);const w=o(f.locales,f.localePrefix,!1).flatMap((e=>{let a,[t,o]=e;function l(e){return"/"===e?o:o+e}if(f.domains){return f.domains.filter((e=>n(t,e))).map((e=>(a=new URL(h),a.port="",a.host=e.domain,a.pathname=x(h.pathname,t),t===e.defaultLocale&&"always"!==f.localePrefix.mode||(a.pathname=l(a.pathname)),d(a,t))))}{let e;e=p&&"object"==typeof p?x(h.pathname,t):h.pathname,t===f.defaultLocale&&"always"!==f.localePrefix.mode||(e=l(e)),a=new URL(e,h)}return d(a,t)}));if(!f.domains&&("always"!==f.localePrefix.mode||"/"===h.pathname)){const e=new URL(x(h.pathname,f.defaultLocale),h);w.push(d(e,"x-default"))}return w.join(", ")}export{c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{NextResponse as e}from"next/server";import{receiveRoutingConfig as o}from"../routing/config.js";import{HEADER_LOCALE_NAME as l}from"../shared/constants.js";import{matchesPathname as t,normalizeTrailingSlash as a,getLocalePrefix as r}from"../shared/utils.js";import n from"./getAlternateLinksHeaderValue.js";import i from"./resolveLocale.js";import s from"./syncCookie.js";import{sanitizePathname as c,isLocaleSupportedOnDomain as d,getNormalizedPathname as f,getPathnameMatch as m,getInternalTemplate as h,formatTemplatePathname as u,formatPathname as x,getBestMatchingDomain as p,applyBasePath as v,getLocaleAsPrefix as U}from"./utils.js";function P(P,k){var L,g,j;const w=o({...P,alternateLinks:null!==(L=null==k?void 0:k.alternateLinks)&&void 0!==L?L:P.alternateLinks,localeDetection:null!==(g=null==k?void 0:k.localeDetection)&&void 0!==g?g:P.localeDetection,localeCookie:null!==(j=null==k?void 0:k.localeCookie)&&void 0!==j?j:P.localeCookie});return function(o){var P;let k;try{k=decodeURI(o.nextUrl.pathname)}catch(o){return e.next()}const L=c(k),{domain:g,locale:j}=i(w,o.headers,o.cookies,L),C=g?g.defaultLocale===j:j===w.defaultLocale,b=(null===(P=w.domains)||void 0===P?void 0:P.filter((e=>d(j,e))))||[],y=null!=w.domains&&!g;function D(t){const a=new URL(t,o.url);o.nextUrl.basePath&&(a.pathname=v(a.pathname,o.nextUrl.basePath));const r=new Headers(o.headers);return r.set(l,j),e.rewrite(a,{request:{headers:r}})}function R(l,t){const r=new URL(l,o.url);if(r.pathname=a(r.pathname),b.length>0&&!t&&g){const e=p(g,j,b);e&&(t=e.domain,e.defaultLocale===j&&"as-needed"===w.localePrefix.mode&&(r.pathname=f(r.pathname,w.locales,w.localePrefix)))}var n,i;t&&(r.host=t,o.headers.get("x-forwarded-host")&&(r.protocol=null!==(n=o.headers.get("x-forwarded-proto"))&&void 0!==n?n:o.nextUrl.protocol,r.port=null!==(i=o.headers.get("x-forwarded-port"))&&void 0!==i?i:""));return o.nextUrl.basePath&&(r.pathname=v(r.pathname,o.nextUrl.basePath)),e.redirect(r.toString())}const q=f(L,w.locales,w.localePrefix),H=m(L,w.locales,w.localePrefix),z=null!=H,A="never"===w.localePrefix.mode||C&&"as-needed"===w.localePrefix.mode;let I,S,V=q;const B=w.pathnames;if(B){let e;if([e,S]=h(B,q,j),S){const l=B[S],a="string"==typeof l?l:l[j];if(t(a,q))V=u(q,a,S);else{let t;t=e?"string"==typeof l?l:l[e]:S;const n=A?void 0:r(j,w.localePrefix),i=u(q,t,a);I=R(x(i,n,o.nextUrl.search))}}}if(!I)if("/"!==V||z){const e=x(V,U(j),o.nextUrl.search);if(z){const l=x(q,H.prefix,o.nextUrl.search);if("never"===w.localePrefix.mode)I=R(x(q,void 0,o.nextUrl.search));else if(H.exact)if(C&&A)I=R(x(q,void 0,o.nextUrl.search));else if(w.domains){const o=p(g,H.locale,b);I=(null==g?void 0:g.domain)===(null==o?void 0:o.domain)||y?D(e):R(l,null==o?void 0:o.domain)}else I=D(e);else I=R(l)}else I=A?D(e):R(x(q,r(j,w.localePrefix),o.nextUrl.search))}else I=A?D(x(V,U(j),o.nextUrl.search)):R(x(q,r(j,w.localePrefix),o.nextUrl.search));return w.localeDetection&&w.localeCookie&&s(o,I,j,w.localeCookie),"never"!==w.localePrefix.mode&&w.alternateLinks&&w.locales.length>1&&I.headers.set("Link",n({routing:w,localizedPathnames:null!=S&&B?B[S]:void 0,request:o,resolvedLocale:j})),I}}export{P as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{match as e}from"@formatjs/intl-localematcher";import o from"negotiator";import{getPathnameMatch as l,isLocaleSupportedOnDomain as t,getHost as a}from"./utils.js";function n(l,t,a){let n;const c=new o({headers:{"accept-language":l.get("accept-language")||void 0}}).languages();try{const o=function(e){return e.slice().sort(((e,o)=>o.length-e.length))}(t);n=e(c,o,a)}catch(e){}return n}function c(e,o){if(e.localeCookie&&o.has(e.localeCookie.name)){var l;const t=null===(l=o.get(e.localeCookie.name))||void 0===l?void 0:l.value;if(t&&e.locales.includes(t))return t}}function i(e,o,t,a){let i;var r;a&&(i=null===(r=l(a,e.locales,e.localePrefix))||void 0===r?void 0:r.locale);return!i&&e.localeDetection&&(i=c(e,t)),!i&&e.localeDetection&&(i=n(o,e.locales,e.defaultLocale)),i||(i=e.defaultLocale),i}function r(e,o,r,u){const f=function(e,o){const l=a(e);if(l)return o.find((e=>e.domain===l))}(o,e.domains);if(!f)return{locale:i(e,o,r,u)};let s;if(u){var d;const o=null===(d=l(u,e.locales,e.localePrefix))||void 0===d?void 0:d.locale;if(o){if(!t(o,f))return{locale:o,domain:f};s=o}}if(!s&&e.localeDetection){const o=c(e,r);o&&t(o,f)&&(s=o)}if(!s&&e.localeDetection){const l=n(o,f.locales||e.locales,f.defaultLocale);l&&(s=l)}return s||(s=f.defaultLocale),{locale:s,domain:f}}function u(e,o,l,t){return e.domains?r(e,o,l,t):{locale:i(e,o,l,t)}}export{u as default,n as getAcceptLanguageLocale};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,o,t,a){var i;const{name:n,...s}=a;(null===(i=e.cookies.get(n))||void 0===i?void 0:i.value)!==t&&o.cookies.set(n,t,{path:e.nextUrl.basePath||void 0,...s})}export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getSortedPathnames as t,matchesPathname as e,normalizeTrailingSlash as n,getLocalePrefix as r,templateToRegex as o,prefixPathname as c}from"../shared/utils.js";function l(n,r,o){const c=t(Object.keys(n));for(const t of c){const c=n[t];if("string"==typeof c){if(e(c,r))return[void 0,t]}else{const n=Object.entries(c),l=n.findIndex((t=>{let[e]=t;return e===o}));l>0&&n.unshift(n.splice(l,1)[0]);for(const[o,c]of n)if(e(c,r))return[o,t]}}for(const t of Object.keys(n))if(e(t,r))return[void 0,t];return[void 0,void 0]}function i(t,e,r,o){let c="";return c+=d(r,a(e,t)),c=n(c),c}function u(t,e,r){t.endsWith("/")||(t+="/");const o=f(e,r),c=new RegExp("^(".concat(o.map((t=>{let[,e]=t;return e.replaceAll("/","\\/")})).join("|"),")/(.*)"),"i"),l=t.match(c);let i=l?"/"+l[2]:t;return"/"!==i&&(i=n(i)),i}function f(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.map((t=>[t,r(t,e)]));return n&&o.sort(((t,e)=>e[1].length-t[1].length)),o}function s(t,e,n){const r=f(e,n);for(const[e,n]of r){let r,o;if(t===n||t.startsWith(n+"/"))r=o=!0;else{const e=t.toLowerCase(),c=n.toLowerCase();(e===c||e.startsWith(c+"/"))&&(r=!1,o=!0)}if(o)return{locale:e,prefix:n,matchedPrefix:t.slice(0,n.length),exact:r}}}function a(t,e){const r=n(e),c=n(t),l=o(c).exec(r);if(!l)return;const i={};for(let t=1;t<l.length;t++){var u;const e=null===(u=c.match(/\[([^\]]+)\]/g))||void 0===u?void 0:u[t-1].replace(/[[\]]/g,"");e&&(i[e]=l[t])}return i}function d(t,e){if(!e)return t;let n=t=t.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(e).forEach((t=>{let[e,r]=t;n=n.replace("[".concat(e,"]"),r)})),n}function h(t,e,n){let r=t;return e&&(r=c(e,r)),n&&(r+=n),r}function v(t){var e,n;return null!==(e=null!==(n=t.get("x-forwarded-host"))&&void 0!==n?n:t.get("host"))&&void 0!==e?e:void 0}function g(t,e){return e.defaultLocale===t||!e.locales||e.locales.includes(t)}function p(t,e,n){let r;return t&&g(e,t)&&(r=t),r||(r=n.find((t=>t.defaultLocale===e))),r||(r=n.find((t=>{var n;return null===(n=t.locales)||void 0===n?void 0:n.includes(e)}))),r||null!=(null==t?void 0:t.locales)||(r=t),r||(r=n.find((t=>!t.locales))),r}function x(t,e){return n(e+t)}function m(t){return"/".concat(t)}function j(t){return t.replace(/\\/g,"%5C").replace(/\/+/g,"/")}export{x as applyBasePath,h as formatPathname,d as formatPathnameTemplate,i as formatTemplatePathname,p as getBestMatchingDomain,v as getHost,l as getInternalTemplate,m as getLocaleAsPrefix,f as getLocalePrefixes,u as getNormalizedPathname,s as getPathnameMatch,a as getRouteParams,g as isLocaleSupportedOnDomain,j as sanitizePathname};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as l}from"react";import o from"../../react-client/useLocale.js";import{getLocalePrefix as t}from"../../shared/utils.js";import a from"../shared/LegacyBaseLink.js";function i(l,i){let{locale:s,localePrefix:c,...m}=l;const n=o(),f=s||n,p=t(f,c);return r.createElement(a,e({ref:i,locale:f,localePrefixMode:c.mode,prefix:p},m))}const s=l(i);s.displayName="ClientLink";export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as o,useMemo as t}from"react";import n from"../../react-client/useLocale.js";import{receiveRoutingConfig as a,receiveLocaleCookie as l}from"../../routing/config.js";import{getRoute as c,compileLocalizedPathname as i,normalizeNameOrNameWithParams as s}from"../shared/utils.js";import f from"./ClientLink.js";import{clientRedirect as u,clientPermanentRedirect as m}from"./redirects.js";import h from"./useBasePathname.js";import p from"./useBaseRouter.js";function d(d){const v=a(d),P=l(d.localeCookie);function x(){const e=n();if(!v.locales.includes(e))throw new Error('Unknown locale encountered: "'.concat(e,'". Make sure to validate the locale in `i18n.ts`.'));return e}function g(o,t){let{href:n,locale:a,...l}=o;const c=x(),s=a||c;return r.createElement(f,e({ref:t,href:i({locale:s,pathname:n,params:"object"==typeof n?n.params:void 0,pathnames:v.pathnames}),locale:a,localeCookie:P,localePrefix:v.localePrefix},l))}const j=o(g);function w(e){let{href:r,locale:o}=e;return i({...s(r),locale:o,pathnames:v.pathnames})}return j.displayName="Link",{Link:j,redirect:function(e){const r=w({href:e,locale:x()});for(var o=arguments.length,t=new Array(o>1?o-1:0),n=1;n<o;n++)t[n-1]=arguments[n];return u({pathname:r,localePrefix:v.localePrefix},...t)},permanentRedirect:function(e){const r=w({href:e,locale:x()});for(var o=arguments.length,t=new Array(o>1?o-1:0),n=1;n<o;n++)t[n-1]=arguments[n];return m({pathname:r,localePrefix:v.localePrefix},...t)},usePathname:function(){const e=h(v.localePrefix),r=x();return t((()=>e?c(r,e,v.pathnames):e),[r,e])},useRouter:function(){const e=p(v.localePrefix,P),r=x();return t((()=>({...e,push(o){for(var t,n=arguments.length,a=new Array(n>1?n-1:0),l=1;l<n;l++)a[l-1]=arguments[l];const c=w({href:o,locale:(null===(t=a[0])||void 0===t?void 0:t.locale)||r});return e.push(c,...a)},replace(o){for(var t,n=arguments.length,a=new Array(n>1?n-1:0),l=1;l<n;l++)a[l-1]=arguments[l];const c=w({href:o,locale:(null===(t=a[0])||void 0===t?void 0:t.locale)||r});return e.replace(c,...a)},prefetch(o){for(var t,n=arguments.length,a=new Array(n>1?n-1:0),l=1;l<n;l++)a[l-1]=arguments[l];const c=w({href:o,locale:(null===(t=a[0])||void 0===t?void 0:t.locale)||r});return e.prefetch(c,...a)}})),[e,r])},getPathname:w}}export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRouter as e,usePathname as t}from"next/navigation";import{useMemo as o}from"react";import n from"../../react-client/useLocale.js";import r from"../shared/createSharedNavigationFns.js";import a from"../shared/syncLocaleCookie.js";import{getRoute as c}from"../shared/utils.js";import i from"./useBasePathname.js";function s(s){function u(){return n()}const{Link:m,config:f,getPathname:h,...l}=r(u,s);return{...l,Link:m,usePathname:function(){const e=i(f.localePrefix),t=u();return o((()=>e&&f.pathnames?c(t,e,f.pathnames):e),[t,e])},useRouter:function(){const n=e(),r=u(),c=t();return o((()=>{function e(e){return function(t,o){const{locale:n,...i}=o||{},s=[h({href:t,locale:n||r,domain:window.location.host})];Object.keys(i).length>0&&s.push(i),e(...s),a(f.localeCookie,c,r,n)}}return{...n,push:e(n.push),replace:e(n.replace),prefetch:e(n.prefetch)}}),[r,c,n])},getPathname:h}}export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as o}from"react";import{receiveLocalePrefixConfig as t,receiveLocaleCookie as n}from"../../routing/config.js";import i from"./ClientLink.js";import{clientRedirect as a,clientPermanentRedirect as l}from"./redirects.js";import u from"./useBasePathname.js";import f from"./useBaseRouter.js";function m(m){const c=t(null==m?void 0:m.localePrefix),s=n(null==m?void 0:m.localeCookie);function p(o,t){return r.createElement(i,e({ref:t,localeCookie:s,localePrefix:c},o))}const d=o(p);return d.displayName="Link",{Link:d,redirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),t=1;t<r;t++)o[t-1]=arguments[t];return a({pathname:e,localePrefix:c},...o)},permanentRedirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),t=1;t<r;t++)o[t-1]=arguments[t];return l({pathname:e,localePrefix:c},...o)},usePathname:function(){return u(c)},useRouter:function(){return f(c,s)}}}export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"../../react-client/useLocale.js";import{baseRedirect as e,basePermanentRedirect as n}from"../shared/redirects.js";function t(e){return function(n){let t;try{t=r()}catch(r){throw new Error("`redirect()` and `permanentRedirect()` can only be called during render. To redirect in an event handler or similar, you can use `useRouter()` instead.")}for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];return e({...n,locale:t},...a)}}const o=t(e),a=t(n);export{a as clientPermanentRedirect,o as clientRedirect};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{usePathname as r}from"next/navigation";import{useMemo as t}from"react";import o from"../../react-client/useLocale.js";import{hasPathnamePrefixed as e,unprefixPathname as n,getLocalePrefix as i}from"../../shared/utils.js";function a(a){const m=r(),s=o();return t((()=>{if(!m)return m;const r=i(s,a);return e(r,m)?n(m,r):m}),[s,a,m])}export{a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useRouter as t,usePathname as e}from"next/navigation";import{useMemo as r}from"react";import o from"../../react-client/useLocale.js";import{getLocalePrefix as n,localizeHref as c}from"../../shared/utils.js";import s from"../shared/syncLocaleCookie.js";import{getBasePath as a}from"../shared/utils.js";function i(i,p){const u=t(),l=o(),f=e();return r((()=>{function t(t,e){let r=window.location.pathname;const o=a(f);o&&(r=r.replace(o,""));const s=e||l,p=n(s,i);return c(t,s,l,r,p)}function e(e){return function(r,o){const{locale:n,...c}=o||{};s(p,f,l,n);const a=[t(r,n)];return Object.keys(c).length>0&&a.push(c),e(...a)}}return{...u,push:e(u.push),replace:e(u.replace),prefetch:e(u.prefetch)}}),[l,p,i,f,u])}export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{getLocalePrefix as o}from"../../shared/utils.js";import a from"../shared/LegacyBaseLink.js";import t from"../../server/react-server/getLocale.js";async function l(l){let{locale:s,localePrefix:i,...c}=l;const m=s||await t(),f=o(m,i);return r.createElement(a,e({locale:m,localePrefixMode:i.mode,prefix:f},c))}export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveRoutingConfig as o}from"../../routing/config.js";import{getRequestLocale as t}from"../../server/react-server/RequestLocaleLegacy.js";import{compileLocalizedPathname as a,normalizeNameOrNameWithParams as n}from"../shared/utils.js";import l from"./ServerLink.js";import{serverRedirect as c,serverPermanentRedirect as i}from"./redirects.js";function s(s){const m=o(s);function f(e){let{href:r,locale:o}=e;return a({...n(r),locale:o,pathnames:m.pathnames})}function u(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(o){let{href:n,locale:c,...i}=o;const s=t(),f=c||s;return r.createElement(l,e({href:a({locale:f,pathname:n,params:"object"==typeof n?n.params:void 0,pathnames:m.pathnames}),locale:c,localeCookie:m.localeCookie,localePrefix:m.localePrefix},i))},redirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,a=new Array(o>1?o-1:0),n=1;n<o;n++)a[n-1]=arguments[n];return c({localePrefix:m.localePrefix,pathname:r},...a)},permanentRedirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,a=new Array(o>1?o-1:0),n=1;n<o;n++)a[n-1]=arguments[n];return i({localePrefix:m.localePrefix,pathname:r},...a)},getPathname:f,usePathname:u("usePathname"),useRouter:u("useRouter")}}export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"../shared/createSharedNavigationFns.js";import o from"./getServerLocale.js";function t(t){const{config:n,...r}=e((function(){return o()}),t);function u(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the calling component to a Client Component."))}}return{...r,usePathname:u("usePathname"),useRouter:u("useRouter")}}export{t as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveLocalePrefixConfig as o,receiveLocaleCookie as n}from"../../routing/config.js";import t from"./ServerLink.js";import{serverRedirect as i,serverPermanentRedirect as a}from"./redirects.js";function l(l){const u=o(null==l?void 0:l.localePrefix),c=n(null==l?void 0:l.localeCookie);function f(e){return()=>{throw new Error("`".concat(e,"` is not supported in Server Components. You can use this hook if you convert the component to a Client Component."))}}return{Link:function(o){return r.createElement(t,e({localeCookie:c,localePrefix:u},o))},redirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return i({pathname:e,localePrefix:u},...o)},permanentRedirect:function(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return a({pathname:e,localePrefix:u},...o)},usePathname:f("usePathname"),useRouter:f("useRouter")}}export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getRequestLocale as r}from"../../server/react-server/RequestLocaleLegacy.js";import{baseRedirect as e,basePermanentRedirect as t}from"../shared/redirects.js";function o(e){return function(t){const o=r();for(var n=arguments.length,c=new Array(n>1?n-1:0),s=1;s<n;s++)c[s-1]=arguments[s];return e({...t,locale:o},...c)}}const n=o(e),c=o(t);export{c as serverPermanentRedirect,n as serverRedirect};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import o from"next/link";import{usePathname as t}from"next/navigation";import r,{forwardRef as n,useState as l,useEffect as i}from"react";import c from"../../react-client/useLocale.js";import a from"./syncLocaleCookie.js";function s(n,s){let{defaultLocale:p,href:f,locale:u,localeCookie:m,onClick:h,prefetch:d,unprefixed:k,...x}=n;const L=c(),g=null!=u&&u!==L,j=u||L,v=function(){const[e,o]=l();return i((()=>{o(window.location.host)}),[]),e}(),w=v&&k&&(k.domains[v]===j||!Object.keys(k.domains).includes(v)&&L===p&&!u)?k.pathname:f,C=t();return g&&(d&&console.error("The `prefetch` prop is currently not supported when using the `locale` prop on `Link` to switch the locale.`"),d=!1),r.createElement(o,e({ref:s,href:w,hrefLang:g?u:void 0,onClick:function(e){a(m,C,L,u),h&&h(e)},prefetch:d},x))}var p=n(s);export{p as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{usePathname as o}from"next/navigation";import r,{forwardRef as l,useState as t,useEffect as i}from"react";import a from"../../react-client/useLocale.js";import{isLocalizableHref as n,prefixHref as s,localizeHref as m}from"../../shared/utils.js";import c from"./BaseLink.js";function f(l,f){let{href:p,locale:u,localeCookie:d,localePrefixMode:x,prefix:j,...k}=l;const h=o(),v=a(),C=u!==v,[L,g]=t((()=>n(p)&&("never"!==x||C)?s(p,j):p));return i((()=>{h&&g(m(p,u,v,h,j))}),[v,p,u,h,j]),r.createElement(c,e({ref:f,href:L,locale:u,localeCookie:d},k))}const p=l(f);p.displayName="ClientLink";export{p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import{redirect as o,permanentRedirect as a}from"next/navigation";import t,{forwardRef as n,use as r}from"react";import{receiveRoutingConfig as l}from"../../routing/config.js";import{isLocalizableHref as i}from"../../shared/utils.js";import m from"./BaseLink.js";import{validateReceivedConfig as c,serializeSearchParams as f,compileLocalizedPathname as s,applyPathnamePrefix as u,normalizeNameOrNameWithParams as p}from"./utils.js";function d(d,h){const j=l(h||{});c(j);const g=j.pathnames,v="as-needed"===j.localePrefix.mode&&j.domains||void 0;function y(o,a){let n,l,{href:c,locale:f,...s}=o;"object"==typeof c?(n=c.pathname,l=c.params):n=c;const u=i(c),p=d(),h=p instanceof Promise?r(p):p,y=u?L({locale:f||h,href:null==g?n:{pathname:n,params:l}},null!=f||v||void 0):n;return t.createElement(m,e({ref:a,defaultLocale:j.defaultLocale,href:"object"==typeof c?{...c,pathname:y}:y,locale:f,localeCookie:j.localeCookie,unprefixed:v&&u?{domains:j.domains.reduce(((e,o)=>(e[o.domain]=o.defaultLocale,e)),{}),pathname:L({locale:h,href:null==g?n:{pathname:n,params:l}},!1)}:void 0},s))}const x=n(y);function L(e,o){const{href:a,locale:t}=e;let n;return null==g?"object"==typeof a?(n=a.pathname,a.query&&(n+=f(a.query))):n=a:n=s({locale:t,...p(a),pathnames:j.pathnames}),u(n,t,j,e.domain,o)}function b(e){return function(o){for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];return e(L(o,o.domain?void 0:v),...t)}}const k=b(o),P=b(a);return{config:j,Link:x,redirect:k,permanentRedirect:P,getPathname:L}}export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{redirect as e,permanentRedirect as n}from"next/navigation";import{getLocalePrefix as r,isLocalizableHref as t,prefixPathname as o}from"../../shared/utils.js";function a(e){return function(n){const a=r(n.locale,n.localePrefix),i="never"!==n.localePrefix.mode&&t(n.pathname)?o(a,n.pathname):n.pathname;for(var l=arguments.length,m=new Array(l>1?l-1:0),c=1;c<l;c++)m[c-1]=arguments[c];return e(i,...m)}}const i=a(e),l=a(n);export{l as basePermanentRedirect,i as baseRedirect};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getBasePath as t}from"./utils.js";function o(o,e,n,a){if(!o||!(a!==n&&null!=a)||!e)return;const c=t(e),f=""!==c?c:"/",{name:r,...i}=o;i.path||(i.path=f);let l="".concat(r,"=").concat(a,";");for(const[t,o]of Object.entries(i)){l+="".concat("maxAge"===t?"max-age":t),"boolean"!=typeof o&&(l+="="+o),l+=";"}document.cookie=l}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getSortedPathnames as e,matchesPathname as n,isLocalizableHref as t,prefixPathname as r,getLocalePrefix as o,normalizeTrailingSlash as a}from"../../shared/utils.js";function i(e){return"string"==typeof e?{pathname:e}:e}function c(e){function n(e){return String(e)}const t=new URLSearchParams;for(const[r,o]of Object.entries(e))Array.isArray(o)?o.forEach((e=>{t.append(r,n(e))})):t.set(r,n(o));return"?"+t.toString()}function s(e){let{pathname:n,locale:t,params:r,pathnames:o,query:i}=e;function s(e){let n=o[e];return n||(n=e),n}function f(e){const n="string"==typeof e?e:e[t];let o=n;if(r&&Object.entries(r).forEach((e=>{let n,t,[r,a]=e;Array.isArray(a)?(n="(\\[)?\\[...".concat(r,"\\](\\])?"),t=a.map((e=>String(e))).join("/")):(n="\\[".concat(r,"\\]"),t=String(a)),o=o.replace(new RegExp(n,"g"),t)})),o=o.replace(/\[\[\.\.\..+\]\]/g,""),o=a(o),o.includes("["))throw new Error("Insufficient params provided for localized pathname.\nTemplate: ".concat(n,"\nParams: ").concat(JSON.stringify(r)));return i&&(o+=c(i)),o}if("string"==typeof n){return f(s(n))}{const{pathname:e,...t}=n;return{...t,pathname:f(s(e))}}}function f(t,r,o){const a=e(Object.keys(o)),i=decodeURI(r);for(const e of a){const r=o[e];if("string"==typeof r){if(n(r,i))return e}else if(n(r[t],i))return e}return r}function l(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.pathname;return"/"===e?n:n.replace(e,"")}function d(e,n,a,i,c){const{mode:s}=a.localePrefix;let f;if(void 0!==c)f=c;else if(t(e))if("always"===s)f=!0;else if("as-needed"===s){let e=a.defaultLocale;if(a.domains){const n=a.domains.find((e=>e.domain===i));n?e=n.defaultLocale:i||console.error("You're using a routing configuration with `localePrefix: 'as-needed'` in combination with `domains`. In order to compute a correct pathname, you need to provide a `domain` parameter.\n\nSee: https://next-intl-docs.vercel.app/docs/routing#domains-localeprefix-asneeded")}f=e!==n}return f?r(o(n,a.localePrefix),e):e}function u(e){var n;if("as-needed"===(null===(n=e.localePrefix)||void 0===n?void 0:n.mode)&&!("defaultLocale"in e))throw new Error("`localePrefix: 'as-needed' requires a `defaultLocale`.")}export{d as applyPathnamePrefix,s as compileLocalizedPathname,l as getBasePath,f as getRoute,i as normalizeNameOrNameWithParams,c as serializeSearchParams,u as validateReceivedConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as createSharedPathnamesNavigation}from"./navigation/react-client/createSharedPathnamesNavigation.js";export{default as createLocalizedPathnamesNavigation}from"./navigation/react-client/createLocalizedPathnamesNavigation.js";export{default as createNavigation}from"./navigation/react-client/createNavigation.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as createSharedPathnamesNavigation}from"./navigation/react-server/createSharedPathnamesNavigation.js";export{default as createLocalizedPathnamesNavigation}from"./navigation/react-server/createLocalizedPathnamesNavigation.js";export{default as createNavigation}from"./navigation/react-server/createNavigation.js";
|
package/dist/esm/plugin.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import n from"fs";import t from"path";function e(n){return["".concat(n,".ts"),"".concat(n,".tsx"),"".concat(n,".js"),"".concat(n,".jsx")]}let o=!1;function r(r,i){function s(e){return n.existsSync(function(n){const e=[];return i&&e.push(i),e.push(n),t.resolve(...e)}(e))}if(r){if(!s(r))throw new Error("[next-intl] Could not find i18n config at ".concat(r,", please provide a valid path."));return r}for(const n of[...e("./i18n/request"),...e("./src/i18n/request")])if(s(n))return n;for(const n of[...e("./i18n"),...e("./src/i18n")])if(s(n))return o||(console.warn("\n[next-intl] Reading request configuration from ".concat(n," is deprecated, please see https://next-intl-docs.vercel.app/blog/next-intl-3-22#i18n-request — you can either move your configuration to ./i18n/request.ts or provide a custom path in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);\n")),o=!0),n;throw new Error("\n[next-intl] Could not locate request configuration module.\n\nThis path is supported by default: ./(src/)i18n/request.{js,jsx,ts,tsx}\n\nAlternatively, you can specify a custom location in your Next.js config:\n\nconst withNextIntl = createNextIntlPlugin(\n './path/to/i18n/request.tsx'\n);\n")}module.exports=function(n){return function(e){return function(n,e){null!=(null==e?void 0:e.i18n)&&console.warn("\n[next-intl] An `i18n` property was found in your Next.js config. This likely causes conflicts and should therefore be removed if you use the App Router.\n\nIf you're in progress of migrating from the Pages Router, you can refer to this example: https://next-intl-docs.vercel.app/examples#app-router-migration\n");const o={};if(null!=process.env.TURBOPACK){var i,s;if(null!=n&&n.startsWith("/"))throw new Error("[next-intl] Turbopack support for next-intl currently does not support absolute paths, please provide a relative one (e.g. './src/i18n/config.ts').\n\nFound: "+n+"\n");o.experimental={...null==e?void 0:e.experimental,turbo:{...null==e||null===(i=e.experimental)||void 0===i?void 0:i.turbo,resolveAlias:{...null==e||null===(s=e.experimental)||void 0===s||null===(s=s.turbo)||void 0===s?void 0:s.resolveAlias,"next-intl/config":r(n)}}}}else o.webpack=function(){for(var o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];let[l,u]=i;return l.resolve.alias["next-intl/config"]=t.resolve(l.context,r(n,l.context)),"function"==typeof(null==e?void 0:e.webpack)?e.webpack(l,u):l};return o.env={...null==e?void 0:e.env,_next_intl_trailing_slash:null!=e&&e.trailingSlash?"true":void 0},Object.assign({},e,o)}(n,e)}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useTranslations as e,useFormatter as t}from"use-intl";export*from"use-intl";function n(e,t){return function(){try{return t(...arguments)}catch(t){throw new Error("Failed to call `".concat(e,"` because the context from `NextIntlClientProvider` was not found.\n\nThis can happen because:\n1) You intended to render this component as a Server Component, the render\n failed, and therefore React attempted to render the component on the client\n instead. If this is the case, check the console for server errors.\n2) You intended to render this component on the client side, but no context was found.\n Learn more about this error here: https://next-intl-docs.vercel.app/docs/environments/server-client-components#missing-context"))}}}const o=n("useTranslations",e),r=n("useFormatter",t);export{r as useFormatter,o as useTranslations};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useParams as t}from"next/navigation";import{useLocale as o}from"use-intl/_useLocale";import{LOCALE_SEGMENT_NAME as r}from"../shared/constants.js";function e(){const e=t();let n;try{n=o()}catch(t){if("string"!=typeof(null==e?void 0:e[r]))throw t;n=e[r]}return n}export{e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{extends as e}from"../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import t from"../shared/NextIntlClientProvider.js";import o from"../server/react-server/getLocale.js";import l from"../server/react-server/getNow.js";import a from"../server/react-server/getTimeZone.js";async function i(i){let{locale:n,now:s,timeZone:m,...c}=i;return r.createElement(t,e({locale:null!=n?n:await o(),now:null!=s?s:await l(),timeZone:null!=m?m:await a()},c))}export{i as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{use as e}from"react";import n from"../server/react-server/getConfig.js";function r(r){return function(n,r){try{return e(r)}catch(e){throw e instanceof TypeError&&e.message.includes("Cannot read properties of null (reading 'use')")?new Error("`".concat(n,"` is not callable within an async component. Please refer to https://next-intl-docs.vercel.app/docs/environments/server-client-components#async-components"),{cause:e}):e}}(r,n())}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cache as r}from"react";import{createFormatter as o}from"use-intl/core";import t from"./useConfig.js";const e=r(o);function n(){for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];const f=t("useFormatter");return e(f)}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./useConfig.js";function r(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return e("useLocale").locale}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getMessagesFromConfig as e}from"../server/react-server/getMessages.js";import r from"./useConfig.js";function s(){for(var s=arguments.length,t=new Array(s),o=0;o<s;o++)t[o]=arguments[o];const a=r("useMessages");return e(a)}export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./useConfig.js";function o(){for(var o=arguments.length,n=new Array(o),t=0;t<o;t++)n[t]=arguments[t];let[r]=n;null!=(null==r?void 0:r.updateInterval)&&console.error("`useNow` doesn't support the `updateInterval` option in Server Components, the value will be ignored. If you need the value to update, you can convert the component to a Client Component.");return e("useNow").now}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import e from"./useConfig.js";function r(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return e("useTimeZone").timeZone}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import r from"./getTranslator.js";import t from"./useConfig.js";function o(){for(var o=arguments.length,n=new Array(o),e=0;e<o;e++)n[e]=arguments[e];let[s]=n;const a=t("useTranslations");return r(a,s)}export{o as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){var t,n;return{...e,localePrefix:l(e.localePrefix),localeCookie:o(e.localeCookie),localeDetection:null===(t=e.localeDetection)||void 0===t||t,alternateLinks:null===(n=e.alternateLinks)||void 0===n||n}}function o(e){return!(null!=e&&!e)&&{name:"NEXT_LOCALE",maxAge:31536e3,sameSite:"lax",..."object"==typeof e&&e}}function l(e){return"object"==typeof e?e:{mode:e||"always"}}export{o as receiveLocaleCookie,l as receiveLocalePrefixConfig,e as receiveRoutingConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return()=>{throw new Error("`".concat(e,"` is not supported in Client Components."))}}function t(){return e("getRequestConfig")}const n=e("getFormatter"),o=e("getNow"),s=e("getTimeZone"),r=e("getMessages"),a=e("getLocale"),g=e("getTranslations"),u=e("unstable_setRequestLocale"),c=e("setRequestLocale");export{n as getFormatter,a as getLocale,r as getMessages,o as getNow,t as getRequestConfig,s as getTimeZone,g as getTranslations,c as setRequestLocale,u as unstable_setRequestLocale};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{headers as t}from"next/headers";import{cache as e}from"react";import{HEADER_LOCALE_NAME as n}from"../../shared/constants.js";import{getCachedRequestLocale as r}from"./RequestLocaleCache.js";const o=e((async function(){const e=t();return e instanceof Promise?await e:e}));const i=e((async function(){let t;try{t=(await o()).get(n)||void 0}catch(t){if(t instanceof Error&&"DYNAMIC_SERVER_USAGE"===t.digest){const e=new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:t});throw e.digest=t.digest,e}throw t}return t}));async function s(){return r()||await i()}export{s as getRequestLocale};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{headers as e}from"next/headers";import{notFound as t}from"next/navigation";import{cache as n}from"react";import{HEADER_LOCALE_NAME as o}from"../../shared/constants.js";import{getCachedRequestLocale as r}from"./RequestLocaleCache.js";const i=n((function(){let n;try{n=e().get(o)}catch(e){throw e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest?new Error("Usage of next-intl APIs in Server Components currently opts into dynamic rendering. This limitation will eventually be lifted, but as a stopgap solution, you can use the `setRequestLocale` API to enable static rendering, see https://next-intl-docs.vercel.app/docs/getting-started/app-router/with-i18n-routing#static-rendering",{cause:e}):e}return n||(console.error("\nUnable to find `next-intl` locale because the middleware didn't run on this request. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale. The `notFound()` function will be called as a result.\n"),t()),n}));function s(){return r()||i()}export{s as getRequestLocale};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{notFound as e}from"next/navigation";import{cache as t}from"react";import{_createIntlFormatters as n,_createCache as o,initializeConfig as r}from"use-intl/core";import{getRequestLocale as i}from"./RequestLocale.js";import{getRequestLocale as a}from"./RequestLocaleLegacy.js";import s from"next-intl/config";const c=t((function(){return new Date}));const l=t((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const u=t((async function(t,n){if("function"!=typeof t)throw new Error("Invalid i18n request configuration detected.\n\nPlease verify that:\n1. In case you've specified a custom location in your Next.js config, make sure that the path is correct.\n2. You have a default export in your i18n request configuration file.\n\nSee also: https://next-intl-docs.vercel.app/docs/usage/configuration#i18n-request\n");const o={get locale(){return n||a()},get requestLocale(){return n?Promise.resolve(n):i()}};let r=t(o);r instanceof Promise&&(r=await r);const s=r.locale||await o.requestLocale;return s||(console.error("\nUnable to find `next-intl` locale because the middleware didn't run on this request and no `locale` was returned in `getRequestConfig`. See https://next-intl-docs.vercel.app/docs/routing/middleware#unable-to-find-locale. The `notFound()` function will be called as a result.\n"),e()),{...r,locale:s,now:r.now||c(),timeZone:r.timeZone||l()}})),f=t(n),m=t(o);const d=t((async function(e){const t=await u(s,e);return{...r(t),_formatters:f(m())}}));export{d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cache as o}from"react";import{createFormatter as t}from"use-intl/core";import n from"./getConfig.js";const r=o((async function(o){const r=await n(o);return t(r)}));async function c(o){return r(null==o?void 0:o.locale)}export{c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cache as o}from"react";import t from"./getConfig.js";const r=o((async function(){const o=await t();return Promise.resolve(o.locale)}));export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cache as e}from"react";import o from"./getConfig.js";function t(e){if(!e.messages)throw new Error("No messages found. Have you configured them correctly? See https://next-intl-docs.vercel.app/docs/configuration#messages");return e.messages}const n=e((async function(e){return t(await o(e))}));async function r(e){return n(null==e?void 0:e.locale)}export{r as default,t as getMessagesFromConfig};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cache as n}from"react";import o from"./getConfig.js";const t=n((async function(n){return(await o(n)).now}));async function r(n){return t(null==n?void 0:n.locale)}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{cache as e}from"react";import{createTranslator as t}from"use-intl/core";import a from"./getConfig.js";var s=e((async function(e){let s,o;"string"==typeof e?s=e:e&&(o=e.locale,s=e.namespace);const r=await a(o);return t({...r,namespace:s,messages:r.messages})}));export{s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{getFormatter,getLocale,getMessages,getNow,getRequestConfig,getTimeZone,getTranslations,setRequestLocale,unstable_setRequestLocale}from"./server/react-client/index.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as getRequestConfig}from"./server/react-server/getRequestConfig.js";export{default as getFormatter}from"./server/react-server/getFormatter.js";export{default as getMessages}from"./server/react-server/getMessages.js";export{default as getNow}from"./server/react-server/getNow.js";export{default as getTimeZone}from"./server/react-server/getTimeZone.js";export{default as getTranslations}from"./server/react-server/getTranslations.js";export{default as getLocale}from"./server/react-server/getLocale.js";export{setCachedRequestLocale as setRequestLocale,setCachedRequestLocale as unstable_setRequestLocale}from"./server/react-server/RequestLocaleCache.js";
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{extends as e}from"../_virtual/_rollupPluginBabelHelpers.js";import l from"react";import{IntlProvider as t}from"use-intl/_IntlProvider";function r(r){let{locale:o,...i}=r;if(!o)throw new Error("Failed to determine locale in `NextIntlClientProvider`, please provide the `locale` prop explicitly.\n\nSee https://next-intl-docs.vercel.app/docs/configuration#locale");return l.createElement(t,e({locale:o},i))}export{r as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const o="X-NEXT-INTL-LOCALE",L="locale";export{o as HEADER_LOCALE_NAME,L as LOCALE_SEGMENT_NAME};
|
package/dist/esm/shared/utils.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function n(n){return function(n){return"object"==typeof n?null==n.host&&null==n.hostname:!/^[a-z]+:/i.test(n)}(n)&&!function(n){const t="object"==typeof n?n.pathname:n;return null!=t&&!t.startsWith("/")}(n)}function t(t,r){let u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:r,c=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!n(t))return t;const f=r!==u,l=i(o,c);return(f||l)&&null!=o?e(t,o):t}function e(n,t){let e;return"string"==typeof n?e=u(t,n):(e={...n},n.pathname&&(e.pathname=u(t,n.pathname))),e}function r(n,t){return n.replace(new RegExp("^".concat(t)),"")||"/"}function u(n,t){let e=n;return/^\/(\?.*)?$/.test(t)&&(t=t.slice(1)),e+=t,e}function i(n,t){return t===n||t.startsWith("".concat(n,"/"))}function c(n){const t=function(){try{return"true"===process.env._next_intl_trailing_slash}catch(n){return!1}}();if("/"!==n){const e=n.endsWith("/");t&&!e?n+="/":!t&&e&&(n=n.slice(0,-1))}return n}function o(n,t){const e=c(n),r=c(t);return l(e).test(r)}function f(n,t){var e;return"never"!==t.mode&&(null===(e=t.prefixes)||void 0===e?void 0:e[n])||"/"+n}function l(n){const t=n.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(t,"$"))}function s(n){return n.includes("[[...")}function a(n){return n.includes("[...")}function p(n){return n.includes("[")}function h(n,t){const e=n.split("/"),r=t.split("/"),u=Math.max(e.length,r.length);for(let n=0;n<u;n++){const t=e[n],u=r[n];if(!t&&u)return-1;if(t&&!u)return 1;if(t||u){if(!p(t)&&p(u))return-1;if(p(t)&&!p(u))return 1;if(!a(t)&&a(u))return-1;if(a(t)&&!a(u))return 1;if(!s(t)&&s(u))return-1;if(s(t)&&!s(u))return 1}}return 0}function g(n){return n.sort(h)}export{f as getLocalePrefix,g as getSortedPathnames,i as hasPathnamePrefixed,n as isLocalizableHref,t as localizeHref,o as matchesPathname,c as normalizeTrailingSlash,e as prefixHref,u as prefixPathname,l as templateToRegex,r as unprefixPathname};
|
package/dist/middleware.js
DELETED
package/dist/plugin.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},e.apply(null,arguments)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.extends=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(){throw new Error("Couldn't find next-intl config file. Please follow the instructions at https://next-intl-docs.vercel.app/docs/getting-started/app-router")};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./react-client/index.js"),t=require("./react-client/useLocale.js"),r=require("./shared/NextIntlClientProvider.js"),s=require("use-intl");exports.useFormatter=e.useFormatter,exports.useTranslations=e.useTranslations,exports.useLocale=t.default,exports.NextIntlClientProvider=r.default,Object.keys(s).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./react-server/useLocale.js"),r=require("./react-server/useTranslations.js"),t=require("./react-server/useFormatter.js"),s=require("./react-server/useNow.js"),u=require("./react-server/useTimeZone.js"),o=require("./react-server/useMessages.js"),a=require("./react-server/NextIntlClientProviderServer.js"),i=require("use-intl/core");exports.useLocale=e.default,exports.useTranslations=r.default,exports.useFormatter=t.default,exports.useNow=s.default,exports.useTimeZone=u.default,exports.useMessages=o.default,exports.NextIntlClientProvider=a.default,Object.keys(i).forEach((function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js"),a=require("./utils.js");exports.default=function(t){var o;let{localizedPathnames:n,request:l,resolvedLocale:r,routing:s}=t;const i=l.nextUrl.clone(),c=a.getHost(l.headers);function p(t,o){return t.pathname=e.normalizeTrailingSlash(t.pathname),l.nextUrl.basePath&&((t=new URL(t)).pathname=a.applyBasePath(t.pathname,l.nextUrl.basePath)),"<".concat(t.toString(),'>; rel="alternate"; hreflang="').concat(o,'"')}function m(e,t){return n&&"object"==typeof n?a.formatTemplatePathname(e,n[r],n[t]):e}c&&(i.port="",i.host=c),i.protocol=null!==(o=l.headers.get("x-forwarded-proto"))&&void 0!==o?o:i.protocol,i.pathname=a.getNormalizedPathname(i.pathname,s.locales,s.localePrefix);const h=a.getLocalePrefixes(s.locales,s.localePrefix,!1).flatMap((e=>{let t,[o,l]=e;function r(e){return"/"===e?l:l+e}if(s.domains){return s.domains.filter((e=>a.isLocaleSupportedOnDomain(o,e))).map((e=>(t=new URL(i),t.port="",t.host=e.domain,t.pathname=m(i.pathname,o),o===e.defaultLocale&&"always"!==s.localePrefix.mode||(t.pathname=r(t.pathname)),p(t,o))))}{let e;e=n&&"object"==typeof n?m(i.pathname,o):i.pathname,o===s.defaultLocale&&"always"!==s.localePrefix.mode||(e=r(e)),t=new URL(e,i)}return p(t,o)}));if(!s.domains&&("always"!==s.localePrefix.mode||"/"===i.pathname)){const e=new URL(m(i.pathname,s.defaultLocale),i);h.push(p(e,"x-default"))}return h.join(", ")};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../routing/config.js"),t=require("../shared/constants.js"),l=require("../shared/utils.js"),o=require("./getAlternateLinksHeaderValue.js"),n=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,h,m;const f=a.receiveRoutingConfig({...s,alternateLinks:null!==(d=null==c?void 0:c.alternateLinks)&&void 0!==d?d:s.alternateLinks,localeDetection:null!==(h=null==c?void 0:c.localeDetection)&&void 0!==h?h:s.localeDetection,localeCookie:null!==(m=null==c?void 0:c.localeCookie)&&void 0!==m?m:s.localeCookie});return function(a){var s;let c;try{c=decodeURI(a.nextUrl.pathname)}catch(a){return e.NextResponse.next()}const d=i.sanitizePathname(c),{domain:h,locale:m}=n.default(f,a.headers,a.cookies,d),u=h?h.defaultLocale===m:m===f.defaultLocale,x=(null===(s=f.domains)||void 0===s?void 0:s.filter((e=>i.isLocaleSupportedOnDomain(m,e))))||[],P=null!=f.domains&&!h;function p(l){const o=new URL(l,a.url);a.nextUrl.basePath&&(o.pathname=i.applyBasePath(o.pathname,a.nextUrl.basePath));const n=new Headers(a.headers);return n.set(t.HEADER_LOCALE_NAME,m),e.NextResponse.rewrite(o,{request:{headers:n}})}function v(t,o){const n=new URL(t,a.url);if(n.pathname=l.normalizeTrailingSlash(n.pathname),x.length>0&&!o&&h){const e=i.getBestMatchingDomain(h,m,x);e&&(o=e.domain,e.defaultLocale===m&&"as-needed"===f.localePrefix.mode&&(n.pathname=i.getNormalizedPathname(n.pathname,f.locales,f.localePrefix)))}var r,s;o&&(n.host=o,a.headers.get("x-forwarded-host")&&(n.protocol=null!==(r=a.headers.get("x-forwarded-proto"))&&void 0!==r?r:a.nextUrl.protocol,n.port=null!==(s=a.headers.get("x-forwarded-port"))&&void 0!==s?s:""));return a.nextUrl.basePath&&(n.pathname=i.applyBasePath(n.pathname,a.nextUrl.basePath)),e.NextResponse.redirect(n.toString())}const g=i.getNormalizedPathname(d,f.locales,f.localePrefix),L=i.getPathnameMatch(d,f.locales,f.localePrefix),U=null!=L,k="never"===f.localePrefix.mode||u&&"as-needed"===f.localePrefix.mode;let q,j,C=g;const D=f.pathnames;if(D){let e;if([e,j]=i.getInternalTemplate(D,g,m),j){const t=D[j],o="string"==typeof t?t:t[m];if(l.matchesPathname(o,g))C=i.formatTemplatePathname(g,o,j);else{let n;n=e?"string"==typeof t?t:t[e]:j;const r=k?void 0:l.getLocalePrefix(m,f.localePrefix),s=i.formatTemplatePathname(g,n,o);q=v(i.formatPathname(s,r,a.nextUrl.search))}}}if(!q)if("/"!==C||U){const e=i.formatPathname(C,i.getLocaleAsPrefix(m),a.nextUrl.search);if(U){const t=i.formatPathname(g,L.prefix,a.nextUrl.search);if("never"===f.localePrefix.mode)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(L.exact)if(u&&k)q=v(i.formatPathname(g,void 0,a.nextUrl.search));else if(f.domains){const a=i.getBestMatchingDomain(h,L.locale,x);q=(null==h?void 0:h.domain)===(null==a?void 0:a.domain)||P?p(e):v(t,null==a?void 0:a.domain)}else q=p(e);else q=v(t)}else q=k?p(e):v(i.formatPathname(g,l.getLocalePrefix(m,f.localePrefix),a.nextUrl.search))}else q=k?p(i.formatPathname(C,i.getLocaleAsPrefix(m),a.nextUrl.search)):v(i.formatPathname(g,l.getLocalePrefix(m,f.localePrefix),a.nextUrl.search));return f.localeDetection&&f.localeCookie&&r.default(a,q,m,f.localeCookie),"never"!==f.localePrefix.mode&&f.alternateLinks&&f.locales.length>1&&q.headers.set("Link",o.default({routing:f,localizedPathnames:null!=j&&D?D[j]:void 0,request:a,resolvedLocale:m})),q}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),o=require("negotiator"),l=require("./utils.js");function t(e){return e&&e.__esModule?e:{default:e}}var a=t(o);function n(o,l,t){let n;const c=new a.default({headers:{"accept-language":o.get("accept-language")||void 0}}).languages();try{const o=function(e){return e.slice().sort(((e,o)=>o.length-e.length))}(l);n=e.match(c,o,t)}catch(e){}return n}function c(e,o){if(e.localeCookie&&o.has(e.localeCookie.name)){var l;const t=null===(l=o.get(e.localeCookie.name))||void 0===l?void 0:l.value;if(t&&e.locales.includes(t))return t}}function i(e,o,t,a){let i;var r;a&&(i=null===(r=l.getPathnameMatch(a,e.locales,e.localePrefix))||void 0===r?void 0:r.locale);return!i&&e.localeDetection&&(i=c(e,t)),!i&&e.localeDetection&&(i=n(o,e.locales,e.defaultLocale)),i||(i=e.defaultLocale),i}function r(e,o,t,a){const r=function(e,o){const t=l.getHost(e);if(t)return o.find((e=>e.domain===t))}(o,e.domains);if(!r)return{locale:i(e,o,t,a)};let u;if(a){var s;const o=null===(s=l.getPathnameMatch(a,e.locales,e.localePrefix))||void 0===s?void 0:s.locale;if(o){if(!l.isLocaleSupportedOnDomain(o,r))return{locale:o,domain:r};u=o}}if(!u&&e.localeDetection){const o=c(e,t);o&&l.isLocaleSupportedOnDomain(o,r)&&(u=o)}if(!u&&e.localeDetection){const l=n(o,r.locales||e.locales,r.defaultLocale);l&&(u=l)}return u||(u=r.defaultLocale),{locale:u,domain:r}}exports.default=function(e,o,l,t){return e.domains?r(e,o,l,t):{locale:i(e,o,l,t)}},exports.getAcceptLanguageLocale=n;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(e,t,o,s){var a;const{name:i,...l}=s;(null===(a=e.cookies.get(i))||void 0===a?void 0:a.value)!==o&&t.cookies.set(i,o,{path:e.nextUrl.basePath||void 0,...l})};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js");function t(t,n){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const o=t.map((t=>[t,e.getLocalePrefix(t,n)]));return r&&o.sort(((e,t)=>t[1].length-e[1].length)),o}function n(t,n){const r=e.normalizeTrailingSlash(n),o=e.normalizeTrailingSlash(t),a=e.templateToRegex(o).exec(r);if(!a)return;const l={};for(let e=1;e<a.length;e++){var i;const t=null===(i=o.match(/\[([^\]]+)\]/g))||void 0===i?void 0:i[e-1].replace(/[[\]]/g,"");t&&(l[t]=a[e])}return l}function r(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((e=>{let[t,r]=e;n=n.replace("[".concat(t,"]"),r)})),n}function o(e,t){return t.defaultLocale===e||!t.locales||t.locales.includes(e)}exports.applyBasePath=function(t,n){return e.normalizeTrailingSlash(n+t)},exports.formatPathname=function(t,n,r){let o=t;return n&&(o=e.prefixPathname(n,o)),r&&(o+=r),o},exports.formatPathnameTemplate=r,exports.formatTemplatePathname=function(t,o,a,l){let i="";return i+=r(a,n(o,t)),i=e.normalizeTrailingSlash(i),i},exports.getBestMatchingDomain=function(e,t,n){let r;return e&&o(t,e)&&(r=e),r||(r=n.find((e=>e.defaultLocale===t))),r||(r=n.find((e=>{var n;return null===(n=e.locales)||void 0===n?void 0:n.includes(t)}))),r||null!=(null==e?void 0:e.locales)||(r=e),r||(r=n.find((e=>!e.locales))),r},exports.getHost=function(e){var t,n;return null!==(t=null!==(n=e.get("x-forwarded-host"))&&void 0!==n?n:e.get("host"))&&void 0!==t?t:void 0},exports.getInternalTemplate=function(t,n,r){const o=e.getSortedPathnames(Object.keys(t));for(const a of o){const o=t[a];if("string"==typeof o){const t=o;if(e.matchesPathname(t,n))return[void 0,a]}else{const t=Object.entries(o),l=t.findIndex((e=>{let[t]=e;return t===r}));l>0&&t.unshift(t.splice(l,1)[0]);for(const[r,o]of t)if(e.matchesPathname(o,n))return[r,a]}}for(const r of Object.keys(t))if(e.matchesPathname(r,n))return[void 0,r];return[void 0,void 0]},exports.getLocaleAsPrefix=function(e){return"/".concat(e)},exports.getLocalePrefixes=t,exports.getNormalizedPathname=function(n,r,o){n.endsWith("/")||(n+="/");const a=t(r,o),l=new RegExp("^(".concat(a.map((e=>{let[,t]=e;return t.replaceAll("/","\\/")})).join("|"),")/(.*)"),"i"),i=n.match(l);let s=i?"/"+i[2]:n;return"/"!==s&&(s=e.normalizeTrailingSlash(s)),s},exports.getPathnameMatch=function(e,n,r){const o=t(n,r);for(const[t,n]of o){let r,o;if(e===n||e.startsWith(n+"/"))r=o=!0;else{const t=e.toLowerCase(),a=n.toLowerCase();(t===a||t.startsWith(a+"/"))&&(r=!1,o=!0)}if(o)return{locale:t,prefix:n,matchedPrefix:e.slice(0,n.length),exact:r}}},exports.getRouteParams=n,exports.isLocaleSupportedOnDomain=o,exports.sanitizePathname=function(e){return e.replace(/\\/g,"%5C").replace(/\/+/g,"/")};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./middleware/middleware.js");exports.default=e.default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),l=require("../../react-client/useLocale.js"),t=require("../../shared/utils.js"),a=require("../shared/LegacyBaseLink.js");function u(e){return e&&e.__esModule?e:{default:e}}var i=u(r);function s(r,u){let{locale:s,localePrefix:o,...c}=r;const n=l.default(),d=s||n,f=t.getLocalePrefix(d,o);return i.default.createElement(a.default,e.extends({ref:u,locale:d,localePrefixMode:o.mode,prefix:f},c))}const o=r.forwardRef(s);o.displayName="ClientLink",exports.default=o;
|