next-intl 3.21.1 → 3.21.2-canary.0
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/dist/development/middleware/middleware.js +19 -17
- package/dist/development/middleware/resolveLocale.js +20 -34
- package/dist/development/middleware/syncCookie.js +8 -7
- package/dist/development/navigation/react-client/ClientLink.js +2 -2
- package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +6 -1
- package/dist/development/navigation/react-client/createNavigation.js +83 -0
- package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +6 -1
- package/dist/development/navigation/react-client/useBasePathname.js +0 -14
- package/dist/development/navigation/react-client/useBaseRouter.js +3 -3
- package/dist/development/navigation/react-server/ServerLink.js +4 -2
- package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +5 -4
- package/dist/development/navigation/react-server/createNavigation.js +30 -0
- package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +2 -0
- package/dist/development/navigation/react-server/redirects.js +2 -2
- package/dist/development/navigation/shared/BaseLink.js +30 -26
- package/dist/development/navigation/shared/LegacyBaseLink.js +57 -0
- package/dist/development/navigation/shared/createSharedNavigationFns.js +148 -0
- package/dist/development/navigation/shared/redirects.js +3 -0
- package/dist/development/navigation/shared/syncLocaleCookie.js +26 -5
- package/dist/development/navigation/shared/utils.js +40 -1
- package/dist/development/navigation.react-client.js +2 -0
- package/dist/development/navigation.react-server.js +2 -0
- package/dist/development/react-client/index.js +0 -2
- package/dist/development/routing/config.js +18 -1
- package/dist/development/server/react-server/RequestLocale.js +15 -25
- package/dist/development/server/react-server/RequestLocaleCache.js +23 -0
- package/dist/development/server/react-server/RequestLocaleLegacy.js +43 -0
- package/dist/development/server/react-server/getConfig.js +15 -17
- package/dist/development/server/react-server/getRequestConfig.js +1 -1
- package/dist/development/server.react-server.js +2 -2
- package/dist/development/shared/constants.js +0 -9
- package/dist/esm/middleware/middleware.js +1 -1
- package/dist/esm/middleware/resolveLocale.js +1 -1
- package/dist/esm/middleware/syncCookie.js +1 -1
- package/dist/esm/navigation/react-client/ClientLink.js +1 -1
- package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-client/createNavigation.js +1 -0
- package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-client/useBasePathname.js +0 -1
- package/dist/esm/navigation/react-client/useBaseRouter.js +1 -1
- package/dist/esm/navigation/react-server/ServerLink.js +1 -1
- package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-server/createNavigation.js +1 -0
- package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
- package/dist/esm/navigation/react-server/redirects.js +1 -1
- package/dist/esm/navigation/shared/BaseLink.js +1 -1
- package/dist/esm/navigation/shared/LegacyBaseLink.js +2 -0
- package/dist/esm/navigation/shared/createSharedNavigationFns.js +1 -0
- package/dist/esm/navigation/shared/syncLocaleCookie.js +1 -1
- package/dist/esm/navigation/shared/utils.js +1 -1
- package/dist/esm/navigation.react-client.js +1 -1
- package/dist/esm/navigation.react-server.js +1 -1
- package/dist/esm/routing/config.js +1 -1
- package/dist/esm/server/react-server/RequestLocale.js +1 -1
- package/dist/esm/server/react-server/RequestLocaleCache.js +1 -0
- package/dist/esm/server/react-server/RequestLocaleLegacy.js +1 -0
- package/dist/esm/server/react-server/getConfig.js +1 -1
- package/dist/esm/server.react-server.js +1 -1
- package/dist/esm/shared/constants.js +1 -1
- package/dist/production/middleware/middleware.js +1 -1
- package/dist/production/middleware/resolveLocale.js +1 -1
- package/dist/production/middleware/syncCookie.js +1 -1
- package/dist/production/navigation/react-client/ClientLink.js +1 -1
- package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-client/createNavigation.js +1 -0
- package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-client/useBasePathname.js +0 -1
- package/dist/production/navigation/react-client/useBaseRouter.js +1 -1
- package/dist/production/navigation/react-server/ServerLink.js +1 -1
- package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-server/createNavigation.js +1 -0
- package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
- package/dist/production/navigation/react-server/redirects.js +1 -1
- package/dist/production/navigation/shared/BaseLink.js +1 -1
- package/dist/production/navigation/shared/LegacyBaseLink.js +2 -0
- package/dist/production/navigation/shared/createSharedNavigationFns.js +1 -0
- package/dist/production/navigation/shared/syncLocaleCookie.js +1 -1
- package/dist/production/navigation/shared/utils.js +1 -1
- package/dist/production/navigation.react-client.js +1 -1
- package/dist/production/navigation.react-server.js +1 -1
- package/dist/production/routing/config.js +1 -1
- package/dist/production/server/react-server/RequestLocale.js +1 -1
- package/dist/production/server/react-server/RequestLocaleCache.js +1 -0
- package/dist/production/server/react-server/RequestLocaleLegacy.js +1 -0
- package/dist/production/server/react-server/getConfig.js +1 -1
- package/dist/production/server.react-server.js +1 -1
- package/dist/production/shared/constants.js +1 -1
- package/dist/types/src/middleware/getAlternateLinksHeaderValue.d.ts +3 -3
- package/dist/types/src/middleware/middleware.d.ts +11 -3
- package/dist/types/src/middleware/resolveLocale.d.ts +2 -3
- package/dist/types/src/middleware/syncCookie.d.ts +2 -1
- package/dist/types/src/middleware/utils.d.ts +4 -4
- package/dist/types/src/navigation/createNavigation.test.d.ts +1 -0
- package/dist/types/src/navigation/react-client/ClientLink.d.ts +6 -6
- package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +17 -5
- package/dist/types/src/navigation/react-client/createNavigation.d.ts +467 -0
- package/dist/types/src/navigation/react-client/createNavigation.test.d.ts +1 -0
- package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +9 -5
- package/dist/types/src/navigation/react-client/index.d.ts +1 -0
- package/dist/types/src/navigation/react-client/redirects.d.ts +4 -4
- package/dist/types/src/navigation/react-client/useBasePathname.d.ts +2 -15
- package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +3 -2
- package/dist/types/src/navigation/react-server/ServerLink.d.ts +5 -5
- package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +14 -5
- package/dist/types/src/navigation/react-server/createNavigation.d.ts +385 -0
- package/dist/types/src/navigation/react-server/createNavigation.test.d.ts +1 -0
- package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +3 -3
- package/dist/types/src/navigation/react-server/index.d.ts +1 -0
- package/dist/types/src/navigation/react-server/redirects.d.ts +4 -4
- package/dist/types/src/navigation/shared/BaseLink.d.ts +13 -6
- package/dist/types/src/navigation/shared/LegacyBaseLink.d.ts +12 -0
- package/dist/types/src/navigation/shared/createSharedNavigationFns.d.ts +385 -0
- package/dist/types/src/navigation/shared/redirects.d.ts +5 -5
- package/dist/types/src/navigation/shared/syncLocaleCookie.d.ts +2 -1
- package/dist/types/src/navigation/shared/utils.d.ts +10 -3
- package/dist/types/src/routing/config.d.ts +46 -11
- package/dist/types/src/routing/defineRouting.d.ts +2 -2
- package/dist/types/src/routing/types.d.ts +4 -4
- package/dist/types/src/server/react-server/RequestLocale.d.ts +1 -2
- package/dist/types/src/server/react-server/RequestLocaleCache.d.ts +2 -0
- package/dist/types/src/server/react-server/RequestLocaleLegacy.d.ts +1 -0
- package/dist/types/src/server/react-server/createRequestConfig.d.ts +2 -3
- package/dist/types/src/server/react-server/getRequestConfig.d.ts +32 -6
- package/dist/types/src/server/react-server/index.d.ts +1 -1
- package/dist/types/src/shared/constants.d.ts +0 -3
- package/dist/types/src/shared/types.d.ts +3 -0
- package/dist/types/src/shared/utils.d.ts +2 -2
- package/package.json +3 -3
- package/dist/types/src/middleware/config.d.ts +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NextResponse as e}from"next/server";import{receiveRoutingConfig as
|
|
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 r,getLocalePrefix as a}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 u,formatTemplatePathname as h,formatPathname as x,getBestMatchingDomain as v,applyBasePath as p,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 r=new URL(t,o.url);o.nextUrl.basePath&&(r.pathname=p(r.pathname,o.nextUrl.basePath));const a=new Headers(o.headers);return a.set(l,j),e.rewrite(r,{request:{headers:a}})}function R(l,t){const a=new URL(r(l),o.url);if(b.length>0&&!t&&g){const e=v(g,j,b);e&&(t=e.domain,e.defaultLocale===j&&"as-needed"===w.localePrefix.mode&&(a.pathname=f(a.pathname,w.locales,w.localePrefix)))}var n,i;t&&(a.host=t,o.headers.get("x-forwarded-host")&&(a.protocol=null!==(n=o.headers.get("x-forwarded-proto"))&&void 0!==n?n:o.nextUrl.protocol,a.port=null!==(i=o.headers.get("x-forwarded-port"))&&void 0!==i?i:""));return o.nextUrl.basePath&&(a.pathname=p(a.pathname,o.nextUrl.basePath)),e.redirect(a.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]=u(B,q,j),S){const l=B[S],r="string"==typeof l?l:l[j];if(t(r,q))V=h(q,r,S);else{let t;t=e?"string"==typeof l?l:l[e]:S;const n=A?void 0:a(j,w.localePrefix),i=h(q,t,r);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=v(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,a(j,w.localePrefix),o.nextUrl.search))}else I=A?D(x(V,U(j),o.nextUrl.search)):R(x(q,a(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?null==B?void 0:B[S]:void 0,request:o,resolvedLocale:j})),I}}export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{match as e}from"@formatjs/intl-localematcher";import o from"negotiator";import{
|
|
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&&t&&(i=c(e,t)),!i&&e.localeDetection&&o&&(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&&o)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&&r){const o=c(e,r);o&&t(o,f)&&(s=o)}if(!s&&e.localeDetection&&o){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 +1 @@
|
|
|
1
|
-
|
|
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 +1 @@
|
|
|
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/
|
|
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 +1 @@
|
|
|
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}from"../../routing/config.js";import{getRoute as
|
|
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 l,receiveLocaleCookie as a}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=l(d),P=a(null==d?void 0: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:l,...a}=o;const c=x(),s=l||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:l,localeCookie:P,localePrefix:v.localePrefix},a))}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,l=new Array(n>1?n-1:0),a=1;a<n;a++)l[a-1]=arguments[a];const c=w({href:o,locale:(null===(t=l[0])||void 0===t?void 0:t.locale)||r});return e.push(c,...l)},replace(o){for(var t,n=arguments.length,l=new Array(n>1?n-1:0),a=1;a<n;a++)l[a-1]=arguments[a];const c=w({href:o,locale:(null===(t=l[0])||void 0===t?void 0:t.locale)||r});return e.replace(c,...l)},prefetch(o){for(var t,n=arguments.length,l=new Array(n>1?n-1:0),a=1;a<n;a++)l[a-1]=arguments[a];const c=w({href:o,locale:(null===(t=l[0])||void 0===t?void 0:t.locale)||r});return e.prefetch(c,...l)}})),[e,r])},getPathname:w}}export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
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 +1 @@
|
|
|
1
|
-
import{extends as
|
|
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,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
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 +1 @@
|
|
|
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){const
|
|
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 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{getLocalePrefix as o}from"../../shared/utils.js";import
|
|
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 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveRoutingConfig as
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getRequestLocale as e}from"../../server/react-server/RequestLocale.js";import o from"../shared/createSharedNavigationFns.js";function t(t){const{config:n,...r}=o((function(){return e()}),t);function s(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:s("usePathname"),useRouter:s("useRouter")}}export{t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveLocalePrefixConfig as
|
|
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 +1 @@
|
|
|
1
|
-
import{getRequestLocale as r}from"../../server/react-server/
|
|
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 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import o from"next/link";import{usePathname as
|
|
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 i,useEffect as l}from"react";import c from"../../react-client/useLocale.js";import a from"./syncLocaleCookie.js";function s(n,s){let{defaultLocale:p,href:f,locale:m,localeCookie:u,onClick:h,prefetch:d,unprefixed:k,...x}=n;const L=c(),g=m!==L,j=m||L,v=function(){const[e,o]=i();return l((()=>{o(window.location.host)}),[]),e}(),w=v&&k&&(k.domains[v]===j||!Object.keys(k.domains).includes(v)&&L===p&&!m)?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?m:void 0,onClick:function(e){a(u,C,L,m),h&&h(e)},prefetch:d},x))}var p=n(s);export{p as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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},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 +1 @@
|
|
|
1
|
-
import{
|
|
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 +1 @@
|
|
|
1
|
-
import{getSortedPathnames as
|
|
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 +1 @@
|
|
|
1
|
-
export{default as createSharedPathnamesNavigation}from"./navigation/react-client/createSharedPathnamesNavigation.js";export{default as createLocalizedPathnamesNavigation}from"./navigation/react-client/createLocalizedPathnamesNavigation.js";
|
|
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 +1 @@
|
|
|
1
|
-
export{default as createSharedPathnamesNavigation}from"./navigation/react-server/createSharedPathnamesNavigation.js";export{default as createLocalizedPathnamesNavigation}from"./navigation/react-server/createLocalizedPathnamesNavigation.js";
|
|
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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){return{...e,localePrefix:o(e.localePrefix)}}function o(e){return"object"==typeof e?e:{mode:e||"always"}}export{o as receiveLocalePrefixConfig,e as receiveRoutingConfig};
|
|
1
|
+
function e(e){var n,t;return{...e,localePrefix:o(null==e?void 0:e.localePrefix),localeCookie:l(e.localeCookie),localeDetection:null===(n=e.localeDetection)||void 0===n||n,alternateLinks:null===(t=e.alternateLinks)||void 0===t||t}}function l(e){return!(null!=e&&!e)&&{name:"NEXT_LOCALE",maxAge:31536e3,sameSite:"lax",..."object"==typeof e&&e}}function o(e){return"object"==typeof e?e:{mode:e||"always"}}export{l as receiveLocaleCookie,o as receiveLocalePrefixConfig,e as receiveRoutingConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{headers as
|
|
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 s=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 `unstable_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 i(){return r()||await s()}export{i as getRequestLocale};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{cache as o}from"react";const n=o((function(){return{locale:void 0}}));function t(){return n().locale}function c(o){n().locale=o}export{t as getCachedRequestLocale,c as setCachedRequestLocale};
|
|
@@ -0,0 +1 @@
|
|
|
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 `unstable_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 +1 @@
|
|
|
1
|
-
import{
|
|
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 +1 @@
|
|
|
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{
|
|
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 unstable_setRequestLocale}from"./server/react-server/RequestLocaleCache.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const o="X-NEXT-INTL-LOCALE",L="locale";export{o as HEADER_LOCALE_NAME,L as LOCALE_SEGMENT_NAME};
|
|
@@ -1 +1 @@
|
|
|
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"),
|
|
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,f,h;const m=a.receiveRoutingConfig({...s,alternateLinks:null!==(d=null==c?void 0:c.alternateLinks)&&void 0!==d?d:s.alternateLinks,localeDetection:null!==(f=null==c?void 0:c.localeDetection)&&void 0!==f?f:s.localeDetection,localeCookie:null!==(h=null==c?void 0:c.localeCookie)&&void 0!==h?h: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:f,locale:h}=n.default(m,a.headers,a.cookies,d),u=f?f.defaultLocale===h:h===m.defaultLocale,x=(null===(s=m.domains)||void 0===s?void 0:s.filter((e=>i.isLocaleSupportedOnDomain(h,e))))||[],P=null!=m.domains&&!f;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,h),e.NextResponse.rewrite(o,{request:{headers:n}})}function v(t,o){const n=new URL(l.normalizeTrailingSlash(t),a.url);if(x.length>0&&!o&&f){const e=i.getBestMatchingDomain(f,h,x);e&&(o=e.domain,e.defaultLocale===h&&"as-needed"===m.localePrefix.mode&&(n.pathname=i.getNormalizedPathname(n.pathname,m.locales,m.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,m.locales,m.localePrefix),L=i.getPathnameMatch(d,m.locales,m.localePrefix),U=null!=L,k="never"===m.localePrefix.mode||u&&"as-needed"===m.localePrefix.mode;let q,j,C=g;const D=m.pathnames;if(D){let e;if([e,j]=i.getInternalTemplate(D,g,h),j){const t=D[j],o="string"==typeof t?t:t[h];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(h,m.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(h),a.nextUrl.search);if(U){const t=i.formatPathname(g,L.prefix,a.nextUrl.search);if("never"===m.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(m.domains){const a=i.getBestMatchingDomain(f,L.locale,x);q=(null==f?void 0:f.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(h,m.localePrefix),a.nextUrl.search))}else q=k?p(i.formatPathname(C,i.getLocaleAsPrefix(h),a.nextUrl.search)):v(i.formatPathname(g,l.getLocalePrefix(h,m.localePrefix),a.nextUrl.search));return m.localeDetection&&m.localeCookie&&r.default(a,q,h,m.localeCookie),"never"!==m.localePrefix.mode&&m.alternateLinks&&m.locales.length>1&&q.headers.set("Link",o.default({routing:m,localizedPathnames:null!=j&&D?null==D?void 0:D[j]:void 0,request:a,resolvedLocale:h})),q}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),
|
|
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&&t&&(i=c(e,t)),!i&&e.localeDetection&&o&&(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&&o)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&&t){const o=c(e,t);o&&l.isLocaleSupportedOnDomain(o,r)&&(u=o)}if(!u&&e.localeDetection&&o){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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!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 +1 @@
|
|
|
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/
|
|
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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),a=require("../../react-client/useLocale.js"),l=require("../../routing/config.js"),t=require("../shared/utils.js"),o=require("./ClientLink.js"),n=require("./redirects.js"),c=require("./useBasePathname.js"),i=require("./useBaseRouter.js");function u(e){return e&&e.__esModule?e:{default:e}}var s=u(r);exports.default=function(u){const f=l.receiveRoutingConfig(u),h=l.receiveLocaleCookie(null==u?void 0:u.localeCookie);function d(){const e=a.default();if(!f.locales.includes(e))throw new Error(void 0);return e}function m(r,a){let{href:l,locale:n,...c}=r;const i=d(),u=n||i;return s.default.createElement(o.default,e.extends({ref:a,href:t.compileLocalizedPathname({locale:u,pathname:l,params:"object"==typeof l?l.params:void 0,pathnames:f.pathnames}),locale:n,localeCookie:h,localePrefix:f.localePrefix},c))}const p=r.forwardRef(m);function v(e){let{href:r,locale:a}=e;return t.compileLocalizedPathname({...t.normalizeNameOrNameWithParams(r),locale:a,pathnames:f.pathnames})}return p.displayName="Link",{Link:p,redirect:function(e){const r=v({href:e,locale:d()});for(var a=arguments.length,l=new Array(a>1?a-1:0),t=1;t<a;t++)l[t-1]=arguments[t];return n.clientRedirect({pathname:r,localePrefix:f.localePrefix},...l)},permanentRedirect:function(e){const r=v({href:e,locale:d()});for(var a=arguments.length,l=new Array(a>1?a-1:0),t=1;t<a;t++)l[t-1]=arguments[t];return n.clientPermanentRedirect({pathname:r,localePrefix:f.localePrefix},...l)},usePathname:function(){const e=c.default(f.localePrefix),a=d();return r.useMemo((()=>e?t.getRoute(a,e,f.pathnames):e),[a,e])},useRouter:function(){const e=i.default(f.localePrefix,h),a=d();return r.useMemo((()=>({...e,push(r){for(var l,t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(l=o[0])||void 0===l?void 0:l.locale)||a});return e.push(c,...o)},replace(r){for(var l,t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(l=o[0])||void 0===l?void 0:l.locale)||a});return e.replace(c,...o)},prefetch(r){for(var l,t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];const c=v({href:r,locale:(null===(l=o[0])||void 0===l?void 0:l.locale)||a});return e.prefetch(c,...o)}})),[e,a])},getPathname:v}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),n=require("../shared/createSharedNavigationFns.js"),a=require("../shared/syncLocaleCookie.js"),u=require("../shared/utils.js"),o=require("./useBasePathname.js");exports.default=function(s){function c(){return r.default()}const{Link:i,config:l,getPathname:h,...f}=n.default(c,s);return{...f,Link:i,usePathname:function(){const e=o.default(l.localePrefix),r=c();return t.useMemo((()=>e&&l.pathnames?u.getRoute(r,e,l.pathnames):e),[r,e])},useRouter:function(){const r=e.useRouter(),n=c(),u=e.usePathname();return t.useMemo((()=>{function e(e){return function(t,r){const{locale:o,...s}=r||{},c=[h({href:t,locale:o||n,domain:window.location.host})];Object.keys(s).length>0&&c.push(s),e(...c),a.default(l.localeCookie,u,n,o)}}return{...r,push:e(r.push),replace:e(r.replace),prefetch:e(r.prefetch)}}),[n,u,r])},getPathname:h}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ClientLink.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ClientLink.js"),i=require("./redirects.js"),u=require("./useBasePathname.js"),a=require("./useBaseRouter.js");function l(e){return e&&e.__esModule?e:{default:e}}var o=l(r);exports.default=function(l){const c=t.receiveLocalePrefixConfig(null==l?void 0:l.localePrefix),f=t.receiveLocaleCookie(null==l?void 0:l.localeCookie);function s(r,t){return o.default.createElement(n.default,e.extends({ref:t,localeCookie:f,localePrefix:c},r))}const d=r.forwardRef(s);return d.displayName="Link",{Link:d,redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return i.clientRedirect({pathname:e,localePrefix:c},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return i.clientPermanentRedirect({pathname:e,localePrefix:c},...t)},usePathname:function(){return u.default(c)},useRouter:function(){return a.default(c,f)}}};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),r=require("react"),t=require("../../react-client/useLocale.js"),a=require("../../shared/utils.js");exports.default=function(u){const n=e.usePathname(),i=t.default();return r.useMemo((()=>{if(!n)return n;const e=a.getLocalePrefix(i,u);return a.hasPathnamePrefixed(e,n)?a.unprefixPathname(n,e):n}),[i,u,n])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),u=require("../../shared/utils.js"),n=require("../shared/syncLocaleCookie.js"),s=require("../shared/utils.js");exports.default=function(a){const
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),r=require("../../react-client/useLocale.js"),u=require("../../shared/utils.js"),n=require("../shared/syncLocaleCookie.js"),s=require("../shared/utils.js");exports.default=function(a,c){const o=e.useRouter(),i=r.default(),l=e.usePathname();return t.useMemo((()=>{function e(e,t){let r=window.location.pathname;const n=s.getBasePath(l);n&&(r=r.replace(n,""));const c=t||i,o=u.getLocalePrefix(c,a);return u.localizeHref(e,c,i,r,o)}function t(t){return function(r,u){const{locale:s,...a}=u||{};n.default(c,l,i,s);const o=[e(r,s)];return Object.keys(a).length>0&&o.push(a),t(...o)}}return{...o,push:t(o.push),replace:t(o.replace),prefetch:t(o.prefetch)}}),[i,c,a,l,o])};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),l=require("../../shared/utils.js"),t=require("../shared/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),l=require("../../shared/utils.js"),t=require("../shared/LegacyBaseLink.js"),a=require("../../server/react-server/getLocale.js");function u(e){return e&&e.__esModule?e:{default:e}}var s=u(r);exports.default=async function(r){let{locale:u,localePrefix:i,...o}=r;const c=u||await a.default(),d=l.getLocalePrefix(c,i);return s.default.createElement(t.default,e.extends({locale:c,localePrefixMode:i.mode,prefix:d},o))};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),a=require("../../server/react-server/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),a=require("../../server/react-server/RequestLocaleLegacy.js"),o=require("../shared/utils.js"),n=require("./ServerLink.js"),l=require("./redirects.js");function c(e){return e&&e.__esModule?e:{default:e}}var i=c(r);exports.default=function(r){const c=t.receiveRoutingConfig(r);function u(e){let{href:r,locale:t}=e;return o.compileLocalizedPathname({...o.normalizeNameOrNameWithParams(r),locale:t,pathnames:c.pathnames})}function s(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(r){let{href:t,locale:l,...u}=r;const s=a.getRequestLocale(),f=l||s;return i.default.createElement(n.default,e.extends({href:o.compileLocalizedPathname({locale:f,pathname:t,params:"object"==typeof t?t.params:void 0,pathnames:c.pathnames}),locale:l,localeCookie:c.localeCookie,localePrefix:c.localePrefix},u))},redirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return l.serverRedirect({localePrefix:c.localePrefix,pathname:r},...o)},permanentRedirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return l.serverPermanentRedirect({localePrefix:c.localePrefix,pathname:r},...o)},getPathname:u,usePathname:s("usePathname"),useRouter:s("useRouter")}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../server/react-server/RequestLocale.js"),t=require("../shared/createSharedNavigationFns.js");exports.default=function(r){const{config:o,...n}=t.default((function(){return e.getRequestLocale()}),r);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{...n,usePathname:u("usePathname"),useRouter:u("useRouter")}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ServerLink.js"),o=require("./redirects.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../routing/config.js"),n=require("./ServerLink.js"),o=require("./redirects.js");function i(e){return e&&e.__esModule?e:{default:e}}var u=i(r);exports.default=function(r){const i=t.receiveLocalePrefixConfig(null==r?void 0:r.localePrefix),a=t.receiveLocaleCookie(null==r?void 0:r.localeCookie);function l(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(r){return u.default.createElement(n.default,e.extends({localeCookie:a,localePrefix:i},r))},redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverRedirect({pathname:e,localePrefix:i},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return o.serverPermanentRedirect({pathname:e,localePrefix:i},...t)},usePathname:l("usePathname"),useRouter:l("useRouter")}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../server/react-server/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../server/react-server/RequestLocaleLegacy.js"),r=require("../shared/redirects.js");function t(r){return function(t){const s=e.getRequestLocale();for(var c=arguments.length,n=new Array(c>1?c-1:0),a=1;a<c;a++)n[a-1]=arguments[a];return r({...t,locale:s},...n)}}const s=t(r.baseRedirect),c=t(r.basePermanentRedirect);exports.serverPermanentRedirect=c,exports.serverRedirect=s;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),t=require("next/link"),r=require("next/navigation"),n=require("react"),a=require("../../react-client/useLocale.js"),u=require("./syncLocaleCookie.js");function o(e){return e&&e.__esModule?e:{default:e}}var l=o(t),i=o(n);function c(t,o){let{defaultLocale:c,href:f,locale:s,localeCookie:d,onClick:p,prefetch:h,unprefixed:v,...k}=t;const q=a.default(),x=s!==q,_=s||q,j=function(){const[e,t]=n.useState();return n.useEffect((()=>{t(window.location.host)}),[]),e}(),m=j&&v&&(v.domains[j]===_||!Object.keys(v.domains).includes(j)&&q===c&&!s)?v.pathname:f,C=r.usePathname();return x&&(h=!1),i.default.createElement(l.default,e.extends({ref:o,href:m,hrefLang:x?s:void 0,onClick:function(e){u.default(d,C,q,s),p&&p(e)},prefetch:h},k))}var f=n.forwardRef(c);exports.default=f;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("next/navigation"),l=require("react"),t=require("../../react-client/useLocale.js"),a=require("../../shared/utils.js"),i=require("./BaseLink.js");function u(e){return e&&e.__esModule?e:{default:e}}var o=u(l);function s(u,s){let{href:f,locale:n,localeCookie:c,localePrefixMode:d,prefix:p,...x}=u;const q=r.usePathname(),v=t.default(),_=n!==v,[j,h]=l.useState((()=>a.isLocalizableHref(f)&&("never"!==d||_)?a.prefixHref(f,p):f));return l.useEffect((()=>{q&&h(a.localizeHref(f,n,v,q,p))}),[v,f,n,q,p]),o.default.createElement(i.default,e.extends({ref:s,href:j,locale:n,localeCookie:c},x))}const f=l.forwardRef(s);f.displayName="ClientLink",exports.default=f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),a=require("next/navigation"),r=require("react"),t=require("../../routing/config.js"),n=require("../../shared/utils.js"),o=require("./BaseLink.js"),i=require("./utils.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=function(l,c){const s=t.receiveRoutingConfig(c||{}),f=s.pathnames,d="as-needed"===s.localePrefix.mode&&s.domains||void 0;function m(a,t){let i,c,{href:m,locale:p,...v}=a;"object"==typeof m?(i=m.pathname,c=m.params):i=m;const P=n.isLocalizableHref(m),g=l(),j=g instanceof Promise?r.use(g):g,q=P?h({locale:p||j,href:null==f?i:{pathname:i,params:c}},null!=p||d||void 0):i;return u.default.createElement(o.default,e.extends({ref:t,defaultLocale:s.defaultLocale,href:{..."object"==typeof m&&m,pathname:q},locale:p,localeCookie:s.localeCookie,unprefixed:d&&P?{domains:s.domains.reduce(((e,a)=>(e[a.domain]=a.defaultLocale,e)),{}),pathname:h({locale:j,href:null==f?i:{pathname:i,params:c}},!1)}:void 0},v))}const p=r.forwardRef(m);function h(e,a){const{href:r,locale:t}=e;let n;return null==f?"object"==typeof r?(n=r.pathname,r.query&&(n+=i.serializeSearchParams(r.query))):n=r:n=i.compileLocalizedPathname({locale:t,...i.normalizeNameOrNameWithParams(r),pathnames:s.pathnames}),i.applyPathnamePrefix(n,t,s,e.domain,a)}function v(e){return function(a){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];return e(h(a,a.domain?void 0:d),...t)}}const P=v(a.redirect),g=v(a.permanentRedirect);return{config:s,Link:p,redirect:P,permanentRedirect:g,getPathname:h}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils.js");exports.default=function(t,o,a,c){if(!t||!(c!==a&&null!=c)||!o)return;const n=e.getBasePath(o),r=""!==n?n:"/",{name:s,...u}=t;u.path||(u.path=r);let i="".concat(s,"=").concat(c,";");for(const[e,t]of Object.entries(u)){i+="".concat("maxAge"===e?"max-age":e),"boolean"!=typeof t&&(i+="="+t),i+=";"}document.cookie=i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../shared/utils.js");function t(e){function t(e){return String(e)}const r=new URLSearchParams;for(const[n
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../shared/utils.js");function t(e){function t(e){return String(e)}const r=new URLSearchParams;for(const[a,n]of Object.entries(e))Array.isArray(n)?n.forEach((e=>{r.append(a,t(e))})):r.set(a,t(n));return"?"+r.toString()}exports.applyPathnamePrefix=function(t,r,a,n,o){const{mode:i}=a.localePrefix;let s;if(void 0!==o)s=o;else if(e.isLocalizableHref(t))if("always"===i)s=!0;else if("as-needed"===i){let e=a.defaultLocale;if(a.domains){const t=a.domains.find((e=>e.domain===n));t&&(e=t.defaultLocale)}s=e!==r}return s?e.prefixPathname(e.getLocalePrefix(r,a.localePrefix),t):t},exports.compileLocalizedPathname=function(r){let{pathname:a,locale:n,params:o,pathnames:i,query:s}=r;function c(e){let t=i[e];return t||(t=e),t}function l(r){let a="string"==typeof r?r:r[n];return o&&Object.entries(o).forEach((e=>{let t,r,[n,o]=e;Array.isArray(o)?(t="(\\[)?\\[...".concat(n,"\\](\\])?"),r=o.map((e=>String(e))).join("/")):(t="\\[".concat(n,"\\]"),r=String(o)),a=a.replace(new RegExp(t,"g"),r)})),a=a.replace(/\[\[\.\.\..+\]\]/g,""),a=e.normalizeTrailingSlash(a),s&&(a+=t(s)),a}if("string"==typeof a){return l(c(a))}{const{pathname:e,...t}=a;return{...t,pathname:l(c(e))}}},exports.getBasePath=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.pathname;return"/"===e?t:t.replace(e,"")},exports.getRoute=function(t,r,a){const n=e.getSortedPathnames(Object.keys(a)),o=decodeURI(r);for(const r of n){const n=a[r];if("string"==typeof n){const t=n;if(e.matchesPathname(t,o))return r}else if(e.matchesPathname(n[t],o))return r}return r},exports.normalizeNameOrNameWithParams=function(e){return"string"==typeof e?{pathname:e}:e},exports.serializeSearchParams=t;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./navigation/react-client/createSharedPathnamesNavigation.js"),a=require("./navigation/react-client/createLocalizedPathnamesNavigation.js");exports.createSharedPathnamesNavigation=e.default,exports.createLocalizedPathnamesNavigation=a.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./navigation/react-client/createSharedPathnamesNavigation.js"),a=require("./navigation/react-client/createLocalizedPathnamesNavigation.js"),t=require("./navigation/react-client/createNavigation.js");exports.createSharedPathnamesNavigation=e.default,exports.createLocalizedPathnamesNavigation=a.default,exports.createNavigation=t.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./navigation/react-server/createSharedPathnamesNavigation.js"),a=require("./navigation/react-server/createLocalizedPathnamesNavigation.js");exports.createSharedPathnamesNavigation=e.default,exports.createLocalizedPathnamesNavigation=a.default;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./navigation/react-server/createSharedPathnamesNavigation.js"),a=require("./navigation/react-server/createLocalizedPathnamesNavigation.js"),t=require("./navigation/react-server/createNavigation.js");exports.createSharedPathnamesNavigation=e.default,exports.createLocalizedPathnamesNavigation=a.default,exports.createNavigation=t.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return"object"==typeof e?e:{mode:e||"always"}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.
|
|
1
|
+
"use strict";function e(e){return!(null!=e&&!e)&&{name:"NEXT_LOCALE",maxAge:31536e3,sameSite:"lax",..."object"==typeof e&&e}}function o(e){return"object"==typeof e?e:{mode:e||"always"}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.receiveLocaleCookie=e,exports.receiveLocalePrefixConfig=o,exports.receiveRoutingConfig=function(l){var t,i;return{...l,localePrefix:o(null==l?void 0:l.localePrefix),localeCookie:e(l.localeCookie),localeDetection:null===(t=l.localeDetection)||void 0===t||t,alternateLinks:null===(i=l.alternateLinks)||void 0===i||i}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("react"),n=require("../../shared/constants.js"),r=require("./RequestLocaleCache.js");const s=t.cache((async function(){const t=e.headers();return t instanceof Promise?await t:t}));const a=t.cache((async function(){let e;try{e=(await s()).get(n.HEADER_LOCALE_NAME)||void 0}catch(e){if(e instanceof Error&&"DYNAMIC_SERVER_USAGE"===e.digest){const t=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 `unstable_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});throw t.digest=e.digest,t}throw e}return e}));exports.getRequestLocale=async function(){return r.getCachedRequestLocale()||await a()};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=require("react").cache((function(){return{locale:void 0}}));exports.getCachedRequestLocale=function(){return e().locale},exports.setCachedRequestLocale=function(t){e().locale=t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/headers"),t=require("next/navigation"),r=require("react"),n=require("../../shared/constants.js"),s=require("./RequestLocaleCache.js");const a=r.cache((function(){let r;try{r=e.headers().get(n.HEADER_LOCALE_NAME)}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 `unstable_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 r||t.notFound(),r}));exports.getRequestLocale=function(){return s.getCachedRequestLocale()||a()};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),t=require("react"),n=require("use-intl/core"),r=require("./RequestLocale.js"),o=require("./RequestLocaleLegacy.js");function c(e){return e&&e.__esModule?e:{default:e}}var a=c(require("next-intl/config"));const i=t.cache((function(){return new Date}));const u=t.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const s=t.cache((async function(t,n){const c={get locale(){return n||o.getRequestLocale()},get requestLocale(){return n?Promise.resolve(n):r.getRequestLocale()}};let a=t(c);a instanceof Promise&&(a=await a);const s=a.locale||await c.requestLocale;return s||e.notFound(),{...a,locale:s,now:a.now||i(),timeZone:a.timeZone||u()}})),l=t.cache(n._createIntlFormatters),f=t.cache(n._createCache);const q=t.cache((async function(e){const t=await s(a.default,e);return{...n.initializeConfig(t),_formatters:l(f())}}));exports.default=q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./server/react-server/getRequestConfig.js"),r=require("./server/react-server/getFormatter.js"),t=require("./server/react-server/getMessages.js"),s=require("./server/react-server/getNow.js"),a=require("./server/react-server/getTimeZone.js"),o=require("./server/react-server/getTranslations.js"),u=require("./server/react-server/getLocale.js"),g=require("./server/react-server/
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./server/react-server/getRequestConfig.js"),r=require("./server/react-server/getFormatter.js"),t=require("./server/react-server/getMessages.js"),s=require("./server/react-server/getNow.js"),a=require("./server/react-server/getTimeZone.js"),o=require("./server/react-server/getTranslations.js"),u=require("./server/react-server/getLocale.js"),g=require("./server/react-server/RequestLocaleCache.js");exports.getRequestConfig=e.default,exports.getFormatter=r.default,exports.getMessages=t.default,exports.getNow=s.default,exports.getTimeZone=a.default,exports.getTranslations=o.default,exports.getLocale=u.default,exports.unstable_setRequestLocale=g.setCachedRequestLocale;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.HEADER_LOCALE_NAME="X-NEXT-INTL-LOCALE",exports.LOCALE_SEGMENT_NAME="locale";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
2
|
import { ResolvedRoutingConfig } from '../routing/config';
|
|
3
|
-
import { Locales, Pathnames } from '../routing/types';
|
|
3
|
+
import { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types';
|
|
4
4
|
/**
|
|
5
5
|
* See https://developers.google.com/search/docs/specialty/international/localized-versions
|
|
6
6
|
*/
|
|
7
|
-
export default function getAlternateLinksHeaderValue<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>
|
|
8
|
-
routing: ResolvedRoutingConfig<AppLocales, AppPathnames>;
|
|
7
|
+
export default function getAlternateLinksHeaderValue<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode, AppPathnames extends Pathnames<AppLocales> | undefined, AppDomains extends DomainsConfig<AppLocales> | undefined>({ localizedPathnames, request, resolvedLocale, routing }: {
|
|
8
|
+
routing: Omit<ResolvedRoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>, 'pathnames'>;
|
|
9
9
|
request: NextRequest;
|
|
10
10
|
resolvedLocale: AppLocales[number];
|
|
11
11
|
localizedPathnames?: Pathnames<AppLocales>[string];
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { NextRequest, NextResponse } from 'next/server';
|
|
2
2
|
import { RoutingConfig } from '../routing/config';
|
|
3
|
-
import { Locales, Pathnames } from '../routing/types';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { DomainsConfig, LocalePrefixMode, Locales, Pathnames } from '../routing/types';
|
|
4
|
+
export default function createMiddleware<AppLocales extends Locales, AppLocalePrefixMode extends LocalePrefixMode = 'always', AppPathnames extends Pathnames<AppLocales> = never, AppDomains extends DomainsConfig<AppLocales> = never>(routing: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>,
|
|
5
|
+
/** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
|
|
6
|
+
options?: {
|
|
7
|
+
/** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
|
|
8
|
+
localeCookie?: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>['localeCookie'];
|
|
9
|
+
/** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
|
|
10
|
+
localeDetection?: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>['localeDetection'];
|
|
11
|
+
/** @deprecated Should be passed via the first parameter `routing` instead (ideally defined with `defineRouting`) */
|
|
12
|
+
alternateLinks?: RoutingConfig<AppLocales, AppLocalePrefixMode, AppPathnames, AppDomains>['alternateLinks'];
|
|
13
|
+
}): (request: NextRequest) => NextResponse<unknown>;
|