next-intl 3.14.1 → 3.15.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 (133) hide show
  1. package/dist/development/config.js +1 -1
  2. package/dist/development/middleware/config.js +17 -0
  3. package/dist/development/middleware/getAlternateLinksHeaderValue.js +8 -7
  4. package/dist/development/middleware/middleware.js +69 -83
  5. package/dist/development/middleware/resolveLocale.js +5 -6
  6. package/dist/development/middleware/syncCookie.js +19 -0
  7. package/dist/development/middleware/utils.js +58 -30
  8. package/dist/development/navigation/react-client/ClientLink.js +7 -2
  9. package/dist/development/navigation/react-client/createLocalizedPathnamesNavigation.js +18 -16
  10. package/dist/development/navigation/react-client/createSharedPathnamesNavigation.js +17 -12
  11. package/dist/development/navigation/react-client/redirects.js +32 -0
  12. package/dist/development/navigation/react-client/useBasePathname.js +12 -4
  13. package/dist/development/navigation/react-client/useBaseRouter.js +8 -3
  14. package/dist/development/navigation/react-server/ServerLink.js +7 -1
  15. package/dist/development/navigation/react-server/createLocalizedPathnamesNavigation.js +15 -19
  16. package/dist/development/navigation/react-server/createSharedPathnamesNavigation.js +11 -10
  17. package/dist/development/navigation/react-server/redirects.js +24 -0
  18. package/dist/development/navigation/shared/BaseLink.js +6 -5
  19. package/dist/development/navigation/shared/config.js +30 -0
  20. package/dist/development/navigation/shared/redirects.js +22 -0
  21. package/dist/development/navigation/shared/utils.js +2 -4
  22. package/dist/development/routing/config.js +18 -0
  23. package/dist/development/routing.js +2 -0
  24. package/dist/development/server/react-server/RequestLocale.js +1 -1
  25. package/dist/development/shared/utils.js +26 -14
  26. package/dist/esm/config.js +1 -1
  27. package/dist/esm/middleware/config.js +1 -0
  28. package/dist/esm/middleware/getAlternateLinksHeaderValue.js +1 -1
  29. package/dist/esm/middleware/middleware.js +1 -1
  30. package/dist/esm/middleware/resolveLocale.js +1 -1
  31. package/dist/esm/middleware/syncCookie.js +1 -0
  32. package/dist/esm/middleware/utils.js +1 -1
  33. package/dist/esm/navigation/react-client/ClientLink.js +1 -1
  34. package/dist/esm/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
  35. package/dist/esm/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
  36. package/dist/esm/navigation/react-client/redirects.js +1 -0
  37. package/dist/esm/navigation/react-client/useBasePathname.js +1 -1
  38. package/dist/esm/navigation/react-client/useBaseRouter.js +1 -1
  39. package/dist/esm/navigation/react-server/ServerLink.js +1 -1
  40. package/dist/esm/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
  41. package/dist/esm/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
  42. package/dist/esm/navigation/react-server/redirects.js +1 -0
  43. package/dist/esm/navigation/shared/BaseLink.js +1 -1
  44. package/dist/esm/navigation/shared/config.js +1 -0
  45. package/dist/esm/navigation/shared/redirects.js +1 -0
  46. package/dist/esm/navigation/shared/utils.js +1 -1
  47. package/dist/esm/routing/config.js +1 -0
  48. package/dist/esm/routing.js +1 -0
  49. package/dist/esm/server/react-server/RequestLocale.js +1 -1
  50. package/dist/esm/shared/utils.js +1 -1
  51. package/dist/production/config.js +1 -1
  52. package/dist/production/middleware/config.js +1 -0
  53. package/dist/production/middleware/getAlternateLinksHeaderValue.js +1 -1
  54. package/dist/production/middleware/middleware.js +1 -1
  55. package/dist/production/middleware/resolveLocale.js +1 -1
  56. package/dist/production/middleware/syncCookie.js +1 -0
  57. package/dist/production/middleware/utils.js +1 -1
  58. package/dist/production/navigation/react-client/ClientLink.js +1 -1
  59. package/dist/production/navigation/react-client/createLocalizedPathnamesNavigation.js +1 -1
  60. package/dist/production/navigation/react-client/createSharedPathnamesNavigation.js +1 -1
  61. package/dist/production/navigation/react-client/redirects.js +1 -0
  62. package/dist/production/navigation/react-client/useBasePathname.js +1 -1
  63. package/dist/production/navigation/react-client/useBaseRouter.js +1 -1
  64. package/dist/production/navigation/react-server/ServerLink.js +1 -1
  65. package/dist/production/navigation/react-server/createLocalizedPathnamesNavigation.js +1 -1
  66. package/dist/production/navigation/react-server/createSharedPathnamesNavigation.js +1 -1
  67. package/dist/production/navigation/react-server/redirects.js +1 -0
  68. package/dist/production/navigation/shared/BaseLink.js +1 -1
  69. package/dist/production/navigation/shared/config.js +1 -0
  70. package/dist/production/navigation/shared/redirects.js +1 -0
  71. package/dist/production/navigation/shared/utils.js +1 -1
  72. package/dist/production/routing/config.js +1 -0
  73. package/dist/production/routing.js +1 -0
  74. package/dist/production/server/react-server/RequestLocale.js +1 -1
  75. package/dist/production/shared/utils.js +1 -1
  76. package/dist/routing.js +7 -0
  77. package/dist/types/src/middleware/config.d.ts +18 -0
  78. package/dist/types/src/middleware/getAlternateLinksHeaderValue.d.ts +6 -6
  79. package/dist/types/src/middleware/middleware.d.ts +3 -3
  80. package/dist/types/src/middleware/resolveLocale.d.ts +6 -6
  81. package/dist/types/src/middleware/syncCookie.d.ts +2 -0
  82. package/dist/types/src/middleware/utils.d.ts +19 -12
  83. package/dist/types/src/navigation/react-client/ClientLink.d.ts +10 -7
  84. package/dist/types/src/navigation/react-client/createLocalizedPathnamesNavigation.d.ts +21 -22
  85. package/dist/types/src/navigation/react-client/createSharedPathnamesNavigation.d.ts +22 -10
  86. package/dist/types/src/navigation/react-client/index.d.ts +3 -1
  87. package/dist/types/src/navigation/react-client/redirects.d.ts +10 -0
  88. package/dist/types/src/navigation/react-client/useBasePathname.d.ts +2 -1
  89. package/dist/types/src/navigation/react-client/useBaseRouter.d.ts +7 -7
  90. package/dist/types/src/navigation/react-server/ServerLink.d.ts +5 -4
  91. package/dist/types/src/navigation/react-server/createLocalizedPathnamesNavigation.d.ts +14 -15
  92. package/dist/types/src/navigation/react-server/createSharedPathnamesNavigation.d.ts +4 -6
  93. package/dist/types/src/navigation/react-server/index.d.ts +1 -1
  94. package/dist/types/src/navigation/react-server/redirects.d.ts +10 -0
  95. package/dist/types/src/navigation/shared/BaseLink.d.ts +3 -2
  96. package/dist/types/src/navigation/shared/config.d.ts +24 -0
  97. package/dist/types/src/navigation/shared/redirects.d.ts +11 -0
  98. package/dist/types/src/navigation/shared/utils.d.ts +10 -10
  99. package/dist/types/src/routing/config.d.ts +14 -0
  100. package/dist/types/src/routing/index.d.ts +2 -0
  101. package/dist/types/src/routing/types.d.ts +23 -0
  102. package/dist/types/src/routing.d.ts +1 -0
  103. package/dist/types/src/shared/types.d.ts +0 -5
  104. package/dist/types/src/shared/utils.d.ts +10 -7
  105. package/package.json +16 -6
  106. package/routing.d.ts +1 -0
  107. package/dist/development/navigation/react-client/clientPermanentRedirect.js +0 -25
  108. package/dist/development/navigation/react-client/clientRedirect.js +0 -25
  109. package/dist/development/navigation/react-server/serverPermanentRedirect.js +0 -19
  110. package/dist/development/navigation/react-server/serverRedirect.js +0 -19
  111. package/dist/development/navigation/shared/basePermanentRedirect.js +0 -16
  112. package/dist/development/navigation/shared/baseRedirect.js +0 -16
  113. package/dist/esm/navigation/react-client/clientPermanentRedirect.js +0 -1
  114. package/dist/esm/navigation/react-client/clientRedirect.js +0 -1
  115. package/dist/esm/navigation/react-server/serverPermanentRedirect.js +0 -1
  116. package/dist/esm/navigation/react-server/serverRedirect.js +0 -1
  117. package/dist/esm/navigation/shared/basePermanentRedirect.js +0 -1
  118. package/dist/esm/navigation/shared/baseRedirect.js +0 -1
  119. package/dist/production/navigation/react-client/clientPermanentRedirect.js +0 -1
  120. package/dist/production/navigation/react-client/clientRedirect.js +0 -1
  121. package/dist/production/navigation/react-server/serverPermanentRedirect.js +0 -1
  122. package/dist/production/navigation/react-server/serverRedirect.js +0 -1
  123. package/dist/production/navigation/shared/basePermanentRedirect.js +0 -1
  124. package/dist/production/navigation/shared/baseRedirect.js +0 -1
  125. package/dist/types/src/middleware/NextIntlMiddlewareConfig.d.ts +0 -31
  126. package/dist/types/src/navigation/react-client/clientPermanentRedirect.d.ts +0 -6
  127. package/dist/types/src/navigation/react-client/clientRedirect.d.ts +0 -6
  128. package/dist/types/src/navigation/react-server/serverPermanentRedirect.d.ts +0 -6
  129. package/dist/types/src/navigation/react-server/serverRedirect.d.ts +0 -6
  130. package/dist/types/src/navigation/shared/basePermanentRedirect.d.ts +0 -7
  131. package/dist/types/src/navigation/shared/baseRedirect.d.ts +0 -7
  132. /package/dist/types/test/navigation/shared/{basePermanentRedirect.test.d.ts → redirects.test.d.ts} +0 -0
  133. /package/dist/types/test/{navigation/shared/baseRedirect.test.d.ts → routing/types.test.d.ts} +0 -0
