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.
Files changed (129) hide show
  1. package/dist/development/middleware/middleware.js +19 -17
  2. package/dist/development/middleware/resolveLocale.js +20 -34
  3. package/dist/development/middleware/syncCookie.js +8 -7
  4. package/dist/development/navigation/react-client/ClientLink.js +2 -2
  5. package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +6 -1
  6. package/dist/development/navigation/react-client/createNavigation.js +83 -0
  7. package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +6 -1
  8. package/dist/development/navigation/react-client/useBasePathname.js +0 -14
  9. package/dist/development/navigation/react-client/useBaseRouter.js +3 -3
  10. package/dist/development/navigation/react-server/ServerLink.js +4 -2
  11. package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +5 -4
  12. package/dist/development/navigation/react-server/createNavigation.js +30 -0
  13. package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +2 -0
  14. package/dist/development/navigation/react-server/redirects.js +2 -2
  15. package/dist/development/navigation/shared/BaseLink.js +30 -26
  16. package/dist/development/navigation/shared/LegacyBaseLink.js +57 -0
  17. package/dist/development/navigation/shared/createSharedNavigationFns.js +148 -0
  18. package/dist/development/navigation/shared/redirects.js +3 -0
  19. package/dist/development/navigation/shared/syncLocaleCookie.js +26 -5
  20. package/dist/development/navigation/shared/utils.js +40 -1
  21. package/dist/development/navigation.react-client.js +2 -0
  22. package/dist/development/navigation.react-server.js +2 -0
  23. package/dist/development/react-client/index.js +0 -2
  24. package/dist/development/routing/config.js +18 -1
  25. package/dist/development/server/react-server/RequestLocale.js +15 -25
  26. package/dist/development/server/react-server/RequestLocaleCache.js +23 -0
  27. package/dist/development/server/react-server/RequestLocaleLegacy.js +43 -0
  28. package/dist/development/server/react-server/getConfig.js +15 -17
  29. package/dist/development/server/react-server/getRequestConfig.js +1 -1
  30. package/dist/development/server.react-server.js +2 -2
  31. package/dist/development/shared/constants.js +0 -9
  32. package/dist/esm/middleware/middleware.js +1 -1
  33. package/dist/esm/middleware/resolveLocale.js +1 -1
  34. package/dist/esm/middleware/syncCookie.js +1 -1
  35. package/dist/esm/navigation/react-client/ClientLink.js +1 -1
  36. package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
  37. package/dist/esm/navigation/react-client/createNavigation.js +1 -0
  38. package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
  39. package/dist/esm/navigation/react-client/useBasePathname.js +0 -1
  40. package/dist/esm/navigation/react-client/useBaseRouter.js +1 -1
  41. package/dist/esm/navigation/react-server/ServerLink.js +1 -1
  42. package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
  43. package/dist/esm/navigation/react-server/createNavigation.js +1 -0
  44. package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
  45. package/dist/esm/navigation/react-server/redirects.js +1 -1
  46. package/dist/esm/navigation/shared/BaseLink.js +1 -1
  47. package/dist/esm/navigation/shared/LegacyBaseLink.js +2 -0
  48. package/dist/esm/navigation/shared/createSharedNavigationFns.js +1 -0
  49. package/dist/esm/navigation/shared/syncLocaleCookie.js +1 -1
  50. package/dist/esm/navigation/shared/utils.js +1 -1
  51. package/dist/esm/navigation.react-client.js +1 -1
  52. package/dist/esm/navigation.react-server.js +1 -1
  53. package/dist/esm/routing/config.js +1 -1
  54. package/dist/esm/server/react-server/RequestLocale.js +1 -1
  55. package/dist/esm/server/react-server/RequestLocaleCache.js +1 -0
  56. package/dist/esm/server/react-server/RequestLocaleLegacy.js +1 -0
  57. package/dist/esm/server/react-server/getConfig.js +1 -1
  58. package/dist/esm/server.react-server.js +1 -1
  59. package/dist/esm/shared/constants.js +1 -1
  60. package/dist/production/middleware/middleware.js +1 -1
  61. package/dist/production/middleware/resolveLocale.js +1 -1
  62. package/dist/production/middleware/syncCookie.js +1 -1
  63. package/dist/production/navigation/react-client/ClientLink.js +1 -1
  64. package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
  65. package/dist/production/navigation/react-client/createNavigation.js +1 -0
  66. package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
  67. package/dist/production/navigation/react-client/useBasePathname.js +0 -1
  68. package/dist/production/navigation/react-client/useBaseRouter.js +1 -1
  69. package/dist/production/navigation/react-server/ServerLink.js +1 -1
  70. package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
  71. package/dist/production/navigation/react-server/createNavigation.js +1 -0
  72. package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
  73. package/dist/production/navigation/react-server/redirects.js +1 -1
  74. package/dist/production/navigation/shared/BaseLink.js +1 -1
  75. package/dist/production/navigation/shared/LegacyBaseLink.js +2 -0
  76. package/dist/production/navigation/shared/createSharedNavigationFns.js +1 -0
  77. package/dist/production/navigation/shared/syncLocaleCookie.js +1 -1
  78. package/dist/production/navigation/shared/utils.js +1 -1
  79. package/dist/production/navigation.react-client.js +1 -1
  80. package/dist/production/navigation.react-server.js +1 -1
  81. package/dist/production/routing/config.js +1 -1
  82. package/dist/production/server/react-server/RequestLocale.js +1 -1
  83. package/dist/production/server/react-server/RequestLocaleCache.js +1 -0
  84. package/dist/production/server/react-server/RequestLocaleLegacy.js +1 -0
  85. package/dist/production/server/react-server/getConfig.js +1 -1
  86. package/dist/production/server.react-server.js +1 -1
  87. package/dist/production/shared/constants.js +1 -1
  88. package/dist/types/src/middleware/getAlternateLinksHeaderValue.d.ts +3 -3
  89. package/dist/types/src/middleware/middleware.d.ts +11 -3
  90. package/dist/types/src/middleware/resolveLocale.d.ts +2 -3
  91. package/dist/types/src/middleware/syncCookie.d.ts +2 -1
  92. package/dist/types/src/middleware/utils.d.ts +4 -4
  93. package/dist/types/src/navigation/createNavigation.test.d.ts +1 -0
  94. package/dist/types/src/navigation/react-client/ClientLink.d.ts +6 -6
  95. package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +17 -5
  96. package/dist/types/src/navigation/react-client/createNavigation.d.ts +467 -0
  97. package/dist/types/src/navigation/react-client/createNavigation.test.d.ts +1 -0
  98. package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +9 -5
  99. package/dist/types/src/navigation/react-client/index.d.ts +1 -0
  100. package/dist/types/src/navigation/react-client/redirects.d.ts +4 -4
  101. package/dist/types/src/navigation/react-client/useBasePathname.d.ts +2 -15
  102. package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +3 -2
  103. package/dist/types/src/navigation/react-server/ServerLink.d.ts +5 -5
  104. package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +14 -5
  105. package/dist/types/src/navigation/react-server/createNavigation.d.ts +385 -0
  106. package/dist/types/src/navigation/react-server/createNavigation.test.d.ts +1 -0
  107. package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +3 -3
  108. package/dist/types/src/navigation/react-server/index.d.ts +1 -0
  109. package/dist/types/src/navigation/react-server/redirects.d.ts +4 -4
  110. package/dist/types/src/navigation/shared/BaseLink.d.ts +13 -6
  111. package/dist/types/src/navigation/shared/LegacyBaseLink.d.ts +12 -0
  112. package/dist/types/src/navigation/shared/createSharedNavigationFns.d.ts +385 -0
  113. package/dist/types/src/navigation/shared/redirects.d.ts +5 -5
  114. package/dist/types/src/navigation/shared/syncLocaleCookie.d.ts +2 -1
  115. package/dist/types/src/navigation/shared/utils.d.ts +10 -3
  116. package/dist/types/src/routing/config.d.ts +46 -11
  117. package/dist/types/src/routing/defineRouting.d.ts +2 -2
  118. package/dist/types/src/routing/types.d.ts +4 -4
  119. package/dist/types/src/server/react-server/RequestLocale.d.ts +1 -2
  120. package/dist/types/src/server/react-server/RequestLocaleCache.d.ts +2 -0
  121. package/dist/types/src/server/react-server/RequestLocaleLegacy.d.ts +1 -0
  122. package/dist/types/src/server/react-server/createRequestConfig.d.ts +2 -3
  123. package/dist/types/src/server/react-server/getRequestConfig.d.ts +32 -6
  124. package/dist/types/src/server/react-server/index.d.ts +1 -1
  125. package/dist/types/src/shared/constants.d.ts +0 -3
  126. package/dist/types/src/shared/types.d.ts +3 -0
  127. package/dist/types/src/shared/utils.d.ts +2 -2
  128. package/package.json +3 -3
  129. package/dist/types/src/middleware/config.d.ts +0 -7
