vinext 0.0.52 → 0.0.54
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/README.md +1 -1
- package/dist/build/clean-output.d.ts +14 -0
- package/dist/build/clean-output.js +36 -0
- package/dist/build/clean-output.js.map +1 -0
- package/dist/build/inline-css.d.ts +7 -0
- package/dist/build/inline-css.js +50 -0
- package/dist/build/inline-css.js.map +1 -0
- package/dist/build/prerender.d.ts +6 -2
- package/dist/build/prerender.js +51 -12
- package/dist/build/prerender.js.map +1 -1
- package/dist/build/run-prerender.js +10 -1
- package/dist/build/run-prerender.js.map +1 -1
- package/dist/build/static-export.d.ts +5 -0
- package/dist/build/static-export.js +8 -3
- package/dist/build/static-export.js.map +1 -1
- package/dist/check.js +4 -0
- package/dist/check.js.map +1 -1
- package/dist/cli.js +19 -4
- package/dist/cli.js.map +1 -1
- package/dist/client/instrumentation-client-inject.d.ts +34 -0
- package/dist/client/instrumentation-client-inject.js +57 -0
- package/dist/client/instrumentation-client-inject.js.map +1 -0
- package/dist/client/navigation-runtime.d.ts +16 -2
- package/dist/client/navigation-runtime.js +16 -1
- package/dist/client/navigation-runtime.js.map +1 -1
- package/dist/client/vinext-next-data.d.ts +2 -1
- package/dist/client/vinext-next-data.js.map +1 -1
- package/dist/client/window-next.d.ts +17 -2
- package/dist/client/window-next.js.map +1 -1
- package/dist/cloudflare/tpr.js +1 -1
- package/dist/cloudflare/tpr.js.map +1 -1
- package/dist/config/config-matchers.js +2 -1
- package/dist/config/config-matchers.js.map +1 -1
- package/dist/config/next-config.d.ts +95 -4
- package/dist/config/next-config.js +173 -14
- package/dist/config/next-config.js.map +1 -1
- package/dist/deploy.js +42 -7
- package/dist/deploy.js.map +1 -1
- package/dist/entries/app-browser-entry.d.ts +11 -1
- package/dist/entries/app-browser-entry.js +16 -6
- package/dist/entries/app-browser-entry.js.map +1 -1
- package/dist/entries/app-rsc-entry.d.ts +12 -3
- package/dist/entries/app-rsc-entry.js +41 -8
- package/dist/entries/app-rsc-entry.js.map +1 -1
- package/dist/entries/app-rsc-manifest.d.ts +21 -1
- package/dist/entries/app-rsc-manifest.js +6 -4
- package/dist/entries/app-rsc-manifest.js.map +1 -1
- package/dist/entries/pages-client-entry.d.ts +4 -1
- package/dist/entries/pages-client-entry.js +40 -3
- package/dist/entries/pages-client-entry.js.map +1 -1
- package/dist/entries/pages-server-entry.js +292 -34
- package/dist/entries/pages-server-entry.js.map +1 -1
- package/dist/entries/runtime-entry-module.d.ts +1 -10
- package/dist/entries/runtime-entry-module.js +2 -12
- package/dist/entries/runtime-entry-module.js.map +1 -1
- package/dist/index.js +91 -10
- package/dist/index.js.map +1 -1
- package/dist/plugins/fonts.js +25 -2
- package/dist/plugins/fonts.js.map +1 -1
- package/dist/plugins/remove-console.d.ts +16 -0
- package/dist/plugins/remove-console.js +176 -0
- package/dist/plugins/remove-console.js.map +1 -0
- package/dist/routing/app-route-graph.d.ts +24 -1
- package/dist/routing/app-route-graph.js +52 -4
- package/dist/routing/app-route-graph.js.map +1 -1
- package/dist/routing/app-router.d.ts +2 -2
- package/dist/routing/app-router.js +2 -2
- package/dist/routing/app-router.js.map +1 -1
- package/dist/routing/file-matcher.d.ts +21 -1
- package/dist/routing/file-matcher.js +39 -1
- package/dist/routing/file-matcher.js.map +1 -1
- package/dist/routing/pages-router.d.ts +1 -1
- package/dist/routing/pages-router.js +10 -3
- package/dist/routing/pages-router.js.map +1 -1
- package/dist/routing/route-trie.js +13 -18
- package/dist/routing/route-trie.js.map +1 -1
- package/dist/routing/utils.d.ts +11 -1
- package/dist/routing/utils.js +15 -1
- package/dist/routing/utils.js.map +1 -1
- package/dist/server/api-handler.js +19 -10
- package/dist/server/api-handler.js.map +1 -1
- package/dist/server/app-browser-action-result.d.ts +16 -1
- package/dist/server/app-browser-action-result.js +15 -1
- package/dist/server/app-browser-action-result.js.map +1 -1
- package/dist/server/app-browser-entry.js +47 -28
- package/dist/server/app-browser-entry.js.map +1 -1
- package/dist/server/app-browser-navigation-controller.d.ts +2 -0
- package/dist/server/app-browser-navigation-controller.js +4 -0
- package/dist/server/app-browser-navigation-controller.js.map +1 -1
- package/dist/server/app-elements-wire.d.ts +13 -4
- package/dist/server/app-elements-wire.js +10 -1
- package/dist/server/app-elements-wire.js.map +1 -1
- package/dist/server/app-elements.d.ts +2 -2
- package/dist/server/app-elements.js +2 -2
- package/dist/server/app-elements.js.map +1 -1
- package/dist/server/app-fallback-renderer.d.ts +27 -8
- package/dist/server/app-fallback-renderer.js +19 -8
- package/dist/server/app-fallback-renderer.js.map +1 -1
- package/dist/server/app-history-state.js +6 -2
- package/dist/server/app-history-state.js.map +1 -1
- package/dist/server/app-inline-css-client.d.ts +7 -0
- package/dist/server/app-inline-css-client.js +37 -0
- package/dist/server/app-inline-css-client.js.map +1 -0
- package/dist/server/app-interception-context-header.d.ts +33 -0
- package/dist/server/app-interception-context-header.js +44 -0
- package/dist/server/app-interception-context-header.js.map +1 -0
- package/dist/server/app-mounted-slots-header.d.ts +19 -0
- package/dist/server/app-mounted-slots-header.js +40 -1
- package/dist/server/app-mounted-slots-header.js.map +1 -1
- package/dist/server/app-optimistic-routing.js +26 -18
- package/dist/server/app-optimistic-routing.js.map +1 -1
- package/dist/server/app-page-boundary-render.d.ts +1 -0
- package/dist/server/app-page-boundary-render.js +2 -0
- package/dist/server/app-page-boundary-render.js.map +1 -1
- package/dist/server/app-page-boundary.d.ts +22 -1
- package/dist/server/app-page-boundary.js +30 -3
- package/dist/server/app-page-boundary.js.map +1 -1
- package/dist/server/app-page-cache.d.ts +9 -3
- package/dist/server/app-page-cache.js +14 -8
- package/dist/server/app-page-cache.js.map +1 -1
- package/dist/server/app-page-dispatch.d.ts +13 -1
- package/dist/server/app-page-dispatch.js +136 -82
- package/dist/server/app-page-dispatch.js.map +1 -1
- package/dist/server/app-page-element-builder.d.ts +2 -1
- package/dist/server/app-page-element-builder.js +17 -30
- package/dist/server/app-page-element-builder.js.map +1 -1
- package/dist/server/app-page-execution.d.ts +1 -0
- package/dist/server/app-page-execution.js +2 -0
- package/dist/server/app-page-execution.js.map +1 -1
- package/dist/server/app-page-head.d.ts +1 -0
- package/dist/server/app-page-head.js +8 -0
- package/dist/server/app-page-head.js.map +1 -1
- package/dist/server/app-page-render-identity.d.ts +22 -0
- package/dist/server/app-page-render-identity.js +42 -0
- package/dist/server/app-page-render-identity.js.map +1 -0
- package/dist/server/app-page-render-observation.js +1 -1
- package/dist/server/app-page-render.d.ts +9 -1
- package/dist/server/app-page-render.js +8 -2
- package/dist/server/app-page-render.js.map +1 -1
- package/dist/server/app-page-request.d.ts +6 -3
- package/dist/server/app-page-request.js +5 -2
- package/dist/server/app-page-request.js.map +1 -1
- package/dist/server/app-page-response.d.ts +11 -1
- package/dist/server/app-page-response.js +16 -4
- package/dist/server/app-page-response.js.map +1 -1
- package/dist/server/app-page-route-wiring.d.ts +16 -0
- package/dist/server/app-page-route-wiring.js +25 -10
- package/dist/server/app-page-route-wiring.js.map +1 -1
- package/dist/server/app-page-stream.d.ts +12 -0
- package/dist/server/app-page-stream.js +3 -0
- package/dist/server/app-page-stream.js.map +1 -1
- package/dist/server/app-route-handler-dispatch.d.ts +1 -0
- package/dist/server/app-route-handler-dispatch.js +3 -0
- package/dist/server/app-route-handler-dispatch.js.map +1 -1
- package/dist/server/app-route-handler-execution.d.ts +1 -0
- package/dist/server/app-route-handler-execution.js +1 -0
- package/dist/server/app-route-handler-execution.js.map +1 -1
- package/dist/server/app-route-handler-response.js +38 -6
- package/dist/server/app-route-handler-response.js.map +1 -1
- package/dist/server/app-rsc-handler.d.ts +16 -3
- package/dist/server/app-rsc-handler.js +60 -11
- package/dist/server/app-rsc-handler.js.map +1 -1
- package/dist/server/app-rsc-request-normalization.d.ts +2 -1
- package/dist/server/app-rsc-request-normalization.js +6 -4
- package/dist/server/app-rsc-request-normalization.js.map +1 -1
- package/dist/server/app-segment-config.d.ts +4 -1
- package/dist/server/app-segment-config.js +6 -1
- package/dist/server/app-segment-config.js.map +1 -1
- package/dist/server/app-server-action-execution.d.ts +22 -3
- package/dist/server/app-server-action-execution.js +46 -7
- package/dist/server/app-server-action-execution.js.map +1 -1
- package/dist/server/app-ssr-entry.d.ts +6 -0
- package/dist/server/app-ssr-entry.js +57 -6
- package/dist/server/app-ssr-entry.js.map +1 -1
- package/dist/server/app-ssr-error-meta.js +3 -3
- package/dist/server/app-ssr-error-meta.js.map +1 -1
- package/dist/server/app-ssr-stream.d.ts +25 -1
- package/dist/server/app-ssr-stream.js +237 -19
- package/dist/server/app-ssr-stream.js.map +1 -1
- package/dist/server/app-static-generation.d.ts +1 -0
- package/dist/server/app-static-generation.js +2 -1
- package/dist/server/app-static-generation.js.map +1 -1
- package/dist/server/client-trace-metadata.d.ts +31 -0
- package/dist/server/client-trace-metadata.js +83 -0
- package/dist/server/client-trace-metadata.js.map +1 -0
- package/dist/server/cookie-utils.d.ts +13 -0
- package/dist/server/cookie-utils.js +20 -0
- package/dist/server/cookie-utils.js.map +1 -0
- package/dist/server/default-not-found-module.d.ts +20 -0
- package/dist/server/default-not-found-module.js +20 -0
- package/dist/server/default-not-found-module.js.map +1 -0
- package/dist/server/dev-server.d.ts +8 -1
- package/dist/server/dev-server.js +56 -11
- package/dist/server/dev-server.js.map +1 -1
- package/dist/server/headers.d.ts +5 -1
- package/dist/server/headers.js +5 -1
- package/dist/server/headers.js.map +1 -1
- package/dist/server/html.d.ts +2 -1
- package/dist/server/html.js +6 -1
- package/dist/server/html.js.map +1 -1
- package/dist/server/image-optimization.d.ts +13 -4
- package/dist/server/image-optimization.js +15 -4
- package/dist/server/image-optimization.js.map +1 -1
- package/dist/server/isr-cache.d.ts +7 -5
- package/dist/server/isr-cache.js +17 -6
- package/dist/server/isr-cache.js.map +1 -1
- package/dist/server/middleware-runtime.js +1 -2
- package/dist/server/middleware-runtime.js.map +1 -1
- package/dist/server/middleware.js +1 -1
- package/dist/server/middleware.js.map +1 -1
- package/dist/server/pages-api-route.d.ts +18 -0
- package/dist/server/pages-api-route.js +3 -1
- package/dist/server/pages-api-route.js.map +1 -1
- package/dist/server/pages-body-parser-config.d.ts +60 -0
- package/dist/server/pages-body-parser-config.js +79 -0
- package/dist/server/pages-body-parser-config.js.map +1 -0
- package/dist/server/pages-data-route.js +1 -0
- package/dist/server/pages-data-route.js.map +1 -1
- package/dist/server/pages-default-404.d.ts +31 -0
- package/dist/server/pages-default-404.js +40 -0
- package/dist/server/pages-default-404.js.map +1 -0
- package/dist/server/pages-document-initial-props.d.ts +7 -0
- package/dist/server/pages-document-initial-props.js +14 -0
- package/dist/server/pages-document-initial-props.js.map +1 -0
- package/dist/server/pages-node-compat.d.ts +10 -0
- package/dist/server/pages-node-compat.js +12 -1
- package/dist/server/pages-node-compat.js.map +1 -1
- package/dist/server/pages-page-data.d.ts +40 -0
- package/dist/server/pages-page-data.js +19 -14
- package/dist/server/pages-page-data.js.map +1 -1
- package/dist/server/pages-page-method.d.ts +48 -0
- package/dist/server/pages-page-method.js +19 -0
- package/dist/server/pages-page-method.js.map +1 -0
- package/dist/server/pages-page-response.d.ts +8 -0
- package/dist/server/pages-page-response.js +21 -11
- package/dist/server/pages-page-response.js.map +1 -1
- package/dist/server/pages-serializable-props.d.ts +25 -0
- package/dist/server/pages-serializable-props.js +69 -0
- package/dist/server/pages-serializable-props.js.map +1 -0
- package/dist/server/prerender-route-params.d.ts +14 -0
- package/dist/server/prerender-route-params.js +94 -0
- package/dist/server/prerender-route-params.js.map +1 -0
- package/dist/server/prod-server.d.ts +3 -23
- package/dist/server/prod-server.js +43 -57
- package/dist/server/prod-server.js.map +1 -1
- package/dist/server/proxy-trust.d.ts +41 -0
- package/dist/server/proxy-trust.js +70 -0
- package/dist/server/proxy-trust.js.map +1 -0
- package/dist/server/request-pipeline.d.ts +3 -3
- package/dist/server/request-pipeline.js +5 -4
- package/dist/server/request-pipeline.js.map +1 -1
- package/dist/server/seed-cache.js +12 -6
- package/dist/server/seed-cache.js.map +1 -1
- package/dist/server/server-action-not-found.js +3 -2
- package/dist/server/server-action-not-found.js.map +1 -1
- package/dist/server/static-file-cache.js +2 -1
- package/dist/server/static-file-cache.js.map +1 -1
- package/dist/server/streaming-metadata.d.ts +5 -0
- package/dist/server/streaming-metadata.js +10 -0
- package/dist/server/streaming-metadata.js.map +1 -0
- package/dist/shims/app-router-scroll-state.d.ts +14 -0
- package/dist/shims/app-router-scroll-state.js +51 -0
- package/dist/shims/app-router-scroll-state.js.map +1 -0
- package/dist/shims/app-router-scroll.d.ts +28 -0
- package/dist/shims/app-router-scroll.js +115 -0
- package/dist/shims/app-router-scroll.js.map +1 -0
- package/dist/shims/before-interactive-context.d.ts +30 -0
- package/dist/shims/before-interactive-context.js +10 -0
- package/dist/shims/before-interactive-context.js.map +1 -0
- package/dist/shims/cache-runtime.d.ts +1 -1
- package/dist/shims/cache-runtime.js +14 -1
- package/dist/shims/cache-runtime.js.map +1 -1
- package/dist/shims/cache.d.ts +6 -0
- package/dist/shims/cache.js +7 -0
- package/dist/shims/cache.js.map +1 -1
- package/dist/shims/default-not-found.d.ts +12 -0
- package/dist/shims/default-not-found.js +61 -0
- package/dist/shims/default-not-found.js.map +1 -0
- package/dist/shims/error.js +3 -0
- package/dist/shims/error.js.map +1 -1
- package/dist/shims/font-local.d.ts +5 -0
- package/dist/shims/font-local.js +6 -2
- package/dist/shims/font-local.js.map +1 -1
- package/dist/shims/head.js +4 -4
- package/dist/shims/head.js.map +1 -1
- package/dist/shims/headers.d.ts +13 -2
- package/dist/shims/headers.js +73 -22
- package/dist/shims/headers.js.map +1 -1
- package/dist/shims/image.d.ts +1 -1
- package/dist/shims/image.js +4 -4
- package/dist/shims/image.js.map +1 -1
- package/dist/shims/internal/app-route-detection.d.ts +37 -0
- package/dist/shims/internal/app-route-detection.js +69 -0
- package/dist/shims/internal/app-route-detection.js.map +1 -0
- package/dist/shims/internal/pages-data-target.d.ts +58 -0
- package/dist/shims/internal/pages-data-target.js +91 -0
- package/dist/shims/internal/pages-data-target.js.map +1 -0
- package/dist/shims/internal/pages-data-url.d.ts +42 -0
- package/dist/shims/internal/pages-data-url.js +73 -0
- package/dist/shims/internal/pages-data-url.js.map +1 -0
- package/dist/shims/link.d.ts +18 -2
- package/dist/shims/link.js +129 -15
- package/dist/shims/link.js.map +1 -1
- package/dist/shims/metadata.d.ts +9 -7
- package/dist/shims/metadata.js +70 -7
- package/dist/shims/metadata.js.map +1 -1
- package/dist/shims/navigation.d.ts +1 -2
- package/dist/shims/navigation.js +94 -20
- package/dist/shims/navigation.js.map +1 -1
- package/dist/shims/router.d.ts +5 -0
- package/dist/shims/router.js +389 -80
- package/dist/shims/router.js.map +1 -1
- package/dist/shims/script.d.ts +11 -1
- package/dist/shims/script.js +158 -15
- package/dist/shims/script.js.map +1 -1
- package/dist/shims/server.js +1 -0
- package/dist/shims/server.js.map +1 -1
- package/dist/shims/url-utils.d.ts +2 -1
- package/dist/shims/url-utils.js +15 -4
- package/dist/shims/url-utils.js.map +1 -1
- package/dist/utils/html-limited-bots.d.ts +5 -0
- package/dist/utils/html-limited-bots.js +15 -0
- package/dist/utils/html-limited-bots.js.map +1 -0
- package/dist/utils/path.d.ts +13 -0
- package/dist/utils/path.js +16 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/utils/query.d.ts +6 -0
- package/dist/utils/query.js +10 -1
- package/dist/utils/query.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","names":[],"sources":["../../src/shims/metadata.tsx"],"sourcesContent":["/**\n * Metadata support for App Router.\n *\n * Handles `export const metadata` and `export async function generateMetadata()`.\n * Resolves metadata from layouts and pages (pages override layouts).\n */\nimport React from \"react\";\nimport { makeThenableParams } from \"./thenable-params.js\";\nimport { isAbsoluteOrProtocolRelativeUrl } from \"./url-utils.js\";\n\n// ---------------------------------------------------------------------------\n// Viewport types and resolution\n// ---------------------------------------------------------------------------\n\nexport type Viewport = {\n /** Viewport width (default: \"device-width\") */\n width?: string | number;\n /** Viewport height */\n height?: string | number;\n /** Initial scale */\n initialScale?: number;\n /** Minimum scale */\n minimumScale?: number;\n /** Maximum scale */\n maximumScale?: number;\n /** Whether user can scale */\n userScalable?: boolean;\n /** Theme color — single color or array of { media, color } */\n themeColor?: string | Array<{ media?: string; color: string }>;\n /** Color scheme: 'light' | 'dark' | 'light dark' | 'normal' */\n colorScheme?: string;\n};\n\n/**\n * Resolve viewport config from a module. Handles both static `viewport` export\n * and async `generateViewport()` function.\n */\nexport async function resolveModuleViewport(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]>,\n): Promise<Viewport | null> {\n if (typeof mod.generateViewport === \"function\") {\n const asyncParams = makeThenableParams(params);\n return await mod.generateViewport({ params: asyncParams });\n }\n if (mod.viewport && typeof mod.viewport === \"object\") {\n return mod.viewport as Viewport;\n }\n return null;\n}\n\n/**\n * Merge viewport configs from multiple sources (layouts + page).\n * Later entries override earlier ones.\n */\nexport const DEFAULT_VIEWPORT: Viewport = {\n width: \"device-width\",\n initialScale: 1,\n};\n\nexport function mergeViewport(viewportList: Viewport[]): Viewport {\n const merged: Viewport = { ...DEFAULT_VIEWPORT };\n for (const vp of viewportList) {\n Object.assign(merged, vp);\n }\n return merged;\n}\n\n/**\n * React component that renders viewport meta tags into <head>.\n */\nexport function ViewportHead({ viewport }: { viewport: Viewport }) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Build viewport content string\n const parts: string[] = [];\n if (viewport.width !== undefined) parts.push(`width=${viewport.width}`);\n if (viewport.height !== undefined) parts.push(`height=${viewport.height}`);\n if (viewport.initialScale !== undefined) parts.push(`initial-scale=${viewport.initialScale}`);\n if (viewport.minimumScale !== undefined) parts.push(`minimum-scale=${viewport.minimumScale}`);\n if (viewport.maximumScale !== undefined) parts.push(`maximum-scale=${viewport.maximumScale}`);\n if (viewport.userScalable !== undefined)\n parts.push(`user-scalable=${viewport.userScalable ? \"yes\" : \"no\"}`);\n\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"viewport\" content={parts.join(\", \")} />);\n }\n\n // Theme color\n if (viewport.themeColor) {\n if (typeof viewport.themeColor === \"string\") {\n elements.push(<meta key={key++} name=\"theme-color\" content={viewport.themeColor} />);\n } else if (Array.isArray(viewport.themeColor)) {\n for (const entry of viewport.themeColor) {\n elements.push(\n <meta\n key={key++}\n name=\"theme-color\"\n content={entry.color}\n {...(entry.media ? { media: entry.media } : {})}\n />,\n );\n }\n }\n }\n\n // Color scheme\n if (viewport.colorScheme) {\n elements.push(<meta key={key++} name=\"color-scheme\" content={viewport.colorScheme} />);\n }\n\n return <>{elements}</>;\n}\n\n// ---------------------------------------------------------------------------\n// Metadata types and resolution\n// ---------------------------------------------------------------------------\n\nexport type Metadata = {\n title?: string | { default?: string; template?: string; absolute?: string };\n description?: string;\n generator?: string;\n applicationName?: string;\n referrer?: string;\n keywords?: string | string[];\n authors?: Array<{ name?: string; url?: string }> | { name?: string; url?: string };\n creator?: string;\n publisher?: string;\n robots?:\n | string\n | {\n index?: boolean;\n follow?: boolean;\n googleBot?: string | { index?: boolean; follow?: boolean; [key: string]: unknown };\n [key: string]: unknown;\n };\n openGraph?: {\n title?: string;\n description?: string;\n url?: string | URL;\n siteName?: string;\n images?: string | URL | SocialImageDescriptor | Array<string | URL | SocialImageDescriptor>;\n videos?: Array<{ url: string | URL; width?: number; height?: number }>;\n audio?: Array<{ url: string | URL }>;\n locale?: string;\n type?: string;\n publishedTime?: string;\n modifiedTime?: string;\n authors?: string[];\n };\n twitter?: {\n card?: string;\n site?: string;\n siteId?: string;\n title?: string;\n description?: string;\n images?: string | URL | SocialImageDescriptor | Array<string | URL | SocialImageDescriptor>;\n creator?: string;\n creatorId?: string;\n players?: TwitterPlayerDescriptor | TwitterPlayerDescriptor[];\n app?: TwitterAppDescriptor;\n };\n icons?: IconsMetadata;\n manifest?: string | URL;\n alternates?: {\n canonical?: string | URL;\n languages?: Record<string, string | URL>;\n media?: Record<string, string | URL>;\n types?: Record<string, string | URL>;\n };\n verification?: {\n google?: string;\n yahoo?: string;\n yandex?: string;\n other?: Record<string, string | string[]>;\n };\n metadataBase?: URL | null;\n appleWebApp?: {\n capable?: boolean;\n title?: string;\n statusBarStyle?: string;\n startupImage?: string | Array<{ url: string; media?: string }>;\n };\n formatDetection?: {\n email?: boolean;\n address?: boolean;\n telephone?: boolean;\n };\n category?: string;\n itunes?: {\n appId: string;\n appArgument?: string;\n };\n appLinks?: {\n ios?: AppLinksApple | AppLinksApple[];\n iphone?: AppLinksApple | AppLinksApple[];\n ipad?: AppLinksApple | AppLinksApple[];\n android?: AppLinksAndroid | AppLinksAndroid[];\n windows_phone?: AppLinksWindows | AppLinksWindows[];\n windows?: AppLinksWindows | AppLinksWindows[];\n windows_universal?: AppLinksWindows | AppLinksWindows[];\n web?: AppLinksWeb | AppLinksWeb[];\n };\n other?: Record<string, string | string[]>;\n [key: string]: unknown;\n};\n\ntype AppLinksApple = {\n url: string | URL;\n app_store_id?: string | number;\n app_name?: string;\n};\n\ntype AppLinksAndroid = {\n package: string;\n url?: string | URL;\n class?: string;\n app_name?: string;\n};\n\ntype AppLinksWindows = {\n url: string | URL;\n app_id?: string;\n app_name?: string;\n};\n\ntype AppLinksWeb = {\n url: string | URL;\n should_fallback?: boolean;\n};\n\ntype TwitterPlayerDescriptor = {\n playerUrl: string | URL;\n streamUrl: string | URL;\n width: number;\n height: number;\n};\n\ntype TwitterAppDescriptor = {\n id: {\n iphone?: string | number;\n ipad?: string | number;\n googleplay?: string;\n };\n url?: {\n iphone?: string | URL;\n ipad?: string | URL;\n googleplay?: string | URL;\n };\n name?: string;\n};\n\ntype SocialImageDescriptor = {\n url: string | URL;\n alt?: string;\n width?: number;\n height?: number;\n type?: string;\n};\n\ntype IconDescriptor = {\n url: string | URL;\n sizes?: string;\n type?: string;\n media?: string;\n};\n\ntype AppleIconDescriptor = {\n url: string | URL;\n sizes?: string;\n type?: string;\n};\n\ntype IconInput = string | URL | IconDescriptor;\ntype AppleIconInput = string | URL | AppleIconDescriptor;\n\ntype IconsMap = {\n icon?: IconInput | IconInput[];\n shortcut?: string | URL | Array<string | URL>;\n apple?: AppleIconInput | AppleIconInput[];\n other?: Array<{ rel: string; url: string | URL; sizes?: string; type?: string }>;\n};\n\ntype IconsMetadata = IconInput | IconInput[] | IconsMap;\n\nexport type MetadataMergeEntry = {\n contributesTitle?: boolean;\n isPage?: boolean;\n metadata: Metadata;\n};\n\n/**\n * Merge metadata from multiple sources (layouts + page).\n *\n * The list is ordered [rootLayout, nestedLayout, ..., page].\n * Title template from layouts applies to the page title but NOT to\n * the segment that defines the template itself. `title.absolute`\n * skips all templates. `title.default` is the fallback when no\n * child provides a title.\n *\n * Shallow merge: later entries override earlier ones (per Next.js docs).\n */\nexport function mergeMetadata(metadataList: Metadata[]): Metadata {\n const merged = mergeMetadataEntries(\n metadataList.map((metadata, index) => ({\n isPage: index === metadataList.length - 1,\n metadata,\n })),\n );\n return postProcessMetadata(merged);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === \"object\" && value !== null && !Array.isArray(value) && !(value instanceof URL)\n );\n}\n\nfunction isOtherMetadata(value: unknown): value is NonNullable<Metadata[\"other\"]> {\n if (!isPlainObject(value)) return false;\n return Object.values(value).every((item) => {\n if (typeof item === \"string\") return true;\n return Array.isArray(item) && item.every((nestedItem) => typeof nestedItem === \"string\");\n });\n}\n\n/**\n * Extract a plain string title from a metadata title value.\n */\nfunction resolveStringTitle(title: Metadata[\"title\"]): string | undefined {\n if (typeof title === \"string\") return title;\n if (title && typeof title === \"object\") {\n return title.absolute ?? title.default ?? undefined;\n }\n return undefined;\n}\n\nfunction applyTitleTemplate(template: string | undefined, title: string): string {\n return template ? template.replace(/%s/g, title) : title;\n}\n\nfunction resolveTitle(title: Metadata[\"title\"], stashedTemplate: string | undefined) {\n if (typeof title === \"string\") {\n return applyTitleTemplate(stashedTemplate, title);\n }\n\n if (title && typeof title === \"object\") {\n let resolved =\n title.default === undefined ? undefined : applyTitleTemplate(stashedTemplate, title.default);\n\n if (title.absolute) {\n resolved = title.absolute;\n }\n\n return resolved;\n }\n\n return undefined;\n}\n\n/**\n * Post-process merged metadata to cross-fill openGraph and Twitter fields.\n *\n * Next.js runs this once after all layouts/pages and file-based metadata\n * have been resolved. When openGraph exists, it auto-fills missing\n * twitter:title/description/images from openGraph (falling back to root\n * metadata title/description). Existing openGraph/twitter objects also inherit\n * missing title/description from root metadata.\n *\n * Ported from Next.js:\n * https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/metadata/resolve-metadata.ts\n */\nexport function postProcessMetadata(merged: Metadata): Metadata {\n // Shallow-clone to avoid mutating the caller's object.\n // Both current call sites (mergeMetadata, resolveAppPageHead) pass\n // freshly-constructed objects, but this guards against future misuse.\n const result = { ...merged };\n\n const resolvedTitle = resolveStringTitle(result.title);\n\n // openGraph inherits title/description from root metadata when absent\n if (result.openGraph) {\n const og = { ...result.openGraph };\n if (!og.title && resolvedTitle) {\n og.title = resolvedTitle;\n }\n if (!og.description && result.description) {\n og.description = result.description;\n }\n result.openGraph = og;\n }\n\n if (result.openGraph) {\n const autoFill: {\n title?: string;\n description?: string;\n images?: NonNullable<Metadata[\"twitter\"]>[\"images\"];\n } = {};\n\n const existingTwitter = result.twitter;\n const hasTwTitle = existingTwitter ? Boolean(existingTwitter.title) : false;\n const hasTwDescription = existingTwitter ? Boolean(existingTwitter.description) : false;\n const hasTwImages = existingTwitter\n ? Object.prototype.hasOwnProperty.call(existingTwitter, \"images\") &&\n Boolean(existingTwitter.images)\n : false;\n\n if (!hasTwTitle) {\n if (result.openGraph.title) {\n autoFill.title = result.openGraph.title;\n } else if (resolvedTitle) {\n autoFill.title = resolvedTitle;\n }\n }\n if (!hasTwDescription) {\n autoFill.description = result.openGraph.description || result.description || undefined;\n }\n if (!hasTwImages && result.openGraph.images !== undefined) {\n autoFill.images = result.openGraph.images;\n }\n\n if (Object.keys(autoFill).length > 0) {\n if (existingTwitter) {\n result.twitter = { ...existingTwitter, ...autoFill };\n } else {\n result.twitter = autoFill;\n }\n }\n }\n\n if (result.twitter) {\n const tw = { ...result.twitter };\n if (!tw.title && resolvedTitle) {\n tw.title = resolvedTitle;\n }\n if (!tw.description && result.description) {\n tw.description = result.description;\n }\n result.twitter = tw;\n }\n\n // If twitter exists (either originally or via auto-fill), ensure card type is set.\n // Next.js resolveTwitter defaults: summary_large_image when images present, else summary.\n if (result.twitter) {\n const tw = { ...result.twitter };\n if (!tw.card) {\n const images = tw.images;\n const hasImages = Array.isArray(images) ? images.length > 0 : Boolean(images);\n tw.card = hasImages ? \"summary_large_image\" : \"summary\";\n }\n result.twitter = tw;\n }\n\n return result;\n}\n\n/**\n * Merge metadata from multiple sources (layouts + page).\n *\n * The list is ordered [rootLayout, nestedLayout, ..., page].\n * Title template from layouts applies to the page title but NOT to\n * the segment that defines the template itself. `title.absolute`\n * skips all templates. `title.default` is the fallback when no\n * child provides a title.\n *\n * For top-level keys, later entries override earlier ones. `other` custom meta\n * tags are the exception: Next.js merges those across segments.\n */\nexport function mergeMetadataEntries(entries: readonly MetadataMergeEntry[]): Metadata {\n if (entries.length === 0) return {};\n\n const merged: Metadata = {};\n\n // Track the most recent ancestor title template from layouts (not from page).\n let parentTemplate: string | undefined;\n\n for (const entry of entries) {\n const meta = entry.metadata;\n const isPage = Boolean(entry.isPage);\n const contributesTitle = entry.contributesTitle !== false;\n\n // Merge non-title keys\n for (const key of Object.keys(meta)) {\n if (key === \"title\") continue; // Handle title separately below\n\n const incoming = meta[key];\n const existing = merged[key];\n\n if (key === \"other\" && isOtherMetadata(existing) && isOtherMetadata(incoming)) {\n merged.other = { ...existing, ...incoming };\n } else {\n // Plain replacement for everything else\n merged[key] = incoming;\n }\n }\n\n // Title resolution\n if (contributesTitle && meta.title !== undefined) {\n merged.title = resolveTitle(meta.title, parentTemplate);\n }\n\n // Collect the current layout template after resolving its own title so\n // title.default is wrapped by the ancestor template, not by its own template.\n if (\n contributesTitle &&\n !isPage &&\n meta.title &&\n typeof meta.title === \"object\" &&\n meta.title.template\n ) {\n parentTemplate = meta.title.template;\n }\n }\n\n return merged;\n}\n\n/**\n * Resolve metadata from a module. Handles both static `metadata` export\n * and async `generateMetadata()` function.\n *\n * @param parent - A Promise that resolves to the accumulated (merged) metadata\n * from all ancestor segments. Passed as the second argument to\n * `generateMetadata()`, matching Next.js's eager-execution-with-serial-\n * resolution approach. If not provided, defaults to a promise that resolves\n * to an empty object (so `await parent` never throws).\n */\nexport async function resolveModuleMetadata(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]> = {},\n searchParams?: Record<string, string | string[]>,\n parent: Promise<Metadata> = Promise.resolve({}),\n): Promise<Metadata | null> {\n if (typeof mod.generateMetadata === \"function\") {\n // Next.js 16 passes params/searchParams as Promises (async pattern).\n // makeThenableParams() normalises null-prototype + preserves sync access.\n const asyncParams = makeThenableParams(params);\n const props =\n searchParams === undefined\n ? { params: asyncParams }\n : { params: asyncParams, searchParams: makeThenableParams(searchParams) };\n return await mod.generateMetadata(props, parent);\n }\n if (mod.metadata && typeof mod.metadata === \"object\") {\n return mod.metadata as Metadata;\n }\n return null;\n}\n\n/**\n * React component that renders metadata as HTML head elements.\n * Used by the RSC entry to inject into the <head>.\n */\nfunction isIconDescriptor(value: unknown): value is IconDescriptor {\n if (typeof value !== \"object\" || value === null || value instanceof URL || Array.isArray(value)) {\n return false;\n }\n const urlValue = Reflect.get(value, \"url\");\n return typeof urlValue === \"string\" || urlValue instanceof URL;\n}\n\nfunction isIconsMap(value: IconsMetadata): value is IconsMap {\n return (\n typeof value === \"object\" &&\n !(value instanceof URL) &&\n !Array.isArray(value) &&\n !isIconDescriptor(value)\n );\n}\n\nfunction normalizeUrlDescriptor<T extends { url: string | URL }>(\n value: string | URL | T,\n createDescriptor: (url: string | URL) => T,\n): T {\n if (typeof value === \"string\" || value instanceof URL) {\n return createDescriptor(value);\n }\n return value;\n}\n\nfunction normalizeUrlDescriptorEntries<T extends { url: string | URL }>(\n value: string | URL | T | Array<string | URL | T> | undefined,\n createDescriptor: (url: string | URL) => T,\n): T[] {\n if (!value) {\n return [];\n }\n\n if (Array.isArray(value)) {\n return value.map((entry) => normalizeUrlDescriptor(entry, createDescriptor));\n }\n\n return [normalizeUrlDescriptor(value, createDescriptor)];\n}\n\nfunction stringifyUrl(url: string | URL): string {\n return typeof url === \"string\" ? url : url.toString();\n}\n\nfunction createLocalMetadataBase(): URL {\n const protocol = process.env.__NEXT_EXPERIMENTAL_HTTPS ? \"https\" : \"http\";\n return new URL(`${protocol}://localhost:${process.env.PORT || 3000}`);\n}\n\nfunction getPreviewDeploymentUrl(): URL | null {\n const origin = process.env.VERCEL_BRANCH_URL || process.env.VERCEL_URL;\n return origin ? new URL(`https://${origin}`) : null;\n}\n\nfunction getProductionDeploymentUrl(): URL | null {\n const origin = process.env.VERCEL_PROJECT_PRODUCTION_URL;\n return origin ? new URL(`https://${origin}`) : null;\n}\n\nfunction getSocialImageMetadataBaseFallback(metadataBase: URL | null | undefined): URL {\n const defaultMetadataBase = createLocalMetadataBase();\n const previewDeploymentUrl = getPreviewDeploymentUrl();\n const productionDeploymentUrl = getProductionDeploymentUrl();\n\n if (process.env.NODE_ENV === \"development\") {\n return defaultMetadataBase;\n }\n\n if (\n process.env.NODE_ENV === \"production\" &&\n process.env.VERCEL_ENV === \"preview\" &&\n previewDeploymentUrl\n ) {\n return previewDeploymentUrl;\n }\n\n return metadataBase || productionDeploymentUrl || defaultMetadataBase;\n}\n\nfunction trimSlashes(value: string): string {\n return value.replace(/^\\/+|\\/+$/g, \"\");\n}\n\nfunction joinMetadataPath(basePathname: string, pathname: string): string {\n if (!basePathname || basePathname === \"/\") {\n return pathname;\n }\n\n const base = trimSlashes(basePathname);\n const path = trimSlashes(pathname);\n return path ? `/${base}/${path}` : `/${base}`;\n}\n\nfunction resolveRelativeMetadataUrl(url: string, pathname: string): string {\n if (url === \".\" || url === \"./\") {\n return pathname || \"/\";\n }\n if (!url.startsWith(\"./\")) {\n return url;\n }\n\n const base = pathname === \"/\" ? \"\" : pathname.replace(/\\/+$/g, \"\");\n return `${base}/${url.slice(2)}`;\n}\n\nfunction formatResolvedMetadataUrl(url: URL): string {\n if (url.pathname === \"/\" && url.search === \"\" && url.hash === \"\") {\n return url.origin;\n }\n return url.href;\n}\n\nfunction resolveMetadataUrl(url: string | URL, metadataBase: URL | null | undefined): string {\n const value = stringifyUrl(url);\n if (isAbsoluteOrProtocolRelativeUrl(value) || !metadataBase) {\n return value;\n }\n\n try {\n return formatResolvedMetadataUrl(\n new URL(joinMetadataPath(metadataBase.pathname, value), metadataBase),\n );\n } catch {\n return value;\n }\n}\n\nfunction resolveCanonicalUrl(\n url: string | URL,\n metadataBase: URL | null | undefined,\n pathname: string,\n): string {\n if (url instanceof URL) {\n return resolveMetadataUrl(url, metadataBase);\n }\n return resolveMetadataUrl(resolveRelativeMetadataUrl(url, pathname), metadataBase);\n}\n\nfunction isSocialImageDescriptor(\n value: string | URL | SocialImageDescriptor,\n): value is SocialImageDescriptor {\n return typeof value === \"object\" && !(value instanceof URL);\n}\n\nfunction isMetadataRouteSocialImage(value: SocialImageDescriptor): boolean {\n return Reflect.get(value, \"metadataRoute\") === true;\n}\n\nfunction resolveSocialImageUrl(\n image: string | URL | SocialImageDescriptor,\n metadataBase: URL | null | undefined,\n): string {\n const imageUrl = isSocialImageDescriptor(image) ? image.url : image;\n const metadataRoute = isSocialImageDescriptor(image) && isMetadataRouteSocialImage(image);\n if (\n typeof imageUrl === \"string\" &&\n !isAbsoluteOrProtocolRelativeUrl(imageUrl) &&\n (!metadataBase || metadataRoute)\n ) {\n return resolveMetadataUrl(imageUrl, getSocialImageMetadataBaseFallback(metadataBase));\n }\n return resolveMetadataUrl(imageUrl, metadataBase);\n}\n\ntype MetadataHeadProps = {\n metadata: Metadata;\n pathname?: string;\n};\n\nexport function MetadataHead({ metadata, pathname = \"/\" }: MetadataHeadProps) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Resolve metadataBase for URL composition\n const base = metadata.metadataBase;\n function resolveUrl(url: string | URL): string;\n function resolveUrl(url: string | URL | undefined): string | undefined;\n function resolveUrl(url: string | URL | undefined): string | undefined {\n if (!url) return undefined;\n return resolveMetadataUrl(url, base);\n }\n\n // Title\n const title =\n typeof metadata.title === \"string\"\n ? metadata.title\n : typeof metadata.title === \"object\"\n ? metadata.title.absolute || metadata.title.default\n : undefined;\n if (title) {\n elements.push(<title key={key++}>{title}</title>);\n }\n\n // Description\n if (metadata.description) {\n elements.push(<meta key={key++} name=\"description\" content={metadata.description} />);\n }\n\n // Generator\n if (metadata.generator) {\n elements.push(<meta key={key++} name=\"generator\" content={metadata.generator} />);\n }\n\n // Application name\n if (metadata.applicationName) {\n elements.push(<meta key={key++} name=\"application-name\" content={metadata.applicationName} />);\n }\n\n // Referrer\n if (metadata.referrer) {\n elements.push(<meta key={key++} name=\"referrer\" content={metadata.referrer} />);\n }\n\n // Keywords\n if (metadata.keywords) {\n const kw = Array.isArray(metadata.keywords) ? metadata.keywords.join(\",\") : metadata.keywords;\n elements.push(<meta key={key++} name=\"keywords\" content={kw} />);\n }\n\n // Authors\n if (metadata.authors) {\n const authorList = Array.isArray(metadata.authors) ? metadata.authors : [metadata.authors];\n for (const author of authorList) {\n if (author.name) {\n elements.push(<meta key={key++} name=\"author\" content={author.name} />);\n }\n if (author.url) {\n elements.push(<link key={key++} rel=\"author\" href={author.url} />);\n }\n }\n }\n\n // Creator\n if (metadata.creator) {\n elements.push(<meta key={key++} name=\"creator\" content={metadata.creator} />);\n }\n\n // Publisher\n if (metadata.publisher) {\n elements.push(<meta key={key++} name=\"publisher\" content={metadata.publisher} />);\n }\n\n // Format detection\n if (metadata.formatDetection) {\n const parts: string[] = [];\n if (metadata.formatDetection.telephone === false) parts.push(\"telephone=no\");\n if (metadata.formatDetection.address === false) parts.push(\"address=no\");\n if (metadata.formatDetection.email === false) parts.push(\"email=no\");\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"format-detection\" content={parts.join(\", \")} />);\n }\n }\n\n // Category\n if (metadata.category) {\n elements.push(<meta key={key++} name=\"category\" content={metadata.category} />);\n }\n\n // Robots\n if (metadata.robots) {\n if (typeof metadata.robots === \"string\") {\n elements.push(<meta key={key++} name=\"robots\" content={metadata.robots} />);\n } else {\n const { googleBot, ...robotsRest } = metadata.robots;\n const robotParts: string[] = [];\n for (const [k, v] of Object.entries(robotsRest)) {\n if (v === true) robotParts.push(k);\n else if (v === false) robotParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") robotParts.push(`${k}:${v}`);\n }\n if (robotParts.length > 0) {\n elements.push(<meta key={key++} name=\"robots\" content={robotParts.join(\", \")} />);\n }\n // googlebot\n if (googleBot) {\n if (typeof googleBot === \"string\") {\n elements.push(<meta key={key++} name=\"googlebot\" content={googleBot} />);\n } else {\n const gbParts: string[] = [];\n for (const [k, v] of Object.entries(googleBot)) {\n if (v === true) gbParts.push(k);\n else if (v === false) gbParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") gbParts.push(`${k}:${v}`);\n }\n if (gbParts.length > 0) {\n elements.push(<meta key={key++} name=\"googlebot\" content={gbParts.join(\", \")} />);\n }\n }\n }\n }\n }\n\n // Open Graph\n if (metadata.openGraph) {\n const og = metadata.openGraph;\n if (og.title) elements.push(<meta key={key++} property=\"og:title\" content={og.title} />);\n if (og.description)\n elements.push(<meta key={key++} property=\"og:description\" content={og.description} />);\n if (og.url) elements.push(<meta key={key++} property=\"og:url\" content={resolveUrl(og.url)} />);\n if (og.siteName)\n elements.push(<meta key={key++} property=\"og:site_name\" content={og.siteName} />);\n if (og.type) elements.push(<meta key={key++} property=\"og:type\" content={og.type} />);\n if (og.locale) elements.push(<meta key={key++} property=\"og:locale\" content={og.locale} />);\n if (og.publishedTime)\n elements.push(\n <meta key={key++} property=\"article:published_time\" content={og.publishedTime} />,\n );\n if (og.modifiedTime)\n elements.push(\n <meta key={key++} property=\"article:modified_time\" content={og.modifiedTime} />,\n );\n if (og.authors) {\n for (const author of og.authors) {\n elements.push(<meta key={key++} property=\"article:author\" content={author} />);\n }\n }\n if (og.images) {\n const imgList =\n typeof og.images === \"string\" || og.images instanceof URL\n ? [{ url: og.images }]\n : Array.isArray(og.images)\n ? og.images\n : [og.images];\n for (const img of imgList) {\n elements.push(\n <meta key={key++} property=\"og:image\" content={resolveSocialImageUrl(img, base)} />,\n );\n if (typeof img !== \"string\" && !(img instanceof URL)) {\n if (img.width)\n elements.push(\n <meta key={key++} property=\"og:image:width\" content={String(img.width)} />,\n );\n if (img.height)\n elements.push(\n <meta key={key++} property=\"og:image:height\" content={String(img.height)} />,\n );\n if (img.type)\n elements.push(<meta key={key++} property=\"og:image:type\" content={img.type} />);\n if (img.alt)\n elements.push(<meta key={key++} property=\"og:image:alt\" content={img.alt} />);\n }\n }\n }\n if (og.videos) {\n for (const video of og.videos) {\n elements.push(<meta key={key++} property=\"og:video\" content={resolveUrl(video.url)} />);\n if (video.width)\n elements.push(\n <meta key={key++} property=\"og:video:width\" content={String(video.width)} />,\n );\n if (video.height)\n elements.push(\n <meta key={key++} property=\"og:video:height\" content={String(video.height)} />,\n );\n }\n }\n if (og.audio) {\n for (const audio of og.audio) {\n elements.push(<meta key={key++} property=\"og:audio\" content={resolveUrl(audio.url)} />);\n }\n }\n }\n\n // Twitter\n if (metadata.twitter) {\n const tw = metadata.twitter;\n if (tw.card) elements.push(<meta key={key++} name=\"twitter:card\" content={tw.card} />);\n if (tw.site) elements.push(<meta key={key++} name=\"twitter:site\" content={tw.site} />);\n if (tw.siteId) elements.push(<meta key={key++} name=\"twitter:site:id\" content={tw.siteId} />);\n if (tw.title) elements.push(<meta key={key++} name=\"twitter:title\" content={tw.title} />);\n if (tw.description)\n elements.push(<meta key={key++} name=\"twitter:description\" content={tw.description} />);\n if (tw.creator) elements.push(<meta key={key++} name=\"twitter:creator\" content={tw.creator} />);\n if (tw.creatorId)\n elements.push(<meta key={key++} name=\"twitter:creator:id\" content={tw.creatorId} />);\n if (tw.images) {\n const imgList =\n typeof tw.images === \"string\" || tw.images instanceof URL\n ? [tw.images]\n : Array.isArray(tw.images)\n ? tw.images\n : [tw.images];\n for (const img of imgList) {\n elements.push(\n <meta key={key++} name=\"twitter:image\" content={resolveSocialImageUrl(img, base)} />,\n );\n if (typeof img !== \"string\" && !(img instanceof URL)) {\n if (img.type) {\n elements.push(<meta key={key++} name=\"twitter:image:type\" content={img.type} />);\n }\n if (img.width) {\n elements.push(\n <meta key={key++} name=\"twitter:image:width\" content={String(img.width)} />,\n );\n }\n if (img.height) {\n elements.push(\n <meta key={key++} name=\"twitter:image:height\" content={String(img.height)} />,\n );\n }\n if (img.alt) {\n elements.push(<meta key={key++} name=\"twitter:image:alt\" content={img.alt} />);\n }\n }\n }\n }\n // Twitter player cards\n if (tw.players) {\n const players = Array.isArray(tw.players) ? tw.players : [tw.players];\n for (const player of players) {\n const playerUrl = player.playerUrl.toString();\n const streamUrl = player.streamUrl.toString();\n elements.push(<meta key={key++} name=\"twitter:player\" content={resolveUrl(playerUrl)} />);\n elements.push(\n <meta key={key++} name=\"twitter:player:stream\" content={resolveUrl(streamUrl)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:width\" content={String(player.width)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:height\" content={String(player.height)} />,\n );\n }\n }\n // Twitter app cards\n if (tw.app) {\n const { app } = tw;\n for (const platform of [\"iphone\", \"ipad\", \"googleplay\"] as const) {\n if (app.name) {\n elements.push(\n <meta key={key++} name={`twitter:app:name:${platform}`} content={app.name} />,\n );\n }\n if (app.id[platform] !== undefined) {\n elements.push(\n <meta\n key={key++}\n name={`twitter:app:id:${platform}`}\n content={String(app.id[platform])}\n />,\n );\n }\n if (app.url?.[platform] !== undefined) {\n const appUrl = app.url[platform]!.toString();\n elements.push(\n <meta key={key++} name={`twitter:app:url:${platform}`} content={resolveUrl(appUrl)} />,\n );\n }\n }\n }\n }\n\n // Icons\n if (metadata.icons) {\n const iconEntries = isIconsMap(metadata.icons)\n ? normalizeUrlDescriptorEntries(metadata.icons.icon, (url): IconDescriptor => ({ url }))\n : normalizeUrlDescriptorEntries(metadata.icons, (url): IconDescriptor => ({ url }));\n\n // Shortcut icon\n if (isIconsMap(metadata.icons) && metadata.icons.shortcut) {\n const shortcuts = Array.isArray(metadata.icons.shortcut)\n ? metadata.icons.shortcut\n : [metadata.icons.shortcut];\n for (const s of shortcuts) {\n elements.push(<link key={key++} rel=\"shortcut icon\" href={stringifyUrl(s)} />);\n }\n }\n // Icon\n if (iconEntries.length > 0) {\n for (const i of iconEntries) {\n elements.push(\n <link\n key={key++}\n rel=\"icon\"\n href={stringifyUrl(i.url)}\n {...(i.sizes ? { sizes: i.sizes } : {})}\n {...(i.type ? { type: i.type } : {})}\n {...(i.media ? { media: i.media } : {})}\n />,\n );\n }\n }\n // Apple touch icon\n if (isIconsMap(metadata.icons) && metadata.icons.apple) {\n for (const a of normalizeUrlDescriptorEntries(\n metadata.icons.apple,\n (url): AppleIconDescriptor => ({ url }),\n )) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-icon\"\n href={stringifyUrl(a.url)}\n {...(a.sizes ? { sizes: a.sizes } : {})}\n {...(a.type ? { type: a.type } : {})}\n />,\n );\n }\n }\n // Other custom icon relations\n if (isIconsMap(metadata.icons) && metadata.icons.other) {\n for (const o of metadata.icons.other) {\n elements.push(\n <link\n key={key++}\n rel={o.rel}\n href={stringifyUrl(o.url)}\n {...(o.sizes ? { sizes: o.sizes } : {})}\n />,\n );\n }\n }\n }\n\n // Manifest\n if (metadata.manifest) {\n elements.push(<link key={key++} rel=\"manifest\" href={stringifyUrl(metadata.manifest)} />);\n }\n\n // Alternates\n if (metadata.alternates) {\n const alt = metadata.alternates;\n if (alt.canonical) {\n elements.push(\n <link\n key={key++}\n rel=\"canonical\"\n href={resolveCanonicalUrl(alt.canonical, base, pathname)}\n />,\n );\n }\n if (alt.languages) {\n for (const [lang, href] of Object.entries(alt.languages)) {\n elements.push(<link key={key++} rel=\"alternate\" hrefLang={lang} href={resolveUrl(href)} />);\n }\n }\n if (alt.media) {\n for (const [media, href] of Object.entries(alt.media)) {\n elements.push(<link key={key++} rel=\"alternate\" media={media} href={resolveUrl(href)} />);\n }\n }\n if (alt.types) {\n for (const [type, href] of Object.entries(alt.types)) {\n elements.push(<link key={key++} rel=\"alternate\" type={type} href={resolveUrl(href)} />);\n }\n }\n }\n\n // Verification\n if (metadata.verification) {\n const v = metadata.verification;\n if (v.google)\n elements.push(<meta key={key++} name=\"google-site-verification\" content={v.google} />);\n if (v.yahoo) elements.push(<meta key={key++} name=\"y_key\" content={v.yahoo} />);\n if (v.yandex) elements.push(<meta key={key++} name=\"yandex-verification\" content={v.yandex} />);\n if (v.other) {\n for (const [name, content] of Object.entries(v.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n }\n\n // Apple Web App\n if (metadata.appleWebApp) {\n const awa = metadata.appleWebApp;\n if (awa.capable !== false) {\n elements.push(<meta key={key++} name=\"mobile-web-app-capable\" content=\"yes\" />);\n }\n if (awa.title) {\n elements.push(<meta key={key++} name=\"apple-mobile-web-app-title\" content={awa.title} />);\n }\n if (awa.statusBarStyle) {\n elements.push(\n <meta\n key={key++}\n name=\"apple-mobile-web-app-status-bar-style\"\n content={awa.statusBarStyle}\n />,\n );\n }\n if (awa.startupImage) {\n const imgs =\n typeof awa.startupImage === \"string\" ? [{ url: awa.startupImage }] : awa.startupImage;\n for (const img of imgs) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-startup-image\"\n href={resolveUrl(img.url)}\n {...(img.media ? { media: img.media } : {})}\n />,\n );\n }\n }\n }\n\n // iTunes\n if (metadata.itunes) {\n const { appId, appArgument } = metadata.itunes;\n let content = `app-id=${appId}`;\n if (appArgument) {\n content += `, app-argument=${appArgument}`;\n }\n elements.push(<meta key={key++} name=\"apple-itunes-app\" content={content} />);\n }\n\n // App Links\n if (metadata.appLinks) {\n const al = metadata.appLinks;\n const platforms = [\n \"ios\",\n \"iphone\",\n \"ipad\",\n \"android\",\n \"windows_phone\",\n \"windows\",\n \"windows_universal\",\n \"web\",\n ] as const;\n for (const platform of platforms) {\n const entries = al[platform];\n if (!entries) continue;\n const list = Array.isArray(entries) ? entries : [entries];\n for (const entry of list) {\n for (const [k, v] of Object.entries(entry)) {\n if (v === undefined || v === null) continue;\n const str = String(v);\n const content = k === \"url\" ? resolveUrl(str) : str;\n elements.push(<meta key={key++} property={`al:${platform}:${k}`} content={content} />);\n }\n }\n }\n }\n\n // Other custom meta tags\n if (metadata.other) {\n for (const [name, content] of Object.entries(metadata.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n\n return <>{elements}</>;\n}\n"],"mappings":";;;;;;;;;AAqCA,eAAsB,sBACpB,KACA,QAC0B;CAC1B,IAAI,OAAO,IAAI,qBAAqB,YAAY;EAC9C,MAAM,cAAc,mBAAmB,OAAO;EAC9C,OAAO,MAAM,IAAI,iBAAiB,EAAE,QAAQ,aAAa,CAAC;;CAE5D,IAAI,IAAI,YAAY,OAAO,IAAI,aAAa,UAC1C,OAAO,IAAI;CAEb,OAAO;;;;;;AAOT,MAAa,mBAA6B;CACxC,OAAO;CACP,cAAc;CACf;AAED,SAAgB,cAAc,cAAoC;CAChE,MAAM,SAAmB,EAAE,GAAG,kBAAkB;CAChD,KAAK,MAAM,MAAM,cACf,OAAO,OAAO,QAAQ,GAAG;CAE3B,OAAO;;;;;AAMT,SAAgB,aAAa,EAAE,YAAoC;CACjE,MAAM,WAAiC,EAAE;CACzC,IAAI,MAAM;CAGV,MAAM,QAAkB,EAAE;CAC1B,IAAI,SAAS,UAAU,KAAA,GAAW,MAAM,KAAK,SAAS,SAAS,QAAQ;CACvE,IAAI,SAAS,WAAW,KAAA,GAAW,MAAM,KAAK,UAAU,SAAS,SAAS;CAC1E,IAAI,SAAS,iBAAiB,KAAA,GAAW,MAA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K,oBAAC,QAAD;KAAkB,UAAU,MAAM,SAAS,GAAG;KAAc;KAAW,EAA5D,MAA4D,CAAC;;;;CAO9F,IAAI,SAAS,OACX,KAAK,MAAM,CAAC,MAAM,YAAY,OAAO,QAAQ,SAAS,MAAM,EAAE;EAC5D,MAAM,SAAS,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ;EAC3D,KAAK,MAAM,OAAO,QAChB,SAAS,KAAK,oBAAC,QAAD;GAAwB;GAAM,SAAS;GAAO,EAAnC,MAAmC,CAAC;;CAKnE,OAAO,oBAAA,YAAA,EAAA,UAAG,UAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"metadata.js","names":[],"sources":["../../src/shims/metadata.tsx"],"sourcesContent":["/**\n * Metadata support for App Router.\n *\n * Handles `export const metadata` and `export async function generateMetadata()`.\n * Resolves metadata from layouts and pages (pages override layouts).\n */\nimport React from \"react\";\nimport { makeThenableParams } from \"./thenable-params.js\";\nimport { isAbsoluteOrProtocolRelativeUrl } from \"./url-utils.js\";\n\n// ---------------------------------------------------------------------------\n// Viewport types and resolution\n// ---------------------------------------------------------------------------\n\nexport type Viewport = {\n /** Viewport width (default: \"device-width\") */\n width?: string | number;\n /** Viewport height */\n height?: string | number;\n /** Initial scale */\n initialScale?: number;\n /** Minimum scale */\n minimumScale?: number;\n /** Maximum scale */\n maximumScale?: number;\n /** Whether user can scale */\n userScalable?: boolean;\n /** Theme color — single color or array of { media, color } */\n themeColor?: string | Array<{ media?: string; color: string }>;\n /** Color scheme: 'light' | 'dark' | 'light dark' | 'normal' */\n colorScheme?: string;\n};\n\n/**\n * Resolve viewport config from a module. Handles both static `viewport` export\n * and async `generateViewport()` function.\n */\nexport async function resolveModuleViewport(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]>,\n): Promise<Viewport | null> {\n if (typeof mod.generateViewport === \"function\") {\n const asyncParams = makeThenableParams(params);\n return await mod.generateViewport({ params: asyncParams });\n }\n if (mod.viewport && typeof mod.viewport === \"object\") {\n return mod.viewport as Viewport;\n }\n return null;\n}\n\n/**\n * Merge viewport configs from multiple sources (layouts + page).\n * Later entries override earlier ones.\n */\nexport const DEFAULT_VIEWPORT: Viewport = {\n width: \"device-width\",\n initialScale: 1,\n};\n\nexport function mergeViewport(viewportList: Viewport[]): Viewport {\n const merged: Viewport = { ...DEFAULT_VIEWPORT };\n for (const vp of viewportList) {\n Object.assign(merged, vp);\n }\n return merged;\n}\n\n/**\n * React component that renders viewport meta tags into <head>.\n */\nexport function ViewportHead({ viewport }: { viewport: Viewport }) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Build viewport content string\n const parts: string[] = [];\n if (viewport.width !== undefined) parts.push(`width=${viewport.width}`);\n if (viewport.height !== undefined) parts.push(`height=${viewport.height}`);\n if (viewport.initialScale !== undefined) parts.push(`initial-scale=${viewport.initialScale}`);\n if (viewport.minimumScale !== undefined) parts.push(`minimum-scale=${viewport.minimumScale}`);\n if (viewport.maximumScale !== undefined) parts.push(`maximum-scale=${viewport.maximumScale}`);\n if (viewport.userScalable !== undefined)\n parts.push(`user-scalable=${viewport.userScalable ? \"yes\" : \"no\"}`);\n\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"viewport\" content={parts.join(\", \")} />);\n }\n\n // Theme color\n if (viewport.themeColor) {\n if (typeof viewport.themeColor === \"string\") {\n elements.push(<meta key={key++} name=\"theme-color\" content={viewport.themeColor} />);\n } else if (Array.isArray(viewport.themeColor)) {\n for (const entry of viewport.themeColor) {\n elements.push(\n <meta\n key={key++}\n name=\"theme-color\"\n content={entry.color}\n {...(entry.media ? { media: entry.media } : {})}\n />,\n );\n }\n }\n }\n\n // Color scheme\n if (viewport.colorScheme) {\n elements.push(<meta key={key++} name=\"color-scheme\" content={viewport.colorScheme} />);\n }\n\n return <>{elements}</>;\n}\n\n// ---------------------------------------------------------------------------\n// Metadata types and resolution\n// ---------------------------------------------------------------------------\n\nexport type Metadata = {\n title?: string | { default?: string; template?: string; absolute?: string };\n description?: string;\n generator?: string;\n applicationName?: string;\n referrer?: string;\n keywords?: string | string[];\n authors?: Array<{ name?: string; url?: string }> | { name?: string; url?: string };\n creator?: string;\n publisher?: string;\n robots?:\n | string\n | {\n index?: boolean;\n follow?: boolean;\n googleBot?: string | { index?: boolean; follow?: boolean; [key: string]: unknown };\n [key: string]: unknown;\n };\n openGraph?: {\n title?: string;\n description?: string;\n url?: string | URL;\n siteName?: string;\n images?: string | URL | SocialImageDescriptor | Array<string | URL | SocialImageDescriptor>;\n videos?: Array<{ url: string | URL; width?: number; height?: number }>;\n audio?: Array<{ url: string | URL }>;\n locale?: string;\n type?: string;\n publishedTime?: string;\n modifiedTime?: string;\n authors?: string[];\n };\n twitter?: {\n card?: string;\n site?: string;\n siteId?: string;\n title?: string;\n description?: string;\n images?: string | URL | SocialImageDescriptor | Array<string | URL | SocialImageDescriptor>;\n creator?: string;\n creatorId?: string;\n players?: TwitterPlayerDescriptor | TwitterPlayerDescriptor[];\n app?: TwitterAppDescriptor;\n };\n icons?: IconsMetadata;\n manifest?: string | URL;\n alternates?: {\n canonical?: string | URL;\n languages?: Record<string, string | URL>;\n media?: Record<string, string | URL>;\n types?: Record<string, string | URL>;\n };\n verification?: {\n google?: string;\n yahoo?: string;\n yandex?: string;\n other?: Record<string, string | string[]>;\n };\n metadataBase?: URL | null;\n appleWebApp?: {\n capable?: boolean;\n title?: string;\n statusBarStyle?: string;\n startupImage?: string | Array<{ url: string; media?: string }>;\n };\n formatDetection?: {\n email?: boolean;\n address?: boolean;\n telephone?: boolean;\n };\n category?: string;\n itunes?: {\n appId: string;\n appArgument?: string;\n };\n appLinks?: {\n ios?: AppLinksApple | AppLinksApple[];\n iphone?: AppLinksApple | AppLinksApple[];\n ipad?: AppLinksApple | AppLinksApple[];\n android?: AppLinksAndroid | AppLinksAndroid[];\n windows_phone?: AppLinksWindows | AppLinksWindows[];\n windows?: AppLinksWindows | AppLinksWindows[];\n windows_universal?: AppLinksWindows | AppLinksWindows[];\n web?: AppLinksWeb | AppLinksWeb[];\n };\n other?: Record<string, string | string[]>;\n [key: string]: unknown;\n};\n\ntype AppLinksApple = {\n url: string | URL;\n app_store_id?: string | number;\n app_name?: string;\n};\n\ntype AppLinksAndroid = {\n package: string;\n url?: string | URL;\n class?: string;\n app_name?: string;\n};\n\ntype AppLinksWindows = {\n url: string | URL;\n app_id?: string;\n app_name?: string;\n};\n\ntype AppLinksWeb = {\n url: string | URL;\n should_fallback?: boolean;\n};\n\ntype TwitterPlayerDescriptor = {\n playerUrl: string | URL;\n streamUrl: string | URL;\n width: number;\n height: number;\n};\n\ntype TwitterAppDescriptor = {\n id: {\n iphone?: string | number;\n ipad?: string | number;\n googleplay?: string;\n };\n url?: {\n iphone?: string | URL;\n ipad?: string | URL;\n googleplay?: string | URL;\n };\n name?: string;\n};\n\ntype SocialImageDescriptor = {\n url: string | URL;\n alt?: string;\n width?: number;\n height?: number;\n type?: string;\n};\n\ntype IconDescriptor = {\n url: string | URL;\n sizes?: string;\n type?: string;\n media?: string;\n};\n\ntype AppleIconDescriptor = {\n url: string | URL;\n sizes?: string;\n type?: string;\n};\n\ntype IconInput = string | URL | IconDescriptor;\ntype AppleIconInput = string | URL | AppleIconDescriptor;\n\ntype OtherIconDescriptor = { rel: string; url: string | URL; sizes?: string; type?: string };\n\ntype IconsMap = {\n icon?: IconInput | IconInput[];\n shortcut?: string | URL | Array<string | URL>;\n apple?: AppleIconInput | AppleIconInput[];\n // Next.js accepts a single descriptor or an array (see resolveIcons in\n // .nextjs-ref/packages/next/src/lib/metadata/resolvers/resolve-icons.ts —\n // values pass through resolveAsArrayOrUndefined before iteration).\n other?: OtherIconDescriptor | OtherIconDescriptor[];\n};\n\ntype IconsMetadata = IconInput | IconInput[] | IconsMap;\n\nexport type MetadataMergeEntry = {\n contributesTitle?: boolean;\n isPage?: boolean;\n metadata: Metadata;\n};\n\n/**\n * Merge metadata from multiple sources (layouts + page).\n *\n * The list is ordered [rootLayout, nestedLayout, ..., page].\n * Title template from layouts applies to the page title but NOT to\n * the segment that defines the template itself. `title.absolute`\n * skips all templates. `title.default` is the fallback when no\n * child provides a title.\n *\n * Shallow merge: later entries override earlier ones (per Next.js docs).\n */\nexport function mergeMetadata(metadataList: Metadata[]): Metadata {\n const merged = mergeMetadataEntries(\n metadataList.map((metadata, index) => ({\n isPage: index === metadataList.length - 1,\n metadata,\n })),\n );\n return postProcessMetadata(merged);\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === \"object\" && value !== null && !Array.isArray(value) && !(value instanceof URL)\n );\n}\n\nfunction isOtherMetadata(value: unknown): value is NonNullable<Metadata[\"other\"]> {\n if (!isPlainObject(value)) return false;\n return Object.values(value).every((item) => {\n if (typeof item === \"string\") return true;\n return Array.isArray(item) && item.every((nestedItem) => typeof nestedItem === \"string\");\n });\n}\n\n/**\n * Extract a plain string title from a metadata title value.\n */\nfunction resolveStringTitle(title: Metadata[\"title\"]): string | undefined {\n if (typeof title === \"string\") return title;\n if (title && typeof title === \"object\") {\n return title.absolute ?? title.default ?? undefined;\n }\n return undefined;\n}\n\nfunction applyTitleTemplate(template: string | undefined, title: string): string {\n return template ? template.replace(/%s/g, title) : title;\n}\n\nfunction resolveTitle(title: Metadata[\"title\"], stashedTemplate: string | undefined) {\n if (typeof title === \"string\") {\n return applyTitleTemplate(stashedTemplate, title);\n }\n\n if (title && typeof title === \"object\") {\n let resolved =\n title.default === undefined ? undefined : applyTitleTemplate(stashedTemplate, title.default);\n\n if (title.absolute) {\n resolved = title.absolute;\n }\n\n return resolved;\n }\n\n return undefined;\n}\n\n/**\n * Post-process merged metadata to cross-fill openGraph and Twitter fields.\n *\n * Next.js runs this once after all layouts/pages and file-based metadata\n * have been resolved. When openGraph exists, it auto-fills missing\n * twitter:title/description/images from openGraph (falling back to root\n * metadata title/description). Existing openGraph/twitter objects also inherit\n * missing title/description from root metadata.\n *\n * Ported from Next.js:\n * https://github.com/vercel/next.js/blob/canary/packages/next/src/lib/metadata/resolve-metadata.ts\n */\nexport function postProcessMetadata(merged: Metadata): Metadata {\n // Shallow-clone to avoid mutating the caller's object.\n // Both current call sites (mergeMetadata, resolveAppPageHead) pass\n // freshly-constructed objects, but this guards against future misuse.\n const result = { ...merged };\n\n const resolvedTitle = resolveStringTitle(result.title);\n\n // openGraph inherits title/description from root metadata when absent\n if (result.openGraph) {\n const og = { ...result.openGraph };\n if (!og.title && resolvedTitle) {\n og.title = resolvedTitle;\n }\n if (!og.description && result.description) {\n og.description = result.description;\n }\n result.openGraph = og;\n }\n\n if (result.openGraph) {\n const autoFill: {\n title?: string;\n description?: string;\n images?: NonNullable<Metadata[\"twitter\"]>[\"images\"];\n } = {};\n\n const existingTwitter = result.twitter;\n const hasTwTitle = existingTwitter ? Boolean(existingTwitter.title) : false;\n const hasTwDescription = existingTwitter ? Boolean(existingTwitter.description) : false;\n const hasTwImages = existingTwitter\n ? Object.prototype.hasOwnProperty.call(existingTwitter, \"images\") &&\n Boolean(existingTwitter.images)\n : false;\n\n if (!hasTwTitle) {\n if (result.openGraph.title) {\n autoFill.title = result.openGraph.title;\n } else if (resolvedTitle) {\n autoFill.title = resolvedTitle;\n }\n }\n if (!hasTwDescription) {\n autoFill.description = result.openGraph.description || result.description || undefined;\n }\n if (!hasTwImages && result.openGraph.images !== undefined) {\n autoFill.images = result.openGraph.images;\n }\n\n if (Object.keys(autoFill).length > 0) {\n if (existingTwitter) {\n result.twitter = { ...existingTwitter, ...autoFill };\n } else {\n result.twitter = autoFill;\n }\n }\n }\n\n if (result.twitter) {\n const tw = { ...result.twitter };\n if (!tw.title && resolvedTitle) {\n tw.title = resolvedTitle;\n }\n if (!tw.description && result.description) {\n tw.description = result.description;\n }\n result.twitter = tw;\n }\n\n // If twitter exists (either originally or via auto-fill), ensure card type is set.\n // Next.js resolveTwitter defaults: summary_large_image when images present, else summary.\n if (result.twitter) {\n const tw = { ...result.twitter };\n if (!tw.card) {\n const images = tw.images;\n const hasImages = Array.isArray(images) ? images.length > 0 : Boolean(images);\n tw.card = hasImages ? \"summary_large_image\" : \"summary\";\n }\n result.twitter = tw;\n }\n\n return result;\n}\n\n/**\n * Merge metadata from multiple sources (layouts + page).\n *\n * The list is ordered [rootLayout, nestedLayout, ..., page].\n * Title template from layouts applies to the page title but NOT to\n * the segment that defines the template itself. `title.absolute`\n * skips all templates. `title.default` is the fallback when no\n * child provides a title.\n *\n * For top-level keys, later entries override earlier ones. `other` custom meta\n * tags are the exception: Next.js merges those across segments.\n */\nexport function mergeMetadataEntries(entries: readonly MetadataMergeEntry[]): Metadata {\n if (entries.length === 0) return {};\n\n const merged: Metadata = {};\n\n // Track the most recent ancestor title template from layouts (not from page).\n let parentTemplate: string | undefined;\n\n for (const entry of entries) {\n const meta = entry.metadata;\n const isPage = Boolean(entry.isPage);\n const contributesTitle = entry.contributesTitle !== false;\n\n // Merge non-title keys\n for (const key of Object.keys(meta)) {\n if (key === \"title\") continue; // Handle title separately below\n\n const incoming = meta[key];\n const existing = merged[key];\n\n if (key === \"other\" && isOtherMetadata(existing) && isOtherMetadata(incoming)) {\n merged.other = { ...existing, ...incoming };\n } else {\n // Plain replacement for everything else\n merged[key] = incoming;\n }\n }\n\n // Title resolution\n if (contributesTitle && meta.title !== undefined) {\n merged.title = resolveTitle(meta.title, parentTemplate);\n }\n\n // Collect the current layout template after resolving its own title so\n // title.default is wrapped by the ancestor template, not by its own template.\n if (\n contributesTitle &&\n !isPage &&\n meta.title &&\n typeof meta.title === \"object\" &&\n meta.title.template\n ) {\n parentTemplate = meta.title.template;\n }\n }\n\n return merged;\n}\n\n/**\n * Resolve metadata from a module. Handles both static `metadata` export\n * and async `generateMetadata()` function.\n *\n * @param parent - A Promise that resolves to the accumulated (merged) metadata\n * from all ancestor segments. Passed as the second argument to\n * `generateMetadata()`, matching Next.js's eager-execution-with-serial-\n * resolution approach. If not provided, defaults to a promise that resolves\n * to an empty object (so `await parent` never throws).\n */\nexport async function resolveModuleMetadata(\n mod: Record<string, unknown>,\n params: Record<string, string | string[]> = {},\n searchParams?: Record<string, string | string[]>,\n parent: Promise<Metadata> = Promise.resolve({}),\n): Promise<Metadata | null> {\n if (typeof mod.generateMetadata === \"function\") {\n // Next.js 16 passes params/searchParams as Promises (async pattern).\n // makeThenableParams() normalises null-prototype + preserves sync access.\n const asyncParams = makeThenableParams(params);\n const props =\n searchParams === undefined\n ? { params: asyncParams }\n : { params: asyncParams, searchParams: makeThenableParams(searchParams) };\n return await mod.generateMetadata(props, parent);\n }\n if (mod.metadata && typeof mod.metadata === \"object\") {\n return mod.metadata as Metadata;\n }\n return null;\n}\n\n/**\n * React component that renders metadata as HTML head elements.\n * Used by the RSC entry to inject into the <head>.\n */\nfunction isIconDescriptor(value: unknown): value is IconDescriptor {\n if (typeof value !== \"object\" || value === null || value instanceof URL || Array.isArray(value)) {\n return false;\n }\n const urlValue = Reflect.get(value, \"url\");\n return typeof urlValue === \"string\" || urlValue instanceof URL;\n}\n\nfunction isIconsMap(value: IconsMetadata): value is IconsMap {\n return (\n typeof value === \"object\" &&\n !(value instanceof URL) &&\n !Array.isArray(value) &&\n !isIconDescriptor(value)\n );\n}\n\nfunction normalizeUrlDescriptor<T extends { url: string | URL }>(\n value: string | URL | T,\n createDescriptor: (url: string | URL) => T,\n): T {\n if (typeof value === \"string\" || value instanceof URL) {\n return createDescriptor(value);\n }\n return value;\n}\n\nfunction normalizeUrlDescriptorEntries<T extends { url: string | URL }>(\n value: string | URL | T | Array<string | URL | T> | undefined,\n createDescriptor: (url: string | URL) => T,\n): T[] {\n if (!value) {\n return [];\n }\n\n if (Array.isArray(value)) {\n return value.map((entry) => normalizeUrlDescriptor(entry, createDescriptor));\n }\n\n return [normalizeUrlDescriptor(value, createDescriptor)];\n}\n\nfunction stringifyUrl(url: string | URL): string {\n return typeof url === \"string\" ? url : url.toString();\n}\n\nfunction createLocalMetadataBase(): URL {\n const protocol = process.env.__NEXT_EXPERIMENTAL_HTTPS ? \"https\" : \"http\";\n return new URL(`${protocol}://localhost:${process.env.PORT || 3000}`);\n}\n\nfunction getPreviewDeploymentUrl(): URL | null {\n const origin = process.env.VERCEL_BRANCH_URL || process.env.VERCEL_URL;\n return origin ? new URL(`https://${origin}`) : null;\n}\n\nfunction getProductionDeploymentUrl(): URL | null {\n const origin = process.env.VERCEL_PROJECT_PRODUCTION_URL;\n return origin ? new URL(`https://${origin}`) : null;\n}\n\nfunction getSocialImageMetadataBaseFallback(metadataBase: URL | null | undefined): URL {\n const defaultMetadataBase = createLocalMetadataBase();\n const previewDeploymentUrl = getPreviewDeploymentUrl();\n const productionDeploymentUrl = getProductionDeploymentUrl();\n\n if (process.env.NODE_ENV === \"development\") {\n return defaultMetadataBase;\n }\n\n if (\n process.env.NODE_ENV === \"production\" &&\n process.env.VERCEL_ENV === \"preview\" &&\n previewDeploymentUrl\n ) {\n return previewDeploymentUrl;\n }\n\n return metadataBase || productionDeploymentUrl || defaultMetadataBase;\n}\n\nfunction trimSlashes(value: string): string {\n return value.replace(/^\\/+|\\/+$/g, \"\");\n}\n\nfunction joinMetadataPath(basePathname: string, pathname: string): string {\n if (!basePathname || basePathname === \"/\") {\n return pathname;\n }\n\n const base = trimSlashes(basePathname);\n const path = trimSlashes(pathname);\n return path ? `/${base}/${path}` : `/${base}`;\n}\n\nfunction resolveRelativeMetadataUrl(url: string, pathname: string): string {\n if (url === \".\" || url === \"./\") {\n return pathname || \"/\";\n }\n if (!url.startsWith(\"./\")) {\n return url;\n }\n\n const base = pathname === \"/\" ? \"\" : pathname.replace(/\\/+$/g, \"\");\n return `${base}/${url.slice(2)}`;\n}\n\nfunction formatResolvedMetadataUrl(url: URL): string {\n if (url.pathname === \"/\" && url.search === \"\" && url.hash === \"\") {\n return url.origin;\n }\n return url.href;\n}\n\nfunction resolveMetadataUrl(url: string | URL, metadataBase: URL | null | undefined): string {\n const value = stringifyUrl(url);\n if (isAbsoluteOrProtocolRelativeUrl(value) || !metadataBase) {\n return value;\n }\n\n try {\n return formatResolvedMetadataUrl(\n new URL(joinMetadataPath(metadataBase.pathname, value), metadataBase),\n );\n } catch {\n return value;\n }\n}\n\nfunction resolveCanonicalUrl(\n url: string | URL,\n metadataBase: URL | null | undefined,\n pathname: string,\n): string {\n if (url instanceof URL) {\n return resolveMetadataUrl(url, metadataBase);\n }\n return resolveMetadataUrl(resolveRelativeMetadataUrl(url, pathname), metadataBase);\n}\n\nfunction isSocialImageDescriptor(\n value: string | URL | SocialImageDescriptor,\n): value is SocialImageDescriptor {\n return typeof value === \"object\" && !(value instanceof URL);\n}\n\nfunction isMetadataRouteSocialImage(value: SocialImageDescriptor): boolean {\n return Reflect.get(value, \"metadataRoute\") === true;\n}\n\nfunction resolveSocialImageUrl(\n image: string | URL | SocialImageDescriptor,\n metadataBase: URL | null | undefined,\n): string {\n const imageUrl = isSocialImageDescriptor(image) ? image.url : image;\n const metadataRoute = isSocialImageDescriptor(image) && isMetadataRouteSocialImage(image);\n if (\n typeof imageUrl === \"string\" &&\n !isAbsoluteOrProtocolRelativeUrl(imageUrl) &&\n (!metadataBase || metadataRoute)\n ) {\n return resolveMetadataUrl(imageUrl, getSocialImageMetadataBaseFallback(metadataBase));\n }\n return resolveMetadataUrl(imageUrl, metadataBase);\n}\n\ntype MetadataHeadProps = {\n metadata: Metadata;\n pathname?: string;\n};\n\nfunction escapeHtmlText(value: string): string {\n return value.replaceAll(\"&\", \"&\").replaceAll(\"<\", \"<\").replaceAll(\">\", \">\");\n}\n\nfunction escapeHtmlAttribute(value: string): string {\n return escapeHtmlText(value).replaceAll('\"', \""\");\n}\n\nfunction renderMetadataText(node: unknown): string {\n if (node === null || node === undefined || typeof node === \"boolean\") return \"\";\n if (Array.isArray(node)) return node.map(renderMetadataText).join(\"\");\n if (typeof node === \"string\" || typeof node === \"number\" || typeof node === \"bigint\") {\n return escapeHtmlText(String(node));\n }\n return \"\";\n}\n\nfunction renderMetadataAttributes(props: object, names: readonly string[]): string {\n const attributes: string[] = [];\n for (const name of names) {\n const value = Reflect.get(props, name);\n if (value === null || value === undefined || typeof value === \"boolean\") continue;\n const htmlName = name === \"hrefLang\" ? \"hreflang\" : name;\n attributes.push(`${htmlName}=\"${escapeHtmlAttribute(String(value))}\"`);\n }\n return attributes.length > 0 ? ` ${attributes.join(\" \")}` : \"\";\n}\n\nfunction renderMetadataElementToHtml(node: unknown): string {\n if (node === null || node === undefined || typeof node === \"boolean\") return \"\";\n if (Array.isArray(node)) return node.map(renderMetadataElementToHtml).join(\"\");\n if (!React.isValidElement(node)) return renderMetadataText(node);\n\n const props = typeof node.props === \"object\" && node.props !== null ? node.props : {};\n if (node.type === React.Fragment) {\n return renderMetadataElementToHtml(Reflect.get(props, \"children\"));\n }\n if (typeof node.type !== \"string\") return \"\";\n\n switch (node.type) {\n case \"title\":\n return `<title>${renderMetadataText(Reflect.get(props, \"children\"))}</title>`;\n case \"meta\":\n return `<meta${renderMetadataAttributes(props, [\"name\", \"property\", \"content\"])}>`;\n case \"link\":\n return `<link${renderMetadataAttributes(props, [\n \"rel\",\n \"href\",\n \"hrefLang\",\n \"media\",\n \"type\",\n \"sizes\",\n ])}>`;\n default:\n return \"\";\n }\n}\n\nexport function renderMetadataToHtml(metadata: Metadata, pathname = \"/\"): string {\n return renderMetadataElementToHtml(MetadataHead({ metadata, pathname }));\n}\n\nexport function MetadataHead({ metadata, pathname = \"/\" }: MetadataHeadProps) {\n const elements: React.ReactElement[] = [];\n let key = 0;\n\n // Resolve metadataBase for URL composition\n const base = metadata.metadataBase;\n function resolveUrl(url: string | URL): string;\n function resolveUrl(url: string | URL | undefined): string | undefined;\n function resolveUrl(url: string | URL | undefined): string | undefined {\n if (!url) return undefined;\n return resolveMetadataUrl(url, base);\n }\n\n // Title\n const title =\n typeof metadata.title === \"string\"\n ? metadata.title\n : typeof metadata.title === \"object\"\n ? metadata.title.absolute || metadata.title.default\n : undefined;\n if (title) {\n elements.push(<title key={key++}>{title}</title>);\n }\n\n // Description\n if (metadata.description) {\n elements.push(<meta key={key++} name=\"description\" content={metadata.description} />);\n }\n\n // Generator\n if (metadata.generator) {\n elements.push(<meta key={key++} name=\"generator\" content={metadata.generator} />);\n }\n\n // Application name\n if (metadata.applicationName) {\n elements.push(<meta key={key++} name=\"application-name\" content={metadata.applicationName} />);\n }\n\n // Referrer\n if (metadata.referrer) {\n elements.push(<meta key={key++} name=\"referrer\" content={metadata.referrer} />);\n }\n\n // Keywords\n if (metadata.keywords) {\n const kw = Array.isArray(metadata.keywords) ? metadata.keywords.join(\",\") : metadata.keywords;\n elements.push(<meta key={key++} name=\"keywords\" content={kw} />);\n }\n\n // Authors\n if (metadata.authors) {\n const authorList = Array.isArray(metadata.authors) ? metadata.authors : [metadata.authors];\n for (const author of authorList) {\n if (author.name) {\n elements.push(<meta key={key++} name=\"author\" content={author.name} />);\n }\n if (author.url) {\n elements.push(<link key={key++} rel=\"author\" href={author.url} />);\n }\n }\n }\n\n // Creator\n if (metadata.creator) {\n elements.push(<meta key={key++} name=\"creator\" content={metadata.creator} />);\n }\n\n // Publisher\n if (metadata.publisher) {\n elements.push(<meta key={key++} name=\"publisher\" content={metadata.publisher} />);\n }\n\n // Format detection\n if (metadata.formatDetection) {\n const parts: string[] = [];\n if (metadata.formatDetection.telephone === false) parts.push(\"telephone=no\");\n if (metadata.formatDetection.address === false) parts.push(\"address=no\");\n if (metadata.formatDetection.email === false) parts.push(\"email=no\");\n if (parts.length > 0) {\n elements.push(<meta key={key++} name=\"format-detection\" content={parts.join(\", \")} />);\n }\n }\n\n // Category\n if (metadata.category) {\n elements.push(<meta key={key++} name=\"category\" content={metadata.category} />);\n }\n\n // Robots\n if (metadata.robots) {\n if (typeof metadata.robots === \"string\") {\n elements.push(<meta key={key++} name=\"robots\" content={metadata.robots} />);\n } else {\n const { googleBot, ...robotsRest } = metadata.robots;\n const robotParts: string[] = [];\n for (const [k, v] of Object.entries(robotsRest)) {\n if (v === true) robotParts.push(k);\n else if (v === false) robotParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") robotParts.push(`${k}:${v}`);\n }\n if (robotParts.length > 0) {\n elements.push(<meta key={key++} name=\"robots\" content={robotParts.join(\", \")} />);\n }\n // googlebot\n if (googleBot) {\n if (typeof googleBot === \"string\") {\n elements.push(<meta key={key++} name=\"googlebot\" content={googleBot} />);\n } else {\n const gbParts: string[] = [];\n for (const [k, v] of Object.entries(googleBot)) {\n if (v === true) gbParts.push(k);\n else if (v === false) gbParts.push(`no${k}`);\n else if (typeof v === \"string\" || typeof v === \"number\") gbParts.push(`${k}:${v}`);\n }\n if (gbParts.length > 0) {\n elements.push(<meta key={key++} name=\"googlebot\" content={gbParts.join(\", \")} />);\n }\n }\n }\n }\n }\n\n // Open Graph\n if (metadata.openGraph) {\n const og = metadata.openGraph;\n if (og.title) elements.push(<meta key={key++} property=\"og:title\" content={og.title} />);\n if (og.description)\n elements.push(<meta key={key++} property=\"og:description\" content={og.description} />);\n if (og.url) elements.push(<meta key={key++} property=\"og:url\" content={resolveUrl(og.url)} />);\n if (og.siteName)\n elements.push(<meta key={key++} property=\"og:site_name\" content={og.siteName} />);\n if (og.type) elements.push(<meta key={key++} property=\"og:type\" content={og.type} />);\n if (og.locale) elements.push(<meta key={key++} property=\"og:locale\" content={og.locale} />);\n if (og.publishedTime)\n elements.push(\n <meta key={key++} property=\"article:published_time\" content={og.publishedTime} />,\n );\n if (og.modifiedTime)\n elements.push(\n <meta key={key++} property=\"article:modified_time\" content={og.modifiedTime} />,\n );\n if (og.authors) {\n for (const author of og.authors) {\n elements.push(<meta key={key++} property=\"article:author\" content={author} />);\n }\n }\n if (og.images) {\n const imgList =\n typeof og.images === \"string\" || og.images instanceof URL\n ? [{ url: og.images }]\n : Array.isArray(og.images)\n ? og.images\n : [og.images];\n for (const img of imgList) {\n elements.push(\n <meta key={key++} property=\"og:image\" content={resolveSocialImageUrl(img, base)} />,\n );\n if (typeof img !== \"string\" && !(img instanceof URL)) {\n if (img.width)\n elements.push(\n <meta key={key++} property=\"og:image:width\" content={String(img.width)} />,\n );\n if (img.height)\n elements.push(\n <meta key={key++} property=\"og:image:height\" content={String(img.height)} />,\n );\n if (img.type)\n elements.push(<meta key={key++} property=\"og:image:type\" content={img.type} />);\n if (img.alt)\n elements.push(<meta key={key++} property=\"og:image:alt\" content={img.alt} />);\n }\n }\n }\n if (og.videos) {\n for (const video of og.videos) {\n elements.push(<meta key={key++} property=\"og:video\" content={resolveUrl(video.url)} />);\n if (video.width)\n elements.push(\n <meta key={key++} property=\"og:video:width\" content={String(video.width)} />,\n );\n if (video.height)\n elements.push(\n <meta key={key++} property=\"og:video:height\" content={String(video.height)} />,\n );\n }\n }\n if (og.audio) {\n for (const audio of og.audio) {\n elements.push(<meta key={key++} property=\"og:audio\" content={resolveUrl(audio.url)} />);\n }\n }\n }\n\n // Twitter\n if (metadata.twitter) {\n const tw = metadata.twitter;\n if (tw.card) elements.push(<meta key={key++} name=\"twitter:card\" content={tw.card} />);\n if (tw.site) elements.push(<meta key={key++} name=\"twitter:site\" content={tw.site} />);\n if (tw.siteId) elements.push(<meta key={key++} name=\"twitter:site:id\" content={tw.siteId} />);\n if (tw.title) elements.push(<meta key={key++} name=\"twitter:title\" content={tw.title} />);\n if (tw.description)\n elements.push(<meta key={key++} name=\"twitter:description\" content={tw.description} />);\n if (tw.creator) elements.push(<meta key={key++} name=\"twitter:creator\" content={tw.creator} />);\n if (tw.creatorId)\n elements.push(<meta key={key++} name=\"twitter:creator:id\" content={tw.creatorId} />);\n if (tw.images) {\n const imgList =\n typeof tw.images === \"string\" || tw.images instanceof URL\n ? [tw.images]\n : Array.isArray(tw.images)\n ? tw.images\n : [tw.images];\n for (const img of imgList) {\n elements.push(\n <meta key={key++} name=\"twitter:image\" content={resolveSocialImageUrl(img, base)} />,\n );\n if (typeof img !== \"string\" && !(img instanceof URL)) {\n if (img.type) {\n elements.push(<meta key={key++} name=\"twitter:image:type\" content={img.type} />);\n }\n if (img.width) {\n elements.push(\n <meta key={key++} name=\"twitter:image:width\" content={String(img.width)} />,\n );\n }\n if (img.height) {\n elements.push(\n <meta key={key++} name=\"twitter:image:height\" content={String(img.height)} />,\n );\n }\n if (img.alt) {\n elements.push(<meta key={key++} name=\"twitter:image:alt\" content={img.alt} />);\n }\n }\n }\n }\n // Twitter player cards\n if (tw.players) {\n const players = Array.isArray(tw.players) ? tw.players : [tw.players];\n for (const player of players) {\n const playerUrl = player.playerUrl.toString();\n const streamUrl = player.streamUrl.toString();\n elements.push(<meta key={key++} name=\"twitter:player\" content={resolveUrl(playerUrl)} />);\n elements.push(\n <meta key={key++} name=\"twitter:player:stream\" content={resolveUrl(streamUrl)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:width\" content={String(player.width)} />,\n );\n elements.push(\n <meta key={key++} name=\"twitter:player:height\" content={String(player.height)} />,\n );\n }\n }\n // Twitter app cards\n if (tw.app) {\n const { app } = tw;\n for (const platform of [\"iphone\", \"ipad\", \"googleplay\"] as const) {\n if (app.name) {\n elements.push(\n <meta key={key++} name={`twitter:app:name:${platform}`} content={app.name} />,\n );\n }\n if (app.id[platform] !== undefined) {\n elements.push(\n <meta\n key={key++}\n name={`twitter:app:id:${platform}`}\n content={String(app.id[platform])}\n />,\n );\n }\n if (app.url?.[platform] !== undefined) {\n const appUrl = app.url[platform]!.toString();\n elements.push(\n <meta key={key++} name={`twitter:app:url:${platform}`} content={resolveUrl(appUrl)} />,\n );\n }\n }\n }\n }\n\n // Icons\n if (metadata.icons) {\n const iconEntries = isIconsMap(metadata.icons)\n ? normalizeUrlDescriptorEntries(metadata.icons.icon, (url): IconDescriptor => ({ url }))\n : normalizeUrlDescriptorEntries(metadata.icons, (url): IconDescriptor => ({ url }));\n\n // Shortcut icon\n if (isIconsMap(metadata.icons) && metadata.icons.shortcut) {\n const shortcuts = Array.isArray(metadata.icons.shortcut)\n ? metadata.icons.shortcut\n : [metadata.icons.shortcut];\n for (const s of shortcuts) {\n elements.push(<link key={key++} rel=\"shortcut icon\" href={stringifyUrl(s)} />);\n }\n }\n // Icon\n if (iconEntries.length > 0) {\n for (const i of iconEntries) {\n elements.push(\n <link\n key={key++}\n rel=\"icon\"\n href={stringifyUrl(i.url)}\n {...(i.sizes ? { sizes: i.sizes } : {})}\n {...(i.type ? { type: i.type } : {})}\n {...(i.media ? { media: i.media } : {})}\n />,\n );\n }\n }\n // Apple touch icon\n if (isIconsMap(metadata.icons) && metadata.icons.apple) {\n for (const a of normalizeUrlDescriptorEntries(\n metadata.icons.apple,\n (url): AppleIconDescriptor => ({ url }),\n )) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-icon\"\n href={stringifyUrl(a.url)}\n {...(a.sizes ? { sizes: a.sizes } : {})}\n {...(a.type ? { type: a.type } : {})}\n />,\n );\n }\n }\n // Other custom icon relations. Next.js accepts a single descriptor or an\n // array; normalize before iterating.\n if (isIconsMap(metadata.icons) && metadata.icons.other) {\n const others = Array.isArray(metadata.icons.other)\n ? metadata.icons.other\n : [metadata.icons.other];\n for (const o of others) {\n elements.push(\n <link\n key={key++}\n rel={o.rel}\n href={stringifyUrl(o.url)}\n {...(o.sizes ? { sizes: o.sizes } : {})}\n {...(o.type ? { type: o.type } : {})}\n />,\n );\n }\n }\n }\n\n // Manifest\n if (metadata.manifest) {\n elements.push(<link key={key++} rel=\"manifest\" href={stringifyUrl(metadata.manifest)} />);\n }\n\n // Alternates\n if (metadata.alternates) {\n const alt = metadata.alternates;\n if (alt.canonical) {\n elements.push(\n <link\n key={key++}\n rel=\"canonical\"\n href={resolveCanonicalUrl(alt.canonical, base, pathname)}\n />,\n );\n }\n if (alt.languages) {\n for (const [lang, href] of Object.entries(alt.languages)) {\n elements.push(<link key={key++} rel=\"alternate\" hrefLang={lang} href={resolveUrl(href)} />);\n }\n }\n if (alt.media) {\n for (const [media, href] of Object.entries(alt.media)) {\n elements.push(<link key={key++} rel=\"alternate\" media={media} href={resolveUrl(href)} />);\n }\n }\n if (alt.types) {\n for (const [type, href] of Object.entries(alt.types)) {\n elements.push(<link key={key++} rel=\"alternate\" type={type} href={resolveUrl(href)} />);\n }\n }\n }\n\n // Verification\n if (metadata.verification) {\n const v = metadata.verification;\n if (v.google)\n elements.push(<meta key={key++} name=\"google-site-verification\" content={v.google} />);\n if (v.yahoo) elements.push(<meta key={key++} name=\"y_key\" content={v.yahoo} />);\n if (v.yandex) elements.push(<meta key={key++} name=\"yandex-verification\" content={v.yandex} />);\n if (v.other) {\n for (const [name, content] of Object.entries(v.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n }\n\n // Apple Web App\n if (metadata.appleWebApp) {\n const awa = metadata.appleWebApp;\n if (awa.capable !== false) {\n elements.push(<meta key={key++} name=\"mobile-web-app-capable\" content=\"yes\" />);\n }\n if (awa.title) {\n elements.push(<meta key={key++} name=\"apple-mobile-web-app-title\" content={awa.title} />);\n }\n if (awa.statusBarStyle) {\n elements.push(\n <meta\n key={key++}\n name=\"apple-mobile-web-app-status-bar-style\"\n content={awa.statusBarStyle}\n />,\n );\n }\n if (awa.startupImage) {\n const imgs =\n typeof awa.startupImage === \"string\" ? [{ url: awa.startupImage }] : awa.startupImage;\n for (const img of imgs) {\n elements.push(\n <link\n key={key++}\n rel=\"apple-touch-startup-image\"\n href={resolveUrl(img.url)}\n {...(img.media ? { media: img.media } : {})}\n />,\n );\n }\n }\n }\n\n // iTunes\n if (metadata.itunes) {\n const { appId, appArgument } = metadata.itunes;\n let content = `app-id=${appId}`;\n if (appArgument) {\n content += `, app-argument=${appArgument}`;\n }\n elements.push(<meta key={key++} name=\"apple-itunes-app\" content={content} />);\n }\n\n // App Links\n if (metadata.appLinks) {\n const al = metadata.appLinks;\n const platforms = [\n \"ios\",\n \"iphone\",\n \"ipad\",\n \"android\",\n \"windows_phone\",\n \"windows\",\n \"windows_universal\",\n \"web\",\n ] as const;\n for (const platform of platforms) {\n const entries = al[platform];\n if (!entries) continue;\n const list = Array.isArray(entries) ? entries : [entries];\n for (const entry of list) {\n for (const [k, v] of Object.entries(entry)) {\n if (v === undefined || v === null) continue;\n const str = String(v);\n const content = k === \"url\" ? resolveUrl(str) : str;\n elements.push(<meta key={key++} property={`al:${platform}:${k}`} content={content} />);\n }\n }\n }\n }\n\n // Other custom meta tags\n if (metadata.other) {\n for (const [name, content] of Object.entries(metadata.other)) {\n const values = Array.isArray(content) ? content : [content];\n for (const val of values) {\n elements.push(<meta key={key++} name={name} content={val} />);\n }\n }\n }\n\n return <>{elements}</>;\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,eAAsB,sBACpB,KACA,QAC0B;CAC1B,IAAI,OAAO,IAAI,qBAAqB,YAAY;EAC9C,MAAM,cAAc,mBAAmB,OAAO;EAC9C,OAAO,MAAM,IAAI,iBAAiB,EAAE,QAAQ,aAAa,CAAC;;CAE5D,IAAI,IAAI,YAAY,OAAO,IAAI,aAAa,UAC1C,OAAO,IAAI;CAEb,OAAO;;;;;;AAOT,MAAa,mBAA6B;CACxC,OAAO;CACP,cAAc;CACf;AAED,SAAgB,cAAc,cAAoC;CAChE,MAAM,SAAmB,EAAE,GAAG,kBAAkB;CAChD,KAAK,MAAM,MAAM,cACf,OAAO,OAAO,QAAQ,GAAG;CAE3B,OAAO;;;;;AAMT,SAAgB,aAAa,EAAE,YAAoC;CACjE,MAAM,WAAiC,EAAE;CACzC,IAAI,MAAM;CAGV,MAAM,QAAkB,EAAE;CAC1B,IAAI,SAAS,UAAU,KAAA,GAAW,MAAM,KAAK,SAAS,SAAS,QAAQ;CACvE,IAAI,SAAS,WAAW,KAAA,GAAW,MAAM,KAAK,UAAU,SAAS,SAAS;CAC1E,IAAI,SAAS,iBAAiB,KAAA,GAAW,MAAM,KAAK,iBAAiB,SAAS,eAAe;CAC7F,IAAI,SAAS,iBAAiB,KAAA,GAAW,MAAM,KAAK,iBAAiB,SAAS,eAAe;CAC7F,IAAI,SAAS,iBAAiB,KAAA,GAAW,MAAM,KAAK,iBAAiB,SAAS,eAAe;CAC7F,IAAI,SAAS,iBAAiB,KAAA,GAC5B,MAA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M,YAAY;GATrB;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GAE8B,EAAE;GAChC,MAAM,UAAU,GAAG;GACnB,IAAI,CAAC,SAAS;GACd,MAAM,OAAO,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ;GACzD,KAAK,MAAM,SAAS,MAClB,KAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,MAAM,EAAE;IAC1C,IAAI,MAAM,KAAA,KAAa,MAAM,MAAM;IACnC,MAAM,MAAM,OAAO,EAAE;IACrB,MAAM,UAAU,MAAM,QAAQ,WAAW,IAAI,GAAG;IAChD,SAAS,KAAK,oBAAC,QAAD;KAAkB,UAAU,MAAM,SAAS,GAAG;KAAc;KAAW,EAA5D,MAA4D,CAAC;;;;CAO9F,IAAI,SAAS,OACX,KAAK,MAAM,CAAC,MAAM,YAAY,OAAO,QAAQ,SAAS,MAAM,EAAE;EAC5D,MAAM,SAAS,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ;EAC3D,KAAK,MAAM,OAAO,QAChB,SAAS,KAAK,oBAAC,QAAD;GAAwB;GAAM,SAAS;GAAO,EAAnC,MAAmC,CAAC;;CAKnE,OAAO,oBAAA,YAAA,EAAA,UAAG,UAAY,CAAA"}
|
|
@@ -53,8 +53,7 @@ declare function setNavigationContext(ctx: NavigationContext | null): void;
|
|
|
53
53
|
declare const __basePath: string;
|
|
54
54
|
/** Maximum number of entries in the RSC prefetch cache. */
|
|
55
55
|
declare const MAX_PREFETCH_CACHE_SIZE = 50;
|
|
56
|
-
|
|
57
|
-
declare const PREFETCH_CACHE_TTL = 30000;
|
|
56
|
+
declare const PREFETCH_CACHE_TTL: number;
|
|
58
57
|
/** A buffered RSC response stored as an ArrayBuffer for replay. */
|
|
59
58
|
type CachedRscResponse = {
|
|
60
59
|
compatibilityIdHeader?: string | null;
|
package/dist/shims/navigation.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { stripBasePath } from "../utils/base-path.js";
|
|
2
2
|
import { VINEXT_MOUNTED_SLOTS_HEADER, VINEXT_PARAMS_HEADER } from "../server/headers.js";
|
|
3
3
|
import { assertSafeNavigationUrl } from "./url-safety.js";
|
|
4
|
-
import {
|
|
4
|
+
import { AppElementsWire } from "../server/app-elements-wire.js";
|
|
5
|
+
import "../server/app-elements.js";
|
|
6
|
+
import { isAbsoluteOrProtocolRelativeUrl, isHashOnlyBrowserUrlChange, toBrowserNavigationHref, toSameOriginAppPath, withBasePath } from "./url-utils.js";
|
|
5
7
|
import { scrollToHashTarget } from "./hash-scroll.js";
|
|
6
8
|
import { getNavigationRuntime, hasAppNavigationRuntime } from "../client/navigation-runtime.js";
|
|
7
9
|
import { notifyAppRouterTransitionStart } from "../client/instrumentation-client-state.js";
|
|
8
|
-
import { AppElementsWire } from "../server/app-elements-wire.js";
|
|
9
|
-
import "../server/app-elements.js";
|
|
10
10
|
import { resolveManifestNavigationInterceptionContext } from "../server/app-browser-interception-context.js";
|
|
11
11
|
import { createExternalHistoryStatePreservingMetadata } from "../server/app-history-state.js";
|
|
12
12
|
import { VINEXT_RSC_COMPATIBILITY_ID_HEADER, createRscRequestHeaders, createRscRequestUrl } from "../server/app-rsc-cache-busting.js";
|
|
13
13
|
import { ReadonlyURLSearchParams } from "./readonly-url-search-params.js";
|
|
14
14
|
import { AppRouterContext } from "./internal/app-router-context.js";
|
|
15
|
+
import { beginAppRouterScrollIntent, clearAppRouterScrollIntent, consumeAppRouterScrollIntent } from "./app-router-scroll-state.js";
|
|
15
16
|
import { UnrecognizedActionError, unstable_isUnrecognizedActionError } from "./unrecognized-action-error.js";
|
|
16
17
|
import * as React$1 from "react";
|
|
17
18
|
//#region src/shims/navigation.ts
|
|
@@ -139,8 +140,28 @@ const isServer = typeof window === "undefined";
|
|
|
139
140
|
const __basePath = process.env.__NEXT_ROUTER_BASEPATH ?? "";
|
|
140
141
|
/** Maximum number of entries in the RSC prefetch cache. */
|
|
141
142
|
const MAX_PREFETCH_CACHE_SIZE = 50;
|
|
142
|
-
/**
|
|
143
|
-
|
|
143
|
+
/**
|
|
144
|
+
* TTL for prefetch cache entries in ms.
|
|
145
|
+
*
|
|
146
|
+
* Mirrors Next.js' `STATIC_STALETIME_MS` derivation. The plugin injects
|
|
147
|
+
* `process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME` from
|
|
148
|
+
* `experimental.staleTimes.static` (in seconds) at build time; we convert
|
|
149
|
+
* to ms here.
|
|
150
|
+
*
|
|
151
|
+
* Falls back to vinext's historical default of 30s when the env var is
|
|
152
|
+
* absent (e.g. unit tests that import this module without going through
|
|
153
|
+
* the plugin's `define` pipeline). When the plugin is active and the user
|
|
154
|
+
* has not set `experimental.staleTimes`, Next.js' 300s default applies
|
|
155
|
+
* (see `resolveStaleTimes` in `config/next-config.ts`).
|
|
156
|
+
*/
|
|
157
|
+
function resolvePrefetchCacheTtl() {
|
|
158
|
+
const raw = process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME;
|
|
159
|
+
if (raw === void 0 || raw === "") return 3e4;
|
|
160
|
+
const seconds = Number(raw);
|
|
161
|
+
if (!Number.isFinite(seconds) || seconds < 0) return 3e4;
|
|
162
|
+
return seconds * 1e3;
|
|
163
|
+
}
|
|
164
|
+
const PREFETCH_CACHE_TTL = resolvePrefetchCacheTtl();
|
|
144
165
|
function getCurrentInterceptionContext() {
|
|
145
166
|
if (isServer) return null;
|
|
146
167
|
return stripBasePath(window.location.pathname, __basePath);
|
|
@@ -188,7 +209,7 @@ function evictPrefetchCacheIfNeeded() {
|
|
|
188
209
|
if (cache.size < 50) return;
|
|
189
210
|
const now = Date.now();
|
|
190
211
|
const prefetched = getPrefetchedUrls();
|
|
191
|
-
for (const [key, entry] of cache) if (now - entry.timestamp >=
|
|
212
|
+
for (const [key, entry] of cache) if (now - entry.timestamp >= PREFETCH_CACHE_TTL) deletePrefetchCacheEntry(cache, prefetched, key, entry, true);
|
|
192
213
|
while (cache.size >= 50) {
|
|
193
214
|
const oldest = cache.keys().next().value;
|
|
194
215
|
if (oldest !== void 0) {
|
|
@@ -393,7 +414,7 @@ function consumePrefetchResponse(rscUrl, interceptionContext = null, mountedSlot
|
|
|
393
414
|
deletePrefetchCacheEntry(cache, getPrefetchedUrls(), cacheKey, entry, false);
|
|
394
415
|
if (entry.snapshot) {
|
|
395
416
|
if ((entry.snapshot.mountedSlotsHeader ?? null) !== mountedSlotsHeader) return null;
|
|
396
|
-
if (Date.now() - entry.timestamp >=
|
|
417
|
+
if (Date.now() - entry.timestamp >= PREFETCH_CACHE_TTL) return null;
|
|
397
418
|
return entry.snapshot;
|
|
398
419
|
}
|
|
399
420
|
return null;
|
|
@@ -737,6 +758,14 @@ function commitHashOnlyHistoryState(href, mode, scroll) {
|
|
|
737
758
|
if (mode === "replace") replaceHistoryStateWithoutNotify(null, "", href);
|
|
738
759
|
else pushHistoryStateWithoutNotify(null, "", href);
|
|
739
760
|
}
|
|
761
|
+
function applyAppRouterScrollFallback(intent) {
|
|
762
|
+
if (typeof document === "undefined" || typeof window === "undefined") return;
|
|
763
|
+
if (intent.hash !== null) {
|
|
764
|
+
scrollToHashTarget(intent.hash);
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
document.documentElement.scrollTop = 0;
|
|
768
|
+
}
|
|
740
769
|
/**
|
|
741
770
|
* Restore scroll position from a history state object (used on popstate).
|
|
742
771
|
*
|
|
@@ -794,15 +823,40 @@ async function navigateClientSide(href, mode, scroll, programmaticTransition = f
|
|
|
794
823
|
}
|
|
795
824
|
const hashIdx = fullHref.indexOf("#");
|
|
796
825
|
const hash = hashIdx !== -1 ? fullHref.slice(hashIdx) : "";
|
|
826
|
+
const scrollIntent = scroll ? beginAppRouterScrollIntent(hash || null) : null;
|
|
827
|
+
if (!scroll) clearAppRouterScrollIntent();
|
|
797
828
|
const appNavigate = getNavigationRuntime()?.functions.navigate;
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
829
|
+
try {
|
|
830
|
+
if (appNavigate) await appNavigate(fullHref, 0, "navigate", mode, void 0, programmaticTransition, void 0, scrollIntent);
|
|
831
|
+
else {
|
|
832
|
+
if (mode === "replace") replaceHistoryStateWithoutNotify(null, "", fullHref);
|
|
833
|
+
else pushHistoryStateWithoutNotify(null, "", fullHref);
|
|
834
|
+
commitClientNavigationState();
|
|
835
|
+
}
|
|
836
|
+
} catch (error) {
|
|
837
|
+
if (scrollIntent) consumeAppRouterScrollIntent(scrollIntent);
|
|
838
|
+
throw error;
|
|
839
|
+
}
|
|
840
|
+
if (scrollIntent) {
|
|
841
|
+
const fallbackIntent = consumeAppRouterScrollIntent(scrollIntent);
|
|
842
|
+
if (fallbackIntent) applyAppRouterScrollFallback(fallbackIntent);
|
|
803
843
|
}
|
|
804
|
-
|
|
805
|
-
|
|
844
|
+
}
|
|
845
|
+
let scheduledAppRouterNavigationCount = 0;
|
|
846
|
+
function trackScheduledAppRouterNavigation() {
|
|
847
|
+
scheduledAppRouterNavigationCount += 1;
|
|
848
|
+
let released = false;
|
|
849
|
+
return () => {
|
|
850
|
+
if (released) return;
|
|
851
|
+
released = true;
|
|
852
|
+
scheduledAppRouterNavigationCount = Math.max(0, scheduledAppRouterNavigationCount - 1);
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
function hasScheduledAppRouterNavigation() {
|
|
856
|
+
return scheduledAppRouterNavigationCount > 0;
|
|
857
|
+
}
|
|
858
|
+
function releaseScheduledAppRouterNavigationAfterCurrentTask(release) {
|
|
859
|
+
queueMicrotask(release);
|
|
806
860
|
}
|
|
807
861
|
/**
|
|
808
862
|
* Public App Router instance, exposed for the browser entry so it can wire
|
|
@@ -816,16 +870,30 @@ const appRouterInstance = {
|
|
|
816
870
|
push(href, options) {
|
|
817
871
|
assertSafeNavigationUrl(href);
|
|
818
872
|
if (isServer) return;
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
873
|
+
const releaseNavigation = trackScheduledAppRouterNavigation();
|
|
874
|
+
try {
|
|
875
|
+
React$1.startTransition(() => {
|
|
876
|
+
navigateClientSide(href, "push", options?.scroll !== false, true);
|
|
877
|
+
});
|
|
878
|
+
} catch (error) {
|
|
879
|
+
releaseNavigation();
|
|
880
|
+
throw error;
|
|
881
|
+
}
|
|
882
|
+
releaseScheduledAppRouterNavigationAfterCurrentTask(releaseNavigation);
|
|
822
883
|
},
|
|
823
884
|
replace(href, options) {
|
|
824
885
|
assertSafeNavigationUrl(href);
|
|
825
886
|
if (isServer) return;
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
887
|
+
const releaseNavigation = trackScheduledAppRouterNavigation();
|
|
888
|
+
try {
|
|
889
|
+
React$1.startTransition(() => {
|
|
890
|
+
navigateClientSide(href, "replace", options?.scroll !== false, true);
|
|
891
|
+
});
|
|
892
|
+
} catch (error) {
|
|
893
|
+
releaseNavigation();
|
|
894
|
+
throw error;
|
|
895
|
+
}
|
|
896
|
+
releaseScheduledAppRouterNavigationAfterCurrentTask(releaseNavigation);
|
|
829
897
|
},
|
|
830
898
|
back() {
|
|
831
899
|
if (isServer) return;
|
|
@@ -838,6 +906,7 @@ const appRouterInstance = {
|
|
|
838
906
|
refresh() {
|
|
839
907
|
if (isServer) return;
|
|
840
908
|
getNavigationRuntime()?.functions.clearNavigationCaches?.();
|
|
909
|
+
if (hasScheduledAppRouterNavigation()) return;
|
|
841
910
|
const rscNavigate = getNavigationRuntime()?.functions.navigate;
|
|
842
911
|
if (rscNavigate) {
|
|
843
912
|
const navigate = () => {
|
|
@@ -849,6 +918,11 @@ const appRouterInstance = {
|
|
|
849
918
|
prefetch(href, options) {
|
|
850
919
|
assertSafeNavigationUrl(href);
|
|
851
920
|
if (isServer) return;
|
|
921
|
+
try {
|
|
922
|
+
new URL(withBasePath(href, __basePath), window.location.href);
|
|
923
|
+
} catch {
|
|
924
|
+
throw new Error(`Cannot prefetch '${href}' because it cannot be converted to a URL.`);
|
|
925
|
+
}
|
|
852
926
|
(async () => {
|
|
853
927
|
let prefetchHref = href;
|
|
854
928
|
if (isAbsoluteOrProtocolRelativeUrl(href)) {
|