@@ -1 +1 @@
1
- import{match as e}from"@formatjs/intl-localematcher";import o from"negotiator";import{COOKIE_LOCALE_NAME as t}from"../shared/constants.js";import{isLocaleSupportedOnDomain as n,getHost as l,getFirstPathnameSegment as a,findCaseInsensitiveLocale as c}from"./utils.js";function i(t,n,l){let a;const c=new o({headers:{"accept-language":t.get("accept-language")||void 0}}).languages();try{a=e(c,n,l)}catch(e){}return a}function r(e,o){const t=a(e);return c(t,o)}function u(e,o){if(e.has(t)){var n;const l=null===(n=e.get(t))||void 0===n?void 0:n.value;if(l&&o.includes(l))return l}}function f(e,o,t,n){let l,{defaultLocale:a,localeDetection:c,locales:f}=e;return n&&(l=r(n,f)),!l&&c&&t&&(l=u(t,f)),!l&&c&&o&&(l=i(o,f,a)),l||(l=a),l}function s(e,o,t,a){const c=function(e,o){var t;let n=l(e);if(n=null===(t=n)||void 0===t?void 0:t.replace(/:\d+$/,""),n&&o)return o.find((e=>e.domain===n))}(o,e.domains);if(!c)return{locale:f(e,o,t,a)};let s;if(a){const o=r(a,e.locales);if(o){if(!n(o,c))return{locale:o,domain:c};s=o}}if(!s&&e.localeDetection&&t){const o=u(t,e.locales);o&&n(o,c)&&(s=o)}if(!s&&e.localeDetection&&o){const t=i(o,c.locales||e.locales,c.defaultLocale);t&&(s=t)}return s||(s=c.defaultLocale),{locale:s,domain:c}}function d(e,o,t,n){return e.domains?s(e,o,t,n):{locale:f(e,o,t,n)}}export{d as default,i as getAcceptLanguageLocale};
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 a,getHost as n}from"./utils.js";function c(l,t,a){let n;const c=new o({headers:{"accept-language":l.get("accept-language")||void 0}}).languages();try{n=e(c,t,a)}catch(e){}return n}function i(e,o){if(e.has(l)){var t;const a=null===(t=e.get(l))||void 0===t?void 0:t.value;if(a&&o.includes(a))return a}}function r(e,o,l,a){let n,{defaultLocale:r,localeDetection:u,localePrefix:f,locales:s}=e;var d;a&&(n=null===(d=t(a,s,f))||void 0===d?void 0:d.locale);return!n&&u&&l&&(n=i(l,s)),!n&&u&&o&&(n=c(o,s,r)),n||(n=r),n}function u(e,o,l,u){const f=function(e,o){var l;let t=n(e);if(t=null===(l=t)||void 0===l?void 0:l.replace(/:\d+$/,""),t&&o)return o.find((e=>e.domain===t))}(o,e.domains);if(!f)return{locale:r(e,o,l,u)};let s;if(u){var d;const o=null===(d=t(u,e.locales,e.localePrefix))||void 0===d?void 0:d.locale;if(o){if(!a(o,f))return{locale:o,domain:f};s=o}}if(!s&&e.localeDetection&&l){const o=i(l,e.locales);o&&a(o,f)&&(s=o)}if(!s&&e.localeDetection&&o){const l=c(o,f.locales||e.locales,f.defaultLocale);l&&(s=l)}return s||(s=f.defaultLocale),{locale:s,domain:f}}function f(e,o,l,t){return e.domains?u(e,o,l,t):{locale:r(e,o,l,t)}}export{f as default,c as getAcceptLanguageLocale};
@@ -0,0 +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 +1 @@
1
- import{matchesPathname as n,templateToRegex as t}from"../shared/utils.js";function e(n){return n.split("/")[1]}function r(n){return n.includes("[[...")}function o(n){return n.includes("[...")}function i(n){return n.includes("[")}function u(n,t){const e=n.split("/"),u=t.split("/"),c=Math.max(e.length,u.length);for(let n=0;n<c;n++){const t=e[n],c=u[n];if(!t&&c)return-1;if(t&&!c)return 1;if(!i(t)&&i(c))return-1;if(i(t)&&!i(c))return 1;if(!o(t)&&o(c))return-1;if(o(t)&&!o(c))return 1;if(!r(t)&&r(c))return-1;if(r(t)&&!r(c))return 1}return 0}function c(n){return n.sort(u)}function l(t,e,r){const o=c(Object.keys(t));for(const i of o){const o=t[i];if("string"==typeof o){if(n(o,e))return[void 0,i]}else{const t=Object.entries(o),u=t.findIndex((n=>{let[t]=n;return t===r}));u>0&&t.unshift(t.splice(u,1)[0]);for(const[r,o]of t)if(n(o,e))return[r,i]}}for(const r of Object.keys(t))if(n(r,e))return[void 0,r];return[void 0,void 0]}function f(n,t,e,r){const o=h(t,n);let i="";return r&&(i="/".concat(r)),i+=v(e,o),i=b(i),i}function s(n,t){n.endsWith("/")||(n+="/");const e=n.match(new RegExp("^/(".concat(t.join("|"),")/(.*)"),"i"));let r=e?"/"+e[2]:n;return"/"!==r&&(r=b(r)),r}function d(n,t){return t.find((t=>t.toLowerCase()===n.toLowerCase()))}function a(n,t){const r=e(n);return d(r,t)?r:void 0}function h(n,e){const r=t(n).exec(e);if(!r)return;const o={};for(let t=1;t<r.length;t++){var i;const e=null===(i=n.match(/\[([^\]]+)\]/g))||void 0===i?void 0:i[t-1].replace(/[[\]]/g,"");e&&(o[e]=r[t])}return o}function v(n,t){if(!t)return n;let e=n=n.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((n=>{let[t,r]=n;e=e.replace("[".concat(t,"]"),r)})),e}function p(n,t){let e=n;return t&&(e+=t),e}function g(n){var t,e;return null!==(t=null!==(e=n.get("x-forwarded-host"))&&void 0!==e?e:n.get("host"))&&void 0!==t?t:void 0}function j(n,t){return t.defaultLocale===n||!t.locales||t.locales.includes(n)}function x(n,t,e){let r;return n&&j(t,n)&&(r=n),r||(r=e.find((n=>n.defaultLocale===t))),r||(r=e.find((n=>null!=n.locales&&n.locales.includes(t)))),r||null!=(null==n?void 0:n.locales)||(r=n),r||(r=e.find((n=>!n.locales))),r}function m(n,t){return b(t+n)}function b(n){return n.endsWith("/")&&(n=n.slice(0,-1)),n}export{m as applyBasePath,u as comparePathnamePairs,d as findCaseInsensitiveLocale,v as formatPathname,f as formatTemplatePathname,x as getBestMatchingDomain,e as getFirstPathnameSegment,g as getHost,l as getInternalTemplate,s as getNormalizedPathname,p as getPathWithSearch,a as getPathnameLocale,h as getRouteParams,c as getSortedPathnames,j as isLocaleSupportedOnDomain};
1
+ import{matchesPathname as t,getLocalePrefix as n,templateToRegex as e,prefixPathname as r}from"../shared/utils.js";function o(t){return t.includes("[[...")}function c(t){return t.includes("[...")}function i(t){return t.includes("[")}function u(t,n){const e=t.split("/"),r=n.split("/"),u=Math.max(e.length,r.length);for(let t=0;t<u;t++){const n=e[t],u=r[t];if(!n&&u)return-1;if(n&&!u)return 1;if(!i(n)&&i(u))return-1;if(i(n)&&!i(u))return 1;if(!c(n)&&c(u))return-1;if(c(n)&&!c(u))return 1;if(!o(n)&&o(u))return-1;if(o(n)&&!o(u))return 1}return 0}function l(t){return t.sort(u)}function f(n,e,r){const o=l(Object.keys(n));for(const c of o){const o=n[c];if("string"==typeof o){if(t(o,e))return[void 0,c]}else{const n=Object.entries(o),i=n.findIndex((t=>{let[n]=t;return n===r}));i>0&&n.unshift(n.splice(i,1)[0]);for(const[r,o]of n)if(t(o,e))return[r,c]}}for(const r of Object.keys(n))if(t(r,e))return[void 0,r];return[void 0,void 0]}function s(t,n,e,r){const o=p(n,t);let c="";return r&&(c="/".concat(r)),c+=g(e,o),c=w(c),c}function a(t,n,e){t.endsWith("/")||(t+="/");const r=d(n,e),o=new RegExp("^(".concat(r.map((t=>{let[,n]=t;return n.replaceAll("/","\\/")})).join("|"),")/(.*)"),"i"),c=t.match(o);let i=c?"/"+c[2]:t;return"/"!==i&&(i=w(i)),i}function d(t,e){return t.map((t=>[t,n(t,e)]))}function h(t,n,e){const r=d(n,e);for(const[n,e]of r){let r,o;if(t===e||t.startsWith(e+"/"))r=o=!0;else{const n=t.toLowerCase(),c=e.toLowerCase();(n===c||n.startsWith(c+"/"))&&(r=!1,o=!0)}if(o)return{locale:n,prefix:e,matchedPrefix:t.slice(0,e.length),exact:r}}}function p(t,n){const r=e(t).exec(n);if(!r)return;const o={};for(let n=1;n<r.length;n++){var c;const e=null===(c=t.match(/\[([^\]]+)\]/g))||void 0===c?void 0:c[n-1].replace(/[[\]]/g,"");e&&(o[e]=r[n])}return o}function g(t,n){if(!n)return t;let e=t=t.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(n).forEach((t=>{let[n,r]=t;e=e.replace("[".concat(n,"]"),r)})),e}function v(t,n,e){let o=t;return n&&(o=r(n,o)),e&&(o+=e),o}function x(t){var n,e;return null!==(n=null!==(e=t.get("x-forwarded-host"))&&void 0!==e?e:t.get("host"))&&void 0!==n?n:void 0}function m(t,n){return n.defaultLocale===t||!n.locales||n.locales.includes(t)}function j(t,n,e){let r;return t&&m(n,t)&&(r=t),r||(r=e.find((t=>t.defaultLocale===n))),r||(r=e.find((t=>null!=t.locales&&t.locales.includes(n)))),r||null!=(null==t?void 0:t.locales)||(r=t),r||(r=e.find((t=>!t.locales))),r}function b(t,n){return w(n+t)}function w(t){return"/"!==t&&t.endsWith("/")&&(t=t.slice(0,-1)),t}function L(t){return"/".concat(t)}export{b as applyBasePath,u as comparePathnamePairs,v as formatPathname,g as formatPathnameTemplate,s as formatTemplatePathname,j as getBestMatchingDomain,x as getHost,f as getInternalTemplate,L as getLocaleAsPrefix,d as getLocalePrefixes,a as getNormalizedPathname,h as getPathnameMatch,p as getRouteParams,l as getSortedPathnames,m as isLocaleSupportedOnDomain,w as normalizeTrailingSlash};
@@ -1 +1 @@
1
- import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as t}from"react";import l from"../../react-client/useLocale.js";import a from"../shared/BaseLink.js";function o(t,o){let{locale:s,...i}=t;const n=l(),c=s||n;return r.createElement(a,e({ref:o,locale:c},i))}const s=t(o);s.displayName="ClientLink";var i=s;export{i 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/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";var m=s;export{m as default};
@@ -1 +1 @@
1
- import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as t}from"react";import n from"../../react-client/useLocale.js";import{getRoute as a,compileLocalizedPathname as o,normalizeNameOrNameWithParams as l}from"../shared/utils.js";import c from"./ClientLink.js";import i from"./clientPermanentRedirect.js";import s from"./clientRedirect.js";import u from"./useBasePathname.js";import f from"./useBaseRouter.js";function m(m){function h(){const e=n();if(!m.locales.includes(e))throw new Error('Unknown locale encountered: "'.concat(e,'". Make sure to validate the locale in `i18n.ts`.'));return e}function p(t,n){let{href:a,locale:l,...i}=t;const s=h(),u=l||s;return r.createElement(c,e({ref:n,href:o({locale:u,pathname:a,params:"object"==typeof a?a.params:void 0,pathnames:m.pathnames}),locale:l,localePrefix:m.localePrefix},i))}const d=t(p);function v(e){let{href:r,locale:t}=e;return o({...l(r),locale:t,pathnames:m.pathnames})}return d.displayName="Link",{Link:d,redirect:function(e){const r=v({href:e,locale:h()});for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return s({...m,pathname:r},...n)},permanentRedirect:function(e){const r=v({href:e,locale:h()});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({...m,pathname:r},...n)},usePathname:function(){const e=u(),r=h();return e?a({pathname:e,locale:r,pathnames:m.pathnames}):e},useRouter:function(){const e=f(),r=h();return{...e,push(t){for(var n,a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];const c=v({href:t,locale:(null===(n=o[0])||void 0===n?void 0:n.locale)||r});return e.push(c,...o)},replace(t){for(var n,a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];const c=v({href:t,locale:(null===(n=o[0])||void 0===n?void 0:n.locale)||r});return e.replace(c,...o)},prefetch(t){for(var n,a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];const c=v({href:t,locale:(null===(n=o[0])||void 0===n?void 0:n.locale)||r});return e.prefetch(c,...o)}}},getPathname:v}}export{m as default};
1
+ import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as o}from"react";import t from"../../react-client/useLocale.js";import{receiveLocalizedNavigationRoutingConfig as a}from"../shared/config.js";import{getRoute as n,compileLocalizedPathname as l,normalizeNameOrNameWithParams as c}from"../shared/utils.js";import i from"./ClientLink.js";import{clientRedirect as s,clientPermanentRedirect as f}from"./redirects.js";import u from"./useBasePathname.js";import m from"./useBaseRouter.js";function h(h){const p=a(h);function d(){const e=t();if(!p.locales.includes(e))throw new Error('Unknown locale encountered: "'.concat(e,'". Make sure to validate the locale in `i18n.ts`.'));return e}function v(o,t){let{href:a,locale:n,...c}=o;const s=d(),f=n||s;return r.createElement(i,e({ref:t,href:l({locale:f,pathname:a,params:"object"==typeof a?a.params:void 0,pathnames:p.pathnames}),locale:n,localePrefix:p.localePrefix},c))}const P=o(v);function x(e){let{href:r,locale:o}=e;return l({...c(r),locale:o,pathnames:p.pathnames})}return P.displayName="Link",{Link:P,redirect:function(e){const r=x({href:e,locale:d()});for(var o=arguments.length,t=new Array(o>1?o-1:0),a=1;a<o;a++)t[a-1]=arguments[a];return s({pathname:r,localePrefix:p.localePrefix},...t)},permanentRedirect:function(e){const r=x({href:e,locale:d()});for(var o=arguments.length,t=new Array(o>1?o-1:0),a=1;a<o;a++)t[a-1]=arguments[a];return f({pathname:r,localePrefix:p.localePrefix},...t)},usePathname:function(){const e=u(p.localePrefix),r=d();return e?n({pathname:e,locale:r,pathnames:p.pathnames}):e},useRouter:function(){const e=m(p.localePrefix),r=d();return{...e,push(o){for(var t,a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];const c=x({href:o,locale:(null===(t=n[0])||void 0===t?void 0:t.locale)||r});return e.push(c,...n)},replace(o){for(var t,a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];const c=x({href:o,locale:(null===(t=n[0])||void 0===t?void 0:t.locale)||r});return e.replace(c,...n)},prefetch(o){for(var t,a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];const c=x({href:o,locale:(null===(t=n[0])||void 0===t?void 0:t.locale)||r});return e.prefetch(c,...n)}}},getPathname:x}}export{h as default};
@@ -1 +1 @@
1
- import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as t}from"react";import n from"./ClientLink.js";import o from"./clientPermanentRedirect.js";import i from"./clientRedirect.js";import a from"./useBasePathname.js";import m from"./useBaseRouter.js";function u(u){function l(t,o){return r.createElement(n,e({ref:o,localePrefix:null==u?void 0:u.localePrefix},t))}const f=t(l);return f.displayName="Link",{Link:f,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({...u,pathname:e},...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({...u,pathname:e},...t)},usePathname:function(){return a()},useRouter:m}}export{u as default};
1
+ import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r,{forwardRef as t}from"react";import{receiveSharedNavigationRoutingConfig as n}from"../shared/config.js";import o from"./ClientLink.js";import{clientRedirect as a,clientPermanentRedirect as i}from"./redirects.js";import l from"./useBasePathname.js";import f from"./useBaseRouter.js";function c(c){const u=n(c);function m(t,n){return r.createElement(o,e({ref:n,localePrefix:u.localePrefix},t))}const s=t(m);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 a({pathname:e,localePrefix:u.localePrefix},...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.localePrefix},...t)},usePathname:function(){return l(u.localePrefix)},useRouter:function(){return f(u.localePrefix)}}}export{c as default};
@@ -0,0 +1 @@
1
+ import r from"../../react-client/useLocale.js";import{baseRedirect as e,basePermanentRedirect as n}from"../shared/redirects.js";function t(e){return function(n){let t;try{t=r()}catch(r){throw new Error("`redirect()` and `permanentRedirect()` can only be called during render. To redirect in an event handler or similar, you can use `useRouter()` instead.")}for(var o=arguments.length,a=new Array(o>1?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];return e({...n,locale:t},...a)}}const o=t(e),a=t(n);export{a as clientPermanentRedirect,o as clientRedirect};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{usePathname as r}from"next/navigation";import{useMemo as t}from"react";import o from"../../react-client/useLocale.js";import{hasPathnamePrefixed as e,unlocalizePathname as i}from"../../shared/utils.js";function n(){const n=r(),a=o();return t((()=>{if(!n)return n;return e(a,n)?i(n,a):n}),[a,n])}export{n as default};
2
+ 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{localizeHref as n}from"../../shared/utils.js";import c from"../shared/syncLocaleCookie.js";import{getBasePath as s}from"../shared/utils.js";function a(){const a=t(),i=o(),p=e();return r((()=>{function t(t,e){let r=window.location.pathname;const o=s(p);return o&&(r=r.replace(o,"")),n(t,e||i,i,r)}function e(e){return function(r,o){const{locale:n,...s}=o||{};c(p,i,n);const a=[t(r,n)];return Object.keys(s).length>0&&a.push(s),e(...a)}}return{...a,push:e(a.push),replace:e(a.replace),prefetch:e(a.prefetch)}}),[i,p,a])}export{a 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){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 +1 @@
1
- import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import t from"../shared/BaseLink.js";import a from"../../server/react-server/getLocale.js";async function l(l){let{locale:o,...s}=l;return r.createElement(t,e({locale:o||await a()},s))}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 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 +1 @@
1
- import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{getRequestLocale as t}from"../../server/react-server/RequestLocale.js";import{compileLocalizedPathname as o,normalizeNameOrNameWithParams as n}from"../shared/utils.js";import a from"./ServerLink.js";import l from"./serverPermanentRedirect.js";import c from"./serverRedirect.js";function s(s){let{localePrefix:i,locales:m,pathnames:u}=s;function f(e){let{href:r,locale:t}=e;return o({...n(r),locale:t,pathnames:u})}function p(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(n){let{href:l,locale:c,...s}=n;const m=t(),f=c||m;return r.createElement(a,e({href:o({locale:f,pathname:l,params:"object"==typeof l?l.params:void 0,pathnames:u}),locale:c,localePrefix:i},s))},redirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return c({localePrefix:i,pathname:r},...n)},permanentRedirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return l({localePrefix:i,pathname:r},...n)},getPathname:f,usePathname:p("usePathname"),useRouter:p("useRouter")}}export{s as default};
1
+ import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{getRequestLocale as t}from"../../server/react-server/RequestLocale.js";import{receiveLocalizedNavigationRoutingConfig as o}from"../shared/config.js";import{compileLocalizedPathname as n,normalizeNameOrNameWithParams as a}from"../shared/utils.js";import l from"./ServerLink.js";import{serverRedirect as c,serverPermanentRedirect as s}from"./redirects.js";function i(i){const m=o(i);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(o){let{href:a,locale:c,...s}=o;const i=t(),f=c||i;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},s))},redirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return c({localePrefix:m.localePrefix,pathname:r},...n)},permanentRedirect:function(e){const r=f({href:e,locale:t()});for(var o=arguments.length,n=new Array(o>1?o-1:0),a=1;a<o;a++)n[a-1]=arguments[a];return s({localePrefix:m.localePrefix,pathname:r},...n)},getPathname:f,usePathname:u("usePathname"),useRouter:u("useRouter")}}export{i as default};
@@ -1 +1 @@
1
- import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import t from"./ServerLink.js";import n from"./serverPermanentRedirect.js";import o from"./serverRedirect.js";function a(a){function i(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(n){return r.createElement(t,e({localePrefix:null==a?void 0:a.localePrefix},n))},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({...a,pathname:e},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];return n({...a,pathname:e},...t)},usePathname:i("usePathname"),useRouter:i("useRouter")}}export{a as default};
1
+ import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"react";import{receiveSharedNavigationRoutingConfig as t}from"../shared/config.js";import o from"./ServerLink.js";import{serverRedirect as n,serverPermanentRedirect as a}from"./redirects.js";function i(i){const u=t(i);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(o,e({localePrefix:u.localePrefix},t))},redirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];return n({pathname:e,localePrefix:u.localePrefix},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];return a({pathname:e,localePrefix:u.localePrefix},...t)},usePathname:c("usePathname"),useRouter:c("useRouter")}}export{i as default};
@@ -0,0 +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,2 +1,2 @@
1
1
  'use client';