@@ -1 +1 @@
1
- import{NextResponse as e}from"next/server";import{receiveRoutingConfig as l}from"../routing/config.js";import{HEADER_LOCALE_NAME as o}from"../shared/constants.js";import{matchesPathname as t,normalizeTrailingSlash as a,getLocalePrefix as n}from"../shared/utils.js";import r 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 v,applyBasePath as p,getLocaleAsPrefix as U}from"./utils.js";function P(P,L){var g,k,j,w;const b=l(P),y={alternateLinks:null===(g=null!==(k=null==L?void 0:L.alternateLinks)&&void 0!==k?k:P.alternateLinks)||void 0===g||g,localeDetection:null===(j=null!==(w=null==L?void 0:L.localeDetection)&&void 0!==w?w:null==P?void 0:P.localeDetection)||void 0===j||j};return function(l){var P;let L;try{L=decodeURI(l.nextUrl.pathname)}catch(l){return e.next()}const g=c(L),{domain:k,locale:j}=i(b,y,l.headers,l.cookies,g),w=k?k.defaultLocale===j:j===b.defaultLocale,D=(null===(P=b.domains)||void 0===P?void 0:P.filter((e=>d(j,e))))||[],R=null!=b.domains&&!k;function q(t){const a=new URL(t,l.url);l.nextUrl.basePath&&(a.pathname=p(a.pathname,l.nextUrl.basePath));const n=new Headers(l.headers);return n.set(o,j),e.rewrite(a,{request:{headers:n}})}function H(o,t){const n=new URL(a(o),l.url);if(D.length>0&&!t){const e=v(k,j,D);e&&(t=e.domain,e.defaultLocale===j&&"as-needed"===b.localePrefix.mode&&(n.pathname=f(n.pathname,b.locales,b.localePrefix)))}var r,i;t&&(n.host=t,l.headers.get("x-forwarded-host")&&(n.protocol=null!==(r=l.headers.get("x-forwarded-proto"))&&void 0!==r?r:l.nextUrl.protocol,n.port=null!==(i=l.headers.get("x-forwarded-port"))&&void 0!==i?i:""));return l.nextUrl.basePath&&(n.pathname=p(n.pathname,l.nextUrl.basePath)),e.redirect(n.toString())}const z=f(g,b.locales,b.localePrefix),A=m(g,b.locales,b.localePrefix),C=null!=A,I="never"===b.localePrefix.mode||w&&"as-needed"===b.localePrefix.mode;let S,V,B=z;if("pathnames"in b){let e;if([e,V]=h(b.pathnames,z,j),V){const o=b.pathnames[V],a="string"==typeof o?o:o[j];if(t(a,z))B=u(z,a,V);else{let t;t=e?"string"==typeof o?o:o[e]:V;const r=I?void 0:n(j,b.localePrefix),i=u(z,t,a);S=H(x(i,r,l.nextUrl.search))}}}if(!S)if("/"!==B||C){const e=x(B,U(j),l.nextUrl.search);if(C){const o=x(z,A.prefix,l.nextUrl.search);if("never"===b.localePrefix.mode)S=H(x(z,void 0,l.nextUrl.search));else if(A.exact)if(w&&I)S=H(x(z,void 0,l.nextUrl.search));else if(b.domains){const l=v(k,A.locale,D);S=(null==k?void 0:k.domain)===(null==l?void 0:l.domain)||R?q(e):H(o,null==l?void 0:l.domain)}else S=q(e);else S=H(o)}else S=I?q(e):H(x(z,n(j,b.localePrefix),l.nextUrl.search))}else S=I?q(x(B,U(j),l.nextUrl.search)):H(x(z,n(j,b.localePrefix),l.nextUrl.search));var E;(y.localeDetection&&s(l,S,j),"never"!==b.localePrefix.mode&&y.alternateLinks&&b.locales.length>1)&&S.headers.set("Link",r({routing:b,localizedPathnames:null!=V&&"pathnames"in b?null===(E=b.pathnames)||void 0===E?void 0:E[V]:void 0,request:l,resolvedLocale:j}));return S}}export{P as default};
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{COOKIE_LOCALE_NAME as l}from"../shared/constants.js";import{getPathnameMatch as t,isLocaleSupportedOnDomain as n,getHost as a}from"./utils.js";function c(l,t,n){let a;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);a=e(c,o,n)}catch(e){}return a}function i(e,o){if(e.has(l)){var t;const n=null===(t=e.get(l))||void 0===t?void 0:t.value;if(n&&o.includes(n))return n}}function r(e,o,l,n,a){let r,{defaultLocale:u,localePrefix:f,locales:s}=e,{localeDetection:d}=o;var m;a&&(r=null===(m=t(a,s,f))||void 0===m?void 0:m.locale);return!r&&d&&n&&(r=i(n,s)),!r&&d&&l&&(r=c(l,s,u)),r||(r=u),r}function u(e,o,l,u,f){const s=function(e,o){var l;let t=a(e);if(t=null===(l=t)||void 0===l?void 0:l.replace(/:\d+$/,""),t&&o)return o.find((e=>e.domain===t))}(l,e.domains);if(!s)return{locale:r(e,o,l,u,f)};let d;if(f){var m;const o=null===(m=t(f,e.locales,e.localePrefix))||void 0===m?void 0:m.locale;if(o){if(!n(o,s))return{locale:o,domain:s};d=o}}if(!d&&o.localeDetection&&u){const o=i(u,e.locales);o&&n(o,s)&&(d=o)}if(!d&&o.localeDetection&&l){const o=c(l,s.locales||e.locales,s.defaultLocale);o&&(d=o)}return d||(d=s.defaultLocale),{locale:d,domain:s}}function f(e,o,l,t,n){if(e.domains){return u(e,o,l,t,n)}return{locale:r(e,o,l,t,n)}}export{f as default,c as getAcceptLanguageLocale};
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
- import{COOKIE_LOCALE_NAME as e,COOKIE_SAME_SITE as o,COOKIE_MAX_AGE as t}from"../shared/constants.js";function a(a,s,i){var n;(null===(n=a.cookies.get(e))||void 0===n?void 0:n.value)!==i&&s.cookies.set(e,i,{path:a.nextUrl.basePath||void 0,sameSite:o,maxAge:t})}export{a as default};
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/BaseLink.js";function i(l,i){let{locale:s,localePrefix:m,...c}=l;const n=o(),f=s||n,p=t(f,m);return r.createElement(a,e({ref:i,locale:f,localePrefixMode:m.mode,prefix:p},c))}const s=l(i);s.displayName="ClientLink";export{s as default};
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 l,compileLocalizedPathname as c,normalizeNameOrNameWithParams as i}from"../shared/utils.js";import s from"./ClientLink.js";import{clientRedirect as f,clientPermanentRedirect as u}from"./redirects.js";import m from"./useBasePathname.js";import h from"./useBaseRouter.js";function p(p){const d=a(p);function v(){const e=n();if(!d.locales.includes(e))throw new Error('Unknown locale encountered: "'.concat(e,'". Make sure to validate the locale in `i18n.ts`.'));return e}function P(o,t){let{href:n,locale:a,...l}=o;const i=v(),f=a||i;return r.createElement(s,e({ref:t,href:c({locale:f,pathname:n,params:"object"==typeof n?n.params:void 0,pathnames:d.pathnames}),locale:a,localePrefix:d.localePrefix},l))}const x=o(P);function g(e){let{href:r,locale:o}=e;return c({...i(r),locale:o,pathnames:d.pathnames})}return x.displayName="Link",{Link:x,redirect:function(e){const r=g({href:e,locale:v()});for(var o=arguments.length,t=new Array(o>1?o-1:0),n=1;n<o;n++)t[n-1]=arguments[n];return f({pathname:r,localePrefix:d.localePrefix},...t)},permanentRedirect:function(e){const r=g({href:e,locale:v()});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:d.localePrefix},...t)},usePathname:function(){const e=m(d.localePrefix),r=v();return t((()=>e?l(r,e,d.pathnames):e),[r,e])},useRouter:function(){const e=h(d.localePrefix),r=v();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=g({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=g({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=g({href:o,locale:(null===(t=a[0])||void 0===t?void 0:t.locale)||r});return e.prefetch(c,...a)}})),[e,r])},getPathname:g}}export{p as default};
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 r}from"../../_virtual/_rollupPluginBabelHelpers.js";import e,{forwardRef as t}from"react";import{receiveLocalePrefixConfig as n}from"../../routing/config.js";import o from"./ClientLink.js";import{clientRedirect as i,clientPermanentRedirect as a}from"./redirects.js";import u from"./useBasePathname.js";import f from"./useBaseRouter.js";function l(l){const m=n(null==l?void 0:l.localePrefix);function s(t,n){return e.createElement(o,r({ref:n,localePrefix:m},t))}const c=t(s);return c.displayName="Link",{Link:c,redirect:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return i({pathname:r,localePrefix:m},...t)},permanentRedirect:function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return a({pathname:r,localePrefix:m},...t)},usePathname:function(){return u(m)},useRouter:function(){return f(m)}}}export{l as default};
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 p=t(),u=o(),l=e();return r((()=>{function t(t,e){let r=window.location.pathname;const o=a(l);o&&(r=r.replace(o,""));const s=e||u,p=n(s,i);return c(t,s,u,r,p)}function e(e){return function(r,o){const{locale:n,...c}=o||{};s(l,u,n);const a=[t(r,n)];return Object.keys(c).length>0&&a.push(c),e(...a)}}return{...p,push:e(p.push),replace:e(p.replace),prefetch:e(p.prefetch)}}),[u,i,l,p])}export{i as default};
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 t from"../shared/BaseLink.js";import a from"../../server/react-server/getLocale.js";async function l(l){let{locale:s,localePrefix:i,...m}=l;const c=s||await a(),f=o(c,i);return r.createElement(t,e({locale:c,localePrefixMode:i.mode,prefix:f},m))}export{l as default};
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 t}from"../../routing/config.js";import{getRequestLocale as o}from"../../server/react-server/RequestLocale.js";import{compileLocalizedPathname as n,normalizeNameOrNameWithParams as a}from"../shared/utils.js";import l from"./ServerLink.js";import{serverRedirect as c,serverPermanentRedirect as i}from"./redirects.js";function s(s){const m=t(s);function f(e){let{href:r,locale:t}=e;return n({...a(r),locale:t,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(t){let{href:a,locale:c,...i}=t;const s=o(),f=c||s;return r.createElement(l,e({href:n({locale:f,pathname:a,params:"object"==typeof a?a.params:void 0,pathnames:m.pathnames}),locale:c,localePrefix:m.localePrefix},i))},redirect:function(e){const r=f({href:e,locale:o()});for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return c({localePrefix:m.localePrefix,pathname:r},...n)},permanentRedirect:function(e){const r=f({href:e,locale:o()});for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return i({localePrefix:m.localePrefix,pathname:r},...n)},getPathname:f,usePathname:u("usePathname"),useRouter:u("useRouter")}}export{s as default};
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 t}from"../../routing/config.js";import n from"./ServerLink.js";import{serverRedirect as o,serverPermanentRedirect as i}from"./redirects.js";function a(a){const u=t(null==a?void 0:a.localePrefix);function c(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(t){return r.createElement(n,e({localePrefix:u},t))},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({pathname:e,localePrefix:u},...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({pathname:e,localePrefix:u},...t)},usePathname:c("usePathname"),useRouter:c("useRouter")}}export{a as default};
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/RequestLocale.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,s=new Array(n>1?n-1:0),c=1;c<n;c++)s[c-1]=arguments[c];return e({...t,locale:o},...s)}}const n=o(e),s=o(t);export{s as serverPermanentRedirect,n as serverRedirect};
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 r}from"next/navigation";import t,{forwardRef as n,useState as i,useEffect as l}from"react";import c from"../../react-client/useLocale.js";import{isLocalizableHref as p,prefixHref as a,localizeHref as s}from"../../shared/utils.js";import f from"./syncLocaleCookie.js";function m(n,m){let{href:h,locale:u,localePrefixMode:d,onClick:k,prefetch:x,prefix:L,...g}=n;const j=r(),v=c(),C=u!==v,[y,w]=i((()=>p(h)&&("never"!==d||C)?a(h,L):h));return l((()=>{j&&w(s(h,u,v,j,L))}),[v,h,u,j,L]),C&&(x&&console.error("The `prefetch` prop is currently not supported when using the `locale` prop on `Link` to switch the locale.`"),x=!1),t.createElement(o,e({ref:m,href:y,hrefLang:C?u:void 0,onClick:function(e){f(j,v,u),k&&k(e)},prefetch:x},g))}const h=n(m);h.displayName="ClientLink";export{h as default};
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{COOKIE_LOCALE_NAME as t,COOKIE_MAX_AGE as o,COOKIE_SAME_SITE as c}from"../../shared/constants.js";import{getBasePath as a}from"./utils.js";function n(n,e,s){if(!(s!==e&&null!=s)||!n)return;const r=a(n),i=""!==r?r:"/";document.cookie="".concat(t,"=").concat(s,"; path=").concat(i,"; max-age=").concat(o,"; sameSite=").concat(c)}export{n as default};
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 t,matchesPathname as n,normalizeTrailingSlash as r}from"../../shared/utils.js";function e(t){return"string"==typeof t?{pathname:t}:t}function o(t){function n(t){return String(t)}const r=new URLSearchParams;for(const[e,o]of Object.entries(t))Array.isArray(o)?o.forEach((t=>{r.append(e,n(t))})):r.set(e,n(o));return"?"+r.toString()}function a(t){let{pathname:n,locale:e,params:a,pathnames:c,query:i}=t;function s(t){let n=c[t];return n||(n=t),n}function f(t){const n="string"==typeof t?t:t[e];let c=n;if(a&&Object.entries(a).forEach((t=>{let n,r,[e,o]=t;Array.isArray(o)?(n="(\\[)?\\[...".concat(e,"\\](\\])?"),r=o.map((t=>String(t))).join("/")):(n="\\[".concat(e,"\\]"),r=String(o)),c=c.replace(new RegExp(n,"g"),r)})),c=c.replace(/\[\[\.\.\..+\]\]/g,""),c=r(c),c.includes("["))throw new Error("Insufficient params provided for localized pathname.\nTemplate: ".concat(n,"\nParams: ").concat(JSON.stringify(a)));return i&&(c+=o(i)),c}if("string"==typeof n){return f(s(n))}{const{pathname:t,...r}=n;return{...r,pathname:f(s(t))}}}function c(r,e,o){const a=t(Object.keys(o)),c=decodeURI(e);for(const t of a){const e=o[t];if("string"==typeof e){if(n(e,c))return t}else if(n(e[r],c))return t}return e}function i(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.pathname;return"/"===t?n:n.replace(t,"")}export{a as compileLocalizedPathname,i as getBasePath,c as getRoute,e as normalizeNameOrNameWithParams,o as serializeSearchParams};
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 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";const r=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}));const i=n((function(){return{locale:void 0}}));function a(e){i().locale=e}function l(){return i().locale||r()}export{l as getRequestLocale,a as setRequestLocale};
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{cache as e}from"react";import{_createIntlFormatters as t,_createCache as o,initializeConfig as n}from"use-intl/core";import{getRequestLocale as r}from"./RequestLocale.js";import a from"next-intl/config";const i=e((function(){return new Date}));const s=e((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const c=e((async function(e,t){if("function"!=typeof e)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");let o=!1;const n={get locale(){return o=!0,t||r()}};let a=e(n);return a instanceof Promise&&(a=await a),o?a.locale&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"):a.locale||console.error("\nYou haven't read the `locale` param that was passed to `getRequestConfig` and also haven't returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...a,locale:a.locale||n.locale,now:a.now||i(),timeZone:a.timeZone||s()}})),u=e(t),l=e(o);const p=e((async function(e){const t=await c(a,e);return{...n(t),_formatters:u(l())}}));export{p as default};
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{setRequestLocale as unstable_setRequestLocale}from"./server/react-server/RequestLocale.js";
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 L="NEXT_LOCALE",E=31536e3,e="lax",l="X-NEXT-INTL-LOCALE",o="locale";export{L as COOKIE_LOCALE_NAME,E as COOKIE_MAX_AGE,e as COOKIE_SAME_SITE,l as HEADER_LOCALE_NAME,o as LOCALE_SEGMENT_NAME};
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"),n=require("./getAlternateLinksHeaderValue.js"),o=require("./resolveLocale.js"),r=require("./syncCookie.js"),i=require("./utils.js");exports.default=function(s,c){var d,h,m,f;const u=a.receiveRoutingConfig(s),x={alternateLinks:null===(d=null!==(h=null==c?void 0:c.alternateLinks)&&void 0!==h?h:s.alternateLinks)||void 0===d||d,localeDetection:null===(m=null!==(f=null==c?void 0:c.localeDetection)&&void 0!==f?f:null==s?void 0:s.localeDetection)||void 0===m||m};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}=o.default(u,x,a.headers,a.cookies,d),f=h?h.defaultLocale===m:m===u.defaultLocale,P=(null===(s=u.domains)||void 0===s?void 0:s.filter((e=>i.isLocaleSupportedOnDomain(m,e))))||[],p=null!=u.domains&&!h;function v(l){const n=new URL(l,a.url);a.nextUrl.basePath&&(n.pathname=i.applyBasePath(n.pathname,a.nextUrl.basePath));const o=new Headers(a.headers);return o.set(t.HEADER_LOCALE_NAME,m),e.NextResponse.rewrite(n,{request:{headers:o}})}function g(t,n){const o=new URL(l.normalizeTrailingSlash(t),a.url);if(P.length>0&&!n){const e=i.getBestMatchingDomain(h,m,P);e&&(n=e.domain,e.defaultLocale===m&&"as-needed"===u.localePrefix.mode&&(o.pathname=i.getNormalizedPathname(o.pathname,u.locales,u.localePrefix)))}var r,s;n&&(o.host=n,a.headers.get("x-forwarded-host")&&(o.protocol=null!==(r=a.headers.get("x-forwarded-proto"))&&void 0!==r?r:a.nextUrl.protocol,o.port=null!==(s=a.headers.get("x-forwarded-port"))&&void 0!==s?s:""));return a.nextUrl.basePath&&(o.pathname=i.applyBasePath(o.pathname,a.nextUrl.basePath)),e.NextResponse.redirect(o.toString())}const L=i.getNormalizedPathname(d,u.locales,u.localePrefix),U=i.getPathnameMatch(d,u.locales,u.localePrefix),q=null!=U,j="never"===u.localePrefix.mode||f&&"as-needed"===u.localePrefix.mode;let k,D,R=L;if("pathnames"in u){let e;if([e,D]=i.getInternalTemplate(u.pathnames,L,m),D){const t=u.pathnames[D],n="string"==typeof t?t:t[m];if(l.matchesPathname(n,L))R=i.formatTemplatePathname(L,n,D);else{let o;o=e?"string"==typeof t?t:t[e]:D;const r=j?void 0:l.getLocalePrefix(m,u.localePrefix),s=i.formatTemplatePathname(L,o,n);k=g(i.formatPathname(s,r,a.nextUrl.search))}}}if(!k)if("/"!==R||q){const e=i.formatPathname(R,i.getLocaleAsPrefix(m),a.nextUrl.search);if(q){const t=i.formatPathname(L,U.prefix,a.nextUrl.search);if("never"===u.localePrefix.mode)k=g(i.formatPathname(L,void 0,a.nextUrl.search));else if(U.exact)if(f&&j)k=g(i.formatPathname(L,void 0,a.nextUrl.search));else if(u.domains){const a=i.getBestMatchingDomain(h,U.locale,P);k=(null==h?void 0:h.domain)===(null==a?void 0:a.domain)||p?v(e):g(t,null==a?void 0:a.domain)}else k=v(e);else k=g(t)}else k=j?v(e):g(i.formatPathname(L,l.getLocalePrefix(m,u.localePrefix),a.nextUrl.search))}else k=j?v(i.formatPathname(R,i.getLocaleAsPrefix(m),a.nextUrl.search)):g(i.formatPathname(L,l.getLocalePrefix(m,u.localePrefix),a.nextUrl.search));var w;(x.localeDetection&&r.default(a,k,m),"never"!==u.localePrefix.mode&&x.alternateLinks&&u.locales.length>1)&&k.headers.set("Link",n.default({routing:u,localizedPathnames:null!=D&&"pathnames"in u?null===(w=u.pathnames)||void 0===w?void 0:w[D]:void 0,request:a,resolvedLocale:m}));return k}};
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"),t=require("negotiator"),l=require("../shared/constants.js"),o=require("./utils.js");function a(e){return e&&e.__esModule?e:{default:e}}var n=a(t);function c(t,l,o){let a;const c=new n.default({headers:{"accept-language":t.get("accept-language")||void 0}}).languages();try{const t=function(e){return e.slice().sort(((e,t)=>t.length-e.length))}(l);a=e.match(c,t,o)}catch(e){}return a}function r(e,t){if(e.has(l.COOKIE_LOCALE_NAME)){var o;const a=null===(o=e.get(l.COOKIE_LOCALE_NAME))||void 0===o?void 0:o.value;if(a&&t.includes(a))return a}}function i(e,t,l,a,n){let i,{defaultLocale:u,localePrefix:s,locales:d}=e,{localeDetection:f}=t;var g;n&&(i=null===(g=o.getPathnameMatch(n,d,s))||void 0===g?void 0:g.locale);return!i&&f&&a&&(i=r(a,d)),!i&&f&&l&&(i=c(l,d,u)),i||(i=u),i}function u(e,t,l,a,n){const u=function(e,t){var l;let a=o.getHost(e);if(a=null===(l=a)||void 0===l?void 0:l.replace(/:\d+$/,""),a&&t)return t.find((e=>e.domain===a))}(l,e.domains);if(!u)return{locale:i(e,t,l,a,n)};let s;if(n){var d;const t=null===(d=o.getPathnameMatch(n,e.locales,e.localePrefix))||void 0===d?void 0:d.locale;if(t){if(!o.isLocaleSupportedOnDomain(t,u))return{locale:t,domain:u};s=t}}if(!s&&t.localeDetection&&a){const t=r(a,e.locales);t&&o.isLocaleSupportedOnDomain(t,u)&&(s=t)}if(!s&&t.localeDetection&&l){const t=c(l,u.locales||e.locales,u.defaultLocale);t&&(s=t)}return s||(s=u.defaultLocale),{locale:s,domain:u}}exports.default=function(e,t,l,o,a){if(e.domains){return u(e,t,l,o,a)}return{locale:i(e,t,l,o,a)}},exports.getAcceptLanguageLocale=c;
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});var e=require("../shared/constants.js");exports.default=function(t,s,o){var a;(null===(a=t.cookies.get(e.COOKIE_LOCALE_NAME))||void 0===a?void 0:a.value)!==o&&s.cookies.set(e.COOKIE_LOCALE_NAME,o,{path:t.nextUrl.basePath||void 0,sameSite:e.COOKIE_SAME_SITE,maxAge:e.COOKIE_MAX_AGE})};
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/BaseLink.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
+ "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"),t=require("../../react-client/useLocale.js"),a=require("../../routing/config.js"),l=require("../shared/utils.js"),n=require("./ClientLink.js"),o=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=a.receiveRoutingConfig(u);function h(){const e=t.default();if(!f.locales.includes(e))throw new Error(void 0);return e}function d(r,t){let{href:a,locale:o,...c}=r;const i=h(),u=o||i;return s.default.createElement(n.default,e.extends({ref:t,href:l.compileLocalizedPathname({locale:u,pathname:a,params:"object"==typeof a?a.params:void 0,pathnames:f.pathnames}),locale:o,localePrefix:f.localePrefix},c))}const m=r.forwardRef(d);function p(e){let{href:r,locale:t}=e;return l.compileLocalizedPathname({...l.normalizeNameOrNameWithParams(r),locale:t,pathnames:f.pathnames})}return m.displayName="Link",{Link:m,redirect:function(e){const r=p({href:e,locale:h()});for(var t=arguments.length,a=new Array(t>1?t-1:0),l=1;l<t;l++)a[l-1]=arguments[l];return o.clientRedirect({pathname:r,localePrefix:f.localePrefix},...a)},permanentRedirect:function(e){const r=p({href:e,locale:h()});for(var t=arguments.length,a=new Array(t>1?t-1:0),l=1;l<t;l++)a[l-1]=arguments[l];return o.clientPermanentRedirect({pathname:r,localePrefix:f.localePrefix},...a)},usePathname:function(){const e=c.default(f.localePrefix),t=h();return r.useMemo((()=>e?l.getRoute(t,e,f.pathnames):e),[t,e])},useRouter:function(){const e=i.default(f.localePrefix),t=h();return r.useMemo((()=>({...e,push(r){for(var a,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=p({href:r,locale:(null===(a=n[0])||void 0===a?void 0:a.locale)||t});return e.push(c,...n)},replace(r){for(var a,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=p({href:r,locale:(null===(a=n[0])||void 0===a?void 0:a.locale)||t});return e.replace(c,...n)},prefetch(r){for(var a,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=p({href:r,locale:(null===(a=n[0])||void 0===a?void 0:a.locale)||t});return e.prefetch(c,...n)}})),[e,t])},getPathname:p}};
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"),u=require("./redirects.js"),i=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);function f(r,t){return o.default.createElement(n.default,e.extends({ref:t,localePrefix:c},r))}const s=r.forwardRef(f);return s.displayName="Link",{Link:s,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 u.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 u.clientPermanentRedirect({pathname:e,localePrefix:c},...t)},usePathname:function(){return i.default(c)},useRouter:function(){return a.default(c)}}};
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 c=e.useRouter(),o=r.default(),i=e.usePathname();return t.useMemo((()=>{function e(e,t){let r=window.location.pathname;const n=s.getBasePath(i);n&&(r=r.replace(n,""));const c=t||o,l=u.getLocalePrefix(c,a);return u.localizeHref(e,c,o,r,l)}function t(t){return function(r,u){const{locale:s,...a}=u||{};n.default(i,o,s);const c=[e(r,s)];return Object.keys(a).length>0&&c.push(a),t(...c)}}return{...c,push:t(c.push),replace:t(c.replace),prefetch:t(c.prefetch)}}),[o,a,i,c])};
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/BaseLink.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
+ "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/RequestLocale.js"),n=require("../shared/utils.js"),o=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 n.compileLocalizedPathname({...n.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(o.default,e.extends({href:n.compileLocalizedPathname({locale:f,pathname:t,params:"object"==typeof t?t.params:void 0,pathnames:c.pathnames}),locale:l,localePrefix:c.localePrefix},u))},redirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return l.serverRedirect({localePrefix:c.localePrefix,pathname:r},...n)},permanentRedirect:function(e){const r=u({href:e,locale:a.getRequestLocale()});for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return l.serverPermanentRedirect({localePrefix:c.localePrefix,pathname:r},...n)},getPathname:u,usePathname:s("usePathname"),useRouter:s("useRouter")}};
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 u(e){return e&&e.__esModule?e:{default:e}}var i=u(r);exports.default=function(r){const u=t.receiveLocalePrefixConfig(null==r?void 0:r.localePrefix);function a(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 i.default.createElement(n.default,e.extends({localePrefix:u},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:u},...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:u},...t)},usePathname:a("usePathname"),useRouter:a("useRouter")}};
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/RequestLocale.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
+ "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"),r=require("next/link"),t=require("next/navigation"),l=require("react"),i=require("../../react-client/useLocale.js"),a=require("../../shared/utils.js"),u=require("./syncLocaleCookie.js");function n(e){return e&&e.__esModule?e:{default:e}}var f=n(r),o=n(l);function c(r,n){let{href:c,locale:s,localePrefixMode:d,onClick:p,prefetch:x,prefix:h,...q}=r;const v=t.usePathname(),_=i.default(),j=s!==_,[k,L]=l.useState((()=>a.isLocalizableHref(c)&&("never"!==d||j)?a.prefixHref(c,h):c));return l.useEffect((()=>{v&&L(a.localizeHref(c,s,_,v,h))}),[_,c,s,v,h]),j&&(x=!1),o.default.createElement(f.default,e.extends({ref:n,href:k,hrefLang:j?s:void 0,onClick:function(e){u.default(v,_,s),p&&p(e)},prefetch:x},q))}const s=l.forwardRef(c);s.displayName="ClientLink",exports.default=s;
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("../../shared/constants.js"),t=require("./utils.js");exports.default=function(c,a,o){if(!(o!==a&&null!=o)||!c)return;const n=t.getBasePath(c),s=""!==n?n:"/";document.cookie="".concat(e.COOKIE_LOCALE_NAME,"=").concat(o,"; path=").concat(s,"; max-age=").concat(e.COOKIE_MAX_AGE,"; sameSite=").concat(e.COOKIE_SAME_SITE)};
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,a]of Object.entries(e))Array.isArray(a)?a.forEach((e=>{r.append(n,t(e))})):r.set(n,t(a));return"?"+r.toString()}exports.compileLocalizedPathname=function(r){let{pathname:n,locale:a,params:o,pathnames:i,query:s}=r;function c(e){let t=i[e];return t||(t=e),t}function p(r){let n="string"==typeof r?r:r[a];return o&&Object.entries(o).forEach((e=>{let t,r,[a,o]=e;Array.isArray(o)?(t="(\\[)?\\[...".concat(a,"\\](\\])?"),r=o.map((e=>String(e))).join("/")):(t="\\[".concat(a,"\\]"),r=String(o)),n=n.replace(new RegExp(t,"g"),r)})),n=n.replace(/\[\[\.\.\..+\]\]/g,""),n=e.normalizeTrailingSlash(n),s&&(n+=t(s)),n}if("string"==typeof n){return p(c(n))}{const{pathname:e,...t}=n;return{...t,pathname:p(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,n){const a=e.getSortedPathnames(Object.keys(n)),o=decodeURI(r);for(const r of a){const a=n[r];if("string"==typeof a){const t=a;if(e.matchesPathname(t,o))return r}else if(e.matchesPathname(a[t],o))return r}return r},exports.normalizeNameOrNameWithParams=function(e){return"string"==typeof e?{pathname:e}:e},exports.serializeSearchParams=t;
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.receiveLocalePrefixConfig=e,exports.receiveRoutingConfig=function(o){return{...o,localePrefix:e(o.localePrefix)}};
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("next/navigation"),n=require("react"),r=require("../../shared/constants.js");const o=n.cache((function(){let n;try{n=e.headers().get(r.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 n||t.notFound(),n}));const s=n.cache((function(){return{locale:void 0}}));exports.getRequestLocale=function(){return s().locale||o()},exports.setRequestLocale=function(e){s().locale=e};
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("react"),t=require("use-intl/core"),n=require("./RequestLocale.js");function c(e){return e&&e.__esModule?e:{default:e}}var r=c(require("next-intl/config"));const o=e.cache((function(){return new Date}));const a=e.cache((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const i=e.cache((async function(e,t){const c={get locale(){return t||n.getRequestLocale()}};let r=e(c);return r instanceof Promise&&(r=await r),{...r,locale:r.locale||c.locale,now:r.now||o(),timeZone:r.timeZone||a()}})),u=e.cache(t._createIntlFormatters),s=e.cache(t._createCache);const l=e.cache((async function(e){const n=await i(r.default,e);return{...t.initializeConfig(n),_formatters:u(s())}}));exports.default=l;
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/RequestLocale.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.setRequestLocale;
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.COOKIE_LOCALE_NAME="NEXT_LOCALE",exports.COOKIE_MAX_AGE=31536e3,exports.COOKIE_SAME_SITE="lax",exports.HEADER_LOCALE_NAME="X-NEXT-INTL-LOCALE",exports.LOCALE_SEGMENT_NAME="locale";
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> = never>({ localizedPathnames, request, resolvedLocale, routing }: {
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
- import { MiddlewareOptions } from './config';
5
- export default function createMiddleware<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales> = never>(routing: RoutingConfig<AppLocales, AppPathnames> & MiddlewareOptions, options?: MiddlewareOptions): (request: NextRequest) => NextResponse<unknown>;
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>;