next-intl 2.13.0-beta.2 → 2.14.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/README.md +10 -1
- package/dist/index.d.ts +5 -5
- package/dist/middleware/middleware.d.ts +1 -1
- package/dist/next-intl.cjs.development.js +31 -35
- package/dist/next-intl.cjs.development.js.map +1 -1
- package/dist/next-intl.cjs.production.min.js +1 -1
- package/dist/next-intl.cjs.production.min.js.map +1 -1
- package/dist/next-intl.esm.js +2 -6
- package/dist/next-intl.esm.js.map +1 -1
- package/dist/react-server/index.d.ts +1 -1
- package/dist/server/createRequestConfig.d.ts +2 -2
- package/dist/server/getConfig.d.ts +5 -5
- package/dist/server/getRequestConfig.d.ts +7 -2
- package/dist/shared/Link.d.ts +1 -1
- package/dist/shared/LocalizedLink.d.ts +1 -1
- package/dist/shared/next-intl.esm2.js +0 -1
- package/dist/shared/next-intl.esm2.js.map +1 -1
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.js +3 -4
- package/dist/src/index.js.map +1 -1
- package/dist/src/middleware/middleware.d.ts +1 -1
- package/dist/src/middleware/middleware.js +8 -1
- package/dist/src/middleware/middleware.js.map +1 -1
- package/dist/src/react-server/index.d.ts +1 -1
- package/dist/src/server/createRequestConfig.d.ts +2 -2
- package/dist/src/server/createRequestConfig.js.map +1 -1
- package/dist/src/server/getConfig.d.ts +4 -4
- package/dist/src/server/getConfig.js +2 -2
- package/dist/src/server/getConfig.js.map +1 -1
- package/dist/src/server/getRequestConfig.d.ts +7 -2
- package/dist/src/server/getRequestConfig.js +3 -0
- package/dist/src/server/getRequestConfig.js.map +1 -1
- package/dist/src/server/index.js +13 -1
- package/dist/src/server/index.js.map +1 -1
- package/dist/src/shared/Link.d.ts +1 -1
- package/dist/src/shared/LocalizedLink.d.ts +1 -1
- package/dist/src/shared/NextIntlClientProvider.js +0 -1
- package/dist/src/shared/NextIntlClientProvider.js.map +1 -1
- package/package.json +3 -3
- package/src/.DS_Store +0 -0
- package/src/index.tsx +5 -5
- package/src/middleware/middleware.tsx +10 -1
- package/src/server/createRequestConfig.tsx +2 -2
- package/src/server/getConfig.tsx +2 -2
- package/src/server/getRequestConfig.tsx +7 -2
- package/src/server/index.tsx +13 -1
- package/src/shared/NextIntlClientProvider.tsx +0 -2
- package/dist/server/NextIntlConfig.d.ts +0 -6
- package/dist/src/server/NextIntlConfig.d.ts +0 -6
- package/dist/src/server/NextIntlConfig.js +0 -2
- package/dist/src/server/NextIntlConfig.js.map +0 -1
- package/src/server/NextIntlConfig.tsx +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 2.13.0 (2023-04-12)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Sync improvements from RSC branch to main ([#238](https://github.com/amannn/next-intl/issues/238)) ([1d12ba2](https://github.com/amannn/next-intl/commit/1d12ba219afdbca77663c9d20f18db746de033fd)), closes [#149](https://github.com/amannn/next-intl/issues/149) [#237](https://github.com/amannn/next-intl/issues/237)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# 2.12.0 (2023-03-25)
|
|
7
18
|
|
|
8
19
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
2
|
<br>
|
|
3
3
|
<br>
|
|
4
|
-
|
|
4
|
+
<a href="https://next-intl-docs.vercel.app/">
|
|
5
|
+
<img width="400" src="media/logo.svg" alt="next-intl">
|
|
6
|
+
</a>
|
|
5
7
|
<br>
|
|
6
8
|
<br>
|
|
7
9
|
<br>
|
|
@@ -68,3 +70,10 @@ function UserDetails({user}) {
|
|
|
68
70
|
```
|
|
69
71
|
|
|
70
72
|
### [→ Read the docs](https://next-intl-docs.vercel.app/)
|
|
73
|
+
|
|
74
|
+
<div align="center">
|
|
75
|
+
<a href="https://next-intl-docs.vercel.app/redirect?href=https://crowdin.com" target="_blank">
|
|
76
|
+
<img width="350" src="media/partner.svg" alt="Crowdin logo">
|
|
77
|
+
</a>
|
|
78
|
+
<br>
|
|
79
|
+
</div>
|
package/dist/index.d.ts
CHANGED
|
@@ -4,16 +4,13 @@
|
|
|
4
4
|
*/
|
|
5
5
|
/// <reference types="react" />
|
|
6
6
|
/// <reference types="node" />
|
|
7
|
-
import NextIntlClientProvider from './shared/NextIntlClientProvider';
|
|
8
7
|
export * from 'use-intl';
|
|
9
8
|
export { default as useLocalizedRouter } from './react-client/useLocalizedRouter';
|
|
10
9
|
export { default as Link } from './shared/Link';
|
|
11
|
-
export { default as NextIntlClientProvider } from './shared/NextIntlClientProvider';
|
|
12
|
-
/** @deprecated Is called `NextIntlClientProvider` now. */
|
|
13
|
-
export declare const NextIntlProvider: typeof NextIntlClientProvider;
|
|
14
10
|
/** @deprecated Is called `Link` now. */
|
|
15
11
|
export declare const LocalizedLink: import("react").ForwardRefExoticComponent<Pick<Omit<Omit<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, keyof {
|
|
16
12
|
href: string | import("url").UrlObject;
|
|
13
|
+
/** @deprecated Is called `Link` now. */
|
|
17
14
|
as?: (string | import("url").UrlObject) | undefined;
|
|
18
15
|
replace?: boolean | undefined;
|
|
19
16
|
scroll?: boolean | undefined;
|
|
@@ -27,6 +24,7 @@ export declare const LocalizedLink: import("react").ForwardRefExoticComponent<Pi
|
|
|
27
24
|
onClick?: import("react").MouseEventHandler<HTMLAnchorElement> | undefined;
|
|
28
25
|
}> & {
|
|
29
26
|
href: string | import("url").UrlObject;
|
|
27
|
+
/** @deprecated Is called `Link` now. */
|
|
30
28
|
as?: (string | import("url").UrlObject) | undefined;
|
|
31
29
|
replace?: boolean | undefined;
|
|
32
30
|
scroll?: boolean | undefined;
|
|
@@ -42,4 +40,6 @@ export declare const LocalizedLink: import("react").ForwardRefExoticComponent<Pi
|
|
|
42
40
|
children?: import("react").ReactNode;
|
|
43
41
|
} & import("react").RefAttributes<HTMLAnchorElement>, "locale"> & {
|
|
44
42
|
locale?: string | undefined;
|
|
45
|
-
}, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
43
|
+
}, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "tw" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
44
|
+
export { default as NextIntlClientProvider } from './shared/NextIntlClientProvider';
|
|
45
|
+
export { default as NextIntlProvider } from './shared/NextIntlClientProvider';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NextRequest, NextResponse } from 'next/server';
|
|
2
2
|
import MiddlewareConfig from './NextIntlMiddlewareConfig';
|
|
3
|
-
export default function
|
|
3
|
+
export default function createMiddleware(config: MiddlewareConfig): (request: NextRequest) => NextResponse;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var NextLink = require('next/link');
|
|
6
6
|
var navigation = require('next/navigation');
|
|
7
7
|
var React = require('react');
|
|
8
|
-
var router = require('next/router');
|
|
9
8
|
var useIntl = require('use-intl');
|
|
9
|
+
var router = require('next/router');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
@@ -176,8 +176,36 @@ function Link(_ref, ref) {
|
|
|
176
176
|
|
|
177
177
|
var Link$1 = /*#__PURE__*/React.forwardRef(Link);
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
function useRouter() {
|
|
180
|
+
var router = navigation.useRouter();
|
|
181
|
+
return React.useMemo(function () {
|
|
182
|
+
return _extends({}, router, {
|
|
183
|
+
push: function push(href) {
|
|
184
|
+
return router.push(localizeHref(href));
|
|
185
|
+
},
|
|
186
|
+
replace: function replace(href) {
|
|
187
|
+
return router.replace(localizeHref(href));
|
|
188
|
+
},
|
|
189
|
+
prefetch: function prefetch(href) {
|
|
190
|
+
return router.prefetch(localizeHref(href));
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}, [router]);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// during the beta, remove for stable release
|
|
197
|
+
|
|
198
|
+
var hasWarned = false;
|
|
199
|
+
function useLocalizedRouterDeprecated() {
|
|
200
|
+
if (!hasWarned) {
|
|
201
|
+
console.warn("\n\nDEPRECATION WARNING: The `useLocalizedRouter` import from `next-intl` is deprecated and will be removed in the stable release of next-intl. Please import `useLocalizedRouter` from `next-intl/client` instead. See https://next-intl-docs.vercel.app/docs/next-13/server-components\n\n");
|
|
202
|
+
hasWarned = true;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return useRouter();
|
|
206
|
+
}
|
|
180
207
|
|
|
208
|
+
var _excluded = ["children", "locale", "now"];
|
|
181
209
|
function NextIntlClientProvider(_ref) {
|
|
182
210
|
var children = _ref.children,
|
|
183
211
|
locale = _ref.locale,
|
|
@@ -216,42 +244,10 @@ function NextIntlClientProvider(_ref) {
|
|
|
216
244
|
}, rest), children);
|
|
217
245
|
}
|
|
218
246
|
|
|
219
|
-
function useRouter() {
|
|
220
|
-
var router = navigation.useRouter();
|
|
221
|
-
return React.useMemo(function () {
|
|
222
|
-
return _extends({}, router, {
|
|
223
|
-
push: function push(href) {
|
|
224
|
-
return router.push(localizeHref(href));
|
|
225
|
-
},
|
|
226
|
-
replace: function replace(href) {
|
|
227
|
-
return router.replace(localizeHref(href));
|
|
228
|
-
},
|
|
229
|
-
prefetch: function prefetch(href) {
|
|
230
|
-
return router.prefetch(localizeHref(href));
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
}, [router]);
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
// during the beta, remove for stable release
|
|
237
|
-
|
|
238
|
-
var hasWarned = false;
|
|
239
|
-
function useLocalizedRouterDeprecated() {
|
|
240
|
-
if (!hasWarned) {
|
|
241
|
-
console.warn("\n\nDEPRECATION WARNING: The `useLocalizedRouter` import from `next-intl` is deprecated and will be removed in the stable release of next-intl. Please import `useLocalizedRouter` from `next-intl/client` instead. See https://next-intl-docs.vercel.app/docs/next-13/server-components\n\n");
|
|
242
|
-
hasWarned = true;
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return useRouter();
|
|
246
|
-
}
|
|
247
|
-
|
|
248
247
|
/**
|
|
249
248
|
* This is the main entry file when non-'react-server' environments import
|
|
250
249
|
* from 'next-intl'. Make sure this mirrors the API from 'react-server'.
|
|
251
250
|
*/
|
|
252
|
-
/** @deprecated Is called `NextIntlClientProvider` now. */
|
|
253
|
-
|
|
254
|
-
var NextIntlProvider = NextIntlClientProvider;
|
|
255
251
|
/** @deprecated Is called `Link` now. */
|
|
256
252
|
|
|
257
253
|
var LocalizedLink = Link$1;
|
|
@@ -259,7 +255,7 @@ var LocalizedLink = Link$1;
|
|
|
259
255
|
exports.Link = Link$1;
|
|
260
256
|
exports.LocalizedLink = LocalizedLink;
|
|
261
257
|
exports.NextIntlClientProvider = NextIntlClientProvider;
|
|
262
|
-
exports.NextIntlProvider =
|
|
258
|
+
exports.NextIntlProvider = NextIntlClientProvider;
|
|
263
259
|
exports.useLocalizedRouter = useLocalizedRouterDeprecated;
|
|
264
260
|
Object.keys(useIntl).forEach(function (k) {
|
|
265
261
|
if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-intl.cjs.development.js","sources":["../src/shared/localizePathname.tsx","../src/shared/constants.tsx","../src/client/getCookieLocale.tsx","../src/client/hasPathnamePrefixed.tsx","../src/client/localizeHref.tsx","../src/shared/Link.tsx","../src/shared/NextIntlClientProvider.tsx","../src/client/useRouter.tsx","../src/react-client/useLocalizedRouter.tsx","../src/index.tsx"],"sourcesContent":["export default function localizePathname(locale: string, pathname: string) {\n let localizedHref = '/' + locale;\n\n if (pathname !== '/') {\n localizedHref += pathname;\n }\n\n return localizedHref;\n}\n","// Reuse the legacy cookie name\n// https://nextjs.org/docs/advanced-features/i18n-routing#leveraging-the-next_locale-cookie\nexport const COOKIE_LOCALE_NAME = 'NEXT_LOCALE';\n\n// Should take precedence over the cookie\nexport const HEADER_LOCALE_NAME = 'X-NEXT-INTL-LOCALE';\n","import {COOKIE_LOCALE_NAME} from '../shared/constants';\n\nfunction getCookieValueByName(name: string) {\n // https://stackoverflow.com/a/15724300/343045\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n const part = parts.pop()?.split(';').shift();\n if (part) return part;\n }\n\n throw new Error(\n `Unable to find next-intl cookie, have you configured the middleware?`\n );\n}\n\nexport default function getCookieLocale() {\n return getCookieValueByName(COOKIE_LOCALE_NAME);\n}\n","export default function hasPathnamePrefixed(locale: string, pathname: string) {\n const prefix = `/${locale}`;\n return (\n pathname === prefix ||\n (pathname.startsWith(`${prefix}/`) && pathname.length > prefix.length)\n );\n}\n","import {UrlObject} from 'url';\nimport localizePathname from '../shared/localizePathname';\nimport getCookieLocale from './getCookieLocale';\nimport hasPathnamePrefixed from './hasPathnamePrefixed';\n\nexport default function localizeHref(\n href: string,\n locale?: string,\n pathname?: string\n): string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n): UrlObject | string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n) {\n const cookieLocale = getCookieLocale();\n if (!locale) locale = cookieLocale;\n\n if (!pathname) {\n pathname = window.location.pathname;\n }\n\n const isSwitchingLocale = locale !== cookieLocale;\n const isPathnamePrefixed = hasPathnamePrefixed(locale, pathname);\n\n if (isPathnamePrefixed || isSwitchingLocale) {\n let prefixedHref;\n if (typeof href === 'string') {\n prefixedHref = localizePathname(locale, href);\n } else {\n prefixedHref = {...href};\n if (href.pathname) {\n prefixedHref.pathname = localizePathname(locale, href.pathname);\n }\n }\n\n return prefixedHref;\n } else {\n return href;\n }\n}\n","'use client';\n\nimport NextLink from 'next/link';\nimport {usePathname} from 'next/navigation';\nimport React, {ComponentProps, forwardRef, useEffect, useState} from 'react';\nimport localizeHref from '../client/localizeHref';\n\ntype Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {\n locale?: string;\n};\n\n/**\n * Wraps `next/link` and prefixes the `href` with the current locale.\n *\n * Note that when a `locale` prop is passed, two de-optimizations are made:\n *\n * 1. The `prefetch` prop is not supported. This is because Next.js prefetches\n * the page and the `set-cookie` response header will cause the locale cookie\n * on the current page to be overwritten.\n * 2. A regular anchor tag is used instead of `next/link`. This is to avoid a\n * bug with Server Components where the markup wouldn't be updated correctly\n * otherwise.\n */\nfunction Link({href, locale, prefetch, ...rest}: Props, ref: Props['ref']) {\n const [localizedHref, setLocalizedHref] = useState<typeof href>(href);\n const pathname = usePathname();\n\n useEffect(() => {\n setLocalizedHref(localizeHref(href, locale, pathname ?? undefined));\n }, [href, locale, pathname]);\n\n if (locale !== undefined) {\n // If Next.js fixes the bug where the markup isn't updated correctly when\n // the locale changes, we can remove this check. Note however that we still\n // need to disable prefetching (see comment above).\n\n if (prefetch && process.env.NODE_ENV !== 'production') {\n console.error(\n 'The `prefetch` prop is currently not supported when using the `locale` prop on `Link`.`'\n );\n }\n\n let localizedHrefString;\n if (typeof localizedHref === 'string') {\n localizedHrefString = localizedHref;\n } else if (localizedHref) {\n localizedHrefString = localizedHref.toString();\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a ref={ref} href={localizedHrefString} {...rest} />\n );\n }\n\n return (\n <NextLink ref={ref} href={localizedHref} prefetch={prefetch} {...rest} />\n );\n}\n\nexport default forwardRef(Link);\n","'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\n// Move this from /client to default\n\nexport default function NextIntlClientProvider({\n children,\n locale,\n now,\n ...rest\n}: Props) {\n let router;\n try {\n // Reading from context is practically ok to do conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n router = useRouter();\n } catch (error) {\n // Calling `useRouter` is not supported in the app folder\n }\n\n // The router can be undefined if used in a context outside\n // of Next.js (e.g. unit tests, Storybook, ...)\n if (!locale && router) {\n locale = router.locale;\n }\n\n // Currently RSC serialize dates to strings, therefore make sure we have\n // a date object. We might be able to remove this once more types have\n // first-class serialization support (https://github.com/facebook/react/issues/25687)\n if (typeof now === 'string') {\n now = new Date(now);\n }\n\n if (!locale) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? \"Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing).\"\n : undefined\n );\n }\n\n return (\n <IntlProvider locale={locale} now={now} {...rest}>\n {children}\n </IntlProvider>\n );\n}\n","import {useRouter as useNextRouter} from 'next/navigation';\nimport {useMemo} from 'react';\nimport localizeHref from './localizeHref';\n\nexport default function useRouter() {\n const router = useNextRouter();\n\n return useMemo(\n () => ({\n ...router,\n push(href: string) {\n return router.push(localizeHref(href));\n },\n replace(href: string) {\n return router.replace(localizeHref(href));\n },\n prefetch(href: string) {\n return router.prefetch(localizeHref(href));\n }\n }),\n [router]\n );\n}\n","import useRouter from '../client/useRouter';\n\n// TODO: Only available for backwards compatibility\n// during the beta, remove for stable release\n\nlet hasWarned = false;\n\nexport default function useLocalizedRouterDeprecated() {\n if (!hasWarned) {\n console.warn(\n `\\n\\nDEPRECATION WARNING: The \\`useLocalizedRouter\\` import from \\`next-intl\\` is deprecated and will be removed in the stable release of next-intl. Please import \\`useLocalizedRouter\\` from \\`next-intl/client\\` instead. See https://next-intl-docs.vercel.app/docs/next-13/server-components\\n\\n`\n );\n hasWarned = true;\n }\n\n return useRouter();\n}\n","/**\n * This is the main entry file when non-'react-server' environments import\n * from 'next-intl'. Make sure this mirrors the API from 'react-server'.\n */\n\nimport Link from './shared/Link';\nimport NextIntlClientProvider from './shared/NextIntlClientProvider';\n\nexport * from 'use-intl';\n\nexport {default as useLocalizedRouter} from './react-client/useLocalizedRouter';\nexport {default as Link} from './shared/Link';\nexport {default as NextIntlClientProvider} from './shared/NextIntlClientProvider';\n\n/** @deprecated Is called `NextIntlClientProvider` now. */\nexport const NextIntlProvider = NextIntlClientProvider;\n\n/** @deprecated Is called `Link` now. */\nexport const LocalizedLink = Link;\n"],"names":["localizePathname","locale","pathname","localizedHref","COOKIE_LOCALE_NAME","getCookieValueByName","name","value","document","cookie","parts","split","length","part","pop","shift","Error","getCookieLocale","hasPathnamePrefixed","prefix","startsWith","localizeHref","href","cookieLocale","window","location","isSwitchingLocale","isPathnamePrefixed","prefixedHref","Link","ref","prefetch","rest","_excluded","useState","setLocalizedHref","usePathname","useEffect","undefined","process","console","error","localizedHrefString","toString","React","createElement","NextLink","forwardRef","NextIntlClientProvider","children","now","router","useRouter","Date","IntlProvider","useNextRouter","useMemo","push","replace","hasWarned","useLocalizedRouterDeprecated","warn","NextIntlProvider","LocalizedLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAc,SAAUA,gBAAV,CAA2BC,MAA3B,EAA2CC,QAA3C,EAA2D;AACvE,EAAIC,IAAAA,aAAa,GAAG,GAAA,GAAMF,MAA1B,CAAA;;AAEA,EAAIC,IAAAA,QAAQ,KAAK,GAAjB,EAAsB;AACpBC,IAAAA,aAAa,IAAID,QAAjB,CAAA;AACD,GAAA;;AAED,EAAA,OAAOC,aAAP,CAAA;AACD;;ACRD;AACA;AACO,IAAMC,kBAAkB,GAAG,aAA3B;;ACAP,SAASC,oBAAT,CAA8BC,IAA9B,EAA0C;AACxC;AACA,EAAA,IAAMC,KAAK,GAAA,IAAA,GAAQC,QAAQ,CAACC,MAA5B,CAAA;AACA,EAAA,IAAMC,KAAK,GAAGH,KAAK,CAACI,KAAN,CAAA,IAAA,GAAiBL,IAAjB,GAAd,GAAA,CAAA,CAAA;;AACA,EAAA,IAAII,KAAK,CAACE,MAAN,KAAiB,CAArB,EAAwB;AAAA,IAAA,IAAA,UAAA,CAAA;;AACt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AAA,MAAM,CAACpB,QAAP,CAAgBV,YAAY,CAACC,IAAD,CAA5B,CAAP,CAAA;AACD,OAAA;AAVH,KAAA,CAAA,CAAA;AAAA,GADY,EAaZ,CAAC6B,MAAD,CAbY,CAAd,CAAA;AAeD;;ACnBD;;AAEA,IAAIQ,SAAS,GAAG,KAAhB,CAAA;AAEc,SAAUC,4BAAV,GAAsC;AAClD,EAAI,IAAA,CAACD,SAAL,EAAgB;AACdnB,IAAAA,OAAO,CAACqB,IAAR,CAAA,8RAAA,CAAA,CAAA;AAGAF,IAAAA,SAAS,GAAG,IAAZ,CAAA;AACD,GAAA;;AAED,EAAA,OAAOP,SAAS,EAAhB,CAAA;AACD;;AChBD;;;AAGG;AAWH;;AACO,IAAMU,gBAAgB,GAAGd,uBAAzB;AAEP;;AACO,IAAMe,aAAa,GAAGlC;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"next-intl.cjs.development.js","sources":["../src/shared/localizePathname.tsx","../src/shared/constants.tsx","../src/client/getCookieLocale.tsx","../src/client/hasPathnamePrefixed.tsx","../src/client/localizeHref.tsx","../src/shared/Link.tsx","../src/client/useRouter.tsx","../src/react-client/useLocalizedRouter.tsx","../src/shared/NextIntlClientProvider.tsx","../src/index.tsx"],"sourcesContent":["export default function localizePathname(locale: string, pathname: string) {\n let localizedHref = '/' + locale;\n\n if (pathname !== '/') {\n localizedHref += pathname;\n }\n\n return localizedHref;\n}\n","// Reuse the legacy cookie name\n// https://nextjs.org/docs/advanced-features/i18n-routing#leveraging-the-next_locale-cookie\nexport const COOKIE_LOCALE_NAME = 'NEXT_LOCALE';\n\n// Should take precedence over the cookie\nexport const HEADER_LOCALE_NAME = 'X-NEXT-INTL-LOCALE';\n","import {COOKIE_LOCALE_NAME} from '../shared/constants';\n\nfunction getCookieValueByName(name: string) {\n // https://stackoverflow.com/a/15724300/343045\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n const part = parts.pop()?.split(';').shift();\n if (part) return part;\n }\n\n throw new Error(\n `Unable to find next-intl cookie, have you configured the middleware?`\n );\n}\n\nexport default function getCookieLocale() {\n return getCookieValueByName(COOKIE_LOCALE_NAME);\n}\n","export default function hasPathnamePrefixed(locale: string, pathname: string) {\n const prefix = `/${locale}`;\n return (\n pathname === prefix ||\n (pathname.startsWith(`${prefix}/`) && pathname.length > prefix.length)\n );\n}\n","import {UrlObject} from 'url';\nimport localizePathname from '../shared/localizePathname';\nimport getCookieLocale from './getCookieLocale';\nimport hasPathnamePrefixed from './hasPathnamePrefixed';\n\nexport default function localizeHref(\n href: string,\n locale?: string,\n pathname?: string\n): string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n): UrlObject | string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n) {\n const cookieLocale = getCookieLocale();\n if (!locale) locale = cookieLocale;\n\n if (!pathname) {\n pathname = window.location.pathname;\n }\n\n const isSwitchingLocale = locale !== cookieLocale;\n const isPathnamePrefixed = hasPathnamePrefixed(locale, pathname);\n\n if (isPathnamePrefixed || isSwitchingLocale) {\n let prefixedHref;\n if (typeof href === 'string') {\n prefixedHref = localizePathname(locale, href);\n } else {\n prefixedHref = {...href};\n if (href.pathname) {\n prefixedHref.pathname = localizePathname(locale, href.pathname);\n }\n }\n\n return prefixedHref;\n } else {\n return href;\n }\n}\n","'use client';\n\nimport NextLink from 'next/link';\nimport {usePathname} from 'next/navigation';\nimport React, {ComponentProps, forwardRef, useEffect, useState} from 'react';\nimport localizeHref from '../client/localizeHref';\n\ntype Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {\n locale?: string;\n};\n\n/**\n * Wraps `next/link` and prefixes the `href` with the current locale.\n *\n * Note that when a `locale` prop is passed, two de-optimizations are made:\n *\n * 1. The `prefetch` prop is not supported. This is because Next.js prefetches\n * the page and the `set-cookie` response header will cause the locale cookie\n * on the current page to be overwritten.\n * 2. A regular anchor tag is used instead of `next/link`. This is to avoid a\n * bug with Server Components where the markup wouldn't be updated correctly\n * otherwise.\n */\nfunction Link({href, locale, prefetch, ...rest}: Props, ref: Props['ref']) {\n const [localizedHref, setLocalizedHref] = useState<typeof href>(href);\n const pathname = usePathname();\n\n useEffect(() => {\n setLocalizedHref(localizeHref(href, locale, pathname ?? undefined));\n }, [href, locale, pathname]);\n\n if (locale !== undefined) {\n // If Next.js fixes the bug where the markup isn't updated correctly when\n // the locale changes, we can remove this check. Note however that we still\n // need to disable prefetching (see comment above).\n\n if (prefetch && process.env.NODE_ENV !== 'production') {\n console.error(\n 'The `prefetch` prop is currently not supported when using the `locale` prop on `Link`.`'\n );\n }\n\n let localizedHrefString;\n if (typeof localizedHref === 'string') {\n localizedHrefString = localizedHref;\n } else if (localizedHref) {\n localizedHrefString = localizedHref.toString();\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a ref={ref} href={localizedHrefString} {...rest} />\n );\n }\n\n return (\n <NextLink ref={ref} href={localizedHref} prefetch={prefetch} {...rest} />\n );\n}\n\nexport default forwardRef(Link);\n","import {useRouter as useNextRouter} from 'next/navigation';\nimport {useMemo} from 'react';\nimport localizeHref from './localizeHref';\n\nexport default function useRouter() {\n const router = useNextRouter();\n\n return useMemo(\n () => ({\n ...router,\n push(href: string) {\n return router.push(localizeHref(href));\n },\n replace(href: string) {\n return router.replace(localizeHref(href));\n },\n prefetch(href: string) {\n return router.prefetch(localizeHref(href));\n }\n }),\n [router]\n );\n}\n","import useRouter from '../client/useRouter';\n\n// TODO: Only available for backwards compatibility\n// during the beta, remove for stable release\n\nlet hasWarned = false;\n\nexport default function useLocalizedRouterDeprecated() {\n if (!hasWarned) {\n console.warn(\n `\\n\\nDEPRECATION WARNING: The \\`useLocalizedRouter\\` import from \\`next-intl\\` is deprecated and will be removed in the stable release of next-intl. Please import \\`useLocalizedRouter\\` from \\`next-intl/client\\` instead. See https://next-intl-docs.vercel.app/docs/next-13/server-components\\n\\n`\n );\n hasWarned = true;\n }\n\n return useRouter();\n}\n","'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\nexport default function NextIntlClientProvider({\n children,\n locale,\n now,\n ...rest\n}: Props) {\n let router;\n try {\n // Reading from context is practically ok to do conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n router = useRouter();\n } catch (error) {\n // Calling `useRouter` is not supported in the app folder\n }\n\n // The router can be undefined if used in a context outside\n // of Next.js (e.g. unit tests, Storybook, ...)\n if (!locale && router) {\n locale = router.locale;\n }\n\n // Currently RSC serialize dates to strings, therefore make sure we have\n // a date object. We might be able to remove this once more types have\n // first-class serialization support (https://github.com/facebook/react/issues/25687)\n if (typeof now === 'string') {\n now = new Date(now);\n }\n\n if (!locale) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? \"Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing).\"\n : undefined\n );\n }\n\n return (\n <IntlProvider locale={locale} now={now} {...rest}>\n {children}\n </IntlProvider>\n );\n}\n","/**\n * This is the main entry file when non-'react-server' environments import\n * from 'next-intl'. Make sure this mirrors the API from 'react-server'.\n */\n\nimport Link from './shared/Link';\n\nexport * from 'use-intl';\n\nexport {default as useLocalizedRouter} from './react-client/useLocalizedRouter';\nexport {default as Link} from './shared/Link';\n\n/** @deprecated Is called `Link` now. */\nexport const LocalizedLink = Link;\n\nexport {default as NextIntlClientProvider} from './shared/NextIntlClientProvider';\n\n// Legacy export for compatibility\nexport {default as NextIntlProvider} from './shared/NextIntlClientProvider';\n"],"names":["localizePathname","locale","pathname","localizedHref","COOKIE_LOCALE_NAME","getCookieValueByName","name","value","document","cookie","parts","split","length","part","pop","shift","Error","getCookieLocale","hasPathnamePrefixed","prefix","startsWith","localizeHref","href","cookieLocale","window","location","isSwitchingLocale","isPathnamePrefixed","prefixedHref","Link","ref","prefetch","rest","_excluded","useState","setLocalizedHref","usePathname","useEffect","undefined","process","console","error","localizedHrefString","toString","React","createElement","NextLink","forwardRef","useRouter","router","useNextRouter","useMemo","push","replace","hasWarned","useLocalizedRouterDeprecated","warn","NextIntlClientProvider","children","now","Date","IntlProvider","LocalizedLink"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAc,SAAUA,gBAAV,CAA2BC,MAA3B,EAA2CC,QAA3C,EAA2D;AACvE,EAAIC,IAAAA,aAAa,GAAG,GAAA,GAAMF,MAA1B,CAAA;;AAEA,EAAIC,IAAAA,QAAQ,KAAK,GAAjB,EAAsB;AACpBC,IAAAA,aAAa,IAAID,QAAjB,CAAA;AACD,GAAA;;AAED,EAAA,OAAOC,aAAP,CAAA;AACD;;ACRD;AACA;AACO,IAAMC,kBAAkB,GAAG,aAA3B;;ACAP,SAASC,oBAAT,CAA8BC,IAA9B,EAA0C;AACxC;AACA,EAAA,IAAMC,KAAK,GAAA,IAAA,GAAQC,QAAQ,CAACC,MAA5B,CAAA;AACA,EAAA,IAAMC,KAAK,GAAGH,KAAK,CAACI,KAAN,CAAA,IAAA,GAAiBL,IAAjB,GAAd,GAAA,CAAA,CAAA;;AACA,EAAA,IAAII,KAAK,CAACE,MAAN,KAAiB,CAArB,EAAwB;AAAA,IAAA,IAAA,UAAA,CAAA;;AACtB,IAAA,IAAMC,IAAI,GAAA,CAAA,UAAA,GAAGH,KAAK,CAACI,GAAN,EAAH,KAAG,IAAA,GAAA,KAAA,CAAA,GAAA,UAAA,CAAaH,KAAb,CAAmB,GAAnB,CAAA,CAAwBI,KAAxB,EAAb,CAAA;AACA,IAAIF,IAAAA,IAAJ,EAAU,OAAOA,IAAP,CAAA;AACX,GAAA;;AAED,EAAM,MA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,CAACgB,oBAAD,EAAA,QAAA,CAAA;AAAc5D,IAAAA,MAAM,EAAEA,MAAtB;AAA8B0D,IAAAA,GAAG,EAAEA,GAAAA;AAAnC,GAA4C3B,EAAAA,IAA5C,CACG0B,EAAAA,QADH,CADF,CAAA;AAKD;;ACrDD;;;AAGG;AASH;;AACO,IAAMI,aAAa,GAAGjC;;;;;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/link"),t=require("next/navigation"),r=require("react"),n=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("next/link"),t=require("next/navigation"),r=require("react"),n=require("use-intl"),o=require("next/router");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=i(e),u=i(r);function l(){return l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(this,arguments)}function c(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)t.indexOf(r=i[n])>=0||(o[r]=e[r]);return o}function f(e,t){var r="/"+e;return"/"!==t&&(r+=t),r}function s(e,t,r){var n=function(e){var t=("; "+document.cookie).split("; NEXT_LOCALE=");if(2===t.length){var r,n=null==(r=t.pop())?void 0:r.split(";").shift();if(n)return n}throw new Error("Unable to find next-intl cookie, have you configured the middleware?")}();t||(t=n),r||(r=window.location.pathname);var o,i=t!==n,a=function(e,t){var r="/"+e;return t===r||t.startsWith(r+"/")&&t.length>r.length}(t,r);return a||i?("string"==typeof e?o=f(t,e):(o=l({},e),e.pathname&&(o.pathname=f(t,e.pathname))),o):e}var p=["href","locale","prefetch"];function d(e,n){var o,i=e.href,f=e.locale,d=e.prefetch,h=c(e,p),v=r.useState(i),x=v[0],m=v[1],w=t.usePathname();return r.useEffect((function(){m(s(i,f,null!=w?w:void 0))}),[i,f,w]),void 0!==f?("string"==typeof x?o=x:x&&(o=x.toString()),u.default.createElement("a",l({ref:n,href:o},h))):u.default.createElement(a.default,l({ref:n,href:x,prefetch:d},h))}var h=r.forwardRef(d),v=!1,x=["children","locale","now"];function m(e){var t,r=e.children,i=e.locale,a=e.now,f=c(e,x);try{t=o.useRouter()}catch(e){}if(!i&&t&&(i=t.locale),"string"==typeof a&&(a=new Date(a)),!i)throw new Error(void 0);return u.default.createElement(n.IntlProvider,l({locale:i,now:a},f),r)}var w=h;exports.Link=h,exports.LocalizedLink=w,exports.NextIntlClientProvider=m,exports.NextIntlProvider=m,exports.useLocalizedRouter=function(){return v||(console.warn("\n\nDEPRECATION WARNING: The `useLocalizedRouter` import from `next-intl` is deprecated and will be removed in the stable release of next-intl. Please import `useLocalizedRouter` from `next-intl/client` instead. See https://next-intl-docs.vercel.app/docs/next-13/server-components\n\n"),v=!0),function(){var e=t.useRouter();return r.useMemo((function(){return l({},e,{push:function(t){return e.push(s(t))},replace:function(t){return e.replace(s(t))},prefetch:function(t){return e.prefetch(s(t))}})}),[e])}()},Object.keys(n).forEach((function(e){"default"===e||exports.hasOwnProperty(e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}));
|
|
2
2
|
//# sourceMappingURL=next-intl.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-intl.cjs.production.min.js","sources":["../src/shared/localizePathname.tsx","../src/client/localizeHref.tsx","../src/client/getCookieLocale.tsx","../src/client/hasPathnamePrefixed.tsx","../src/shared/Link.tsx","../src/shared/NextIntlClientProvider.tsx","../src/react-client/useLocalizedRouter.tsx","../src/index.tsx","../src/client/useRouter.tsx"],"sourcesContent":["export default function localizePathname(locale: string, pathname: string) {\n let localizedHref = '/' + locale;\n\n if (pathname !== '/') {\n localizedHref += pathname;\n }\n\n return localizedHref;\n}\n","import {UrlObject} from 'url';\nimport localizePathname from '../shared/localizePathname';\nimport getCookieLocale from './getCookieLocale';\nimport hasPathnamePrefixed from './hasPathnamePrefixed';\n\nexport default function localizeHref(\n href: string,\n locale?: string,\n pathname?: string\n): string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n): UrlObject | string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n) {\n const cookieLocale = getCookieLocale();\n if (!locale) locale = cookieLocale;\n\n if (!pathname) {\n pathname = window.location.pathname;\n }\n\n const isSwitchingLocale = locale !== cookieLocale;\n const isPathnamePrefixed = hasPathnamePrefixed(locale, pathname);\n\n if (isPathnamePrefixed || isSwitchingLocale) {\n let prefixedHref;\n if (typeof href === 'string') {\n prefixedHref = localizePathname(locale, href);\n } else {\n prefixedHref = {...href};\n if (href.pathname) {\n prefixedHref.pathname = localizePathname(locale, href.pathname);\n }\n }\n\n return prefixedHref;\n } else {\n return href;\n }\n}\n","import {COOKIE_LOCALE_NAME} from '../shared/constants';\n\nfunction getCookieValueByName(name: string) {\n // https://stackoverflow.com/a/15724300/343045\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n const part = parts.pop()?.split(';').shift();\n if (part) return part;\n }\n\n throw new Error(\n `Unable to find next-intl cookie, have you configured the middleware?`\n );\n}\n\nexport default function getCookieLocale() {\n return getCookieValueByName(COOKIE_LOCALE_NAME);\n}\n","export default function hasPathnamePrefixed(locale: string, pathname: string) {\n const prefix = `/${locale}`;\n return (\n pathname === prefix ||\n (pathname.startsWith(`${prefix}/`) && pathname.length > prefix.length)\n );\n}\n","'use client';\n\nimport NextLink from 'next/link';\nimport {usePathname} from 'next/navigation';\nimport React, {ComponentProps, forwardRef, useEffect, useState} from 'react';\nimport localizeHref from '../client/localizeHref';\n\ntype Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {\n locale?: string;\n};\n\n/**\n * Wraps `next/link` and prefixes the `href` with the current locale.\n *\n * Note that when a `locale` prop is passed, two de-optimizations are made:\n *\n * 1. The `prefetch` prop is not supported. This is because Next.js prefetches\n * the page and the `set-cookie` response header will cause the locale cookie\n * on the current page to be overwritten.\n * 2. A regular anchor tag is used instead of `next/link`. This is to avoid a\n * bug with Server Components where the markup wouldn't be updated correctly\n * otherwise.\n */\nfunction Link({href, locale, prefetch, ...rest}: Props, ref: Props['ref']) {\n const [localizedHref, setLocalizedHref] = useState<typeof href>(href);\n const pathname = usePathname();\n\n useEffect(() => {\n setLocalizedHref(localizeHref(href, locale, pathname ?? undefined));\n }, [href, locale, pathname]);\n\n if (locale !== undefined) {\n // If Next.js fixes the bug where the markup isn't updated correctly when\n // the locale changes, we can remove this check. Note however that we still\n // need to disable prefetching (see comment above).\n\n if (prefetch && process.env.NODE_ENV !== 'production') {\n console.error(\n 'The `prefetch` prop is currently not supported when using the `locale` prop on `Link`.`'\n );\n }\n\n let localizedHrefString;\n if (typeof localizedHref === 'string') {\n localizedHrefString = localizedHref;\n } else if (localizedHref) {\n localizedHrefString = localizedHref.toString();\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a ref={ref} href={localizedHrefString} {...rest} />\n );\n }\n\n return (\n <NextLink ref={ref} href={localizedHref} prefetch={prefetch} {...rest} />\n );\n}\n\nexport default forwardRef(Link);\n","'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\n// Move this from /client to default\n\nexport default function NextIntlClientProvider({\n children,\n locale,\n now,\n ...rest\n}: Props) {\n let router;\n try {\n // Reading from context is practically ok to do conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n router = useRouter();\n } catch (error) {\n // Calling `useRouter` is not supported in the app folder\n }\n\n // The router can be undefined if used in a context outside\n // of Next.js (e.g. unit tests, Storybook, ...)\n if (!locale && router) {\n locale = router.locale;\n }\n\n // Currently RSC serialize dates to strings, therefore make sure we have\n // a date object. We might be able to remove this once more types have\n // first-class serialization support (https://github.com/facebook/react/issues/25687)\n if (typeof now === 'string') {\n now = new Date(now);\n }\n\n if (!locale) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? \"Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing).\"\n : undefined\n );\n }\n\n return (\n <IntlProvider locale={locale} now={now} {...rest}>\n {children}\n </IntlProvider>\n );\n}\n","import useRouter from '../client/useRouter';\n\n// TODO: Only available for backwards compatibility\n// during the beta, remove for stable release\n\nlet hasWarned = false;\n\nexport default function useLocalizedRouterDeprecated() {\n if (!hasWarned) {\n console.warn(\n `\\n\\nDEPRECATION WARNING: The \\`useLocalizedRouter\\` import from \\`next-intl\\` is deprecated and will be removed in the stable release of next-intl. Please import \\`useLocalizedRouter\\` from \\`next-intl/client\\` instead. See https://next-intl-docs.vercel.app/docs/next-13/server-components\\n\\n`\n );\n hasWarned = true;\n }\n\n return useRouter();\n}\n","/**\n * This is the main entry file when non-'react-server' environments import\n * from 'next-intl'. Make sure this mirrors the API from 'react-server'.\n */\n\nimport Link from './shared/Link';\nimport NextIntlClientProvider from './shared/NextIntlClientProvider';\n\nexport * from 'use-intl';\n\nexport {default as useLocalizedRouter} from './react-client/useLocalizedRouter';\nexport {default as Link} from './shared/Link';\nexport {default as NextIntlClientProvider} from './shared/NextIntlClientProvider';\n\n/** @deprecated Is called `NextIntlClientProvider` now. */\nexport const NextIntlProvider = NextIntlClientProvider;\n\n/** @deprecated Is called `Link` now. */\nexport const LocalizedLink = Link;\n","import {useRouter as useNextRouter} from 'next/navigation';\nimport {useMemo} from 'react';\nimport localizeHref from './localizeHref';\n\nexport default function useRouter() {\n const router = useNextRouter();\n\n return useMemo(\n () => ({\n ...router,\n push(href: string) {\n return router.push(localizeHref(href));\n },\n replace(href: string) {\n return router.replace(localizeHref(href));\n },\n prefetch(href: string) {\n return router.prefetch(localizeHref(href));\n }\n }),\n [router]\n );\n}\n"],"names":["localizePathname","locale","pathname","localizedHref","localizeHref","href","cookieLocale","name","parts","document","cookie","split","length","_parts$pop","part","pop","shift","Error","getCookieValueByName","window","location","prefixedHref","isSwitchingLocale","isPathnamePrefixed","prefix","startsWith","hasPathnamePrefixed","Link","ref","localizedHrefString","prefetch","rest","_objectWithoutPropertiesLoose","_ref","_excluded","useState","_useState","setLocalizedHref","usePathname","useEffect","undefined","toString","React","createElement","_extends","NextLink","Link$1","forwardRef","NextIntlClientProvider","children","router","now","useRouter","error","Date","IntlProvider","hasWarned","NextIntlProvider","LocalizedLink","console","warn","useNextRouter","useMemo","push","replace"],"mappings":"4mBAAc,SAAUA,EAAiBC,EAAgBC,GACnDC,IAAAA,EAAgB,IAAMF,EAM1B,MAJiB,MAAbC,IACFC,GAAiBD,GAGZC,ECQe,SAAAC,EACtBC,EACAJ,EACAC,GAEMI,IAAAA,EClBR,SAA8BC,GAE5B,IACMC,GADK,KAAQC,SAASC,QACRC,MAAN,kBACd,GAAqB,IAAjBH,EAAMI,OAAc,CAAA,IAAAC,EAChBC,EAAO,OAAHD,EAAGL,EAAMO,YAAN,EAAAF,EAAaF,MAAM,KAAKK,QACjCF,GAAAA,EAAM,OAAOA,EAGb,MAAA,IAAIG,MAAV,wEAMOC,GDIFjB,IAAQA,EAASK,GAEjBJ,IACHA,EAAWiB,OAAOC,SAASlB,UAG7B,IAIMmB,EAJAC,EAAoBrB,IAAWK,EAC/BiB,EE5BM,SAA8BtB,EAAgBC,GACpDsB,IAAAA,MAAavB,EACnB,OACEC,IAAasB,GACZtB,EAASuB,WAAcD,EAAvB,MAAqCtB,EAASU,OAASY,EAAOZ,OFwBtCc,CAAoBzB,EAAQC,GAEnDqB,OAAAA,GAAsBD,GAEJ,iBAATjB,EACTgB,EAAerB,EAAiBC,EAAQI,IAExCgB,EAAmBhB,EAAAA,GAAAA,GACfA,EAAKH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SACZ,WAAA,OAAAlB,EAAA,GACKM,EADL,CAEEa,KAAK1D,SAAAA,GACI6C,OAAAA,EAAOa,KAAK3D,EAAaC,KAElC2D,QAAQ3D,SAAAA,GACC6C,OAAAA,EAAOc,QAAQ5D,EAAaC,KAErCyB,SAASzB,SAAAA,GACA6C,OAAAA,EAAOpB,SAAS1B,EAAaC,SAGxC,CAAC6C,IFLIE"}
|
|
1
|
+
{"version":3,"file":"next-intl.cjs.production.min.js","sources":["../src/shared/localizePathname.tsx","../src/client/localizeHref.tsx","../src/client/getCookieLocale.tsx","../src/client/hasPathnamePrefixed.tsx","../src/shared/Link.tsx","../src/react-client/useLocalizedRouter.tsx","../src/shared/NextIntlClientProvider.tsx","../src/index.tsx","../src/client/useRouter.tsx"],"sourcesContent":["export default function localizePathname(locale: string, pathname: string) {\n let localizedHref = '/' + locale;\n\n if (pathname !== '/') {\n localizedHref += pathname;\n }\n\n return localizedHref;\n}\n","import {UrlObject} from 'url';\nimport localizePathname from '../shared/localizePathname';\nimport getCookieLocale from './getCookieLocale';\nimport hasPathnamePrefixed from './hasPathnamePrefixed';\n\nexport default function localizeHref(\n href: string,\n locale?: string,\n pathname?: string\n): string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n): UrlObject | string;\nexport default function localizeHref(\n href: UrlObject | string,\n locale?: string,\n pathname?: string\n) {\n const cookieLocale = getCookieLocale();\n if (!locale) locale = cookieLocale;\n\n if (!pathname) {\n pathname = window.location.pathname;\n }\n\n const isSwitchingLocale = locale !== cookieLocale;\n const isPathnamePrefixed = hasPathnamePrefixed(locale, pathname);\n\n if (isPathnamePrefixed || isSwitchingLocale) {\n let prefixedHref;\n if (typeof href === 'string') {\n prefixedHref = localizePathname(locale, href);\n } else {\n prefixedHref = {...href};\n if (href.pathname) {\n prefixedHref.pathname = localizePathname(locale, href.pathname);\n }\n }\n\n return prefixedHref;\n } else {\n return href;\n }\n}\n","import {COOKIE_LOCALE_NAME} from '../shared/constants';\n\nfunction getCookieValueByName(name: string) {\n // https://stackoverflow.com/a/15724300/343045\n const value = `; ${document.cookie}`;\n const parts = value.split(`; ${name}=`);\n if (parts.length === 2) {\n const part = parts.pop()?.split(';').shift();\n if (part) return part;\n }\n\n throw new Error(\n `Unable to find next-intl cookie, have you configured the middleware?`\n );\n}\n\nexport default function getCookieLocale() {\n return getCookieValueByName(COOKIE_LOCALE_NAME);\n}\n","export default function hasPathnamePrefixed(locale: string, pathname: string) {\n const prefix = `/${locale}`;\n return (\n pathname === prefix ||\n (pathname.startsWith(`${prefix}/`) && pathname.length > prefix.length)\n );\n}\n","'use client';\n\nimport NextLink from 'next/link';\nimport {usePathname} from 'next/navigation';\nimport React, {ComponentProps, forwardRef, useEffect, useState} from 'react';\nimport localizeHref from '../client/localizeHref';\n\ntype Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {\n locale?: string;\n};\n\n/**\n * Wraps `next/link` and prefixes the `href` with the current locale.\n *\n * Note that when a `locale` prop is passed, two de-optimizations are made:\n *\n * 1. The `prefetch` prop is not supported. This is because Next.js prefetches\n * the page and the `set-cookie` response header will cause the locale cookie\n * on the current page to be overwritten.\n * 2. A regular anchor tag is used instead of `next/link`. This is to avoid a\n * bug with Server Components where the markup wouldn't be updated correctly\n * otherwise.\n */\nfunction Link({href, locale, prefetch, ...rest}: Props, ref: Props['ref']) {\n const [localizedHref, setLocalizedHref] = useState<typeof href>(href);\n const pathname = usePathname();\n\n useEffect(() => {\n setLocalizedHref(localizeHref(href, locale, pathname ?? undefined));\n }, [href, locale, pathname]);\n\n if (locale !== undefined) {\n // If Next.js fixes the bug where the markup isn't updated correctly when\n // the locale changes, we can remove this check. Note however that we still\n // need to disable prefetching (see comment above).\n\n if (prefetch && process.env.NODE_ENV !== 'production') {\n console.error(\n 'The `prefetch` prop is currently not supported when using the `locale` prop on `Link`.`'\n );\n }\n\n let localizedHrefString;\n if (typeof localizedHref === 'string') {\n localizedHrefString = localizedHref;\n } else if (localizedHref) {\n localizedHrefString = localizedHref.toString();\n }\n\n return (\n // eslint-disable-next-line jsx-a11y/anchor-has-content\n <a ref={ref} href={localizedHrefString} {...rest} />\n );\n }\n\n return (\n <NextLink ref={ref} href={localizedHref} prefetch={prefetch} {...rest} />\n );\n}\n\nexport default forwardRef(Link);\n","import useRouter from '../client/useRouter';\n\n// TODO: Only available for backwards compatibility\n// during the beta, remove for stable release\n\nlet hasWarned = false;\n\nexport default function useLocalizedRouterDeprecated() {\n if (!hasWarned) {\n console.warn(\n `\\n\\nDEPRECATION WARNING: The \\`useLocalizedRouter\\` import from \\`next-intl\\` is deprecated and will be removed in the stable release of next-intl. Please import \\`useLocalizedRouter\\` from \\`next-intl/client\\` instead. See https://next-intl-docs.vercel.app/docs/next-13/server-components\\n\\n`\n );\n hasWarned = true;\n }\n\n return useRouter();\n}\n","'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\nexport default function NextIntlClientProvider({\n children,\n locale,\n now,\n ...rest\n}: Props) {\n let router;\n try {\n // Reading from context is practically ok to do conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n router = useRouter();\n } catch (error) {\n // Calling `useRouter` is not supported in the app folder\n }\n\n // The router can be undefined if used in a context outside\n // of Next.js (e.g. unit tests, Storybook, ...)\n if (!locale && router) {\n locale = router.locale;\n }\n\n // Currently RSC serialize dates to strings, therefore make sure we have\n // a date object. We might be able to remove this once more types have\n // first-class serialization support (https://github.com/facebook/react/issues/25687)\n if (typeof now === 'string') {\n now = new Date(now);\n }\n\n if (!locale) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? \"Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing).\"\n : undefined\n );\n }\n\n return (\n <IntlProvider locale={locale} now={now} {...rest}>\n {children}\n </IntlProvider>\n );\n}\n","/**\n * This is the main entry file when non-'react-server' environments import\n * from 'next-intl'. Make sure this mirrors the API from 'react-server'.\n */\n\nimport Link from './shared/Link';\n\nexport * from 'use-intl';\n\nexport {default as useLocalizedRouter} from './react-client/useLocalizedRouter';\nexport {default as Link} from './shared/Link';\n\n/** @deprecated Is called `Link` now. */\nexport const LocalizedLink = Link;\n\nexport {default as NextIntlClientProvider} from './shared/NextIntlClientProvider';\n\n// Legacy export for compatibility\nexport {default as NextIntlProvider} from './shared/NextIntlClientProvider';\n","import {useRouter as useNextRouter} from 'next/navigation';\nimport {useMemo} from 'react';\nimport localizeHref from './localizeHref';\n\nexport default function useRouter() {\n const router = useNextRouter();\n\n return useMemo(\n () => ({\n ...router,\n push(href: string) {\n return router.push(localizeHref(href));\n },\n replace(href: string) {\n return router.replace(localizeHref(href));\n },\n prefetch(href: string) {\n return router.prefetch(localizeHref(href));\n }\n }),\n [router]\n );\n}\n"],"names":["localizePathname","locale","pathname","localizedHref","localizeHref","href","cookieLocale","name","parts","document","cookie","split","length","_parts$pop","part","pop","shift","Error","getCookieValueByName","window","location","prefixedHref","isSwitchingLocale","isPathnamePrefixed","prefix","startsWith","hasPathnamePrefixed","Link","ref","localizedHrefString","prefetch","rest","_objectWithoutPropertiesLoose","_ref","_excluded","useState","_useState","setLocalizedHref","usePathname","useEffect","undefined","toString","React","createElement","_extends","NextLink","Link$1","forwardRef","hasWarned","NextIntlClientProvider","children","router","now","useRouter","error","Date","IntlProvider","LocalizedLink","console","warn","useNextRouter","useMemo","push","replace"],"mappings":"4mBAAc,SAAUA,EAAiBC,EAAgBC,GACnDC,IAAAA,EAAgB,IAAMF,EAM1B,MAJiB,MAAbC,IACFC,GAAiBD,GAGZC,ECQe,SAAAC,EACtBC,EACAJ,EACAC,GAEMI,IAAAA,EClBR,SAA8BC,GAE5B,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F,EAAe2B,SAAUA,GAAcC,IAIrE,IAAAe,EAAeC,EAAAA,WAAWpB,GCvDtBqB,GAAY,gCCOQ,SAAAC,EAKhBhB,GAJNiB,IAKIC,EALJD,IAAAA,SACAjD,IAAAA,OACAmD,IAAAA,IACGrB,EACGC,EAAAC,EAAAC,GAEF,IAGFiB,EAASE,EAASA,YAClB,MAAOC,IAiBL,IAXCrD,GAAUkD,IACblD,EAASkD,EAAOlD,QAMC,iBAARmD,IACTA,EAAM,IAAIG,KAAKH,KAGZnD,EACH,MAAM,IAAIgB,WAGJuB,GAIR,OACEE,UAACC,cAAAa,EAADA,aAAAZ,EAAA,CAAc3C,OAAQA,EAAQmD,IAAKA,GAASrB,GACzCmB,GCrCA,IAAMO,EAAgB9B,gIFNf,WAQZ,OAPKqB,IACHU,QAAQC,KAAR,gSAGAX,GAAY,GGRF,WACNG,IAAAA,EAASS,EAAAA,YAEf,OAAOC,EAAOA,SACZ,WAAA,OAAAjB,EAAA,GACKO,EADL,CAEEW,KAAKzD,SAAAA,GACI8C,OAAAA,EAAOW,KAAK1D,EAAaC,KAElC0D,QAAQ1D,SAAAA,GACC8C,OAAAA,EAAOY,QAAQ3D,EAAaC,KAErCyB,SAASzB,SAAAA,GACA8C,OAAAA,EAAOrB,SAAS1B,EAAaC,SAGxC,CAAC8C,IHLIE"}
|
package/dist/next-intl.esm.js
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
import Link from './shared/next-intl.esm.js';
|
|
2
2
|
export { default as Link } from './shared/next-intl.esm.js';
|
|
3
|
-
import NextIntlClientProvider from './shared/next-intl.esm2.js';
|
|
4
|
-
export { default as NextIntlClientProvider } from './shared/next-intl.esm2.js';
|
|
5
3
|
export * from 'use-intl';
|
|
6
4
|
export { default as useLocalizedRouter } from './react-client/next-intl.esm.js';
|
|
5
|
+
export { default as NextIntlClientProvider, default as NextIntlProvider } from './shared/next-intl.esm2.js';
|
|
7
6
|
|
|
8
7
|
/**
|
|
9
8
|
* This is the main entry file when non-'react-server' environments import
|
|
10
9
|
* from 'next-intl'. Make sure this mirrors the API from 'react-server'.
|
|
11
10
|
*/
|
|
12
|
-
/** @deprecated Is called `NextIntlClientProvider` now. */
|
|
13
|
-
|
|
14
|
-
var NextIntlProvider = NextIntlClientProvider;
|
|
15
11
|
/** @deprecated Is called `Link` now. */
|
|
16
12
|
|
|
17
13
|
var LocalizedLink = Link;
|
|
18
14
|
|
|
19
|
-
export { LocalizedLink
|
|
15
|
+
export { LocalizedLink };
|
|
20
16
|
//# sourceMappingURL=next-intl.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-intl.esm.js","sources":["../src/index.tsx"],"sourcesContent":["/**\n * This is the main entry file when non-'react-server' environments import\n * from 'next-intl'. Make sure this mirrors the API from 'react-server'.\n */\n\nimport Link from './shared/Link';\
|
|
1
|
+
{"version":3,"file":"next-intl.esm.js","sources":["../src/index.tsx"],"sourcesContent":["/**\n * This is the main entry file when non-'react-server' environments import\n * from 'next-intl'. Make sure this mirrors the API from 'react-server'.\n */\n\nimport Link from './shared/Link';\n\nexport * from 'use-intl';\n\nexport {default as useLocalizedRouter} from './react-client/useLocalizedRouter';\nexport {default as Link} from './shared/Link';\n\n/** @deprecated Is called `Link` now. */\nexport const LocalizedLink = Link;\n\nexport {default as NextIntlClientProvider} from './shared/NextIntlClientProvider';\n\n// Legacy export for compatibility\nexport {default as NextIntlProvider} from './shared/NextIntlClientProvider';\n"],"names":["LocalizedLink","Link"],"mappings":";;;;;;AAAA;;;AAGG;AASH;;AACO,IAAMA,aAAa,GAAGC;;;;"}
|
|
@@ -44,4 +44,4 @@ export declare const LocalizedLink: import("react").ForwardRefExoticComponent<Pi
|
|
|
44
44
|
children?: import("react").ReactNode;
|
|
45
45
|
} & import("react").RefAttributes<HTMLAnchorElement>, "locale"> & {
|
|
46
46
|
locale?: string | undefined;
|
|
47
|
-
}, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
47
|
+
}, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "tw" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import IntlConfig from 'use-intl/dist/core/IntlConfig';
|
|
2
2
|
import { GetRequestConfigParams } from './getRequestConfig';
|
|
3
|
-
declare const _default: (params: GetRequestConfigParams) =>
|
|
3
|
+
declare const _default: (params: GetRequestConfigParams) => IntlConfig | Promise<IntlConfig>;
|
|
4
4
|
export default _default;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
declare const getConfig: () => Promise<Omit<{
|
|
2
2
|
locale: string;
|
|
3
3
|
now: Date;
|
|
4
|
-
messages?: import("use-intl/dist/core/AbstractIntlMessages").default | undefined;
|
|
5
|
-
defaultTranslationValues?: import("use-intl/dist/core").RichTranslationValues | undefined;
|
|
6
4
|
formats?: Partial<import("use-intl/dist/core/Formats").default> | undefined;
|
|
7
|
-
|
|
5
|
+
timeZone?: string | undefined;
|
|
6
|
+
onError?: ((error: import("use-intl").IntlError) => void) | undefined;
|
|
8
7
|
getMessageFallback?: ((info: {
|
|
9
|
-
error: import("use-intl
|
|
8
|
+
error: import("use-intl").IntlError;
|
|
10
9
|
key: string;
|
|
11
10
|
namespace?: string | undefined;
|
|
12
11
|
}) => string) | undefined;
|
|
13
|
-
|
|
12
|
+
messages?: import("use-intl/dist/core/AbstractIntlMessages").default | undefined;
|
|
13
|
+
defaultTranslationValues?: import("use-intl").RichTranslationValues | undefined;
|
|
14
14
|
}, "onError" | "getMessageFallback" | "messages"> & {
|
|
15
15
|
messages: import("use-intl/dist/src/core/AbstractIntlMessages").default | undefined;
|
|
16
16
|
onError: (error: import("use-intl/dist/src").IntlError) => void;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import IntlConfig from 'use-intl/dist/core/IntlConfig';
|
|
2
|
+
declare type RequestConfig = Omit<IntlConfig, 'locale'>;
|
|
2
3
|
export declare type GetRequestConfigParams = {
|
|
3
4
|
locale: string;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Should be called in `i18n.ts` to create the configuration for the current request.
|
|
8
|
+
*/
|
|
9
|
+
export default function getRequestConfig(createRequestConfig: ({ locale }: GetRequestConfigParams) => RequestConfig | Promise<RequestConfig>): ({ locale }: GetRequestConfigParams) => RequestConfig | Promise<RequestConfig>;
|
|
10
|
+
export {};
|
package/dist/shared/Link.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ import React, { ComponentProps } from 'react';
|
|
|
3
3
|
declare type Props = Omit<ComponentProps<typeof NextLink>, 'locale'> & {
|
|
4
4
|
locale?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "tw" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
7
7
|
export default _default;
|
|
@@ -3,5 +3,5 @@ import React, { ComponentProps } from 'react';
|
|
|
3
3
|
declare type Props = Omit<ComponentProps<typeof Link>, 'locale'> & {
|
|
4
4
|
locale?: string;
|
|
5
5
|
};
|
|
6
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "href" | "as" | "replace" | "scroll" | "shallow" | "passHref" | "prefetch" | "locale" | "legacyBehavior" | "onMouseEnter" | "onTouchStart" | "onClick" | "download" | "hrefLang" | "media" | "ping" | "rel" | "target" | "type" | "referrerPolicy" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "tw" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
7
7
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next-intl.esm2.js","sources":["../../src/shared/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\
|
|
1
|
+
{"version":3,"file":"next-intl.esm2.js","sources":["../../src/shared/NextIntlClientProvider.tsx"],"sourcesContent":["'use client';\n\nimport {useRouter} from 'next/router';\nimport React, {ComponentProps} from 'react';\nimport {IntlProvider} from 'use-intl';\n\ntype Props = Omit<ComponentProps<typeof IntlProvider>, 'locale' | 'now'> & {\n locale?: string;\n /** If a string is supplied, make sure this conforms to the ISO 8601 format (YYYY-MM-DDTHH:mm:ss.sssZ */\n now?: Date | string;\n};\n\nexport default function NextIntlClientProvider({\n children,\n locale,\n now,\n ...rest\n}: Props) {\n let router;\n try {\n // Reading from context is practically ok to do conditionally\n // eslint-disable-next-line react-hooks/rules-of-hooks\n router = useRouter();\n } catch (error) {\n // Calling `useRouter` is not supported in the app folder\n }\n\n // The router can be undefined if used in a context outside\n // of Next.js (e.g. unit tests, Storybook, ...)\n if (!locale && router) {\n locale = router.locale;\n }\n\n // Currently RSC serialize dates to strings, therefore make sure we have\n // a date object. We might be able to remove this once more types have\n // first-class serialization support (https://github.com/facebook/react/issues/25687)\n if (typeof now === 'string') {\n now = new Date(now);\n }\n\n if (!locale) {\n throw new Error(\n process.env.NODE_ENV !== 'production'\n ? \"Couldn't determine locale. Please pass an explicit `locale` prop the provider, or if you're using the `pages` folder, use internationalized routing (https://nextjs.org/docs/advanced-features/i18n-routing).\"\n : undefined\n );\n }\n\n return (\n <IntlProvider locale={locale} now={now} {...rest}>\n {children}\n </IntlProvider>\n );\n}\n"],"names":["NextIntlClientProvider","children","locale","now","rest","router","useRouter","error","Date","Error","process","env","NODE_ENV","undefined","React","createElement","IntlProvider"],"mappings":";;;;;;AAYwB,SAAAA,sBAAA,CAKhB,IAAA,EAAA;AAAA,EAJNC,IAAAA,QAIM,QAJNA,QAIM;AAAA,MAHNC,MAGM,QAHNA,MAGM;AAAA,MAFNC,GAEM,QAFNA,GAEM;AAAA,MADHC,IACG,GAAA,6BAAA,CAAA,IAAA,EAAA,SAAA,CAAA,CAAA;;AACN,EAAA,IAAIC,MAAJ,CAAA;;AACA,EAAI,IAAA;AACF;AACA;AACAA,IAAAA,MAAM,GAAGC,SAAS,EAAlB,CAAA;AACD,GAJD,CAIE,OAAOC,KAAP,EAAc;AAEf,GARK;AAWN;;;AACA,EAAA,IAAI,CAACL,MAAD,IAAWG,MAAf,EAAuB;AACrBH,IAAAA,MAAM,GAAGG,MAAM,CAACH,MAAhB,CAAA;AACD,GAdK;AAiBN;AACA;;;AACA,EAAA,IAAI,OAAOC,GAAP,KAAe,QAAnB,EAA6B;AAC3BA,IAAAA,GAAG,GAAG,IAAIK,IAAJ,CAASL,GAAT,CAAN,CAAA;AACD,GAAA;;AAED,EAAI,IAAA,CAACD,MAAL,EAAa;AACX,IAAA,MAAM,IAAIO,KAAJ,CACJC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,GACI,+MADJ,GAEIC,SAHA,CAAN,CAAA;AAKD,GAAA;;AAED,EAAA,OACEC,KAAC,CAAAC,aAAD,CAACC,YAAD,EAAA,QAAA,CAAA;AAAcd,IAAAA,MAAM,EAAEA,MAAtB;AAA8BC,IAAAA,GAAG,EAAEA,GAAAA;AAAnC,GAA4CC,EAAAA,IAA5C,CACGH,EAAAA,QADH,CADF,CAAA;AAKD;;;;"}
|