2
- import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"next/link";import{usePathname as o}from"next/navigation";import t,{forwardRef as n,useState as i,useEffect as l}from"react";import c from"../../react-client/useLocale.js";import{isLocalHref as a,prefixHref as p,localizeHref as s}from"../../shared/utils.js";import f from"./syncLocaleCookie.js";function m(n,m){let{href:h,locale:u,localePrefix:d,onClick:k,prefetch:v,...x}=n;const L=o(),g=c(),j=u!==g,[C,y]=i((()=>a(h)&&("never"!==d||j)?p(h,u):h));return l((()=>{L&&y(s(h,u,g,L))}),[g,h,u,L]),j&&(v&&console.error("The `prefetch` prop is currently not supported when using the `locale` prop on `Link` to switch the locale.`"),v=!1),t.createElement(r,e({ref:m,href:C,hrefLang:j?u:void 0,onClick:function(e){f(L,g,u),k&&k(e)},prefetch:v},x))}const h=n(m);h.displayName="ClientLink";var u=h;export{u as default};
2
+ import{extends as e}from"../../_virtual/_rollupPluginBabelHelpers.js";import r from"next/link";import{usePathname as o}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 a,prefixHref as p,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:v,...L}=n;const g=o(),j=c(),C=u!==j,[y,w]=i((()=>a(h)&&("never"!==d||C)?p(h,v):h));return l((()=>{g&&w(s(h,u,j,g,v))}),[j,h,u,g,v]),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(r,e({ref:m,href:y,hrefLang:C?u:void 0,onClick:function(e){f(g,j,u),k&&k(e)},prefetch:x},L))}const h=n(m);h.displayName="ClientLink";var u=h;export{u as default};
@@ -0,0 +1 @@
1
+ import{receiveLocalePrefixConfig as o}from"../../routing/config.js";function l(l){return{...l,localePrefix:o(null==l?void 0:l.localePrefix)}}function r(l){return{...l,localePrefix:o(null==l?void 0:l.localePrefix)}}export{r as receiveLocalizedNavigationRoutingConfig,l as receiveSharedNavigationRoutingConfig};
@@ -0,0 +1 @@
1
+ import{redirect as e,permanentRedirect as n}from"next/navigation";import{getLocalePrefix as r,isLocalHref as t,prefixPathname as o}from"../../shared/utils.js";function a(e){return function(n){const a=r(n.locale,n.localePrefix),i="never"!==n.localePrefix.mode&&t(n.pathname)?o(a,n.pathname):n.pathname;for(var l=arguments.length,m=new Array(l>1?l-1:0),c=1;c<l;c++)m[c-1]=arguments[c];return e(i,...m)}}const i=a(e),l=a(n);export{l as basePermanentRedirect,i as baseRedirect};
@@ -1 +1 @@
1
- import{unlocalizePathname as t,matchesPathname as n}from"../../shared/utils.js";function e(t){return"string"==typeof t?{pathname:t}:t}function r(t){function n(t){return String(t)}const e=new URLSearchParams;for(const[r,a]of Object.entries(t))Array.isArray(a)?a.forEach((t=>{e.append(r,n(t))})):e.set(r,n(a));return"?"+e.toString()}function a(t){let{pathname:n,locale:e,params:a,pathnames:o,query:i}=t;function c(t){let n=o[t];return n||(n=t),n}function s(t){const n="string"==typeof t?t:t[e];let o=n;if(a&&Object.entries(a).forEach((t=>{let[n,e]=t;o=Array.isArray(e)?o.replace(new RegExp("(\\[)?\\[...".concat(n,"\\](\\])?"),"g"),e.map((t=>String(t))).join("/")):o.replace("[".concat(n,"]"),String(e))})),o.includes("["))throw new Error("Insufficient params provided for localized pathname.\nTemplate: ".concat(n,"\nParams: ").concat(JSON.stringify(a)));return i&&(o+=r(i)),o}if("string"==typeof n){return s(c(n))}{const{pathname:t,...e}=n;return{...e,pathname:s(c(t))}}}function o(e){var r;let{locale:a,pathname:o,pathnames:i}=e;const c=t(decodeURI(o),a);let s=null===(r=Object.entries(i).find((t=>{let[,e]=t;const r="string"!=typeof e?e[a]:e;return n(r,c)})))||void 0===r?void 0:r[0];return s||(s=o),s}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,o as getRoute,e as normalizeNameOrNameWithParams,r as serializeSearchParams};
1
+ import{matchesPathname as t}from"../../shared/utils.js";function n(t){return"string"==typeof t?{pathname:t}:t}function e(t){function n(t){return String(t)}const e=new URLSearchParams;for(const[r,a]of Object.entries(t))Array.isArray(a)?a.forEach((t=>{e.append(r,n(t))})):e.set(r,n(a));return"?"+e.toString()}function r(t){let{pathname:n,locale:r,params:a,pathnames:o,query:i}=t;function c(t){let n=o[t];return n||(n=t),n}function s(t){const n="string"==typeof t?t:t[r];let o=n;if(a&&Object.entries(a).forEach((t=>{let[n,e]=t;o=Array.isArray(e)?o.replace(new RegExp("(\\[)?\\[...".concat(n,"\\](\\])?"),"g"),e.map((t=>String(t))).join("/")):o.replace("[".concat(n,"]"),String(e))})),o.includes("["))throw new Error("Insufficient params provided for localized pathname.\nTemplate: ".concat(n,"\nParams: ").concat(JSON.stringify(a)));return i&&(o+=e(i)),o}if("string"==typeof n){return s(c(n))}{const{pathname:t,...e}=n;return{...e,pathname:s(c(t))}}}function a(n){var e;let{locale:r,pathname:a,pathnames:o}=n;const i=decodeURI(a);let c=null===(e=Object.entries(o).find((n=>{let[,e]=n;const a="string"!=typeof e?e[r]:e;return t(a,i)})))||void 0===e?void 0:e[0];return c||(c=a),c}function o(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.location.pathname;return"/"===t?n:n.replace(t,"")}export{r as compileLocalizedPathname,o as getBasePath,a as getRoute,n as normalizeNameOrNameWithParams,e as serializeSearchParams};
@@ -0,0 +1 @@
1
+ function e(e){return"object"==typeof e?e:{mode:e||"always"}}export{e as receiveLocalePrefixConfig};
@@ -0,0 +1 @@
1
+
@@ -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-server-components#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 s(e){i().locale=e}function a(){return i().locale||r()}export{a as getRequestLocale,s as setRequestLocale};
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 +1 @@
1
- function t(t){const n="object"==typeof t?t.pathname:t;return null!=n&&!n.startsWith("/")}function n(t){if("object"==typeof t)return null==t.host&&null==t.hostname;return!/^[a-z]+:/i.test(t)}function e(e,c){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c,a=arguments.length>3?arguments[3]:void 0;if(!n(e)||t(e))return e;const l=c!==o,i=null==c||u(c,a);return(l||i)&&null!=c?r(e,c):e}function r(t,n){let e;return"string"==typeof t?e=o(n,t):(e={...t},t.pathname&&(e.pathname=o(n,t.pathname))),e}function c(t,n){return t.replace(new RegExp("^/".concat(n)),"")||"/"}function o(t,n){let e="/"+t;return/^\/(\?.*)?$/.test(n)&&(n=n.slice(1)),e+=n,e}function u(t,n){const e="/".concat(t);return n===e||n.startsWith("".concat(e,"/"))}function a(t,n){return l(t).test(n)}function l(t){const n=t.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(n,"$"))}export{u as hasPathnamePrefixed,n as isLocalHref,t as isRelativeHref,e as localizeHref,a as matchesPathname,r as prefixHref,o as prefixPathname,l as templateToRegex,c as unlocalizePathname};
1
+ function t(t){const n="object"==typeof t?t.pathname:t;return null!=n&&!n.startsWith("/")}function n(t){if("object"==typeof t)return null==t.host&&null==t.hostname;return!/^[a-z]+:/i.test(t)}function e(e){return n(e)&&!t(e)}function r(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n,u=arguments.length>3?arguments[3]:void 0,c=arguments.length>4?arguments[4]:void 0;if(!e(t))return t;const l=n!==r,a=i(c,u);return(l||a)&&null!=c?o(t,c):t}function o(t,n){let e;return"string"==typeof t?e=c(n,t):(e={...t},t.pathname&&(e.pathname=c(n,t.pathname))),e}function u(t,n){return t.replace(new RegExp("^".concat(n)),"")||"/"}function c(t,n){let e=t;return/^\/(\?.*)?$/.test(n)&&(n=n.slice(1)),e+=n,e}function i(t,n){return n===t||n.startsWith("".concat(t,"/"))}function l(t,n){return f(t).test(n)}function a(t,n){var e;return"never"!==n.mode&&(null===(e=n.prefixes)||void 0===e?void 0:e[t])||"/"+t}function f(t){const n=t.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(n,"$"))}export{a as getLocalePrefix,i as hasPathnamePrefixed,n as isLocalHref,e as isLocalizableHref,t as isRelativeHref,r as localizeHref,l as matchesPathname,o as prefixHref,c as prefixPathname,f as templateToRegex,u as unprefixPathname};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(){throw new Error("Couldn't find next-intl config file. Please follow the instructions at https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components")};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(){throw new Error("Couldn't find next-intl config file. Please follow the instructions at https://next-intl-docs.vercel.app/docs/getting-started/app-router")};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../routing/config.js");exports.receiveConfig=function(l){var i,o;return{...l,alternateLinks:null===(i=null==l?void 0:l.alternateLinks)||void 0===i||i,localeDetection:null===(o=null==l?void 0:l.localeDetection)||void 0===o||o,localePrefix:e.receiveLocalePrefixConfig(null==l?void 0:l.localePrefix)}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils.js");exports.default=function(a){var t;let{config:o,localizedPathnames:n,request:l,resolvedLocale:r}=a;const c=l.nextUrl.clone(),s=e.getHost(l.headers);function p(a,t){return l.nextUrl.basePath&&((a=new URL(a)).pathname=e.applyBasePath(a.pathname,l.nextUrl.basePath)),"<".concat(a.toString(),'>; rel="alternate"; hreflang="').concat(t,'"')}function i(a,t){return n&&"object"==typeof n?e.formatTemplatePathname(a,n[r],n[t]):a}s&&(c.port="",c.host=s),c.protocol=null!==(t=l.headers.get("x-forwarded-proto"))&&void 0!==t?t:c.protocol,c.pathname=e.getNormalizedPathname(c.pathname,o.locales);const h=o.locales.flatMap((a=>{function t(e){return"/"===e?"/".concat(a):"/".concat(a).concat(e)}let l;if(o.domains){return(o.domains.filter((t=>e.isLocaleSupportedOnDomain(a,t)))||[]).map((e=>(l=new URL(c),l.port="",l.host=e.domain,l.pathname=i(c.pathname,a),a===e.defaultLocale&&"always"!==o.localePrefix||(l.pathname=t(l.pathname)),p(l,a))))}{let e;e=n&&"object"==typeof n?i(c.pathname,a):c.pathname,a===o.defaultLocale&&"always"!==o.localePrefix||(e=t(e)),l=new URL(e,c)}return p(l,a)}));if(!o.domains&&("always"!==o.localePrefix||"/"===c.pathname)){const e=new URL(i(c.pathname,o.defaultLocale),c);h.push(p(e,"x-default"))}return h.join(", ")};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./utils.js");exports.default=function(a){var t;let{config:o,localizedPathnames:n,request:l,resolvedLocale:r}=a;const c=l.nextUrl.clone(),s=e.getHost(l.headers);function p(a,t){return l.nextUrl.basePath&&((a=new URL(a)).pathname=e.applyBasePath(a.pathname,l.nextUrl.basePath)),"<".concat(a.toString(),'>; rel="alternate"; hreflang="').concat(t,'"')}function i(a,t){return n&&"object"==typeof n?e.formatTemplatePathname(a,n[r],n[t]):a}s&&(c.port="",c.host=s),c.protocol=null!==(t=l.headers.get("x-forwarded-proto"))&&void 0!==t?t:c.protocol,c.pathname=e.getNormalizedPathname(c.pathname,o.locales,o.localePrefix);const m=e.getLocalePrefixes(o.locales,o.localePrefix).flatMap((a=>{let t,[l,r]=a;function s(e){return"/"===e?r:r+e}if(o.domains){return(o.domains.filter((a=>e.isLocaleSupportedOnDomain(l,a)))||[]).map((e=>(t=new URL(c),t.port="",t.host=e.domain,t.pathname=i(c.pathname,l),l===e.defaultLocale&&"always"!==o.localePrefix.mode||(t.pathname=s(t.pathname)),p(t,l))))}{let e;e=n&&"object"==typeof n?i(c.pathname,l):c.pathname,l===o.defaultLocale&&"always"!==o.localePrefix.mode||(e=s(e)),t=new URL(e,c)}return p(t,l)}));if(!o.domains&&("always"!==o.localePrefix.mode||"/"===c.pathname)){const e=new URL(i(c.pathname,o.defaultLocale),c);m.push(p(e,"x-default"))}return m.join(", ")};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../shared/constants.js"),t=require("../shared/utils.js"),n=require("./getAlternateLinksHeaderValue.js"),l=require("./resolveLocale.js"),o=require("./utils.js");exports.default=function(r){const s=function(e){var a,t,n;return{...e,alternateLinks:null===(a=e.alternateLinks)||void 0===a||a,localePrefix:null!==(t=e.localePrefix)&&void 0!==t?t:"always",localeDetection:null===(n=e.localeDetection)||void 0===n||n}}(r);return function(r){var i,c;const d=decodeURI(r.nextUrl.pathname),{domain:h,locale:u}=l.default(s,r.headers,r.cookies,d),f=s.localeDetection&&(null===(i=r.cookies.get(a.COOKIE_LOCALE_NAME))||void 0===i?void 0:i.value)!==u,m=h?h.defaultLocale===u:u===s.defaultLocale,p=(null===(c=s.domains)||void 0===c?void 0:c.filter((e=>o.isLocaleSupportedOnDomain(u,e))))||[],v=null!=s.domains&&!h;function x(t){const n=new URL(t,r.url);return r.nextUrl.basePath&&(n.pathname=o.applyBasePath(n.pathname,r.nextUrl.basePath)),e.NextResponse.rewrite(n,function(){const e=new Headers(r.headers);return e.set(a.HEADER_LOCALE_NAME,u),{request:{headers:e}}}())}function P(a,t){const n=new URL(a,r.url);if(p.length>0&&!t){const e=o.getBestMatchingDomain(h,u,p);e&&(t=e.domain,e.defaultLocale===u&&"as-needed"===s.localePrefix&&n.pathname.startsWith("/".concat(u))&&(n.pathname=o.getNormalizedPathname(n.pathname,s.locales)))}var l,i;t&&(n.host=t,r.headers.get("x-forwarded-host")&&(n.protocol=null!==(l=r.headers.get("x-forwarded-proto"))&&void 0!==l?l:r.nextUrl.protocol,n.port=null!==(i=r.headers.get("x-forwarded-port"))&&void 0!==i?i:""));return r.nextUrl.basePath&&(n.pathname=o.applyBasePath(n.pathname,r.nextUrl.basePath)),e.NextResponse.redirect(n.toString())}const g=o.getNormalizedPathname(d,s.locales),L=o.getPathnameLocale(d,s.locales),E=null!=L;let U,O,A=d;if(s.pathnames){let e;if([e,O]=o.getInternalTemplate(s.pathnames,g,u),O){const a=s.pathnames[O],n="string"==typeof a?a:a[u];if(t.matchesPathname(n,g))A=o.formatTemplatePathname(g,n,O,L);else{let t;t=e?"string"==typeof a?a:a[e]:O;const l=!E&&m||"never"===s.localePrefix?void 0:u;U=P(o.getPathWithSearch(o.formatTemplatePathname(g,t,n,l),r.nextUrl.search))}}}if(!U)if("/"===A){const e=o.getPathWithSearch("/".concat(u),r.nextUrl.search);U="never"===s.localePrefix||m&&"as-needed"===s.localePrefix?x(e):P(e)}else{const e=o.getPathWithSearch(A,r.nextUrl.search);if(E){const a=o.getPathWithSearch(g,r.nextUrl.search);if("never"===s.localePrefix)U=P(a);else if(L===u)if(m&&"as-needed"===s.localePrefix)U=P(a);else if(s.domains){const t=o.getBestMatchingDomain(h,L,p);U=(null==h?void 0:h.domain)===(null==t?void 0:t.domain)||v?x(e):P(a,null==t?void 0:t.domain)}else U=x(e);else U=P("/".concat(u).concat(a))}else U="never"===s.localePrefix||m&&("as-needed"===s.localePrefix||s.domains)?x("/".concat(u).concat(e)):P("/".concat(u).concat(e))}var _;(f&&U.cookies.set(a.COOKIE_LOCALE_NAME,u,{path:r.nextUrl.basePath||void 0,sameSite:a.COOKIE_SAME_SITE,maxAge:a.COOKIE_MAX_AGE}),"never"!==s.localePrefix&&s.alternateLinks&&s.locales.length>1)&&U.headers.set("Link",n.default({config:s,localizedPathnames:null!=O?null===(_=s.pathnames)||void 0===_?void 0:_[O]:void 0,request:r,resolvedLocale:u}));return U}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/server"),a=require("../shared/constants.js"),t=require("../shared/utils.js"),r=require("./config.js"),l=require("./getAlternateLinksHeaderValue.js"),o=require("./resolveLocale.js"),n=require("./syncCookie.js"),s=require("./utils.js");exports.default=function(i){const c=r.receiveConfig(i);return function(r){var i;const d=decodeURI(r.nextUrl.pathname),{domain:f,locale:m}=o.default(c,r.headers,r.cookies,d),h=f?f.defaultLocale===m:m===c.defaultLocale,u=(null===(i=c.domains)||void 0===i?void 0:i.filter((e=>s.isLocaleSupportedOnDomain(m,e))))||[],x=null!=c.domains&&!f;function P(t){const l=new URL(t,r.url);r.nextUrl.basePath&&(l.pathname=s.applyBasePath(l.pathname,r.nextUrl.basePath));const o=new Headers(r.headers);return o.set(a.HEADER_LOCALE_NAME,m),e.NextResponse.rewrite(l,{request:{headers:o}})}function p(a,t){const l=new URL(s.normalizeTrailingSlash(a),r.url);if(u.length>0&&!t){const e=s.getBestMatchingDomain(f,m,u);e&&(t=e.domain,e.defaultLocale===m&&"as-needed"===c.localePrefix.mode&&(l.pathname=s.getNormalizedPathname(l.pathname,c.locales,c.localePrefix)))}var o,n;t&&(l.host=t,r.headers.get("x-forwarded-host")&&(l.protocol=null!==(o=r.headers.get("x-forwarded-proto"))&&void 0!==o?o:r.nextUrl.protocol,l.port=null!==(n=r.headers.get("x-forwarded-port"))&&void 0!==n?n:""));return r.nextUrl.basePath&&(l.pathname=s.applyBasePath(l.pathname,r.nextUrl.basePath)),e.NextResponse.redirect(l.toString())}const g=s.getNormalizedPathname(d,c.locales,c.localePrefix),v=s.getPathnameMatch(d,c.locales,c.localePrefix),L=null!=v,U="never"===c.localePrefix.mode||h&&"as-needed"===c.localePrefix.mode;let q,j,w=g;if(c.pathnames){let e;if([e,j]=s.getInternalTemplate(c.pathnames,g,m),j){const a=c.pathnames[j],l="string"==typeof a?a:a[m];if(t.matchesPathname(l,g))w=s.formatTemplatePathname(g,l,j);else{let o;o=e?"string"==typeof a?a:a[e]:j;const n=U?void 0:t.getLocalePrefix(m,c.localePrefix),i=s.formatTemplatePathname(g,o,l);q=p(s.formatPathname(i,n,r.nextUrl.search))}}}if(!q)if("/"!==w||L){const e=s.formatPathname(w,s.getLocaleAsPrefix(m),r.nextUrl.search);if(L){const a=s.formatPathname(g,v.prefix,r.nextUrl.search);if("never"===c.localePrefix.mode)q=p(s.formatPathname(g,void 0,r.nextUrl.search));else if(v.exact)if(h&&U)q=p(s.formatPathname(g,void 0,r.nextUrl.search));else if(c.domains){const t=s.getBestMatchingDomain(f,v.locale,u);q=(null==f?void 0:f.domain)===(null==t?void 0:t.domain)||x?P(e):p(a,null==t?void 0:t.domain)}else q=P(e);else q=p(a)}else q=U?P(e):p(s.formatPathname(g,t.getLocalePrefix(m,c.localePrefix),r.nextUrl.search))}else q=U?P(s.formatPathname(w,s.getLocaleAsPrefix(m),r.nextUrl.search)):p(s.formatPathname(g,t.getLocalePrefix(m,c.localePrefix),r.nextUrl.search));var y;(c.localeDetection&&n.default(r,q,m),"never"!==c.localePrefix.mode&&c.alternateLinks&&c.locales.length>1)&&q.headers.set("Link",l.default({config:c,localizedPathnames:null!=j?null===(y=c.pathnames)||void 0===y?void 0:y[j]:void 0,request:r,resolvedLocale:m}));return q}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),t=require("negotiator"),n=require("../shared/constants.js"),o=require("./utils.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=a(t);function c(t,n,o){let a;const c=new l.default({headers:{"accept-language":t.get("accept-language")||void 0}}).languages();try{a=e.match(c,n,o)}catch(e){}return a}function i(e,t){const n=o.getFirstPathnameSegment(e);return o.findCaseInsensitiveLocale(n,t)}function r(e,t){if(e.has(n.COOKIE_LOCALE_NAME)){var o;const a=null===(o=e.get(n.COOKIE_LOCALE_NAME))||void 0===o?void 0:o.value;if(a&&t.includes(a))return a}}function u(e,t,n,o){let a,{defaultLocale:l,localeDetection:u,locales:s}=e;return o&&(a=i(o,s)),!a&&u&&n&&(a=r(n,s)),!a&&u&&t&&(a=c(t,s,l)),a||(a=l),a}function s(e,t,n,a){const l=function(e,t){var n;let a=o.getHost(e);if(a=null===(n=a)||void 0===n?void 0:n.replace(/:\d+$/,""),a&&t)return t.find((e=>e.domain===a))}(t,e.domains);if(!l)return{locale:u(e,t,n,a)};let s;if(a){const t=i(a,e.locales);if(t){if(!o.isLocaleSupportedOnDomain(t,l))return{locale:t,domain:l};s=t}}if(!s&&e.localeDetection&&n){const t=r(n,e.locales);t&&o.isLocaleSupportedOnDomain(t,l)&&(s=t)}if(!s&&e.localeDetection&&t){const n=c(t,l.locales||e.locales,l.defaultLocale);n&&(s=n)}return s||(s=l.defaultLocale),{locale:s,domain:l}}exports.default=function(e,t,n,o){return e.domains?s(e,t,n,o):{locale:u(e,t,n,o)}},exports.getAcceptLanguageLocale=c;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@formatjs/intl-localematcher"),t=require("negotiator"),a=require("../shared/constants.js"),l=require("./utils.js");function o(e){return e&&e.__esModule?e:{default:e}}var n=o(t);function c(t,a,l){let o;const c=new n.default({headers:{"accept-language":t.get("accept-language")||void 0}}).languages();try{o=e.match(c,a,l)}catch(e){}return o}function i(e,t){if(e.has(a.COOKIE_LOCALE_NAME)){var l;const o=null===(l=e.get(a.COOKIE_LOCALE_NAME))||void 0===l?void 0:l.value;if(o&&t.includes(o))return o}}function r(e,t,a,o){let n,{defaultLocale:r,localeDetection:u,localePrefix:s,locales:d}=e;var f;o&&(n=null===(f=l.getPathnameMatch(o,d,s))||void 0===f?void 0:f.locale);return!n&&u&&a&&(n=i(a,d)),!n&&u&&t&&(n=c(t,d,r)),n||(n=r),n}function u(e,t,a,o){const n=function(e,t){var a;let o=l.getHost(e);if(o=null===(a=o)||void 0===a?void 0:a.replace(/:\d+$/,""),o&&t)return t.find((e=>e.domain===o))}(t,e.domains);if(!n)return{locale:r(e,t,a,o)};let u;if(o){var s;const t=null===(s=l.getPathnameMatch(o,e.locales,e.localePrefix))||void 0===s?void 0:s.locale;if(t){if(!l.isLocaleSupportedOnDomain(t,n))return{locale:t,domain:n};u=t}}if(!u&&e.localeDetection&&a){const t=i(a,e.locales);t&&l.isLocaleSupportedOnDomain(t,n)&&(u=t)}if(!u&&e.localeDetection&&t){const a=c(t,n.locales||e.locales,n.defaultLocale);a&&(u=a)}return u||(u=n.defaultLocale),{locale:u,domain:n}}exports.default=function(e,t,a,l){return e.domains?u(e,t,a,l):{locale:r(e,t,a,l)}},exports.getAcceptLanguageLocale=c;
@@ -0,0 +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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js");function t(e){return e.split("/")[1]}function n(e){return e.includes("[[...")}function r(e){return e.includes("[...")}function o(e){return e.includes("[")}function i(e,t){const i=e.split("/"),s=t.split("/"),c=Math.max(i.length,s.length);for(let e=0;e<c;e++){const t=i[e],c=s[e];if(!t&&c)return-1;if(t&&!c)return 1;if(!o(t)&&o(c))return-1;if(o(t)&&!o(c))return 1;if(!r(t)&&r(c))return-1;if(r(t)&&!r(c))return 1;if(!n(t)&&n(c))return-1;if(n(t)&&!n(c))return 1}return 0}function s(e){return e.sort(i)}function c(e,t){return t.find((t=>t.toLowerCase()===e.toLowerCase()))}function a(t,n){const r=e.templateToRegex(t).exec(n);if(!r)return;const o={};for(let e=1;e<r.length;e++){var i;const n=null===(i=t.match(/\[([^\]]+)\]/g))||void 0===i?void 0:i[e-1].replace(/[[\]]/g,"");n&&(o[n]=r[e])}return o}function u(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((e=>{let[t,r]=e;n=n.replace("[".concat(t,"]"),r)})),n}function l(e,t){return t.defaultLocale===e||!t.locales||t.locales.includes(e)}function f(e){return e.endsWith("/")&&(e=e.slice(0,-1)),e}exports.applyBasePath=function(e,t){return f(t+e)},exports.comparePathnamePairs=i,exports.findCaseInsensitiveLocale=c,exports.formatPathname=u,exports.formatTemplatePathname=function(e,t,n,r){const o=a(t,e);let i="";return r&&(i="/".concat(r)),i+=u(n,o),i=f(i),i},exports.getBestMatchingDomain=function(e,t,n){let r;return e&&l(t,e)&&(r=e),r||(r=n.find((e=>e.defaultLocale===t))),r||(r=n.find((e=>null!=e.locales&&e.locales.includes(t)))),r||null!=(null==e?void 0:e.locales)||(r=e),r||(r=n.find((e=>!e.locales))),r},exports.getFirstPathnameSegment=t,exports.getHost=function(e){var t,n;return null!==(t=null!==(n=e.get("x-forwarded-host"))&&void 0!==n?n:e.get("host"))&&void 0!==t?t:void 0},exports.getInternalTemplate=function(t,n,r){const o=s(Object.keys(t));for(const i of o){const o=t[i];if("string"==typeof o){const t=o;if(e.matchesPathname(t,n))return[void 0,i]}else{const t=Object.entries(o),s=t.findIndex((e=>{let[t]=e;return t===r}));s>0&&t.unshift(t.splice(s,1)[0]);for(const[r,o]of t)if(e.matchesPathname(o,n))return[r,i]}}for(const r of Object.keys(t))if(e.matchesPathname(r,n))return[void 0,r];return[void 0,void 0]},exports.getNormalizedPathname=function(e,t){e.endsWith("/")||(e+="/");const n=e.match(new RegExp("^/(".concat(t.join("|"),")/(.*)"),"i"));let r=n?"/"+n[2]:e;return"/"!==r&&(r=f(r)),r},exports.getPathWithSearch=function(e,t){let n=e;return t&&(n+=t),n},exports.getPathnameLocale=function(e,n){const r=t(e);return c(r,n)?r:void 0},exports.getRouteParams=a,exports.getSortedPathnames=s,exports.isLocaleSupportedOnDomain=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../shared/utils.js");function t(e){return e.includes("[[...")}function n(e){return e.includes("[...")}function r(e){return e.includes("[")}function o(e,o){const a=e.split("/"),c=o.split("/"),i=Math.max(a.length,c.length);for(let e=0;e<i;e++){const o=a[e],i=c[e];if(!o&&i)return-1;if(o&&!i)return 1;if(!r(o)&&r(i))return-1;if(r(o)&&!r(i))return 1;if(!n(o)&&n(i))return-1;if(n(o)&&!n(i))return 1;if(!t(o)&&t(i))return-1;if(t(o)&&!t(i))return 1}return 0}function a(e){return e.sort(o)}function c(t,n){return t.map((t=>[t,e.getLocalePrefix(t,n)]))}function i(t,n){const r=e.templateToRegex(t).exec(n);if(!r)return;const o={};for(let e=1;e<r.length;e++){var a;const n=null===(a=t.match(/\[([^\]]+)\]/g))||void 0===a?void 0:a[e-1].replace(/[[\]]/g,"");n&&(o[n]=r[e])}return o}function s(e,t){if(!t)return e;let n=e=e.replace(/\[\[/g,"[").replace(/\]\]/g,"]");return Object.entries(t).forEach((e=>{let[t,r]=e;n=n.replace("[".concat(t,"]"),r)})),n}function l(e,t){return t.defaultLocale===e||!t.locales||t.locales.includes(e)}function u(e){return"/"!==e&&e.endsWith("/")&&(e=e.slice(0,-1)),e}exports.applyBasePath=function(e,t){return u(t+e)},exports.comparePathnamePairs=o,exports.formatPathname=function(t,n,r){let o=t;return n&&(o=e.prefixPathname(n,o)),r&&(o+=r),o},exports.formatPathnameTemplate=s,exports.formatTemplatePathname=function(e,t,n,r){const o=i(t,e);let a="";return r&&(a="/".concat(r)),a+=s(n,o),a=u(a),a},exports.getBestMatchingDomain=function(e,t,n){let r;return e&&l(t,e)&&(r=e),r||(r=n.find((e=>e.defaultLocale===t))),r||(r=n.find((e=>null!=e.locales&&e.locales.includes(t)))),r||null!=(null==e?void 0:e.locales)||(r=e),r||(r=n.find((e=>!e.locales))),r},exports.getHost=function(e){var t,n;return null!==(t=null!==(n=e.get("x-forwarded-host"))&&void 0!==n?n:e.get("host"))&&void 0!==t?t:void 0},exports.getInternalTemplate=function(t,n,r){const o=a(Object.keys(t));for(const a of o){const o=t[a];if("string"==typeof o){const t=o;if(e.matchesPathname(t,n))return[void 0,a]}else{const t=Object.entries(o),c=t.findIndex((e=>{let[t]=e;return t===r}));c>0&&t.unshift(t.splice(c,1)[0]);for(const[r,o]of t)if(e.matchesPathname(o,n))return[r,a]}}for(const r of Object.keys(t))if(e.matchesPathname(r,n))return[void 0,r];return[void 0,void 0]},exports.getLocaleAsPrefix=function(e){return"/".concat(e)},exports.getLocalePrefixes=c,exports.getNormalizedPathname=function(e,t,n){e.endsWith("/")||(e+="/");const r=c(t,n),o=new RegExp("^(".concat(r.map((e=>{let[,t]=e;return t.replaceAll("/","\\/")})).join("|"),")/(.*)"),"i"),a=e.match(o);let i=a?"/"+a[2]:e;return"/"!==i&&(i=u(i)),i},exports.getPathnameMatch=function(e,t,n){const r=c(t,n);for(const[t,n]of r){let r,o;if(e===n||e.startsWith(n+"/"))r=o=!0;else{const t=e.toLowerCase(),a=n.toLowerCase();(t===a||t.startsWith(a+"/"))&&(r=!1,o=!0)}if(o)return{locale:t,prefix:n,matchedPrefix:e.slice(0,n.length),exact:r}}},exports.getRouteParams=i,exports.getSortedPathnames=a,exports.isLocaleSupportedOnDomain=l,exports.normalizeTrailingSlash=u;
@@ -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"),l=require("../shared/BaseLink.js");function a(e){return e&&e.__esModule?e:{default:e}}var u=a(r);function s(r,a){let{locale:s,...n}=r;const i=t.default(),o=s||i;return u.default.createElement(l.default,e.extends({ref:a,locale:o},n))}const n=r.forwardRef(s);n.displayName="ClientLink";var i=n;exports.default=i;
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";var c=o;exports.default=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),a=require("../../react-client/useLocale.js"),t=require("../shared/utils.js"),n=require("./ClientLink.js"),l=require("./clientPermanentRedirect.js"),o=require("./clientRedirect.js"),u=require("./useBasePathname.js"),c=require("./useBaseRouter.js");function i(e){return e&&e.__esModule?e:{default:e}}var s=i(r);exports.default=function(i){function f(){const e=a.default();if(!i.locales.includes(e))throw new Error(void 0);return e}function h(r,a){let{href:l,locale:o,...u}=r;const c=f(),h=o||c;return s.default.createElement(n.default,e.extends({ref:a,href:t.compileLocalizedPathname({locale:h,pathname:l,params:"object"==typeof l?l.params:void 0,pathnames:i.pathnames}),locale:o,localePrefix:i.localePrefix},u))}const d=r.forwardRef(h);function p(e){let{href:r,locale:a}=e;return t.compileLocalizedPathname({...t.normalizeNameOrNameWithParams(r),locale:a,pathnames:i.pathnames})}return d.displayName="Link",{Link:d,redirect:function(e){const r=p({href:e,locale:f()});for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];return o.default({...i,pathname:r},...t)},permanentRedirect:function(e){const r=p({href:e,locale:f()});for(var a=arguments.length,t=new Array(a>1?a-1:0),n=1;n<a;n++)t[n-1]=arguments[n];return l.default({...i,pathname:r},...t)},usePathname:function(){const e=u.default(),r=f();return e?t.getRoute({pathname:e,locale:r,pathnames:i.pathnames}):e},useRouter:function(){const e=c.default(),r=f();return{...e,push(a){for(var t,n=arguments.length,l=new Array(n>1?n-1:0),o=1;o<n;o++)l[o-1]=arguments[o];const u=p({href:a,locale:(null===(t=l[0])||void 0===t?void 0:t.locale)||r});return e.push(u,...l)},replace(a){for(var t,n=arguments.length,l=new Array(n>1?n-1:0),o=1;o<n;o++)l[o-1]=arguments[o];const u=p({href:a,locale:(null===(t=l[0])||void 0===t?void 0:t.locale)||r});return e.replace(u,...l)},prefetch(a){for(var t,n=arguments.length,l=new Array(n>1?n-1:0),o=1;o<n;o++)l[o-1]=arguments[o];const u=p({href:a,locale:(null===(t=l[0])||void 0===t?void 0:t.locale)||r});return e.prefetch(u,...l)}}},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"),t=require("../shared/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=t.receiveLocalizedNavigationRoutingConfig(u);function h(){const e=a.default();if(!f.locales.includes(e))throw new Error(void 0);return e}function d(r,a){let{href:t,locale:o,...c}=r;const i=h(),u=o||i;return s.default.createElement(n.default,e.extends({ref:a,href:l.compileLocalizedPathname({locale:u,pathname:t,params:"object"==typeof t?t.params:void 0,pathnames:f.pathnames}),locale:o,localePrefix:f.localePrefix},c))}const p=r.forwardRef(d);function m(e){let{href:r,locale:a}=e;return l.compileLocalizedPathname({...l.normalizeNameOrNameWithParams(r),locale:a,pathnames:f.pathnames})}return p.displayName="Link",{Link:p,redirect:function(e){const r=m({href:e,locale:h()});for(var a=arguments.length,t=new Array(a>1?a-1:0),l=1;l<a;l++)t[l-1]=arguments[l];return o.clientRedirect({pathname:r,localePrefix:f.localePrefix},...t)},permanentRedirect:function(e){const r=m({href:e,locale:h()});for(var a=arguments.length,t=new Array(a>1?a-1:0),l=1;l<a;l++)t[l-1]=arguments[l];return o.clientPermanentRedirect({pathname:r,localePrefix:f.localePrefix},...t)},usePathname:function(){const e=c.default(f.localePrefix),r=h();return e?l.getRoute({pathname:e,locale:r,pathnames:f.pathnames}):e},useRouter:function(){const e=i.default(f.localePrefix),r=h();return{...e,push(a){for(var t,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=m({href:a,locale:(null===(t=n[0])||void 0===t?void 0:t.locale)||r});return e.push(c,...n)},replace(a){for(var t,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=m({href:a,locale:(null===(t=n[0])||void 0===t?void 0:t.locale)||r});return e.replace(c,...n)},prefetch(a){for(var t,l=arguments.length,n=new Array(l>1?l-1:0),o=1;o<l;o++)n[o-1]=arguments[o];const c=m({href:a,locale:(null===(t=n[0])||void 0===t?void 0:t.locale)||r});return e.prefetch(c,...n)}}},getPathname:m}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("./ClientLink.js"),n=require("./clientPermanentRedirect.js"),u=require("./clientRedirect.js"),a=require("./useBasePathname.js"),i=require("./useBaseRouter.js");function l(e){return e&&e.__esModule?e:{default:e}}var f=l(r);exports.default=function(l){function s(r,n){return f.default.createElement(t.default,e.extends({ref:n,localePrefix:null==l?void 0:l.localePrefix},r))}const o=r.forwardRef(s);return o.displayName="Link",{Link:o,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.default({...l,pathname:e},...t)},permanentRedirect:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),u=1;u<r;u++)t[u-1]=arguments[u];return n.default({...l,pathname:e},...t)},usePathname:function(){return a.default()},useRouter:i.default}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../shared/config.js"),n=require("./ClientLink.js"),a=require("./redirects.js"),i=require("./useBasePathname.js"),u=require("./useBaseRouter.js");function l(e){return e&&e.__esModule?e:{default:e}}var o=l(r);exports.default=function(l){const c=t.receiveSharedNavigationRoutingConfig(l);function f(r,t){return o.default.createElement(n.default,e.extends({ref:t,localePrefix:c.localePrefix},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 a.clientRedirect({pathname:e,localePrefix:c.localePrefix},...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 a.clientPermanentRedirect({pathname:e,localePrefix:c.localePrefix},...t)},usePathname:function(){return i.default(c.localePrefix)},useRouter:function(){return u.default(c.localePrefix)}}};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../react-client/useLocale.js"),r=require("../shared/redirects.js");function t(r){return function(t){let c;try{c=e.default()}catch(e){throw e}for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];return r({...t,locale:c},...a)}}const c=t(r.baseRedirect),n=t(r.basePermanentRedirect);exports.clientPermanentRedirect=n,exports.clientRedirect=c;
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "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(){const u=e.usePathname(),n=t.default();return r.useMemo((()=>{if(!u)return u;return a.hasPathnamePrefixed(n,u)?a.unlocalizePathname(u,n):u}),[n,u])};
2
+ "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"),r=require("react"),t=require("../../react-client/useLocale.js"),u=require("../../shared/utils.js"),n=require("../shared/syncLocaleCookie.js"),s=require("../shared/utils.js");exports.default=function(){const a=e.useRouter(),c=t.default(),o=e.usePathname();return r.useMemo((()=>{function e(e,r){let t=window.location.pathname;const n=s.getBasePath(o);return n&&(t=t.replace(n,"")),u.localizeHref(e,r||c,c,t)}function r(r){return function(t,u){const{locale:s,...a}=u||{};n.default(o,c,s);const i=[e(t,s)];return Object.keys(a).length>0&&i.push(a),r(...i)}}return{...a,push:r(a.push),replace:r(a.replace),prefetch:r(a.prefetch)}}),[c,o,a])};
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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../shared/BaseLink.js"),a=require("../../server/react-server/getLocale.js");function l(e){return e&&e.__esModule?e:{default:e}}var u=l(r);exports.default=async function(r){let{locale:l,...s}=r;return u.default.createElement(t.default,e.extends({locale:l||await a.default()},s))};
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 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../server/react-server/RequestLocale.js"),a=require("../shared/utils.js"),n=require("./ServerLink.js"),o=require("./serverPermanentRedirect.js"),l=require("./serverRedirect.js");function u(e){return e&&e.__esModule?e:{default:e}}var c=u(r);exports.default=function(r){let{localePrefix:u,locales:s,pathnames:i}=r;function f(e){let{href:r,locale:t}=e;return a.compileLocalizedPathname({...a.normalizeNameOrNameWithParams(r),locale:t,pathnames:i})}function m(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:o,locale:l,...s}=r;const f=t.getRequestLocale(),m=l||f;return c.default.createElement(n.default,e.extends({href:a.compileLocalizedPathname({locale:m,pathname:o,params:"object"==typeof o?o.params:void 0,pathnames:i}),locale:l,localePrefix:u},s))},redirect:function(e){const r=f({href:e,locale:t.getRequestLocale()});for(var a=arguments.length,n=new Array(a>1?a-1:0),o=1;o<a;o++)n[o-1]=arguments[o];return l.default({localePrefix:u,pathname:r},...n)},permanentRedirect:function(e){const r=f({href:e,locale:t.getRequestLocale()});for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return o.default({localePrefix:u,pathname:r},...n)},getPathname:f,usePathname:m("usePathname"),useRouter:m("useRouter")}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../../server/react-server/RequestLocale.js"),a=require("../shared/config.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=a.receiveLocalizedNavigationRoutingConfig(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:a,locale:l,...u}=r;const s=t.getRequestLocale(),f=l||s;return i.default.createElement(o.default,e.extends({href:n.compileLocalizedPathname({locale:f,pathname:a,params:"object"==typeof a?a.params:void 0,pathnames:c.pathnames}),locale:l,localePrefix:c.localePrefix},u))},redirect:function(e){const r=u({href:e,locale:t.getRequestLocale()});for(var a=arguments.length,n=new Array(a>1?a-1:0),o=1;o<a;o++)n[o-1]=arguments[o];return l.serverRedirect({localePrefix:c.localePrefix,pathname:r},...n)},permanentRedirect:function(e){const r=u({href:e,locale:t.getRequestLocale()});for(var a=arguments.length,n=new Array(a>1?a-1:0),o=1;o<a;o++)n[o-1]=arguments[o];return l.serverPermanentRedirect({localePrefix:c.localePrefix,pathname:r},...n)},getPathname:u,usePathname:s("usePathname"),useRouter:s("useRouter")}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("./ServerLink.js"),n=require("./serverPermanentRedirect.js"),u=require("./serverRedirect.js");function o(e){return e&&e.__esModule?e:{default:e}}var a=o(r);exports.default=function(r){function o(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(n){return a.default.createElement(t.default,e.extends({localePrefix:null==r?void 0:r.localePrefix},n))},redirect:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return u.default({...r,pathname:e},...n)},permanentRedirect:function(e){for(var t=arguments.length,u=new Array(t>1?t-1:0),o=1;o<t;o++)u[o-1]=arguments[o];return n.default({...r,pathname:e},...u)},usePathname:o("usePathname"),useRouter:o("useRouter")}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),r=require("react"),t=require("../shared/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.receiveSharedNavigationRoutingConfig(r);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 u.default.createElement(n.default,e.extends({localePrefix:i.localePrefix},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.localePrefix},...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.localePrefix},...t)},usePathname:a("usePathname"),useRouter:a("useRouter")}};
@@ -0,0 +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,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"),a=require("../../react-client/useLocale.js"),i=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,localePrefix:d,onClick:p,prefetch:v,...h}=r;const q=t.usePathname(),x=a.default(),_=s!==x,[j,k]=l.useState((()=>i.isLocalHref(c)&&("never"!==d||_)?i.prefixHref(c,s):c));return l.useEffect((()=>{q&&k(i.localizeHref(c,s,x,q))}),[x,c,s,q]),_&&(v=!1),o.default.createElement(f.default,e.extends({ref:n,href:j,hrefLang:_?s:void 0,onClick:function(e){u.default(q,x,s),p&&p(e)},prefetch:v},h))}const s=l.forwardRef(c);s.displayName="ClientLink";var d=s;exports.default=d;
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"),a=require("../../react-client/useLocale.js"),i=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:v,prefix:x,...h}=r;const q=t.usePathname(),_=a.default(),j=s!==_,[k,L]=l.useState((()=>i.isLocalizableHref(c)&&("never"!==d||j)?i.prefixHref(c,x):c));return l.useEffect((()=>{q&&L(i.localizeHref(c,s,_,q,x))}),[_,c,s,q,x]),j&&(v=!1),o.default.createElement(f.default,e.extends({ref:n,href:k,hrefLang:j?s:void 0,onClick:function(e){u.default(q,_,s),p&&p(e)},prefetch:v},h))}const s=l.forwardRef(c);s.displayName="ClientLink";var d=s;exports.default=d;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../routing/config.js");exports.receiveLocalizedNavigationRoutingConfig=function(i){return{...i,localePrefix:e.receiveLocalePrefixConfig(null==i?void 0:i.localePrefix)}},exports.receiveSharedNavigationRoutingConfig=function(i){return{...i,localePrefix:e.receiveLocalePrefixConfig(null==i?void 0:i.localePrefix)}};
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/navigation"),r=require("../../shared/utils.js");function t(e){return function(t){const a=r.getLocalePrefix(t.locale,t.localePrefix),n="never"!==t.localePrefix.mode&&r.isLocalHref(t.pathname)?r.prefixPathname(a,t.pathname):t.pathname;for(var i=arguments.length,o=new Array(i>1?i-1:0),c=1;c<i;c++)o[c-1]=arguments[c];return e(n,...o)}}const a=t(e.redirect),n=t(e.permanentRedirect);exports.basePermanentRedirect=n,exports.baseRedirect=a;
@@ -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(e){let{pathname:r,locale:n,params:a,pathnames:o,query:i}=e;function c(e){let t=o[e];return t||(t=e),t}function s(e){let r="string"==typeof e?e:e[n];return a&&Object.entries(a).forEach((e=>{let[t,n]=e;r=Array.isArray(n)?r.replace(new RegExp("(\\[)?\\[...".concat(t,"\\](\\])?"),"g"),n.map((e=>String(e))).join("/")):r.replace("[".concat(t,"]"),String(n))})),i&&(r+=t(i)),r}if("string"==typeof r){return s(c(r))}{const{pathname:e,...t}=r;return{...t,pathname:s(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){var r;let{locale:n,pathname:a,pathnames:o}=t;const i=e.unlocalizePathname(decodeURI(a),n);let c=null===(r=Object.entries(o).find((t=>{let[,r]=t;const a="string"!=typeof r?r[n]:r;return e.matchesPathname(a,i)})))||void 0===r?void 0:r[0];return c||(c=a),c},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[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(e){let{pathname:r,locale:n,params:a,pathnames:o,query:i}=e;function c(e){let t=o[e];return t||(t=e),t}function s(e){let r="string"==typeof e?e:e[n];return a&&Object.entries(a).forEach((e=>{let[t,n]=e;r=Array.isArray(n)?r.replace(new RegExp("(\\[)?\\[...".concat(t,"\\](\\])?"),"g"),n.map((e=>String(e))).join("/")):r.replace("[".concat(t,"]"),String(n))})),i&&(r+=t(i)),r}if("string"==typeof r){return s(c(r))}{const{pathname:e,...t}=r;return{...t,pathname:s(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){var r;let{locale:n,pathname:a,pathnames:o}=t;const i=decodeURI(a);let c=null===(r=Object.entries(o).find((t=>{let[,r]=t;const a="string"!=typeof r?r[n]:r;return e.matchesPathname(a,i)})))||void 0===r?void 0:r[0];return c||(c=a),c},exports.normalizeNameOrNameWithParams=function(e){return"string"==typeof e?{pathname:e}:e},exports.serializeSearchParams=t;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.receiveLocalePrefixConfig=function(e){return"object"==typeof e?e:{mode:e||"always"}};
@@ -0,0 +1 @@
1
+ "use strict";
@@ -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-server-components#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("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 +1 @@
1
- "use strict";function e(e){const t="object"==typeof e?e.pathname:e;return null!=t&&!t.startsWith("/")}function t(e){if("object"==typeof e)return null==e.host&&null==e.hostname;return!/^[a-z]+:/i.test(e)}function n(e,t){let n;return"string"==typeof e?n=r(t,e):(n={...e},e.pathname&&(n.pathname=r(t,e.pathname))),n}function r(e,t){let n="/"+e;return/^\/(\?.*)?$/.test(t)&&(t=t.slice(1)),n+=t,n}function o(e,t){const n="/".concat(e);return t===n||t.startsWith("".concat(n,"/"))}function a(e){const t=e.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(t,"$"))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.hasPathnamePrefixed=o,exports.isLocalHref=t,exports.isRelativeHref=e,exports.localizeHref=function(r,a){let c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,s=arguments.length>3?arguments[3]:void 0;if(!t(r)||e(r))return r;const l=a!==c,u=null==a||o(a,s);return(l||u)&&null!=a?n(r,a):r},exports.matchesPathname=function(e,t){return a(e).test(t)},exports.prefixHref=n,exports.prefixPathname=r,exports.templateToRegex=a,exports.unlocalizePathname=function(e,t){return e.replace(new RegExp("^/".concat(t)),"")||"/"};
1
+ "use strict";function e(e){const t="object"==typeof e?e.pathname:e;return null!=t&&!t.startsWith("/")}function t(e){if("object"==typeof e)return null==e.host&&null==e.hostname;return!/^[a-z]+:/i.test(e)}function n(n){return t(n)&&!e(n)}function r(e,t){let n;return"string"==typeof e?n=o(t,e):(n={...e},e.pathname&&(n.pathname=o(t,e.pathname))),n}function o(e,t){let n=e;return/^\/(\?.*)?$/.test(t)&&(t=t.slice(1)),n+=t,n}function a(e,t){return t===e||t.startsWith("".concat(e,"/"))}function i(e){const t=e.replace(/\[\[(\.\.\.[^\]]+)\]\]/g,"?(.*)").replace(/\[(\.\.\.[^\]]+)\]/g,"(.+)").replace(/\[([^\]]+)\]/g,"([^/]+)");return new RegExp("^".concat(t,"$"))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getLocalePrefix=function(e,t){var n;return"never"!==t.mode&&(null===(n=t.prefixes)||void 0===n?void 0:n[e])||"/"+e},exports.hasPathnamePrefixed=a,exports.isLocalHref=t,exports.isLocalizableHref=n,exports.isRelativeHref=e,exports.localizeHref=function(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,i=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;if(!n(e))return e;const c=t!==o,u=a(s,i);return(c||u)&&null!=s?r(e,s):e},exports.matchesPathname=function(e,t){return i(e).test(t)},exports.prefixHref=r,exports.prefixPathname=o,exports.templateToRegex=i,exports.unprefixPathname=function(e,t){return e.replace(new RegExp("^".concat(t)),"")||"/"};
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./production/routing.js');
5
+ } else {
6
+ module.exports = require('./development/routing.js');
7
+ }
@@ -0,0 +1,18 @@
1
+ import { RoutingBaseConfigInput } from '../routing/config';
2
+ import { Locales, LocalePrefixConfigVerbose, Pathnames } from '../routing/types';
3
+ export type MiddlewareRoutingConfigInput<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>> = RoutingBaseConfigInput<AppLocales> & {
4
+ locales: AppLocales;
5
+ defaultLocale: AppLocales[number];
6
+ /** Sets the `Link` response header to notify search engines about content in other languages (defaults to `true`). See https://developers.google.com/search/docs/specialty/international/localized-versions#http */
7
+ alternateLinks?: boolean;
8
+ /** By setting this to `false`, the cookie as well as the `accept-language` header will no longer be used for locale detection. */
9
+ localeDetection?: boolean;
10
+ /** Maps internal pathnames to external ones which can be localized per locale. */
11
+ pathnames?: AppPathnames;
12
+ };
13
+ export type MiddlewareRoutingConfig<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>> = Omit<MiddlewareRoutingConfigInput<AppLocales, AppPathnames>, 'alternateLinks' | 'localeDetection' | 'localePrefix'> & {
14
+ alternateLinks: boolean;
15
+ localeDetection: boolean;
16
+ localePrefix: LocalePrefixConfigVerbose<AppLocales>;
17
+ };
18
+ export declare function receiveConfig<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>(input: MiddlewareRoutingConfigInput<AppLocales, AppPathnames>): MiddlewareRoutingConfig<AppLocales, AppPathnames>;
@@ -1,12 +1,12 @@
1
1
  import { NextRequest } from 'next/server';
2
- import { AllLocales, Pathnames } from '../shared/types';
3
- import { MiddlewareConfigWithDefaults } from './NextIntlMiddlewareConfig';
2
+ import { Locales, Pathnames } from '../routing/types';
3
+ import { MiddlewareRoutingConfig } from './config';
4
4
  /**
5
5
  * See https://developers.google.com/search/docs/specialty/international/localized-versions
6
6
  */
7
- export default function getAlternateLinksHeaderValue<Locales extends AllLocales>({ config, localizedPathnames, request, resolvedLocale }: {
8
- config: MiddlewareConfigWithDefaults<Locales>;
7
+ export default function getAlternateLinksHeaderValue<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>({ config, localizedPathnames, request, resolvedLocale }: {
8
+ config: MiddlewareRoutingConfig<AppLocales, AppPathnames>;
9
9
  request: NextRequest;
10
- resolvedLocale: Locales[number];
11
- localizedPathnames?: Pathnames<Locales>[string];
10
+ resolvedLocale: AppLocales[number];
11
+ localizedPathnames?: Pathnames<AppLocales>[string];
12
12
  }): string;
@@ -1,4 +1,4 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
- import { AllLocales } from '../shared/types';
3
- import MiddlewareConfig from './NextIntlMiddlewareConfig';
4
- export default function createMiddleware<Locales extends AllLocales>(config: MiddlewareConfig<Locales>): (request: NextRequest) => NextResponse<unknown>;
2
+ import { Locales, Pathnames } from '../routing/types';
3
+ import { MiddlewareRoutingConfigInput } from './config';
4
+ export default function createMiddleware<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>(input: MiddlewareRoutingConfigInput<AppLocales, AppPathnames>): (request: NextRequest) => NextResponse<unknown>;
@@ -1,8 +1,8 @@
1
1
  import { RequestCookies } from 'next/dist/server/web/spec-extension/cookies';
2
- import { AllLocales } from '../shared/types';
3
- import { DomainConfig, MiddlewareConfigWithDefaults } from './NextIntlMiddlewareConfig';
4
- export declare function getAcceptLanguageLocale<Locales extends AllLocales>(requestHeaders: Headers, locales: Locales, defaultLocale: string): string | undefined;
5
- export default function resolveLocale<Locales extends AllLocales>(config: MiddlewareConfigWithDefaults<Locales>, requestHeaders: Headers, requestCookies: RequestCookies, pathname: string): {
6
- locale: Locales[number];
7
- domain?: DomainConfig<Locales>;
2
+ import { Locales, DomainConfig, Pathnames } from '../routing/types';
3
+ import { MiddlewareRoutingConfig } from './config';
4
+ export declare function getAcceptLanguageLocale<AppLocales extends Locales>(requestHeaders: Headers, locales: AppLocales, defaultLocale: string): string | undefined;
5
+ export default function resolveLocale<AppLocales extends Locales, AppPathnames extends Pathnames<AppLocales>>(config: MiddlewareRoutingConfig<AppLocales, AppPathnames>, requestHeaders: Headers, requestCookies: RequestCookies, pathname: string): {
6
+ locale: AppLocales[number];
7
+ domain?: DomainConfig<AppLocales>;
8
8
  };
@@ -0,0 +1,2 @@
1
+ import { NextRequest, NextResponse } from 'next/server';
2
+ export default function syncCookie(request: NextRequest, response: NextResponse, locale: string): void;